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 #define __CR6_GT_REV 5
25 #define __CR6_SO_REV 7
27 /* Constants for vec_test_data_class */
28 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
29 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
30 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
31 __VEC_CLASS_FP_SUBNORMAL_N)
32 #define __VEC_CLASS_FP_ZERO_N (1<<2)
33 #define __VEC_CLASS_FP_ZERO_P (1<<3)
34 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
35 __VEC_CLASS_FP_ZERO_N)
36 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
37 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
38 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
39 __VEC_CLASS_FP_INFINITY_N)
40 #define __VEC_CLASS_FP_NAN (1<<6)
41 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
42 __VEC_CLASS_FP_SUBNORMAL | \
43 __VEC_CLASS_FP_ZERO | \
44 __VEC_CLASS_FP_INFINITY)
46 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
50 static __inline__ vector
signed char __ATTRS_o_ai
vec_perm(
51 vector
signed char __a
, vector
signed char __b
, vector
unsigned char __c
);
53 static __inline__ vector
unsigned char __ATTRS_o_ai
54 vec_perm(vector
unsigned char __a
, vector
unsigned char __b
,
55 vector
unsigned char __c
);
57 static __inline__ vector
bool char __ATTRS_o_ai
58 vec_perm(vector
bool char __a
, vector
bool char __b
, vector
unsigned char __c
);
60 static __inline__ vector
short __ATTRS_o_ai
vec_perm(vector
signed short __a
,
61 vector
signed short __b
,
62 vector
unsigned char __c
);
64 static __inline__ vector
unsigned short __ATTRS_o_ai
65 vec_perm(vector
unsigned short __a
, vector
unsigned short __b
,
66 vector
unsigned char __c
);
68 static __inline__ vector
bool short __ATTRS_o_ai
vec_perm(
69 vector
bool short __a
, vector
bool short __b
, vector
unsigned char __c
);
71 static __inline__ vector pixel __ATTRS_o_ai
vec_perm(vector pixel __a
,
73 vector
unsigned char __c
);
75 static __inline__ vector
int __ATTRS_o_ai
vec_perm(vector
signed int __a
,
76 vector
signed int __b
,
77 vector
unsigned char __c
);
79 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_perm(
80 vector
unsigned int __a
, vector
unsigned int __b
, vector
unsigned char __c
);
82 static __inline__ vector
bool int __ATTRS_o_ai
83 vec_perm(vector
bool int __a
, vector
bool int __b
, vector
unsigned char __c
);
85 static __inline__ vector
float __ATTRS_o_ai
vec_perm(vector
float __a
,
87 vector
unsigned char __c
);
90 static __inline__ vector
long long __ATTRS_o_ai
91 vec_perm(vector
signed long long __a
, vector
signed long long __b
,
92 vector
unsigned char __c
);
94 static __inline__ vector
unsigned long long __ATTRS_o_ai
95 vec_perm(vector
unsigned long long __a
, vector
unsigned long long __b
,
96 vector
unsigned char __c
);
98 static __inline__ vector
bool long long __ATTRS_o_ai
99 vec_perm(vector
bool long long __a
, vector
bool long long __b
,
100 vector
unsigned char __c
);
102 static __inline__ vector
double __ATTRS_o_ai
vec_perm(vector
double __a
,
104 vector
unsigned char __c
);
107 static __inline__ vector
unsigned char __ATTRS_o_ai
108 vec_xor(vector
unsigned char __a
, vector
unsigned char __b
);
112 #define __builtin_altivec_abs_v16qi vec_abs
113 #define __builtin_altivec_abs_v8hi vec_abs
114 #define __builtin_altivec_abs_v4si vec_abs
116 static __inline__ vector
signed char __ATTRS_o_ai
117 vec_abs(vector
signed char __a
) {
118 return __builtin_altivec_vmaxsb(__a
, -__a
);
121 static __inline__ vector
signed short __ATTRS_o_ai
122 vec_abs(vector
signed short __a
) {
123 return __builtin_altivec_vmaxsh(__a
, -__a
);
126 static __inline__ vector
signed int __ATTRS_o_ai
127 vec_abs(vector
signed int __a
) {
128 return __builtin_altivec_vmaxsw(__a
, -__a
);
131 #ifdef __POWER8_VECTOR__
132 static __inline__ vector
signed long long __ATTRS_o_ai
133 vec_abs(vector
signed long long __a
) {
134 return __builtin_altivec_vmaxsd(__a
, -__a
);
138 static __inline__ vector
float __ATTRS_o_ai
vec_abs(vector
float __a
) {
140 return __builtin_vsx_xvabssp(__a
);
142 vector
unsigned int __res
=
143 (vector
unsigned int)__a
& (vector
unsigned int)(0x7FFFFFFF);
144 return (vector
float)__res
;
149 static __inline__ vector
double __ATTRS_o_ai
vec_abs(vector
double __a
) {
150 return __builtin_vsx_xvabsdp(__a
);
155 #define __builtin_altivec_abss_v16qi vec_abss
156 #define __builtin_altivec_abss_v8hi vec_abss
157 #define __builtin_altivec_abss_v4si vec_abss
159 static __inline__ vector
signed char __ATTRS_o_ai
160 vec_abss(vector
signed char __a
) {
161 return __builtin_altivec_vmaxsb(
162 __a
, __builtin_altivec_vsubsbs((vector
signed char)(0), __a
));
165 static __inline__ vector
signed short __ATTRS_o_ai
166 vec_abss(vector
signed short __a
) {
167 return __builtin_altivec_vmaxsh(
168 __a
, __builtin_altivec_vsubshs((vector
signed short)(0), __a
));
171 static __inline__ vector
signed int __ATTRS_o_ai
172 vec_abss(vector
signed int __a
) {
173 return __builtin_altivec_vmaxsw(
174 __a
, __builtin_altivec_vsubsws((vector
signed int)(0), __a
));
178 #if defined(__POWER9_VECTOR__)
180 static __inline__ vector
unsigned char __ATTRS_o_ai
181 vec_absd(vector
unsigned char __a
, vector
unsigned char __b
) {
182 return __builtin_altivec_vabsdub(__a
, __b
);
185 static __inline__ vector
unsigned short __ATTRS_o_ai
186 vec_absd(vector
unsigned short __a
, vector
unsigned short __b
) {
187 return __builtin_altivec_vabsduh(__a
, __b
);
190 static __inline__ vector
unsigned int __ATTRS_o_ai
191 vec_absd(vector
unsigned int __a
, vector
unsigned int __b
) {
192 return __builtin_altivec_vabsduw(__a
, __b
);
195 #endif /* End __POWER9_VECTOR__ */
199 static __inline__ vector
signed char __ATTRS_o_ai
200 vec_add(vector
signed char __a
, vector
signed char __b
) {
204 static __inline__ vector
signed char __ATTRS_o_ai
205 vec_add(vector
bool char __a
, vector
signed char __b
) {
206 return (vector
signed char)__a
+ __b
;
209 static __inline__ vector
signed char __ATTRS_o_ai
210 vec_add(vector
signed char __a
, vector
bool char __b
) {
211 return __a
+ (vector
signed char)__b
;
214 static __inline__ vector
unsigned char __ATTRS_o_ai
215 vec_add(vector
unsigned char __a
, vector
unsigned char __b
) {
219 static __inline__ vector
unsigned char __ATTRS_o_ai
220 vec_add(vector
bool char __a
, vector
unsigned char __b
) {
221 return (vector
unsigned char)__a
+ __b
;
224 static __inline__ vector
unsigned char __ATTRS_o_ai
225 vec_add(vector
unsigned char __a
, vector
bool char __b
) {
226 return __a
+ (vector
unsigned char)__b
;
229 static __inline__ vector
short __ATTRS_o_ai
vec_add(vector
short __a
,
234 static __inline__ vector
short __ATTRS_o_ai
vec_add(vector
bool short __a
,
236 return (vector
short)__a
+ __b
;
239 static __inline__ vector
short __ATTRS_o_ai
vec_add(vector
short __a
,
240 vector
bool short __b
) {
241 return __a
+ (vector
short)__b
;
244 static __inline__ vector
unsigned short __ATTRS_o_ai
245 vec_add(vector
unsigned short __a
, vector
unsigned short __b
) {
249 static __inline__ vector
unsigned short __ATTRS_o_ai
250 vec_add(vector
bool short __a
, vector
unsigned short __b
) {
251 return (vector
unsigned short)__a
+ __b
;
254 static __inline__ vector
unsigned short __ATTRS_o_ai
255 vec_add(vector
unsigned short __a
, vector
bool short __b
) {
256 return __a
+ (vector
unsigned short)__b
;
259 static __inline__ vector
int __ATTRS_o_ai
vec_add(vector
int __a
,
264 static __inline__ vector
int __ATTRS_o_ai
vec_add(vector
bool int __a
,
266 return (vector
int)__a
+ __b
;
269 static __inline__ vector
int __ATTRS_o_ai
vec_add(vector
int __a
,
270 vector
bool int __b
) {
271 return __a
+ (vector
int)__b
;
274 static __inline__ vector
unsigned int __ATTRS_o_ai
275 vec_add(vector
unsigned int __a
, vector
unsigned int __b
) {
279 static __inline__ vector
unsigned int __ATTRS_o_ai
280 vec_add(vector
bool int __a
, vector
unsigned int __b
) {
281 return (vector
unsigned int)__a
+ __b
;
284 static __inline__ vector
unsigned int __ATTRS_o_ai
285 vec_add(vector
unsigned int __a
, vector
bool int __b
) {
286 return __a
+ (vector
unsigned int)__b
;
289 #ifdef __POWER8_VECTOR__
290 static __inline__ vector
signed long long __ATTRS_o_ai
291 vec_add(vector
signed long long __a
, vector
signed long long __b
) {
295 static __inline__ vector
unsigned long long __ATTRS_o_ai
296 vec_add(vector
unsigned long long __a
, vector
unsigned long long __b
) {
300 #ifdef __SIZEOF_INT128__
301 static __inline__ vector
signed __int128 __ATTRS_o_ai
302 vec_add(vector
signed __int128 __a
, vector
signed __int128 __b
) {
306 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
307 vec_add(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
312 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
313 vec_add_u128(vector
unsigned char __a
, vector
unsigned char __b
) {
314 return (vector
unsigned char)__builtin_altivec_vadduqm(__a
, __b
);
316 #elif defined(__VSX__)
317 static __inline__ vector
signed long long __ATTRS_o_ai
318 vec_add(vector
signed long long __a
, vector
signed long long __b
) {
319 #ifdef __LITTLE_ENDIAN__
320 // Little endian systems on CPU's prior to Power8 don't really exist
321 // so scalarizing is fine.
324 vector
unsigned int __res
=
325 (vector
unsigned int)__a
+ (vector
unsigned int)__b
;
326 vector
unsigned int __carry
= __builtin_altivec_vaddcuw(
327 (vector
unsigned int)__a
, (vector
unsigned int)__b
);
328 __carry
= (vector
unsigned int)__builtin_shufflevector(
329 (vector
unsigned char)__carry
, (vector
unsigned char)__carry
, 0, 0, 0, 7,
330 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0);
331 return (vector
signed long long)(__res
+ __carry
);
335 static __inline__ vector
unsigned long long __ATTRS_o_ai
336 vec_add(vector
unsigned long long __a
, vector
unsigned long long __b
) {
337 return (vector
unsigned long long)vec_add((vector
signed long long)__a
,
338 (vector
signed long long)__b
);
340 #endif // __POWER8_VECTOR__
342 static __inline__ vector
float __ATTRS_o_ai
vec_add(vector
float __a
,
348 static __inline__ vector
double __ATTRS_o_ai
vec_add(vector
double __a
,
356 #ifdef __POWER8_VECTOR__
357 #ifdef __SIZEOF_INT128__
358 static __inline__ vector
signed __int128 __ATTRS_o_ai
359 vec_adde(vector
signed __int128 __a
, vector
signed __int128 __b
,
360 vector
signed __int128 __c
) {
361 return (vector
signed __int128
)__builtin_altivec_vaddeuqm(
362 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
363 (vector
unsigned __int128
)__c
);
366 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
367 vec_adde(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
368 vector
unsigned __int128 __c
) {
369 return __builtin_altivec_vaddeuqm(__a
, __b
, __c
);
373 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
374 vec_adde_u128(vector
unsigned char __a
, vector
unsigned char __b
,
375 vector
unsigned char __c
) {
376 return (vector
unsigned char)__builtin_altivec_vaddeuqm_c(
377 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
378 (vector
unsigned char)__c
);
382 static __inline__ vector
signed int __ATTRS_o_ai
383 vec_adde(vector
signed int __a
, vector
signed int __b
,
384 vector
signed int __c
) {
385 vector
signed int __mask
= {1, 1, 1, 1};
386 vector
signed int __carry
= __c
& __mask
;
387 return vec_add(vec_add(__a
, __b
), __carry
);
390 static __inline__ vector
unsigned int __ATTRS_o_ai
391 vec_adde(vector
unsigned int __a
, vector
unsigned int __b
,
392 vector
unsigned int __c
) {
393 vector
unsigned int __mask
= {1, 1, 1, 1};
394 vector
unsigned int __carry
= __c
& __mask
;
395 return vec_add(vec_add(__a
, __b
), __carry
);
400 #ifdef __POWER8_VECTOR__
401 #ifdef __SIZEOF_INT128__
402 static __inline__ vector
signed __int128 __ATTRS_o_ai
403 vec_addec(vector
signed __int128 __a
, vector
signed __int128 __b
,
404 vector
signed __int128 __c
) {
405 return (vector
signed __int128
)__builtin_altivec_vaddecuq(
406 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
407 (vector
unsigned __int128
)__c
);
410 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
411 vec_addec(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
412 vector
unsigned __int128 __c
) {
413 return __builtin_altivec_vaddecuq(__a
, __b
, __c
);
417 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
418 vec_addec_u128(vector
unsigned char __a
, vector
unsigned char __b
,
419 vector
unsigned char __c
) {
420 return (vector
unsigned char)__builtin_altivec_vaddecuq_c(
421 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
422 (vector
unsigned char)__c
);
426 static __inline__ vector
signed int __ATTRS_o_ai
427 vec_addec(vector
signed int __a
, vector
signed int __b
,
428 vector
signed int __c
) {
430 signed int __result
[4];
431 for (int i
= 0; i
< 4; i
++) {
432 unsigned int __tempa
= (unsigned int) __a
[i
];
433 unsigned int __tempb
= (unsigned int) __b
[i
];
434 unsigned int __tempc
= (unsigned int) __c
[i
];
435 __tempc
= __tempc
& 0x00000001;
436 unsigned long long __longa
= (unsigned long long) __tempa
;
437 unsigned long long __longb
= (unsigned long long) __tempb
;
438 unsigned long long __longc
= (unsigned long long) __tempc
;
439 unsigned long long __sum
= __longa
+ __longb
+ __longc
;
440 unsigned long long __res
= (__sum
>> 32) & 0x01;
441 unsigned long long __tempres
= (unsigned int) __res
;
442 __result
[i
] = (signed int) __tempres
;
445 vector
signed int ret
= { __result
[0], __result
[1], __result
[2], __result
[3] };
449 static __inline__ vector
unsigned int __ATTRS_o_ai
450 vec_addec(vector
unsigned int __a
, vector
unsigned int __b
,
451 vector
unsigned int __c
) {
453 unsigned int __result
[4];
454 for (int i
= 0; i
< 4; i
++) {
455 unsigned int __tempc
= __c
[i
] & 1;
456 unsigned long long __longa
= (unsigned long long) __a
[i
];
457 unsigned long long __longb
= (unsigned long long) __b
[i
];
458 unsigned long long __longc
= (unsigned long long) __tempc
;
459 unsigned long long __sum
= __longa
+ __longb
+ __longc
;
460 unsigned long long __res
= (__sum
>> 32) & 0x01;
461 unsigned long long __tempres
= (unsigned int) __res
;
462 __result
[i
] = (signed int) __tempres
;
465 vector
unsigned int ret
= { __result
[0], __result
[1], __result
[2], __result
[3] };
468 #endif // __powerpc64__
469 #endif // __POWER8_VECTOR__
473 #define __builtin_altivec_vaddubm vec_vaddubm
475 static __inline__ vector
signed char __ATTRS_o_ai
476 vec_vaddubm(vector
signed char __a
, vector
signed char __b
) {
480 static __inline__ vector
signed char __ATTRS_o_ai
481 vec_vaddubm(vector
bool char __a
, vector
signed char __b
) {
482 return (vector
signed char)__a
+ __b
;
485 static __inline__ vector
signed char __ATTRS_o_ai
486 vec_vaddubm(vector
signed char __a
, vector
bool char __b
) {
487 return __a
+ (vector
signed char)__b
;
490 static __inline__ vector
unsigned char __ATTRS_o_ai
491 vec_vaddubm(vector
unsigned char __a
, vector
unsigned char __b
) {
495 static __inline__ vector
unsigned char __ATTRS_o_ai
496 vec_vaddubm(vector
bool char __a
, vector
unsigned char __b
) {
497 return (vector
unsigned char)__a
+ __b
;
500 static __inline__ vector
unsigned char __ATTRS_o_ai
501 vec_vaddubm(vector
unsigned char __a
, vector
bool char __b
) {
502 return __a
+ (vector
unsigned char)__b
;
507 #define __builtin_altivec_vadduhm vec_vadduhm
509 static __inline__ vector
short __ATTRS_o_ai
vec_vadduhm(vector
short __a
,
514 static __inline__ vector
short __ATTRS_o_ai
vec_vadduhm(vector
bool short __a
,
516 return (vector
short)__a
+ __b
;
519 static __inline__ vector
short __ATTRS_o_ai
vec_vadduhm(vector
short __a
,
520 vector
bool short __b
) {
521 return __a
+ (vector
short)__b
;
524 static __inline__ vector
unsigned short __ATTRS_o_ai
525 vec_vadduhm(vector
unsigned short __a
, vector
unsigned short __b
) {
529 static __inline__ vector
unsigned short __ATTRS_o_ai
530 vec_vadduhm(vector
bool short __a
, vector
unsigned short __b
) {
531 return (vector
unsigned short)__a
+ __b
;
534 static __inline__ vector
unsigned short __ATTRS_o_ai
535 vec_vadduhm(vector
unsigned short __a
, vector
bool short __b
) {
536 return __a
+ (vector
unsigned short)__b
;
541 #define __builtin_altivec_vadduwm vec_vadduwm
543 static __inline__ vector
int __ATTRS_o_ai
vec_vadduwm(vector
int __a
,
548 static __inline__ vector
int __ATTRS_o_ai
vec_vadduwm(vector
bool int __a
,
550 return (vector
int)__a
+ __b
;
553 static __inline__ vector
int __ATTRS_o_ai
vec_vadduwm(vector
int __a
,
554 vector
bool int __b
) {
555 return __a
+ (vector
int)__b
;
558 static __inline__ vector
unsigned int __ATTRS_o_ai
559 vec_vadduwm(vector
unsigned int __a
, vector
unsigned int __b
) {
563 static __inline__ vector
unsigned int __ATTRS_o_ai
564 vec_vadduwm(vector
bool int __a
, vector
unsigned int __b
) {
565 return (vector
unsigned int)__a
+ __b
;
568 static __inline__ vector
unsigned int __ATTRS_o_ai
569 vec_vadduwm(vector
unsigned int __a
, vector
bool int __b
) {
570 return __a
+ (vector
unsigned int)__b
;
575 #define __builtin_altivec_vaddfp vec_vaddfp
577 static __inline__ vector
float __attribute__((__always_inline__
))
578 vec_vaddfp(vector
float __a
, vector
float __b
) {
584 static __inline__ vector
signed int __ATTRS_o_ai
585 vec_addc(vector
signed int __a
, vector
signed int __b
) {
586 return (vector
signed int)__builtin_altivec_vaddcuw((vector
unsigned int)__a
,
587 (vector
unsigned int)__b
);
590 static __inline__ vector
unsigned int __ATTRS_o_ai
591 vec_addc(vector
unsigned int __a
, vector
unsigned int __b
) {
592 return __builtin_altivec_vaddcuw(__a
, __b
);
595 #ifdef __POWER8_VECTOR__
596 #ifdef __SIZEOF_INT128__
597 static __inline__ vector
signed __int128 __ATTRS_o_ai
598 vec_addc(vector
signed __int128 __a
, vector
signed __int128 __b
) {
599 return (vector
signed __int128
)__builtin_altivec_vaddcuq(
600 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
603 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
604 vec_addc(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
605 return __builtin_altivec_vaddcuq(__a
, __b
);
609 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
610 vec_addc_u128(vector
unsigned char __a
, vector
unsigned char __b
) {
611 return (vector
unsigned char)__builtin_altivec_vaddcuq_c(
612 (vector
unsigned char)__a
, (vector
unsigned char)__b
);
614 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
618 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
619 vec_vaddcuw(vector
unsigned int __a
, vector
unsigned int __b
) {
620 return __builtin_altivec_vaddcuw(__a
, __b
);
625 static __inline__ vector
signed char __ATTRS_o_ai
626 vec_adds(vector
signed char __a
, vector
signed char __b
) {
627 return __builtin_altivec_vaddsbs(__a
, __b
);
630 static __inline__ vector
signed char __ATTRS_o_ai
631 vec_adds(vector
bool char __a
, vector
signed char __b
) {
632 return __builtin_altivec_vaddsbs((vector
signed char)__a
, __b
);
635 static __inline__ vector
signed char __ATTRS_o_ai
636 vec_adds(vector
signed char __a
, vector
bool char __b
) {
637 return __builtin_altivec_vaddsbs(__a
, (vector
signed char)__b
);
640 static __inline__ vector
unsigned char __ATTRS_o_ai
641 vec_adds(vector
unsigned char __a
, vector
unsigned char __b
) {
642 return __builtin_altivec_vaddubs(__a
, __b
);
645 static __inline__ vector
unsigned char __ATTRS_o_ai
646 vec_adds(vector
bool char __a
, vector
unsigned char __b
) {
647 return __builtin_altivec_vaddubs((vector
unsigned char)__a
, __b
);
650 static __inline__ vector
unsigned char __ATTRS_o_ai
651 vec_adds(vector
unsigned char __a
, vector
bool char __b
) {
652 return __builtin_altivec_vaddubs(__a
, (vector
unsigned char)__b
);
655 static __inline__ vector
short __ATTRS_o_ai
vec_adds(vector
short __a
,
657 return __builtin_altivec_vaddshs(__a
, __b
);
660 static __inline__ vector
short __ATTRS_o_ai
vec_adds(vector
bool short __a
,
662 return __builtin_altivec_vaddshs((vector
short)__a
, __b
);
665 static __inline__ vector
short __ATTRS_o_ai
vec_adds(vector
short __a
,
666 vector
bool short __b
) {
667 return __builtin_altivec_vaddshs(__a
, (vector
short)__b
);
670 static __inline__ vector
unsigned short __ATTRS_o_ai
671 vec_adds(vector
unsigned short __a
, vector
unsigned short __b
) {
672 return __builtin_altivec_vadduhs(__a
, __b
);
675 static __inline__ vector
unsigned short __ATTRS_o_ai
676 vec_adds(vector
bool short __a
, vector
unsigned short __b
) {
677 return __builtin_altivec_vadduhs((vector
unsigned short)__a
, __b
);
680 static __inline__ vector
unsigned short __ATTRS_o_ai
681 vec_adds(vector
unsigned short __a
, vector
bool short __b
) {
682 return __builtin_altivec_vadduhs(__a
, (vector
unsigned short)__b
);
685 static __inline__ vector
int __ATTRS_o_ai
vec_adds(vector
int __a
,
687 return __builtin_altivec_vaddsws(__a
, __b
);
690 static __inline__ vector
int __ATTRS_o_ai
vec_adds(vector
bool int __a
,
692 return __builtin_altivec_vaddsws((vector
int)__a
, __b
);
695 static __inline__ vector
int __ATTRS_o_ai
vec_adds(vector
int __a
,
696 vector
bool int __b
) {
697 return __builtin_altivec_vaddsws(__a
, (vector
int)__b
);
700 static __inline__ vector
unsigned int __ATTRS_o_ai
701 vec_adds(vector
unsigned int __a
, vector
unsigned int __b
) {
702 return __builtin_altivec_vadduws(__a
, __b
);
705 static __inline__ vector
unsigned int __ATTRS_o_ai
706 vec_adds(vector
bool int __a
, vector
unsigned int __b
) {
707 return __builtin_altivec_vadduws((vector
unsigned int)__a
, __b
);
710 static __inline__ vector
unsigned int __ATTRS_o_ai
711 vec_adds(vector
unsigned int __a
, vector
bool int __b
) {
712 return __builtin_altivec_vadduws(__a
, (vector
unsigned int)__b
);
717 static __inline__ vector
signed char __ATTRS_o_ai
718 vec_vaddsbs(vector
signed char __a
, vector
signed char __b
) {
719 return __builtin_altivec_vaddsbs(__a
, __b
);
722 static __inline__ vector
signed char __ATTRS_o_ai
723 vec_vaddsbs(vector
bool char __a
, vector
signed char __b
) {
724 return __builtin_altivec_vaddsbs((vector
signed char)__a
, __b
);
727 static __inline__ vector
signed char __ATTRS_o_ai
728 vec_vaddsbs(vector
signed char __a
, vector
bool char __b
) {
729 return __builtin_altivec_vaddsbs(__a
, (vector
signed char)__b
);
734 static __inline__ vector
unsigned char __ATTRS_o_ai
735 vec_vaddubs(vector
unsigned char __a
, vector
unsigned char __b
) {
736 return __builtin_altivec_vaddubs(__a
, __b
);
739 static __inline__ vector
unsigned char __ATTRS_o_ai
740 vec_vaddubs(vector
bool char __a
, vector
unsigned char __b
) {
741 return __builtin_altivec_vaddubs((vector
unsigned char)__a
, __b
);
744 static __inline__ vector
unsigned char __ATTRS_o_ai
745 vec_vaddubs(vector
unsigned char __a
, vector
bool char __b
) {
746 return __builtin_altivec_vaddubs(__a
, (vector
unsigned char)__b
);
751 static __inline__ vector
short __ATTRS_o_ai
vec_vaddshs(vector
short __a
,
753 return __builtin_altivec_vaddshs(__a
, __b
);
756 static __inline__ vector
short __ATTRS_o_ai
vec_vaddshs(vector
bool short __a
,
758 return __builtin_altivec_vaddshs((vector
short)__a
, __b
);
761 static __inline__ vector
short __ATTRS_o_ai
vec_vaddshs(vector
short __a
,
762 vector
bool short __b
) {
763 return __builtin_altivec_vaddshs(__a
, (vector
short)__b
);
768 static __inline__ vector
unsigned short __ATTRS_o_ai
769 vec_vadduhs(vector
unsigned short __a
, vector
unsigned short __b
) {
770 return __builtin_altivec_vadduhs(__a
, __b
);
773 static __inline__ vector
unsigned short __ATTRS_o_ai
774 vec_vadduhs(vector
bool short __a
, vector
unsigned short __b
) {
775 return __builtin_altivec_vadduhs((vector
unsigned short)__a
, __b
);
778 static __inline__ vector
unsigned short __ATTRS_o_ai
779 vec_vadduhs(vector
unsigned short __a
, vector
bool short __b
) {
780 return __builtin_altivec_vadduhs(__a
, (vector
unsigned short)__b
);
785 static __inline__ vector
int __ATTRS_o_ai
vec_vaddsws(vector
int __a
,
787 return __builtin_altivec_vaddsws(__a
, __b
);
790 static __inline__ vector
int __ATTRS_o_ai
vec_vaddsws(vector
bool int __a
,
792 return __builtin_altivec_vaddsws((vector
int)__a
, __b
);
795 static __inline__ vector
int __ATTRS_o_ai
vec_vaddsws(vector
int __a
,
796 vector
bool int __b
) {
797 return __builtin_altivec_vaddsws(__a
, (vector
int)__b
);
802 static __inline__ vector
unsigned int __ATTRS_o_ai
803 vec_vadduws(vector
unsigned int __a
, vector
unsigned int __b
) {
804 return __builtin_altivec_vadduws(__a
, __b
);
807 static __inline__ vector
unsigned int __ATTRS_o_ai
808 vec_vadduws(vector
bool int __a
, vector
unsigned int __b
) {
809 return __builtin_altivec_vadduws((vector
unsigned int)__a
, __b
);
812 static __inline__ vector
unsigned int __ATTRS_o_ai
813 vec_vadduws(vector
unsigned int __a
, vector
bool int __b
) {
814 return __builtin_altivec_vadduws(__a
, (vector
unsigned int)__b
);
817 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
818 defined(__SIZEOF_INT128__)
821 static __inline__ vector
signed __int128 __ATTRS_o_ai
822 vec_vadduqm(vector
signed __int128 __a
, vector
signed __int128 __b
) {
826 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
827 vec_vadduqm(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
833 static __inline__ vector
signed __int128 __ATTRS_o_ai
834 vec_vaddeuqm(vector
signed __int128 __a
, vector
signed __int128 __b
,
835 vector
signed __int128 __c
) {
836 return (vector
signed __int128
)__builtin_altivec_vaddeuqm(
837 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
838 (vector
unsigned __int128
)__c
);
841 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
842 vec_vaddeuqm(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
843 vector
unsigned __int128 __c
) {
844 return __builtin_altivec_vaddeuqm(__a
, __b
, __c
);
849 static __inline__ vector
signed __int128 __ATTRS_o_ai
850 vec_vaddcuq(vector
signed __int128 __a
, vector
signed __int128 __b
) {
851 return (vector
signed __int128
)__builtin_altivec_vaddcuq(
852 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
855 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
856 vec_vaddcuq(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
857 return __builtin_altivec_vaddcuq(__a
, __b
);
862 static __inline__ vector
signed __int128 __ATTRS_o_ai
863 vec_vaddecuq(vector
signed __int128 __a
, vector
signed __int128 __b
,
864 vector
signed __int128 __c
) {
865 return (vector
signed __int128
)__builtin_altivec_vaddecuq(
866 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
867 (vector
unsigned __int128
)__c
);
870 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
871 vec_vaddecuq(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
872 vector
unsigned __int128 __c
) {
873 return __builtin_altivec_vaddecuq(__a
, __b
, __c
);
875 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
879 #define __builtin_altivec_vand vec_and
881 static __inline__ vector
signed char __ATTRS_o_ai
882 vec_and(vector
signed char __a
, vector
signed char __b
) {
886 static __inline__ vector
signed char __ATTRS_o_ai
887 vec_and(vector
bool char __a
, vector
signed char __b
) {
888 return (vector
signed char)__a
& __b
;
891 static __inline__ vector
signed char __ATTRS_o_ai
892 vec_and(vector
signed char __a
, vector
bool char __b
) {
893 return __a
& (vector
signed char)__b
;
896 static __inline__ vector
unsigned char __ATTRS_o_ai
897 vec_and(vector
unsigned char __a
, vector
unsigned char __b
) {
901 static __inline__ vector
unsigned char __ATTRS_o_ai
902 vec_and(vector
bool char __a
, vector
unsigned char __b
) {
903 return (vector
unsigned char)__a
& __b
;
906 static __inline__ vector
unsigned char __ATTRS_o_ai
907 vec_and(vector
unsigned char __a
, vector
bool char __b
) {
908 return __a
& (vector
unsigned char)__b
;
911 static __inline__ vector
bool char __ATTRS_o_ai
vec_and(vector
bool char __a
,
912 vector
bool char __b
) {
916 static __inline__ vector
short __ATTRS_o_ai
vec_and(vector
short __a
,
921 static __inline__ vector
short __ATTRS_o_ai
vec_and(vector
bool short __a
,
923 return (vector
short)__a
& __b
;
926 static __inline__ vector
short __ATTRS_o_ai
vec_and(vector
short __a
,
927 vector
bool short __b
) {
928 return __a
& (vector
short)__b
;
931 static __inline__ vector
unsigned short __ATTRS_o_ai
932 vec_and(vector
unsigned short __a
, vector
unsigned short __b
) {
936 static __inline__ vector
unsigned short __ATTRS_o_ai
937 vec_and(vector
bool short __a
, vector
unsigned short __b
) {
938 return (vector
unsigned short)__a
& __b
;
941 static __inline__ vector
unsigned short __ATTRS_o_ai
942 vec_and(vector
unsigned short __a
, vector
bool short __b
) {
943 return __a
& (vector
unsigned short)__b
;
946 static __inline__ vector
bool short __ATTRS_o_ai
947 vec_and(vector
bool short __a
, vector
bool short __b
) {
951 static __inline__ vector
int __ATTRS_o_ai
vec_and(vector
int __a
,
956 static __inline__ vector
int __ATTRS_o_ai
vec_and(vector
bool int __a
,
958 return (vector
int)__a
& __b
;
961 static __inline__ vector
int __ATTRS_o_ai
vec_and(vector
int __a
,
962 vector
bool int __b
) {
963 return __a
& (vector
int)__b
;
966 static __inline__ vector
unsigned int __ATTRS_o_ai
967 vec_and(vector
unsigned int __a
, vector
unsigned int __b
) {
971 static __inline__ vector
unsigned int __ATTRS_o_ai
972 vec_and(vector
bool int __a
, vector
unsigned int __b
) {
973 return (vector
unsigned int)__a
& __b
;
976 static __inline__ vector
unsigned int __ATTRS_o_ai
977 vec_and(vector
unsigned int __a
, vector
bool int __b
) {
978 return __a
& (vector
unsigned int)__b
;
981 static __inline__ vector
bool int __ATTRS_o_ai
vec_and(vector
bool int __a
,
982 vector
bool int __b
) {
986 static __inline__ vector
float __ATTRS_o_ai
vec_and(vector
float __a
,
988 vector
unsigned int __res
=
989 (vector
unsigned int)__a
& (vector
unsigned int)__b
;
990 return (vector
float)__res
;
993 static __inline__ vector
float __ATTRS_o_ai
vec_and(vector
bool int __a
,
995 vector
unsigned int __res
=
996 (vector
unsigned int)__a
& (vector
unsigned int)__b
;
997 return (vector
float)__res
;
1000 static __inline__ vector
float __ATTRS_o_ai
vec_and(vector
float __a
,
1001 vector
bool int __b
) {
1002 vector
unsigned int __res
=
1003 (vector
unsigned int)__a
& (vector
unsigned int)__b
;
1004 return (vector
float)__res
;
1008 static __inline__ vector
double __ATTRS_o_ai
vec_and(vector
bool long long __a
,
1009 vector
double __b
) {
1010 vector
unsigned long long __res
=
1011 (vector
unsigned long long)__a
& (vector
unsigned long long)__b
;
1012 return (vector
double)__res
;
1015 static __inline__ vector
double __ATTRS_o_ai
1016 vec_and(vector
double __a
, vector
bool long long __b
) {
1017 vector
unsigned long long __res
=
1018 (vector
unsigned long long)__a
& (vector
unsigned long long)__b
;
1019 return (vector
double)__res
;
1022 static __inline__ vector
double __ATTRS_o_ai
vec_and(vector
double __a
,
1023 vector
double __b
) {
1024 vector
unsigned long long __res
=
1025 (vector
unsigned long long)__a
& (vector
unsigned long long)__b
;
1026 return (vector
double)__res
;
1029 static __inline__ vector
signed long long __ATTRS_o_ai
1030 vec_and(vector
signed long long __a
, vector
signed long long __b
) {
1034 static __inline__ vector
signed long long __ATTRS_o_ai
1035 vec_and(vector
bool long long __a
, vector
signed long long __b
) {
1036 return (vector
signed long long)__a
& __b
;
1039 static __inline__ vector
signed long long __ATTRS_o_ai
1040 vec_and(vector
signed long long __a
, vector
bool long long __b
) {
1041 return __a
& (vector
signed long long)__b
;
1044 static __inline__ vector
unsigned long long __ATTRS_o_ai
1045 vec_and(vector
unsigned long long __a
, vector
unsigned long long __b
) {
1049 static __inline__ vector
unsigned long long __ATTRS_o_ai
1050 vec_and(vector
bool long long __a
, vector
unsigned long long __b
) {
1051 return (vector
unsigned long long)__a
& __b
;
1054 static __inline__ vector
unsigned long long __ATTRS_o_ai
1055 vec_and(vector
unsigned long long __a
, vector
bool long long __b
) {
1056 return __a
& (vector
unsigned long long)__b
;
1059 static __inline__ vector
bool long long __ATTRS_o_ai
1060 vec_and(vector
bool long long __a
, vector
bool long long __b
) {
1067 static __inline__ vector
signed char __ATTRS_o_ai
1068 vec_vand(vector
signed char __a
, vector
signed char __b
) {
1072 static __inline__ vector
signed char __ATTRS_o_ai
1073 vec_vand(vector
bool char __a
, vector
signed char __b
) {
1074 return (vector
signed char)__a
& __b
;
1077 static __inline__ vector
signed char __ATTRS_o_ai
1078 vec_vand(vector
signed char __a
, vector
bool char __b
) {
1079 return __a
& (vector
signed char)__b
;
1082 static __inline__ vector
unsigned char __ATTRS_o_ai
1083 vec_vand(vector
unsigned char __a
, vector
unsigned char __b
) {
1087 static __inline__ vector
unsigned char __ATTRS_o_ai
1088 vec_vand(vector
bool char __a
, vector
unsigned char __b
) {
1089 return (vector
unsigned char)__a
& __b
;
1092 static __inline__ vector
unsigned char __ATTRS_o_ai
1093 vec_vand(vector
unsigned char __a
, vector
bool char __b
) {
1094 return __a
& (vector
unsigned char)__b
;
1097 static __inline__ vector
bool char __ATTRS_o_ai
vec_vand(vector
bool char __a
,
1098 vector
bool char __b
) {
1102 static __inline__ vector
short __ATTRS_o_ai
vec_vand(vector
short __a
,
1107 static __inline__ vector
short __ATTRS_o_ai
vec_vand(vector
bool short __a
,
1109 return (vector
short)__a
& __b
;
1112 static __inline__ vector
short __ATTRS_o_ai
vec_vand(vector
short __a
,
1113 vector
bool short __b
) {
1114 return __a
& (vector
short)__b
;
1117 static __inline__ vector
unsigned short __ATTRS_o_ai
1118 vec_vand(vector
unsigned short __a
, vector
unsigned short __b
) {
1122 static __inline__ vector
unsigned short __ATTRS_o_ai
1123 vec_vand(vector
bool short __a
, vector
unsigned short __b
) {
1124 return (vector
unsigned short)__a
& __b
;
1127 static __inline__ vector
unsigned short __ATTRS_o_ai
1128 vec_vand(vector
unsigned short __a
, vector
bool short __b
) {
1129 return __a
& (vector
unsigned short)__b
;
1132 static __inline__ vector
bool short __ATTRS_o_ai
1133 vec_vand(vector
bool short __a
, vector
bool short __b
) {
1137 static __inline__ vector
int __ATTRS_o_ai
vec_vand(vector
int __a
,
1142 static __inline__ vector
int __ATTRS_o_ai
vec_vand(vector
bool int __a
,
1144 return (vector
int)__a
& __b
;
1147 static __inline__ vector
int __ATTRS_o_ai
vec_vand(vector
int __a
,
1148 vector
bool int __b
) {
1149 return __a
& (vector
int)__b
;
1152 static __inline__ vector
unsigned int __ATTRS_o_ai
1153 vec_vand(vector
unsigned int __a
, vector
unsigned int __b
) {
1157 static __inline__ vector
unsigned int __ATTRS_o_ai
1158 vec_vand(vector
bool int __a
, vector
unsigned int __b
) {
1159 return (vector
unsigned int)__a
& __b
;
1162 static __inline__ vector
unsigned int __ATTRS_o_ai
1163 vec_vand(vector
unsigned int __a
, vector
bool int __b
) {
1164 return __a
& (vector
unsigned int)__b
;
1167 static __inline__ vector
bool int __ATTRS_o_ai
vec_vand(vector
bool int __a
,
1168 vector
bool int __b
) {
1172 static __inline__ vector
float __ATTRS_o_ai
vec_vand(vector
float __a
,
1174 vector
unsigned int __res
=
1175 (vector
unsigned int)__a
& (vector
unsigned int)__b
;
1176 return (vector
float)__res
;
1179 static __inline__ vector
float __ATTRS_o_ai
vec_vand(vector
bool int __a
,
1181 vector
unsigned int __res
=
1182 (vector
unsigned int)__a
& (vector
unsigned int)__b
;
1183 return (vector
float)__res
;
1186 static __inline__ vector
float __ATTRS_o_ai
vec_vand(vector
float __a
,
1187 vector
bool int __b
) {
1188 vector
unsigned int __res
=
1189 (vector
unsigned int)__a
& (vector
unsigned int)__b
;
1190 return (vector
float)__res
;
1194 static __inline__ vector
signed long long __ATTRS_o_ai
1195 vec_vand(vector
signed long long __a
, vector
signed long long __b
) {
1199 static __inline__ vector
signed long long __ATTRS_o_ai
1200 vec_vand(vector
bool long long __a
, vector
signed long long __b
) {
1201 return (vector
signed long long)__a
& __b
;
1204 static __inline__ vector
signed long long __ATTRS_o_ai
1205 vec_vand(vector
signed long long __a
, vector
bool long long __b
) {
1206 return __a
& (vector
signed long long)__b
;
1209 static __inline__ vector
unsigned long long __ATTRS_o_ai
1210 vec_vand(vector
unsigned long long __a
, vector
unsigned long long __b
) {
1214 static __inline__ vector
unsigned long long __ATTRS_o_ai
1215 vec_vand(vector
bool long long __a
, vector
unsigned long long __b
) {
1216 return (vector
unsigned long long)__a
& __b
;
1219 static __inline__ vector
unsigned long long __ATTRS_o_ai
1220 vec_vand(vector
unsigned long long __a
, vector
bool long long __b
) {
1221 return __a
& (vector
unsigned long long)__b
;
1224 static __inline__ vector
bool long long __ATTRS_o_ai
1225 vec_vand(vector
bool long long __a
, vector
bool long long __b
) {
1232 #define __builtin_altivec_vandc vec_andc
1234 static __inline__ vector
signed char __ATTRS_o_ai
1235 vec_andc(vector
signed char __a
, vector
signed char __b
) {
1239 static __inline__ vector
signed char __ATTRS_o_ai
1240 vec_andc(vector
bool char __a
, vector
signed char __b
) {
1241 return (vector
signed char)__a
& ~__b
;
1244 static __inline__ vector
signed char __ATTRS_o_ai
1245 vec_andc(vector
signed char __a
, vector
bool char __b
) {
1246 return __a
& ~(vector
signed char)__b
;
1249 static __inline__ vector
unsigned char __ATTRS_o_ai
1250 vec_andc(vector
unsigned char __a
, vector
unsigned char __b
) {
1254 static __inline__ vector
unsigned char __ATTRS_o_ai
1255 vec_andc(vector
bool char __a
, vector
unsigned char __b
) {
1256 return (vector
unsigned char)__a
& ~__b
;
1259 static __inline__ vector
unsigned char __ATTRS_o_ai
1260 vec_andc(vector
unsigned char __a
, vector
bool char __b
) {
1261 return __a
& ~(vector
unsigned char)__b
;
1264 static __inline__ vector
bool char __ATTRS_o_ai
vec_andc(vector
bool char __a
,
1265 vector
bool char __b
) {
1269 static __inline__ vector
short __ATTRS_o_ai
vec_andc(vector
short __a
,
1274 static __inline__ vector
short __ATTRS_o_ai
vec_andc(vector
bool short __a
,
1276 return (vector
short)__a
& ~__b
;
1279 static __inline__ vector
short __ATTRS_o_ai
vec_andc(vector
short __a
,
1280 vector
bool short __b
) {
1281 return __a
& ~(vector
short)__b
;
1284 static __inline__ vector
unsigned short __ATTRS_o_ai
1285 vec_andc(vector
unsigned short __a
, vector
unsigned short __b
) {
1289 static __inline__ vector
unsigned short __ATTRS_o_ai
1290 vec_andc(vector
bool short __a
, vector
unsigned short __b
) {
1291 return (vector
unsigned short)__a
& ~__b
;
1294 static __inline__ vector
unsigned short __ATTRS_o_ai
1295 vec_andc(vector
unsigned short __a
, vector
bool short __b
) {
1296 return __a
& ~(vector
unsigned short)__b
;
1299 static __inline__ vector
bool short __ATTRS_o_ai
1300 vec_andc(vector
bool short __a
, vector
bool short __b
) {
1304 static __inline__ vector
int __ATTRS_o_ai
vec_andc(vector
int __a
,
1309 static __inline__ vector
int __ATTRS_o_ai
vec_andc(vector
bool int __a
,
1311 return (vector
int)__a
& ~__b
;
1314 static __inline__ vector
int __ATTRS_o_ai
vec_andc(vector
int __a
,
1315 vector
bool int __b
) {
1316 return __a
& ~(vector
int)__b
;
1319 static __inline__ vector
unsigned int __ATTRS_o_ai
1320 vec_andc(vector
unsigned int __a
, vector
unsigned int __b
) {
1324 static __inline__ vector
unsigned int __ATTRS_o_ai
1325 vec_andc(vector
bool int __a
, vector
unsigned int __b
) {
1326 return (vector
unsigned int)__a
& ~__b
;
1329 static __inline__ vector
unsigned int __ATTRS_o_ai
1330 vec_andc(vector
unsigned int __a
, vector
bool int __b
) {
1331 return __a
& ~(vector
unsigned int)__b
;
1334 static __inline__ vector
bool int __ATTRS_o_ai
vec_andc(vector
bool int __a
,
1335 vector
bool int __b
) {
1339 static __inline__ vector
float __ATTRS_o_ai
vec_andc(vector
float __a
,
1341 vector
unsigned int __res
=
1342 (vector
unsigned int)__a
& ~(vector
unsigned int)__b
;
1343 return (vector
float)__res
;
1346 static __inline__ vector
float __ATTRS_o_ai
vec_andc(vector
bool int __a
,
1348 vector
unsigned int __res
=
1349 (vector
unsigned int)__a
& ~(vector
unsigned int)__b
;
1350 return (vector
float)__res
;
1353 static __inline__ vector
float __ATTRS_o_ai
vec_andc(vector
float __a
,
1354 vector
bool int __b
) {
1355 vector
unsigned int __res
=
1356 (vector
unsigned int)__a
& ~(vector
unsigned int)__b
;
1357 return (vector
float)__res
;
1361 static __inline__ vector
double __ATTRS_o_ai
vec_andc(vector
bool long long __a
,
1362 vector
double __b
) {
1363 vector
unsigned long long __res
=
1364 (vector
unsigned long long)__a
& ~(vector
unsigned long long)__b
;
1365 return (vector
double)__res
;
1368 static __inline__ vector
double __ATTRS_o_ai
1369 vec_andc(vector
double __a
, vector
bool long long __b
) {
1370 vector
unsigned long long __res
=
1371 (vector
unsigned long long)__a
& ~(vector
unsigned long long)__b
;
1372 return (vector
double)__res
;
1375 static __inline__ vector
double __ATTRS_o_ai
vec_andc(vector
double __a
,
1376 vector
double __b
) {
1377 vector
unsigned long long __res
=
1378 (vector
unsigned long long)__a
& ~(vector
unsigned long long)__b
;
1379 return (vector
double)__res
;
1382 static __inline__ vector
signed long long __ATTRS_o_ai
1383 vec_andc(vector
signed long long __a
, vector
signed long long __b
) {
1387 static __inline__ vector
signed long long __ATTRS_o_ai
1388 vec_andc(vector
bool long long __a
, vector
signed long long __b
) {
1389 return (vector
signed long long)__a
& ~__b
;
1392 static __inline__ vector
signed long long __ATTRS_o_ai
1393 vec_andc(vector
signed long long __a
, vector
bool long long __b
) {
1394 return __a
& ~(vector
signed long long)__b
;
1397 static __inline__ vector
unsigned long long __ATTRS_o_ai
1398 vec_andc(vector
unsigned long long __a
, vector
unsigned long long __b
) {
1402 static __inline__ vector
unsigned long long __ATTRS_o_ai
1403 vec_andc(vector
bool long long __a
, vector
unsigned long long __b
) {
1404 return (vector
unsigned long long)__a
& ~__b
;
1407 static __inline__ vector
unsigned long long __ATTRS_o_ai
1408 vec_andc(vector
unsigned long long __a
, vector
bool long long __b
) {
1409 return __a
& ~(vector
unsigned long long)__b
;
1412 static __inline__ vector
bool long long __ATTRS_o_ai
1413 vec_andc(vector
bool long long __a
, vector
bool long long __b
) {
1420 static __inline__ vector
signed char __ATTRS_o_ai
1421 vec_vandc(vector
signed char __a
, vector
signed char __b
) {
1425 static __inline__ vector
signed char __ATTRS_o_ai
1426 vec_vandc(vector
bool char __a
, vector
signed char __b
) {
1427 return (vector
signed char)__a
& ~__b
;
1430 static __inline__ vector
signed char __ATTRS_o_ai
1431 vec_vandc(vector
signed char __a
, vector
bool char __b
) {
1432 return __a
& ~(vector
signed char)__b
;
1435 static __inline__ vector
unsigned char __ATTRS_o_ai
1436 vec_vandc(vector
unsigned char __a
, vector
unsigned char __b
) {
1440 static __inline__ vector
unsigned char __ATTRS_o_ai
1441 vec_vandc(vector
bool char __a
, vector
unsigned char __b
) {
1442 return (vector
unsigned char)__a
& ~__b
;
1445 static __inline__ vector
unsigned char __ATTRS_o_ai
1446 vec_vandc(vector
unsigned char __a
, vector
bool char __b
) {
1447 return __a
& ~(vector
unsigned char)__b
;
1450 static __inline__ vector
bool char __ATTRS_o_ai
1451 vec_vandc(vector
bool char __a
, vector
bool char __b
) {
1455 static __inline__ vector
short __ATTRS_o_ai
vec_vandc(vector
short __a
,
1460 static __inline__ vector
short __ATTRS_o_ai
vec_vandc(vector
bool short __a
,
1462 return (vector
short)__a
& ~__b
;
1465 static __inline__ vector
short __ATTRS_o_ai
vec_vandc(vector
short __a
,
1466 vector
bool short __b
) {
1467 return __a
& ~(vector
short)__b
;
1470 static __inline__ vector
unsigned short __ATTRS_o_ai
1471 vec_vandc(vector
unsigned short __a
, vector
unsigned short __b
) {
1475 static __inline__ vector
unsigned short __ATTRS_o_ai
1476 vec_vandc(vector
bool short __a
, vector
unsigned short __b
) {
1477 return (vector
unsigned short)__a
& ~__b
;
1480 static __inline__ vector
unsigned short __ATTRS_o_ai
1481 vec_vandc(vector
unsigned short __a
, vector
bool short __b
) {
1482 return __a
& ~(vector
unsigned short)__b
;
1485 static __inline__ vector
bool short __ATTRS_o_ai
1486 vec_vandc(vector
bool short __a
, vector
bool short __b
) {
1490 static __inline__ vector
int __ATTRS_o_ai
vec_vandc(vector
int __a
,
1495 static __inline__ vector
int __ATTRS_o_ai
vec_vandc(vector
bool int __a
,
1497 return (vector
int)__a
& ~__b
;
1500 static __inline__ vector
int __ATTRS_o_ai
vec_vandc(vector
int __a
,
1501 vector
bool int __b
) {
1502 return __a
& ~(vector
int)__b
;
1505 static __inline__ vector
unsigned int __ATTRS_o_ai
1506 vec_vandc(vector
unsigned int __a
, vector
unsigned int __b
) {
1510 static __inline__ vector
unsigned int __ATTRS_o_ai
1511 vec_vandc(vector
bool int __a
, vector
unsigned int __b
) {
1512 return (vector
unsigned int)__a
& ~__b
;
1515 static __inline__ vector
unsigned int __ATTRS_o_ai
1516 vec_vandc(vector
unsigned int __a
, vector
bool int __b
) {
1517 return __a
& ~(vector
unsigned int)__b
;
1520 static __inline__ vector
bool int __ATTRS_o_ai
vec_vandc(vector
bool int __a
,
1521 vector
bool int __b
) {
1525 static __inline__ vector
float __ATTRS_o_ai
vec_vandc(vector
float __a
,
1527 vector
unsigned int __res
=
1528 (vector
unsigned int)__a
& ~(vector
unsigned int)__b
;
1529 return (vector
float)__res
;
1532 static __inline__ vector
float __ATTRS_o_ai
vec_vandc(vector
bool int __a
,
1534 vector
unsigned int __res
=
1535 (vector
unsigned int)__a
& ~(vector
unsigned int)__b
;
1536 return (vector
float)__res
;
1539 static __inline__ vector
float __ATTRS_o_ai
vec_vandc(vector
float __a
,
1540 vector
bool int __b
) {
1541 vector
unsigned int __res
=
1542 (vector
unsigned int)__a
& ~(vector
unsigned int)__b
;
1543 return (vector
float)__res
;
1547 static __inline__ vector
signed long long __ATTRS_o_ai
1548 vec_vandc(vector
signed long long __a
, vector
signed long long __b
) {
1552 static __inline__ vector
signed long long __ATTRS_o_ai
1553 vec_vandc(vector
bool long long __a
, vector
signed long long __b
) {
1554 return (vector
signed long long)__a
& ~__b
;
1557 static __inline__ vector
signed long long __ATTRS_o_ai
1558 vec_vandc(vector
signed long long __a
, vector
bool long long __b
) {
1559 return __a
& ~(vector
signed long long)__b
;
1562 static __inline__ vector
unsigned long long __ATTRS_o_ai
1563 vec_vandc(vector
unsigned long long __a
, vector
unsigned long long __b
) {
1567 static __inline__ vector
unsigned long long __ATTRS_o_ai
1568 vec_vandc(vector
bool long long __a
, vector
unsigned long long __b
) {
1569 return (vector
unsigned long long)__a
& ~__b
;
1572 static __inline__ vector
unsigned long long __ATTRS_o_ai
1573 vec_vandc(vector
unsigned long long __a
, vector
bool long long __b
) {
1574 return __a
& ~(vector
unsigned long long)__b
;
1577 static __inline__ vector
bool long long __ATTRS_o_ai
1578 vec_vandc(vector
bool long long __a
, vector
bool long long __b
) {
1585 static __inline__ vector
signed char __ATTRS_o_ai
1586 vec_avg(vector
signed char __a
, vector
signed char __b
) {
1587 return __builtin_altivec_vavgsb(__a
, __b
);
1590 static __inline__ vector
unsigned char __ATTRS_o_ai
1591 vec_avg(vector
unsigned char __a
, vector
unsigned char __b
) {
1592 return __builtin_altivec_vavgub(__a
, __b
);
1595 static __inline__ vector
short __ATTRS_o_ai
vec_avg(vector
short __a
,
1597 return __builtin_altivec_vavgsh(__a
, __b
);
1600 static __inline__ vector
unsigned short __ATTRS_o_ai
1601 vec_avg(vector
unsigned short __a
, vector
unsigned short __b
) {
1602 return __builtin_altivec_vavguh(__a
, __b
);
1605 static __inline__ vector
int __ATTRS_o_ai
vec_avg(vector
int __a
,
1607 return __builtin_altivec_vavgsw(__a
, __b
);
1610 static __inline__ vector
unsigned int __ATTRS_o_ai
1611 vec_avg(vector
unsigned int __a
, vector
unsigned int __b
) {
1612 return __builtin_altivec_vavguw(__a
, __b
);
1617 static __inline__ vector
signed char __attribute__((__always_inline__
))
1618 vec_vavgsb(vector
signed char __a
, vector
signed char __b
) {
1619 return __builtin_altivec_vavgsb(__a
, __b
);
1624 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
1625 vec_vavgub(vector
unsigned char __a
, vector
unsigned char __b
) {
1626 return __builtin_altivec_vavgub(__a
, __b
);
1631 static __inline__ vector
short __attribute__((__always_inline__
))
1632 vec_vavgsh(vector
short __a
, vector
short __b
) {
1633 return __builtin_altivec_vavgsh(__a
, __b
);
1638 static __inline__ vector
unsigned short __attribute__((__always_inline__
))
1639 vec_vavguh(vector
unsigned short __a
, vector
unsigned short __b
) {
1640 return __builtin_altivec_vavguh(__a
, __b
);
1645 static __inline__ vector
int __attribute__((__always_inline__
))
1646 vec_vavgsw(vector
int __a
, vector
int __b
) {
1647 return __builtin_altivec_vavgsw(__a
, __b
);
1652 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
1653 vec_vavguw(vector
unsigned int __a
, vector
unsigned int __b
) {
1654 return __builtin_altivec_vavguw(__a
, __b
);
1659 static __inline__ vector
float __ATTRS_o_ai
vec_ceil(vector
float __a
) {
1661 return __builtin_vsx_xvrspip(__a
);
1663 return __builtin_altivec_vrfip(__a
);
1668 static __inline__ vector
double __ATTRS_o_ai
vec_ceil(vector
double __a
) {
1669 return __builtin_vsx_xvrdpip(__a
);
1674 static __inline__ vector
float __ATTRS_o_ai
vec_roundp(vector
float __a
) {
1675 return vec_ceil(__a
);
1679 static __inline__ vector
double __ATTRS_o_ai
vec_roundp(vector
double __a
) {
1680 return vec_ceil(__a
);
1686 static __inline__ vector
float __attribute__((__always_inline__
))
1687 vec_vrfip(vector
float __a
) {
1688 return __builtin_altivec_vrfip(__a
);
1693 static __inline__ vector
int __attribute__((__always_inline__
))
1694 vec_cmpb(vector
float __a
, vector
float __b
) {
1695 return __builtin_altivec_vcmpbfp(__a
, __b
);
1700 static __inline__ vector
int __attribute__((__always_inline__
))
1701 vec_vcmpbfp(vector
float __a
, vector
float __b
) {
1702 return __builtin_altivec_vcmpbfp(__a
, __b
);
1707 static __inline__ vector
bool char __ATTRS_o_ai
1708 vec_cmpeq(vector
signed char __a
, vector
signed char __b
) {
1709 return (vector
bool char)__builtin_altivec_vcmpequb((vector
char)__a
,
1713 static __inline__ vector
bool char __ATTRS_o_ai
1714 vec_cmpeq(vector
unsigned char __a
, vector
unsigned char __b
) {
1715 return (vector
bool char)__builtin_altivec_vcmpequb((vector
char)__a
,
1719 static __inline__ vector
bool char __ATTRS_o_ai
1720 vec_cmpeq(vector
bool char __a
, vector
bool char __b
) {
1721 return (vector
bool char)__builtin_altivec_vcmpequb((vector
char)__a
,
1725 static __inline__ vector
bool short __ATTRS_o_ai
vec_cmpeq(vector
short __a
,
1727 return (vector
bool short)__builtin_altivec_vcmpequh(__a
, __b
);
1730 static __inline__ vector
bool short __ATTRS_o_ai
1731 vec_cmpeq(vector
unsigned short __a
, vector
unsigned short __b
) {
1732 return (vector
bool short)__builtin_altivec_vcmpequh((vector
short)__a
,
1736 static __inline__ vector
bool short __ATTRS_o_ai
1737 vec_cmpeq(vector
bool short __a
, vector
bool short __b
) {
1738 return (vector
bool short)__builtin_altivec_vcmpequh((vector
short)__a
,
1742 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmpeq(vector
int __a
,
1744 return (vector
bool int)__builtin_altivec_vcmpequw(__a
, __b
);
1747 static __inline__ vector
bool int __ATTRS_o_ai
1748 vec_cmpeq(vector
unsigned int __a
, vector
unsigned int __b
) {
1749 return (vector
bool int)__builtin_altivec_vcmpequw((vector
int)__a
,
1753 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmpeq(vector
bool int __a
,
1754 vector
bool int __b
) {
1755 return (vector
bool int)__builtin_altivec_vcmpequw((vector
int)__a
,
1759 #ifdef __POWER8_VECTOR__
1760 static __inline__ vector
bool long long __ATTRS_o_ai
1761 vec_cmpeq(vector
signed long long __a
, vector
signed long long __b
) {
1762 return (vector
bool long long)__builtin_altivec_vcmpequd(__a
, __b
);
1765 static __inline__ vector
bool long long __ATTRS_o_ai
1766 vec_cmpeq(vector
unsigned long long __a
, vector
unsigned long long __b
) {
1767 return (vector
bool long long)__builtin_altivec_vcmpequd(
1768 (vector
long long)__a
, (vector
long long)__b
);
1771 static __inline__ vector
bool long long __ATTRS_o_ai
1772 vec_cmpeq(vector
bool long long __a
, vector
bool long long __b
) {
1773 return (vector
bool long long)__builtin_altivec_vcmpequd(
1774 (vector
long long)__a
, (vector
long long)__b
);
1776 #elif defined(__VSX__)
1777 static __inline__ vector
bool long long __ATTRS_o_ai
1778 vec_cmpeq(vector
signed long long __a
, vector
signed long long __b
) {
1779 vector
bool int __wordcmp
=
1780 vec_cmpeq((vector
signed int)__a
, (vector
signed int)__b
);
1781 #ifdef __LITTLE_ENDIAN__
1782 __wordcmp
&= __builtin_shufflevector(__wordcmp
, __wordcmp
, 3, 0, 1, 2);
1783 return (vector
bool long long)__builtin_shufflevector(__wordcmp
, __wordcmp
, 1,
1786 __wordcmp
&= __builtin_shufflevector(__wordcmp
, __wordcmp
, 1, 2, 3, 0);
1787 return (vector
bool long long)__builtin_shufflevector(__wordcmp
, __wordcmp
, 0,
1792 static __inline__ vector
bool long long __ATTRS_o_ai
1793 vec_cmpeq(vector
unsigned long long __a
, vector
unsigned long long __b
) {
1794 return vec_cmpeq((vector
signed long long)__a
, (vector
signed long long)__b
);
1797 static __inline__ vector
bool long long __ATTRS_o_ai
1798 vec_cmpeq(vector
bool long long __a
, vector
bool long long __b
) {
1799 return vec_cmpeq((vector
signed long long)__a
, (vector
signed long long)__b
);
1803 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmpeq(vector
float __a
,
1806 return (vector
bool int)__builtin_vsx_xvcmpeqsp(__a
, __b
);
1808 return (vector
bool int)__builtin_altivec_vcmpeqfp(__a
, __b
);
1813 static __inline__ vector
bool long long __ATTRS_o_ai
1814 vec_cmpeq(vector
double __a
, vector
double __b
) {
1815 return (vector
bool long long)__builtin_vsx_xvcmpeqdp(__a
, __b
);
1819 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1820 static __inline__ vector
bool __int128 __ATTRS_o_ai
1821 vec_cmpeq(vector
signed __int128 __a
, vector
signed __int128 __b
) {
1822 return (vector
bool __int128
)__builtin_altivec_vcmpequq(
1823 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
1826 static __inline__ vector
bool __int128 __ATTRS_o_ai
1827 vec_cmpeq(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
1828 return (vector
bool __int128
)__builtin_altivec_vcmpequq(
1829 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
1832 static __inline__ vector
bool __int128 __ATTRS_o_ai
1833 vec_cmpeq(vector
bool __int128 __a
, vector
bool __int128 __b
) {
1834 return (vector
bool __int128
)__builtin_altivec_vcmpequq(
1835 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
1839 #ifdef __POWER9_VECTOR__
1842 static __inline__ vector
bool char __ATTRS_o_ai
1843 vec_cmpne(vector
bool char __a
, vector
bool char __b
) {
1844 return (vector
bool char)__builtin_altivec_vcmpneb((vector
char)__a
,
1848 static __inline__ vector
bool char __ATTRS_o_ai
1849 vec_cmpne(vector
signed char __a
, vector
signed char __b
) {
1850 return (vector
bool char)__builtin_altivec_vcmpneb((vector
char)__a
,
1854 static __inline__ vector
bool char __ATTRS_o_ai
1855 vec_cmpne(vector
unsigned char __a
, vector
unsigned char __b
) {
1856 return (vector
bool char)__builtin_altivec_vcmpneb((vector
char)__a
,
1860 static __inline__ vector
bool short __ATTRS_o_ai
1861 vec_cmpne(vector
bool short __a
, vector
bool short __b
) {
1862 return (vector
bool short)__builtin_altivec_vcmpneh((vector
short)__a
,
1866 static __inline__ vector
bool short __ATTRS_o_ai
1867 vec_cmpne(vector
signed short __a
, vector
signed short __b
) {
1868 return (vector
bool short)__builtin_altivec_vcmpneh((vector
short)__a
,
1872 static __inline__ vector
bool short __ATTRS_o_ai
1873 vec_cmpne(vector
unsigned short __a
, vector
unsigned short __b
) {
1874 return (vector
bool short)__builtin_altivec_vcmpneh((vector
short)__a
,
1878 static __inline__ vector
bool int __ATTRS_o_ai
1879 vec_cmpne(vector
bool int __a
, vector
bool int __b
) {
1880 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)__a
,
1884 static __inline__ vector
bool int __ATTRS_o_ai
1885 vec_cmpne(vector
signed int __a
, vector
signed int __b
) {
1886 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)__a
,
1890 static __inline__ vector
bool int __ATTRS_o_ai
1891 vec_cmpne(vector
unsigned int __a
, vector
unsigned int __b
) {
1892 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)__a
,
1896 static __inline__ vector
bool int __ATTRS_o_ai
1897 vec_cmpne(vector
float __a
, vector
float __b
) {
1898 return (vector
bool int)__builtin_altivec_vcmpnew((vector
int)__a
,
1902 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1903 static __inline__ vector
bool __int128 __ATTRS_o_ai
1904 vec_cmpne(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
1905 return (vector
bool __int128
)~(__builtin_altivec_vcmpequq(
1906 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
));
1909 static __inline__ vector
bool __int128 __ATTRS_o_ai
1910 vec_cmpne(vector
signed __int128 __a
, vector
signed __int128 __b
) {
1911 return (vector
bool __int128
)~(__builtin_altivec_vcmpequq(
1912 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
));
1915 static __inline__ vector
bool __int128 __ATTRS_o_ai
1916 vec_cmpne(vector
bool __int128 __a
, vector
bool __int128 __b
) {
1917 return (vector
bool __int128
)~(__builtin_altivec_vcmpequq(
1918 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
));
1924 static __inline__ vector
bool char __ATTRS_o_ai
1925 vec_cmpnez(vector
signed char __a
, vector
signed char __b
) {
1926 return (vector
bool char)__builtin_altivec_vcmpnezb((vector
char)__a
,
1930 static __inline__ vector
bool char __ATTRS_o_ai
1931 vec_cmpnez(vector
unsigned char __a
, vector
unsigned char __b
) {
1932 return (vector
bool char)__builtin_altivec_vcmpnezb((vector
char)__a
,
1936 static __inline__ vector
bool short __ATTRS_o_ai
1937 vec_cmpnez(vector
signed short __a
, vector
signed short __b
) {
1938 return (vector
bool short)__builtin_altivec_vcmpnezh((vector
short)__a
,
1942 static __inline__ vector
bool short __ATTRS_o_ai
1943 vec_cmpnez(vector
unsigned short __a
, vector
unsigned short __b
) {
1944 return (vector
bool short)__builtin_altivec_vcmpnezh((vector
short)__a
,
1948 static __inline__ vector
bool int __ATTRS_o_ai
1949 vec_cmpnez(vector
signed int __a
, vector
signed int __b
) {
1950 return (vector
bool int)__builtin_altivec_vcmpnezw((vector
int)__a
,
1954 static __inline__ vector
bool int __ATTRS_o_ai
1955 vec_cmpnez(vector
unsigned int __a
, vector
unsigned int __b
) {
1956 return (vector
bool int)__builtin_altivec_vcmpnezw((vector
int)__a
,
1960 static __inline__
signed int __ATTRS_o_ai
1961 vec_cntlz_lsbb(vector
signed char __a
) {
1962 #ifdef __LITTLE_ENDIAN__
1963 return __builtin_altivec_vctzlsbb((vector
unsigned char)__a
);
1965 return __builtin_altivec_vclzlsbb((vector
unsigned char)__a
);
1969 static __inline__
signed int __ATTRS_o_ai
1970 vec_cntlz_lsbb(vector
unsigned char __a
) {
1971 #ifdef __LITTLE_ENDIAN__
1972 return __builtin_altivec_vctzlsbb((vector
unsigned char)__a
);
1974 return __builtin_altivec_vclzlsbb(__a
);
1978 static __inline__
signed int __ATTRS_o_ai
1979 vec_cnttz_lsbb(vector
signed char __a
) {
1980 #ifdef __LITTLE_ENDIAN__
1981 return __builtin_altivec_vclzlsbb((vector
unsigned char)__a
);
1983 return __builtin_altivec_vctzlsbb((vector
unsigned char)__a
);
1987 static __inline__
signed int __ATTRS_o_ai
1988 vec_cnttz_lsbb(vector
unsigned char __a
) {
1989 #ifdef __LITTLE_ENDIAN__
1990 return __builtin_altivec_vclzlsbb(__a
);
1992 return __builtin_altivec_vctzlsbb(__a
);
1996 static __inline__ vector
unsigned int __ATTRS_o_ai
1997 vec_parity_lsbb(vector
unsigned int __a
) {
1998 return __builtin_altivec_vprtybw(__a
);
2001 static __inline__ vector
unsigned int __ATTRS_o_ai
2002 vec_parity_lsbb(vector
signed int __a
) {
2003 return __builtin_altivec_vprtybw((vector
unsigned int)__a
);
2006 #ifdef __SIZEOF_INT128__
2007 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
2008 vec_parity_lsbb(vector
unsigned __int128 __a
) {
2009 return __builtin_altivec_vprtybq(__a
);
2012 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
2013 vec_parity_lsbb(vector
signed __int128 __a
) {
2014 return __builtin_altivec_vprtybq((vector
unsigned __int128
)__a
);
2018 static __inline__ vector
unsigned long long __ATTRS_o_ai
2019 vec_parity_lsbb(vector
unsigned long long __a
) {
2020 return __builtin_altivec_vprtybd(__a
);
2023 static __inline__ vector
unsigned long long __ATTRS_o_ai
2024 vec_parity_lsbb(vector
signed long long __a
) {
2025 return __builtin_altivec_vprtybd((vector
unsigned long long)__a
);
2031 static __inline__ vector
bool char __ATTRS_o_ai
2032 vec_cmpne(vector
bool char __a
, vector
bool char __b
) {
2033 return ~(vec_cmpeq(__a
, __b
));
2036 static __inline__ vector
bool char __ATTRS_o_ai
2037 vec_cmpne(vector
signed char __a
, vector
signed char __b
) {
2038 return ~(vec_cmpeq(__a
, __b
));
2041 static __inline__ vector
bool char __ATTRS_o_ai
2042 vec_cmpne(vector
unsigned char __a
, vector
unsigned char __b
) {
2043 return ~(vec_cmpeq(__a
, __b
));
2046 static __inline__ vector
bool short __ATTRS_o_ai
2047 vec_cmpne(vector
bool short __a
, vector
bool short __b
) {
2048 return ~(vec_cmpeq(__a
, __b
));
2051 static __inline__ vector
bool short __ATTRS_o_ai
2052 vec_cmpne(vector
signed short __a
, vector
signed short __b
) {
2053 return ~(vec_cmpeq(__a
, __b
));
2056 static __inline__ vector
bool short __ATTRS_o_ai
2057 vec_cmpne(vector
unsigned short __a
, vector
unsigned short __b
) {
2058 return ~(vec_cmpeq(__a
, __b
));
2061 static __inline__ vector
bool int __ATTRS_o_ai
2062 vec_cmpne(vector
bool int __a
, vector
bool int __b
) {
2063 return ~(vec_cmpeq(__a
, __b
));
2066 static __inline__ vector
bool int __ATTRS_o_ai
2067 vec_cmpne(vector
signed int __a
, vector
signed int __b
) {
2068 return ~(vec_cmpeq(__a
, __b
));
2071 static __inline__ vector
bool int __ATTRS_o_ai
2072 vec_cmpne(vector
unsigned int __a
, vector
unsigned int __b
) {
2073 return ~(vec_cmpeq(__a
, __b
));
2076 static __inline__ vector
bool int __ATTRS_o_ai
2077 vec_cmpne(vector
float __a
, vector
float __b
) {
2078 return ~(vec_cmpeq(__a
, __b
));
2082 #ifdef __POWER8_VECTOR__
2083 static __inline__ vector
bool long long __ATTRS_o_ai
2084 vec_cmpne(vector
bool long long __a
, vector
bool long long __b
) {
2085 return (vector
bool long long)
2086 ~(__builtin_altivec_vcmpequd((vector
long long)__a
, (vector
long long)__b
));
2089 static __inline__ vector
bool long long __ATTRS_o_ai
2090 vec_cmpne(vector
signed long long __a
, vector
signed long long __b
) {
2091 return (vector
bool long long)
2092 ~(__builtin_altivec_vcmpequd((vector
long long)__a
, (vector
long long)__b
));
2095 static __inline__ vector
bool long long __ATTRS_o_ai
2096 vec_cmpne(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2097 return (vector
bool long long)
2098 ~(__builtin_altivec_vcmpequd((vector
long long)__a
, (vector
long long)__b
));
2100 #elif defined(__VSX__)
2101 static __inline__ vector
bool long long __ATTRS_o_ai
2102 vec_cmpne(vector
bool long long __a
, vector
bool long long __b
) {
2103 return (vector
bool long long)~(
2104 vec_cmpeq((vector
signed long long)__a
, (vector
signed long long)__b
));
2107 static __inline__ vector
bool long long __ATTRS_o_ai
2108 vec_cmpne(vector
signed long long __a
, vector
signed long long __b
) {
2109 return (vector
bool long long)~(
2110 vec_cmpeq((vector
signed long long)__a
, (vector
signed long long)__b
));
2113 static __inline__ vector
bool long long __ATTRS_o_ai
2114 vec_cmpne(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2115 return (vector
bool long long)~(
2116 vec_cmpeq((vector
signed long long)__a
, (vector
signed long long)__b
));
2121 static __inline__ vector
bool long long __ATTRS_o_ai
2122 vec_cmpne(vector
double __a
, vector
double __b
) {
2123 return (vector
bool long long)
2124 ~(__builtin_altivec_vcmpequd((vector
long long)__a
, (vector
long long)__b
));
2130 static __inline__ vector
bool char __ATTRS_o_ai
2131 vec_cmpgt(vector
signed char __a
, vector
signed char __b
) {
2132 return (vector
bool char)__builtin_altivec_vcmpgtsb(__a
, __b
);
2135 static __inline__ vector
bool char __ATTRS_o_ai
2136 vec_cmpgt(vector
unsigned char __a
, vector
unsigned char __b
) {
2137 return (vector
bool char)__builtin_altivec_vcmpgtub(__a
, __b
);
2140 static __inline__ vector
bool short __ATTRS_o_ai
vec_cmpgt(vector
short __a
,
2142 return (vector
bool short)__builtin_altivec_vcmpgtsh(__a
, __b
);
2145 static __inline__ vector
bool short __ATTRS_o_ai
2146 vec_cmpgt(vector
unsigned short __a
, vector
unsigned short __b
) {
2147 return (vector
bool short)__builtin_altivec_vcmpgtuh(__a
, __b
);
2150 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmpgt(vector
int __a
,
2152 return (vector
bool int)__builtin_altivec_vcmpgtsw(__a
, __b
);
2155 static __inline__ vector
bool int __ATTRS_o_ai
2156 vec_cmpgt(vector
unsigned int __a
, vector
unsigned int __b
) {
2157 return (vector
bool int)__builtin_altivec_vcmpgtuw(__a
, __b
);
2160 #ifdef __POWER8_VECTOR__
2161 static __inline__ vector
bool long long __ATTRS_o_ai
2162 vec_cmpgt(vector
signed long long __a
, vector
signed long long __b
) {
2163 return (vector
bool long long)__builtin_altivec_vcmpgtsd(__a
, __b
);
2166 static __inline__ vector
bool long long __ATTRS_o_ai
2167 vec_cmpgt(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2168 return (vector
bool long long)__builtin_altivec_vcmpgtud(__a
, __b
);
2170 #elif defined(__VSX__)
2171 static __inline__ vector
bool long long __ATTRS_o_ai
2172 vec_cmpgt(vector
signed long long __a
, vector
signed long long __b
) {
2173 vector
signed int __sgtw
= (vector
signed int)vec_cmpgt(
2174 (vector
signed int)__a
, (vector
signed int)__b
);
2175 vector
unsigned int __ugtw
= (vector
unsigned int)vec_cmpgt(
2176 (vector
unsigned int)__a
, (vector
unsigned int)__b
);
2177 vector
unsigned int __eqw
= (vector
unsigned int)vec_cmpeq(
2178 (vector
signed int)__a
, (vector
signed int)__b
);
2179 #ifdef __LITTLE_ENDIAN__
2180 __ugtw
= __builtin_shufflevector(__ugtw
, __ugtw
, 3, 0, 1, 2) & __eqw
;
2181 __sgtw
|= (vector
signed int)__ugtw
;
2182 return (vector
bool long long)__builtin_shufflevector(__sgtw
, __sgtw
, 1, 1, 3,
2185 __ugtw
= __builtin_shufflevector(__ugtw
, __ugtw
, 1, 2, 3, 0) & __eqw
;
2186 __sgtw
|= (vector
signed int)__ugtw
;
2187 return (vector
bool long long)__builtin_shufflevector(__sgtw
, __sgtw
, 0, 0, 2,
2192 static __inline__ vector
bool long long __ATTRS_o_ai
2193 vec_cmpgt(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2194 vector
unsigned int __ugtw
= (vector
unsigned int)vec_cmpgt(
2195 (vector
unsigned int)__a
, (vector
unsigned int)__b
);
2196 vector
unsigned int __eqw
= (vector
unsigned int)vec_cmpeq(
2197 (vector
signed int)__a
, (vector
signed int)__b
);
2198 #ifdef __LITTLE_ENDIAN__
2199 __eqw
= __builtin_shufflevector(__ugtw
, __ugtw
, 3, 0, 1, 2) & __eqw
;
2201 return (vector
bool long long)__builtin_shufflevector(__ugtw
, __ugtw
, 1, 1, 3,
2204 __eqw
= __builtin_shufflevector(__ugtw
, __ugtw
, 1, 2, 3, 0) & __eqw
;
2206 return (vector
bool long long)__builtin_shufflevector(__ugtw
, __ugtw
, 0, 0, 2,
2212 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmpgt(vector
float __a
,
2215 return (vector
bool int)__builtin_vsx_xvcmpgtsp(__a
, __b
);
2217 return (vector
bool int)__builtin_altivec_vcmpgtfp(__a
, __b
);
2222 static __inline__ vector
bool long long __ATTRS_o_ai
2223 vec_cmpgt(vector
double __a
, vector
double __b
) {
2224 return (vector
bool long long)__builtin_vsx_xvcmpgtdp(__a
, __b
);
2228 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2229 static __inline__ vector
bool __int128 __ATTRS_o_ai
2230 vec_cmpgt(vector
signed __int128 __a
, vector
signed __int128 __b
) {
2231 return (vector
bool __int128
)__builtin_altivec_vcmpgtsq(__a
, __b
);
2234 static __inline__ vector
bool __int128 __ATTRS_o_ai
2235 vec_cmpgt(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
2236 return (vector
bool __int128
)__builtin_altivec_vcmpgtuq(__a
, __b
);
2242 static __inline__ vector
bool char __ATTRS_o_ai
2243 vec_cmpge(vector
signed char __a
, vector
signed char __b
) {
2244 return ~(vec_cmpgt(__b
, __a
));
2247 static __inline__ vector
bool char __ATTRS_o_ai
2248 vec_cmpge(vector
unsigned char __a
, vector
unsigned char __b
) {
2249 return ~(vec_cmpgt(__b
, __a
));
2252 static __inline__ vector
bool short __ATTRS_o_ai
2253 vec_cmpge(vector
signed short __a
, vector
signed short __b
) {
2254 return ~(vec_cmpgt(__b
, __a
));
2257 static __inline__ vector
bool short __ATTRS_o_ai
2258 vec_cmpge(vector
unsigned short __a
, vector
unsigned short __b
) {
2259 return ~(vec_cmpgt(__b
, __a
));
2262 static __inline__ vector
bool int __ATTRS_o_ai
2263 vec_cmpge(vector
signed int __a
, vector
signed int __b
) {
2264 return ~(vec_cmpgt(__b
, __a
));
2267 static __inline__ vector
bool int __ATTRS_o_ai
2268 vec_cmpge(vector
unsigned int __a
, vector
unsigned int __b
) {
2269 return ~(vec_cmpgt(__b
, __a
));
2272 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmpge(vector
float __a
,
2275 return (vector
bool int)__builtin_vsx_xvcmpgesp(__a
, __b
);
2277 return (vector
bool int)__builtin_altivec_vcmpgefp(__a
, __b
);
2282 static __inline__ vector
bool long long __ATTRS_o_ai
2283 vec_cmpge(vector
double __a
, vector
double __b
) {
2284 return (vector
bool long long)__builtin_vsx_xvcmpgedp(__a
, __b
);
2287 static __inline__ vector
bool long long __ATTRS_o_ai
2288 vec_cmpge(vector
signed long long __a
, vector
signed long long __b
) {
2289 return ~(vec_cmpgt(__b
, __a
));
2292 static __inline__ vector
bool long long __ATTRS_o_ai
2293 vec_cmpge(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2294 return ~(vec_cmpgt(__b
, __a
));
2298 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2299 static __inline__ vector
bool __int128 __ATTRS_o_ai
2300 vec_cmpge(vector
signed __int128 __a
, vector
signed __int128 __b
) {
2301 return ~(vec_cmpgt(__b
, __a
));
2304 static __inline__ vector
bool __int128 __ATTRS_o_ai
2305 vec_cmpge(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
2306 return ~(vec_cmpgt(__b
, __a
));
2312 static __inline__ vector
bool int __attribute__((__always_inline__
))
2313 vec_vcmpgefp(vector
float __a
, vector
float __b
) {
2314 return (vector
bool int)__builtin_altivec_vcmpgefp(__a
, __b
);
2319 static __inline__ vector
bool char __attribute__((__always_inline__
))
2320 vec_vcmpgtsb(vector
signed char __a
, vector
signed char __b
) {
2321 return (vector
bool char)__builtin_altivec_vcmpgtsb(__a
, __b
);
2326 static __inline__ vector
bool char __attribute__((__always_inline__
))
2327 vec_vcmpgtub(vector
unsigned char __a
, vector
unsigned char __b
) {
2328 return (vector
bool char)__builtin_altivec_vcmpgtub(__a
, __b
);
2333 static __inline__ vector
bool short __attribute__((__always_inline__
))
2334 vec_vcmpgtsh(vector
short __a
, vector
short __b
) {
2335 return (vector
bool short)__builtin_altivec_vcmpgtsh(__a
, __b
);
2340 static __inline__ vector
bool short __attribute__((__always_inline__
))
2341 vec_vcmpgtuh(vector
unsigned short __a
, vector
unsigned short __b
) {
2342 return (vector
bool short)__builtin_altivec_vcmpgtuh(__a
, __b
);
2347 static __inline__ vector
bool int __attribute__((__always_inline__
))
2348 vec_vcmpgtsw(vector
int __a
, vector
int __b
) {
2349 return (vector
bool int)__builtin_altivec_vcmpgtsw(__a
, __b
);
2354 static __inline__ vector
bool int __attribute__((__always_inline__
))
2355 vec_vcmpgtuw(vector
unsigned int __a
, vector
unsigned int __b
) {
2356 return (vector
bool int)__builtin_altivec_vcmpgtuw(__a
, __b
);
2361 static __inline__ vector
bool int __attribute__((__always_inline__
))
2362 vec_vcmpgtfp(vector
float __a
, vector
float __b
) {
2363 return (vector
bool int)__builtin_altivec_vcmpgtfp(__a
, __b
);
2368 static __inline__ vector
bool char __ATTRS_o_ai
2369 vec_cmple(vector
signed char __a
, vector
signed char __b
) {
2370 return vec_cmpge(__b
, __a
);
2373 static __inline__ vector
bool char __ATTRS_o_ai
2374 vec_cmple(vector
unsigned char __a
, vector
unsigned char __b
) {
2375 return vec_cmpge(__b
, __a
);
2378 static __inline__ vector
bool short __ATTRS_o_ai
2379 vec_cmple(vector
signed short __a
, vector
signed short __b
) {
2380 return vec_cmpge(__b
, __a
);
2383 static __inline__ vector
bool short __ATTRS_o_ai
2384 vec_cmple(vector
unsigned short __a
, vector
unsigned short __b
) {
2385 return vec_cmpge(__b
, __a
);
2388 static __inline__ vector
bool int __ATTRS_o_ai
2389 vec_cmple(vector
signed int __a
, vector
signed int __b
) {
2390 return vec_cmpge(__b
, __a
);
2393 static __inline__ vector
bool int __ATTRS_o_ai
2394 vec_cmple(vector
unsigned int __a
, vector
unsigned int __b
) {
2395 return vec_cmpge(__b
, __a
);
2398 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmple(vector
float __a
,
2400 return vec_cmpge(__b
, __a
);
2404 static __inline__ vector
bool long long __ATTRS_o_ai
2405 vec_cmple(vector
double __a
, vector
double __b
) {
2406 return vec_cmpge(__b
, __a
);
2409 static __inline__ vector
bool long long __ATTRS_o_ai
2410 vec_cmple(vector
signed long long __a
, vector
signed long long __b
) {
2411 return vec_cmpge(__b
, __a
);
2414 static __inline__ vector
bool long long __ATTRS_o_ai
2415 vec_cmple(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2416 return vec_cmpge(__b
, __a
);
2420 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2421 static __inline__ vector
bool __int128 __ATTRS_o_ai
2422 vec_cmple(vector
signed __int128 __a
, vector
signed __int128 __b
) {
2423 return vec_cmpge(__b
, __a
);
2426 static __inline__ vector
bool __int128 __ATTRS_o_ai
2427 vec_cmple(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
2428 return vec_cmpge(__b
, __a
);
2434 static __inline__ vector
bool char __ATTRS_o_ai
2435 vec_cmplt(vector
signed char __a
, vector
signed char __b
) {
2436 return vec_cmpgt(__b
, __a
);
2439 static __inline__ vector
bool char __ATTRS_o_ai
2440 vec_cmplt(vector
unsigned char __a
, vector
unsigned char __b
) {
2441 return vec_cmpgt(__b
, __a
);
2444 static __inline__ vector
bool short __ATTRS_o_ai
vec_cmplt(vector
short __a
,
2446 return vec_cmpgt(__b
, __a
);
2449 static __inline__ vector
bool short __ATTRS_o_ai
2450 vec_cmplt(vector
unsigned short __a
, vector
unsigned short __b
) {
2451 return vec_cmpgt(__b
, __a
);
2454 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmplt(vector
int __a
,
2456 return vec_cmpgt(__b
, __a
);
2459 static __inline__ vector
bool int __ATTRS_o_ai
2460 vec_cmplt(vector
unsigned int __a
, vector
unsigned int __b
) {
2461 return vec_cmpgt(__b
, __a
);
2464 static __inline__ vector
bool int __ATTRS_o_ai
vec_cmplt(vector
float __a
,
2466 return vec_cmpgt(__b
, __a
);
2470 static __inline__ vector
bool long long __ATTRS_o_ai
2471 vec_cmplt(vector
double __a
, vector
double __b
) {
2472 return vec_cmpgt(__b
, __a
);
2476 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2477 static __inline__ vector
bool __int128 __ATTRS_o_ai
2478 vec_cmplt(vector
signed __int128 __a
, vector
signed __int128 __b
) {
2479 return vec_cmpgt(__b
, __a
);
2482 static __inline__ vector
bool __int128 __ATTRS_o_ai
2483 vec_cmplt(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
2484 return vec_cmpgt(__b
, __a
);
2489 static __inline__ vector
bool long long __ATTRS_o_ai
2490 vec_cmplt(vector
signed long long __a
, vector
signed long long __b
) {
2491 return vec_cmpgt(__b
, __a
);
2494 static __inline__ vector
bool long long __ATTRS_o_ai
2495 vec_cmplt(vector
unsigned long long __a
, vector
unsigned long long __b
) {
2496 return vec_cmpgt(__b
, __a
);
2500 #ifdef __POWER8_VECTOR__
2503 static __inline__ vector
unsigned char __ATTRS_o_ai
2504 vec_popcnt(vector
signed char __a
) {
2505 return (vector
unsigned char)__builtin_altivec_vpopcntb(
2506 (vector
unsigned char)__a
);
2508 static __inline__ vector
unsigned char __ATTRS_o_ai
2509 vec_popcnt(vector
unsigned char __a
) {
2510 return __builtin_altivec_vpopcntb(__a
);
2512 static __inline__ vector
unsigned short __ATTRS_o_ai
2513 vec_popcnt(vector
signed short __a
) {
2514 return (vector
unsigned short)__builtin_altivec_vpopcnth(
2515 (vector
unsigned short)__a
);
2517 static __inline__ vector
unsigned short __ATTRS_o_ai
2518 vec_popcnt(vector
unsigned short __a
) {
2519 return __builtin_altivec_vpopcnth(__a
);
2521 static __inline__ vector
unsigned int __ATTRS_o_ai
2522 vec_popcnt(vector
signed int __a
) {
2523 return __builtin_altivec_vpopcntw((vector
unsigned int)__a
);
2525 static __inline__ vector
unsigned int __ATTRS_o_ai
2526 vec_popcnt(vector
unsigned int __a
) {
2527 return __builtin_altivec_vpopcntw(__a
);
2529 static __inline__ vector
unsigned long long __ATTRS_o_ai
2530 vec_popcnt(vector
signed long long __a
) {
2531 return __builtin_altivec_vpopcntd((vector
unsigned long long)__a
);
2533 static __inline__ vector
unsigned long long __ATTRS_o_ai
2534 vec_popcnt(vector
unsigned long long __a
) {
2535 return __builtin_altivec_vpopcntd(__a
);
2538 #define vec_vclz vec_cntlz
2541 static __inline__ vector
signed char __ATTRS_o_ai
2542 vec_cntlz(vector
signed char __a
) {
2543 return (vector
signed char)__builtin_altivec_vclzb((vector
unsigned char)__a
);
2545 static __inline__ vector
unsigned char __ATTRS_o_ai
2546 vec_cntlz(vector
unsigned char __a
) {
2547 return __builtin_altivec_vclzb(__a
);
2549 static __inline__ vector
signed short __ATTRS_o_ai
2550 vec_cntlz(vector
signed short __a
) {
2551 return (vector
signed short)__builtin_altivec_vclzh(
2552 (vector
unsigned short)__a
);
2554 static __inline__ vector
unsigned short __ATTRS_o_ai
2555 vec_cntlz(vector
unsigned short __a
) {
2556 return __builtin_altivec_vclzh(__a
);
2558 static __inline__ vector
signed int __ATTRS_o_ai
2559 vec_cntlz(vector
signed int __a
) {
2560 return (vector
signed int)__builtin_altivec_vclzw((vector
unsigned int)__a
);
2562 static __inline__ vector
unsigned int __ATTRS_o_ai
2563 vec_cntlz(vector
unsigned int __a
) {
2564 return __builtin_altivec_vclzw(__a
);
2566 static __inline__ vector
signed long long __ATTRS_o_ai
2567 vec_cntlz(vector
signed long long __a
) {
2568 return (vector
signed long long)__builtin_altivec_vclzd(
2569 (vector
unsigned long long)__a
);
2571 static __inline__ vector
unsigned long long __ATTRS_o_ai
2572 vec_cntlz(vector
unsigned long long __a
) {
2573 return __builtin_altivec_vclzd(__a
);
2577 #ifdef __POWER9_VECTOR__
2581 static __inline__ vector
signed char __ATTRS_o_ai
2582 vec_cnttz(vector
signed char __a
) {
2583 return (vector
signed char)__builtin_altivec_vctzb((vector
unsigned char)__a
);
2585 static __inline__ vector
unsigned char __ATTRS_o_ai
2586 vec_cnttz(vector
unsigned char __a
) {
2587 return __builtin_altivec_vctzb(__a
);
2589 static __inline__ vector
signed short __ATTRS_o_ai
2590 vec_cnttz(vector
signed short __a
) {
2591 return (vector
signed short)__builtin_altivec_vctzh(
2592 (vector
unsigned short)__a
);
2594 static __inline__ vector
unsigned short __ATTRS_o_ai
2595 vec_cnttz(vector
unsigned short __a
) {
2596 return __builtin_altivec_vctzh(__a
);
2598 static __inline__ vector
signed int __ATTRS_o_ai
2599 vec_cnttz(vector
signed int __a
) {
2600 return (vector
signed int)__builtin_altivec_vctzw((vector
unsigned int)__a
);
2602 static __inline__ vector
unsigned int __ATTRS_o_ai
2603 vec_cnttz(vector
unsigned int __a
) {
2604 return __builtin_altivec_vctzw(__a
);
2606 static __inline__ vector
signed long long __ATTRS_o_ai
2607 vec_cnttz(vector
signed long long __a
) {
2608 return (vector
signed long long)__builtin_altivec_vctzd(
2609 (vector
unsigned long long)__a
);
2611 static __inline__ vector
unsigned long long __ATTRS_o_ai
2612 vec_cnttz(vector
unsigned long long __a
) {
2613 return __builtin_altivec_vctzd(__a
);
2616 /* vec_first_match_index */
2618 static __inline__
unsigned __ATTRS_o_ai
2619 vec_first_match_index(vector
signed char __a
, vector
signed char __b
) {
2620 vector
unsigned long long __res
=
2621 #ifdef __LITTLE_ENDIAN__
2622 vec_cnttz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2624 vec_cntlz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2626 if (__res
[0] == 64) {
2627 return (__res
[1] + 64) >> 3;
2629 return __res
[0] >> 3;
2632 static __inline__
unsigned __ATTRS_o_ai
2633 vec_first_match_index(vector
unsigned char __a
, vector
unsigned char __b
) {
2634 vector
unsigned long long __res
=
2635 #ifdef __LITTLE_ENDIAN__
2636 vec_cnttz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2638 vec_cntlz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2640 if (__res
[0] == 64) {
2641 return (__res
[1] + 64) >> 3;
2643 return __res
[0] >> 3;
2646 static __inline__
unsigned __ATTRS_o_ai
2647 vec_first_match_index(vector
signed short __a
, vector
signed short __b
) {
2648 vector
unsigned long long __res
=
2649 #ifdef __LITTLE_ENDIAN__
2650 vec_cnttz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2652 vec_cntlz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2654 if (__res
[0] == 64) {
2655 return (__res
[1] + 64) >> 4;
2657 return __res
[0] >> 4;
2660 static __inline__
unsigned __ATTRS_o_ai
2661 vec_first_match_index(vector
unsigned short __a
, vector
unsigned short __b
) {
2662 vector
unsigned long long __res
=
2663 #ifdef __LITTLE_ENDIAN__
2664 vec_cnttz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2666 vec_cntlz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2668 if (__res
[0] == 64) {
2669 return (__res
[1] + 64) >> 4;
2671 return __res
[0] >> 4;
2674 static __inline__
unsigned __ATTRS_o_ai
2675 vec_first_match_index(vector
signed int __a
, vector
signed int __b
) {
2676 vector
unsigned long long __res
=
2677 #ifdef __LITTLE_ENDIAN__
2678 vec_cnttz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2680 vec_cntlz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2682 if (__res
[0] == 64) {
2683 return (__res
[1] + 64) >> 5;
2685 return __res
[0] >> 5;
2688 static __inline__
unsigned __ATTRS_o_ai
2689 vec_first_match_index(vector
unsigned int __a
, vector
unsigned int __b
) {
2690 vector
unsigned long long __res
=
2691 #ifdef __LITTLE_ENDIAN__
2692 vec_cnttz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2694 vec_cntlz((vector
unsigned long long)vec_cmpeq(__a
, __b
));
2696 if (__res
[0] == 64) {
2697 return (__res
[1] + 64) >> 5;
2699 return __res
[0] >> 5;
2702 /* vec_first_match_or_eos_index */
2704 static __inline__
unsigned __ATTRS_o_ai
2705 vec_first_match_or_eos_index(vector
signed char __a
, vector
signed char __b
) {
2706 /* Compare the result of the comparison of two vectors with either and OR the
2707 result. Either the elements are equal or one will equal the comparison
2708 result if either is zero.
2710 vector
bool char __tmp1
= vec_cmpeq(__a
, __b
);
2711 vector
bool char __tmp2
= __tmp1
|
2712 vec_cmpeq((vector
signed char)__tmp1
, __a
) |
2713 vec_cmpeq((vector
signed char)__tmp1
, __b
);
2715 vector
unsigned long long __res
=
2716 #ifdef __LITTLE_ENDIAN__
2717 vec_cnttz((vector
unsigned long long)__tmp2
);
2719 vec_cntlz((vector
unsigned long long)__tmp2
);
2721 if (__res
[0] == 64) {
2722 return (__res
[1] + 64) >> 3;
2724 return __res
[0] >> 3;
2727 static __inline__
unsigned __ATTRS_o_ai
2728 vec_first_match_or_eos_index(vector
unsigned char __a
,
2729 vector
unsigned char __b
) {
2730 vector
bool char __tmp1
= vec_cmpeq(__a
, __b
);
2731 vector
bool char __tmp2
= __tmp1
|
2732 vec_cmpeq((vector
unsigned char)__tmp1
, __a
) |
2733 vec_cmpeq((vector
unsigned char)__tmp1
, __b
);
2735 vector
unsigned long long __res
=
2736 #ifdef __LITTLE_ENDIAN__
2737 vec_cnttz((vector
unsigned long long)__tmp2
);
2739 vec_cntlz((vector
unsigned long long)__tmp2
);
2741 if (__res
[0] == 64) {
2742 return (__res
[1] + 64) >> 3;
2744 return __res
[0] >> 3;
2747 static __inline__
unsigned __ATTRS_o_ai
2748 vec_first_match_or_eos_index(vector
signed short __a
, vector
signed short __b
) {
2749 vector
bool short __tmp1
= vec_cmpeq(__a
, __b
);
2750 vector
bool short __tmp2
= __tmp1
|
2751 vec_cmpeq((vector
signed short)__tmp1
, __a
) |
2752 vec_cmpeq((vector
signed short)__tmp1
, __b
);
2754 vector
unsigned long long __res
=
2755 #ifdef __LITTLE_ENDIAN__
2756 vec_cnttz((vector
unsigned long long)__tmp2
);
2758 vec_cntlz((vector
unsigned long long)__tmp2
);
2760 if (__res
[0] == 64) {
2761 return (__res
[1] + 64) >> 4;
2763 return __res
[0] >> 4;
2766 static __inline__
unsigned __ATTRS_o_ai
2767 vec_first_match_or_eos_index(vector
unsigned short __a
,
2768 vector
unsigned short __b
) {
2769 vector
bool short __tmp1
= vec_cmpeq(__a
, __b
);
2770 vector
bool short __tmp2
= __tmp1
|
2771 vec_cmpeq((vector
unsigned short)__tmp1
, __a
) |
2772 vec_cmpeq((vector
unsigned short)__tmp1
, __b
);
2774 vector
unsigned long long __res
=
2775 #ifdef __LITTLE_ENDIAN__
2776 vec_cnttz((vector
unsigned long long)__tmp2
);
2778 vec_cntlz((vector
unsigned long long)__tmp2
);
2780 if (__res
[0] == 64) {
2781 return (__res
[1] + 64) >> 4;
2783 return __res
[0] >> 4;
2786 static __inline__
unsigned __ATTRS_o_ai
2787 vec_first_match_or_eos_index(vector
signed int __a
, vector
signed int __b
) {
2788 vector
bool int __tmp1
= vec_cmpeq(__a
, __b
);
2789 vector
bool int __tmp2
= __tmp1
| vec_cmpeq((vector
signed int)__tmp1
, __a
) |
2790 vec_cmpeq((vector
signed int)__tmp1
, __b
);
2792 vector
unsigned long long __res
=
2793 #ifdef __LITTLE_ENDIAN__
2794 vec_cnttz((vector
unsigned long long)__tmp2
);
2796 vec_cntlz((vector
unsigned long long)__tmp2
);
2798 if (__res
[0] == 64) {
2799 return (__res
[1] + 64) >> 5;
2801 return __res
[0] >> 5;
2804 static __inline__
unsigned __ATTRS_o_ai
2805 vec_first_match_or_eos_index(vector
unsigned int __a
, vector
unsigned int __b
) {
2806 vector
bool int __tmp1
= vec_cmpeq(__a
, __b
);
2807 vector
bool int __tmp2
= __tmp1
|
2808 vec_cmpeq((vector
unsigned int)__tmp1
, __a
) |
2809 vec_cmpeq((vector
unsigned int)__tmp1
, __b
);
2811 vector
unsigned long long __res
=
2812 #ifdef __LITTLE_ENDIAN__
2813 vec_cnttz((vector
unsigned long long)__tmp2
);
2815 vec_cntlz((vector
unsigned long long)__tmp2
);
2817 if (__res
[0] == 64) {
2818 return (__res
[1] + 64) >> 5;
2820 return __res
[0] >> 5;
2823 /* vec_first_mismatch_index */
2825 static __inline__
unsigned __ATTRS_o_ai
2826 vec_first_mismatch_index(vector
signed char __a
, vector
signed char __b
) {
2827 vector
unsigned long long __res
=
2828 #ifdef __LITTLE_ENDIAN__
2829 vec_cnttz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2831 vec_cntlz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2833 if (__res
[0] == 64) {
2834 return (__res
[1] + 64) >> 3;
2836 return __res
[0] >> 3;
2839 static __inline__
unsigned __ATTRS_o_ai
2840 vec_first_mismatch_index(vector
unsigned char __a
, vector
unsigned char __b
) {
2841 vector
unsigned long long __res
=
2842 #ifdef __LITTLE_ENDIAN__
2843 vec_cnttz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2845 vec_cntlz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2847 if (__res
[0] == 64) {
2848 return (__res
[1] + 64) >> 3;
2850 return __res
[0] >> 3;
2853 static __inline__
unsigned __ATTRS_o_ai
2854 vec_first_mismatch_index(vector
signed short __a
, vector
signed short __b
) {
2855 vector
unsigned long long __res
=
2856 #ifdef __LITTLE_ENDIAN__
2857 vec_cnttz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2859 vec_cntlz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2861 if (__res
[0] == 64) {
2862 return (__res
[1] + 64) >> 4;
2864 return __res
[0] >> 4;
2867 static __inline__
unsigned __ATTRS_o_ai
2868 vec_first_mismatch_index(vector
unsigned short __a
, vector
unsigned short __b
) {
2869 vector
unsigned long long __res
=
2870 #ifdef __LITTLE_ENDIAN__
2871 vec_cnttz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2873 vec_cntlz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2875 if (__res
[0] == 64) {
2876 return (__res
[1] + 64) >> 4;
2878 return __res
[0] >> 4;
2881 static __inline__
unsigned __ATTRS_o_ai
2882 vec_first_mismatch_index(vector
signed int __a
, vector
signed int __b
) {
2883 vector
unsigned long long __res
=
2884 #ifdef __LITTLE_ENDIAN__
2885 vec_cnttz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2887 vec_cntlz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2889 if (__res
[0] == 64) {
2890 return (__res
[1] + 64) >> 5;
2892 return __res
[0] >> 5;
2895 static __inline__
unsigned __ATTRS_o_ai
2896 vec_first_mismatch_index(vector
unsigned int __a
, vector
unsigned int __b
) {
2897 vector
unsigned long long __res
=
2898 #ifdef __LITTLE_ENDIAN__
2899 vec_cnttz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2901 vec_cntlz((vector
unsigned long long)vec_cmpne(__a
, __b
));
2903 if (__res
[0] == 64) {
2904 return (__res
[1] + 64) >> 5;
2906 return __res
[0] >> 5;
2909 /* vec_first_mismatch_or_eos_index */
2911 static __inline__
unsigned __ATTRS_o_ai
2912 vec_first_mismatch_or_eos_index(vector
signed char __a
,
2913 vector
signed char __b
) {
2914 vector
unsigned long long __res
=
2915 #ifdef __LITTLE_ENDIAN__
2916 vec_cnttz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2918 vec_cntlz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2920 if (__res
[0] == 64) {
2921 return (__res
[1] + 64) >> 3;
2923 return __res
[0] >> 3;
2926 static __inline__
unsigned __ATTRS_o_ai
2927 vec_first_mismatch_or_eos_index(vector
unsigned char __a
,
2928 vector
unsigned char __b
) {
2929 vector
unsigned long long __res
=
2930 #ifdef __LITTLE_ENDIAN__
2931 vec_cnttz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2933 vec_cntlz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2935 if (__res
[0] == 64) {
2936 return (__res
[1] + 64) >> 3;
2938 return __res
[0] >> 3;
2941 static __inline__
unsigned __ATTRS_o_ai
2942 vec_first_mismatch_or_eos_index(vector
signed short __a
,
2943 vector
signed short __b
) {
2944 vector
unsigned long long __res
=
2945 #ifdef __LITTLE_ENDIAN__
2946 vec_cnttz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2948 vec_cntlz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2950 if (__res
[0] == 64) {
2951 return (__res
[1] + 64) >> 4;
2953 return __res
[0] >> 4;
2956 static __inline__
unsigned __ATTRS_o_ai
2957 vec_first_mismatch_or_eos_index(vector
unsigned short __a
,
2958 vector
unsigned short __b
) {
2959 vector
unsigned long long __res
=
2960 #ifdef __LITTLE_ENDIAN__
2961 vec_cnttz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2963 vec_cntlz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2965 if (__res
[0] == 64) {
2966 return (__res
[1] + 64) >> 4;
2968 return __res
[0] >> 4;
2971 static __inline__
unsigned __ATTRS_o_ai
2972 vec_first_mismatch_or_eos_index(vector
signed int __a
, vector
signed int __b
) {
2973 vector
unsigned long long __res
=
2974 #ifdef __LITTLE_ENDIAN__
2975 vec_cnttz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2977 vec_cntlz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2979 if (__res
[0] == 64) {
2980 return (__res
[1] + 64) >> 5;
2982 return __res
[0] >> 5;
2985 static __inline__
unsigned __ATTRS_o_ai
2986 vec_first_mismatch_or_eos_index(vector
unsigned int __a
,
2987 vector
unsigned int __b
) {
2988 vector
unsigned long long __res
=
2989 #ifdef __LITTLE_ENDIAN__
2990 vec_cnttz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2992 vec_cntlz((vector
unsigned long long)vec_cmpnez(__a
, __b
));
2994 if (__res
[0] == 64) {
2995 return (__res
[1] + 64) >> 5;
2997 return __res
[0] >> 5;
3000 static __inline__ vector
double __ATTRS_o_ai
3001 vec_insert_exp(vector
double __a
, vector
unsigned long long __b
) {
3002 return __builtin_vsx_xviexpdp((vector
unsigned long long)__a
,__b
);
3005 static __inline__ vector
double __ATTRS_o_ai
3006 vec_insert_exp(vector
unsigned long long __a
, vector
unsigned long long __b
) {
3007 return __builtin_vsx_xviexpdp(__a
,__b
);
3010 static __inline__ vector
float __ATTRS_o_ai
3011 vec_insert_exp(vector
float __a
, vector
unsigned int __b
) {
3012 return __builtin_vsx_xviexpsp((vector
unsigned int)__a
,__b
);
3015 static __inline__ vector
float __ATTRS_o_ai
3016 vec_insert_exp(vector
unsigned int __a
, vector
unsigned int __b
) {
3017 return __builtin_vsx_xviexpsp(__a
,__b
);
3020 #if defined(__powerpc64__)
3021 static __inline__ vector
signed char __ATTRS_o_ai
vec_xl_len(const signed char *__a
,
3023 return (vector
signed char)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3026 static __inline__ vector
unsigned char __ATTRS_o_ai
3027 vec_xl_len(const unsigned char *__a
, size_t __b
) {
3028 return (vector
unsigned char)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3031 static __inline__ vector
signed short __ATTRS_o_ai
vec_xl_len(const signed short *__a
,
3033 return (vector
signed short)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3036 static __inline__ vector
unsigned short __ATTRS_o_ai
3037 vec_xl_len(const unsigned short *__a
, size_t __b
) {
3038 return (vector
unsigned short)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3041 static __inline__ vector
signed int __ATTRS_o_ai
vec_xl_len(const signed int *__a
,
3043 return (vector
signed int)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3046 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_xl_len(const unsigned int *__a
,
3048 return (vector
unsigned int)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3051 static __inline__ vector
float __ATTRS_o_ai
vec_xl_len(const float *__a
, size_t __b
) {
3052 return (vector
float)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3055 #ifdef __SIZEOF_INT128__
3056 static __inline__ vector
signed __int128 __ATTRS_o_ai
3057 vec_xl_len(const signed __int128
*__a
, size_t __b
) {
3058 return (vector
signed __int128
)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3061 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
3062 vec_xl_len(const unsigned __int128
*__a
, size_t __b
) {
3063 return (vector
unsigned __int128
)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3067 static __inline__ vector
signed long long __ATTRS_o_ai
3068 vec_xl_len(const signed long long *__a
, size_t __b
) {
3069 return (vector
signed long long)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3072 static __inline__ vector
unsigned long long __ATTRS_o_ai
3073 vec_xl_len(const unsigned long long *__a
, size_t __b
) {
3074 return (vector
unsigned long long)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3077 static __inline__ vector
double __ATTRS_o_ai
vec_xl_len(const double *__a
,
3079 return (vector
double)__builtin_vsx_lxvl(__a
, (__b
<< 56));
3082 static __inline__ vector
unsigned char __ATTRS_o_ai
3083 vec_xl_len_r(const unsigned char *__a
, size_t __b
) {
3084 vector
unsigned char __res
=
3085 (vector
unsigned char)__builtin_vsx_lxvll(__a
, (__b
<< 56));
3086 vector
unsigned char __mask
=
3087 (vector
unsigned char)__builtin_altivec_lvsr(16 - __b
, (int *)NULL
);
3088 return (vector
unsigned char)__builtin_altivec_vperm_4si(
3089 (vector
int)__res
, (vector
int)__res
, __mask
);
3093 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
unsigned char __a
,
3096 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3099 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
signed char __a
,
3100 signed char *__b
, size_t __c
) {
3101 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3104 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
signed short __a
,
3105 signed short *__b
, size_t __c
) {
3106 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3109 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
unsigned short __a
,
3110 unsigned short *__b
,
3112 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3115 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
signed int __a
,
3116 signed int *__b
, size_t __c
) {
3117 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3120 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
unsigned int __a
,
3121 unsigned int *__b
, size_t __c
) {
3122 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3125 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
float __a
, float *__b
,
3127 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3130 #ifdef __SIZEOF_INT128__
3131 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
signed __int128 __a
,
3132 signed __int128
*__b
,
3134 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3137 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
unsigned __int128 __a
,
3138 unsigned __int128
*__b
,
3140 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3144 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
signed long long __a
,
3145 signed long long *__b
,
3147 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3150 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
unsigned long long __a
,
3151 unsigned long long *__b
,
3153 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3156 static __inline__
void __ATTRS_o_ai
vec_xst_len(vector
double __a
, double *__b
,
3158 return __builtin_vsx_stxvl((vector
int)__a
, __b
, (__c
<< 56));
3161 static __inline__
void __ATTRS_o_ai
vec_xst_len_r(vector
unsigned char __a
,
3164 vector
unsigned char __mask
=
3165 (vector
unsigned char)__builtin_altivec_lvsl(16 - __c
, (int *)NULL
);
3166 vector
unsigned char __res
=
3167 (vector
unsigned char)__builtin_altivec_vperm_4si(
3168 (vector
int)__a
, (vector
int)__a
, __mask
);
3169 return __builtin_vsx_stxvll((vector
int)__res
, __b
, (__c
<< 56));
3174 #if defined(__POWER9_VECTOR__) && defined(__powerpc64__)
3175 #define __vec_ldrmb(PTR, CNT) vec_xl_len_r((const unsigned char *)(PTR), (CNT))
3176 #define __vec_strmb(PTR, CNT, VAL) \
3177 vec_xst_len_r((VAL), (unsigned char *)(PTR), (CNT))
3179 #define __vec_ldrmb __builtin_vsx_ldrmb
3180 #define __vec_strmb __builtin_vsx_strmb
3186 static __inline__ vector
float __ATTRS_o_ai
vec_cpsgn(vector
float __a
,
3188 return __builtin_vsx_xvcpsgnsp(__b
, __a
);
3191 static __inline__ vector
double __ATTRS_o_ai
vec_cpsgn(vector
double __a
,
3192 vector
double __b
) {
3193 return __builtin_vsx_xvcpsgndp(__b
, __a
);
3200 // There are some functions that have different signatures with the XL compiler
3201 // from those in Clang/GCC and documented in the PVIPR. This macro ensures that
3202 // the XL-compatible signatures are used for those functions.
3203 #ifdef __XL_COMPAT_ALTIVEC__
3204 #define vec_ctf(__a, __b) \
3207 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3208 vector unsigned int \
3209 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3211 vector unsigned long long \
3212 : (vector float)(__builtin_vsx_xvcvuxdsp( \
3213 (vector unsigned long long)(__a)) * \
3214 (vector float)(vector unsigned)((0x7f - (__b)) << 23)), \
3215 vector signed long long \
3216 : (vector float)(__builtin_vsx_xvcvsxdsp( \
3217 (vector signed long long)(__a)) * \
3218 (vector float)(vector unsigned)((0x7f - (__b)) << 23)))
3219 #else // __XL_COMPAT_ALTIVEC__
3220 #define vec_ctf(__a, __b) \
3223 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3224 vector unsigned int \
3225 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3227 vector unsigned long long \
3228 : (vector float)(__builtin_convertvector( \
3229 (vector unsigned long long)(__a), vector double) * \
3230 (vector double)(vector unsigned long long)((0x3ffULL - \
3233 vector signed long long \
3234 : (vector float)(__builtin_convertvector((vector signed long long)(__a), \
3236 (vector double)(vector unsigned long long)((0x3ffULL - \
3239 #endif // __XL_COMPAT_ALTIVEC__
3241 #define vec_ctf(__a, __b) \
3242 _Generic((__a), vector int \
3243 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
3244 vector unsigned int \
3245 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
3251 #define vec_ctd(__a, __b) \
3252 _Generic((__a), vector signed int \
3253 : (vec_doublee((vector signed int)(__a)) * \
3254 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3256 vector unsigned int \
3257 : (vec_doublee((vector unsigned int)(__a)) * \
3258 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3260 vector unsigned long long \
3261 : (__builtin_convertvector((vector unsigned long long)(__a), \
3263 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3265 vector signed long long \
3266 : (__builtin_convertvector((vector signed long long)(__a), \
3268 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
3274 #define vec_vcfux __builtin_altivec_vcfux
3277 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
3282 #ifdef __XL_COMPAT_ALTIVEC__
3283 #define vec_cts(__a, __b) \
3284 _Generic((__a), vector float \
3285 : (vector signed int)__builtin_altivec_vctsxs((vector float)(__a), \
3289 vector double __ret = \
3290 (vector double)(__a) * \
3291 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3293 (vector signed long long)__builtin_vsx_xvcvdpsxws(__ret); \
3295 #else // __XL_COMPAT_ALTIVEC__
3296 #define vec_cts(__a, __b) \
3297 _Generic((__a), vector float \
3298 : (vector signed int)__builtin_altivec_vctsxs((vector float)(__a), \
3302 vector double __ret = \
3303 (vector double)(__a) * \
3304 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
3306 (vector signed long long)__builtin_convertvector( \
3307 __ret, vector signed long long); \
3309 #endif // __XL_COMPAT_ALTIVEC__
3311 #define vec_cts __builtin_altivec_vctsxs
3316 #define vec_vctsxs __builtin_altivec_vctsxs
3321 #ifdef __XL_COMPAT_ALTIVEC__
3322 #define vec_ctu(__a, __b) \
3323 _Generic((__a), vector float \
3324 : (vector unsigned int)__builtin_altivec_vctuxs( \
3325 (vector float)(__a), (__b)), \
3328 vector double __ret = \
3329 (vector double)(__a) * \
3330 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3332 (vector unsigned long long)__builtin_vsx_xvcvdpuxws(__ret); \
3334 #else // __XL_COMPAT_ALTIVEC__
3335 #define vec_ctu(__a, __b) \
3336 _Generic((__a), vector float \
3337 : (vector unsigned int)__builtin_altivec_vctuxs( \
3338 (vector float)(__a), (__b)), \
3341 vector double __ret = \
3342 (vector double)(__a) * \
3343 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3345 (vector unsigned long long)__builtin_convertvector( \
3346 __ret, vector unsigned long long); \
3348 #endif // __XL_COMPAT_ALTIVEC__
3350 #define vec_ctu __builtin_altivec_vctuxs
3353 #ifdef __LITTLE_ENDIAN__
3357 #define vec_ctsl(__a, __b) \
3358 _Generic((__a), vector float \
3360 vector float __ret = \
3361 (vector float)(__a) * \
3362 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3363 __builtin_vsx_xvcvspsxds( \
3364 __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3368 vector double __ret = \
3369 (vector double)(__a) * \
3370 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3372 __builtin_convertvector(__ret, vector signed long long); \
3377 #define vec_ctul(__a, __b) \
3378 _Generic((__a), vector float \
3380 vector float __ret = \
3381 (vector float)(__a) * \
3382 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3383 __builtin_vsx_xvcvspuxds( \
3384 __builtin_vsx_xxsldwi(__ret, __ret, 1)); \
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 #else // __LITTLE_ENDIAN__
3399 #define vec_ctsl(__a, __b) \
3400 _Generic((__a), vector float \
3402 vector float __ret = \
3403 (vector float)(__a) * \
3404 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3405 __builtin_vsx_xvcvspsxds(__ret); \
3409 vector double __ret = \
3410 (vector double)(__a) * \
3411 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3413 __builtin_convertvector(__ret, vector signed long long); \
3418 #define vec_ctul(__a, __b) \
3419 _Generic((__a), vector float \
3421 vector float __ret = \
3422 (vector float)(__a) * \
3423 (vector float)(vector unsigned)((0x7f + (__b)) << 23); \
3424 __builtin_vsx_xvcvspuxds(__ret); \
3428 vector double __ret = \
3429 (vector double)(__a) * \
3430 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
3432 __builtin_convertvector(__ret, vector unsigned long long); \
3435 #endif // __LITTLE_ENDIAN__
3439 #define vec_vctuxs __builtin_altivec_vctuxs
3443 #ifdef __POWER9_VECTOR__
3444 static __inline__ vector
signed int __ATTRS_o_ai
3445 vec_signexti(vector
signed char __a
) {
3446 return __builtin_altivec_vextsb2w(__a
);
3449 static __inline__ vector
signed int __ATTRS_o_ai
3450 vec_signexti(vector
signed short __a
) {
3451 return __builtin_altivec_vextsh2w(__a
);
3454 static __inline__ vector
signed long long __ATTRS_o_ai
3455 vec_signextll(vector
signed char __a
) {
3456 return __builtin_altivec_vextsb2d(__a
);
3459 static __inline__ vector
signed long long __ATTRS_o_ai
3460 vec_signextll(vector
signed short __a
) {
3461 return __builtin_altivec_vextsh2d(__a
);
3464 static __inline__ vector
signed long long __ATTRS_o_ai
3465 vec_signextll(vector
signed int __a
) {
3466 return __builtin_altivec_vextsw2d(__a
);
3470 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3471 static __inline__ vector
signed __int128 __ATTRS_o_ai
3472 vec_signextq(vector
signed long long __a
) {
3473 return __builtin_altivec_vextsd2q(__a
);
3479 static __inline__ vector
signed int __ATTRS_o_ai
3480 vec_sld(vector
signed int, vector
signed int, unsigned const int __c
);
3482 static __inline__ vector
signed int __ATTRS_o_ai
3483 vec_signed(vector
float __a
) {
3484 return __builtin_convertvector(__a
, vector
signed int);
3488 static __inline__ vector
signed long long __ATTRS_o_ai
3489 vec_signed(vector
double __a
) {
3490 return __builtin_convertvector(__a
, vector
signed long long);
3493 static __inline__ vector
signed int __attribute__((__always_inline__
))
3494 vec_signed2(vector
double __a
, vector
double __b
) {
3495 return (vector
signed int) { __a
[0], __a
[1], __b
[0], __b
[1] };
3498 static __inline__ vector
signed int __ATTRS_o_ai
3499 vec_signede(vector
double __a
) {
3500 #ifdef __LITTLE_ENDIAN__
3501 vector
signed int __ret
= __builtin_vsx_xvcvdpsxws(__a
);
3502 return vec_sld(__ret
, __ret
, 12);
3504 return __builtin_vsx_xvcvdpsxws(__a
);
3508 static __inline__ vector
signed int __ATTRS_o_ai
3509 vec_signedo(vector
double __a
) {
3510 #ifdef __LITTLE_ENDIAN__
3511 return __builtin_vsx_xvcvdpsxws(__a
);
3513 vector
signed int __ret
= __builtin_vsx_xvcvdpsxws(__a
);
3514 return vec_sld(__ret
, __ret
, 12);
3521 static __inline__ vector
unsigned int __ATTRS_o_ai
3522 vec_sld(vector
unsigned int, vector
unsigned int, unsigned const int __c
);
3524 static __inline__ vector
unsigned int __ATTRS_o_ai
3525 vec_unsigned(vector
float __a
) {
3526 return __builtin_convertvector(__a
, vector
unsigned int);
3530 static __inline__ vector
unsigned long long __ATTRS_o_ai
3531 vec_unsigned(vector
double __a
) {
3532 return __builtin_convertvector(__a
, vector
unsigned long long);
3535 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
3536 vec_unsigned2(vector
double __a
, vector
double __b
) {
3537 return (vector
unsigned int) { __a
[0], __a
[1], __b
[0], __b
[1] };
3540 static __inline__ vector
unsigned int __ATTRS_o_ai
3541 vec_unsignede(vector
double __a
) {
3542 #ifdef __LITTLE_ENDIAN__
3543 vector
unsigned int __ret
= __builtin_vsx_xvcvdpuxws(__a
);
3544 return vec_sld(__ret
, __ret
, 12);
3546 return __builtin_vsx_xvcvdpuxws(__a
);
3550 static __inline__ vector
unsigned int __ATTRS_o_ai
3551 vec_unsignedo(vector
double __a
) {
3552 #ifdef __LITTLE_ENDIAN__
3553 return __builtin_vsx_xvcvdpuxws(__a
);
3555 vector
unsigned int __ret
= __builtin_vsx_xvcvdpuxws(__a
);
3556 return vec_sld(__ret
, __ret
, 12);
3563 static __inline__ vector
float __ATTRS_o_ai
3564 vec_sld(vector
float, vector
float, unsigned const int __c
);
3566 static __inline__ vector
float __ATTRS_o_ai
3567 vec_float(vector
signed int __a
) {
3568 return __builtin_convertvector(__a
, vector
float);
3571 static __inline__ vector
float __ATTRS_o_ai
3572 vec_float(vector
unsigned int __a
) {
3573 return __builtin_convertvector(__a
, vector
float);
3577 static __inline__ vector
float __ATTRS_o_ai
3578 vec_float2(vector
signed long long __a
, vector
signed long long __b
) {
3579 return (vector
float) { __a
[0], __a
[1], __b
[0], __b
[1] };
3582 static __inline__ vector
float __ATTRS_o_ai
3583 vec_float2(vector
unsigned long long __a
, vector
unsigned long long __b
) {
3584 return (vector
float) { __a
[0], __a
[1], __b
[0], __b
[1] };
3587 static __inline__ vector
float __ATTRS_o_ai
3588 vec_float2(vector
double __a
, vector
double __b
) {
3589 return (vector
float) { __a
[0], __a
[1], __b
[0], __b
[1] };
3592 static __inline__ vector
float __ATTRS_o_ai
3593 vec_floate(vector
signed long long __a
) {
3594 #ifdef __LITTLE_ENDIAN__
3595 vector
float __ret
= __builtin_vsx_xvcvsxdsp(__a
);
3596 return vec_sld(__ret
, __ret
, 12);
3598 return __builtin_vsx_xvcvsxdsp(__a
);
3602 static __inline__ vector
float __ATTRS_o_ai
3603 vec_floate(vector
unsigned long long __a
) {
3604 #ifdef __LITTLE_ENDIAN__
3605 vector
float __ret
= __builtin_vsx_xvcvuxdsp(__a
);
3606 return vec_sld(__ret
, __ret
, 12);
3608 return __builtin_vsx_xvcvuxdsp(__a
);
3612 static __inline__ vector
float __ATTRS_o_ai
3613 vec_floate(vector
double __a
) {
3614 #ifdef __LITTLE_ENDIAN__
3615 vector
float __ret
= __builtin_vsx_xvcvdpsp(__a
);
3616 return vec_sld(__ret
, __ret
, 12);
3618 return __builtin_vsx_xvcvdpsp(__a
);
3622 static __inline__ vector
float __ATTRS_o_ai
3623 vec_floato(vector
signed long long __a
) {
3624 #ifdef __LITTLE_ENDIAN__
3625 return __builtin_vsx_xvcvsxdsp(__a
);
3627 vector
float __ret
= __builtin_vsx_xvcvsxdsp(__a
);
3628 return vec_sld(__ret
, __ret
, 12);
3632 static __inline__ vector
float __ATTRS_o_ai
3633 vec_floato(vector
unsigned long long __a
) {
3634 #ifdef __LITTLE_ENDIAN__
3635 return __builtin_vsx_xvcvuxdsp(__a
);
3637 vector
float __ret
= __builtin_vsx_xvcvuxdsp(__a
);
3638 return vec_sld(__ret
, __ret
, 12);
3642 static __inline__ vector
float __ATTRS_o_ai
3643 vec_floato(vector
double __a
) {
3644 #ifdef __LITTLE_ENDIAN__
3645 return __builtin_vsx_xvcvdpsp(__a
);
3647 vector
float __ret
= __builtin_vsx_xvcvdpsp(__a
);
3648 return vec_sld(__ret
, __ret
, 12);
3656 static __inline__ vector
double __ATTRS_o_ai
3657 vec_double(vector
signed long long __a
) {
3658 return __builtin_convertvector(__a
, vector
double);
3661 static __inline__ vector
double __ATTRS_o_ai
3662 vec_double(vector
unsigned long long __a
) {
3663 return __builtin_convertvector(__a
, vector
double);
3666 static __inline__ vector
double __ATTRS_o_ai
3667 vec_doublee(vector
signed int __a
) {
3668 #ifdef __LITTLE_ENDIAN__
3669 return __builtin_vsx_xvcvsxwdp(vec_sld(__a
, __a
, 4));
3671 return __builtin_vsx_xvcvsxwdp(__a
);
3675 static __inline__ vector
double __ATTRS_o_ai
3676 vec_doublee(vector
unsigned int __a
) {
3677 #ifdef __LITTLE_ENDIAN__
3678 return __builtin_vsx_xvcvuxwdp(vec_sld(__a
, __a
, 4));
3680 return __builtin_vsx_xvcvuxwdp(__a
);
3684 static __inline__ vector
double __ATTRS_o_ai
3685 vec_doublee(vector
float __a
) {
3686 #ifdef __LITTLE_ENDIAN__
3687 return __builtin_vsx_xvcvspdp(vec_sld(__a
, __a
, 4));
3689 return __builtin_vsx_xvcvspdp(__a
);
3693 static __inline__ vector
double __ATTRS_o_ai
3694 vec_doubleh(vector
signed int __a
) {
3695 vector
double __ret
= {__a
[0], __a
[1]};
3699 static __inline__ vector
double __ATTRS_o_ai
3700 vec_doubleh(vector
unsigned int __a
) {
3701 vector
double __ret
= {__a
[0], __a
[1]};
3705 static __inline__ vector
double __ATTRS_o_ai
3706 vec_doubleh(vector
float __a
) {
3707 vector
double __ret
= {__a
[0], __a
[1]};
3711 static __inline__ vector
double __ATTRS_o_ai
3712 vec_doublel(vector
signed int __a
) {
3713 vector
double __ret
= {__a
[2], __a
[3]};
3717 static __inline__ vector
double __ATTRS_o_ai
3718 vec_doublel(vector
unsigned int __a
) {
3719 vector
double __ret
= {__a
[2], __a
[3]};
3723 static __inline__ vector
double __ATTRS_o_ai
3724 vec_doublel(vector
float __a
) {
3725 vector
double __ret
= {__a
[2], __a
[3]};
3729 static __inline__ vector
double __ATTRS_o_ai
3730 vec_doubleo(vector
signed int __a
) {
3731 #ifdef __LITTLE_ENDIAN__
3732 return __builtin_vsx_xvcvsxwdp(__a
);
3734 return __builtin_vsx_xvcvsxwdp(vec_sld(__a
, __a
, 4));
3738 static __inline__ vector
double __ATTRS_o_ai
3739 vec_doubleo(vector
unsigned int __a
) {
3740 #ifdef __LITTLE_ENDIAN__
3741 return __builtin_vsx_xvcvuxwdp(__a
);
3743 return __builtin_vsx_xvcvuxwdp(vec_sld(__a
, __a
, 4));
3747 static __inline__ vector
double __ATTRS_o_ai
3748 vec_doubleo(vector
float __a
) {
3749 #ifdef __LITTLE_ENDIAN__
3750 return __builtin_vsx_xvcvspdp(__a
);
3752 return __builtin_vsx_xvcvspdp(vec_sld(__a
, __a
, 4));
3757 static __inline__ vector
double __ATTRS_o_ai
vec_cvf(vector
float __a
) {
3758 return vec_doublee(__a
);
3761 static __inline__ vector
float __ATTRS_o_ai
vec_cvf(vector
double __a
) {
3762 return vec_floate(__a
);
3768 /* Integer vector divides (vectors are scalarized, elements divided
3769 and the vectors reassembled).
3771 static __inline__ vector
signed char __ATTRS_o_ai
3772 vec_div(vector
signed char __a
, vector
signed char __b
) {
3776 static __inline__ vector
unsigned char __ATTRS_o_ai
3777 vec_div(vector
unsigned char __a
, vector
unsigned char __b
) {
3781 static __inline__ vector
signed short __ATTRS_o_ai
3782 vec_div(vector
signed short __a
, vector
signed short __b
) {
3786 static __inline__ vector
unsigned short __ATTRS_o_ai
3787 vec_div(vector
unsigned short __a
, vector
unsigned short __b
) {
3791 static __inline__ vector
signed int __ATTRS_o_ai
3792 vec_div(vector
signed int __a
, vector
signed int __b
) {
3796 static __inline__ vector
unsigned int __ATTRS_o_ai
3797 vec_div(vector
unsigned int __a
, vector
unsigned int __b
) {
3802 static __inline__ vector
signed long long __ATTRS_o_ai
3803 vec_div(vector
signed long long __a
, vector
signed long long __b
) {
3807 static __inline__ vector
unsigned long long __ATTRS_o_ai
3808 vec_div(vector
unsigned long long __a
, vector
unsigned long long __b
) {
3812 static __inline__ vector
float __ATTRS_o_ai
vec_div(vector
float __a
,
3817 static __inline__ vector
double __ATTRS_o_ai
vec_div(vector
double __a
,
3818 vector
double __b
) {
3825 #ifdef __POWER10_VECTOR__
3826 static __inline__ vector
signed int __ATTRS_o_ai
3827 vec_dive(vector
signed int __a
, vector
signed int __b
) {
3828 return __builtin_altivec_vdivesw(__a
, __b
);
3831 static __inline__ vector
unsigned int __ATTRS_o_ai
3832 vec_dive(vector
unsigned int __a
, vector
unsigned int __b
) {
3833 return __builtin_altivec_vdiveuw(__a
, __b
);
3836 static __inline__ vector
signed long long __ATTRS_o_ai
3837 vec_dive(vector
signed long long __a
, vector
signed long long __b
) {
3838 return __builtin_altivec_vdivesd(__a
, __b
);
3841 static __inline__ vector
unsigned long long __ATTRS_o_ai
3842 vec_dive(vector
unsigned long long __a
, vector
unsigned long long __b
) {
3843 return __builtin_altivec_vdiveud(__a
, __b
);
3846 #ifdef __SIZEOF_INT128__
3847 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
3848 vec_dive(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
3849 return __builtin_altivec_vdiveuq(__a
, __b
);
3852 static __inline__ vector
signed __int128 __ATTRS_o_ai
3853 vec_dive(vector
signed __int128 __a
, vector
signed __int128 __b
) {
3854 return __builtin_altivec_vdivesq(__a
, __b
);
3859 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3860 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
3861 vec_div(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
3865 static __inline__ vector
signed __int128 __ATTRS_o_ai
3866 vec_div(vector
signed __int128 __a
, vector
signed __int128 __b
) {
3869 #endif /* __POWER10_VECTOR__ */
3874 static __inline__
int __ATTRS_o_ai
vec_test_swdiv(vector
double __a
,
3875 vector
double __b
) {
3876 return __builtin_vsx_xvtdivdp(__a
, __b
);
3879 static __inline__
int __ATTRS_o_ai
vec_test_swdivs(vector
float __a
,
3881 return __builtin_vsx_xvtdivsp(__a
, __b
);
3887 #define vec_dss __builtin_altivec_dss
3891 static __inline__
void __attribute__((__always_inline__
)) vec_dssall(void) {
3892 __builtin_altivec_dssall();
3896 #define vec_dst(__PTR, __CW, __STR) \
3897 __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))
3900 #define vec_dstst(__PTR, __CW, __STR) \
3901 __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))
3904 #define vec_dststt(__PTR, __CW, __STR) \
3905 __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))
3908 #define vec_dstt(__PTR, __CW, __STR) \
3909 __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))
3913 #ifdef __POWER8_VECTOR__
3914 static __inline__ vector
signed char __ATTRS_o_ai
3915 vec_eqv(vector
signed char __a
, vector
signed char __b
) {
3916 return (vector
signed char)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3917 (vector
unsigned int)__b
);
3920 static __inline__ vector
unsigned char __ATTRS_o_ai
3921 vec_eqv(vector
unsigned char __a
, vector
unsigned char __b
) {
3922 return (vector
unsigned char)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3923 (vector
unsigned int)__b
);
3926 static __inline__ vector
bool char __ATTRS_o_ai
vec_eqv(vector
bool char __a
,
3927 vector
bool char __b
) {
3928 return (vector
bool char)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3929 (vector
unsigned int)__b
);
3932 static __inline__ vector
signed short __ATTRS_o_ai
3933 vec_eqv(vector
signed short __a
, vector
signed short __b
) {
3934 return (vector
signed short)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3935 (vector
unsigned int)__b
);
3938 static __inline__ vector
unsigned short __ATTRS_o_ai
3939 vec_eqv(vector
unsigned short __a
, vector
unsigned short __b
) {
3940 return (vector
unsigned short)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3941 (vector
unsigned int)__b
);
3944 static __inline__ vector
bool short __ATTRS_o_ai
3945 vec_eqv(vector
bool short __a
, vector
bool short __b
) {
3946 return (vector
bool short)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3947 (vector
unsigned int)__b
);
3950 static __inline__ vector
signed int __ATTRS_o_ai
3951 vec_eqv(vector
signed int __a
, vector
signed int __b
) {
3952 return (vector
signed int)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3953 (vector
unsigned int)__b
);
3956 static __inline__ vector
unsigned int __ATTRS_o_ai
3957 vec_eqv(vector
unsigned int __a
, vector
unsigned int __b
) {
3958 return __builtin_vsx_xxleqv(__a
, __b
);
3961 static __inline__ vector
bool int __ATTRS_o_ai
vec_eqv(vector
bool int __a
,
3962 vector
bool int __b
) {
3963 return (vector
bool int)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3964 (vector
unsigned int)__b
);
3967 static __inline__ vector
signed long long __ATTRS_o_ai
3968 vec_eqv(vector
signed long long __a
, vector
signed long long __b
) {
3969 return (vector
signed long long)__builtin_vsx_xxleqv(
3970 (vector
unsigned int)__a
, (vector
unsigned int)__b
);
3973 static __inline__ vector
unsigned long long __ATTRS_o_ai
3974 vec_eqv(vector
unsigned long long __a
, vector
unsigned long long __b
) {
3975 return (vector
unsigned long long)__builtin_vsx_xxleqv(
3976 (vector
unsigned int)__a
, (vector
unsigned int)__b
);
3979 static __inline__ vector
bool long long __ATTRS_o_ai
3980 vec_eqv(vector
bool long long __a
, vector
bool long long __b
) {
3981 return (vector
bool long long)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3982 (vector
unsigned int)__b
);
3985 static __inline__ vector
float __ATTRS_o_ai
vec_eqv(vector
float __a
,
3987 return (vector
float)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3988 (vector
unsigned int)__b
);
3991 static __inline__ vector
double __ATTRS_o_ai
vec_eqv(vector
double __a
,
3992 vector
double __b
) {
3993 return (vector
double)__builtin_vsx_xxleqv((vector
unsigned int)__a
,
3994 (vector
unsigned int)__b
);
4000 static __inline__ vector
float __attribute__((__always_inline__
))
4001 vec_expte(vector
float __a
) {
4002 return __builtin_altivec_vexptefp(__a
);
4007 static __inline__ vector
float __attribute__((__always_inline__
))
4008 vec_vexptefp(vector
float __a
) {
4009 return __builtin_altivec_vexptefp(__a
);
4014 static __inline__ vector
float __ATTRS_o_ai
vec_floor(vector
float __a
) {
4016 return __builtin_vsx_xvrspim(__a
);
4018 return __builtin_altivec_vrfim(__a
);
4023 static __inline__ vector
double __ATTRS_o_ai
vec_floor(vector
double __a
) {
4024 return __builtin_vsx_xvrdpim(__a
);
4029 static __inline__ vector
float __ATTRS_o_ai
vec_roundm(vector
float __a
) {
4030 return vec_floor(__a
);
4034 static __inline__ vector
double __ATTRS_o_ai
vec_roundm(vector
double __a
) {
4035 return vec_floor(__a
);
4041 static __inline__ vector
float __attribute__((__always_inline__
))
4042 vec_vrfim(vector
float __a
) {
4043 return __builtin_altivec_vrfim(__a
);
4048 static __inline__ vector
signed char __ATTRS_o_ai
4049 vec_ld(long __a
, const vector
signed char *__b
) {
4050 return (vector
signed char)__builtin_altivec_lvx(__a
, __b
);
4053 static __inline__ vector
signed char __ATTRS_o_ai
4054 vec_ld(long __a
, const signed char *__b
) {
4055 return (vector
signed char)__builtin_altivec_lvx(__a
, __b
);
4058 static __inline__ vector
unsigned char __ATTRS_o_ai
4059 vec_ld(long __a
, const vector
unsigned char *__b
) {
4060 return (vector
unsigned char)__builtin_altivec_lvx(__a
, __b
);
4063 static __inline__ vector
unsigned char __ATTRS_o_ai
4064 vec_ld(long __a
, const unsigned char *__b
) {
4065 return (vector
unsigned char)__builtin_altivec_lvx(__a
, __b
);
4068 static __inline__ vector
bool char __ATTRS_o_ai
4069 vec_ld(long __a
, const vector
bool char *__b
) {
4070 return (vector
bool char)__builtin_altivec_lvx(__a
, __b
);
4073 static __inline__ vector
short __ATTRS_o_ai
vec_ld(long __a
,
4074 const vector
short *__b
) {
4075 return (vector
short)__builtin_altivec_lvx(__a
, __b
);
4078 static __inline__ vector
short __ATTRS_o_ai
vec_ld(long __a
, const short *__b
) {
4079 return (vector
short)__builtin_altivec_lvx(__a
, __b
);
4082 static __inline__ vector
unsigned short __ATTRS_o_ai
4083 vec_ld(long __a
, const vector
unsigned short *__b
) {
4084 return (vector
unsigned short)__builtin_altivec_lvx(__a
, __b
);
4087 static __inline__ vector
unsigned short __ATTRS_o_ai
4088 vec_ld(long __a
, const unsigned short *__b
) {
4089 return (vector
unsigned short)__builtin_altivec_lvx(__a
, __b
);
4092 static __inline__ vector
bool short __ATTRS_o_ai
4093 vec_ld(long __a
, const vector
bool short *__b
) {
4094 return (vector
bool short)__builtin_altivec_lvx(__a
, __b
);
4097 static __inline__ vector pixel __ATTRS_o_ai
vec_ld(long __a
,
4098 const vector pixel
*__b
) {
4099 return (vector pixel
)__builtin_altivec_lvx(__a
, __b
);
4102 static __inline__ vector
int __ATTRS_o_ai
vec_ld(long __a
,
4103 const vector
int *__b
) {
4104 return (vector
int)__builtin_altivec_lvx(__a
, __b
);
4107 static __inline__ vector
int __ATTRS_o_ai
vec_ld(long __a
, const int *__b
) {
4108 return (vector
int)__builtin_altivec_lvx(__a
, __b
);
4111 static __inline__ vector
unsigned int __ATTRS_o_ai
4112 vec_ld(long __a
, const vector
unsigned int *__b
) {
4113 return (vector
unsigned int)__builtin_altivec_lvx(__a
, __b
);
4116 static __inline__ vector
unsigned int __ATTRS_o_ai
4117 vec_ld(long __a
, const unsigned int *__b
) {
4118 return (vector
unsigned int)__builtin_altivec_lvx(__a
, __b
);
4121 static __inline__ vector
bool int __ATTRS_o_ai
4122 vec_ld(long __a
, const vector
bool int *__b
) {
4123 return (vector
bool int)__builtin_altivec_lvx(__a
, __b
);
4126 static __inline__ vector
float __ATTRS_o_ai
vec_ld(long __a
,
4127 const vector
float *__b
) {
4128 return (vector
float)__builtin_altivec_lvx(__a
, __b
);
4131 static __inline__ vector
float __ATTRS_o_ai
vec_ld(long __a
, const float *__b
) {
4132 return (vector
float)__builtin_altivec_lvx(__a
, __b
);
4137 static __inline__ vector
signed char __ATTRS_o_ai
4138 vec_lvx(long __a
, const vector
signed char *__b
) {
4139 return (vector
signed char)__builtin_altivec_lvx(__a
, __b
);
4142 static __inline__ vector
signed char __ATTRS_o_ai
4143 vec_lvx(long __a
, const signed char *__b
) {
4144 return (vector
signed char)__builtin_altivec_lvx(__a
, __b
);
4147 static __inline__ vector
unsigned char __ATTRS_o_ai
4148 vec_lvx(long __a
, const vector
unsigned char *__b
) {
4149 return (vector
unsigned char)__builtin_altivec_lvx(__a
, __b
);
4152 static __inline__ vector
unsigned char __ATTRS_o_ai
4153 vec_lvx(long __a
, const unsigned char *__b
) {
4154 return (vector
unsigned char)__builtin_altivec_lvx(__a
, __b
);
4157 static __inline__ vector
bool char __ATTRS_o_ai
4158 vec_lvx(long __a
, const vector
bool char *__b
) {
4159 return (vector
bool char)__builtin_altivec_lvx(__a
, __b
);
4162 static __inline__ vector
short __ATTRS_o_ai
vec_lvx(long __a
,
4163 const vector
short *__b
) {
4164 return (vector
short)__builtin_altivec_lvx(__a
, __b
);
4167 static __inline__ vector
short __ATTRS_o_ai
vec_lvx(long __a
, const short *__b
) {
4168 return (vector
short)__builtin_altivec_lvx(__a
, __b
);
4171 static __inline__ vector
unsigned short __ATTRS_o_ai
4172 vec_lvx(long __a
, const vector
unsigned short *__b
) {
4173 return (vector
unsigned short)__builtin_altivec_lvx(__a
, __b
);
4176 static __inline__ vector
unsigned short __ATTRS_o_ai
4177 vec_lvx(long __a
, const unsigned short *__b
) {
4178 return (vector
unsigned short)__builtin_altivec_lvx(__a
, __b
);
4181 static __inline__ vector
bool short __ATTRS_o_ai
4182 vec_lvx(long __a
, const vector
bool short *__b
) {
4183 return (vector
bool short)__builtin_altivec_lvx(__a
, __b
);
4186 static __inline__ vector pixel __ATTRS_o_ai
vec_lvx(long __a
,
4187 const vector pixel
*__b
) {
4188 return (vector pixel
)__builtin_altivec_lvx(__a
, __b
);
4191 static __inline__ vector
int __ATTRS_o_ai
vec_lvx(long __a
,
4192 const vector
int *__b
) {
4193 return (vector
int)__builtin_altivec_lvx(__a
, __b
);
4196 static __inline__ vector
int __ATTRS_o_ai
vec_lvx(long __a
, const int *__b
) {
4197 return (vector
int)__builtin_altivec_lvx(__a
, __b
);
4200 static __inline__ vector
unsigned int __ATTRS_o_ai
4201 vec_lvx(long __a
, const vector
unsigned int *__b
) {
4202 return (vector
unsigned int)__builtin_altivec_lvx(__a
, __b
);
4205 static __inline__ vector
unsigned int __ATTRS_o_ai
4206 vec_lvx(long __a
, const unsigned int *__b
) {
4207 return (vector
unsigned int)__builtin_altivec_lvx(__a
, __b
);
4210 static __inline__ vector
bool int __ATTRS_o_ai
4211 vec_lvx(long __a
, const vector
bool int *__b
) {
4212 return (vector
bool int)__builtin_altivec_lvx(__a
, __b
);
4215 static __inline__ vector
float __ATTRS_o_ai
vec_lvx(long __a
,
4216 const vector
float *__b
) {
4217 return (vector
float)__builtin_altivec_lvx(__a
, __b
);
4220 static __inline__ vector
float __ATTRS_o_ai
vec_lvx(long __a
, const float *__b
) {
4221 return (vector
float)__builtin_altivec_lvx(__a
, __b
);
4226 static __inline__ vector
signed char __ATTRS_o_ai
4227 vec_lde(long __a
, const signed char *__b
) {
4228 return (vector
signed char)__builtin_altivec_lvebx(__a
, __b
);
4231 static __inline__ vector
unsigned char __ATTRS_o_ai
4232 vec_lde(long __a
, const unsigned char *__b
) {
4233 return (vector
unsigned char)__builtin_altivec_lvebx(__a
, __b
);
4236 static __inline__ vector
short __ATTRS_o_ai
vec_lde(long __a
, const short *__b
) {
4237 return (vector
short)__builtin_altivec_lvehx(__a
, __b
);
4240 static __inline__ vector
unsigned short __ATTRS_o_ai
4241 vec_lde(long __a
, const unsigned short *__b
) {
4242 return (vector
unsigned short)__builtin_altivec_lvehx(__a
, __b
);
4245 static __inline__ vector
int __ATTRS_o_ai
vec_lde(long __a
, const int *__b
) {
4246 return (vector
int)__builtin_altivec_lvewx(__a
, __b
);
4249 static __inline__ vector
unsigned int __ATTRS_o_ai
4250 vec_lde(long __a
, const unsigned int *__b
) {
4251 return (vector
unsigned int)__builtin_altivec_lvewx(__a
, __b
);
4254 static __inline__ vector
float __ATTRS_o_ai
vec_lde(long __a
, const float *__b
) {
4255 return (vector
float)__builtin_altivec_lvewx(__a
, __b
);
4260 static __inline__ vector
signed char __ATTRS_o_ai
4261 vec_lvebx(long __a
, const signed char *__b
) {
4262 return (vector
signed char)__builtin_altivec_lvebx(__a
, __b
);
4265 static __inline__ vector
unsigned char __ATTRS_o_ai
4266 vec_lvebx(long __a
, const unsigned char *__b
) {
4267 return (vector
unsigned char)__builtin_altivec_lvebx(__a
, __b
);
4272 static __inline__ vector
short __ATTRS_o_ai
vec_lvehx(long __a
,
4274 return (vector
short)__builtin_altivec_lvehx(__a
, __b
);
4277 static __inline__ vector
unsigned short __ATTRS_o_ai
4278 vec_lvehx(long __a
, const unsigned short *__b
) {
4279 return (vector
unsigned short)__builtin_altivec_lvehx(__a
, __b
);
4284 static __inline__ vector
int __ATTRS_o_ai
vec_lvewx(long __a
, const int *__b
) {
4285 return (vector
int)__builtin_altivec_lvewx(__a
, __b
);
4288 static __inline__ vector
unsigned int __ATTRS_o_ai
4289 vec_lvewx(long __a
, const unsigned int *__b
) {
4290 return (vector
unsigned int)__builtin_altivec_lvewx(__a
, __b
);
4293 static __inline__ vector
float __ATTRS_o_ai
vec_lvewx(long __a
,
4295 return (vector
float)__builtin_altivec_lvewx(__a
, __b
);
4300 static __inline__ vector
signed char __ATTRS_o_ai
4301 vec_ldl(long __a
, const vector
signed char *__b
) {
4302 return (vector
signed char)__builtin_altivec_lvxl(__a
, __b
);
4305 static __inline__ vector
signed char __ATTRS_o_ai
4306 vec_ldl(long __a
, const signed char *__b
) {
4307 return (vector
signed char)__builtin_altivec_lvxl(__a
, __b
);
4310 static __inline__ vector
unsigned char __ATTRS_o_ai
4311 vec_ldl(long __a
, const vector
unsigned char *__b
) {
4312 return (vector
unsigned char)__builtin_altivec_lvxl(__a
, __b
);
4315 static __inline__ vector
unsigned char __ATTRS_o_ai
4316 vec_ldl(long __a
, const unsigned char *__b
) {
4317 return (vector
unsigned char)__builtin_altivec_lvxl(__a
, __b
);
4320 static __inline__ vector
bool char __ATTRS_o_ai
4321 vec_ldl(long __a
, const vector
bool char *__b
) {
4322 return (vector
bool char)__builtin_altivec_lvxl(__a
, __b
);
4325 static __inline__ vector
short __ATTRS_o_ai
vec_ldl(long __a
,
4326 const vector
short *__b
) {
4327 return (vector
short)__builtin_altivec_lvxl(__a
, __b
);
4330 static __inline__ vector
short __ATTRS_o_ai
vec_ldl(long __a
, const short *__b
) {
4331 return (vector
short)__builtin_altivec_lvxl(__a
, __b
);
4334 static __inline__ vector
unsigned short __ATTRS_o_ai
4335 vec_ldl(long __a
, const vector
unsigned short *__b
) {
4336 return (vector
unsigned short)__builtin_altivec_lvxl(__a
, __b
);
4339 static __inline__ vector
unsigned short __ATTRS_o_ai
4340 vec_ldl(long __a
, const unsigned short *__b
) {
4341 return (vector
unsigned short)__builtin_altivec_lvxl(__a
, __b
);
4344 static __inline__ vector
bool short __ATTRS_o_ai
4345 vec_ldl(long __a
, const vector
bool short *__b
) {
4346 return (vector
bool short)__builtin_altivec_lvxl(__a
, __b
);
4349 static __inline__ vector pixel __ATTRS_o_ai
vec_ldl(long __a
,
4350 const vector pixel
*__b
) {
4351 return (vector pixel
short)__builtin_altivec_lvxl(__a
, __b
);
4354 static __inline__ vector
int __ATTRS_o_ai
vec_ldl(long __a
,
4355 const vector
int *__b
) {
4356 return (vector
int)__builtin_altivec_lvxl(__a
, __b
);
4359 static __inline__ vector
int __ATTRS_o_ai
vec_ldl(long __a
, const int *__b
) {
4360 return (vector
int)__builtin_altivec_lvxl(__a
, __b
);
4363 static __inline__ vector
unsigned int __ATTRS_o_ai
4364 vec_ldl(long __a
, const vector
unsigned int *__b
) {
4365 return (vector
unsigned int)__builtin_altivec_lvxl(__a
, __b
);
4368 static __inline__ vector
unsigned int __ATTRS_o_ai
4369 vec_ldl(long __a
, const unsigned int *__b
) {
4370 return (vector
unsigned int)__builtin_altivec_lvxl(__a
, __b
);
4373 static __inline__ vector
bool int __ATTRS_o_ai
4374 vec_ldl(long __a
, const vector
bool int *__b
) {
4375 return (vector
bool int)__builtin_altivec_lvxl(__a
, __b
);
4378 static __inline__ vector
float __ATTRS_o_ai
vec_ldl(long __a
,
4379 const vector
float *__b
) {
4380 return (vector
float)__builtin_altivec_lvxl(__a
, __b
);
4383 static __inline__ vector
float __ATTRS_o_ai
vec_ldl(long __a
, const float *__b
) {
4384 return (vector
float)__builtin_altivec_lvxl(__a
, __b
);
4389 static __inline__ vector
signed char __ATTRS_o_ai
4390 vec_lvxl(long __a
, const vector
signed char *__b
) {
4391 return (vector
signed char)__builtin_altivec_lvxl(__a
, __b
);
4394 static __inline__ vector
signed char __ATTRS_o_ai
4395 vec_lvxl(long __a
, const signed char *__b
) {
4396 return (vector
signed char)__builtin_altivec_lvxl(__a
, __b
);
4399 static __inline__ vector
unsigned char __ATTRS_o_ai
4400 vec_lvxl(long __a
, const vector
unsigned char *__b
) {
4401 return (vector
unsigned char)__builtin_altivec_lvxl(__a
, __b
);
4404 static __inline__ vector
unsigned char __ATTRS_o_ai
4405 vec_lvxl(long __a
, const unsigned char *__b
) {
4406 return (vector
unsigned char)__builtin_altivec_lvxl(__a
, __b
);
4409 static __inline__ vector
bool char __ATTRS_o_ai
4410 vec_lvxl(long __a
, const vector
bool char *__b
) {
4411 return (vector
bool char)__builtin_altivec_lvxl(__a
, __b
);
4414 static __inline__ vector
short __ATTRS_o_ai
vec_lvxl(long __a
,
4415 const vector
short *__b
) {
4416 return (vector
short)__builtin_altivec_lvxl(__a
, __b
);
4419 static __inline__ vector
short __ATTRS_o_ai
vec_lvxl(long __a
,
4421 return (vector
short)__builtin_altivec_lvxl(__a
, __b
);
4424 static __inline__ vector
unsigned short __ATTRS_o_ai
4425 vec_lvxl(long __a
, const vector
unsigned short *__b
) {
4426 return (vector
unsigned short)__builtin_altivec_lvxl(__a
, __b
);
4429 static __inline__ vector
unsigned short __ATTRS_o_ai
4430 vec_lvxl(long __a
, const unsigned short *__b
) {
4431 return (vector
unsigned short)__builtin_altivec_lvxl(__a
, __b
);
4434 static __inline__ vector
bool short __ATTRS_o_ai
4435 vec_lvxl(long __a
, const vector
bool short *__b
) {
4436 return (vector
bool short)__builtin_altivec_lvxl(__a
, __b
);
4439 static __inline__ vector pixel __ATTRS_o_ai
vec_lvxl(long __a
,
4440 const vector pixel
*__b
) {
4441 return (vector pixel
)__builtin_altivec_lvxl(__a
, __b
);
4444 static __inline__ vector
int __ATTRS_o_ai
vec_lvxl(long __a
,
4445 const vector
int *__b
) {
4446 return (vector
int)__builtin_altivec_lvxl(__a
, __b
);
4449 static __inline__ vector
int __ATTRS_o_ai
vec_lvxl(long __a
, const int *__b
) {
4450 return (vector
int)__builtin_altivec_lvxl(__a
, __b
);
4453 static __inline__ vector
unsigned int __ATTRS_o_ai
4454 vec_lvxl(long __a
, const vector
unsigned int *__b
) {
4455 return (vector
unsigned int)__builtin_altivec_lvxl(__a
, __b
);
4458 static __inline__ vector
unsigned int __ATTRS_o_ai
4459 vec_lvxl(long __a
, const unsigned int *__b
) {
4460 return (vector
unsigned int)__builtin_altivec_lvxl(__a
, __b
);
4463 static __inline__ vector
bool int __ATTRS_o_ai
4464 vec_lvxl(long __a
, const vector
bool int *__b
) {
4465 return (vector
bool int)__builtin_altivec_lvxl(__a
, __b
);
4468 static __inline__ vector
float __ATTRS_o_ai
vec_lvxl(long __a
,
4469 const vector
float *__b
) {
4470 return (vector
float)__builtin_altivec_lvxl(__a
, __b
);
4473 static __inline__ vector
float __ATTRS_o_ai
vec_lvxl(long __a
,
4475 return (vector
float)__builtin_altivec_lvxl(__a
, __b
);
4480 static __inline__ vector
float __attribute__((__always_inline__
))
4481 vec_loge(vector
float __a
) {
4482 return __builtin_altivec_vlogefp(__a
);
4487 static __inline__ vector
float __attribute__((__always_inline__
))
4488 vec_vlogefp(vector
float __a
) {
4489 return __builtin_altivec_vlogefp(__a
);
4494 #ifdef __LITTLE_ENDIAN__
4495 static __inline__ vector
unsigned char __ATTRS_o_ai
4496 __attribute__((__deprecated__("use assignment for unaligned little endian \
4497 loads/stores"))) vec_lvsl(int __a
, const signed char *__b
) {
4498 vector
unsigned char mask
=
4499 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4500 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4501 7, 6, 5, 4, 3, 2, 1, 0};
4502 return vec_perm(mask
, mask
, reverse
);
4505 static __inline__ vector
unsigned char __ATTRS_o_ai
4506 vec_lvsl(int __a
, const signed char *__b
) {
4507 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4511 #ifdef __LITTLE_ENDIAN__
4512 static __inline__ vector
unsigned char __ATTRS_o_ai
4513 __attribute__((__deprecated__("use assignment for unaligned little endian \
4514 loads/stores"))) vec_lvsl(int __a
, const unsigned char *__b
) {
4515 vector
unsigned char mask
=
4516 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4517 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4518 7, 6, 5, 4, 3, 2, 1, 0};
4519 return vec_perm(mask
, mask
, reverse
);
4522 static __inline__ vector
unsigned char __ATTRS_o_ai
4523 vec_lvsl(int __a
, const unsigned char *__b
) {
4524 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4528 #ifdef __LITTLE_ENDIAN__
4529 static __inline__ vector
unsigned char __ATTRS_o_ai
4530 __attribute__((__deprecated__("use assignment for unaligned little endian \
4531 loads/stores"))) vec_lvsl(int __a
, const short *__b
) {
4532 vector
unsigned char mask
=
4533 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4534 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4535 7, 6, 5, 4, 3, 2, 1, 0};
4536 return vec_perm(mask
, mask
, reverse
);
4539 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_lvsl(int __a
,
4541 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4545 #ifdef __LITTLE_ENDIAN__
4546 static __inline__ vector
unsigned char __ATTRS_o_ai
4547 __attribute__((__deprecated__("use assignment for unaligned little endian \
4548 loads/stores"))) vec_lvsl(int __a
, const unsigned short *__b
) {
4549 vector
unsigned char mask
=
4550 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4551 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4552 7, 6, 5, 4, 3, 2, 1, 0};
4553 return vec_perm(mask
, mask
, reverse
);
4556 static __inline__ vector
unsigned char __ATTRS_o_ai
4557 vec_lvsl(int __a
, const unsigned short *__b
) {
4558 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4562 #ifdef __LITTLE_ENDIAN__
4563 static __inline__ vector
unsigned char __ATTRS_o_ai
4564 __attribute__((__deprecated__("use assignment for unaligned little endian \
4565 loads/stores"))) vec_lvsl(int __a
, const int *__b
) {
4566 vector
unsigned char mask
=
4567 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4568 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4569 7, 6, 5, 4, 3, 2, 1, 0};
4570 return vec_perm(mask
, mask
, reverse
);
4573 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_lvsl(int __a
,
4575 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4579 #ifdef __LITTLE_ENDIAN__
4580 static __inline__ vector
unsigned char __ATTRS_o_ai
4581 __attribute__((__deprecated__("use assignment for unaligned little endian \
4582 loads/stores"))) vec_lvsl(int __a
, const unsigned int *__b
) {
4583 vector
unsigned char mask
=
4584 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4585 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4586 7, 6, 5, 4, 3, 2, 1, 0};
4587 return vec_perm(mask
, mask
, reverse
);
4590 static __inline__ vector
unsigned char __ATTRS_o_ai
4591 vec_lvsl(int __a
, const unsigned int *__b
) {
4592 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4596 #ifdef __LITTLE_ENDIAN__
4597 static __inline__ vector
unsigned char __ATTRS_o_ai
4598 __attribute__((__deprecated__("use assignment for unaligned little endian \
4599 loads/stores"))) vec_lvsl(int __a
, const float *__b
) {
4600 vector
unsigned char mask
=
4601 (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4602 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4603 7, 6, 5, 4, 3, 2, 1, 0};
4604 return vec_perm(mask
, mask
, reverse
);
4607 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_lvsl(int __a
,
4609 return (vector
unsigned char)__builtin_altivec_lvsl(__a
, __b
);
4615 #ifdef __LITTLE_ENDIAN__
4616 static __inline__ vector
unsigned char __ATTRS_o_ai
4617 __attribute__((__deprecated__("use assignment for unaligned little endian \
4618 loads/stores"))) vec_lvsr(int __a
, const signed char *__b
) {
4619 vector
unsigned char mask
=
4620 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4621 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4622 7, 6, 5, 4, 3, 2, 1, 0};
4623 return vec_perm(mask
, mask
, reverse
);
4626 static __inline__ vector
unsigned char __ATTRS_o_ai
4627 vec_lvsr(int __a
, const signed char *__b
) {
4628 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4632 #ifdef __LITTLE_ENDIAN__
4633 static __inline__ vector
unsigned char __ATTRS_o_ai
4634 __attribute__((__deprecated__("use assignment for unaligned little endian \
4635 loads/stores"))) vec_lvsr(int __a
, const unsigned char *__b
) {
4636 vector
unsigned char mask
=
4637 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4638 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4639 7, 6, 5, 4, 3, 2, 1, 0};
4640 return vec_perm(mask
, mask
, reverse
);
4643 static __inline__ vector
unsigned char __ATTRS_o_ai
4644 vec_lvsr(int __a
, const unsigned char *__b
) {
4645 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4649 #ifdef __LITTLE_ENDIAN__
4650 static __inline__ vector
unsigned char __ATTRS_o_ai
4651 __attribute__((__deprecated__("use assignment for unaligned little endian \
4652 loads/stores"))) vec_lvsr(int __a
, const short *__b
) {
4653 vector
unsigned char mask
=
4654 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4655 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4656 7, 6, 5, 4, 3, 2, 1, 0};
4657 return vec_perm(mask
, mask
, reverse
);
4660 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_lvsr(int __a
,
4662 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4666 #ifdef __LITTLE_ENDIAN__
4667 static __inline__ vector
unsigned char __ATTRS_o_ai
4668 __attribute__((__deprecated__("use assignment for unaligned little endian \
4669 loads/stores"))) vec_lvsr(int __a
, const unsigned short *__b
) {
4670 vector
unsigned char mask
=
4671 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4672 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4673 7, 6, 5, 4, 3, 2, 1, 0};
4674 return vec_perm(mask
, mask
, reverse
);
4677 static __inline__ vector
unsigned char __ATTRS_o_ai
4678 vec_lvsr(int __a
, const unsigned short *__b
) {
4679 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4683 #ifdef __LITTLE_ENDIAN__
4684 static __inline__ vector
unsigned char __ATTRS_o_ai
4685 __attribute__((__deprecated__("use assignment for unaligned little endian \
4686 loads/stores"))) vec_lvsr(int __a
, const int *__b
) {
4687 vector
unsigned char mask
=
4688 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4689 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4690 7, 6, 5, 4, 3, 2, 1, 0};
4691 return vec_perm(mask
, mask
, reverse
);
4694 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_lvsr(int __a
,
4696 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4700 #ifdef __LITTLE_ENDIAN__
4701 static __inline__ vector
unsigned char __ATTRS_o_ai
4702 __attribute__((__deprecated__("use assignment for unaligned little endian \
4703 loads/stores"))) vec_lvsr(int __a
, const unsigned int *__b
) {
4704 vector
unsigned char mask
=
4705 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4706 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4707 7, 6, 5, 4, 3, 2, 1, 0};
4708 return vec_perm(mask
, mask
, reverse
);
4711 static __inline__ vector
unsigned char __ATTRS_o_ai
4712 vec_lvsr(int __a
, const unsigned int *__b
) {
4713 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4717 #ifdef __LITTLE_ENDIAN__
4718 static __inline__ vector
unsigned char __ATTRS_o_ai
4719 __attribute__((__deprecated__("use assignment for unaligned little endian \
4720 loads/stores"))) vec_lvsr(int __a
, const float *__b
) {
4721 vector
unsigned char mask
=
4722 (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4723 vector
unsigned char reverse
= {15, 14, 13, 12, 11, 10, 9, 8,
4724 7, 6, 5, 4, 3, 2, 1, 0};
4725 return vec_perm(mask
, mask
, reverse
);
4728 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_lvsr(int __a
,
4730 return (vector
unsigned char)__builtin_altivec_lvsr(__a
, __b
);
4735 static __inline__ vector
signed short __ATTRS_o_ai
4736 vec_mladd(vector
signed short, vector
signed short, vector
signed short);
4737 static __inline__ vector
signed short __ATTRS_o_ai
4738 vec_mladd(vector
signed short, vector
unsigned short, vector
unsigned short);
4739 static __inline__ vector
signed short __ATTRS_o_ai
4740 vec_mladd(vector
unsigned short, vector
signed short, vector
signed short);
4741 static __inline__ vector
unsigned short __ATTRS_o_ai
4742 vec_mladd(vector
unsigned short, vector
unsigned short, vector
unsigned short);
4744 static __inline__ vector
signed short __ATTRS_o_ai
vec_madd(
4745 vector
signed short __a
, vector
signed short __b
, vector
signed short __c
) {
4746 return vec_mladd(__a
, __b
, __c
);
4749 static __inline__ vector
signed short __ATTRS_o_ai
4750 vec_madd(vector
signed short __a
, vector
unsigned short __b
,
4751 vector
unsigned short __c
) {
4752 return vec_mladd(__a
, __b
, __c
);
4755 static __inline__ vector
signed short __ATTRS_o_ai
4756 vec_madd(vector
unsigned short __a
, vector
signed short __b
,
4757 vector
signed short __c
) {
4758 return vec_mladd(__a
, __b
, __c
);
4761 static __inline__ vector
unsigned short __ATTRS_o_ai
4762 vec_madd(vector
unsigned short __a
, vector
unsigned short __b
,
4763 vector
unsigned short __c
) {
4764 return vec_mladd(__a
, __b
, __c
);
4767 static __inline__ vector
float __ATTRS_o_ai
vec_madd(vector
float __a
,
4771 return __builtin_vsx_xvmaddasp(__a
, __b
, __c
);
4773 return __builtin_altivec_vmaddfp(__a
, __b
, __c
);
4778 static __inline__ vector
double __ATTRS_o_ai
vec_madd(vector
double __a
,
4780 vector
double __c
) {
4781 return __builtin_vsx_xvmaddadp(__a
, __b
, __c
);
4787 static __inline__ vector
float __attribute__((__always_inline__
))
4788 vec_vmaddfp(vector
float __a
, vector
float __b
, vector
float __c
) {
4789 return __builtin_altivec_vmaddfp(__a
, __b
, __c
);
4794 static __inline__ vector
signed short __attribute__((__always_inline__
))
4795 vec_madds(vector
signed short __a
, vector
signed short __b
,
4796 vector
signed short __c
) {
4797 return __builtin_altivec_vmhaddshs(__a
, __b
, __c
);
4801 static __inline__ vector
signed short __attribute__((__always_inline__
))
4802 vec_vmhaddshs(vector
signed short __a
, vector
signed short __b
,
4803 vector
signed short __c
) {
4804 return __builtin_altivec_vmhaddshs(__a
, __b
, __c
);
4810 static __inline__ vector
float __ATTRS_o_ai
vec_msub(vector
float __a
,
4813 return __builtin_vsx_xvmsubasp(__a
, __b
, __c
);
4816 static __inline__ vector
double __ATTRS_o_ai
vec_msub(vector
double __a
,
4818 vector
double __c
) {
4819 return __builtin_vsx_xvmsubadp(__a
, __b
, __c
);
4825 static __inline__ vector
signed char __ATTRS_o_ai
4826 vec_max(vector
signed char __a
, vector
signed char __b
) {
4827 return __builtin_altivec_vmaxsb(__a
, __b
);
4830 static __inline__ vector
signed char __ATTRS_o_ai
4831 vec_max(vector
bool char __a
, vector
signed char __b
) {
4832 return __builtin_altivec_vmaxsb((vector
signed char)__a
, __b
);
4835 static __inline__ vector
signed char __ATTRS_o_ai
4836 vec_max(vector
signed char __a
, vector
bool char __b
) {
4837 return __builtin_altivec_vmaxsb(__a
, (vector
signed char)__b
);
4840 static __inline__ vector
unsigned char __ATTRS_o_ai
4841 vec_max(vector
unsigned char __a
, vector
unsigned char __b
) {
4842 return __builtin_altivec_vmaxub(__a
, __b
);
4845 static __inline__ vector
unsigned char __ATTRS_o_ai
4846 vec_max(vector
bool char __a
, vector
unsigned char __b
) {
4847 return __builtin_altivec_vmaxub((vector
unsigned char)__a
, __b
);
4850 static __inline__ vector
unsigned char __ATTRS_o_ai
4851 vec_max(vector
unsigned char __a
, vector
bool char __b
) {
4852 return __builtin_altivec_vmaxub(__a
, (vector
unsigned char)__b
);
4855 static __inline__ vector
short __ATTRS_o_ai
vec_max(vector
short __a
,
4857 return __builtin_altivec_vmaxsh(__a
, __b
);
4860 static __inline__ vector
short __ATTRS_o_ai
vec_max(vector
bool short __a
,
4862 return __builtin_altivec_vmaxsh((vector
short)__a
, __b
);
4865 static __inline__ vector
short __ATTRS_o_ai
vec_max(vector
short __a
,
4866 vector
bool short __b
) {
4867 return __builtin_altivec_vmaxsh(__a
, (vector
short)__b
);
4870 static __inline__ vector
unsigned short __ATTRS_o_ai
4871 vec_max(vector
unsigned short __a
, vector
unsigned short __b
) {
4872 return __builtin_altivec_vmaxuh(__a
, __b
);
4875 static __inline__ vector
unsigned short __ATTRS_o_ai
4876 vec_max(vector
bool short __a
, vector
unsigned short __b
) {
4877 return __builtin_altivec_vmaxuh((vector
unsigned short)__a
, __b
);
4880 static __inline__ vector
unsigned short __ATTRS_o_ai
4881 vec_max(vector
unsigned short __a
, vector
bool short __b
) {
4882 return __builtin_altivec_vmaxuh(__a
, (vector
unsigned short)__b
);
4885 static __inline__ vector
int __ATTRS_o_ai
vec_max(vector
int __a
,
4887 return __builtin_altivec_vmaxsw(__a
, __b
);
4890 static __inline__ vector
int __ATTRS_o_ai
vec_max(vector
bool int __a
,
4892 return __builtin_altivec_vmaxsw((vector
int)__a
, __b
);
4895 static __inline__ vector
int __ATTRS_o_ai
vec_max(vector
int __a
,
4896 vector
bool int __b
) {
4897 return __builtin_altivec_vmaxsw(__a
, (vector
int)__b
);
4900 static __inline__ vector
unsigned int __ATTRS_o_ai
4901 vec_max(vector
unsigned int __a
, vector
unsigned int __b
) {
4902 return __builtin_altivec_vmaxuw(__a
, __b
);
4905 static __inline__ vector
unsigned int __ATTRS_o_ai
4906 vec_max(vector
bool int __a
, vector
unsigned int __b
) {
4907 return __builtin_altivec_vmaxuw((vector
unsigned int)__a
, __b
);
4910 static __inline__ vector
unsigned int __ATTRS_o_ai
4911 vec_max(vector
unsigned int __a
, vector
bool int __b
) {
4912 return __builtin_altivec_vmaxuw(__a
, (vector
unsigned int)__b
);
4915 #ifdef __POWER8_VECTOR__
4916 static __inline__ vector
signed long long __ATTRS_o_ai
4917 vec_max(vector
signed long long __a
, vector
signed long long __b
) {
4918 return __builtin_altivec_vmaxsd(__a
, __b
);
4921 static __inline__ vector
signed long long __ATTRS_o_ai
4922 vec_max(vector
bool long long __a
, vector
signed long long __b
) {
4923 return __builtin_altivec_vmaxsd((vector
signed long long)__a
, __b
);
4926 static __inline__ vector
signed long long __ATTRS_o_ai
4927 vec_max(vector
signed long long __a
, vector
bool long long __b
) {
4928 return __builtin_altivec_vmaxsd(__a
, (vector
signed long long)__b
);
4931 static __inline__ vector
unsigned long long __ATTRS_o_ai
4932 vec_max(vector
unsigned long long __a
, vector
unsigned long long __b
) {
4933 return __builtin_altivec_vmaxud(__a
, __b
);
4936 static __inline__ vector
unsigned long long __ATTRS_o_ai
4937 vec_max(vector
bool long long __a
, vector
unsigned long long __b
) {
4938 return __builtin_altivec_vmaxud((vector
unsigned long long)__a
, __b
);
4941 static __inline__ vector
unsigned long long __ATTRS_o_ai
4942 vec_max(vector
unsigned long long __a
, vector
bool long long __b
) {
4943 return __builtin_altivec_vmaxud(__a
, (vector
unsigned long long)__b
);
4947 static __inline__ vector
float __ATTRS_o_ai
vec_max(vector
float __a
,
4950 return __builtin_vsx_xvmaxsp(__a
, __b
);
4952 return __builtin_altivec_vmaxfp(__a
, __b
);
4957 static __inline__ vector
double __ATTRS_o_ai
vec_max(vector
double __a
,
4958 vector
double __b
) {
4959 return __builtin_vsx_xvmaxdp(__a
, __b
);
4965 static __inline__ vector
signed char __ATTRS_o_ai
4966 vec_vmaxsb(vector
signed char __a
, vector
signed char __b
) {
4967 return __builtin_altivec_vmaxsb(__a
, __b
);
4970 static __inline__ vector
signed char __ATTRS_o_ai
4971 vec_vmaxsb(vector
bool char __a
, vector
signed char __b
) {
4972 return __builtin_altivec_vmaxsb((vector
signed char)__a
, __b
);
4975 static __inline__ vector
signed char __ATTRS_o_ai
4976 vec_vmaxsb(vector
signed char __a
, vector
bool char __b
) {
4977 return __builtin_altivec_vmaxsb(__a
, (vector
signed char)__b
);
4982 static __inline__ vector
unsigned char __ATTRS_o_ai
4983 vec_vmaxub(vector
unsigned char __a
, vector
unsigned char __b
) {
4984 return __builtin_altivec_vmaxub(__a
, __b
);
4987 static __inline__ vector
unsigned char __ATTRS_o_ai
4988 vec_vmaxub(vector
bool char __a
, vector
unsigned char __b
) {
4989 return __builtin_altivec_vmaxub((vector
unsigned char)__a
, __b
);
4992 static __inline__ vector
unsigned char __ATTRS_o_ai
4993 vec_vmaxub(vector
unsigned char __a
, vector
bool char __b
) {
4994 return __builtin_altivec_vmaxub(__a
, (vector
unsigned char)__b
);
4999 static __inline__ vector
short __ATTRS_o_ai
vec_vmaxsh(vector
short __a
,
5001 return __builtin_altivec_vmaxsh(__a
, __b
);
5004 static __inline__ vector
short __ATTRS_o_ai
vec_vmaxsh(vector
bool short __a
,
5006 return __builtin_altivec_vmaxsh((vector
short)__a
, __b
);
5009 static __inline__ vector
short __ATTRS_o_ai
vec_vmaxsh(vector
short __a
,
5010 vector
bool short __b
) {
5011 return __builtin_altivec_vmaxsh(__a
, (vector
short)__b
);
5016 static __inline__ vector
unsigned short __ATTRS_o_ai
5017 vec_vmaxuh(vector
unsigned short __a
, vector
unsigned short __b
) {
5018 return __builtin_altivec_vmaxuh(__a
, __b
);
5021 static __inline__ vector
unsigned short __ATTRS_o_ai
5022 vec_vmaxuh(vector
bool short __a
, vector
unsigned short __b
) {
5023 return __builtin_altivec_vmaxuh((vector
unsigned short)__a
, __b
);
5026 static __inline__ vector
unsigned short __ATTRS_o_ai
5027 vec_vmaxuh(vector
unsigned short __a
, vector
bool short __b
) {
5028 return __builtin_altivec_vmaxuh(__a
, (vector
unsigned short)__b
);
5033 static __inline__ vector
int __ATTRS_o_ai
vec_vmaxsw(vector
int __a
,
5035 return __builtin_altivec_vmaxsw(__a
, __b
);
5038 static __inline__ vector
int __ATTRS_o_ai
vec_vmaxsw(vector
bool int __a
,
5040 return __builtin_altivec_vmaxsw((vector
int)__a
, __b
);
5043 static __inline__ vector
int __ATTRS_o_ai
vec_vmaxsw(vector
int __a
,
5044 vector
bool int __b
) {
5045 return __builtin_altivec_vmaxsw(__a
, (vector
int)__b
);
5050 static __inline__ vector
unsigned int __ATTRS_o_ai
5051 vec_vmaxuw(vector
unsigned int __a
, vector
unsigned int __b
) {
5052 return __builtin_altivec_vmaxuw(__a
, __b
);
5055 static __inline__ vector
unsigned int __ATTRS_o_ai
5056 vec_vmaxuw(vector
bool int __a
, vector
unsigned int __b
) {
5057 return __builtin_altivec_vmaxuw((vector
unsigned int)__a
, __b
);
5060 static __inline__ vector
unsigned int __ATTRS_o_ai
5061 vec_vmaxuw(vector
unsigned int __a
, vector
bool int __b
) {
5062 return __builtin_altivec_vmaxuw(__a
, (vector
unsigned int)__b
);
5067 static __inline__ vector
float __attribute__((__always_inline__
))
5068 vec_vmaxfp(vector
float __a
, vector
float __b
) {
5070 return __builtin_vsx_xvmaxsp(__a
, __b
);
5072 return __builtin_altivec_vmaxfp(__a
, __b
);
5078 static __inline__ vector
signed char __ATTRS_o_ai
5079 vec_mergeh(vector
signed char __a
, vector
signed char __b
) {
5080 return vec_perm(__a
, __b
,
5081 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5082 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5083 0x06, 0x16, 0x07, 0x17));
5086 static __inline__ vector
unsigned char __ATTRS_o_ai
5087 vec_mergeh(vector
unsigned char __a
, vector
unsigned char __b
) {
5088 return vec_perm(__a
, __b
,
5089 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5090 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5091 0x06, 0x16, 0x07, 0x17));
5094 static __inline__ vector
bool char __ATTRS_o_ai
5095 vec_mergeh(vector
bool char __a
, vector
bool char __b
) {
5096 return vec_perm(__a
, __b
,
5097 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5098 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5099 0x06, 0x16, 0x07, 0x17));
5102 static __inline__ vector
short __ATTRS_o_ai
vec_mergeh(vector
short __a
,
5104 return vec_perm(__a
, __b
,
5105 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5106 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5107 0x06, 0x07, 0x16, 0x17));
5110 static __inline__ vector
unsigned short __ATTRS_o_ai
5111 vec_mergeh(vector
unsigned short __a
, vector
unsigned short __b
) {
5112 return vec_perm(__a
, __b
,
5113 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5114 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5115 0x06, 0x07, 0x16, 0x17));
5118 static __inline__ vector
bool short __ATTRS_o_ai
5119 vec_mergeh(vector
bool short __a
, vector
bool short __b
) {
5120 return vec_perm(__a
, __b
,
5121 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5122 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5123 0x06, 0x07, 0x16, 0x17));
5126 static __inline__ vector pixel __ATTRS_o_ai
vec_mergeh(vector pixel __a
,
5128 return vec_perm(__a
, __b
,
5129 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5130 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5131 0x06, 0x07, 0x16, 0x17));
5134 static __inline__ vector
int __ATTRS_o_ai
vec_mergeh(vector
int __a
,
5136 return vec_perm(__a
, __b
,
5137 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5138 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5139 0x14, 0x15, 0x16, 0x17));
5142 static __inline__ vector
unsigned int __ATTRS_o_ai
5143 vec_mergeh(vector
unsigned int __a
, vector
unsigned int __b
) {
5144 return vec_perm(__a
, __b
,
5145 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5146 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5147 0x14, 0x15, 0x16, 0x17));
5150 static __inline__ vector
bool int __ATTRS_o_ai
vec_mergeh(vector
bool int __a
,
5151 vector
bool int __b
) {
5152 return vec_perm(__a
, __b
,
5153 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5154 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5155 0x14, 0x15, 0x16, 0x17));
5158 static __inline__ vector
float __ATTRS_o_ai
vec_mergeh(vector
float __a
,
5160 return vec_perm(__a
, __b
,
5161 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5162 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5163 0x14, 0x15, 0x16, 0x17));
5167 static __inline__ vector
signed long long __ATTRS_o_ai
5168 vec_mergeh(vector
signed long long __a
, vector
signed long long __b
) {
5169 return vec_perm(__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
signed long long __ATTRS_o_ai
5176 vec_mergeh(vector
signed long long __a
, vector
bool long long __b
) {
5177 return vec_perm(__a
, (vector
signed long long)__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
signed long long __ATTRS_o_ai
5184 vec_mergeh(vector
bool long long __a
, vector
signed long long __b
) {
5185 return vec_perm((vector
signed long long)__a
, __b
,
5186 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5187 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5188 0x14, 0x15, 0x16, 0x17));
5191 static __inline__ vector
unsigned long long __ATTRS_o_ai
5192 vec_mergeh(vector
unsigned long long __a
, vector
unsigned long long __b
) {
5193 return vec_perm(__a
, __b
,
5194 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5195 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5196 0x14, 0x15, 0x16, 0x17));
5199 static __inline__ vector
unsigned long long __ATTRS_o_ai
5200 vec_mergeh(vector
unsigned long long __a
, vector
bool long long __b
) {
5201 return vec_perm(__a
, (vector
unsigned long long)__b
,
5202 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5203 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5204 0x14, 0x15, 0x16, 0x17));
5207 static __inline__ vector
unsigned long long __ATTRS_o_ai
5208 vec_mergeh(vector
bool long long __a
, vector
unsigned long long __b
) {
5209 return vec_perm((vector
unsigned long long)__a
, __b
,
5210 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5211 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5212 0x14, 0x15, 0x16, 0x17));
5215 static __inline__ vector
bool long long __ATTRS_o_ai
5216 vec_mergeh(vector
bool long long __a
, vector
bool long long __b
) {
5217 return vec_perm(__a
, __b
,
5218 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5219 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5220 0x14, 0x15, 0x16, 0x17));
5223 static __inline__ vector
double __ATTRS_o_ai
vec_mergeh(vector
double __a
,
5224 vector
double __b
) {
5225 return vec_perm(__a
, __b
,
5226 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5227 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5228 0x14, 0x15, 0x16, 0x17));
5230 static __inline__ vector
double __ATTRS_o_ai
5231 vec_mergeh(vector
double __a
, vector
bool long long __b
) {
5232 return vec_perm(__a
, (vector
double)__b
,
5233 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5234 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5235 0x14, 0x15, 0x16, 0x17));
5237 static __inline__ vector
double __ATTRS_o_ai
5238 vec_mergeh(vector
bool long long __a
, vector
double __b
) {
5239 return vec_perm((vector
double)__a
, __b
,
5240 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5241 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5242 0x14, 0x15, 0x16, 0x17));
5248 #define __builtin_altivec_vmrghb vec_vmrghb
5250 static __inline__ vector
signed char __ATTRS_o_ai
5251 vec_vmrghb(vector
signed char __a
, vector
signed char __b
) {
5252 return vec_perm(__a
, __b
,
5253 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5254 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5255 0x06, 0x16, 0x07, 0x17));
5258 static __inline__ vector
unsigned char __ATTRS_o_ai
5259 vec_vmrghb(vector
unsigned char __a
, vector
unsigned char __b
) {
5260 return vec_perm(__a
, __b
,
5261 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5262 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5263 0x06, 0x16, 0x07, 0x17));
5266 static __inline__ vector
bool char __ATTRS_o_ai
5267 vec_vmrghb(vector
bool char __a
, vector
bool char __b
) {
5268 return vec_perm(__a
, __b
,
5269 (vector
unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5270 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5271 0x06, 0x16, 0x07, 0x17));
5276 #define __builtin_altivec_vmrghh vec_vmrghh
5278 static __inline__ vector
short __ATTRS_o_ai
vec_vmrghh(vector
short __a
,
5280 return vec_perm(__a
, __b
,
5281 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5282 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5283 0x06, 0x07, 0x16, 0x17));
5286 static __inline__ vector
unsigned short __ATTRS_o_ai
5287 vec_vmrghh(vector
unsigned short __a
, vector
unsigned short __b
) {
5288 return vec_perm(__a
, __b
,
5289 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5290 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5291 0x06, 0x07, 0x16, 0x17));
5294 static __inline__ vector
bool short __ATTRS_o_ai
5295 vec_vmrghh(vector
bool short __a
, vector
bool short __b
) {
5296 return vec_perm(__a
, __b
,
5297 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5298 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5299 0x06, 0x07, 0x16, 0x17));
5302 static __inline__ vector pixel __ATTRS_o_ai
vec_vmrghh(vector pixel __a
,
5304 return vec_perm(__a
, __b
,
5305 (vector
unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5306 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5307 0x06, 0x07, 0x16, 0x17));
5312 #define __builtin_altivec_vmrghw vec_vmrghw
5314 static __inline__ vector
int __ATTRS_o_ai
vec_vmrghw(vector
int __a
,
5316 return vec_perm(__a
, __b
,
5317 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5318 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5319 0x14, 0x15, 0x16, 0x17));
5322 static __inline__ vector
unsigned int __ATTRS_o_ai
5323 vec_vmrghw(vector
unsigned int __a
, vector
unsigned int __b
) {
5324 return vec_perm(__a
, __b
,
5325 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5326 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5327 0x14, 0x15, 0x16, 0x17));
5330 static __inline__ vector
bool int __ATTRS_o_ai
vec_vmrghw(vector
bool int __a
,
5331 vector
bool int __b
) {
5332 return vec_perm(__a
, __b
,
5333 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5334 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5335 0x14, 0x15, 0x16, 0x17));
5338 static __inline__ vector
float __ATTRS_o_ai
vec_vmrghw(vector
float __a
,
5340 return vec_perm(__a
, __b
,
5341 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5342 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5343 0x14, 0x15, 0x16, 0x17));
5348 static __inline__ vector
signed char __ATTRS_o_ai
5349 vec_mergel(vector
signed char __a
, vector
signed char __b
) {
5350 return vec_perm(__a
, __b
,
5351 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5352 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5353 0x0E, 0x1E, 0x0F, 0x1F));
5356 static __inline__ vector
unsigned char __ATTRS_o_ai
5357 vec_mergel(vector
unsigned char __a
, vector
unsigned char __b
) {
5358 return vec_perm(__a
, __b
,
5359 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5360 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5361 0x0E, 0x1E, 0x0F, 0x1F));
5364 static __inline__ vector
bool char __ATTRS_o_ai
5365 vec_mergel(vector
bool char __a
, vector
bool char __b
) {
5366 return vec_perm(__a
, __b
,
5367 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5368 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5369 0x0E, 0x1E, 0x0F, 0x1F));
5372 static __inline__ vector
short __ATTRS_o_ai
vec_mergel(vector
short __a
,
5374 return vec_perm(__a
, __b
,
5375 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5376 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5377 0x0E, 0x0F, 0x1E, 0x1F));
5380 static __inline__ vector
unsigned short __ATTRS_o_ai
5381 vec_mergel(vector
unsigned short __a
, vector
unsigned short __b
) {
5382 return vec_perm(__a
, __b
,
5383 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5384 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5385 0x0E, 0x0F, 0x1E, 0x1F));
5388 static __inline__ vector
bool short __ATTRS_o_ai
5389 vec_mergel(vector
bool short __a
, vector
bool short __b
) {
5390 return vec_perm(__a
, __b
,
5391 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5392 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5393 0x0E, 0x0F, 0x1E, 0x1F));
5396 static __inline__ vector pixel __ATTRS_o_ai
vec_mergel(vector pixel __a
,
5398 return vec_perm(__a
, __b
,
5399 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5400 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5401 0x0E, 0x0F, 0x1E, 0x1F));
5404 static __inline__ vector
int __ATTRS_o_ai
vec_mergel(vector
int __a
,
5406 return vec_perm(__a
, __b
,
5407 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5408 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5409 0x1C, 0x1D, 0x1E, 0x1F));
5412 static __inline__ vector
unsigned int __ATTRS_o_ai
5413 vec_mergel(vector
unsigned int __a
, vector
unsigned int __b
) {
5414 return vec_perm(__a
, __b
,
5415 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5416 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5417 0x1C, 0x1D, 0x1E, 0x1F));
5420 static __inline__ vector
bool int __ATTRS_o_ai
vec_mergel(vector
bool int __a
,
5421 vector
bool int __b
) {
5422 return vec_perm(__a
, __b
,
5423 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5424 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5425 0x1C, 0x1D, 0x1E, 0x1F));
5428 static __inline__ vector
float __ATTRS_o_ai
vec_mergel(vector
float __a
,
5430 return vec_perm(__a
, __b
,
5431 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5432 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5433 0x1C, 0x1D, 0x1E, 0x1F));
5437 static __inline__ vector
signed long long __ATTRS_o_ai
5438 vec_mergel(vector
signed long long __a
, vector
signed long long __b
) {
5439 return vec_perm(__a
, __b
,
5440 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5441 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5442 0x1C, 0x1D, 0x1E, 0x1F));
5444 static __inline__ vector
signed long long __ATTRS_o_ai
5445 vec_mergel(vector
signed long long __a
, vector
bool long long __b
) {
5446 return vec_perm(__a
, (vector
signed long long)__b
,
5447 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5448 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5449 0x1C, 0x1D, 0x1E, 0x1F));
5451 static __inline__ vector
signed long long __ATTRS_o_ai
5452 vec_mergel(vector
bool long long __a
, vector
signed long long __b
) {
5453 return vec_perm((vector
signed long long)__a
, __b
,
5454 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5455 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5456 0x1C, 0x1D, 0x1E, 0x1F));
5458 static __inline__ vector
unsigned long long __ATTRS_o_ai
5459 vec_mergel(vector
unsigned long long __a
, vector
unsigned long long __b
) {
5460 return vec_perm(__a
, __b
,
5461 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5462 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5463 0x1C, 0x1D, 0x1E, 0x1F));
5465 static __inline__ vector
unsigned long long __ATTRS_o_ai
5466 vec_mergel(vector
unsigned long long __a
, vector
bool long long __b
) {
5467 return vec_perm(__a
, (vector
unsigned long long)__b
,
5468 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5469 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5470 0x1C, 0x1D, 0x1E, 0x1F));
5472 static __inline__ vector
unsigned long long __ATTRS_o_ai
5473 vec_mergel(vector
bool long long __a
, vector
unsigned long long __b
) {
5474 return vec_perm((vector
unsigned long long)__a
, __b
,
5475 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5476 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5477 0x1C, 0x1D, 0x1E, 0x1F));
5479 static __inline__ vector
bool long long __ATTRS_o_ai
5480 vec_mergel(vector
bool long long __a
, vector
bool long long __b
) {
5481 return vec_perm(__a
, __b
,
5482 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5483 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5484 0x1C, 0x1D, 0x1E, 0x1F));
5486 static __inline__ vector
double __ATTRS_o_ai
vec_mergel(vector
double __a
,
5487 vector
double __b
) {
5488 return vec_perm(__a
, __b
,
5489 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5490 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5491 0x1C, 0x1D, 0x1E, 0x1F));
5493 static __inline__ vector
double __ATTRS_o_ai
5494 vec_mergel(vector
double __a
, vector
bool long long __b
) {
5495 return vec_perm(__a
, (vector
double)__b
,
5496 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5497 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5498 0x1C, 0x1D, 0x1E, 0x1F));
5500 static __inline__ vector
double __ATTRS_o_ai
5501 vec_mergel(vector
bool long long __a
, vector
double __b
) {
5502 return vec_perm((vector
double)__a
, __b
,
5503 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5504 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5505 0x1C, 0x1D, 0x1E, 0x1F));
5511 #define __builtin_altivec_vmrglb vec_vmrglb
5513 static __inline__ vector
signed char __ATTRS_o_ai
5514 vec_vmrglb(vector
signed char __a
, vector
signed char __b
) {
5515 return vec_perm(__a
, __b
,
5516 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5517 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5518 0x0E, 0x1E, 0x0F, 0x1F));
5521 static __inline__ vector
unsigned char __ATTRS_o_ai
5522 vec_vmrglb(vector
unsigned char __a
, vector
unsigned char __b
) {
5523 return vec_perm(__a
, __b
,
5524 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5525 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5526 0x0E, 0x1E, 0x0F, 0x1F));
5529 static __inline__ vector
bool char __ATTRS_o_ai
5530 vec_vmrglb(vector
bool char __a
, vector
bool char __b
) {
5531 return vec_perm(__a
, __b
,
5532 (vector
unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5533 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5534 0x0E, 0x1E, 0x0F, 0x1F));
5539 #define __builtin_altivec_vmrglh vec_vmrglh
5541 static __inline__ vector
short __ATTRS_o_ai
vec_vmrglh(vector
short __a
,
5543 return vec_perm(__a
, __b
,
5544 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5545 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5546 0x0E, 0x0F, 0x1E, 0x1F));
5549 static __inline__ vector
unsigned short __ATTRS_o_ai
5550 vec_vmrglh(vector
unsigned short __a
, vector
unsigned short __b
) {
5551 return vec_perm(__a
, __b
,
5552 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5553 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5554 0x0E, 0x0F, 0x1E, 0x1F));
5557 static __inline__ vector
bool short __ATTRS_o_ai
5558 vec_vmrglh(vector
bool short __a
, vector
bool short __b
) {
5559 return vec_perm(__a
, __b
,
5560 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5561 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5562 0x0E, 0x0F, 0x1E, 0x1F));
5565 static __inline__ vector pixel __ATTRS_o_ai
vec_vmrglh(vector pixel __a
,
5567 return vec_perm(__a
, __b
,
5568 (vector
unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5569 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5570 0x0E, 0x0F, 0x1E, 0x1F));
5575 #define __builtin_altivec_vmrglw vec_vmrglw
5577 static __inline__ vector
int __ATTRS_o_ai
vec_vmrglw(vector
int __a
,
5579 return vec_perm(__a
, __b
,
5580 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5581 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5582 0x1C, 0x1D, 0x1E, 0x1F));
5585 static __inline__ vector
unsigned int __ATTRS_o_ai
5586 vec_vmrglw(vector
unsigned int __a
, vector
unsigned int __b
) {
5587 return vec_perm(__a
, __b
,
5588 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5589 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5590 0x1C, 0x1D, 0x1E, 0x1F));
5593 static __inline__ vector
bool int __ATTRS_o_ai
vec_vmrglw(vector
bool int __a
,
5594 vector
bool int __b
) {
5595 return vec_perm(__a
, __b
,
5596 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5597 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5598 0x1C, 0x1D, 0x1E, 0x1F));
5601 static __inline__ vector
float __ATTRS_o_ai
vec_vmrglw(vector
float __a
,
5603 return vec_perm(__a
, __b
,
5604 (vector
unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5605 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5606 0x1C, 0x1D, 0x1E, 0x1F));
5609 #ifdef __POWER8_VECTOR__
5612 static __inline__ vector
bool int __ATTRS_o_ai
vec_mergee(vector
bool int __a
,
5613 vector
bool int __b
) {
5614 return vec_perm(__a
, __b
,
5615 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5616 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5617 0x18, 0x19, 0x1A, 0x1B));
5620 static __inline__ vector
signed int __ATTRS_o_ai
5621 vec_mergee(vector
signed int __a
, vector
signed int __b
) {
5622 return vec_perm(__a
, __b
,
5623 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5624 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5625 0x18, 0x19, 0x1A, 0x1B));
5628 static __inline__ vector
unsigned int __ATTRS_o_ai
5629 vec_mergee(vector
unsigned int __a
, vector
unsigned int __b
) {
5630 return vec_perm(__a
, __b
,
5631 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5632 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5633 0x18, 0x19, 0x1A, 0x1B));
5636 static __inline__ vector
bool long long __ATTRS_o_ai
5637 vec_mergee(vector
bool long long __a
, vector
bool long long __b
) {
5638 return vec_mergeh(__a
, __b
);
5641 static __inline__ vector
signed long long __ATTRS_o_ai
5642 vec_mergee(vector
signed long long __a
, vector
signed long long __b
) {
5643 return vec_mergeh(__a
, __b
);
5646 static __inline__ vector
unsigned long long __ATTRS_o_ai
5647 vec_mergee(vector
unsigned long long __a
, vector
unsigned long long __b
) {
5648 return vec_mergeh(__a
, __b
);
5651 static __inline__ vector
float __ATTRS_o_ai
5652 vec_mergee(vector
float __a
, vector
float __b
) {
5653 return vec_perm(__a
, __b
,
5654 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5655 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5656 0x18, 0x19, 0x1A, 0x1B));
5659 static __inline__ vector
double __ATTRS_o_ai
5660 vec_mergee(vector
double __a
, vector
double __b
) {
5661 return vec_mergeh(__a
, __b
);
5666 static __inline__ vector
bool int __ATTRS_o_ai
vec_mergeo(vector
bool int __a
,
5667 vector
bool int __b
) {
5668 return vec_perm(__a
, __b
,
5669 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5670 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5671 0x1C, 0x1D, 0x1E, 0x1F));
5674 static __inline__ vector
signed int __ATTRS_o_ai
5675 vec_mergeo(vector
signed int __a
, vector
signed int __b
) {
5676 return vec_perm(__a
, __b
,
5677 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5678 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5679 0x1C, 0x1D, 0x1E, 0x1F));
5682 static __inline__ vector
unsigned int __ATTRS_o_ai
5683 vec_mergeo(vector
unsigned int __a
, vector
unsigned int __b
) {
5684 return vec_perm(__a
, __b
,
5685 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5686 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5687 0x1C, 0x1D, 0x1E, 0x1F));
5690 static __inline__ vector
bool long long __ATTRS_o_ai
5691 vec_mergeo(vector
bool long long __a
, vector
bool long long __b
) {
5692 return vec_mergel(__a
, __b
);
5695 static __inline__ vector
signed long long __ATTRS_o_ai
5696 vec_mergeo(vector
signed long long __a
, vector
signed long long __b
) {
5697 return vec_mergel(__a
, __b
);
5700 static __inline__ vector
unsigned long long __ATTRS_o_ai
5701 vec_mergeo(vector
unsigned long long __a
, vector
unsigned long long __b
) {
5702 return vec_mergel(__a
, __b
);
5705 static __inline__ vector
float __ATTRS_o_ai
5706 vec_mergeo(vector
float __a
, vector
float __b
) {
5707 return vec_perm(__a
, __b
,
5708 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5709 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5710 0x1C, 0x1D, 0x1E, 0x1F));
5713 static __inline__ vector
double __ATTRS_o_ai
5714 vec_mergeo(vector
double __a
, vector
double __b
) {
5715 return vec_mergel(__a
, __b
);
5722 static __inline__ vector
unsigned short __attribute__((__always_inline__
))
5724 return __builtin_altivec_mfvscr();
5729 static __inline__ vector
signed char __ATTRS_o_ai
5730 vec_min(vector
signed char __a
, vector
signed char __b
) {
5731 return __builtin_altivec_vminsb(__a
, __b
);
5734 static __inline__ vector
signed char __ATTRS_o_ai
5735 vec_min(vector
bool char __a
, vector
signed char __b
) {
5736 return __builtin_altivec_vminsb((vector
signed char)__a
, __b
);
5739 static __inline__ vector
signed char __ATTRS_o_ai
5740 vec_min(vector
signed char __a
, vector
bool char __b
) {
5741 return __builtin_altivec_vminsb(__a
, (vector
signed char)__b
);
5744 static __inline__ vector
unsigned char __ATTRS_o_ai
5745 vec_min(vector
unsigned char __a
, vector
unsigned char __b
) {
5746 return __builtin_altivec_vminub(__a
, __b
);
5749 static __inline__ vector
unsigned char __ATTRS_o_ai
5750 vec_min(vector
bool char __a
, vector
unsigned char __b
) {
5751 return __builtin_altivec_vminub((vector
unsigned char)__a
, __b
);
5754 static __inline__ vector
unsigned char __ATTRS_o_ai
5755 vec_min(vector
unsigned char __a
, vector
bool char __b
) {
5756 return __builtin_altivec_vminub(__a
, (vector
unsigned char)__b
);
5759 static __inline__ vector
short __ATTRS_o_ai
vec_min(vector
short __a
,
5761 return __builtin_altivec_vminsh(__a
, __b
);
5764 static __inline__ vector
short __ATTRS_o_ai
vec_min(vector
bool short __a
,
5766 return __builtin_altivec_vminsh((vector
short)__a
, __b
);
5769 static __inline__ vector
short __ATTRS_o_ai
vec_min(vector
short __a
,
5770 vector
bool short __b
) {
5771 return __builtin_altivec_vminsh(__a
, (vector
short)__b
);
5774 static __inline__ vector
unsigned short __ATTRS_o_ai
5775 vec_min(vector
unsigned short __a
, vector
unsigned short __b
) {
5776 return __builtin_altivec_vminuh(__a
, __b
);
5779 static __inline__ vector
unsigned short __ATTRS_o_ai
5780 vec_min(vector
bool short __a
, vector
unsigned short __b
) {
5781 return __builtin_altivec_vminuh((vector
unsigned short)__a
, __b
);
5784 static __inline__ vector
unsigned short __ATTRS_o_ai
5785 vec_min(vector
unsigned short __a
, vector
bool short __b
) {
5786 return __builtin_altivec_vminuh(__a
, (vector
unsigned short)__b
);
5789 static __inline__ vector
int __ATTRS_o_ai
vec_min(vector
int __a
,
5791 return __builtin_altivec_vminsw(__a
, __b
);
5794 static __inline__ vector
int __ATTRS_o_ai
vec_min(vector
bool int __a
,
5796 return __builtin_altivec_vminsw((vector
int)__a
, __b
);
5799 static __inline__ vector
int __ATTRS_o_ai
vec_min(vector
int __a
,
5800 vector
bool int __b
) {
5801 return __builtin_altivec_vminsw(__a
, (vector
int)__b
);
5804 static __inline__ vector
unsigned int __ATTRS_o_ai
5805 vec_min(vector
unsigned int __a
, vector
unsigned int __b
) {
5806 return __builtin_altivec_vminuw(__a
, __b
);
5809 static __inline__ vector
unsigned int __ATTRS_o_ai
5810 vec_min(vector
bool int __a
, vector
unsigned int __b
) {
5811 return __builtin_altivec_vminuw((vector
unsigned int)__a
, __b
);
5814 static __inline__ vector
unsigned int __ATTRS_o_ai
5815 vec_min(vector
unsigned int __a
, vector
bool int __b
) {
5816 return __builtin_altivec_vminuw(__a
, (vector
unsigned int)__b
);
5819 #ifdef __POWER8_VECTOR__
5820 static __inline__ vector
signed long long __ATTRS_o_ai
5821 vec_min(vector
signed long long __a
, vector
signed long long __b
) {
5822 return __builtin_altivec_vminsd(__a
, __b
);
5825 static __inline__ vector
signed long long __ATTRS_o_ai
5826 vec_min(vector
bool long long __a
, vector
signed long long __b
) {
5827 return __builtin_altivec_vminsd((vector
signed long long)__a
, __b
);
5830 static __inline__ vector
signed long long __ATTRS_o_ai
5831 vec_min(vector
signed long long __a
, vector
bool long long __b
) {
5832 return __builtin_altivec_vminsd(__a
, (vector
signed long long)__b
);
5835 static __inline__ vector
unsigned long long __ATTRS_o_ai
5836 vec_min(vector
unsigned long long __a
, vector
unsigned long long __b
) {
5837 return __builtin_altivec_vminud(__a
, __b
);
5840 static __inline__ vector
unsigned long long __ATTRS_o_ai
5841 vec_min(vector
bool long long __a
, vector
unsigned long long __b
) {
5842 return __builtin_altivec_vminud((vector
unsigned long long)__a
, __b
);
5845 static __inline__ vector
unsigned long long __ATTRS_o_ai
5846 vec_min(vector
unsigned long long __a
, vector
bool long long __b
) {
5847 return __builtin_altivec_vminud(__a
, (vector
unsigned long long)__b
);
5851 static __inline__ vector
float __ATTRS_o_ai
vec_min(vector
float __a
,
5854 return __builtin_vsx_xvminsp(__a
, __b
);
5856 return __builtin_altivec_vminfp(__a
, __b
);
5861 static __inline__ vector
double __ATTRS_o_ai
vec_min(vector
double __a
,
5862 vector
double __b
) {
5863 return __builtin_vsx_xvmindp(__a
, __b
);
5869 static __inline__ vector
signed char __ATTRS_o_ai
5870 vec_vminsb(vector
signed char __a
, vector
signed char __b
) {
5871 return __builtin_altivec_vminsb(__a
, __b
);
5874 static __inline__ vector
signed char __ATTRS_o_ai
5875 vec_vminsb(vector
bool char __a
, vector
signed char __b
) {
5876 return __builtin_altivec_vminsb((vector
signed char)__a
, __b
);
5879 static __inline__ vector
signed char __ATTRS_o_ai
5880 vec_vminsb(vector
signed char __a
, vector
bool char __b
) {
5881 return __builtin_altivec_vminsb(__a
, (vector
signed char)__b
);
5886 static __inline__ vector
unsigned char __ATTRS_o_ai
5887 vec_vminub(vector
unsigned char __a
, vector
unsigned char __b
) {
5888 return __builtin_altivec_vminub(__a
, __b
);
5891 static __inline__ vector
unsigned char __ATTRS_o_ai
5892 vec_vminub(vector
bool char __a
, vector
unsigned char __b
) {
5893 return __builtin_altivec_vminub((vector
unsigned char)__a
, __b
);
5896 static __inline__ vector
unsigned char __ATTRS_o_ai
5897 vec_vminub(vector
unsigned char __a
, vector
bool char __b
) {
5898 return __builtin_altivec_vminub(__a
, (vector
unsigned char)__b
);
5903 static __inline__ vector
short __ATTRS_o_ai
vec_vminsh(vector
short __a
,
5905 return __builtin_altivec_vminsh(__a
, __b
);
5908 static __inline__ vector
short __ATTRS_o_ai
vec_vminsh(vector
bool short __a
,
5910 return __builtin_altivec_vminsh((vector
short)__a
, __b
);
5913 static __inline__ vector
short __ATTRS_o_ai
vec_vminsh(vector
short __a
,
5914 vector
bool short __b
) {
5915 return __builtin_altivec_vminsh(__a
, (vector
short)__b
);
5920 static __inline__ vector
unsigned short __ATTRS_o_ai
5921 vec_vminuh(vector
unsigned short __a
, vector
unsigned short __b
) {
5922 return __builtin_altivec_vminuh(__a
, __b
);
5925 static __inline__ vector
unsigned short __ATTRS_o_ai
5926 vec_vminuh(vector
bool short __a
, vector
unsigned short __b
) {
5927 return __builtin_altivec_vminuh((vector
unsigned short)__a
, __b
);
5930 static __inline__ vector
unsigned short __ATTRS_o_ai
5931 vec_vminuh(vector
unsigned short __a
, vector
bool short __b
) {
5932 return __builtin_altivec_vminuh(__a
, (vector
unsigned short)__b
);
5937 static __inline__ vector
int __ATTRS_o_ai
vec_vminsw(vector
int __a
,
5939 return __builtin_altivec_vminsw(__a
, __b
);
5942 static __inline__ vector
int __ATTRS_o_ai
vec_vminsw(vector
bool int __a
,
5944 return __builtin_altivec_vminsw((vector
int)__a
, __b
);
5947 static __inline__ vector
int __ATTRS_o_ai
vec_vminsw(vector
int __a
,
5948 vector
bool int __b
) {
5949 return __builtin_altivec_vminsw(__a
, (vector
int)__b
);
5954 static __inline__ vector
unsigned int __ATTRS_o_ai
5955 vec_vminuw(vector
unsigned int __a
, vector
unsigned int __b
) {
5956 return __builtin_altivec_vminuw(__a
, __b
);
5959 static __inline__ vector
unsigned int __ATTRS_o_ai
5960 vec_vminuw(vector
bool int __a
, vector
unsigned int __b
) {
5961 return __builtin_altivec_vminuw((vector
unsigned int)__a
, __b
);
5964 static __inline__ vector
unsigned int __ATTRS_o_ai
5965 vec_vminuw(vector
unsigned int __a
, vector
bool int __b
) {
5966 return __builtin_altivec_vminuw(__a
, (vector
unsigned int)__b
);
5971 static __inline__ vector
float __attribute__((__always_inline__
))
5972 vec_vminfp(vector
float __a
, vector
float __b
) {
5974 return __builtin_vsx_xvminsp(__a
, __b
);
5976 return __builtin_altivec_vminfp(__a
, __b
);
5982 #define __builtin_altivec_vmladduhm vec_mladd
5984 static __inline__ vector
short __ATTRS_o_ai
vec_mladd(vector
short __a
,
5987 return __a
* __b
+ __c
;
5990 static __inline__ vector
short __ATTRS_o_ai
vec_mladd(
5991 vector
short __a
, vector
unsigned short __b
, vector
unsigned short __c
) {
5992 return __a
* (vector
short)__b
+ (vector
short)__c
;
5995 static __inline__ vector
short __ATTRS_o_ai
vec_mladd(vector
unsigned short __a
,
5998 return (vector
short)__a
* __b
+ __c
;
6001 static __inline__ vector
unsigned short __ATTRS_o_ai
6002 vec_mladd(vector
unsigned short __a
, vector
unsigned short __b
,
6003 vector
unsigned short __c
) {
6004 return __a
* __b
+ __c
;
6009 static __inline__ vector
short __ATTRS_o_ai
vec_vmladduhm(vector
short __a
,
6012 return __a
* __b
+ __c
;
6015 static __inline__ vector
short __ATTRS_o_ai
vec_vmladduhm(
6016 vector
short __a
, vector
unsigned short __b
, vector
unsigned short __c
) {
6017 return __a
* (vector
short)__b
+ (vector
short)__c
;
6020 static __inline__ vector
short __ATTRS_o_ai
6021 vec_vmladduhm(vector
unsigned short __a
, vector
short __b
, vector
short __c
) {
6022 return (vector
short)__a
* __b
+ __c
;
6025 static __inline__ vector
unsigned short __ATTRS_o_ai
6026 vec_vmladduhm(vector
unsigned short __a
, vector
unsigned short __b
,
6027 vector
unsigned short __c
) {
6028 return __a
* __b
+ __c
;
6033 static __inline__ vector
short __attribute__((__always_inline__
))
6034 vec_mradds(vector
short __a
, vector
short __b
, vector
short __c
) {
6035 return __builtin_altivec_vmhraddshs(__a
, __b
, __c
);
6038 /* vec_vmhraddshs */
6040 static __inline__ vector
short __attribute__((__always_inline__
))
6041 vec_vmhraddshs(vector
short __a
, vector
short __b
, vector
short __c
) {
6042 return __builtin_altivec_vmhraddshs(__a
, __b
, __c
);
6047 static __inline__ vector
int __ATTRS_o_ai
vec_msum(vector
signed char __a
,
6048 vector
unsigned char __b
,
6050 return __builtin_altivec_vmsummbm(__a
, __b
, __c
);
6053 static __inline__ vector
unsigned int __ATTRS_o_ai
6054 vec_msum(vector
unsigned char __a
, vector
unsigned char __b
,
6055 vector
unsigned int __c
) {
6056 return __builtin_altivec_vmsumubm(__a
, __b
, __c
);
6059 static __inline__ vector
int __ATTRS_o_ai
vec_msum(vector
short __a
,
6062 return __builtin_altivec_vmsumshm(__a
, __b
, __c
);
6065 static __inline__ vector
unsigned int __ATTRS_o_ai
6066 vec_msum(vector
unsigned short __a
, vector
unsigned short __b
,
6067 vector
unsigned int __c
) {
6068 return __builtin_altivec_vmsumuhm(__a
, __b
, __c
);
6073 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6074 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
6075 vec_msumc(vector
unsigned long long __a
, vector
unsigned long long __b
,
6076 vector
unsigned __int128 __c
) {
6077 return __builtin_altivec_vmsumcud(__a
, __b
, __c
);
6083 static __inline__ vector
int __attribute__((__always_inline__
))
6084 vec_vmsummbm(vector
signed char __a
, vector
unsigned char __b
, vector
int __c
) {
6085 return __builtin_altivec_vmsummbm(__a
, __b
, __c
);
6090 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
6091 vec_vmsumubm(vector
unsigned char __a
, vector
unsigned char __b
,
6092 vector
unsigned int __c
) {
6093 return __builtin_altivec_vmsumubm(__a
, __b
, __c
);
6098 static __inline__ vector
int __attribute__((__always_inline__
))
6099 vec_vmsumshm(vector
short __a
, vector
short __b
, vector
int __c
) {
6100 return __builtin_altivec_vmsumshm(__a
, __b
, __c
);
6105 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
6106 vec_vmsumuhm(vector
unsigned short __a
, vector
unsigned short __b
,
6107 vector
unsigned int __c
) {
6108 return __builtin_altivec_vmsumuhm(__a
, __b
, __c
);
6113 static __inline__ vector
int __ATTRS_o_ai
vec_msums(vector
short __a
,
6116 return __builtin_altivec_vmsumshs(__a
, __b
, __c
);
6119 static __inline__ vector
unsigned int __ATTRS_o_ai
6120 vec_msums(vector
unsigned short __a
, vector
unsigned short __b
,
6121 vector
unsigned int __c
) {
6122 return __builtin_altivec_vmsumuhs(__a
, __b
, __c
);
6127 static __inline__ vector
int __attribute__((__always_inline__
))
6128 vec_vmsumshs(vector
short __a
, vector
short __b
, vector
int __c
) {
6129 return __builtin_altivec_vmsumshs(__a
, __b
, __c
);
6134 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
6135 vec_vmsumuhs(vector
unsigned short __a
, vector
unsigned short __b
,
6136 vector
unsigned int __c
) {
6137 return __builtin_altivec_vmsumuhs(__a
, __b
, __c
);
6142 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
signed char __a
) {
6143 __builtin_altivec_mtvscr((vector
int)__a
);
6146 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
unsigned char __a
) {
6147 __builtin_altivec_mtvscr((vector
int)__a
);
6150 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
bool char __a
) {
6151 __builtin_altivec_mtvscr((vector
int)__a
);
6154 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
short __a
) {
6155 __builtin_altivec_mtvscr((vector
int)__a
);
6158 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
unsigned short __a
) {
6159 __builtin_altivec_mtvscr((vector
int)__a
);
6162 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
bool short __a
) {
6163 __builtin_altivec_mtvscr((vector
int)__a
);
6166 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector pixel __a
) {
6167 __builtin_altivec_mtvscr((vector
int)__a
);
6170 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
int __a
) {
6171 __builtin_altivec_mtvscr((vector
int)__a
);
6174 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
unsigned int __a
) {
6175 __builtin_altivec_mtvscr((vector
int)__a
);
6178 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
bool int __a
) {
6179 __builtin_altivec_mtvscr((vector
int)__a
);
6182 static __inline__
void __ATTRS_o_ai
vec_mtvscr(vector
float __a
) {
6183 __builtin_altivec_mtvscr((vector
int)__a
);
6188 /* Integer vector multiplication will involve multiplication of the odd/even
6189 elements separately, then truncating the results and moving to the
6192 static __inline__ vector
signed char __ATTRS_o_ai
6193 vec_mul(vector
signed char __a
, vector
signed char __b
) {
6197 static __inline__ vector
unsigned char __ATTRS_o_ai
6198 vec_mul(vector
unsigned char __a
, vector
unsigned char __b
) {
6202 static __inline__ vector
signed short __ATTRS_o_ai
6203 vec_mul(vector
signed short __a
, vector
signed short __b
) {
6207 static __inline__ vector
unsigned short __ATTRS_o_ai
6208 vec_mul(vector
unsigned short __a
, vector
unsigned short __b
) {
6212 static __inline__ vector
signed int __ATTRS_o_ai
6213 vec_mul(vector
signed int __a
, vector
signed int __b
) {
6217 static __inline__ vector
unsigned int __ATTRS_o_ai
6218 vec_mul(vector
unsigned int __a
, vector
unsigned int __b
) {
6223 static __inline__ vector
signed long long __ATTRS_o_ai
6224 vec_mul(vector
signed long long __a
, vector
signed long long __b
) {
6228 static __inline__ vector
unsigned long long __ATTRS_o_ai
6229 vec_mul(vector
unsigned long long __a
, vector
unsigned long long __b
) {
6234 static __inline__ vector
float __ATTRS_o_ai
vec_mul(vector
float __a
,
6240 static __inline__ vector
double __ATTRS_o_ai
vec_mul(vector
double __a
,
6241 vector
double __b
) {
6246 /* The vmulos* and vmules* instructions have a big endian bias, so
6247 we must reverse the meaning of "even" and "odd" for little endian. */
6251 static __inline__ vector
short __ATTRS_o_ai
vec_mule(vector
signed char __a
,
6252 vector
signed char __b
) {
6253 #ifdef __LITTLE_ENDIAN__
6254 return __builtin_altivec_vmulosb(__a
, __b
);
6256 return __builtin_altivec_vmulesb(__a
, __b
);
6260 static __inline__ vector
unsigned short __ATTRS_o_ai
6261 vec_mule(vector
unsigned char __a
, vector
unsigned char __b
) {
6262 #ifdef __LITTLE_ENDIAN__
6263 return __builtin_altivec_vmuloub(__a
, __b
);
6265 return __builtin_altivec_vmuleub(__a
, __b
);
6269 static __inline__ vector
int __ATTRS_o_ai
vec_mule(vector
short __a
,
6271 #ifdef __LITTLE_ENDIAN__
6272 return __builtin_altivec_vmulosh(__a
, __b
);
6274 return __builtin_altivec_vmulesh(__a
, __b
);
6278 static __inline__ vector
unsigned int __ATTRS_o_ai
6279 vec_mule(vector
unsigned short __a
, vector
unsigned short __b
) {
6280 #ifdef __LITTLE_ENDIAN__
6281 return __builtin_altivec_vmulouh(__a
, __b
);
6283 return __builtin_altivec_vmuleuh(__a
, __b
);
6287 #ifdef __POWER8_VECTOR__
6288 static __inline__ vector
signed long long __ATTRS_o_ai
6289 vec_mule(vector
signed int __a
, vector
signed int __b
) {
6290 #ifdef __LITTLE_ENDIAN__
6291 return __builtin_altivec_vmulosw(__a
, __b
);
6293 return __builtin_altivec_vmulesw(__a
, __b
);
6297 static __inline__ vector
unsigned long long __ATTRS_o_ai
6298 vec_mule(vector
unsigned int __a
, vector
unsigned int __b
) {
6299 #ifdef __LITTLE_ENDIAN__
6300 return __builtin_altivec_vmulouw(__a
, __b
);
6302 return __builtin_altivec_vmuleuw(__a
, __b
);
6307 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6308 static __inline__ vector
signed __int128 __ATTRS_o_ai
6309 vec_mule(vector
signed long long __a
, vector
signed long long __b
) {
6310 #ifdef __LITTLE_ENDIAN__
6311 return __builtin_altivec_vmulosd(__a
, __b
);
6313 return __builtin_altivec_vmulesd(__a
, __b
);
6317 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
6318 vec_mule(vector
unsigned long long __a
, vector
unsigned long long __b
) {
6319 #ifdef __LITTLE_ENDIAN__
6320 return __builtin_altivec_vmuloud(__a
, __b
);
6322 return __builtin_altivec_vmuleud(__a
, __b
);
6329 static __inline__ vector
short __attribute__((__always_inline__
))
6330 vec_vmulesb(vector
signed char __a
, vector
signed char __b
) {
6331 #ifdef __LITTLE_ENDIAN__
6332 return __builtin_altivec_vmulosb(__a
, __b
);
6334 return __builtin_altivec_vmulesb(__a
, __b
);
6340 static __inline__ vector
unsigned short __attribute__((__always_inline__
))
6341 vec_vmuleub(vector
unsigned char __a
, vector
unsigned char __b
) {
6342 #ifdef __LITTLE_ENDIAN__
6343 return __builtin_altivec_vmuloub(__a
, __b
);
6345 return __builtin_altivec_vmuleub(__a
, __b
);
6351 static __inline__ vector
int __attribute__((__always_inline__
))
6352 vec_vmulesh(vector
short __a
, vector
short __b
) {
6353 #ifdef __LITTLE_ENDIAN__
6354 return __builtin_altivec_vmulosh(__a
, __b
);
6356 return __builtin_altivec_vmulesh(__a
, __b
);
6362 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
6363 vec_vmuleuh(vector
unsigned short __a
, vector
unsigned short __b
) {
6364 #ifdef __LITTLE_ENDIAN__
6365 return __builtin_altivec_vmulouh(__a
, __b
);
6367 return __builtin_altivec_vmuleuh(__a
, __b
);
6373 #ifdef __POWER10_VECTOR__
6374 static __inline__ vector
signed int __ATTRS_o_ai
6375 vec_mulh(vector
signed int __a
, vector
signed int __b
) {
6376 return __builtin_altivec_vmulhsw(__a
, __b
);
6379 static __inline__ vector
unsigned int __ATTRS_o_ai
6380 vec_mulh(vector
unsigned int __a
, vector
unsigned int __b
) {
6381 return __builtin_altivec_vmulhuw(__a
, __b
);
6384 static __inline__ vector
signed long long __ATTRS_o_ai
6385 vec_mulh(vector
signed long long __a
, vector
signed long long __b
) {
6386 return __builtin_altivec_vmulhsd(__a
, __b
);
6389 static __inline__ vector
unsigned long long __ATTRS_o_ai
6390 vec_mulh(vector
unsigned long long __a
, vector
unsigned long long __b
) {
6391 return __builtin_altivec_vmulhud(__a
, __b
);
6397 static __inline__ vector
short __ATTRS_o_ai
vec_mulo(vector
signed char __a
,
6398 vector
signed char __b
) {
6399 #ifdef __LITTLE_ENDIAN__
6400 return __builtin_altivec_vmulesb(__a
, __b
);
6402 return __builtin_altivec_vmulosb(__a
, __b
);
6406 static __inline__ vector
unsigned short __ATTRS_o_ai
6407 vec_mulo(vector
unsigned char __a
, vector
unsigned char __b
) {
6408 #ifdef __LITTLE_ENDIAN__
6409 return __builtin_altivec_vmuleub(__a
, __b
);
6411 return __builtin_altivec_vmuloub(__a
, __b
);
6415 static __inline__ vector
int __ATTRS_o_ai
vec_mulo(vector
short __a
,
6417 #ifdef __LITTLE_ENDIAN__
6418 return __builtin_altivec_vmulesh(__a
, __b
);
6420 return __builtin_altivec_vmulosh(__a
, __b
);
6424 static __inline__ vector
unsigned int __ATTRS_o_ai
6425 vec_mulo(vector
unsigned short __a
, vector
unsigned short __b
) {
6426 #ifdef __LITTLE_ENDIAN__
6427 return __builtin_altivec_vmuleuh(__a
, __b
);
6429 return __builtin_altivec_vmulouh(__a
, __b
);
6433 #ifdef __POWER8_VECTOR__
6434 static __inline__ vector
signed long long __ATTRS_o_ai
6435 vec_mulo(vector
signed int __a
, vector
signed int __b
) {
6436 #ifdef __LITTLE_ENDIAN__
6437 return __builtin_altivec_vmulesw(__a
, __b
);
6439 return __builtin_altivec_vmulosw(__a
, __b
);
6443 static __inline__ vector
unsigned long long __ATTRS_o_ai
6444 vec_mulo(vector
unsigned int __a
, vector
unsigned int __b
) {
6445 #ifdef __LITTLE_ENDIAN__
6446 return __builtin_altivec_vmuleuw(__a
, __b
);
6448 return __builtin_altivec_vmulouw(__a
, __b
);
6453 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6454 static __inline__ vector
signed __int128 __ATTRS_o_ai
6455 vec_mulo(vector
signed long long __a
, vector
signed long long __b
) {
6456 #ifdef __LITTLE_ENDIAN__
6457 return __builtin_altivec_vmulesd(__a
, __b
);
6459 return __builtin_altivec_vmulosd(__a
, __b
);
6463 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
6464 vec_mulo(vector
unsigned long long __a
, vector
unsigned long long __b
) {
6465 #ifdef __LITTLE_ENDIAN__
6466 return __builtin_altivec_vmuleud(__a
, __b
);
6468 return __builtin_altivec_vmuloud(__a
, __b
);
6475 static __inline__ vector
short __attribute__((__always_inline__
))
6476 vec_vmulosb(vector
signed char __a
, vector
signed char __b
) {
6477 #ifdef __LITTLE_ENDIAN__
6478 return __builtin_altivec_vmulesb(__a
, __b
);
6480 return __builtin_altivec_vmulosb(__a
, __b
);
6486 static __inline__ vector
unsigned short __attribute__((__always_inline__
))
6487 vec_vmuloub(vector
unsigned char __a
, vector
unsigned char __b
) {
6488 #ifdef __LITTLE_ENDIAN__
6489 return __builtin_altivec_vmuleub(__a
, __b
);
6491 return __builtin_altivec_vmuloub(__a
, __b
);
6497 static __inline__ vector
int __attribute__((__always_inline__
))
6498 vec_vmulosh(vector
short __a
, vector
short __b
) {
6499 #ifdef __LITTLE_ENDIAN__
6500 return __builtin_altivec_vmulesh(__a
, __b
);
6502 return __builtin_altivec_vmulosh(__a
, __b
);
6508 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
6509 vec_vmulouh(vector
unsigned short __a
, vector
unsigned short __b
) {
6510 #ifdef __LITTLE_ENDIAN__
6511 return __builtin_altivec_vmuleuh(__a
, __b
);
6513 return __builtin_altivec_vmulouh(__a
, __b
);
6519 #ifdef __POWER8_VECTOR__
6520 static __inline__ vector
signed char __ATTRS_o_ai
6521 vec_nand(vector
signed char __a
, vector
signed char __b
) {
6522 return ~(__a
& __b
);
6525 static __inline__ vector
signed char __ATTRS_o_ai
6526 vec_nand(vector
signed char __a
, vector
bool char __b
) {
6527 return ~(__a
& (vector
signed char)__b
);
6530 static __inline__ vector
signed char __ATTRS_o_ai
6531 vec_nand(vector
bool char __a
, vector
signed char __b
) {
6532 return (vector
signed char)~(__a
& (vector
bool char)__b
);
6535 static __inline__ vector
unsigned char __ATTRS_o_ai
6536 vec_nand(vector
unsigned char __a
, vector
unsigned char __b
) {
6537 return ~(__a
& __b
);
6540 static __inline__ vector
unsigned char __ATTRS_o_ai
6541 vec_nand(vector
unsigned char __a
, vector
bool char __b
) {
6542 return ~(__a
& (vector
unsigned char)__b
);
6545 static __inline__ vector
unsigned char __ATTRS_o_ai
6546 vec_nand(vector
bool char __a
, vector
unsigned char __b
) {
6547 return (vector
unsigned char)~(__a
& (vector
bool char)__b
);
6550 static __inline__ vector
bool char __ATTRS_o_ai
vec_nand(vector
bool char __a
,
6551 vector
bool char __b
) {
6552 return ~(__a
& __b
);
6555 static __inline__ vector
signed short __ATTRS_o_ai
6556 vec_nand(vector
signed short __a
, vector
signed short __b
) {
6557 return ~(__a
& __b
);
6560 static __inline__ vector
signed short __ATTRS_o_ai
6561 vec_nand(vector
signed short __a
, vector
bool short __b
) {
6562 return ~(__a
& (vector
signed short)__b
);
6565 static __inline__ vector
signed short __ATTRS_o_ai
6566 vec_nand(vector
bool short __a
, vector
signed short __b
) {
6567 return (vector
signed short)~(__a
& (vector
bool short)__b
);
6570 static __inline__ vector
unsigned short __ATTRS_o_ai
6571 vec_nand(vector
unsigned short __a
, vector
unsigned short __b
) {
6572 return ~(__a
& __b
);
6575 static __inline__ vector
unsigned short __ATTRS_o_ai
6576 vec_nand(vector
unsigned short __a
, vector
bool short __b
) {
6577 return ~(__a
& (vector
unsigned short)__b
);
6580 static __inline__ vector
bool short __ATTRS_o_ai
6581 vec_nand(vector
bool short __a
, vector
bool short __b
) {
6582 return ~(__a
& __b
);
6585 static __inline__ vector
signed int __ATTRS_o_ai
6586 vec_nand(vector
signed int __a
, vector
signed int __b
) {
6587 return ~(__a
& __b
);
6590 static __inline__ vector
signed int __ATTRS_o_ai
vec_nand(vector
signed int __a
,
6591 vector
bool int __b
) {
6592 return ~(__a
& (vector
signed int)__b
);
6595 static __inline__ vector
signed int __ATTRS_o_ai
6596 vec_nand(vector
bool int __a
, vector
signed int __b
) {
6597 return (vector
signed int)~(__a
& (vector
bool int)__b
);
6600 static __inline__ vector
unsigned int __ATTRS_o_ai
6601 vec_nand(vector
unsigned int __a
, vector
unsigned int __b
) {
6602 return ~(__a
& __b
);
6605 static __inline__ vector
unsigned int __ATTRS_o_ai
6606 vec_nand(vector
unsigned int __a
, vector
bool int __b
) {
6607 return ~(__a
& (vector
unsigned int)__b
);
6610 static __inline__ vector
unsigned int __ATTRS_o_ai
6611 vec_nand(vector
bool int __a
, vector
unsigned int __b
) {
6612 return (vector
unsigned int)~(__a
& (vector
bool int)__b
);
6615 static __inline__ vector
bool int __ATTRS_o_ai
vec_nand(vector
bool int __a
,
6616 vector
bool int __b
) {
6617 return ~(__a
& __b
);
6620 static __inline__ vector
float __ATTRS_o_ai
6621 vec_nand(vector
float __a
, vector
float __b
) {
6622 return (vector
float)(~((vector
unsigned int)__a
&
6623 (vector
unsigned int)__b
));
6626 static __inline__ vector
signed long long __ATTRS_o_ai
6627 vec_nand(vector
signed long long __a
, vector
signed long long __b
) {
6628 return ~(__a
& __b
);
6631 static __inline__ vector
signed long long __ATTRS_o_ai
6632 vec_nand(vector
signed long long __a
, vector
bool long long __b
) {
6633 return ~(__a
& (vector
signed long long)__b
);
6636 static __inline__ vector
signed long long __ATTRS_o_ai
6637 vec_nand(vector
bool long long __a
, vector
signed long long __b
) {
6638 return (vector
signed long long)~(__a
& (vector
bool long long)__b
);
6641 static __inline__ vector
unsigned long long __ATTRS_o_ai
6642 vec_nand(vector
unsigned long long __a
, vector
unsigned long long __b
) {
6643 return ~(__a
& __b
);
6646 static __inline__ vector
unsigned long long __ATTRS_o_ai
6647 vec_nand(vector
unsigned long long __a
, vector
bool long long __b
) {
6648 return ~(__a
& (vector
unsigned long long)__b
);
6651 static __inline__ vector
unsigned long long __ATTRS_o_ai
6652 vec_nand(vector
bool long long __a
, vector
unsigned long long __b
) {
6653 return (vector
unsigned long long)~(__a
& (vector
bool long long)__b
);
6656 static __inline__ vector
bool long long __ATTRS_o_ai
6657 vec_nand(vector
bool long long __a
, vector
bool long long __b
) {
6658 return ~(__a
& __b
);
6661 static __inline__ vector
double __ATTRS_o_ai
6662 vec_nand(vector
double __a
, vector
double __b
) {
6663 return (vector
double)(~((vector
unsigned long long)__a
&
6664 (vector
unsigned long long)__b
));
6672 static __inline__ vector
float __ATTRS_o_ai
vec_nmadd(vector
float __a
,
6675 return __builtin_vsx_xvnmaddasp(__a
, __b
, __c
);
6678 static __inline__ vector
double __ATTRS_o_ai
vec_nmadd(vector
double __a
,
6680 vector
double __c
) {
6681 return __builtin_vsx_xvnmaddadp(__a
, __b
, __c
);
6687 static __inline__ vector
float __ATTRS_o_ai
vec_nmsub(vector
float __a
,
6691 return __builtin_vsx_xvnmsubasp(__a
, __b
, __c
);
6693 return __builtin_altivec_vnmsubfp(__a
, __b
, __c
);
6698 static __inline__ vector
double __ATTRS_o_ai
vec_nmsub(vector
double __a
,
6700 vector
double __c
) {
6701 return __builtin_vsx_xvnmsubadp(__a
, __b
, __c
);
6707 static __inline__ vector
float __attribute__((__always_inline__
))
6708 vec_vnmsubfp(vector
float __a
, vector
float __b
, vector
float __c
) {
6709 return __builtin_altivec_vnmsubfp(__a
, __b
, __c
);
6714 #define __builtin_altivec_vnor vec_nor
6716 static __inline__ vector
signed char __ATTRS_o_ai
6717 vec_nor(vector
signed char __a
, vector
signed char __b
) {
6718 return ~(__a
| __b
);
6721 static __inline__ vector
unsigned char __ATTRS_o_ai
6722 vec_nor(vector
unsigned char __a
, vector
unsigned char __b
) {
6723 return ~(__a
| __b
);
6726 static __inline__ vector
bool char __ATTRS_o_ai
vec_nor(vector
bool char __a
,
6727 vector
bool char __b
) {
6728 return ~(__a
| __b
);
6731 static __inline__ vector
short __ATTRS_o_ai
vec_nor(vector
short __a
,
6733 return ~(__a
| __b
);
6736 static __inline__ vector
unsigned short __ATTRS_o_ai
6737 vec_nor(vector
unsigned short __a
, vector
unsigned short __b
) {
6738 return ~(__a
| __b
);
6741 static __inline__ vector
bool short __ATTRS_o_ai
6742 vec_nor(vector
bool short __a
, vector
bool short __b
) {
6743 return ~(__a
| __b
);
6746 static __inline__ vector
int __ATTRS_o_ai
vec_nor(vector
int __a
,
6748 return ~(__a
| __b
);
6751 static __inline__ vector
unsigned int __ATTRS_o_ai
6752 vec_nor(vector
unsigned int __a
, vector
unsigned int __b
) {
6753 return ~(__a
| __b
);
6756 static __inline__ vector
bool int __ATTRS_o_ai
vec_nor(vector
bool int __a
,
6757 vector
bool int __b
) {
6758 return ~(__a
| __b
);
6761 static __inline__ vector
float __ATTRS_o_ai
vec_nor(vector
float __a
,
6763 vector
unsigned int __res
=
6764 ~((vector
unsigned int)__a
| (vector
unsigned int)__b
);
6765 return (vector
float)__res
;
6769 static __inline__ vector
double __ATTRS_o_ai
vec_nor(vector
double __a
,
6770 vector
double __b
) {
6771 vector
unsigned long long __res
=
6772 ~((vector
unsigned long long)__a
| (vector
unsigned long long)__b
);
6773 return (vector
double)__res
;
6779 static __inline__ vector
signed char __ATTRS_o_ai
6780 vec_vnor(vector
signed char __a
, vector
signed char __b
) {
6781 return ~(__a
| __b
);
6784 static __inline__ vector
unsigned char __ATTRS_o_ai
6785 vec_vnor(vector
unsigned char __a
, vector
unsigned char __b
) {
6786 return ~(__a
| __b
);
6789 static __inline__ vector
bool char __ATTRS_o_ai
vec_vnor(vector
bool char __a
,
6790 vector
bool char __b
) {
6791 return ~(__a
| __b
);
6794 static __inline__ vector
short __ATTRS_o_ai
vec_vnor(vector
short __a
,
6796 return ~(__a
| __b
);
6799 static __inline__ vector
unsigned short __ATTRS_o_ai
6800 vec_vnor(vector
unsigned short __a
, vector
unsigned short __b
) {
6801 return ~(__a
| __b
);
6804 static __inline__ vector
bool short __ATTRS_o_ai
6805 vec_vnor(vector
bool short __a
, vector
bool short __b
) {
6806 return ~(__a
| __b
);
6809 static __inline__ vector
int __ATTRS_o_ai
vec_vnor(vector
int __a
,
6811 return ~(__a
| __b
);
6814 static __inline__ vector
unsigned int __ATTRS_o_ai
6815 vec_vnor(vector
unsigned int __a
, vector
unsigned int __b
) {
6816 return ~(__a
| __b
);
6819 static __inline__ vector
bool int __ATTRS_o_ai
vec_vnor(vector
bool int __a
,
6820 vector
bool int __b
) {
6821 return ~(__a
| __b
);
6824 static __inline__ vector
float __ATTRS_o_ai
vec_vnor(vector
float __a
,
6826 vector
unsigned int __res
=
6827 ~((vector
unsigned int)__a
| (vector
unsigned int)__b
);
6828 return (vector
float)__res
;
6832 static __inline__ vector
signed long long __ATTRS_o_ai
6833 vec_nor(vector
signed long long __a
, vector
signed long long __b
) {
6834 return ~(__a
| __b
);
6837 static __inline__ vector
unsigned long long __ATTRS_o_ai
6838 vec_nor(vector
unsigned long long __a
, vector
unsigned long long __b
) {
6839 return ~(__a
| __b
);
6842 static __inline__ vector
bool long long __ATTRS_o_ai
6843 vec_nor(vector
bool long long __a
, vector
bool long long __b
) {
6844 return ~(__a
| __b
);
6850 #define __builtin_altivec_vor vec_or
6852 static __inline__ vector
signed char __ATTRS_o_ai
6853 vec_or(vector
signed char __a
, vector
signed char __b
) {
6857 static __inline__ vector
signed char __ATTRS_o_ai
6858 vec_or(vector
bool char __a
, vector
signed char __b
) {
6859 return (vector
signed char)__a
| __b
;
6862 static __inline__ vector
signed char __ATTRS_o_ai
vec_or(vector
signed char __a
,
6863 vector
bool char __b
) {
6864 return __a
| (vector
signed char)__b
;
6867 static __inline__ vector
unsigned char __ATTRS_o_ai
6868 vec_or(vector
unsigned char __a
, vector
unsigned char __b
) {
6872 static __inline__ vector
unsigned char __ATTRS_o_ai
6873 vec_or(vector
bool char __a
, vector
unsigned char __b
) {
6874 return (vector
unsigned char)__a
| __b
;
6877 static __inline__ vector
unsigned char __ATTRS_o_ai
6878 vec_or(vector
unsigned char __a
, vector
bool char __b
) {
6879 return __a
| (vector
unsigned char)__b
;
6882 static __inline__ vector
bool char __ATTRS_o_ai
vec_or(vector
bool char __a
,
6883 vector
bool char __b
) {
6887 static __inline__ vector
short __ATTRS_o_ai
vec_or(vector
short __a
,
6892 static __inline__ vector
short __ATTRS_o_ai
vec_or(vector
bool short __a
,
6894 return (vector
short)__a
| __b
;
6897 static __inline__ vector
short __ATTRS_o_ai
vec_or(vector
short __a
,
6898 vector
bool short __b
) {
6899 return __a
| (vector
short)__b
;
6902 static __inline__ vector
unsigned short __ATTRS_o_ai
6903 vec_or(vector
unsigned short __a
, vector
unsigned short __b
) {
6907 static __inline__ vector
unsigned short __ATTRS_o_ai
6908 vec_or(vector
bool short __a
, vector
unsigned short __b
) {
6909 return (vector
unsigned short)__a
| __b
;
6912 static __inline__ vector
unsigned short __ATTRS_o_ai
6913 vec_or(vector
unsigned short __a
, vector
bool short __b
) {
6914 return __a
| (vector
unsigned short)__b
;
6917 static __inline__ vector
bool short __ATTRS_o_ai
vec_or(vector
bool short __a
,
6918 vector
bool short __b
) {
6922 static __inline__ vector
int __ATTRS_o_ai
vec_or(vector
int __a
,
6927 static __inline__ vector
int __ATTRS_o_ai
vec_or(vector
bool int __a
,
6929 return (vector
int)__a
| __b
;
6932 static __inline__ vector
int __ATTRS_o_ai
vec_or(vector
int __a
,
6933 vector
bool int __b
) {
6934 return __a
| (vector
int)__b
;
6937 static __inline__ vector
unsigned int __ATTRS_o_ai
6938 vec_or(vector
unsigned int __a
, vector
unsigned int __b
) {
6942 static __inline__ vector
unsigned int __ATTRS_o_ai
6943 vec_or(vector
bool int __a
, vector
unsigned int __b
) {
6944 return (vector
unsigned int)__a
| __b
;
6947 static __inline__ vector
unsigned int __ATTRS_o_ai
6948 vec_or(vector
unsigned int __a
, vector
bool int __b
) {
6949 return __a
| (vector
unsigned int)__b
;
6952 static __inline__ vector
bool int __ATTRS_o_ai
vec_or(vector
bool int __a
,
6953 vector
bool int __b
) {
6957 static __inline__ vector
float __ATTRS_o_ai
vec_or(vector
float __a
,
6959 vector
unsigned int __res
=
6960 (vector
unsigned int)__a
| (vector
unsigned int)__b
;
6961 return (vector
float)__res
;
6964 static __inline__ vector
float __ATTRS_o_ai
vec_or(vector
bool int __a
,
6966 vector
unsigned int __res
=
6967 (vector
unsigned int)__a
| (vector
unsigned int)__b
;
6968 return (vector
float)__res
;
6971 static __inline__ vector
float __ATTRS_o_ai
vec_or(vector
float __a
,
6972 vector
bool int __b
) {
6973 vector
unsigned int __res
=
6974 (vector
unsigned int)__a
| (vector
unsigned int)__b
;
6975 return (vector
float)__res
;
6979 static __inline__ vector
double __ATTRS_o_ai
vec_or(vector
bool long long __a
,
6980 vector
double __b
) {
6981 return (vector
double)((vector
unsigned long long)__a
|
6982 (vector
unsigned long long)__b
);
6985 static __inline__ vector
double __ATTRS_o_ai
vec_or(vector
double __a
,
6986 vector
bool long long __b
) {
6987 return (vector
double)((vector
unsigned long long)__a
|
6988 (vector
unsigned long long)__b
);
6991 static __inline__ vector
double __ATTRS_o_ai
vec_or(vector
double __a
,
6992 vector
double __b
) {
6993 return (vector
double)((vector
unsigned long long)__a
|
6994 (vector
unsigned long long)__b
);
6997 static __inline__ vector
signed long long __ATTRS_o_ai
6998 vec_or(vector
signed long long __a
, vector
signed long long __b
) {
7002 static __inline__ vector
signed long long __ATTRS_o_ai
7003 vec_or(vector
bool long long __a
, vector
signed long long __b
) {
7004 return (vector
signed long long)__a
| __b
;
7007 static __inline__ vector
signed long long __ATTRS_o_ai
7008 vec_or(vector
signed long long __a
, vector
bool long long __b
) {
7009 return __a
| (vector
signed long long)__b
;
7012 static __inline__ vector
unsigned long long __ATTRS_o_ai
7013 vec_or(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7017 static __inline__ vector
unsigned long long __ATTRS_o_ai
7018 vec_or(vector
bool long long __a
, vector
unsigned long long __b
) {
7019 return (vector
unsigned long long)__a
| __b
;
7022 static __inline__ vector
unsigned long long __ATTRS_o_ai
7023 vec_or(vector
unsigned long long __a
, vector
bool long long __b
) {
7024 return __a
| (vector
unsigned long long)__b
;
7027 static __inline__ vector
bool long long __ATTRS_o_ai
7028 vec_or(vector
bool long long __a
, vector
bool long long __b
) {
7033 #ifdef __POWER8_VECTOR__
7034 static __inline__ vector
signed char __ATTRS_o_ai
7035 vec_orc(vector
signed char __a
, vector
signed char __b
) {
7039 static __inline__ vector
signed char __ATTRS_o_ai
7040 vec_orc(vector
signed char __a
, vector
bool char __b
) {
7041 return __a
| (vector
signed char)~__b
;
7044 static __inline__ vector
signed char __ATTRS_o_ai
7045 vec_orc(vector
bool char __a
, vector
signed char __b
) {
7046 return (vector
signed char)(__a
| (vector
bool char)~__b
);
7049 static __inline__ vector
unsigned char __ATTRS_o_ai
7050 vec_orc(vector
unsigned char __a
, vector
unsigned char __b
) {
7054 static __inline__ vector
unsigned char __ATTRS_o_ai
7055 vec_orc(vector
unsigned char __a
, vector
bool char __b
) {
7056 return __a
| (vector
unsigned char)~__b
;
7059 static __inline__ vector
unsigned char __ATTRS_o_ai
7060 vec_orc(vector
bool char __a
, vector
unsigned char __b
) {
7061 return (vector
unsigned char)(__a
| (vector
bool char)~__b
);
7064 static __inline__ vector
bool char __ATTRS_o_ai
vec_orc(vector
bool char __a
,
7065 vector
bool char __b
) {
7069 static __inline__ vector
signed short __ATTRS_o_ai
7070 vec_orc(vector
signed short __a
, vector
signed short __b
) {
7074 static __inline__ vector
signed short __ATTRS_o_ai
7075 vec_orc(vector
signed short __a
, vector
bool short __b
) {
7076 return __a
| (vector
signed short)~__b
;
7079 static __inline__ vector
signed short __ATTRS_o_ai
7080 vec_orc(vector
bool short __a
, vector
signed short __b
) {
7081 return (vector
signed short)(__a
| (vector
bool short)~__b
);
7084 static __inline__ vector
unsigned short __ATTRS_o_ai
7085 vec_orc(vector
unsigned short __a
, vector
unsigned short __b
) {
7089 static __inline__ vector
unsigned short __ATTRS_o_ai
7090 vec_orc(vector
unsigned short __a
, vector
bool short __b
) {
7091 return __a
| (vector
unsigned short)~__b
;
7094 static __inline__ vector
unsigned short __ATTRS_o_ai
7095 vec_orc(vector
bool short __a
, vector
unsigned short __b
) {
7096 return (vector
unsigned short)(__a
| (vector
bool short)~__b
);
7099 static __inline__ vector
bool short __ATTRS_o_ai
7100 vec_orc(vector
bool short __a
, vector
bool short __b
) {
7104 static __inline__ vector
signed int __ATTRS_o_ai
7105 vec_orc(vector
signed int __a
, vector
signed int __b
) {
7109 static __inline__ vector
signed int __ATTRS_o_ai
vec_orc(vector
signed int __a
,
7110 vector
bool int __b
) {
7111 return __a
| (vector
signed int)~__b
;
7114 static __inline__ vector
signed int __ATTRS_o_ai
7115 vec_orc(vector
bool int __a
, vector
signed int __b
) {
7116 return (vector
signed int)(__a
| (vector
bool int)~__b
);
7119 static __inline__ vector
unsigned int __ATTRS_o_ai
7120 vec_orc(vector
unsigned int __a
, vector
unsigned int __b
) {
7124 static __inline__ vector
unsigned int __ATTRS_o_ai
7125 vec_orc(vector
unsigned int __a
, vector
bool int __b
) {
7126 return __a
| (vector
unsigned int)~__b
;
7129 static __inline__ vector
unsigned int __ATTRS_o_ai
7130 vec_orc(vector
bool int __a
, vector
unsigned int __b
) {
7131 return (vector
unsigned int)(__a
| (vector
bool int)~__b
);
7134 static __inline__ vector
bool int __ATTRS_o_ai
vec_orc(vector
bool int __a
,
7135 vector
bool int __b
) {
7139 static __inline__ vector
float __ATTRS_o_ai
7140 vec_orc(vector
bool int __a
, vector
float __b
) {
7141 return (vector
float)(__a
| ~(vector
bool int)__b
);
7144 static __inline__ vector
float __ATTRS_o_ai
7145 vec_orc(vector
float __a
, vector
bool int __b
) {
7146 return (vector
float)((vector
bool int)__a
| ~__b
);
7149 static __inline__ vector
float __ATTRS_o_ai
vec_orc(vector
float __a
,
7151 return (vector
float)((vector
unsigned int)__a
| ~(vector
unsigned int)__b
);
7154 static __inline__ vector
signed long long __ATTRS_o_ai
7155 vec_orc(vector
signed long long __a
, vector
signed long long __b
) {
7159 static __inline__ vector
signed long long __ATTRS_o_ai
7160 vec_orc(vector
signed long long __a
, vector
bool long long __b
) {
7161 return __a
| (vector
signed long long)~__b
;
7164 static __inline__ vector
signed long long __ATTRS_o_ai
7165 vec_orc(vector
bool long long __a
, vector
signed long long __b
) {
7166 return (vector
signed long long)(__a
| (vector
bool long long)~__b
);
7169 static __inline__ vector
unsigned long long __ATTRS_o_ai
7170 vec_orc(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7174 static __inline__ vector
unsigned long long __ATTRS_o_ai
7175 vec_orc(vector
unsigned long long __a
, vector
bool long long __b
) {
7176 return __a
| (vector
unsigned long long)~__b
;
7179 static __inline__ vector
unsigned long long __ATTRS_o_ai
7180 vec_orc(vector
bool long long __a
, vector
unsigned long long __b
) {
7181 return (vector
unsigned long long)(__a
| (vector
bool long long)~__b
);
7184 static __inline__ vector
bool long long __ATTRS_o_ai
7185 vec_orc(vector
bool long long __a
, vector
bool long long __b
) {
7189 static __inline__ vector
double __ATTRS_o_ai
7190 vec_orc(vector
double __a
, vector
bool long long __b
) {
7191 return (vector
double)((vector
bool long long)__a
| ~__b
);
7194 static __inline__ vector
double __ATTRS_o_ai
7195 vec_orc(vector
bool long long __a
, vector
double __b
) {
7196 return (vector
double)(__a
| ~(vector
bool long long)__b
);
7199 static __inline__ vector
double __ATTRS_o_ai
vec_orc(vector
double __a
,
7200 vector
double __b
) {
7201 return (vector
double)((vector
unsigned long long)__a
|
7202 ~(vector
unsigned long long)__b
);
7208 static __inline__ vector
signed char __ATTRS_o_ai
7209 vec_vor(vector
signed char __a
, vector
signed char __b
) {
7213 static __inline__ vector
signed char __ATTRS_o_ai
7214 vec_vor(vector
bool char __a
, vector
signed char __b
) {
7215 return (vector
signed char)__a
| __b
;
7218 static __inline__ vector
signed char __ATTRS_o_ai
7219 vec_vor(vector
signed char __a
, vector
bool char __b
) {
7220 return __a
| (vector
signed char)__b
;
7223 static __inline__ vector
unsigned char __ATTRS_o_ai
7224 vec_vor(vector
unsigned char __a
, vector
unsigned char __b
) {
7228 static __inline__ vector
unsigned char __ATTRS_o_ai
7229 vec_vor(vector
bool char __a
, vector
unsigned char __b
) {
7230 return (vector
unsigned char)__a
| __b
;
7233 static __inline__ vector
unsigned char __ATTRS_o_ai
7234 vec_vor(vector
unsigned char __a
, vector
bool char __b
) {
7235 return __a
| (vector
unsigned char)__b
;
7238 static __inline__ vector
bool char __ATTRS_o_ai
vec_vor(vector
bool char __a
,
7239 vector
bool char __b
) {
7243 static __inline__ vector
short __ATTRS_o_ai
vec_vor(vector
short __a
,
7248 static __inline__ vector
short __ATTRS_o_ai
vec_vor(vector
bool short __a
,
7250 return (vector
short)__a
| __b
;
7253 static __inline__ vector
short __ATTRS_o_ai
vec_vor(vector
short __a
,
7254 vector
bool short __b
) {
7255 return __a
| (vector
short)__b
;
7258 static __inline__ vector
unsigned short __ATTRS_o_ai
7259 vec_vor(vector
unsigned short __a
, vector
unsigned short __b
) {
7263 static __inline__ vector
unsigned short __ATTRS_o_ai
7264 vec_vor(vector
bool short __a
, vector
unsigned short __b
) {
7265 return (vector
unsigned short)__a
| __b
;
7268 static __inline__ vector
unsigned short __ATTRS_o_ai
7269 vec_vor(vector
unsigned short __a
, vector
bool short __b
) {
7270 return __a
| (vector
unsigned short)__b
;
7273 static __inline__ vector
bool short __ATTRS_o_ai
7274 vec_vor(vector
bool short __a
, vector
bool short __b
) {
7278 static __inline__ vector
int __ATTRS_o_ai
vec_vor(vector
int __a
,
7283 static __inline__ vector
int __ATTRS_o_ai
vec_vor(vector
bool int __a
,
7285 return (vector
int)__a
| __b
;
7288 static __inline__ vector
int __ATTRS_o_ai
vec_vor(vector
int __a
,
7289 vector
bool int __b
) {
7290 return __a
| (vector
int)__b
;
7293 static __inline__ vector
unsigned int __ATTRS_o_ai
7294 vec_vor(vector
unsigned int __a
, vector
unsigned int __b
) {
7298 static __inline__ vector
unsigned int __ATTRS_o_ai
7299 vec_vor(vector
bool int __a
, vector
unsigned int __b
) {
7300 return (vector
unsigned int)__a
| __b
;
7303 static __inline__ vector
unsigned int __ATTRS_o_ai
7304 vec_vor(vector
unsigned int __a
, vector
bool int __b
) {
7305 return __a
| (vector
unsigned int)__b
;
7308 static __inline__ vector
bool int __ATTRS_o_ai
vec_vor(vector
bool int __a
,
7309 vector
bool int __b
) {
7313 static __inline__ vector
float __ATTRS_o_ai
vec_vor(vector
float __a
,
7315 vector
unsigned int __res
=
7316 (vector
unsigned int)__a
| (vector
unsigned int)__b
;
7317 return (vector
float)__res
;
7320 static __inline__ vector
float __ATTRS_o_ai
vec_vor(vector
bool int __a
,
7322 vector
unsigned int __res
=
7323 (vector
unsigned int)__a
| (vector
unsigned int)__b
;
7324 return (vector
float)__res
;
7327 static __inline__ vector
float __ATTRS_o_ai
vec_vor(vector
float __a
,
7328 vector
bool int __b
) {
7329 vector
unsigned int __res
=
7330 (vector
unsigned int)__a
| (vector
unsigned int)__b
;
7331 return (vector
float)__res
;
7335 static __inline__ vector
signed long long __ATTRS_o_ai
7336 vec_vor(vector
signed long long __a
, vector
signed long long __b
) {
7340 static __inline__ vector
signed long long __ATTRS_o_ai
7341 vec_vor(vector
bool long long __a
, vector
signed long long __b
) {
7342 return (vector
signed long long)__a
| __b
;
7345 static __inline__ vector
signed long long __ATTRS_o_ai
7346 vec_vor(vector
signed long long __a
, vector
bool long long __b
) {
7347 return __a
| (vector
signed long long)__b
;
7350 static __inline__ vector
unsigned long long __ATTRS_o_ai
7351 vec_vor(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7355 static __inline__ vector
unsigned long long __ATTRS_o_ai
7356 vec_vor(vector
bool long long __a
, vector
unsigned long long __b
) {
7357 return (vector
unsigned long long)__a
| __b
;
7360 static __inline__ vector
unsigned long long __ATTRS_o_ai
7361 vec_vor(vector
unsigned long long __a
, vector
bool long long __b
) {
7362 return __a
| (vector
unsigned long long)__b
;
7365 static __inline__ vector
bool long long __ATTRS_o_ai
7366 vec_vor(vector
bool long long __a
, vector
bool long long __b
) {
7373 /* The various vector pack instructions have a big-endian bias, so for
7374 little endian we must handle reversed element numbering. */
7376 static __inline__ vector
signed char __ATTRS_o_ai
7377 vec_pack(vector
signed short __a
, vector
signed short __b
) {
7378 #ifdef __LITTLE_ENDIAN__
7379 return (vector
signed char)vec_perm(
7381 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7382 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7384 return (vector
signed char)vec_perm(
7386 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7387 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7391 static __inline__ vector
unsigned char __ATTRS_o_ai
7392 vec_pack(vector
unsigned short __a
, vector
unsigned short __b
) {
7393 #ifdef __LITTLE_ENDIAN__
7394 return (vector
unsigned char)vec_perm(
7396 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7397 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7399 return (vector
unsigned char)vec_perm(
7401 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7402 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7406 static __inline__ vector
bool char __ATTRS_o_ai
7407 vec_pack(vector
bool short __a
, vector
bool short __b
) {
7408 #ifdef __LITTLE_ENDIAN__
7409 return (vector
bool char)vec_perm(
7411 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7412 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7414 return (vector
bool char)vec_perm(
7416 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7417 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7421 static __inline__ vector
short __ATTRS_o_ai
vec_pack(vector
int __a
,
7423 #ifdef __LITTLE_ENDIAN__
7424 return (vector
short)vec_perm(
7426 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7427 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7429 return (vector
short)vec_perm(
7431 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7432 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7436 static __inline__ vector
unsigned short __ATTRS_o_ai
7437 vec_pack(vector
unsigned int __a
, vector
unsigned int __b
) {
7438 #ifdef __LITTLE_ENDIAN__
7439 return (vector
unsigned short)vec_perm(
7441 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7442 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7444 return (vector
unsigned short)vec_perm(
7446 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7447 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7451 static __inline__ vector
bool short __ATTRS_o_ai
vec_pack(vector
bool int __a
,
7452 vector
bool int __b
) {
7453 #ifdef __LITTLE_ENDIAN__
7454 return (vector
bool short)vec_perm(
7456 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7457 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7459 return (vector
bool short)vec_perm(
7461 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7462 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7467 static __inline__ vector
signed int __ATTRS_o_ai
7468 vec_pack(vector
signed long long __a
, vector
signed long long __b
) {
7469 #ifdef __LITTLE_ENDIAN__
7470 return (vector
signed int)vec_perm(
7472 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7473 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7475 return (vector
signed int)vec_perm(
7477 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7478 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7481 static __inline__ vector
unsigned int __ATTRS_o_ai
7482 vec_pack(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7483 #ifdef __LITTLE_ENDIAN__
7484 return (vector
unsigned int)vec_perm(
7486 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7487 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7489 return (vector
unsigned int)vec_perm(
7491 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7492 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7496 static __inline__ vector
bool int __ATTRS_o_ai
7497 vec_pack(vector
bool long long __a
, vector
bool long long __b
) {
7498 #ifdef __LITTLE_ENDIAN__
7499 return (vector
bool int)vec_perm(
7501 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7502 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7504 return (vector
bool int)vec_perm(
7506 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7507 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7511 static __inline__ vector
float __ATTRS_o_ai
7512 vec_pack(vector
double __a
, vector
double __b
) {
7513 return (vector
float) (__a
[0], __a
[1], __b
[0], __b
[1]);
7517 #ifdef __POWER9_VECTOR__
7518 static __inline__ vector
unsigned short __ATTRS_o_ai
7519 vec_pack_to_short_fp32(vector
float __a
, vector
float __b
) {
7520 vector
float __resa
= __builtin_vsx_xvcvsphp(__a
);
7521 vector
float __resb
= __builtin_vsx_xvcvsphp(__b
);
7522 #ifdef __LITTLE_ENDIAN__
7523 return (vector
unsigned short)vec_mergee(__resa
, __resb
);
7525 return (vector
unsigned short)vec_mergeo(__resa
, __resb
);
7532 #define __builtin_altivec_vpkuhum vec_vpkuhum
7534 static __inline__ vector
signed char __ATTRS_o_ai
7535 vec_vpkuhum(vector
signed short __a
, vector
signed short __b
) {
7536 #ifdef __LITTLE_ENDIAN__
7537 return (vector
signed char)vec_perm(
7539 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7540 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7542 return (vector
signed char)vec_perm(
7544 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7545 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7549 static __inline__ vector
unsigned char __ATTRS_o_ai
7550 vec_vpkuhum(vector
unsigned short __a
, vector
unsigned short __b
) {
7551 #ifdef __LITTLE_ENDIAN__
7552 return (vector
unsigned char)vec_perm(
7554 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7555 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7557 return (vector
unsigned char)vec_perm(
7559 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7560 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7564 static __inline__ vector
bool char __ATTRS_o_ai
7565 vec_vpkuhum(vector
bool short __a
, vector
bool short __b
) {
7566 #ifdef __LITTLE_ENDIAN__
7567 return (vector
bool char)vec_perm(
7569 (vector
unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7570 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7572 return (vector
bool char)vec_perm(
7574 (vector
unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7575 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7581 #define __builtin_altivec_vpkuwum vec_vpkuwum
7583 static __inline__ vector
short __ATTRS_o_ai
vec_vpkuwum(vector
int __a
,
7585 #ifdef __LITTLE_ENDIAN__
7586 return (vector
short)vec_perm(
7588 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7589 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7591 return (vector
short)vec_perm(
7593 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7594 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7598 static __inline__ vector
unsigned short __ATTRS_o_ai
7599 vec_vpkuwum(vector
unsigned int __a
, vector
unsigned int __b
) {
7600 #ifdef __LITTLE_ENDIAN__
7601 return (vector
unsigned short)vec_perm(
7603 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7604 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7606 return (vector
unsigned short)vec_perm(
7608 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7609 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7613 static __inline__ vector
bool short __ATTRS_o_ai
7614 vec_vpkuwum(vector
bool int __a
, vector
bool int __b
) {
7615 #ifdef __LITTLE_ENDIAN__
7616 return (vector
bool short)vec_perm(
7618 (vector
unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7619 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7621 return (vector
bool short)vec_perm(
7623 (vector
unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7624 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7630 #ifdef __POWER8_VECTOR__
7631 #define __builtin_altivec_vpkudum vec_vpkudum
7633 static __inline__ vector
int __ATTRS_o_ai
vec_vpkudum(vector
long long __a
,
7634 vector
long long __b
) {
7635 #ifdef __LITTLE_ENDIAN__
7636 return (vector
int)vec_perm(
7638 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7639 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7641 return (vector
int)vec_perm(
7643 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7644 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7648 static __inline__ vector
unsigned int __ATTRS_o_ai
7649 vec_vpkudum(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7650 #ifdef __LITTLE_ENDIAN__
7651 return (vector
unsigned int)vec_perm(
7653 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7654 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7656 return (vector
unsigned int)vec_perm(
7658 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7659 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7663 static __inline__ vector
bool int __ATTRS_o_ai
7664 vec_vpkudum(vector
bool long long __a
, vector
bool long long __b
) {
7665 #ifdef __LITTLE_ENDIAN__
7666 return (vector
bool int)vec_perm(
7667 (vector
long long)__a
, (vector
long long)__b
,
7668 (vector
unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7669 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7671 return (vector
bool int)vec_perm(
7672 (vector
long long)__a
, (vector
long long)__b
,
7673 (vector
unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7674 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7681 static __inline__ vector pixel
__attribute__((__always_inline__
))
7682 vec_packpx(vector
unsigned int __a
, vector
unsigned int __b
) {
7683 #ifdef __LITTLE_ENDIAN__
7684 return (vector pixel
)__builtin_altivec_vpkpx(__b
, __a
);
7686 return (vector pixel
)__builtin_altivec_vpkpx(__a
, __b
);
7692 static __inline__ vector pixel
__attribute__((__always_inline__
))
7693 vec_vpkpx(vector
unsigned int __a
, vector
unsigned int __b
) {
7694 #ifdef __LITTLE_ENDIAN__
7695 return (vector pixel
)__builtin_altivec_vpkpx(__b
, __a
);
7697 return (vector pixel
)__builtin_altivec_vpkpx(__a
, __b
);
7703 static __inline__ vector
signed char __ATTRS_o_ai
vec_packs(vector
short __a
,
7705 #ifdef __LITTLE_ENDIAN__
7706 return __builtin_altivec_vpkshss(__b
, __a
);
7708 return __builtin_altivec_vpkshss(__a
, __b
);
7712 static __inline__ vector
unsigned char __ATTRS_o_ai
7713 vec_packs(vector
unsigned short __a
, vector
unsigned short __b
) {
7714 #ifdef __LITTLE_ENDIAN__
7715 return __builtin_altivec_vpkuhus(__b
, __a
);
7717 return __builtin_altivec_vpkuhus(__a
, __b
);
7721 static __inline__ vector
signed short __ATTRS_o_ai
vec_packs(vector
int __a
,
7723 #ifdef __LITTLE_ENDIAN__
7724 return __builtin_altivec_vpkswss(__b
, __a
);
7726 return __builtin_altivec_vpkswss(__a
, __b
);
7730 static __inline__ vector
unsigned short __ATTRS_o_ai
7731 vec_packs(vector
unsigned int __a
, vector
unsigned int __b
) {
7732 #ifdef __LITTLE_ENDIAN__
7733 return __builtin_altivec_vpkuwus(__b
, __a
);
7735 return __builtin_altivec_vpkuwus(__a
, __b
);
7739 #ifdef __POWER8_VECTOR__
7740 static __inline__ vector
int __ATTRS_o_ai
vec_packs(vector
long long __a
,
7741 vector
long long __b
) {
7742 #ifdef __LITTLE_ENDIAN__
7743 return __builtin_altivec_vpksdss(__b
, __a
);
7745 return __builtin_altivec_vpksdss(__a
, __b
);
7749 static __inline__ vector
unsigned int __ATTRS_o_ai
7750 vec_packs(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7751 #ifdef __LITTLE_ENDIAN__
7752 return __builtin_altivec_vpkudus(__b
, __a
);
7754 return __builtin_altivec_vpkudus(__a
, __b
);
7761 static __inline__ vector
signed char __attribute__((__always_inline__
))
7762 vec_vpkshss(vector
short __a
, vector
short __b
) {
7763 #ifdef __LITTLE_ENDIAN__
7764 return __builtin_altivec_vpkshss(__b
, __a
);
7766 return __builtin_altivec_vpkshss(__a
, __b
);
7772 #ifdef __POWER8_VECTOR__
7773 static __inline__ vector
int __ATTRS_o_ai
vec_vpksdss(vector
long long __a
,
7774 vector
long long __b
) {
7775 #ifdef __LITTLE_ENDIAN__
7776 return __builtin_altivec_vpksdss(__b
, __a
);
7778 return __builtin_altivec_vpksdss(__a
, __b
);
7785 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
7786 vec_vpkuhus(vector
unsigned short __a
, vector
unsigned short __b
) {
7787 #ifdef __LITTLE_ENDIAN__
7788 return __builtin_altivec_vpkuhus(__b
, __a
);
7790 return __builtin_altivec_vpkuhus(__a
, __b
);
7796 #ifdef __POWER8_VECTOR__
7797 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
7798 vec_vpkudus(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7799 #ifdef __LITTLE_ENDIAN__
7800 return __builtin_altivec_vpkudus(__b
, __a
);
7802 return __builtin_altivec_vpkudus(__a
, __b
);
7809 static __inline__ vector
signed short __attribute__((__always_inline__
))
7810 vec_vpkswss(vector
int __a
, vector
int __b
) {
7811 #ifdef __LITTLE_ENDIAN__
7812 return __builtin_altivec_vpkswss(__b
, __a
);
7814 return __builtin_altivec_vpkswss(__a
, __b
);
7820 static __inline__ vector
unsigned short __attribute__((__always_inline__
))
7821 vec_vpkuwus(vector
unsigned int __a
, vector
unsigned int __b
) {
7822 #ifdef __LITTLE_ENDIAN__
7823 return __builtin_altivec_vpkuwus(__b
, __a
);
7825 return __builtin_altivec_vpkuwus(__a
, __b
);
7831 static __inline__ vector
unsigned char __ATTRS_o_ai
7832 vec_packsu(vector
short __a
, vector
short __b
) {
7833 #ifdef __LITTLE_ENDIAN__
7834 return __builtin_altivec_vpkshus(__b
, __a
);
7836 return __builtin_altivec_vpkshus(__a
, __b
);
7840 static __inline__ vector
unsigned char __ATTRS_o_ai
7841 vec_packsu(vector
unsigned short __a
, vector
unsigned short __b
) {
7842 #ifdef __LITTLE_ENDIAN__
7843 return __builtin_altivec_vpkuhus(__b
, __a
);
7845 return __builtin_altivec_vpkuhus(__a
, __b
);
7849 static __inline__ vector
unsigned short __ATTRS_o_ai
7850 vec_packsu(vector
int __a
, vector
int __b
) {
7851 #ifdef __LITTLE_ENDIAN__
7852 return __builtin_altivec_vpkswus(__b
, __a
);
7854 return __builtin_altivec_vpkswus(__a
, __b
);
7858 static __inline__ vector
unsigned short __ATTRS_o_ai
7859 vec_packsu(vector
unsigned int __a
, vector
unsigned int __b
) {
7860 #ifdef __LITTLE_ENDIAN__
7861 return __builtin_altivec_vpkuwus(__b
, __a
);
7863 return __builtin_altivec_vpkuwus(__a
, __b
);
7867 #ifdef __POWER8_VECTOR__
7868 static __inline__ vector
unsigned int __ATTRS_o_ai
7869 vec_packsu(vector
long long __a
, vector
long long __b
) {
7870 #ifdef __LITTLE_ENDIAN__
7871 return __builtin_altivec_vpksdus(__b
, __a
);
7873 return __builtin_altivec_vpksdus(__a
, __b
);
7877 static __inline__ vector
unsigned int __ATTRS_o_ai
7878 vec_packsu(vector
unsigned long long __a
, vector
unsigned long long __b
) {
7879 #ifdef __LITTLE_ENDIAN__
7880 return __builtin_altivec_vpkudus(__b
, __a
);
7882 return __builtin_altivec_vpkudus(__a
, __b
);
7889 static __inline__ vector
unsigned char __ATTRS_o_ai
7890 vec_vpkshus(vector
short __a
, vector
short __b
) {
7891 #ifdef __LITTLE_ENDIAN__
7892 return __builtin_altivec_vpkshus(__b
, __a
);
7894 return __builtin_altivec_vpkshus(__a
, __b
);
7898 static __inline__ vector
unsigned char __ATTRS_o_ai
7899 vec_vpkshus(vector
unsigned short __a
, vector
unsigned short __b
) {
7900 #ifdef __LITTLE_ENDIAN__
7901 return __builtin_altivec_vpkuhus(__b
, __a
);
7903 return __builtin_altivec_vpkuhus(__a
, __b
);
7909 static __inline__ vector
unsigned short __ATTRS_o_ai
7910 vec_vpkswus(vector
int __a
, vector
int __b
) {
7911 #ifdef __LITTLE_ENDIAN__
7912 return __builtin_altivec_vpkswus(__b
, __a
);
7914 return __builtin_altivec_vpkswus(__a
, __b
);
7918 static __inline__ vector
unsigned short __ATTRS_o_ai
7919 vec_vpkswus(vector
unsigned int __a
, vector
unsigned int __b
) {
7920 #ifdef __LITTLE_ENDIAN__
7921 return __builtin_altivec_vpkuwus(__b
, __a
);
7923 return __builtin_altivec_vpkuwus(__a
, __b
);
7929 #ifdef __POWER8_VECTOR__
7930 static __inline__ vector
unsigned int __ATTRS_o_ai
7931 vec_vpksdus(vector
long long __a
, vector
long long __b
) {
7932 #ifdef __LITTLE_ENDIAN__
7933 return __builtin_altivec_vpksdus(__b
, __a
);
7935 return __builtin_altivec_vpksdus(__a
, __b
);
7942 // The vperm instruction is defined architecturally with a big-endian bias.
7943 // For little endian, we swap the input operands and invert the permute
7944 // control vector. Only the rightmost 5 bits matter, so we could use
7945 // a vector of all 31s instead of all 255s to perform the inversion.
7946 // However, when the PCV is not a constant, using 255 has an advantage
7947 // in that the vec_xor can be recognized as a vec_nor (and for P8 and
7948 // later, possibly a vec_nand).
7950 static __inline__ vector
signed char __ATTRS_o_ai
vec_perm(
7951 vector
signed char __a
, vector
signed char __b
, vector
unsigned char __c
) {
7952 #ifdef __LITTLE_ENDIAN__
7953 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
7954 255, 255, 255, 255, 255, 255, 255, 255};
7955 __d
= vec_xor(__c
, __d
);
7956 return (vector
signed char)__builtin_altivec_vperm_4si((vector
int)__b
,
7957 (vector
int)__a
, __d
);
7959 return (vector
signed char)__builtin_altivec_vperm_4si((vector
int)__a
,
7960 (vector
int)__b
, __c
);
7964 static __inline__ vector
unsigned char __ATTRS_o_ai
7965 vec_perm(vector
unsigned char __a
, vector
unsigned char __b
,
7966 vector
unsigned char __c
) {
7967 #ifdef __LITTLE_ENDIAN__
7968 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
7969 255, 255, 255, 255, 255, 255, 255, 255};
7970 __d
= vec_xor(__c
, __d
);
7971 return (vector
unsigned char)__builtin_altivec_vperm_4si(
7972 (vector
int)__b
, (vector
int)__a
, __d
);
7974 return (vector
unsigned char)__builtin_altivec_vperm_4si(
7975 (vector
int)__a
, (vector
int)__b
, __c
);
7979 static __inline__ vector
bool char __ATTRS_o_ai
7980 vec_perm(vector
bool char __a
, vector
bool char __b
, vector
unsigned char __c
) {
7981 #ifdef __LITTLE_ENDIAN__
7982 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
7983 255, 255, 255, 255, 255, 255, 255, 255};
7984 __d
= vec_xor(__c
, __d
);
7985 return (vector
bool char)__builtin_altivec_vperm_4si((vector
int)__b
,
7986 (vector
int)__a
, __d
);
7988 return (vector
bool char)__builtin_altivec_vperm_4si((vector
int)__a
,
7989 (vector
int)__b
, __c
);
7993 static __inline__ vector
short __ATTRS_o_ai
vec_perm(vector
signed short __a
,
7994 vector
signed short __b
,
7995 vector
unsigned char __c
) {
7996 #ifdef __LITTLE_ENDIAN__
7997 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
7998 255, 255, 255, 255, 255, 255, 255, 255};
7999 __d
= vec_xor(__c
, __d
);
8000 return (vector
signed short)__builtin_altivec_vperm_4si((vector
int)__b
,
8001 (vector
int)__a
, __d
);
8003 return (vector
signed short)__builtin_altivec_vperm_4si((vector
int)__a
,
8004 (vector
int)__b
, __c
);
8008 static __inline__ vector
unsigned short __ATTRS_o_ai
8009 vec_perm(vector
unsigned short __a
, vector
unsigned short __b
,
8010 vector
unsigned char __c
) {
8011 #ifdef __LITTLE_ENDIAN__
8012 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8013 255, 255, 255, 255, 255, 255, 255, 255};
8014 __d
= vec_xor(__c
, __d
);
8015 return (vector
unsigned short)__builtin_altivec_vperm_4si(
8016 (vector
int)__b
, (vector
int)__a
, __d
);
8018 return (vector
unsigned short)__builtin_altivec_vperm_4si(
8019 (vector
int)__a
, (vector
int)__b
, __c
);
8023 static __inline__ vector
bool short __ATTRS_o_ai
vec_perm(
8024 vector
bool short __a
, vector
bool short __b
, vector
unsigned char __c
) {
8025 #ifdef __LITTLE_ENDIAN__
8026 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8027 255, 255, 255, 255, 255, 255, 255, 255};
8028 __d
= vec_xor(__c
, __d
);
8029 return (vector
bool short)__builtin_altivec_vperm_4si((vector
int)__b
,
8030 (vector
int)__a
, __d
);
8032 return (vector
bool short)__builtin_altivec_vperm_4si((vector
int)__a
,
8033 (vector
int)__b
, __c
);
8037 static __inline__ vector pixel __ATTRS_o_ai
vec_perm(vector pixel __a
,
8039 vector
unsigned char __c
) {
8040 #ifdef __LITTLE_ENDIAN__
8041 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8042 255, 255, 255, 255, 255, 255, 255, 255};
8043 __d
= vec_xor(__c
, __d
);
8044 return (vector pixel
)__builtin_altivec_vperm_4si((vector
int)__b
,
8045 (vector
int)__a
, __d
);
8047 return (vector pixel
)__builtin_altivec_vperm_4si((vector
int)__a
,
8048 (vector
int)__b
, __c
);
8052 static __inline__ vector
int __ATTRS_o_ai
vec_perm(vector
signed int __a
,
8053 vector
signed int __b
,
8054 vector
unsigned char __c
) {
8055 #ifdef __LITTLE_ENDIAN__
8056 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8057 255, 255, 255, 255, 255, 255, 255, 255};
8058 __d
= vec_xor(__c
, __d
);
8059 return (vector
signed int)__builtin_altivec_vperm_4si(__b
, __a
, __d
);
8061 return (vector
signed int)__builtin_altivec_vperm_4si(__a
, __b
, __c
);
8065 static __inline__ vector
unsigned int __ATTRS_o_ai
8066 vec_perm(vector
unsigned int __a
, vector
unsigned int __b
,
8067 vector
unsigned char __c
) {
8068 #ifdef __LITTLE_ENDIAN__
8069 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8070 255, 255, 255, 255, 255, 255, 255, 255};
8071 __d
= vec_xor(__c
, __d
);
8072 return (vector
unsigned int)__builtin_altivec_vperm_4si((vector
int)__b
,
8073 (vector
int)__a
, __d
);
8075 return (vector
unsigned int)__builtin_altivec_vperm_4si((vector
int)__a
,
8076 (vector
int)__b
, __c
);
8080 static __inline__ vector
bool int __ATTRS_o_ai
8081 vec_perm(vector
bool int __a
, vector
bool int __b
, vector
unsigned char __c
) {
8082 #ifdef __LITTLE_ENDIAN__
8083 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8084 255, 255, 255, 255, 255, 255, 255, 255};
8085 __d
= vec_xor(__c
, __d
);
8086 return (vector
bool int)__builtin_altivec_vperm_4si((vector
int)__b
,
8087 (vector
int)__a
, __d
);
8089 return (vector
bool int)__builtin_altivec_vperm_4si((vector
int)__a
,
8090 (vector
int)__b
, __c
);
8094 static __inline__ vector
float __ATTRS_o_ai
vec_perm(vector
float __a
,
8096 vector
unsigned char __c
) {
8097 #ifdef __LITTLE_ENDIAN__
8098 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8099 255, 255, 255, 255, 255, 255, 255, 255};
8100 __d
= vec_xor(__c
, __d
);
8101 return (vector
float)__builtin_altivec_vperm_4si((vector
int)__b
,
8102 (vector
int)__a
, __d
);
8104 return (vector
float)__builtin_altivec_vperm_4si((vector
int)__a
,
8105 (vector
int)__b
, __c
);
8110 static __inline__ vector
long long __ATTRS_o_ai
8111 vec_perm(vector
signed long long __a
, vector
signed long long __b
,
8112 vector
unsigned char __c
) {
8113 #ifdef __LITTLE_ENDIAN__
8114 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8115 255, 255, 255, 255, 255, 255, 255, 255};
8116 __d
= vec_xor(__c
, __d
);
8117 return (vector
signed long long)__builtin_altivec_vperm_4si(
8118 (vector
int)__b
, (vector
int)__a
, __d
);
8120 return (vector
signed long long)__builtin_altivec_vperm_4si(
8121 (vector
int)__a
, (vector
int)__b
, __c
);
8125 static __inline__ vector
unsigned long long __ATTRS_o_ai
8126 vec_perm(vector
unsigned long long __a
, vector
unsigned long long __b
,
8127 vector
unsigned char __c
) {
8128 #ifdef __LITTLE_ENDIAN__
8129 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8130 255, 255, 255, 255, 255, 255, 255, 255};
8131 __d
= vec_xor(__c
, __d
);
8132 return (vector
unsigned long long)__builtin_altivec_vperm_4si(
8133 (vector
int)__b
, (vector
int)__a
, __d
);
8135 return (vector
unsigned long long)__builtin_altivec_vperm_4si(
8136 (vector
int)__a
, (vector
int)__b
, __c
);
8140 static __inline__ vector
bool long long __ATTRS_o_ai
8141 vec_perm(vector
bool long long __a
, vector
bool long long __b
,
8142 vector
unsigned char __c
) {
8143 #ifdef __LITTLE_ENDIAN__
8144 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8145 255, 255, 255, 255, 255, 255, 255, 255};
8146 __d
= vec_xor(__c
, __d
);
8147 return (vector
bool long long)__builtin_altivec_vperm_4si(
8148 (vector
int)__b
, (vector
int)__a
, __d
);
8150 return (vector
bool long long)__builtin_altivec_vperm_4si(
8151 (vector
int)__a
, (vector
int)__b
, __c
);
8155 static __inline__ vector
double __ATTRS_o_ai
8156 vec_perm(vector
double __a
, vector
double __b
, vector
unsigned char __c
) {
8157 #ifdef __LITTLE_ENDIAN__
8158 vector
unsigned char __d
= {255, 255, 255, 255, 255, 255, 255, 255,
8159 255, 255, 255, 255, 255, 255, 255, 255};
8160 __d
= vec_xor(__c
, __d
);
8161 return (vector
double)__builtin_altivec_vperm_4si((vector
int)__b
,
8162 (vector
int)__a
, __d
);
8164 return (vector
double)__builtin_altivec_vperm_4si((vector
int)__a
,
8165 (vector
int)__b
, __c
);
8172 static __inline__ vector
signed char __ATTRS_o_ai
vec_vperm(
8173 vector
signed char __a
, vector
signed char __b
, vector
unsigned char __c
) {
8174 return vec_perm(__a
, __b
, __c
);
8177 static __inline__ vector
unsigned char __ATTRS_o_ai
8178 vec_vperm(vector
unsigned char __a
, vector
unsigned char __b
,
8179 vector
unsigned char __c
) {
8180 return vec_perm(__a
, __b
, __c
);
8183 static __inline__ vector
bool char __ATTRS_o_ai
vec_vperm(
8184 vector
bool char __a
, vector
bool char __b
, vector
unsigned char __c
) {
8185 return vec_perm(__a
, __b
, __c
);
8188 static __inline__ vector
short __ATTRS_o_ai
8189 vec_vperm(vector
short __a
, vector
short __b
, vector
unsigned char __c
) {
8190 return vec_perm(__a
, __b
, __c
);
8193 static __inline__ vector
unsigned short __ATTRS_o_ai
8194 vec_vperm(vector
unsigned short __a
, vector
unsigned short __b
,
8195 vector
unsigned char __c
) {
8196 return vec_perm(__a
, __b
, __c
);
8199 static __inline__ vector
bool short __ATTRS_o_ai
vec_vperm(
8200 vector
bool short __a
, vector
bool short __b
, vector
unsigned char __c
) {
8201 return vec_perm(__a
, __b
, __c
);
8204 static __inline__ vector pixel __ATTRS_o_ai
8205 vec_vperm(vector pixel __a
, vector pixel __b
, vector
unsigned char __c
) {
8206 return vec_perm(__a
, __b
, __c
);
8209 static __inline__ vector
int __ATTRS_o_ai
vec_vperm(vector
int __a
,
8211 vector
unsigned char __c
) {
8212 return vec_perm(__a
, __b
, __c
);
8215 static __inline__ vector
unsigned int __ATTRS_o_ai
8216 vec_vperm(vector
unsigned int __a
, vector
unsigned int __b
,
8217 vector
unsigned char __c
) {
8218 return vec_perm(__a
, __b
, __c
);
8221 static __inline__ vector
bool int __ATTRS_o_ai
8222 vec_vperm(vector
bool int __a
, vector
bool int __b
, vector
unsigned char __c
) {
8223 return vec_perm(__a
, __b
, __c
);
8226 static __inline__ vector
float __ATTRS_o_ai
8227 vec_vperm(vector
float __a
, vector
float __b
, vector
unsigned char __c
) {
8228 return vec_perm(__a
, __b
, __c
);
8232 static __inline__ vector
long long __ATTRS_o_ai
vec_vperm(
8233 vector
long long __a
, vector
long long __b
, vector
unsigned char __c
) {
8234 return vec_perm(__a
, __b
, __c
);
8237 static __inline__ vector
unsigned long long __ATTRS_o_ai
8238 vec_vperm(vector
unsigned long long __a
, vector
unsigned long long __b
,
8239 vector
unsigned char __c
) {
8240 return vec_perm(__a
, __b
, __c
);
8243 static __inline__ vector
double __ATTRS_o_ai
8244 vec_vperm(vector
double __a
, vector
double __b
, vector
unsigned char __c
) {
8245 return vec_perm(__a
, __b
, __c
);
8251 static __inline__ vector
float __ATTRS_o_ai
vec_re(vector
float __a
) {
8253 return __builtin_vsx_xvresp(__a
);
8255 return __builtin_altivec_vrefp(__a
);
8260 static __inline__ vector
double __ATTRS_o_ai
vec_re(vector
double __a
) {
8261 return __builtin_vsx_xvredp(__a
);
8267 static __inline__ vector
float __attribute__((__always_inline__
))
8268 vec_vrefp(vector
float __a
) {
8269 return __builtin_altivec_vrefp(__a
);
8274 static __inline__ vector
signed char __ATTRS_o_ai
8275 vec_rl(vector
signed char __a
, vector
unsigned char __b
) {
8276 return (vector
signed char)__builtin_altivec_vrlb((vector
char)__a
, __b
);
8279 static __inline__ vector
unsigned char __ATTRS_o_ai
8280 vec_rl(vector
unsigned char __a
, vector
unsigned char __b
) {
8281 return (vector
unsigned char)__builtin_altivec_vrlb((vector
char)__a
, __b
);
8284 static __inline__ vector
short __ATTRS_o_ai
vec_rl(vector
short __a
,
8285 vector
unsigned short __b
) {
8286 return __builtin_altivec_vrlh(__a
, __b
);
8289 static __inline__ vector
unsigned short __ATTRS_o_ai
8290 vec_rl(vector
unsigned short __a
, vector
unsigned short __b
) {
8291 return (vector
unsigned short)__builtin_altivec_vrlh((vector
short)__a
, __b
);
8294 static __inline__ vector
int __ATTRS_o_ai
vec_rl(vector
int __a
,
8295 vector
unsigned int __b
) {
8296 return __builtin_altivec_vrlw(__a
, __b
);
8299 static __inline__ vector
unsigned int __ATTRS_o_ai
8300 vec_rl(vector
unsigned int __a
, vector
unsigned int __b
) {
8301 return (vector
unsigned int)__builtin_altivec_vrlw((vector
int)__a
, __b
);
8304 #ifdef __POWER8_VECTOR__
8305 static __inline__ vector
signed long long __ATTRS_o_ai
8306 vec_rl(vector
signed long long __a
, vector
unsigned long long __b
) {
8307 return __builtin_altivec_vrld(__a
, __b
);
8310 static __inline__ vector
unsigned long long __ATTRS_o_ai
8311 vec_rl(vector
unsigned long long __a
, vector
unsigned long long __b
) {
8312 return (vector
unsigned long long)__builtin_altivec_vrld(
8313 (vector
long long)__a
, __b
);
8317 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8318 static __inline__ vector
signed __int128 __ATTRS_o_ai
8319 vec_rl(vector
signed __int128 __a
, vector
unsigned __int128 __b
) {
8320 return (vector
signed __int128
)(((vector
unsigned __int128
)__b
8321 << (vector
unsigned __int128
)__a
) |
8322 ((vector
unsigned __int128
)__b
>>
8324 sizeof(vector
unsigned __int128
)) -
8325 (vector
unsigned __int128
)__a
)));
8328 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
8329 vec_rl(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
8330 return (__b
<< __a
)|(__b
>> ((__CHAR_BIT__
* sizeof(vector
unsigned __int128
)) - __a
));
8335 #ifdef __POWER9_VECTOR__
8336 static __inline__ vector
unsigned int __ATTRS_o_ai
8337 vec_rlmi(vector
unsigned int __a
, vector
unsigned int __b
,
8338 vector
unsigned int __c
) {
8339 return __builtin_altivec_vrlwmi(__a
, __c
, __b
);
8342 static __inline__ vector
unsigned long long __ATTRS_o_ai
8343 vec_rlmi(vector
unsigned long long __a
, vector
unsigned long long __b
,
8344 vector
unsigned long long __c
) {
8345 return __builtin_altivec_vrldmi(__a
, __c
, __b
);
8349 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8350 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
8351 vec_rlmi(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
8352 vector
unsigned __int128 __c
) {
8353 return __builtin_altivec_vrlqmi(__a
, __c
, __b
);
8356 static __inline__ vector
signed __int128 __ATTRS_o_ai
8357 vec_rlmi(vector
signed __int128 __a
, vector
signed __int128 __b
,
8358 vector
signed __int128 __c
) {
8359 return (vector
signed __int128
)__builtin_altivec_vrlqmi(
8360 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__c
,
8361 (vector
unsigned __int128
)__b
);
8366 #ifdef __POWER9_VECTOR__
8367 static __inline__ vector
unsigned int __ATTRS_o_ai
8368 vec_rlnm(vector
unsigned int __a
, vector
unsigned int __b
,
8369 vector
unsigned int __c
) {
8370 vector
unsigned int OneByte
= { 0x8, 0x8, 0x8, 0x8 };
8371 return __builtin_altivec_vrlwnm(__a
, ((__c
<< OneByte
) | __b
));
8374 static __inline__ vector
unsigned long long __ATTRS_o_ai
8375 vec_rlnm(vector
unsigned long long __a
, vector
unsigned long long __b
,
8376 vector
unsigned long long __c
) {
8377 vector
unsigned long long OneByte
= { 0x8, 0x8 };
8378 return __builtin_altivec_vrldnm(__a
, ((__c
<< OneByte
) | __b
));
8382 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8383 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
8384 vec_rlnm(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
8385 vector
unsigned __int128 __c
) {
8386 // Merge __b and __c using an appropriate shuffle.
8387 vector
unsigned char TmpB
= (vector
unsigned char)__b
;
8388 vector
unsigned char TmpC
= (vector
unsigned char)__c
;
8389 vector
unsigned char MaskAndShift
=
8390 #ifdef __LITTLE_ENDIAN__
8391 __builtin_shufflevector(TmpB
, TmpC
, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8392 1, -1, -1, -1, -1, -1);
8394 __builtin_shufflevector(TmpB
, TmpC
, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8395 -1, -1, -1, -1, -1, -1, -1);
8397 return __builtin_altivec_vrlqnm(__a
, (vector
unsigned __int128
) MaskAndShift
);
8400 static __inline__ vector
signed __int128 __ATTRS_o_ai
8401 vec_rlnm(vector
signed __int128 __a
, vector
signed __int128 __b
,
8402 vector
signed __int128 __c
) {
8403 // Merge __b and __c using an appropriate shuffle.
8404 vector
unsigned char TmpB
= (vector
unsigned char)__b
;
8405 vector
unsigned char TmpC
= (vector
unsigned char)__c
;
8406 vector
unsigned char MaskAndShift
=
8407 #ifdef __LITTLE_ENDIAN__
8408 __builtin_shufflevector(TmpB
, TmpC
, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8409 1, -1, -1, -1, -1, -1);
8411 __builtin_shufflevector(TmpB
, TmpC
, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8412 -1, -1, -1, -1, -1, -1, -1);
8414 return (vector
signed __int128
)__builtin_altivec_vrlqnm(
8415 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)MaskAndShift
);
8421 static __inline__ vector
signed char __ATTRS_o_ai
8422 vec_vrlb(vector
signed char __a
, vector
unsigned char __b
) {
8423 return (vector
signed char)__builtin_altivec_vrlb((vector
char)__a
, __b
);
8426 static __inline__ vector
unsigned char __ATTRS_o_ai
8427 vec_vrlb(vector
unsigned char __a
, vector
unsigned char __b
) {
8428 return (vector
unsigned char)__builtin_altivec_vrlb((vector
char)__a
, __b
);
8433 static __inline__ vector
short __ATTRS_o_ai
8434 vec_vrlh(vector
short __a
, vector
unsigned short __b
) {
8435 return __builtin_altivec_vrlh(__a
, __b
);
8438 static __inline__ vector
unsigned short __ATTRS_o_ai
8439 vec_vrlh(vector
unsigned short __a
, vector
unsigned short __b
) {
8440 return (vector
unsigned short)__builtin_altivec_vrlh((vector
short)__a
, __b
);
8445 static __inline__ vector
int __ATTRS_o_ai
vec_vrlw(vector
int __a
,
8446 vector
unsigned int __b
) {
8447 return __builtin_altivec_vrlw(__a
, __b
);
8450 static __inline__ vector
unsigned int __ATTRS_o_ai
8451 vec_vrlw(vector
unsigned int __a
, vector
unsigned int __b
) {
8452 return (vector
unsigned int)__builtin_altivec_vrlw((vector
int)__a
, __b
);
8457 static __inline__ vector
float __ATTRS_o_ai
vec_round(vector
float __a
) {
8458 return __builtin_altivec_vrfin(__a
);
8462 #ifdef __XL_COMPAT_ALTIVEC__
8463 static __inline__ vector
double __ATTRS_o_ai
vec_rint(vector
double __a
);
8464 static __inline__ vector
double __ATTRS_o_ai
vec_round(vector
double __a
) {
8465 double __fpscr
= __builtin_readflm();
8466 __builtin_setrnd(0);
8467 vector
double __rounded
= vec_rint(__a
);
8468 __builtin_setflm(__fpscr
);
8472 static __inline__ vector
double __ATTRS_o_ai
vec_round(vector
double __a
) {
8473 return __builtin_vsx_xvrdpi(__a
);
8479 static __inline__ vector
float __ATTRS_o_ai
vec_rint(vector
float __a
) {
8480 return __builtin_vsx_xvrspic(__a
);
8483 static __inline__ vector
double __ATTRS_o_ai
vec_rint(vector
double __a
) {
8484 return __builtin_vsx_xvrdpic(__a
);
8489 static __inline__ vector
float __ATTRS_o_ai
vec_roundc(vector
float __a
) {
8490 return __builtin_vsx_xvrspic(__a
);
8493 static __inline__ vector
double __ATTRS_o_ai
vec_roundc(vector
double __a
) {
8494 return __builtin_vsx_xvrdpic(__a
);
8499 static __inline__ vector
float __ATTRS_o_ai
vec_nearbyint(vector
float __a
) {
8500 return __builtin_vsx_xvrspi(__a
);
8503 static __inline__ vector
double __ATTRS_o_ai
vec_nearbyint(vector
double __a
) {
8504 return __builtin_vsx_xvrdpi(__a
);
8510 static __inline__ vector
float __attribute__((__always_inline__
))
8511 vec_vrfin(vector
float __a
) {
8512 return __builtin_altivec_vrfin(__a
);
8518 static __inline__ vector
float __ATTRS_o_ai
vec_sqrt(vector
float __a
) {
8519 return __builtin_vsx_xvsqrtsp(__a
);
8522 static __inline__ vector
double __ATTRS_o_ai
vec_sqrt(vector
double __a
) {
8523 return __builtin_vsx_xvsqrtdp(__a
);
8529 static __inline__ vector
float __ATTRS_o_ai
vec_rsqrte(vector
float __a
) {
8531 return __builtin_vsx_xvrsqrtesp(__a
);
8533 return __builtin_altivec_vrsqrtefp(__a
);
8538 static __inline__ vector
double __ATTRS_o_ai
vec_rsqrte(vector
double __a
) {
8539 return __builtin_vsx_xvrsqrtedp(__a
);
8543 static vector
float __ATTRS_o_ai
vec_rsqrt(vector
float __a
) {
8544 return __builtin_ppc_rsqrtf(__a
);
8548 static vector
double __ATTRS_o_ai
vec_rsqrt(vector
double __a
) {
8549 return __builtin_ppc_rsqrtd(__a
);
8555 static __inline__ __vector
float __attribute__((__always_inline__
))
8556 vec_vrsqrtefp(vector
float __a
) {
8557 return __builtin_altivec_vrsqrtefp(__a
);
8563 static __inline__
int __ATTRS_o_ai
vec_test_swsqrt(vector
double __a
) {
8564 return __builtin_vsx_xvtsqrtdp(__a
);
8567 static __inline__
int __ATTRS_o_ai
vec_test_swsqrts(vector
float __a
) {
8568 return __builtin_vsx_xvtsqrtsp(__a
);
8574 #define __builtin_altivec_vsel_4si vec_sel
8576 static __inline__ vector
signed char __ATTRS_o_ai
vec_sel(
8577 vector
signed char __a
, vector
signed char __b
, vector
unsigned char __c
) {
8578 return (__a
& ~(vector
signed char)__c
) | (__b
& (vector
signed char)__c
);
8581 static __inline__ vector
signed char __ATTRS_o_ai
8582 vec_sel(vector
signed char __a
, vector
signed char __b
, vector
bool char __c
) {
8583 return (__a
& ~(vector
signed char)__c
) | (__b
& (vector
signed char)__c
);
8586 static __inline__ vector
unsigned char __ATTRS_o_ai
8587 vec_sel(vector
unsigned char __a
, vector
unsigned char __b
,
8588 vector
unsigned char __c
) {
8589 return (__a
& ~__c
) | (__b
& __c
);
8592 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_sel(
8593 vector
unsigned char __a
, vector
unsigned char __b
, vector
bool char __c
) {
8594 return (__a
& ~(vector
unsigned char)__c
) | (__b
& (vector
unsigned char)__c
);
8597 static __inline__ vector
bool char __ATTRS_o_ai
8598 vec_sel(vector
bool char __a
, vector
bool char __b
, vector
unsigned char __c
) {
8599 return (__a
& ~(vector
bool char)__c
) | (__b
& (vector
bool char)__c
);
8602 static __inline__ vector
bool char __ATTRS_o_ai
vec_sel(vector
bool char __a
,
8603 vector
bool char __b
,
8604 vector
bool char __c
) {
8605 return (__a
& ~__c
) | (__b
& __c
);
8608 static __inline__ vector
short __ATTRS_o_ai
vec_sel(vector
short __a
,
8610 vector
unsigned short __c
) {
8611 return (__a
& ~(vector
short)__c
) | (__b
& (vector
short)__c
);
8614 static __inline__ vector
short __ATTRS_o_ai
vec_sel(vector
short __a
,
8616 vector
bool short __c
) {
8617 return (__a
& ~(vector
short)__c
) | (__b
& (vector
short)__c
);
8620 static __inline__ vector
unsigned short __ATTRS_o_ai
8621 vec_sel(vector
unsigned short __a
, vector
unsigned short __b
,
8622 vector
unsigned short __c
) {
8623 return (__a
& ~__c
) | (__b
& __c
);
8626 static __inline__ vector
unsigned short __ATTRS_o_ai
8627 vec_sel(vector
unsigned short __a
, vector
unsigned short __b
,
8628 vector
bool short __c
) {
8629 return (__a
& ~(vector
unsigned short)__c
) |
8630 (__b
& (vector
unsigned short)__c
);
8633 static __inline__ vector
bool short __ATTRS_o_ai
vec_sel(
8634 vector
bool short __a
, vector
bool short __b
, vector
unsigned short __c
) {
8635 return (__a
& ~(vector
bool short)__c
) | (__b
& (vector
bool short)__c
);
8638 static __inline__ vector
bool short __ATTRS_o_ai
8639 vec_sel(vector
bool short __a
, vector
bool short __b
, vector
bool short __c
) {
8640 return (__a
& ~__c
) | (__b
& __c
);
8643 static __inline__ vector
int __ATTRS_o_ai
vec_sel(vector
int __a
,
8645 vector
unsigned int __c
) {
8646 return (__a
& ~(vector
int)__c
) | (__b
& (vector
int)__c
);
8649 static __inline__ vector
int __ATTRS_o_ai
vec_sel(vector
int __a
,
8651 vector
bool int __c
) {
8652 return (__a
& ~(vector
int)__c
) | (__b
& (vector
int)__c
);
8655 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_sel(
8656 vector
unsigned int __a
, vector
unsigned int __b
, vector
unsigned int __c
) {
8657 return (__a
& ~__c
) | (__b
& __c
);
8660 static __inline__ vector
unsigned int __ATTRS_o_ai
8661 vec_sel(vector
unsigned int __a
, vector
unsigned int __b
, vector
bool int __c
) {
8662 return (__a
& ~(vector
unsigned int)__c
) | (__b
& (vector
unsigned int)__c
);
8665 static __inline__ vector
bool int __ATTRS_o_ai
8666 vec_sel(vector
bool int __a
, vector
bool int __b
, vector
unsigned int __c
) {
8667 return (__a
& ~(vector
bool int)__c
) | (__b
& (vector
bool int)__c
);
8670 static __inline__ vector
bool int __ATTRS_o_ai
vec_sel(vector
bool int __a
,
8671 vector
bool int __b
,
8672 vector
bool int __c
) {
8673 return (__a
& ~__c
) | (__b
& __c
);
8676 static __inline__ vector
float __ATTRS_o_ai
vec_sel(vector
float __a
,
8678 vector
unsigned int __c
) {
8679 vector
int __res
= ((vector
int)__a
& ~(vector
int)__c
) |
8680 ((vector
int)__b
& (vector
int)__c
);
8681 return (vector
float)__res
;
8684 static __inline__ vector
float __ATTRS_o_ai
vec_sel(vector
float __a
,
8686 vector
bool int __c
) {
8687 vector
int __res
= ((vector
int)__a
& ~(vector
int)__c
) |
8688 ((vector
int)__b
& (vector
int)__c
);
8689 return (vector
float)__res
;
8693 static __inline__ vector
double __ATTRS_o_ai
8694 vec_sel(vector
double __a
, vector
double __b
, vector
bool long long __c
) {
8695 vector
long long __res
= ((vector
long long)__a
& ~(vector
long long)__c
) |
8696 ((vector
long long)__b
& (vector
long long)__c
);
8697 return (vector
double)__res
;
8700 static __inline__ vector
double __ATTRS_o_ai
8701 vec_sel(vector
double __a
, vector
double __b
, vector
unsigned long long __c
) {
8702 vector
long long __res
= ((vector
long long)__a
& ~(vector
long long)__c
) |
8703 ((vector
long long)__b
& (vector
long long)__c
);
8704 return (vector
double)__res
;
8707 static __inline__ vector
bool long long __ATTRS_o_ai
8708 vec_sel(vector
bool long long __a
, vector
bool long long __b
,
8709 vector
bool long long __c
) {
8710 return (__a
& ~__c
) | (__b
& __c
);
8713 static __inline__ vector
bool long long __ATTRS_o_ai
8714 vec_sel(vector
bool long long __a
, vector
bool long long __b
,
8715 vector
unsigned long long __c
) {
8716 return (__a
& ~(vector
bool long long)__c
) |
8717 (__b
& (vector
bool long long)__c
);
8720 static __inline__ vector
signed long long __ATTRS_o_ai
8721 vec_sel(vector
signed long long __a
, vector
signed long long __b
,
8722 vector
bool long long __c
) {
8723 return (__a
& ~(vector
signed long long)__c
) |
8724 (__b
& (vector
signed long long)__c
);
8727 static __inline__ vector
signed long long __ATTRS_o_ai
8728 vec_sel(vector
signed long long __a
, vector
signed long long __b
,
8729 vector
unsigned long long __c
) {
8730 return (__a
& ~(vector
signed long long)__c
) |
8731 (__b
& (vector
signed long long)__c
);
8734 static __inline__ vector
unsigned long long __ATTRS_o_ai
8735 vec_sel(vector
unsigned long long __a
, vector
unsigned long long __b
,
8736 vector
bool long long __c
) {
8737 return (__a
& ~(vector
unsigned long long)__c
) |
8738 (__b
& (vector
unsigned long long)__c
);
8741 static __inline__ vector
unsigned long long __ATTRS_o_ai
8742 vec_sel(vector
unsigned long long __a
, vector
unsigned long long __b
,
8743 vector
unsigned long long __c
) {
8744 return (__a
& ~__c
) | (__b
& __c
);
8750 static __inline__ vector
signed char __ATTRS_o_ai
vec_vsel(
8751 vector
signed char __a
, vector
signed char __b
, vector
unsigned char __c
) {
8752 return (__a
& ~(vector
signed char)__c
) | (__b
& (vector
signed char)__c
);
8755 static __inline__ vector
signed char __ATTRS_o_ai
8756 vec_vsel(vector
signed char __a
, vector
signed char __b
, vector
bool char __c
) {
8757 return (__a
& ~(vector
signed char)__c
) | (__b
& (vector
signed char)__c
);
8760 static __inline__ vector
unsigned char __ATTRS_o_ai
8761 vec_vsel(vector
unsigned char __a
, vector
unsigned char __b
,
8762 vector
unsigned char __c
) {
8763 return (__a
& ~__c
) | (__b
& __c
);
8766 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_vsel(
8767 vector
unsigned char __a
, vector
unsigned char __b
, vector
bool char __c
) {
8768 return (__a
& ~(vector
unsigned char)__c
) | (__b
& (vector
unsigned char)__c
);
8771 static __inline__ vector
bool char __ATTRS_o_ai
8772 vec_vsel(vector
bool char __a
, vector
bool char __b
, vector
unsigned char __c
) {
8773 return (__a
& ~(vector
bool char)__c
) | (__b
& (vector
bool char)__c
);
8776 static __inline__ vector
bool char __ATTRS_o_ai
vec_vsel(vector
bool char __a
,
8777 vector
bool char __b
,
8778 vector
bool char __c
) {
8779 return (__a
& ~__c
) | (__b
& __c
);
8782 static __inline__ vector
short __ATTRS_o_ai
8783 vec_vsel(vector
short __a
, vector
short __b
, vector
unsigned short __c
) {
8784 return (__a
& ~(vector
short)__c
) | (__b
& (vector
short)__c
);
8787 static __inline__ vector
short __ATTRS_o_ai
vec_vsel(vector
short __a
,
8789 vector
bool short __c
) {
8790 return (__a
& ~(vector
short)__c
) | (__b
& (vector
short)__c
);
8793 static __inline__ vector
unsigned short __ATTRS_o_ai
8794 vec_vsel(vector
unsigned short __a
, vector
unsigned short __b
,
8795 vector
unsigned short __c
) {
8796 return (__a
& ~__c
) | (__b
& __c
);
8799 static __inline__ vector
unsigned short __ATTRS_o_ai
8800 vec_vsel(vector
unsigned short __a
, vector
unsigned short __b
,
8801 vector
bool short __c
) {
8802 return (__a
& ~(vector
unsigned short)__c
) |
8803 (__b
& (vector
unsigned short)__c
);
8806 static __inline__ vector
bool short __ATTRS_o_ai
vec_vsel(
8807 vector
bool short __a
, vector
bool short __b
, vector
unsigned short __c
) {
8808 return (__a
& ~(vector
bool short)__c
) | (__b
& (vector
bool short)__c
);
8811 static __inline__ vector
bool short __ATTRS_o_ai
8812 vec_vsel(vector
bool short __a
, vector
bool short __b
, vector
bool short __c
) {
8813 return (__a
& ~__c
) | (__b
& __c
);
8816 static __inline__ vector
int __ATTRS_o_ai
vec_vsel(vector
int __a
,
8818 vector
unsigned int __c
) {
8819 return (__a
& ~(vector
int)__c
) | (__b
& (vector
int)__c
);
8822 static __inline__ vector
int __ATTRS_o_ai
vec_vsel(vector
int __a
,
8824 vector
bool int __c
) {
8825 return (__a
& ~(vector
int)__c
) | (__b
& (vector
int)__c
);
8828 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_vsel(
8829 vector
unsigned int __a
, vector
unsigned int __b
, vector
unsigned int __c
) {
8830 return (__a
& ~__c
) | (__b
& __c
);
8833 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_vsel(
8834 vector
unsigned int __a
, vector
unsigned int __b
, vector
bool int __c
) {
8835 return (__a
& ~(vector
unsigned int)__c
) | (__b
& (vector
unsigned int)__c
);
8838 static __inline__ vector
bool int __ATTRS_o_ai
8839 vec_vsel(vector
bool int __a
, vector
bool int __b
, vector
unsigned int __c
) {
8840 return (__a
& ~(vector
bool int)__c
) | (__b
& (vector
bool int)__c
);
8843 static __inline__ vector
bool int __ATTRS_o_ai
vec_vsel(vector
bool int __a
,
8844 vector
bool int __b
,
8845 vector
bool int __c
) {
8846 return (__a
& ~__c
) | (__b
& __c
);
8849 static __inline__ vector
float __ATTRS_o_ai
vec_vsel(vector
float __a
,
8851 vector
unsigned int __c
) {
8852 vector
int __res
= ((vector
int)__a
& ~(vector
int)__c
) |
8853 ((vector
int)__b
& (vector
int)__c
);
8854 return (vector
float)__res
;
8857 static __inline__ vector
float __ATTRS_o_ai
vec_vsel(vector
float __a
,
8859 vector
bool int __c
) {
8860 vector
int __res
= ((vector
int)__a
& ~(vector
int)__c
) |
8861 ((vector
int)__b
& (vector
int)__c
);
8862 return (vector
float)__res
;
8867 // vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8868 // than the length of __a.
8869 static __inline__ vector
unsigned char __ATTRS_o_ai
8870 vec_sl(vector
unsigned char __a
, vector
unsigned char __b
) {
8871 return __a
<< (__b
%
8872 (vector
unsigned char)(sizeof(unsigned char) * __CHAR_BIT__
));
8875 static __inline__ vector
signed char __ATTRS_o_ai
8876 vec_sl(vector
signed char __a
, vector
unsigned char __b
) {
8877 return (vector
signed char)vec_sl((vector
unsigned char)__a
, __b
);
8880 static __inline__ vector
unsigned short __ATTRS_o_ai
8881 vec_sl(vector
unsigned short __a
, vector
unsigned short __b
) {
8882 return __a
<< (__b
% (vector
unsigned short)(sizeof(unsigned short) *
8886 static __inline__ vector
short __ATTRS_o_ai
vec_sl(vector
short __a
,
8887 vector
unsigned short __b
) {
8888 return (vector
short)vec_sl((vector
unsigned short)__a
, __b
);
8891 static __inline__ vector
unsigned int __ATTRS_o_ai
8892 vec_sl(vector
unsigned int __a
, vector
unsigned int __b
) {
8893 return __a
<< (__b
%
8894 (vector
unsigned int)(sizeof(unsigned int) * __CHAR_BIT__
));
8897 static __inline__ vector
int __ATTRS_o_ai
vec_sl(vector
int __a
,
8898 vector
unsigned int __b
) {
8899 return (vector
int)vec_sl((vector
unsigned int)__a
, __b
);
8902 #ifdef __POWER8_VECTOR__
8903 static __inline__ vector
unsigned long long __ATTRS_o_ai
8904 vec_sl(vector
unsigned long long __a
, vector
unsigned long long __b
) {
8905 return __a
<< (__b
% (vector
unsigned long long)(sizeof(unsigned long long) *
8909 static __inline__ vector
long long __ATTRS_o_ai
8910 vec_sl(vector
long long __a
, vector
unsigned long long __b
) {
8911 return (vector
long long)vec_sl((vector
unsigned long long)__a
, __b
);
8913 #elif defined(__VSX__)
8914 static __inline__ vector
unsigned char __ATTRS_o_ai
8915 vec_vspltb(vector
unsigned char __a
, unsigned char __b
);
8916 static __inline__ vector
unsigned long long __ATTRS_o_ai
8917 vec_sl(vector
unsigned long long __a
, vector
unsigned long long __b
) {
8918 __b
%= (vector
unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__
);
8920 // Big endian element one (the right doubleword) can be left shifted as-is.
8921 // The other element needs to be swapped into the right doubleword and
8922 // shifted. Then the right doublewords of the two result vectors are merged.
8923 vector
signed long long __rightelt
=
8924 (vector
signed long long)__builtin_altivec_vslo((vector
signed int)__a
,
8925 (vector
signed int)__b
);
8926 #ifdef __LITTLE_ENDIAN__
8927 __rightelt
= (vector
signed long long)__builtin_altivec_vsl(
8928 (vector
signed int)__rightelt
,
8929 (vector
signed int)vec_vspltb((vector
unsigned char)__b
, 0));
8931 __rightelt
= (vector
signed long long)__builtin_altivec_vsl(
8932 (vector
signed int)__rightelt
,
8933 (vector
signed int)vec_vspltb((vector
unsigned char)__b
, 15));
8935 __a
= __builtin_shufflevector(__a
, __a
, 1, 0);
8936 __b
= __builtin_shufflevector(__b
, __b
, 1, 0);
8937 vector
signed long long __leftelt
=
8938 (vector
signed long long)__builtin_altivec_vslo((vector
signed int)__a
,
8939 (vector
signed int)__b
);
8940 #ifdef __LITTLE_ENDIAN__
8941 __leftelt
= (vector
signed long long)__builtin_altivec_vsl(
8942 (vector
signed int)__leftelt
,
8943 (vector
signed int)vec_vspltb((vector
unsigned char)__b
, 0));
8944 return (vector
unsigned long long)__builtin_shufflevector(__rightelt
,
8947 __leftelt
= (vector
signed long long)__builtin_altivec_vsl(
8948 (vector
signed int)__leftelt
,
8949 (vector
signed int)vec_vspltb((vector
unsigned char)__b
, 15));
8950 return (vector
unsigned long long)__builtin_shufflevector(__leftelt
,
8955 static __inline__ vector
long long __ATTRS_o_ai
8956 vec_sl(vector
long long __a
, vector
unsigned long long __b
) {
8957 return (vector
long long)vec_sl((vector
unsigned long long)__a
, __b
);
8959 #endif /* __VSX__ */
8963 #define __builtin_altivec_vslb vec_vslb
8965 static __inline__ vector
signed char __ATTRS_o_ai
8966 vec_vslb(vector
signed char __a
, vector
unsigned char __b
) {
8967 return vec_sl(__a
, __b
);
8970 static __inline__ vector
unsigned char __ATTRS_o_ai
8971 vec_vslb(vector
unsigned char __a
, vector
unsigned char __b
) {
8972 return vec_sl(__a
, __b
);
8977 #define __builtin_altivec_vslh vec_vslh
8979 static __inline__ vector
short __ATTRS_o_ai
8980 vec_vslh(vector
short __a
, vector
unsigned short __b
) {
8981 return vec_sl(__a
, __b
);
8984 static __inline__ vector
unsigned short __ATTRS_o_ai
8985 vec_vslh(vector
unsigned short __a
, vector
unsigned short __b
) {
8986 return vec_sl(__a
, __b
);
8991 #define __builtin_altivec_vslw vec_vslw
8993 static __inline__ vector
int __ATTRS_o_ai
vec_vslw(vector
int __a
,
8994 vector
unsigned int __b
) {
8995 return vec_sl(__a
, __b
);
8998 static __inline__ vector
unsigned int __ATTRS_o_ai
8999 vec_vslw(vector
unsigned int __a
, vector
unsigned int __b
) {
9000 return vec_sl(__a
, __b
);
9005 #define __builtin_altivec_vsldoi_4si vec_sld
9007 static __inline__ vector
signed char __ATTRS_o_ai
vec_sld(
9008 vector
signed char __a
, vector
signed char __b
, unsigned const int __c
) {
9009 unsigned char __d
= __c
& 0x0F;
9010 #ifdef __LITTLE_ENDIAN__
9012 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9013 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9014 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9015 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9019 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9020 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9021 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9025 static __inline__ vector
unsigned char __ATTRS_o_ai
9026 vec_sld(vector
unsigned char __a
, vector
unsigned char __b
,
9027 unsigned const int __c
) {
9028 unsigned char __d
= __c
& 0x0F;
9029 #ifdef __LITTLE_ENDIAN__
9031 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9032 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9033 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9034 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9038 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9039 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9040 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9044 static __inline__ vector
bool char __ATTRS_o_ai
9045 vec_sld(vector
bool char __a
, vector
bool char __b
, unsigned const int __c
) {
9046 unsigned char __d
= __c
& 0x0F;
9047 #ifdef __LITTLE_ENDIAN__
9049 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9050 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9051 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9052 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9056 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9057 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9058 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9062 static __inline__ vector
signed short __ATTRS_o_ai
vec_sld(
9063 vector
signed short __a
, vector
signed short __b
, unsigned const int __c
) {
9064 unsigned char __d
= __c
& 0x0F;
9065 #ifdef __LITTLE_ENDIAN__
9067 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9068 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9069 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9070 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9074 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9075 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9076 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9080 static __inline__ vector
unsigned short __ATTRS_o_ai
9081 vec_sld(vector
unsigned short __a
, vector
unsigned short __b
,
9082 unsigned const int __c
) {
9083 unsigned char __d
= __c
& 0x0F;
9084 #ifdef __LITTLE_ENDIAN__
9086 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9087 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9088 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9089 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9093 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9094 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9095 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9099 static __inline__ vector
bool short __ATTRS_o_ai
9100 vec_sld(vector
bool short __a
, vector
bool short __b
, unsigned const int __c
) {
9101 unsigned char __d
= __c
& 0x0F;
9102 #ifdef __LITTLE_ENDIAN__
9104 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9105 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9106 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9107 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9111 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9112 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9113 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9117 static __inline__ vector pixel __ATTRS_o_ai
vec_sld(vector pixel __a
,
9119 unsigned const int __c
) {
9120 unsigned char __d
= __c
& 0x0F;
9121 #ifdef __LITTLE_ENDIAN__
9123 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9124 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9125 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9126 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9130 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9131 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9132 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9136 static __inline__ vector
signed int __ATTRS_o_ai
9137 vec_sld(vector
signed int __a
, vector
signed int __b
, unsigned const int __c
) {
9138 unsigned char __d
= __c
& 0x0F;
9139 #ifdef __LITTLE_ENDIAN__
9141 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9142 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9143 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9144 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9148 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9149 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9150 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9154 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_sld(
9155 vector
unsigned int __a
, vector
unsigned int __b
, unsigned const int __c
) {
9156 unsigned char __d
= __c
& 0x0F;
9157 #ifdef __LITTLE_ENDIAN__
9159 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9160 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9161 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9162 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9166 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9167 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9168 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9172 static __inline__ vector
bool int __ATTRS_o_ai
vec_sld(vector
bool int __a
,
9173 vector
bool int __b
,
9174 unsigned const int __c
) {
9175 unsigned char __d
= __c
& 0x0F;
9176 #ifdef __LITTLE_ENDIAN__
9178 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9179 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9180 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9181 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9185 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9186 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9187 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9191 static __inline__ vector
float __ATTRS_o_ai
vec_sld(vector
float __a
,
9193 unsigned const int __c
) {
9194 unsigned char __d
= __c
& 0x0F;
9195 #ifdef __LITTLE_ENDIAN__
9197 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9198 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9199 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9200 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9204 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9205 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9206 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9211 static __inline__ vector
bool long long __ATTRS_o_ai
9212 vec_sld(vector
bool long long __a
, vector
bool long long __b
,
9213 unsigned const int __c
) {
9214 unsigned char __d
= __c
& 0x0F;
9215 #ifdef __LITTLE_ENDIAN__
9217 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9218 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9219 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9220 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9224 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9225 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9226 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9230 static __inline__ vector
signed long long __ATTRS_o_ai
9231 vec_sld(vector
signed long long __a
, vector
signed long long __b
,
9232 unsigned const int __c
) {
9233 unsigned char __d
= __c
& 0x0F;
9234 #ifdef __LITTLE_ENDIAN__
9236 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9237 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9238 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9239 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9243 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9244 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9245 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9249 static __inline__ vector
unsigned long long __ATTRS_o_ai
9250 vec_sld(vector
unsigned long long __a
, vector
unsigned long long __b
,
9251 unsigned const int __c
) {
9252 unsigned char __d
= __c
& 0x0F;
9253 #ifdef __LITTLE_ENDIAN__
9255 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9256 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9257 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9258 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9262 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9263 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9264 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9268 static __inline__ vector
double __ATTRS_o_ai
vec_sld(vector
double __a
,
9270 unsigned const int __c
) {
9271 unsigned char __d
= __c
& 0x0F;
9272 #ifdef __LITTLE_ENDIAN__
9274 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9275 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9276 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9277 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9281 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9282 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9283 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9289 static __inline__ vector
signed char __ATTRS_o_ai
vec_sldw(
9290 vector
signed char __a
, vector
signed char __b
, unsigned const int __c
) {
9291 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9294 static __inline__ vector
unsigned char __ATTRS_o_ai
9295 vec_sldw(vector
unsigned char __a
, vector
unsigned char __b
,
9296 unsigned const int __c
) {
9297 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9300 static __inline__ vector
signed short __ATTRS_o_ai
vec_sldw(
9301 vector
signed short __a
, vector
signed short __b
, unsigned const int __c
) {
9302 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9305 static __inline__ vector
unsigned short __ATTRS_o_ai
9306 vec_sldw(vector
unsigned short __a
, vector
unsigned short __b
,
9307 unsigned const int __c
) {
9308 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9311 static __inline__ vector
signed int __ATTRS_o_ai
9312 vec_sldw(vector
signed int __a
, vector
signed int __b
, unsigned const int __c
) {
9313 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9316 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_sldw(
9317 vector
unsigned int __a
, vector
unsigned int __b
, unsigned const int __c
) {
9318 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9321 static __inline__ vector
float __ATTRS_o_ai
vec_sldw(
9322 vector
float __a
, vector
float __b
, unsigned const int __c
) {
9323 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9327 static __inline__ vector
signed long long __ATTRS_o_ai
9328 vec_sldw(vector
signed long long __a
, vector
signed long long __b
,
9329 unsigned const int __c
) {
9330 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9333 static __inline__ vector
unsigned long long __ATTRS_o_ai
9334 vec_sldw(vector
unsigned long long __a
, vector
unsigned long long __b
,
9335 unsigned const int __c
) {
9336 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9339 static __inline__ vector
double __ATTRS_o_ai
vec_sldw(
9340 vector
double __a
, vector
double __b
, unsigned const int __c
) {
9341 return vec_sld(__a
, __b
, ((__c
<< 2) & 0x0F));
9345 #ifdef __POWER9_VECTOR__
9347 static __inline__ vector
unsigned char __ATTRS_o_ai
9348 vec_slv(vector
unsigned char __a
, vector
unsigned char __b
) {
9349 return __builtin_altivec_vslv(__a
, __b
);
9353 static __inline__ vector
unsigned char __ATTRS_o_ai
9354 vec_srv(vector
unsigned char __a
, vector
unsigned char __b
) {
9355 return __builtin_altivec_vsrv(__a
, __b
);
9361 static __inline__ vector
signed char __ATTRS_o_ai
9362 vec_vsldoi(vector
signed char __a
, vector
signed char __b
, unsigned char __c
) {
9363 unsigned char __d
= __c
& 0x0F;
9364 #ifdef __LITTLE_ENDIAN__
9366 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9367 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9368 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9369 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9373 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9374 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9375 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9379 static __inline__ vector
unsigned char __ATTRS_o_ai
vec_vsldoi(
9380 vector
unsigned char __a
, vector
unsigned char __b
, unsigned char __c
) {
9381 unsigned char __d
= __c
& 0x0F;
9382 #ifdef __LITTLE_ENDIAN__
9384 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9385 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9386 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9387 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9391 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9392 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9393 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9397 static __inline__ vector
short __ATTRS_o_ai
vec_vsldoi(vector
short __a
,
9399 unsigned char __c
) {
9400 unsigned char __d
= __c
& 0x0F;
9401 #ifdef __LITTLE_ENDIAN__
9403 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9404 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9405 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9406 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9410 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9411 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9412 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9416 static __inline__ vector
unsigned short __ATTRS_o_ai
vec_vsldoi(
9417 vector
unsigned short __a
, vector
unsigned short __b
, unsigned char __c
) {
9418 unsigned char __d
= __c
& 0x0F;
9419 #ifdef __LITTLE_ENDIAN__
9421 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9422 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9423 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9424 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9428 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9429 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9430 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9434 static __inline__ vector pixel __ATTRS_o_ai
vec_vsldoi(vector pixel __a
,
9436 unsigned char __c
) {
9437 unsigned char __d
= __c
& 0x0F;
9438 #ifdef __LITTLE_ENDIAN__
9440 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9441 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9442 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9443 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9447 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9448 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9449 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9453 static __inline__ vector
int __ATTRS_o_ai
vec_vsldoi(vector
int __a
,
9455 unsigned char __c
) {
9456 unsigned char __d
= __c
& 0x0F;
9457 #ifdef __LITTLE_ENDIAN__
9459 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9460 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9461 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9462 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9466 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9467 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9468 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9472 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_vsldoi(
9473 vector
unsigned int __a
, vector
unsigned int __b
, unsigned char __c
) {
9474 unsigned char __d
= __c
& 0x0F;
9475 #ifdef __LITTLE_ENDIAN__
9477 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9478 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9479 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9480 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9484 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9485 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9486 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9490 static __inline__ vector
float __ATTRS_o_ai
vec_vsldoi(vector
float __a
,
9492 unsigned char __c
) {
9493 unsigned char __d
= __c
& 0x0F;
9494 #ifdef __LITTLE_ENDIAN__
9496 __b
, __a
, (vector
unsigned char)(16 - __d
, 17 - __d
, 18 - __d
, 19 - __d
,
9497 20 - __d
, 21 - __d
, 22 - __d
, 23 - __d
,
9498 24 - __d
, 25 - __d
, 26 - __d
, 27 - __d
,
9499 28 - __d
, 29 - __d
, 30 - __d
, 31 - __d
));
9503 (vector
unsigned char)(__d
, __d
+ 1, __d
+ 2, __d
+ 3, __d
+ 4, __d
+ 5,
9504 __d
+ 6, __d
+ 7, __d
+ 8, __d
+ 9, __d
+ 10,
9505 __d
+ 11, __d
+ 12, __d
+ 13, __d
+ 14, __d
+ 15));
9511 static __inline__ vector
signed char __ATTRS_o_ai
9512 vec_sll(vector
signed char __a
, vector
unsigned char __b
) {
9513 return (vector
signed char)__builtin_altivec_vsl((vector
int)__a
,
9517 static __inline__ vector
signed char __ATTRS_o_ai
9518 vec_sll(vector
signed char __a
, vector
unsigned short __b
) {
9519 return (vector
signed char)__builtin_altivec_vsl((vector
int)__a
,
9523 static __inline__ vector
signed char __ATTRS_o_ai
9524 vec_sll(vector
signed char __a
, vector
unsigned int __b
) {
9525 return (vector
signed char)__builtin_altivec_vsl((vector
int)__a
,
9529 static __inline__ vector
unsigned char __ATTRS_o_ai
9530 vec_sll(vector
unsigned char __a
, vector
unsigned char __b
) {
9531 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)__a
,
9535 static __inline__ vector
unsigned char __ATTRS_o_ai
9536 vec_sll(vector
unsigned char __a
, vector
unsigned short __b
) {
9537 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)__a
,
9541 static __inline__ vector
unsigned char __ATTRS_o_ai
9542 vec_sll(vector
unsigned char __a
, vector
unsigned int __b
) {
9543 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)__a
,
9547 static __inline__ vector
bool char __ATTRS_o_ai
9548 vec_sll(vector
bool char __a
, vector
unsigned char __b
) {
9549 return (vector
bool char)__builtin_altivec_vsl((vector
int)__a
,
9553 static __inline__ vector
bool char __ATTRS_o_ai
9554 vec_sll(vector
bool char __a
, vector
unsigned short __b
) {
9555 return (vector
bool char)__builtin_altivec_vsl((vector
int)__a
,
9559 static __inline__ vector
bool char __ATTRS_o_ai
9560 vec_sll(vector
bool char __a
, vector
unsigned int __b
) {
9561 return (vector
bool char)__builtin_altivec_vsl((vector
int)__a
,
9565 static __inline__ vector
short __ATTRS_o_ai
vec_sll(vector
short __a
,
9566 vector
unsigned char __b
) {
9567 return (vector
short)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9570 static __inline__ vector
short __ATTRS_o_ai
vec_sll(vector
short __a
,
9571 vector
unsigned short __b
) {
9572 return (vector
short)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9575 static __inline__ vector
short __ATTRS_o_ai
vec_sll(vector
short __a
,
9576 vector
unsigned int __b
) {
9577 return (vector
short)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9580 static __inline__ vector
unsigned short __ATTRS_o_ai
9581 vec_sll(vector
unsigned short __a
, vector
unsigned char __b
) {
9582 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)__a
,
9586 static __inline__ vector
unsigned short __ATTRS_o_ai
9587 vec_sll(vector
unsigned short __a
, vector
unsigned short __b
) {
9588 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)__a
,
9592 static __inline__ vector
unsigned short __ATTRS_o_ai
9593 vec_sll(vector
unsigned short __a
, vector
unsigned int __b
) {
9594 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)__a
,
9598 static __inline__ vector
bool short __ATTRS_o_ai
9599 vec_sll(vector
bool short __a
, vector
unsigned char __b
) {
9600 return (vector
bool short)__builtin_altivec_vsl((vector
int)__a
,
9604 static __inline__ vector
bool short __ATTRS_o_ai
9605 vec_sll(vector
bool short __a
, vector
unsigned short __b
) {
9606 return (vector
bool short)__builtin_altivec_vsl((vector
int)__a
,
9610 static __inline__ vector
bool short __ATTRS_o_ai
9611 vec_sll(vector
bool short __a
, vector
unsigned int __b
) {
9612 return (vector
bool short)__builtin_altivec_vsl((vector
int)__a
,
9616 static __inline__ vector pixel __ATTRS_o_ai
vec_sll(vector pixel __a
,
9617 vector
unsigned char __b
) {
9618 return (vector pixel
)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9621 static __inline__ vector pixel __ATTRS_o_ai
vec_sll(vector pixel __a
,
9622 vector
unsigned short __b
) {
9623 return (vector pixel
)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9626 static __inline__ vector pixel __ATTRS_o_ai
vec_sll(vector pixel __a
,
9627 vector
unsigned int __b
) {
9628 return (vector pixel
)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9631 static __inline__ vector
int __ATTRS_o_ai
vec_sll(vector
int __a
,
9632 vector
unsigned char __b
) {
9633 return (vector
int)__builtin_altivec_vsl(__a
, (vector
int)__b
);
9636 static __inline__ vector
int __ATTRS_o_ai
vec_sll(vector
int __a
,
9637 vector
unsigned short __b
) {
9638 return (vector
int)__builtin_altivec_vsl(__a
, (vector
int)__b
);
9641 static __inline__ vector
int __ATTRS_o_ai
vec_sll(vector
int __a
,
9642 vector
unsigned int __b
) {
9643 return (vector
int)__builtin_altivec_vsl(__a
, (vector
int)__b
);
9646 static __inline__ vector
unsigned int __ATTRS_o_ai
9647 vec_sll(vector
unsigned int __a
, vector
unsigned char __b
) {
9648 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)__a
,
9652 static __inline__ vector
unsigned int __ATTRS_o_ai
9653 vec_sll(vector
unsigned int __a
, vector
unsigned short __b
) {
9654 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)__a
,
9658 static __inline__ vector
unsigned int __ATTRS_o_ai
9659 vec_sll(vector
unsigned int __a
, vector
unsigned int __b
) {
9660 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)__a
,
9664 static __inline__ vector
bool int __ATTRS_o_ai
9665 vec_sll(vector
bool int __a
, vector
unsigned char __b
) {
9666 return (vector
bool int)__builtin_altivec_vsl((vector
int)__a
,
9670 static __inline__ vector
bool int __ATTRS_o_ai
9671 vec_sll(vector
bool int __a
, vector
unsigned short __b
) {
9672 return (vector
bool int)__builtin_altivec_vsl((vector
int)__a
,
9676 static __inline__ vector
bool int __ATTRS_o_ai
9677 vec_sll(vector
bool int __a
, vector
unsigned int __b
) {
9678 return (vector
bool int)__builtin_altivec_vsl((vector
int)__a
,
9683 static __inline__ vector
signed long long __ATTRS_o_ai
9684 vec_sll(vector
signed long long __a
, vector
unsigned char __b
) {
9685 return (vector
signed long long)__builtin_altivec_vsl((vector
int)__a
,
9689 static __inline__ vector
unsigned long long __ATTRS_o_ai
9690 vec_sll(vector
unsigned long long __a
, vector
unsigned char __b
) {
9691 return (vector
unsigned long long)__builtin_altivec_vsl((vector
int)__a
,
9698 static __inline__ vector
signed char __ATTRS_o_ai
9699 vec_vsl(vector
signed char __a
, vector
unsigned char __b
) {
9700 return (vector
signed char)__builtin_altivec_vsl((vector
int)__a
,
9704 static __inline__ vector
signed char __ATTRS_o_ai
9705 vec_vsl(vector
signed char __a
, vector
unsigned short __b
) {
9706 return (vector
signed char)__builtin_altivec_vsl((vector
int)__a
,
9710 static __inline__ vector
signed char __ATTRS_o_ai
9711 vec_vsl(vector
signed char __a
, vector
unsigned int __b
) {
9712 return (vector
signed char)__builtin_altivec_vsl((vector
int)__a
,
9716 static __inline__ vector
unsigned char __ATTRS_o_ai
9717 vec_vsl(vector
unsigned char __a
, vector
unsigned char __b
) {
9718 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)__a
,
9722 static __inline__ vector
unsigned char __ATTRS_o_ai
9723 vec_vsl(vector
unsigned char __a
, vector
unsigned short __b
) {
9724 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)__a
,
9728 static __inline__ vector
unsigned char __ATTRS_o_ai
9729 vec_vsl(vector
unsigned char __a
, vector
unsigned int __b
) {
9730 return (vector
unsigned char)__builtin_altivec_vsl((vector
int)__a
,
9734 static __inline__ vector
bool char __ATTRS_o_ai
9735 vec_vsl(vector
bool char __a
, vector
unsigned char __b
) {
9736 return (vector
bool char)__builtin_altivec_vsl((vector
int)__a
,
9740 static __inline__ vector
bool char __ATTRS_o_ai
9741 vec_vsl(vector
bool char __a
, vector
unsigned short __b
) {
9742 return (vector
bool char)__builtin_altivec_vsl((vector
int)__a
,
9746 static __inline__ vector
bool char __ATTRS_o_ai
9747 vec_vsl(vector
bool char __a
, vector
unsigned int __b
) {
9748 return (vector
bool char)__builtin_altivec_vsl((vector
int)__a
,
9752 static __inline__ vector
short __ATTRS_o_ai
vec_vsl(vector
short __a
,
9753 vector
unsigned char __b
) {
9754 return (vector
short)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9757 static __inline__ vector
short __ATTRS_o_ai
vec_vsl(vector
short __a
,
9758 vector
unsigned short __b
) {
9759 return (vector
short)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9762 static __inline__ vector
short __ATTRS_o_ai
vec_vsl(vector
short __a
,
9763 vector
unsigned int __b
) {
9764 return (vector
short)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9767 static __inline__ vector
unsigned short __ATTRS_o_ai
9768 vec_vsl(vector
unsigned short __a
, vector
unsigned char __b
) {
9769 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)__a
,
9773 static __inline__ vector
unsigned short __ATTRS_o_ai
9774 vec_vsl(vector
unsigned short __a
, vector
unsigned short __b
) {
9775 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)__a
,
9779 static __inline__ vector
unsigned short __ATTRS_o_ai
9780 vec_vsl(vector
unsigned short __a
, vector
unsigned int __b
) {
9781 return (vector
unsigned short)__builtin_altivec_vsl((vector
int)__a
,
9785 static __inline__ vector
bool short __ATTRS_o_ai
9786 vec_vsl(vector
bool short __a
, vector
unsigned char __b
) {
9787 return (vector
bool short)__builtin_altivec_vsl((vector
int)__a
,
9791 static __inline__ vector
bool short __ATTRS_o_ai
9792 vec_vsl(vector
bool short __a
, vector
unsigned short __b
) {
9793 return (vector
bool short)__builtin_altivec_vsl((vector
int)__a
,
9797 static __inline__ vector
bool short __ATTRS_o_ai
9798 vec_vsl(vector
bool short __a
, vector
unsigned int __b
) {
9799 return (vector
bool short)__builtin_altivec_vsl((vector
int)__a
,
9803 static __inline__ vector pixel __ATTRS_o_ai
vec_vsl(vector pixel __a
,
9804 vector
unsigned char __b
) {
9805 return (vector pixel
)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9808 static __inline__ vector pixel __ATTRS_o_ai
vec_vsl(vector pixel __a
,
9809 vector
unsigned short __b
) {
9810 return (vector pixel
)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9813 static __inline__ vector pixel __ATTRS_o_ai
vec_vsl(vector pixel __a
,
9814 vector
unsigned int __b
) {
9815 return (vector pixel
)__builtin_altivec_vsl((vector
int)__a
, (vector
int)__b
);
9818 static __inline__ vector
int __ATTRS_o_ai
vec_vsl(vector
int __a
,
9819 vector
unsigned char __b
) {
9820 return (vector
int)__builtin_altivec_vsl(__a
, (vector
int)__b
);
9823 static __inline__ vector
int __ATTRS_o_ai
vec_vsl(vector
int __a
,
9824 vector
unsigned short __b
) {
9825 return (vector
int)__builtin_altivec_vsl(__a
, (vector
int)__b
);
9828 static __inline__ vector
int __ATTRS_o_ai
vec_vsl(vector
int __a
,
9829 vector
unsigned int __b
) {
9830 return (vector
int)__builtin_altivec_vsl(__a
, (vector
int)__b
);
9833 static __inline__ vector
unsigned int __ATTRS_o_ai
9834 vec_vsl(vector
unsigned int __a
, vector
unsigned char __b
) {
9835 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)__a
,
9839 static __inline__ vector
unsigned int __ATTRS_o_ai
9840 vec_vsl(vector
unsigned int __a
, vector
unsigned short __b
) {
9841 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)__a
,
9845 static __inline__ vector
unsigned int __ATTRS_o_ai
9846 vec_vsl(vector
unsigned int __a
, vector
unsigned int __b
) {
9847 return (vector
unsigned int)__builtin_altivec_vsl((vector
int)__a
,
9851 static __inline__ vector
bool int __ATTRS_o_ai
9852 vec_vsl(vector
bool int __a
, vector
unsigned char __b
) {
9853 return (vector
bool int)__builtin_altivec_vsl((vector
int)__a
,
9857 static __inline__ vector
bool int __ATTRS_o_ai
9858 vec_vsl(vector
bool int __a
, vector
unsigned short __b
) {
9859 return (vector
bool int)__builtin_altivec_vsl((vector
int)__a
,
9863 static __inline__ vector
bool int __ATTRS_o_ai
9864 vec_vsl(vector
bool int __a
, vector
unsigned int __b
) {
9865 return (vector
bool int)__builtin_altivec_vsl((vector
int)__a
,
9871 static __inline__ vector
signed char __ATTRS_o_ai
9872 vec_slo(vector
signed char __a
, vector
signed char __b
) {
9873 return (vector
signed char)__builtin_altivec_vslo((vector
int)__a
,
9877 static __inline__ vector
signed char __ATTRS_o_ai
9878 vec_slo(vector
signed char __a
, vector
unsigned char __b
) {
9879 return (vector
signed char)__builtin_altivec_vslo((vector
int)__a
,
9883 static __inline__ vector
unsigned char __ATTRS_o_ai
9884 vec_slo(vector
unsigned char __a
, vector
signed char __b
) {
9885 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)__a
,
9889 static __inline__ vector
unsigned char __ATTRS_o_ai
9890 vec_slo(vector
unsigned char __a
, vector
unsigned char __b
) {
9891 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)__a
,
9895 static __inline__ vector
short __ATTRS_o_ai
vec_slo(vector
short __a
,
9896 vector
signed char __b
) {
9897 return (vector
short)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
9900 static __inline__ vector
short __ATTRS_o_ai
vec_slo(vector
short __a
,
9901 vector
unsigned char __b
) {
9902 return (vector
short)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
9905 static __inline__ vector
unsigned short __ATTRS_o_ai
9906 vec_slo(vector
unsigned short __a
, vector
signed char __b
) {
9907 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)__a
,
9911 static __inline__ vector
unsigned short __ATTRS_o_ai
9912 vec_slo(vector
unsigned short __a
, vector
unsigned char __b
) {
9913 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)__a
,
9917 static __inline__ vector pixel __ATTRS_o_ai
vec_slo(vector pixel __a
,
9918 vector
signed char __b
) {
9919 return (vector pixel
)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
9922 static __inline__ vector pixel __ATTRS_o_ai
vec_slo(vector pixel __a
,
9923 vector
unsigned char __b
) {
9924 return (vector pixel
)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
9927 static __inline__ vector
int __ATTRS_o_ai
vec_slo(vector
int __a
,
9928 vector
signed char __b
) {
9929 return (vector
int)__builtin_altivec_vslo(__a
, (vector
int)__b
);
9932 static __inline__ vector
int __ATTRS_o_ai
vec_slo(vector
int __a
,
9933 vector
unsigned char __b
) {
9934 return (vector
int)__builtin_altivec_vslo(__a
, (vector
int)__b
);
9937 static __inline__ vector
unsigned int __ATTRS_o_ai
9938 vec_slo(vector
unsigned int __a
, vector
signed char __b
) {
9939 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)__a
,
9943 static __inline__ vector
unsigned int __ATTRS_o_ai
9944 vec_slo(vector
unsigned int __a
, vector
unsigned char __b
) {
9945 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)__a
,
9949 static __inline__ vector
float __ATTRS_o_ai
vec_slo(vector
float __a
,
9950 vector
signed char __b
) {
9951 return (vector
float)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
9954 static __inline__ vector
float __ATTRS_o_ai
vec_slo(vector
float __a
,
9955 vector
unsigned char __b
) {
9956 return (vector
float)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
9960 static __inline__ vector
signed long long __ATTRS_o_ai
9961 vec_slo(vector
signed long long __a
, vector
signed char __b
) {
9962 return (vector
signed long long)__builtin_altivec_vslo((vector
int)__a
,
9966 static __inline__ vector
signed long long __ATTRS_o_ai
9967 vec_slo(vector
signed long long __a
, vector
unsigned char __b
) {
9968 return (vector
signed long long)__builtin_altivec_vslo((vector
int)__a
,
9972 static __inline__ vector
unsigned long long __ATTRS_o_ai
9973 vec_slo(vector
unsigned long long __a
, vector
signed char __b
) {
9974 return (vector
unsigned long long)__builtin_altivec_vslo((vector
int)__a
,
9978 static __inline__ vector
unsigned long long __ATTRS_o_ai
9979 vec_slo(vector
unsigned long long __a
, vector
unsigned char __b
) {
9980 return (vector
unsigned long long)__builtin_altivec_vslo((vector
int)__a
,
9987 static __inline__ vector
signed char __ATTRS_o_ai
9988 vec_vslo(vector
signed char __a
, vector
signed char __b
) {
9989 return (vector
signed char)__builtin_altivec_vslo((vector
int)__a
,
9993 static __inline__ vector
signed char __ATTRS_o_ai
9994 vec_vslo(vector
signed char __a
, vector
unsigned char __b
) {
9995 return (vector
signed char)__builtin_altivec_vslo((vector
int)__a
,
9999 static __inline__ vector
unsigned char __ATTRS_o_ai
10000 vec_vslo(vector
unsigned char __a
, vector
signed char __b
) {
10001 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)__a
,
10005 static __inline__ vector
unsigned char __ATTRS_o_ai
10006 vec_vslo(vector
unsigned char __a
, vector
unsigned char __b
) {
10007 return (vector
unsigned char)__builtin_altivec_vslo((vector
int)__a
,
10011 static __inline__ vector
short __ATTRS_o_ai
vec_vslo(vector
short __a
,
10012 vector
signed char __b
) {
10013 return (vector
short)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
10016 static __inline__ vector
short __ATTRS_o_ai
vec_vslo(vector
short __a
,
10017 vector
unsigned char __b
) {
10018 return (vector
short)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
10021 static __inline__ vector
unsigned short __ATTRS_o_ai
10022 vec_vslo(vector
unsigned short __a
, vector
signed char __b
) {
10023 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)__a
,
10027 static __inline__ vector
unsigned short __ATTRS_o_ai
10028 vec_vslo(vector
unsigned short __a
, vector
unsigned char __b
) {
10029 return (vector
unsigned short)__builtin_altivec_vslo((vector
int)__a
,
10033 static __inline__ vector pixel __ATTRS_o_ai
vec_vslo(vector pixel __a
,
10034 vector
signed char __b
) {
10035 return (vector pixel
)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
10038 static __inline__ vector pixel __ATTRS_o_ai
vec_vslo(vector pixel __a
,
10039 vector
unsigned char __b
) {
10040 return (vector pixel
)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
10043 static __inline__ vector
int __ATTRS_o_ai
vec_vslo(vector
int __a
,
10044 vector
signed char __b
) {
10045 return (vector
int)__builtin_altivec_vslo(__a
, (vector
int)__b
);
10048 static __inline__ vector
int __ATTRS_o_ai
vec_vslo(vector
int __a
,
10049 vector
unsigned char __b
) {
10050 return (vector
int)__builtin_altivec_vslo(__a
, (vector
int)__b
);
10053 static __inline__ vector
unsigned int __ATTRS_o_ai
10054 vec_vslo(vector
unsigned int __a
, vector
signed char __b
) {
10055 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)__a
,
10059 static __inline__ vector
unsigned int __ATTRS_o_ai
10060 vec_vslo(vector
unsigned int __a
, vector
unsigned char __b
) {
10061 return (vector
unsigned int)__builtin_altivec_vslo((vector
int)__a
,
10065 static __inline__ vector
float __ATTRS_o_ai
vec_vslo(vector
float __a
,
10066 vector
signed char __b
) {
10067 return (vector
float)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
10070 static __inline__ vector
float __ATTRS_o_ai
vec_vslo(vector
float __a
,
10071 vector
unsigned char __b
) {
10072 return (vector
float)__builtin_altivec_vslo((vector
int)__a
, (vector
int)__b
);
10077 static __inline__ vector
signed char __ATTRS_o_ai
10078 vec_splat(vector
signed char __a
, unsigned const int __b
) {
10079 return vec_perm(__a
, __a
, (vector
unsigned char)(__b
& 0x0F));
10082 static __inline__ vector
unsigned char __ATTRS_o_ai
10083 vec_splat(vector
unsigned char __a
, unsigned const int __b
) {
10084 return vec_perm(__a
, __a
, (vector
unsigned char)(__b
& 0x0F));
10087 static __inline__ vector
bool char __ATTRS_o_ai
10088 vec_splat(vector
bool char __a
, unsigned const int __b
) {
10089 return vec_perm(__a
, __a
, (vector
unsigned char)(__b
& 0x0F));
10092 static __inline__ vector
signed short __ATTRS_o_ai
10093 vec_splat(vector
signed short __a
, unsigned const int __b
) {
10094 unsigned char b0
= (__b
& 0x07) * 2;
10095 unsigned char b1
= b0
+ 1;
10096 return vec_perm(__a
, __a
,
10097 (vector
unsigned char)(b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
,
10098 b0
, b1
, b0
, b1
, b0
, b1
));
10101 static __inline__ vector
unsigned short __ATTRS_o_ai
10102 vec_splat(vector
unsigned short __a
, unsigned const int __b
) {
10103 unsigned char b0
= (__b
& 0x07) * 2;
10104 unsigned char b1
= b0
+ 1;
10105 return vec_perm(__a
, __a
,
10106 (vector
unsigned char)(b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
,
10107 b0
, b1
, b0
, b1
, b0
, b1
));
10110 static __inline__ vector
bool short __ATTRS_o_ai
10111 vec_splat(vector
bool short __a
, unsigned const int __b
) {
10112 unsigned char b0
= (__b
& 0x07) * 2;
10113 unsigned char b1
= b0
+ 1;
10114 return vec_perm(__a
, __a
,
10115 (vector
unsigned char)(b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
,
10116 b0
, b1
, b0
, b1
, b0
, b1
));
10119 static __inline__ vector pixel __ATTRS_o_ai
vec_splat(vector pixel __a
,
10120 unsigned const int __b
) {
10121 unsigned char b0
= (__b
& 0x07) * 2;
10122 unsigned char b1
= b0
+ 1;
10123 return vec_perm(__a
, __a
,
10124 (vector
unsigned char)(b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
, b0
, b1
,
10125 b0
, b1
, b0
, b1
, b0
, b1
));
10128 static __inline__ vector
signed int __ATTRS_o_ai
10129 vec_splat(vector
signed int __a
, unsigned const int __b
) {
10130 unsigned char b0
= (__b
& 0x03) * 4;
10131 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3;
10132 return vec_perm(__a
, __a
,
10133 (vector
unsigned char)(b0
, b1
, b2
, b3
, b0
, b1
, b2
, b3
, b0
, b1
,
10134 b2
, b3
, b0
, b1
, b2
, b3
));
10137 static __inline__ vector
unsigned int __ATTRS_o_ai
10138 vec_splat(vector
unsigned int __a
, unsigned const int __b
) {
10139 unsigned char b0
= (__b
& 0x03) * 4;
10140 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3;
10141 return vec_perm(__a
, __a
,
10142 (vector
unsigned char)(b0
, b1
, b2
, b3
, b0
, b1
, b2
, b3
, b0
, b1
,
10143 b2
, b3
, b0
, b1
, b2
, b3
));
10146 static __inline__ vector
bool int __ATTRS_o_ai
10147 vec_splat(vector
bool int __a
, unsigned const int __b
) {
10148 unsigned char b0
= (__b
& 0x03) * 4;
10149 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3;
10150 return vec_perm(__a
, __a
,
10151 (vector
unsigned char)(b0
, b1
, b2
, b3
, b0
, b1
, b2
, b3
, b0
, b1
,
10152 b2
, b3
, b0
, b1
, b2
, b3
));
10155 static __inline__ vector
float __ATTRS_o_ai
vec_splat(vector
float __a
,
10156 unsigned const int __b
) {
10157 unsigned char b0
= (__b
& 0x03) * 4;
10158 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3;
10159 return vec_perm(__a
, __a
,
10160 (vector
unsigned char)(b0
, b1
, b2
, b3
, b0
, b1
, b2
, b3
, b0
, b1
,
10161 b2
, b3
, b0
, b1
, b2
, b3
));
10165 static __inline__ vector
double __ATTRS_o_ai
vec_splat(vector
double __a
,
10166 unsigned const int __b
) {
10167 unsigned char b0
= (__b
& 0x01) * 8;
10168 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3, b4
= b0
+ 4, b5
= b0
+ 5,
10169 b6
= b0
+ 6, b7
= b0
+ 7;
10170 return vec_perm(__a
, __a
,
10171 (vector
unsigned char)(b0
, b1
, b2
, b3
, b4
, b5
, b6
, b7
, b0
, b1
,
10172 b2
, b3
, b4
, b5
, b6
, b7
));
10174 static __inline__ vector
bool long long __ATTRS_o_ai
10175 vec_splat(vector
bool long long __a
, unsigned const int __b
) {
10176 unsigned char b0
= (__b
& 0x01) * 8;
10177 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3, b4
= b0
+ 4, b5
= b0
+ 5,
10178 b6
= b0
+ 6, b7
= b0
+ 7;
10179 return vec_perm(__a
, __a
,
10180 (vector
unsigned char)(b0
, b1
, b2
, b3
, b4
, b5
, b6
, b7
, b0
, b1
,
10181 b2
, b3
, b4
, b5
, b6
, b7
));
10183 static __inline__ vector
signed long long __ATTRS_o_ai
10184 vec_splat(vector
signed long long __a
, unsigned const int __b
) {
10185 unsigned char b0
= (__b
& 0x01) * 8;
10186 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3, b4
= b0
+ 4, b5
= b0
+ 5,
10187 b6
= b0
+ 6, b7
= b0
+ 7;
10188 return vec_perm(__a
, __a
,
10189 (vector
unsigned char)(b0
, b1
, b2
, b3
, b4
, b5
, b6
, b7
, b0
, b1
,
10190 b2
, b3
, b4
, b5
, b6
, b7
));
10192 static __inline__ vector
unsigned long long __ATTRS_o_ai
10193 vec_splat(vector
unsigned long long __a
, unsigned const int __b
) {
10194 unsigned char b0
= (__b
& 0x01) * 8;
10195 unsigned char b1
= b0
+ 1, b2
= b0
+ 2, b3
= b0
+ 3, b4
= b0
+ 4, b5
= b0
+ 5,
10196 b6
= b0
+ 6, b7
= b0
+ 7;
10197 return vec_perm(__a
, __a
,
10198 (vector
unsigned char)(b0
, b1
, b2
, b3
, b4
, b5
, b6
, b7
, b0
, b1
,
10199 b2
, b3
, b4
, b5
, b6
, b7
));
10205 #define __builtin_altivec_vspltb vec_vspltb
10207 static __inline__ vector
signed char __ATTRS_o_ai
10208 vec_vspltb(vector
signed char __a
, unsigned char __b
) {
10209 return vec_perm(__a
, __a
, (vector
unsigned char)(__b
));
10212 static __inline__ vector
unsigned char __ATTRS_o_ai
10213 vec_vspltb(vector
unsigned char __a
, unsigned char __b
) {
10214 return vec_perm(__a
, __a
, (vector
unsigned char)(__b
));
10217 static __inline__ vector
bool char __ATTRS_o_ai
vec_vspltb(vector
bool char __a
,
10218 unsigned char __b
) {
10219 return vec_perm(__a
, __a
, (vector
unsigned char)(__b
));
10224 #define __builtin_altivec_vsplth vec_vsplth
10226 static __inline__ vector
short __ATTRS_o_ai
vec_vsplth(vector
short __a
,
10227 unsigned char __b
) {
10229 unsigned char b1
= __b
+ 1;
10230 return vec_perm(__a
, __a
,
10231 (vector
unsigned char)(__b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
,
10232 __b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
));
10235 static __inline__ vector
unsigned short __ATTRS_o_ai
10236 vec_vsplth(vector
unsigned short __a
, unsigned char __b
) {
10238 unsigned char b1
= __b
+ 1;
10239 return vec_perm(__a
, __a
,
10240 (vector
unsigned char)(__b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
,
10241 __b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
));
10244 static __inline__ vector
bool short __ATTRS_o_ai
10245 vec_vsplth(vector
bool short __a
, unsigned char __b
) {
10247 unsigned char b1
= __b
+ 1;
10248 return vec_perm(__a
, __a
,
10249 (vector
unsigned char)(__b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
,
10250 __b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
));
10253 static __inline__ vector pixel __ATTRS_o_ai
vec_vsplth(vector pixel __a
,
10254 unsigned char __b
) {
10256 unsigned char b1
= __b
+ 1;
10257 return vec_perm(__a
, __a
,
10258 (vector
unsigned char)(__b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
,
10259 __b
, b1
, __b
, b1
, __b
, b1
, __b
, b1
));
10264 #define __builtin_altivec_vspltw vec_vspltw
10266 static __inline__ vector
int __ATTRS_o_ai
vec_vspltw(vector
int __a
,
10267 unsigned char __b
) {
10269 unsigned char b1
= __b
+ 1, b2
= __b
+ 2, b3
= __b
+ 3;
10270 return vec_perm(__a
, __a
,
10271 (vector
unsigned char)(__b
, b1
, b2
, b3
, __b
, b1
, b2
, b3
, __b
,
10272 b1
, b2
, b3
, __b
, b1
, b2
, b3
));
10275 static __inline__ vector
unsigned int __ATTRS_o_ai
10276 vec_vspltw(vector
unsigned int __a
, unsigned char __b
) {
10278 unsigned char b1
= __b
+ 1, b2
= __b
+ 2, b3
= __b
+ 3;
10279 return vec_perm(__a
, __a
,
10280 (vector
unsigned char)(__b
, b1
, b2
, b3
, __b
, b1
, b2
, b3
, __b
,
10281 b1
, b2
, b3
, __b
, b1
, b2
, b3
));
10284 static __inline__ vector
bool int __ATTRS_o_ai
vec_vspltw(vector
bool int __a
,
10285 unsigned char __b
) {
10287 unsigned char b1
= __b
+ 1, b2
= __b
+ 2, b3
= __b
+ 3;
10288 return vec_perm(__a
, __a
,
10289 (vector
unsigned char)(__b
, b1
, b2
, b3
, __b
, b1
, b2
, b3
, __b
,
10290 b1
, b2
, b3
, __b
, b1
, b2
, b3
));
10293 static __inline__ vector
float __ATTRS_o_ai
vec_vspltw(vector
float __a
,
10294 unsigned char __b
) {
10296 unsigned char b1
= __b
+ 1, b2
= __b
+ 2, b3
= __b
+ 3;
10297 return vec_perm(__a
, __a
,
10298 (vector
unsigned char)(__b
, b1
, b2
, b3
, __b
, b1
, b2
, b3
, __b
,
10299 b1
, b2
, b3
, __b
, b1
, b2
, b3
));
10304 #define __builtin_altivec_vspltisb vec_splat_s8
10306 // FIXME: parameter should be treated as 5-bit signed literal
10307 static __inline__ vector
signed char __ATTRS_o_ai
10308 vec_splat_s8(signed char __a
) {
10309 return (vector
signed char)(__a
);
10314 // FIXME: parameter should be treated as 5-bit signed literal
10315 static __inline__ vector
signed char __ATTRS_o_ai
10316 vec_vspltisb(signed char __a
) {
10317 return (vector
signed char)(__a
);
10320 /* vec_splat_s16 */
10322 #define __builtin_altivec_vspltish vec_splat_s16
10324 // FIXME: parameter should be treated as 5-bit signed literal
10325 static __inline__ vector
short __ATTRS_o_ai
vec_splat_s16(signed char __a
) {
10326 return (vector
short)(__a
);
10331 // FIXME: parameter should be treated as 5-bit signed literal
10332 static __inline__ vector
short __ATTRS_o_ai
vec_vspltish(signed char __a
) {
10333 return (vector
short)(__a
);
10336 /* vec_splat_s32 */
10338 #define __builtin_altivec_vspltisw vec_splat_s32
10340 // FIXME: parameter should be treated as 5-bit signed literal
10341 static __inline__ vector
int __ATTRS_o_ai
vec_splat_s32(signed char __a
) {
10342 return (vector
int)(__a
);
10347 // FIXME: parameter should be treated as 5-bit signed literal
10348 static __inline__ vector
int __ATTRS_o_ai
vec_vspltisw(signed char __a
) {
10349 return (vector
int)(__a
);
10354 // FIXME: parameter should be treated as 5-bit signed literal
10355 static __inline__ vector
unsigned char __ATTRS_o_ai
10356 vec_splat_u8(unsigned char __a
) {
10357 return (vector
unsigned char)(__a
);
10360 /* vec_splat_u16 */
10362 // FIXME: parameter should be treated as 5-bit signed literal
10363 static __inline__ vector
unsigned short __ATTRS_o_ai
10364 vec_splat_u16(signed char __a
) {
10365 return (vector
unsigned short)(__a
);
10368 /* vec_splat_u32 */
10370 // FIXME: parameter should be treated as 5-bit signed literal
10371 static __inline__ vector
unsigned int __ATTRS_o_ai
10372 vec_splat_u32(signed char __a
) {
10373 return (vector
unsigned int)(__a
);
10378 // vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
10379 // than the length of __a.
10380 static __inline__ vector
unsigned char __ATTRS_o_ai
10381 vec_sr(vector
unsigned char __a
, vector
unsigned char __b
) {
10383 (__b
% (vector
unsigned char)(sizeof(unsigned char) * __CHAR_BIT__
));
10386 static __inline__ vector
signed char __ATTRS_o_ai
10387 vec_sr(vector
signed char __a
, vector
unsigned char __b
) {
10388 return (vector
signed char)vec_sr((vector
unsigned char)__a
, __b
);
10391 static __inline__ vector
unsigned short __ATTRS_o_ai
10392 vec_sr(vector
unsigned short __a
, vector
unsigned short __b
) {
10394 (__b
% (vector
unsigned short)(sizeof(unsigned short) * __CHAR_BIT__
));
10397 static __inline__ vector
short __ATTRS_o_ai
vec_sr(vector
short __a
,
10398 vector
unsigned short __b
) {
10399 return (vector
short)vec_sr((vector
unsigned short)__a
, __b
);
10402 static __inline__ vector
unsigned int __ATTRS_o_ai
10403 vec_sr(vector
unsigned int __a
, vector
unsigned int __b
) {
10405 (__b
% (vector
unsigned int)(sizeof(unsigned int) * __CHAR_BIT__
));
10408 static __inline__ vector
int __ATTRS_o_ai
vec_sr(vector
int __a
,
10409 vector
unsigned int __b
) {
10410 return (vector
int)vec_sr((vector
unsigned int)__a
, __b
);
10413 #ifdef __POWER8_VECTOR__
10414 static __inline__ vector
unsigned long long __ATTRS_o_ai
10415 vec_sr(vector
unsigned long long __a
, vector
unsigned long long __b
) {
10416 return __a
>> (__b
% (vector
unsigned long long)(sizeof(unsigned long long) *
10420 static __inline__ vector
long long __ATTRS_o_ai
10421 vec_sr(vector
long long __a
, vector
unsigned long long __b
) {
10422 return (vector
long long)vec_sr((vector
unsigned long long)__a
, __b
);
10424 #elif defined(__VSX__)
10425 static __inline__ vector
unsigned long long __ATTRS_o_ai
10426 vec_sr(vector
unsigned long long __a
, vector
unsigned long long __b
) {
10427 __b
%= (vector
unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__
);
10429 // Big endian element zero (the left doubleword) can be right shifted as-is.
10430 // However the shift amount must be in the right doubleword.
10431 // The other element needs to be swapped into the left doubleword and
10432 // shifted. Then the left doublewords of the two result vectors are merged.
10433 vector
unsigned long long __swapshift
=
10434 __builtin_shufflevector(__b
, __b
, 1, 0);
10435 vector
unsigned long long __leftelt
=
10436 (vector
unsigned long long)__builtin_altivec_vsro(
10437 (vector
signed int)__a
, (vector
signed int)__swapshift
);
10438 #ifdef __LITTLE_ENDIAN__
10439 __leftelt
= (vector
unsigned long long)__builtin_altivec_vsr(
10440 (vector
signed int)__leftelt
,
10441 (vector
signed int)vec_vspltb((vector
unsigned char)__swapshift
, 0));
10443 __leftelt
= (vector
unsigned long long)__builtin_altivec_vsr(
10444 (vector
signed int)__leftelt
,
10445 (vector
signed int)vec_vspltb((vector
unsigned char)__swapshift
, 15));
10447 __a
= __builtin_shufflevector(__a
, __a
, 1, 0);
10448 vector
unsigned long long __rightelt
=
10449 (vector
unsigned long long)__builtin_altivec_vsro((vector
signed int)__a
,
10450 (vector
signed int)__b
);
10451 #ifdef __LITTLE_ENDIAN__
10452 __rightelt
= (vector
unsigned long long)__builtin_altivec_vsr(
10453 (vector
signed int)__rightelt
,
10454 (vector
signed int)vec_vspltb((vector
unsigned char)__b
, 0));
10455 return __builtin_shufflevector(__rightelt
, __leftelt
, 1, 3);
10457 __rightelt
= (vector
unsigned long long)__builtin_altivec_vsr(
10458 (vector
signed int)__rightelt
,
10459 (vector
signed int)vec_vspltb((vector
unsigned char)__b
, 15));
10460 return __builtin_shufflevector(__leftelt
, __rightelt
, 0, 2);
10464 static __inline__ vector
long long __ATTRS_o_ai
10465 vec_sr(vector
long long __a
, vector
unsigned long long __b
) {
10466 return (vector
long long)vec_sr((vector
unsigned long long)__a
, __b
);
10468 #endif /* __VSX__ */
10472 #define __builtin_altivec_vsrb vec_vsrb
10474 static __inline__ vector
signed char __ATTRS_o_ai
10475 vec_vsrb(vector
signed char __a
, vector
unsigned char __b
) {
10476 return vec_sr(__a
, __b
);
10479 static __inline__ vector
unsigned char __ATTRS_o_ai
10480 vec_vsrb(vector
unsigned char __a
, vector
unsigned char __b
) {
10481 return vec_sr(__a
, __b
);
10486 #define __builtin_altivec_vsrh vec_vsrh
10488 static __inline__ vector
short __ATTRS_o_ai
10489 vec_vsrh(vector
short __a
, vector
unsigned short __b
) {
10490 return vec_sr(__a
, __b
);
10493 static __inline__ vector
unsigned short __ATTRS_o_ai
10494 vec_vsrh(vector
unsigned short __a
, vector
unsigned short __b
) {
10495 return vec_sr(__a
, __b
);
10500 #define __builtin_altivec_vsrw vec_vsrw
10502 static __inline__ vector
int __ATTRS_o_ai
vec_vsrw(vector
int __a
,
10503 vector
unsigned int __b
) {
10504 return vec_sr(__a
, __b
);
10507 static __inline__ vector
unsigned int __ATTRS_o_ai
10508 vec_vsrw(vector
unsigned int __a
, vector
unsigned int __b
) {
10509 return vec_sr(__a
, __b
);
10514 static __inline__ vector
signed char __ATTRS_o_ai
10515 vec_sra(vector
signed char __a
, vector
unsigned char __b
) {
10516 return (vector
signed char)__builtin_altivec_vsrab((vector
char)__a
, __b
);
10519 static __inline__ vector
unsigned char __ATTRS_o_ai
10520 vec_sra(vector
unsigned char __a
, vector
unsigned char __b
) {
10521 return (vector
unsigned char)__builtin_altivec_vsrab((vector
char)__a
, __b
);
10524 static __inline__ vector
short __ATTRS_o_ai
vec_sra(vector
short __a
,
10525 vector
unsigned short __b
) {
10526 return __builtin_altivec_vsrah(__a
, (vector
unsigned short)__b
);
10529 static __inline__ vector
unsigned short __ATTRS_o_ai
10530 vec_sra(vector
unsigned short __a
, vector
unsigned short __b
) {
10531 return (vector
unsigned short)__builtin_altivec_vsrah((vector
short)__a
, __b
);
10534 static __inline__ vector
int __ATTRS_o_ai
vec_sra(vector
int __a
,
10535 vector
unsigned int __b
) {
10536 return __builtin_altivec_vsraw(__a
, __b
);
10539 static __inline__ vector
unsigned int __ATTRS_o_ai
10540 vec_sra(vector
unsigned int __a
, vector
unsigned int __b
) {
10541 return (vector
unsigned int)__builtin_altivec_vsraw((vector
int)__a
, __b
);
10544 #ifdef __POWER8_VECTOR__
10545 static __inline__ vector
signed long long __ATTRS_o_ai
10546 vec_sra(vector
signed long long __a
, vector
unsigned long long __b
) {
10550 static __inline__ vector
unsigned long long __ATTRS_o_ai
10551 vec_sra(vector
unsigned long long __a
, vector
unsigned long long __b
) {
10552 return (vector
unsigned long long)((vector
signed long long)__a
>> __b
);
10554 #elif defined(__VSX__)
10555 static __inline__ vector
signed long long __ATTRS_o_ai
10556 vec_sra(vector
signed long long __a
, vector
unsigned long long __b
) {
10557 __b
%= (vector
unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__
);
10561 static __inline__ vector
unsigned long long __ATTRS_o_ai
10562 vec_sra(vector
unsigned long long __a
, vector
unsigned long long __b
) {
10563 __b
%= (vector
unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__
);
10564 return (vector
unsigned long long)((vector
signed long long)__a
>> __b
);
10566 #endif /* __VSX__ */
10570 static __inline__ vector
signed char __ATTRS_o_ai
10571 vec_vsrab(vector
signed char __a
, vector
unsigned char __b
) {
10572 return (vector
signed char)__builtin_altivec_vsrab((vector
char)__a
, __b
);
10575 static __inline__ vector
unsigned char __ATTRS_o_ai
10576 vec_vsrab(vector
unsigned char __a
, vector
unsigned char __b
) {
10577 return (vector
unsigned char)__builtin_altivec_vsrab((vector
char)__a
, __b
);
10582 static __inline__ vector
short __ATTRS_o_ai
10583 vec_vsrah(vector
short __a
, vector
unsigned short __b
) {
10584 return __builtin_altivec_vsrah(__a
, (vector
unsigned short)__b
);
10587 static __inline__ vector
unsigned short __ATTRS_o_ai
10588 vec_vsrah(vector
unsigned short __a
, vector
unsigned short __b
) {
10589 return (vector
unsigned short)__builtin_altivec_vsrah((vector
short)__a
, __b
);
10594 static __inline__ vector
int __ATTRS_o_ai
vec_vsraw(vector
int __a
,
10595 vector
unsigned int __b
) {
10596 return __builtin_altivec_vsraw(__a
, __b
);
10599 static __inline__ vector
unsigned int __ATTRS_o_ai
10600 vec_vsraw(vector
unsigned int __a
, vector
unsigned int __b
) {
10601 return (vector
unsigned int)__builtin_altivec_vsraw((vector
int)__a
, __b
);
10606 static __inline__ vector
signed char __ATTRS_o_ai
10607 vec_srl(vector
signed char __a
, vector
unsigned char __b
) {
10608 return (vector
signed char)__builtin_altivec_vsr((vector
int)__a
,
10612 static __inline__ vector
signed char __ATTRS_o_ai
10613 vec_srl(vector
signed char __a
, vector
unsigned short __b
) {
10614 return (vector
signed char)__builtin_altivec_vsr((vector
int)__a
,
10618 static __inline__ vector
signed char __ATTRS_o_ai
10619 vec_srl(vector
signed char __a
, vector
unsigned int __b
) {
10620 return (vector
signed char)__builtin_altivec_vsr((vector
int)__a
,
10624 static __inline__ vector
unsigned char __ATTRS_o_ai
10625 vec_srl(vector
unsigned char __a
, vector
unsigned char __b
) {
10626 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)__a
,
10630 static __inline__ vector
unsigned char __ATTRS_o_ai
10631 vec_srl(vector
unsigned char __a
, vector
unsigned short __b
) {
10632 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)__a
,
10636 static __inline__ vector
unsigned char __ATTRS_o_ai
10637 vec_srl(vector
unsigned char __a
, vector
unsigned int __b
) {
10638 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)__a
,
10642 static __inline__ vector
bool char __ATTRS_o_ai
10643 vec_srl(vector
bool char __a
, vector
unsigned char __b
) {
10644 return (vector
bool char)__builtin_altivec_vsr((vector
int)__a
,
10648 static __inline__ vector
bool char __ATTRS_o_ai
10649 vec_srl(vector
bool char __a
, vector
unsigned short __b
) {
10650 return (vector
bool char)__builtin_altivec_vsr((vector
int)__a
,
10654 static __inline__ vector
bool char __ATTRS_o_ai
10655 vec_srl(vector
bool char __a
, vector
unsigned int __b
) {
10656 return (vector
bool char)__builtin_altivec_vsr((vector
int)__a
,
10660 static __inline__ vector
short __ATTRS_o_ai
vec_srl(vector
short __a
,
10661 vector
unsigned char __b
) {
10662 return (vector
short)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10665 static __inline__ vector
short __ATTRS_o_ai
vec_srl(vector
short __a
,
10666 vector
unsigned short __b
) {
10667 return (vector
short)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10670 static __inline__ vector
short __ATTRS_o_ai
vec_srl(vector
short __a
,
10671 vector
unsigned int __b
) {
10672 return (vector
short)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10675 static __inline__ vector
unsigned short __ATTRS_o_ai
10676 vec_srl(vector
unsigned short __a
, vector
unsigned char __b
) {
10677 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)__a
,
10681 static __inline__ vector
unsigned short __ATTRS_o_ai
10682 vec_srl(vector
unsigned short __a
, vector
unsigned short __b
) {
10683 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)__a
,
10687 static __inline__ vector
unsigned short __ATTRS_o_ai
10688 vec_srl(vector
unsigned short __a
, vector
unsigned int __b
) {
10689 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)__a
,
10693 static __inline__ vector
bool short __ATTRS_o_ai
10694 vec_srl(vector
bool short __a
, vector
unsigned char __b
) {
10695 return (vector
bool short)__builtin_altivec_vsr((vector
int)__a
,
10699 static __inline__ vector
bool short __ATTRS_o_ai
10700 vec_srl(vector
bool short __a
, vector
unsigned short __b
) {
10701 return (vector
bool short)__builtin_altivec_vsr((vector
int)__a
,
10705 static __inline__ vector
bool short __ATTRS_o_ai
10706 vec_srl(vector
bool short __a
, vector
unsigned int __b
) {
10707 return (vector
bool short)__builtin_altivec_vsr((vector
int)__a
,
10711 static __inline__ vector pixel __ATTRS_o_ai
vec_srl(vector pixel __a
,
10712 vector
unsigned char __b
) {
10713 return (vector pixel
)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10716 static __inline__ vector pixel __ATTRS_o_ai
vec_srl(vector pixel __a
,
10717 vector
unsigned short __b
) {
10718 return (vector pixel
)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10721 static __inline__ vector pixel __ATTRS_o_ai
vec_srl(vector pixel __a
,
10722 vector
unsigned int __b
) {
10723 return (vector pixel
)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10726 static __inline__ vector
int __ATTRS_o_ai
vec_srl(vector
int __a
,
10727 vector
unsigned char __b
) {
10728 return (vector
int)__builtin_altivec_vsr(__a
, (vector
int)__b
);
10731 static __inline__ vector
int __ATTRS_o_ai
vec_srl(vector
int __a
,
10732 vector
unsigned short __b
) {
10733 return (vector
int)__builtin_altivec_vsr(__a
, (vector
int)__b
);
10736 static __inline__ vector
int __ATTRS_o_ai
vec_srl(vector
int __a
,
10737 vector
unsigned int __b
) {
10738 return (vector
int)__builtin_altivec_vsr(__a
, (vector
int)__b
);
10741 static __inline__ vector
unsigned int __ATTRS_o_ai
10742 vec_srl(vector
unsigned int __a
, vector
unsigned char __b
) {
10743 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)__a
,
10747 static __inline__ vector
unsigned int __ATTRS_o_ai
10748 vec_srl(vector
unsigned int __a
, vector
unsigned short __b
) {
10749 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)__a
,
10753 static __inline__ vector
unsigned int __ATTRS_o_ai
10754 vec_srl(vector
unsigned int __a
, vector
unsigned int __b
) {
10755 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)__a
,
10759 static __inline__ vector
bool int __ATTRS_o_ai
10760 vec_srl(vector
bool int __a
, vector
unsigned char __b
) {
10761 return (vector
bool int)__builtin_altivec_vsr((vector
int)__a
,
10765 static __inline__ vector
bool int __ATTRS_o_ai
10766 vec_srl(vector
bool int __a
, vector
unsigned short __b
) {
10767 return (vector
bool int)__builtin_altivec_vsr((vector
int)__a
,
10771 static __inline__ vector
bool int __ATTRS_o_ai
10772 vec_srl(vector
bool int __a
, vector
unsigned int __b
) {
10773 return (vector
bool int)__builtin_altivec_vsr((vector
int)__a
,
10778 static __inline__ vector
signed long long __ATTRS_o_ai
10779 vec_srl(vector
signed long long __a
, vector
unsigned char __b
) {
10780 return (vector
signed long long)__builtin_altivec_vsr((vector
int)__a
,
10784 static __inline__ vector
unsigned long long __ATTRS_o_ai
10785 vec_srl(vector
unsigned long long __a
, vector
unsigned char __b
) {
10786 return (vector
unsigned long long)__builtin_altivec_vsr((vector
int)__a
,
10793 static __inline__ vector
signed char __ATTRS_o_ai
10794 vec_vsr(vector
signed char __a
, vector
unsigned char __b
) {
10795 return (vector
signed char)__builtin_altivec_vsr((vector
int)__a
,
10799 static __inline__ vector
signed char __ATTRS_o_ai
10800 vec_vsr(vector
signed char __a
, vector
unsigned short __b
) {
10801 return (vector
signed char)__builtin_altivec_vsr((vector
int)__a
,
10805 static __inline__ vector
signed char __ATTRS_o_ai
10806 vec_vsr(vector
signed char __a
, vector
unsigned int __b
) {
10807 return (vector
signed char)__builtin_altivec_vsr((vector
int)__a
,
10811 static __inline__ vector
unsigned char __ATTRS_o_ai
10812 vec_vsr(vector
unsigned char __a
, vector
unsigned char __b
) {
10813 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)__a
,
10817 static __inline__ vector
unsigned char __ATTRS_o_ai
10818 vec_vsr(vector
unsigned char __a
, vector
unsigned short __b
) {
10819 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)__a
,
10823 static __inline__ vector
unsigned char __ATTRS_o_ai
10824 vec_vsr(vector
unsigned char __a
, vector
unsigned int __b
) {
10825 return (vector
unsigned char)__builtin_altivec_vsr((vector
int)__a
,
10829 static __inline__ vector
bool char __ATTRS_o_ai
10830 vec_vsr(vector
bool char __a
, vector
unsigned char __b
) {
10831 return (vector
bool char)__builtin_altivec_vsr((vector
int)__a
,
10835 static __inline__ vector
bool char __ATTRS_o_ai
10836 vec_vsr(vector
bool char __a
, vector
unsigned short __b
) {
10837 return (vector
bool char)__builtin_altivec_vsr((vector
int)__a
,
10841 static __inline__ vector
bool char __ATTRS_o_ai
10842 vec_vsr(vector
bool char __a
, vector
unsigned int __b
) {
10843 return (vector
bool char)__builtin_altivec_vsr((vector
int)__a
,
10847 static __inline__ vector
short __ATTRS_o_ai
vec_vsr(vector
short __a
,
10848 vector
unsigned char __b
) {
10849 return (vector
short)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10852 static __inline__ vector
short __ATTRS_o_ai
vec_vsr(vector
short __a
,
10853 vector
unsigned short __b
) {
10854 return (vector
short)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10857 static __inline__ vector
short __ATTRS_o_ai
vec_vsr(vector
short __a
,
10858 vector
unsigned int __b
) {
10859 return (vector
short)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10862 static __inline__ vector
unsigned short __ATTRS_o_ai
10863 vec_vsr(vector
unsigned short __a
, vector
unsigned char __b
) {
10864 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)__a
,
10868 static __inline__ vector
unsigned short __ATTRS_o_ai
10869 vec_vsr(vector
unsigned short __a
, vector
unsigned short __b
) {
10870 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)__a
,
10874 static __inline__ vector
unsigned short __ATTRS_o_ai
10875 vec_vsr(vector
unsigned short __a
, vector
unsigned int __b
) {
10876 return (vector
unsigned short)__builtin_altivec_vsr((vector
int)__a
,
10880 static __inline__ vector
bool short __ATTRS_o_ai
10881 vec_vsr(vector
bool short __a
, vector
unsigned char __b
) {
10882 return (vector
bool short)__builtin_altivec_vsr((vector
int)__a
,
10886 static __inline__ vector
bool short __ATTRS_o_ai
10887 vec_vsr(vector
bool short __a
, vector
unsigned short __b
) {
10888 return (vector
bool short)__builtin_altivec_vsr((vector
int)__a
,
10892 static __inline__ vector
bool short __ATTRS_o_ai
10893 vec_vsr(vector
bool short __a
, vector
unsigned int __b
) {
10894 return (vector
bool short)__builtin_altivec_vsr((vector
int)__a
,
10898 static __inline__ vector pixel __ATTRS_o_ai
vec_vsr(vector pixel __a
,
10899 vector
unsigned char __b
) {
10900 return (vector pixel
)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10903 static __inline__ vector pixel __ATTRS_o_ai
vec_vsr(vector pixel __a
,
10904 vector
unsigned short __b
) {
10905 return (vector pixel
)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10908 static __inline__ vector pixel __ATTRS_o_ai
vec_vsr(vector pixel __a
,
10909 vector
unsigned int __b
) {
10910 return (vector pixel
)__builtin_altivec_vsr((vector
int)__a
, (vector
int)__b
);
10913 static __inline__ vector
int __ATTRS_o_ai
vec_vsr(vector
int __a
,
10914 vector
unsigned char __b
) {
10915 return (vector
int)__builtin_altivec_vsr(__a
, (vector
int)__b
);
10918 static __inline__ vector
int __ATTRS_o_ai
vec_vsr(vector
int __a
,
10919 vector
unsigned short __b
) {
10920 return (vector
int)__builtin_altivec_vsr(__a
, (vector
int)__b
);
10923 static __inline__ vector
int __ATTRS_o_ai
vec_vsr(vector
int __a
,
10924 vector
unsigned int __b
) {
10925 return (vector
int)__builtin_altivec_vsr(__a
, (vector
int)__b
);
10928 static __inline__ vector
unsigned int __ATTRS_o_ai
10929 vec_vsr(vector
unsigned int __a
, vector
unsigned char __b
) {
10930 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)__a
,
10934 static __inline__ vector
unsigned int __ATTRS_o_ai
10935 vec_vsr(vector
unsigned int __a
, vector
unsigned short __b
) {
10936 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)__a
,
10940 static __inline__ vector
unsigned int __ATTRS_o_ai
10941 vec_vsr(vector
unsigned int __a
, vector
unsigned int __b
) {
10942 return (vector
unsigned int)__builtin_altivec_vsr((vector
int)__a
,
10946 static __inline__ vector
bool int __ATTRS_o_ai
10947 vec_vsr(vector
bool int __a
, vector
unsigned char __b
) {
10948 return (vector
bool int)__builtin_altivec_vsr((vector
int)__a
,
10952 static __inline__ vector
bool int __ATTRS_o_ai
10953 vec_vsr(vector
bool int __a
, vector
unsigned short __b
) {
10954 return (vector
bool int)__builtin_altivec_vsr((vector
int)__a
,
10958 static __inline__ vector
bool int __ATTRS_o_ai
10959 vec_vsr(vector
bool int __a
, vector
unsigned int __b
) {
10960 return (vector
bool int)__builtin_altivec_vsr((vector
int)__a
,
10966 static __inline__ vector
signed char __ATTRS_o_ai
10967 vec_sro(vector
signed char __a
, vector
signed char __b
) {
10968 return (vector
signed char)__builtin_altivec_vsro((vector
int)__a
,
10972 static __inline__ vector
signed char __ATTRS_o_ai
10973 vec_sro(vector
signed char __a
, vector
unsigned char __b
) {
10974 return (vector
signed char)__builtin_altivec_vsro((vector
int)__a
,
10978 static __inline__ vector
unsigned char __ATTRS_o_ai
10979 vec_sro(vector
unsigned char __a
, vector
signed char __b
) {
10980 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)__a
,
10984 static __inline__ vector
unsigned char __ATTRS_o_ai
10985 vec_sro(vector
unsigned char __a
, vector
unsigned char __b
) {
10986 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)__a
,
10990 static __inline__ vector
short __ATTRS_o_ai
vec_sro(vector
short __a
,
10991 vector
signed char __b
) {
10992 return (vector
short)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
10995 static __inline__ vector
short __ATTRS_o_ai
vec_sro(vector
short __a
,
10996 vector
unsigned char __b
) {
10997 return (vector
short)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11000 static __inline__ vector
unsigned short __ATTRS_o_ai
11001 vec_sro(vector
unsigned short __a
, vector
signed char __b
) {
11002 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)__a
,
11006 static __inline__ vector
unsigned short __ATTRS_o_ai
11007 vec_sro(vector
unsigned short __a
, vector
unsigned char __b
) {
11008 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)__a
,
11012 static __inline__ vector pixel __ATTRS_o_ai
vec_sro(vector pixel __a
,
11013 vector
signed char __b
) {
11014 return (vector pixel
)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11017 static __inline__ vector pixel __ATTRS_o_ai
vec_sro(vector pixel __a
,
11018 vector
unsigned char __b
) {
11019 return (vector pixel
)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11022 static __inline__ vector
int __ATTRS_o_ai
vec_sro(vector
int __a
,
11023 vector
signed char __b
) {
11024 return (vector
int)__builtin_altivec_vsro(__a
, (vector
int)__b
);
11027 static __inline__ vector
int __ATTRS_o_ai
vec_sro(vector
int __a
,
11028 vector
unsigned char __b
) {
11029 return (vector
int)__builtin_altivec_vsro(__a
, (vector
int)__b
);
11032 static __inline__ vector
unsigned int __ATTRS_o_ai
11033 vec_sro(vector
unsigned int __a
, vector
signed char __b
) {
11034 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)__a
,
11038 static __inline__ vector
unsigned int __ATTRS_o_ai
11039 vec_sro(vector
unsigned int __a
, vector
unsigned char __b
) {
11040 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)__a
,
11044 static __inline__ vector
float __ATTRS_o_ai
vec_sro(vector
float __a
,
11045 vector
signed char __b
) {
11046 return (vector
float)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11049 static __inline__ vector
float __ATTRS_o_ai
vec_sro(vector
float __a
,
11050 vector
unsigned char __b
) {
11051 return (vector
float)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11055 static __inline__ vector
signed long long __ATTRS_o_ai
11056 vec_sro(vector
signed long long __a
, vector
signed char __b
) {
11057 return (vector
signed long long)__builtin_altivec_vsro((vector
int)__a
,
11061 static __inline__ vector
signed long long __ATTRS_o_ai
11062 vec_sro(vector
signed long long __a
, vector
unsigned char __b
) {
11063 return (vector
signed long long)__builtin_altivec_vsro((vector
int)__a
,
11067 static __inline__ vector
unsigned long long __ATTRS_o_ai
11068 vec_sro(vector
unsigned long long __a
, vector
signed char __b
) {
11069 return (vector
unsigned long long)__builtin_altivec_vsro((vector
int)__a
,
11073 static __inline__ vector
unsigned long long __ATTRS_o_ai
11074 vec_sro(vector
unsigned long long __a
, vector
unsigned char __b
) {
11075 return (vector
unsigned long long)__builtin_altivec_vsro((vector
int)__a
,
11082 static __inline__ vector
signed char __ATTRS_o_ai
11083 vec_vsro(vector
signed char __a
, vector
signed char __b
) {
11084 return (vector
signed char)__builtin_altivec_vsro((vector
int)__a
,
11088 static __inline__ vector
signed char __ATTRS_o_ai
11089 vec_vsro(vector
signed char __a
, vector
unsigned char __b
) {
11090 return (vector
signed char)__builtin_altivec_vsro((vector
int)__a
,
11094 static __inline__ vector
unsigned char __ATTRS_o_ai
11095 vec_vsro(vector
unsigned char __a
, vector
signed char __b
) {
11096 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)__a
,
11100 static __inline__ vector
unsigned char __ATTRS_o_ai
11101 vec_vsro(vector
unsigned char __a
, vector
unsigned char __b
) {
11102 return (vector
unsigned char)__builtin_altivec_vsro((vector
int)__a
,
11106 static __inline__ vector
short __ATTRS_o_ai
vec_vsro(vector
short __a
,
11107 vector
signed char __b
) {
11108 return (vector
short)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11111 static __inline__ vector
short __ATTRS_o_ai
vec_vsro(vector
short __a
,
11112 vector
unsigned char __b
) {
11113 return (vector
short)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11116 static __inline__ vector
unsigned short __ATTRS_o_ai
11117 vec_vsro(vector
unsigned short __a
, vector
signed char __b
) {
11118 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)__a
,
11122 static __inline__ vector
unsigned short __ATTRS_o_ai
11123 vec_vsro(vector
unsigned short __a
, vector
unsigned char __b
) {
11124 return (vector
unsigned short)__builtin_altivec_vsro((vector
int)__a
,
11128 static __inline__ vector pixel __ATTRS_o_ai
vec_vsro(vector pixel __a
,
11129 vector
signed char __b
) {
11130 return (vector pixel
)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11133 static __inline__ vector pixel __ATTRS_o_ai
vec_vsro(vector pixel __a
,
11134 vector
unsigned char __b
) {
11135 return (vector pixel
)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11138 static __inline__ vector
int __ATTRS_o_ai
vec_vsro(vector
int __a
,
11139 vector
signed char __b
) {
11140 return (vector
int)__builtin_altivec_vsro(__a
, (vector
int)__b
);
11143 static __inline__ vector
int __ATTRS_o_ai
vec_vsro(vector
int __a
,
11144 vector
unsigned char __b
) {
11145 return (vector
int)__builtin_altivec_vsro(__a
, (vector
int)__b
);
11148 static __inline__ vector
unsigned int __ATTRS_o_ai
11149 vec_vsro(vector
unsigned int __a
, vector
signed char __b
) {
11150 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)__a
,
11154 static __inline__ vector
unsigned int __ATTRS_o_ai
11155 vec_vsro(vector
unsigned int __a
, vector
unsigned char __b
) {
11156 return (vector
unsigned int)__builtin_altivec_vsro((vector
int)__a
,
11160 static __inline__ vector
float __ATTRS_o_ai
vec_vsro(vector
float __a
,
11161 vector
signed char __b
) {
11162 return (vector
float)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11165 static __inline__ vector
float __ATTRS_o_ai
vec_vsro(vector
float __a
,
11166 vector
unsigned char __b
) {
11167 return (vector
float)__builtin_altivec_vsro((vector
int)__a
, (vector
int)__b
);
11172 static __inline__
void __ATTRS_o_ai
vec_st(vector
signed char __a
, long __b
,
11173 vector
signed char *__c
) {
11174 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11177 static __inline__
void __ATTRS_o_ai
vec_st(vector
signed char __a
, long __b
,
11178 signed char *__c
) {
11179 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11182 static __inline__
void __ATTRS_o_ai
vec_st(vector
unsigned char __a
, long __b
,
11183 vector
unsigned char *__c
) {
11184 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11187 static __inline__
void __ATTRS_o_ai
vec_st(vector
unsigned char __a
, long __b
,
11188 unsigned char *__c
) {
11189 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11192 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool char __a
, long __b
,
11193 signed char *__c
) {
11194 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11197 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool char __a
, long __b
,
11198 unsigned char *__c
) {
11199 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11202 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool char __a
, long __b
,
11203 vector
bool char *__c
) {
11204 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11207 static __inline__
void __ATTRS_o_ai
vec_st(vector
short __a
, long __b
,
11208 vector
short *__c
) {
11209 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11212 static __inline__
void __ATTRS_o_ai
vec_st(vector
short __a
, long __b
,
11214 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11217 static __inline__
void __ATTRS_o_ai
vec_st(vector
unsigned short __a
, long __b
,
11218 vector
unsigned short *__c
) {
11219 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11222 static __inline__
void __ATTRS_o_ai
vec_st(vector
unsigned short __a
, long __b
,
11223 unsigned short *__c
) {
11224 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11227 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool short __a
, long __b
,
11229 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11232 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool short __a
, long __b
,
11233 unsigned short *__c
) {
11234 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11237 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool short __a
, long __b
,
11238 vector
bool short *__c
) {
11239 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11242 static __inline__
void __ATTRS_o_ai
vec_st(vector pixel __a
, long __b
,
11244 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11247 static __inline__
void __ATTRS_o_ai
vec_st(vector pixel __a
, long __b
,
11248 unsigned short *__c
) {
11249 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11252 static __inline__
void __ATTRS_o_ai
vec_st(vector pixel __a
, long __b
,
11253 vector pixel
*__c
) {
11254 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11257 static __inline__
void __ATTRS_o_ai
vec_st(vector
int __a
, long __b
,
11259 __builtin_altivec_stvx(__a
, __b
, __c
);
11262 static __inline__
void __ATTRS_o_ai
vec_st(vector
int __a
, long __b
, int *__c
) {
11263 __builtin_altivec_stvx(__a
, __b
, __c
);
11266 static __inline__
void __ATTRS_o_ai
vec_st(vector
unsigned int __a
, long __b
,
11267 vector
unsigned int *__c
) {
11268 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11271 static __inline__
void __ATTRS_o_ai
vec_st(vector
unsigned int __a
, long __b
,
11272 unsigned int *__c
) {
11273 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11276 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool int __a
, long __b
,
11278 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11281 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool int __a
, long __b
,
11282 unsigned int *__c
) {
11283 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11286 static __inline__
void __ATTRS_o_ai
vec_st(vector
bool int __a
, long __b
,
11287 vector
bool int *__c
) {
11288 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11291 static __inline__
void __ATTRS_o_ai
vec_st(vector
float __a
, long __b
,
11292 vector
float *__c
) {
11293 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11296 static __inline__
void __ATTRS_o_ai
vec_st(vector
float __a
, long __b
,
11298 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11303 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
signed char __a
, long __b
,
11304 vector
signed char *__c
) {
11305 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11308 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
signed char __a
, long __b
,
11309 signed char *__c
) {
11310 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11313 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
unsigned char __a
, long __b
,
11314 vector
unsigned char *__c
) {
11315 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11318 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
unsigned char __a
, long __b
,
11319 unsigned char *__c
) {
11320 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11323 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool char __a
, long __b
,
11324 signed char *__c
) {
11325 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11328 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool char __a
, long __b
,
11329 unsigned char *__c
) {
11330 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11333 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool char __a
, long __b
,
11334 vector
bool char *__c
) {
11335 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11338 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
short __a
, long __b
,
11339 vector
short *__c
) {
11340 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11343 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
short __a
, long __b
,
11345 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11348 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
unsigned short __a
, long __b
,
11349 vector
unsigned short *__c
) {
11350 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11353 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
unsigned short __a
, long __b
,
11354 unsigned short *__c
) {
11355 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11358 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool short __a
, long __b
,
11360 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11363 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool short __a
, long __b
,
11364 unsigned short *__c
) {
11365 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11368 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool short __a
, long __b
,
11369 vector
bool short *__c
) {
11370 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11373 static __inline__
void __ATTRS_o_ai
vec_stvx(vector pixel __a
, long __b
,
11375 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11378 static __inline__
void __ATTRS_o_ai
vec_stvx(vector pixel __a
, long __b
,
11379 unsigned short *__c
) {
11380 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11383 static __inline__
void __ATTRS_o_ai
vec_stvx(vector pixel __a
, long __b
,
11384 vector pixel
*__c
) {
11385 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11388 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
int __a
, long __b
,
11390 __builtin_altivec_stvx(__a
, __b
, __c
);
11393 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
int __a
, long __b
,
11395 __builtin_altivec_stvx(__a
, __b
, __c
);
11398 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
unsigned int __a
, long __b
,
11399 vector
unsigned int *__c
) {
11400 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11403 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
unsigned int __a
, long __b
,
11404 unsigned int *__c
) {
11405 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11408 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool int __a
, long __b
,
11410 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11413 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool int __a
, long __b
,
11414 unsigned int *__c
) {
11415 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11418 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
bool int __a
, long __b
,
11419 vector
bool int *__c
) {
11420 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11423 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
float __a
, long __b
,
11424 vector
float *__c
) {
11425 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11428 static __inline__
void __ATTRS_o_ai
vec_stvx(vector
float __a
, long __b
,
11430 __builtin_altivec_stvx((vector
int)__a
, __b
, __c
);
11435 static __inline__
void __ATTRS_o_ai
vec_ste(vector
signed char __a
, long __b
,
11436 signed char *__c
) {
11437 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11440 static __inline__
void __ATTRS_o_ai
vec_ste(vector
unsigned char __a
, long __b
,
11441 unsigned char *__c
) {
11442 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11445 static __inline__
void __ATTRS_o_ai
vec_ste(vector
bool char __a
, long __b
,
11446 signed char *__c
) {
11447 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11450 static __inline__
void __ATTRS_o_ai
vec_ste(vector
bool char __a
, long __b
,
11451 unsigned char *__c
) {
11452 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11455 static __inline__
void __ATTRS_o_ai
vec_ste(vector
short __a
, long __b
,
11457 __builtin_altivec_stvehx(__a
, __b
, __c
);
11460 static __inline__
void __ATTRS_o_ai
vec_ste(vector
unsigned short __a
, long __b
,
11461 unsigned short *__c
) {
11462 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11465 static __inline__
void __ATTRS_o_ai
vec_ste(vector
bool short __a
, long __b
,
11467 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11470 static __inline__
void __ATTRS_o_ai
vec_ste(vector
bool short __a
, long __b
,
11471 unsigned short *__c
) {
11472 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11475 static __inline__
void __ATTRS_o_ai
vec_ste(vector pixel __a
, long __b
,
11477 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11480 static __inline__
void __ATTRS_o_ai
vec_ste(vector pixel __a
, long __b
,
11481 unsigned short *__c
) {
11482 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11485 static __inline__
void __ATTRS_o_ai
vec_ste(vector
int __a
, long __b
, int *__c
) {
11486 __builtin_altivec_stvewx(__a
, __b
, __c
);
11489 static __inline__
void __ATTRS_o_ai
vec_ste(vector
unsigned int __a
, long __b
,
11490 unsigned int *__c
) {
11491 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11494 static __inline__
void __ATTRS_o_ai
vec_ste(vector
bool int __a
, long __b
,
11496 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11499 static __inline__
void __ATTRS_o_ai
vec_ste(vector
bool 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_ste(vector
float __a
, long __b
,
11506 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11511 static __inline__
void __ATTRS_o_ai
vec_stvebx(vector
signed char __a
, long __b
,
11512 signed char *__c
) {
11513 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11516 static __inline__
void __ATTRS_o_ai
vec_stvebx(vector
unsigned char __a
,
11517 long __b
, unsigned char *__c
) {
11518 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11521 static __inline__
void __ATTRS_o_ai
vec_stvebx(vector
bool char __a
, long __b
,
11522 signed char *__c
) {
11523 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11526 static __inline__
void __ATTRS_o_ai
vec_stvebx(vector
bool char __a
, long __b
,
11527 unsigned char *__c
) {
11528 __builtin_altivec_stvebx((vector
char)__a
, __b
, __c
);
11533 static __inline__
void __ATTRS_o_ai
vec_stvehx(vector
short __a
, long __b
,
11535 __builtin_altivec_stvehx(__a
, __b
, __c
);
11538 static __inline__
void __ATTRS_o_ai
vec_stvehx(vector
unsigned short __a
,
11539 long __b
, unsigned short *__c
) {
11540 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11543 static __inline__
void __ATTRS_o_ai
vec_stvehx(vector
bool short __a
, long __b
,
11545 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11548 static __inline__
void __ATTRS_o_ai
vec_stvehx(vector
bool short __a
, long __b
,
11549 unsigned short *__c
) {
11550 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11553 static __inline__
void __ATTRS_o_ai
vec_stvehx(vector pixel __a
, long __b
,
11555 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11558 static __inline__
void __ATTRS_o_ai
vec_stvehx(vector pixel __a
, long __b
,
11559 unsigned short *__c
) {
11560 __builtin_altivec_stvehx((vector
short)__a
, __b
, __c
);
11565 static __inline__
void __ATTRS_o_ai
vec_stvewx(vector
int __a
, long __b
,
11567 __builtin_altivec_stvewx(__a
, __b
, __c
);
11570 static __inline__
void __ATTRS_o_ai
vec_stvewx(vector
unsigned int __a
, long __b
,
11571 unsigned int *__c
) {
11572 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11575 static __inline__
void __ATTRS_o_ai
vec_stvewx(vector
bool int __a
, long __b
,
11577 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11580 static __inline__
void __ATTRS_o_ai
vec_stvewx(vector
bool int __a
, long __b
,
11581 unsigned int *__c
) {
11582 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11585 static __inline__
void __ATTRS_o_ai
vec_stvewx(vector
float __a
, long __b
,
11587 __builtin_altivec_stvewx((vector
int)__a
, __b
, __c
);
11592 static __inline__
void __ATTRS_o_ai
vec_stl(vector
signed char __a
, int __b
,
11593 vector
signed char *__c
) {
11594 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11597 static __inline__
void __ATTRS_o_ai
vec_stl(vector
signed char __a
, int __b
,
11598 signed char *__c
) {
11599 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11602 static __inline__
void __ATTRS_o_ai
vec_stl(vector
unsigned char __a
, int __b
,
11603 vector
unsigned char *__c
) {
11604 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11607 static __inline__
void __ATTRS_o_ai
vec_stl(vector
unsigned char __a
, int __b
,
11608 unsigned char *__c
) {
11609 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11612 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool char __a
, int __b
,
11613 signed char *__c
) {
11614 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11617 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool char __a
, int __b
,
11618 unsigned char *__c
) {
11619 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11622 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool char __a
, int __b
,
11623 vector
bool char *__c
) {
11624 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11627 static __inline__
void __ATTRS_o_ai
vec_stl(vector
short __a
, int __b
,
11628 vector
short *__c
) {
11629 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11632 static __inline__
void __ATTRS_o_ai
vec_stl(vector
short __a
, int __b
,
11634 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11637 static __inline__
void __ATTRS_o_ai
vec_stl(vector
unsigned short __a
, int __b
,
11638 vector
unsigned short *__c
) {
11639 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11642 static __inline__
void __ATTRS_o_ai
vec_stl(vector
unsigned short __a
, int __b
,
11643 unsigned short *__c
) {
11644 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11647 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool short __a
, int __b
,
11649 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11652 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool short __a
, int __b
,
11653 unsigned short *__c
) {
11654 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11657 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool short __a
, int __b
,
11658 vector
bool short *__c
) {
11659 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11662 static __inline__
void __ATTRS_o_ai
vec_stl(vector pixel __a
, int __b
,
11664 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11667 static __inline__
void __ATTRS_o_ai
vec_stl(vector pixel __a
, int __b
,
11668 unsigned short *__c
) {
11669 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11672 static __inline__
void __ATTRS_o_ai
vec_stl(vector pixel __a
, int __b
,
11673 vector pixel
*__c
) {
11674 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11677 static __inline__
void __ATTRS_o_ai
vec_stl(vector
int __a
, int __b
,
11679 __builtin_altivec_stvxl(__a
, __b
, __c
);
11682 static __inline__
void __ATTRS_o_ai
vec_stl(vector
int __a
, int __b
, int *__c
) {
11683 __builtin_altivec_stvxl(__a
, __b
, __c
);
11686 static __inline__
void __ATTRS_o_ai
vec_stl(vector
unsigned int __a
, int __b
,
11687 vector
unsigned int *__c
) {
11688 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11691 static __inline__
void __ATTRS_o_ai
vec_stl(vector
unsigned int __a
, int __b
,
11692 unsigned int *__c
) {
11693 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11696 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool int __a
, int __b
,
11698 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11701 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool int __a
, int __b
,
11702 unsigned int *__c
) {
11703 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11706 static __inline__
void __ATTRS_o_ai
vec_stl(vector
bool int __a
, int __b
,
11707 vector
bool int *__c
) {
11708 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11711 static __inline__
void __ATTRS_o_ai
vec_stl(vector
float __a
, int __b
,
11712 vector
float *__c
) {
11713 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11716 static __inline__
void __ATTRS_o_ai
vec_stl(vector
float __a
, int __b
,
11718 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11723 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
signed char __a
, int __b
,
11724 vector
signed char *__c
) {
11725 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11728 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
signed char __a
, int __b
,
11729 signed char *__c
) {
11730 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11733 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
unsigned char __a
, int __b
,
11734 vector
unsigned char *__c
) {
11735 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11738 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
unsigned char __a
, int __b
,
11739 unsigned char *__c
) {
11740 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11743 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool char __a
, int __b
,
11744 signed char *__c
) {
11745 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11748 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool char __a
, int __b
,
11749 unsigned char *__c
) {
11750 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11753 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool char __a
, int __b
,
11754 vector
bool char *__c
) {
11755 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11758 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
short __a
, int __b
,
11759 vector
short *__c
) {
11760 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11763 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
short __a
, int __b
,
11765 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11768 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
unsigned short __a
,
11770 vector
unsigned short *__c
) {
11771 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11774 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
unsigned short __a
,
11775 int __b
, unsigned short *__c
) {
11776 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11779 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool short __a
, int __b
,
11781 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11784 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool short __a
, int __b
,
11785 unsigned short *__c
) {
11786 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11789 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool short __a
, int __b
,
11790 vector
bool short *__c
) {
11791 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11794 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector pixel __a
, int __b
,
11796 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11799 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector pixel __a
, int __b
,
11800 unsigned short *__c
) {
11801 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11804 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector pixel __a
, int __b
,
11805 vector pixel
*__c
) {
11806 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11809 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
int __a
, int __b
,
11811 __builtin_altivec_stvxl(__a
, __b
, __c
);
11814 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
int __a
, int __b
,
11816 __builtin_altivec_stvxl(__a
, __b
, __c
);
11819 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
unsigned int __a
, int __b
,
11820 vector
unsigned int *__c
) {
11821 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11824 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
unsigned int __a
, int __b
,
11825 unsigned int *__c
) {
11826 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11829 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool int __a
, int __b
,
11831 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11834 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool int __a
, int __b
,
11835 unsigned int *__c
) {
11836 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11839 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
bool int __a
, int __b
,
11840 vector
bool int *__c
) {
11841 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11844 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
float __a
, int __b
,
11845 vector
float *__c
) {
11846 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11849 static __inline__
void __ATTRS_o_ai
vec_stvxl(vector
float __a
, int __b
,
11851 __builtin_altivec_stvxl((vector
int)__a
, __b
, __c
);
11856 static __inline__ vector
signed char __ATTRS_o_ai
11857 vec_sub(vector
signed char __a
, vector
signed char __b
) {
11861 static __inline__ vector
signed char __ATTRS_o_ai
11862 vec_sub(vector
bool char __a
, vector
signed char __b
) {
11863 return (vector
signed char)__a
- __b
;
11866 static __inline__ vector
signed char __ATTRS_o_ai
11867 vec_sub(vector
signed char __a
, vector
bool char __b
) {
11868 return __a
- (vector
signed char)__b
;
11871 static __inline__ vector
unsigned char __ATTRS_o_ai
11872 vec_sub(vector
unsigned char __a
, vector
unsigned char __b
) {
11876 static __inline__ vector
unsigned char __ATTRS_o_ai
11877 vec_sub(vector
bool char __a
, vector
unsigned char __b
) {
11878 return (vector
unsigned char)__a
- __b
;
11881 static __inline__ vector
unsigned char __ATTRS_o_ai
11882 vec_sub(vector
unsigned char __a
, vector
bool char __b
) {
11883 return __a
- (vector
unsigned char)__b
;
11886 static __inline__ vector
short __ATTRS_o_ai
vec_sub(vector
short __a
,
11887 vector
short __b
) {
11891 static __inline__ vector
short __ATTRS_o_ai
vec_sub(vector
bool short __a
,
11892 vector
short __b
) {
11893 return (vector
short)__a
- __b
;
11896 static __inline__ vector
short __ATTRS_o_ai
vec_sub(vector
short __a
,
11897 vector
bool short __b
) {
11898 return __a
- (vector
short)__b
;
11901 static __inline__ vector
unsigned short __ATTRS_o_ai
11902 vec_sub(vector
unsigned short __a
, vector
unsigned short __b
) {
11906 static __inline__ vector
unsigned short __ATTRS_o_ai
11907 vec_sub(vector
bool short __a
, vector
unsigned short __b
) {
11908 return (vector
unsigned short)__a
- __b
;
11911 static __inline__ vector
unsigned short __ATTRS_o_ai
11912 vec_sub(vector
unsigned short __a
, vector
bool short __b
) {
11913 return __a
- (vector
unsigned short)__b
;
11916 static __inline__ vector
int __ATTRS_o_ai
vec_sub(vector
int __a
,
11921 static __inline__ vector
int __ATTRS_o_ai
vec_sub(vector
bool int __a
,
11923 return (vector
int)__a
- __b
;
11926 static __inline__ vector
int __ATTRS_o_ai
vec_sub(vector
int __a
,
11927 vector
bool int __b
) {
11928 return __a
- (vector
int)__b
;
11931 static __inline__ vector
unsigned int __ATTRS_o_ai
11932 vec_sub(vector
unsigned int __a
, vector
unsigned int __b
) {
11936 static __inline__ vector
unsigned int __ATTRS_o_ai
11937 vec_sub(vector
bool int __a
, vector
unsigned int __b
) {
11938 return (vector
unsigned int)__a
- __b
;
11941 static __inline__ vector
unsigned int __ATTRS_o_ai
11942 vec_sub(vector
unsigned int __a
, vector
bool int __b
) {
11943 return __a
- (vector
unsigned int)__b
;
11946 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
11947 defined(__SIZEOF_INT128__)
11948 static __inline__ vector
signed __int128 __ATTRS_o_ai
11949 vec_sub(vector
signed __int128 __a
, vector
signed __int128 __b
) {
11953 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
11954 vec_sub(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
11957 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&
11958 // defined(__SIZEOF_INT128__)
11961 static __inline__ vector
signed long long __ATTRS_o_ai
11962 vec_sub(vector
signed long long __a
, vector
signed long long __b
) {
11966 static __inline__ vector
unsigned long long __ATTRS_o_ai
11967 vec_sub(vector
unsigned long long __a
, vector
unsigned long long __b
) {
11971 static __inline__ vector
double __ATTRS_o_ai
vec_sub(vector
double __a
,
11972 vector
double __b
) {
11977 static __inline__ vector
float __ATTRS_o_ai
vec_sub(vector
float __a
,
11978 vector
float __b
) {
11984 #define __builtin_altivec_vsububm vec_vsububm
11986 static __inline__ vector
signed char __ATTRS_o_ai
11987 vec_vsububm(vector
signed char __a
, vector
signed char __b
) {
11991 static __inline__ vector
signed char __ATTRS_o_ai
11992 vec_vsububm(vector
bool char __a
, vector
signed char __b
) {
11993 return (vector
signed char)__a
- __b
;
11996 static __inline__ vector
signed char __ATTRS_o_ai
11997 vec_vsububm(vector
signed char __a
, vector
bool char __b
) {
11998 return __a
- (vector
signed char)__b
;
12001 static __inline__ vector
unsigned char __ATTRS_o_ai
12002 vec_vsububm(vector
unsigned char __a
, vector
unsigned char __b
) {
12006 static __inline__ vector
unsigned char __ATTRS_o_ai
12007 vec_vsububm(vector
bool char __a
, vector
unsigned char __b
) {
12008 return (vector
unsigned char)__a
- __b
;
12011 static __inline__ vector
unsigned char __ATTRS_o_ai
12012 vec_vsububm(vector
unsigned char __a
, vector
bool char __b
) {
12013 return __a
- (vector
unsigned char)__b
;
12018 #define __builtin_altivec_vsubuhm vec_vsubuhm
12020 static __inline__ vector
short __ATTRS_o_ai
vec_vsubuhm(vector
short __a
,
12021 vector
short __b
) {
12025 static __inline__ vector
short __ATTRS_o_ai
vec_vsubuhm(vector
bool short __a
,
12026 vector
short __b
) {
12027 return (vector
short)__a
- __b
;
12030 static __inline__ vector
short __ATTRS_o_ai
vec_vsubuhm(vector
short __a
,
12031 vector
bool short __b
) {
12032 return __a
- (vector
short)__b
;
12035 static __inline__ vector
unsigned short __ATTRS_o_ai
12036 vec_vsubuhm(vector
unsigned short __a
, vector
unsigned short __b
) {
12040 static __inline__ vector
unsigned short __ATTRS_o_ai
12041 vec_vsubuhm(vector
bool short __a
, vector
unsigned short __b
) {
12042 return (vector
unsigned short)__a
- __b
;
12045 static __inline__ vector
unsigned short __ATTRS_o_ai
12046 vec_vsubuhm(vector
unsigned short __a
, vector
bool short __b
) {
12047 return __a
- (vector
unsigned short)__b
;
12052 #define __builtin_altivec_vsubuwm vec_vsubuwm
12054 static __inline__ vector
int __ATTRS_o_ai
vec_vsubuwm(vector
int __a
,
12059 static __inline__ vector
int __ATTRS_o_ai
vec_vsubuwm(vector
bool int __a
,
12061 return (vector
int)__a
- __b
;
12064 static __inline__ vector
int __ATTRS_o_ai
vec_vsubuwm(vector
int __a
,
12065 vector
bool int __b
) {
12066 return __a
- (vector
int)__b
;
12069 static __inline__ vector
unsigned int __ATTRS_o_ai
12070 vec_vsubuwm(vector
unsigned int __a
, vector
unsigned int __b
) {
12074 static __inline__ vector
unsigned int __ATTRS_o_ai
12075 vec_vsubuwm(vector
bool int __a
, vector
unsigned int __b
) {
12076 return (vector
unsigned int)__a
- __b
;
12079 static __inline__ vector
unsigned int __ATTRS_o_ai
12080 vec_vsubuwm(vector
unsigned int __a
, vector
bool int __b
) {
12081 return __a
- (vector
unsigned int)__b
;
12086 #define __builtin_altivec_vsubfp vec_vsubfp
12088 static __inline__ vector
float __attribute__((__always_inline__
))
12089 vec_vsubfp(vector
float __a
, vector
float __b
) {
12095 static __inline__ vector
signed int __ATTRS_o_ai
12096 vec_subc(vector
signed int __a
, vector
signed int __b
) {
12097 return (vector
signed int)__builtin_altivec_vsubcuw((vector
unsigned int)__a
,
12098 (vector
unsigned int) __b
);
12101 static __inline__ vector
unsigned int __ATTRS_o_ai
12102 vec_subc(vector
unsigned int __a
, vector
unsigned int __b
) {
12103 return __builtin_altivec_vsubcuw(__a
, __b
);
12106 #ifdef __POWER8_VECTOR__
12107 #ifdef __SIZEOF_INT128__
12108 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12109 vec_subc(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
12110 return __builtin_altivec_vsubcuq(__a
, __b
);
12113 static __inline__ vector
signed __int128 __ATTRS_o_ai
12114 vec_subc(vector
signed __int128 __a
, vector
signed __int128 __b
) {
12115 return (vector
signed __int128
)__builtin_altivec_vsubcuq(
12116 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
12120 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
12121 vec_subc_u128(vector
unsigned char __a
, vector
unsigned char __b
) {
12122 return (vector
unsigned char)__builtin_altivec_vsubcuq_c(
12123 (vector
unsigned char)__a
, (vector
unsigned char)__b
);
12125 #endif // __POWER8_VECTOR__
12129 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
12130 vec_vsubcuw(vector
unsigned int __a
, vector
unsigned int __b
) {
12131 return __builtin_altivec_vsubcuw(__a
, __b
);
12136 static __inline__ vector
signed char __ATTRS_o_ai
12137 vec_subs(vector
signed char __a
, vector
signed char __b
) {
12138 return __builtin_altivec_vsubsbs(__a
, __b
);
12141 static __inline__ vector
signed char __ATTRS_o_ai
12142 vec_subs(vector
bool char __a
, vector
signed char __b
) {
12143 return __builtin_altivec_vsubsbs((vector
signed char)__a
, __b
);
12146 static __inline__ vector
signed char __ATTRS_o_ai
12147 vec_subs(vector
signed char __a
, vector
bool char __b
) {
12148 return __builtin_altivec_vsubsbs(__a
, (vector
signed char)__b
);
12151 static __inline__ vector
unsigned char __ATTRS_o_ai
12152 vec_subs(vector
unsigned char __a
, vector
unsigned char __b
) {
12153 return __builtin_altivec_vsububs(__a
, __b
);
12156 static __inline__ vector
unsigned char __ATTRS_o_ai
12157 vec_subs(vector
bool char __a
, vector
unsigned char __b
) {
12158 return __builtin_altivec_vsububs((vector
unsigned char)__a
, __b
);
12161 static __inline__ vector
unsigned char __ATTRS_o_ai
12162 vec_subs(vector
unsigned char __a
, vector
bool char __b
) {
12163 return __builtin_altivec_vsububs(__a
, (vector
unsigned char)__b
);
12166 static __inline__ vector
short __ATTRS_o_ai
vec_subs(vector
short __a
,
12167 vector
short __b
) {
12168 return __builtin_altivec_vsubshs(__a
, __b
);
12171 static __inline__ vector
short __ATTRS_o_ai
vec_subs(vector
bool short __a
,
12172 vector
short __b
) {
12173 return __builtin_altivec_vsubshs((vector
short)__a
, __b
);
12176 static __inline__ vector
short __ATTRS_o_ai
vec_subs(vector
short __a
,
12177 vector
bool short __b
) {
12178 return __builtin_altivec_vsubshs(__a
, (vector
short)__b
);
12181 static __inline__ vector
unsigned short __ATTRS_o_ai
12182 vec_subs(vector
unsigned short __a
, vector
unsigned short __b
) {
12183 return __builtin_altivec_vsubuhs(__a
, __b
);
12186 static __inline__ vector
unsigned short __ATTRS_o_ai
12187 vec_subs(vector
bool short __a
, vector
unsigned short __b
) {
12188 return __builtin_altivec_vsubuhs((vector
unsigned short)__a
, __b
);
12191 static __inline__ vector
unsigned short __ATTRS_o_ai
12192 vec_subs(vector
unsigned short __a
, vector
bool short __b
) {
12193 return __builtin_altivec_vsubuhs(__a
, (vector
unsigned short)__b
);
12196 static __inline__ vector
int __ATTRS_o_ai
vec_subs(vector
int __a
,
12198 return __builtin_altivec_vsubsws(__a
, __b
);
12201 static __inline__ vector
int __ATTRS_o_ai
vec_subs(vector
bool int __a
,
12203 return __builtin_altivec_vsubsws((vector
int)__a
, __b
);
12206 static __inline__ vector
int __ATTRS_o_ai
vec_subs(vector
int __a
,
12207 vector
bool int __b
) {
12208 return __builtin_altivec_vsubsws(__a
, (vector
int)__b
);
12211 static __inline__ vector
unsigned int __ATTRS_o_ai
12212 vec_subs(vector
unsigned int __a
, vector
unsigned int __b
) {
12213 return __builtin_altivec_vsubuws(__a
, __b
);
12216 static __inline__ vector
unsigned int __ATTRS_o_ai
12217 vec_subs(vector
bool int __a
, vector
unsigned int __b
) {
12218 return __builtin_altivec_vsubuws((vector
unsigned int)__a
, __b
);
12221 static __inline__ vector
unsigned int __ATTRS_o_ai
12222 vec_subs(vector
unsigned int __a
, vector
bool int __b
) {
12223 return __builtin_altivec_vsubuws(__a
, (vector
unsigned int)__b
);
12228 static __inline__ vector
signed char __ATTRS_o_ai
12229 vec_vsubsbs(vector
signed char __a
, vector
signed char __b
) {
12230 return __builtin_altivec_vsubsbs(__a
, __b
);
12233 static __inline__ vector
signed char __ATTRS_o_ai
12234 vec_vsubsbs(vector
bool char __a
, vector
signed char __b
) {
12235 return __builtin_altivec_vsubsbs((vector
signed char)__a
, __b
);
12238 static __inline__ vector
signed char __ATTRS_o_ai
12239 vec_vsubsbs(vector
signed char __a
, vector
bool char __b
) {
12240 return __builtin_altivec_vsubsbs(__a
, (vector
signed char)__b
);
12245 static __inline__ vector
unsigned char __ATTRS_o_ai
12246 vec_vsububs(vector
unsigned char __a
, vector
unsigned char __b
) {
12247 return __builtin_altivec_vsububs(__a
, __b
);
12250 static __inline__ vector
unsigned char __ATTRS_o_ai
12251 vec_vsububs(vector
bool char __a
, vector
unsigned char __b
) {
12252 return __builtin_altivec_vsububs((vector
unsigned char)__a
, __b
);
12255 static __inline__ vector
unsigned char __ATTRS_o_ai
12256 vec_vsububs(vector
unsigned char __a
, vector
bool char __b
) {
12257 return __builtin_altivec_vsububs(__a
, (vector
unsigned char)__b
);
12262 static __inline__ vector
short __ATTRS_o_ai
vec_vsubshs(vector
short __a
,
12263 vector
short __b
) {
12264 return __builtin_altivec_vsubshs(__a
, __b
);
12267 static __inline__ vector
short __ATTRS_o_ai
vec_vsubshs(vector
bool short __a
,
12268 vector
short __b
) {
12269 return __builtin_altivec_vsubshs((vector
short)__a
, __b
);
12272 static __inline__ vector
short __ATTRS_o_ai
vec_vsubshs(vector
short __a
,
12273 vector
bool short __b
) {
12274 return __builtin_altivec_vsubshs(__a
, (vector
short)__b
);
12279 static __inline__ vector
unsigned short __ATTRS_o_ai
12280 vec_vsubuhs(vector
unsigned short __a
, vector
unsigned short __b
) {
12281 return __builtin_altivec_vsubuhs(__a
, __b
);
12284 static __inline__ vector
unsigned short __ATTRS_o_ai
12285 vec_vsubuhs(vector
bool short __a
, vector
unsigned short __b
) {
12286 return __builtin_altivec_vsubuhs((vector
unsigned short)__a
, __b
);
12289 static __inline__ vector
unsigned short __ATTRS_o_ai
12290 vec_vsubuhs(vector
unsigned short __a
, vector
bool short __b
) {
12291 return __builtin_altivec_vsubuhs(__a
, (vector
unsigned short)__b
);
12296 static __inline__ vector
int __ATTRS_o_ai
vec_vsubsws(vector
int __a
,
12298 return __builtin_altivec_vsubsws(__a
, __b
);
12301 static __inline__ vector
int __ATTRS_o_ai
vec_vsubsws(vector
bool int __a
,
12303 return __builtin_altivec_vsubsws((vector
int)__a
, __b
);
12306 static __inline__ vector
int __ATTRS_o_ai
vec_vsubsws(vector
int __a
,
12307 vector
bool int __b
) {
12308 return __builtin_altivec_vsubsws(__a
, (vector
int)__b
);
12313 static __inline__ vector
unsigned int __ATTRS_o_ai
12314 vec_vsubuws(vector
unsigned int __a
, vector
unsigned int __b
) {
12315 return __builtin_altivec_vsubuws(__a
, __b
);
12318 static __inline__ vector
unsigned int __ATTRS_o_ai
12319 vec_vsubuws(vector
bool int __a
, vector
unsigned int __b
) {
12320 return __builtin_altivec_vsubuws((vector
unsigned int)__a
, __b
);
12323 static __inline__ vector
unsigned int __ATTRS_o_ai
12324 vec_vsubuws(vector
unsigned int __a
, vector
bool int __b
) {
12325 return __builtin_altivec_vsubuws(__a
, (vector
unsigned int)__b
);
12328 #ifdef __POWER8_VECTOR__
12331 #ifdef __SIZEOF_INT128__
12332 static __inline__ vector
signed __int128 __ATTRS_o_ai
12333 vec_vsubuqm(vector
signed __int128 __a
, vector
signed __int128 __b
) {
12337 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12338 vec_vsubuqm(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
12343 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
12344 vec_sub_u128(vector
unsigned char __a
, vector
unsigned char __b
) {
12345 return (vector
unsigned char)__builtin_altivec_vsubuqm(__a
, __b
);
12350 #ifdef __SIZEOF_INT128__
12351 static __inline__ vector
signed __int128 __ATTRS_o_ai
12352 vec_vsubeuqm(vector
signed __int128 __a
, vector
signed __int128 __b
,
12353 vector
signed __int128 __c
) {
12354 return (vector
signed __int128
)__builtin_altivec_vsubeuqm(
12355 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
12356 (vector
unsigned __int128
)__c
);
12359 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12360 vec_vsubeuqm(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
12361 vector
unsigned __int128 __c
) {
12362 return __builtin_altivec_vsubeuqm(__a
, __b
, __c
);
12365 static __inline__ vector
signed __int128 __ATTRS_o_ai
12366 vec_sube(vector
signed __int128 __a
, vector
signed __int128 __b
,
12367 vector
signed __int128 __c
) {
12368 return (vector
signed __int128
)__builtin_altivec_vsubeuqm(
12369 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
12370 (vector
unsigned __int128
)__c
);
12373 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12374 vec_sube(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
12375 vector
unsigned __int128 __c
) {
12376 return __builtin_altivec_vsubeuqm(__a
, __b
, __c
);
12380 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
12381 vec_sube_u128(vector
unsigned char __a
, vector
unsigned char __b
,
12382 vector
unsigned char __c
) {
12383 return (vector
unsigned char)__builtin_altivec_vsubeuqm_c(
12384 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
12385 (vector
unsigned char)__c
);
12390 #ifdef __SIZEOF_INT128__
12391 static __inline__ vector
signed __int128 __ATTRS_o_ai
12392 vec_vsubcuq(vector
signed __int128 __a
, vector
signed __int128 __b
) {
12393 return (vector
signed __int128
)__builtin_altivec_vsubcuq(
12394 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
);
12397 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12398 vec_vsubcuq(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
12399 return __builtin_altivec_vsubcuq(__a
, __b
);
12404 static __inline__ vector
signed __int128 __ATTRS_o_ai
12405 vec_vsubecuq(vector
signed __int128 __a
, vector
signed __int128 __b
,
12406 vector
signed __int128 __c
) {
12407 return (vector
signed __int128
)__builtin_altivec_vsubecuq(
12408 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
12409 (vector
unsigned __int128
)__c
);
12412 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12413 vec_vsubecuq(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
12414 vector
unsigned __int128 __c
) {
12415 return __builtin_altivec_vsubecuq(__a
, __b
, __c
);
12419 #ifdef __powerpc64__
12420 static __inline__ vector
signed int __ATTRS_o_ai
12421 vec_subec(vector
signed int __a
, vector
signed int __b
,
12422 vector
signed int __c
) {
12423 return vec_addec(__a
, ~__b
, __c
);
12426 static __inline__ vector
unsigned int __ATTRS_o_ai
12427 vec_subec(vector
unsigned int __a
, vector
unsigned int __b
,
12428 vector
unsigned int __c
) {
12429 return vec_addec(__a
, ~__b
, __c
);
12433 #ifdef __SIZEOF_INT128__
12434 static __inline__ vector
signed __int128 __ATTRS_o_ai
12435 vec_subec(vector
signed __int128 __a
, vector
signed __int128 __b
,
12436 vector
signed __int128 __c
) {
12437 return (vector
signed __int128
)__builtin_altivec_vsubecuq(
12438 (vector
unsigned __int128
)__a
, (vector
unsigned __int128
)__b
,
12439 (vector
unsigned __int128
)__c
);
12442 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
12443 vec_subec(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
,
12444 vector
unsigned __int128 __c
) {
12445 return __builtin_altivec_vsubecuq(__a
, __b
, __c
);
12449 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
12450 vec_subec_u128(vector
unsigned char __a
, vector
unsigned char __b
,
12451 vector
unsigned char __c
) {
12452 return (vector
unsigned char)__builtin_altivec_vsubecuq_c(
12453 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
12454 (vector
unsigned char)__c
);
12456 #endif // __POWER8_VECTOR__
12458 static __inline__ vector
signed int __ATTRS_o_ai
12459 vec_sube(vector
signed int __a
, vector
signed int __b
,
12460 vector
signed int __c
) {
12461 vector
signed int __mask
= {1, 1, 1, 1};
12462 vector
signed int __carry
= __c
& __mask
;
12463 return vec_adde(__a
, ~__b
, __carry
);
12466 static __inline__ vector
unsigned int __ATTRS_o_ai
12467 vec_sube(vector
unsigned int __a
, vector
unsigned int __b
,
12468 vector
unsigned int __c
) {
12469 vector
unsigned int __mask
= {1, 1, 1, 1};
12470 vector
unsigned int __carry
= __c
& __mask
;
12471 return vec_adde(__a
, ~__b
, __carry
);
12475 static __inline__ vector
int __ATTRS_o_ai
vec_sum4s(vector
signed char __a
,
12477 return __builtin_altivec_vsum4sbs(__a
, __b
);
12480 static __inline__ vector
unsigned int __ATTRS_o_ai
12481 vec_sum4s(vector
unsigned char __a
, vector
unsigned int __b
) {
12482 return __builtin_altivec_vsum4ubs(__a
, __b
);
12485 static __inline__ vector
int __ATTRS_o_ai
vec_sum4s(vector
signed short __a
,
12487 return __builtin_altivec_vsum4shs(__a
, __b
);
12492 static __inline__ vector
int __attribute__((__always_inline__
))
12493 vec_vsum4sbs(vector
signed char __a
, vector
int __b
) {
12494 return __builtin_altivec_vsum4sbs(__a
, __b
);
12499 static __inline__ vector
unsigned int __attribute__((__always_inline__
))
12500 vec_vsum4ubs(vector
unsigned char __a
, vector
unsigned int __b
) {
12501 return __builtin_altivec_vsum4ubs(__a
, __b
);
12506 static __inline__ vector
int __attribute__((__always_inline__
))
12507 vec_vsum4shs(vector
signed short __a
, vector
int __b
) {
12508 return __builtin_altivec_vsum4shs(__a
, __b
);
12513 /* The vsum2sws instruction has a big-endian bias, so that the second
12514 input vector and the result always reference big-endian elements
12515 1 and 3 (little-endian element 0 and 2). For ease of porting the
12516 programmer wants elements 1 and 3 in both cases, so for little
12517 endian we must perform some permutes. */
12519 static __inline__ vector
signed int __attribute__((__always_inline__
))
12520 vec_sum2s(vector
int __a
, vector
int __b
) {
12521 #ifdef __LITTLE_ENDIAN__
12522 vector
int __c
= (vector
signed int)vec_perm(
12523 __b
, __b
, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12525 __c
= __builtin_altivec_vsum2sws(__a
, __c
);
12526 return (vector
signed int)vec_perm(
12527 __c
, __c
, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12530 return __builtin_altivec_vsum2sws(__a
, __b
);
12536 static __inline__ vector
signed int __attribute__((__always_inline__
))
12537 vec_vsum2sws(vector
int __a
, vector
int __b
) {
12538 #ifdef __LITTLE_ENDIAN__
12539 vector
int __c
= (vector
signed int)vec_perm(
12540 __b
, __b
, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12542 __c
= __builtin_altivec_vsum2sws(__a
, __c
);
12543 return (vector
signed int)vec_perm(
12544 __c
, __c
, (vector
unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12547 return __builtin_altivec_vsum2sws(__a
, __b
);
12553 /* The vsumsws instruction has a big-endian bias, so that the second
12554 input vector and the result always reference big-endian element 3
12555 (little-endian element 0). For ease of porting the programmer
12556 wants element 3 in both cases, so for little endian we must perform
12559 static __inline__ vector
signed int __attribute__((__always_inline__
))
12560 vec_sums(vector
signed int __a
, vector
signed int __b
) {
12561 #ifdef __LITTLE_ENDIAN__
12562 __b
= (vector
signed int)vec_splat(__b
, 3);
12563 __b
= __builtin_altivec_vsumsws(__a
, __b
);
12564 return (vector
signed int)(0, 0, 0, __b
[0]);
12566 return __builtin_altivec_vsumsws(__a
, __b
);
12572 static __inline__ vector
signed int __attribute__((__always_inline__
))
12573 vec_vsumsws(vector
signed int __a
, vector
signed int __b
) {
12574 #ifdef __LITTLE_ENDIAN__
12575 __b
= (vector
signed int)vec_splat(__b
, 3);
12576 __b
= __builtin_altivec_vsumsws(__a
, __b
);
12577 return (vector
signed int)(0, 0, 0, __b
[0]);
12579 return __builtin_altivec_vsumsws(__a
, __b
);
12585 static __inline__ vector
float __ATTRS_o_ai
vec_trunc(vector
float __a
) {
12587 return __builtin_vsx_xvrspiz(__a
);
12589 return __builtin_altivec_vrfiz(__a
);
12594 static __inline__ vector
double __ATTRS_o_ai
vec_trunc(vector
double __a
) {
12595 return __builtin_vsx_xvrdpiz(__a
);
12600 static __inline__ vector
float __ATTRS_o_ai
vec_roundz(vector
float __a
) {
12601 return vec_trunc(__a
);
12605 static __inline__ vector
double __ATTRS_o_ai
vec_roundz(vector
double __a
) {
12606 return vec_trunc(__a
);
12612 static __inline__ vector
float __attribute__((__always_inline__
))
12613 vec_vrfiz(vector
float __a
) {
12614 return __builtin_altivec_vrfiz(__a
);
12619 /* The vector unpack instructions all have a big-endian bias, so for
12620 little endian we must reverse the meanings of "high" and "low." */
12621 #ifdef __LITTLE_ENDIAN__
12622 #define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12623 #define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12625 #define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12626 #define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12629 static __inline__ vector
short __ATTRS_o_ai
12630 vec_unpackh(vector
signed char __a
) {
12631 #ifdef __LITTLE_ENDIAN__
12632 return __builtin_altivec_vupklsb((vector
char)__a
);
12634 return __builtin_altivec_vupkhsb((vector
char)__a
);
12638 static __inline__ vector
bool short __ATTRS_o_ai
12639 vec_unpackh(vector
bool char __a
) {
12640 #ifdef __LITTLE_ENDIAN__
12641 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)__a
);
12643 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)__a
);
12647 static __inline__ vector
int __ATTRS_o_ai
vec_unpackh(vector
short __a
) {
12648 #ifdef __LITTLE_ENDIAN__
12649 return __builtin_altivec_vupklsh(__a
);
12651 return __builtin_altivec_vupkhsh(__a
);
12655 static __inline__ vector
bool int __ATTRS_o_ai
12656 vec_unpackh(vector
bool short __a
) {
12657 #ifdef __LITTLE_ENDIAN__
12658 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)__a
);
12660 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)__a
);
12664 static __inline__ vector
unsigned int __ATTRS_o_ai
12665 vec_unpackh(vector pixel __a
) {
12666 #ifdef __LITTLE_ENDIAN__
12667 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)__a
);
12669 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)__a
);
12673 #ifdef __POWER8_VECTOR__
12674 static __inline__ vector
long long __ATTRS_o_ai
vec_unpackh(vector
int __a
) {
12675 #ifdef __LITTLE_ENDIAN__
12676 return __builtin_altivec_vupklsw(__a
);
12678 return __builtin_altivec_vupkhsw(__a
);
12682 static __inline__ vector
bool long long __ATTRS_o_ai
12683 vec_unpackh(vector
bool int __a
) {
12684 #ifdef __LITTLE_ENDIAN__
12685 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)__a
);
12687 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)__a
);
12691 static __inline__ vector
double __ATTRS_o_ai
12692 vec_unpackh(vector
float __a
) {
12693 return (vector
double)(__a
[0], __a
[1]);
12699 static __inline__ vector
short __ATTRS_o_ai
12700 vec_vupkhsb(vector
signed char __a
) {
12701 #ifdef __LITTLE_ENDIAN__
12702 return __builtin_altivec_vupklsb((vector
char)__a
);
12704 return __builtin_altivec_vupkhsb((vector
char)__a
);
12708 static __inline__ vector
bool short __ATTRS_o_ai
12709 vec_vupkhsb(vector
bool char __a
) {
12710 #ifdef __LITTLE_ENDIAN__
12711 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)__a
);
12713 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)__a
);
12719 static __inline__ vector
int __ATTRS_o_ai
vec_vupkhsh(vector
short __a
) {
12720 #ifdef __LITTLE_ENDIAN__
12721 return __builtin_altivec_vupklsh(__a
);
12723 return __builtin_altivec_vupkhsh(__a
);
12727 static __inline__ vector
bool int __ATTRS_o_ai
12728 vec_vupkhsh(vector
bool short __a
) {
12729 #ifdef __LITTLE_ENDIAN__
12730 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)__a
);
12732 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)__a
);
12736 static __inline__ vector
unsigned int __ATTRS_o_ai
12737 vec_vupkhsh(vector pixel __a
) {
12738 #ifdef __LITTLE_ENDIAN__
12739 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)__a
);
12741 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)__a
);
12747 #ifdef __POWER8_VECTOR__
12748 static __inline__ vector
long long __ATTRS_o_ai
vec_vupkhsw(vector
int __a
) {
12749 #ifdef __LITTLE_ENDIAN__
12750 return __builtin_altivec_vupklsw(__a
);
12752 return __builtin_altivec_vupkhsw(__a
);
12756 static __inline__ vector
bool long long __ATTRS_o_ai
12757 vec_vupkhsw(vector
bool int __a
) {
12758 #ifdef __LITTLE_ENDIAN__
12759 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)__a
);
12761 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)__a
);
12768 static __inline__ vector
short __ATTRS_o_ai
12769 vec_unpackl(vector
signed char __a
) {
12770 #ifdef __LITTLE_ENDIAN__
12771 return __builtin_altivec_vupkhsb((vector
char)__a
);
12773 return __builtin_altivec_vupklsb((vector
char)__a
);
12777 static __inline__ vector
bool short __ATTRS_o_ai
12778 vec_unpackl(vector
bool char __a
) {
12779 #ifdef __LITTLE_ENDIAN__
12780 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)__a
);
12782 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)__a
);
12786 static __inline__ vector
int __ATTRS_o_ai
vec_unpackl(vector
short __a
) {
12787 #ifdef __LITTLE_ENDIAN__
12788 return __builtin_altivec_vupkhsh(__a
);
12790 return __builtin_altivec_vupklsh(__a
);
12794 static __inline__ vector
bool int __ATTRS_o_ai
12795 vec_unpackl(vector
bool short __a
) {
12796 #ifdef __LITTLE_ENDIAN__
12797 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)__a
);
12799 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)__a
);
12803 static __inline__ vector
unsigned int __ATTRS_o_ai
12804 vec_unpackl(vector pixel __a
) {
12805 #ifdef __LITTLE_ENDIAN__
12806 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)__a
);
12808 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)__a
);
12812 #ifdef __POWER8_VECTOR__
12813 static __inline__ vector
long long __ATTRS_o_ai
vec_unpackl(vector
int __a
) {
12814 #ifdef __LITTLE_ENDIAN__
12815 return __builtin_altivec_vupkhsw(__a
);
12817 return __builtin_altivec_vupklsw(__a
);
12821 static __inline__ vector
bool long long __ATTRS_o_ai
12822 vec_unpackl(vector
bool int __a
) {
12823 #ifdef __LITTLE_ENDIAN__
12824 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)__a
);
12826 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)__a
);
12830 static __inline__ vector
double __ATTRS_o_ai
12831 vec_unpackl(vector
float __a
) {
12832 return (vector
double)(__a
[2], __a
[3]);
12838 static __inline__ vector
short __ATTRS_o_ai
12839 vec_vupklsb(vector
signed char __a
) {
12840 #ifdef __LITTLE_ENDIAN__
12841 return __builtin_altivec_vupkhsb((vector
char)__a
);
12843 return __builtin_altivec_vupklsb((vector
char)__a
);
12847 static __inline__ vector
bool short __ATTRS_o_ai
12848 vec_vupklsb(vector
bool char __a
) {
12849 #ifdef __LITTLE_ENDIAN__
12850 return (vector
bool short)__builtin_altivec_vupkhsb((vector
char)__a
);
12852 return (vector
bool short)__builtin_altivec_vupklsb((vector
char)__a
);
12858 static __inline__ vector
int __ATTRS_o_ai
vec_vupklsh(vector
short __a
) {
12859 #ifdef __LITTLE_ENDIAN__
12860 return __builtin_altivec_vupkhsh(__a
);
12862 return __builtin_altivec_vupklsh(__a
);
12866 static __inline__ vector
bool int __ATTRS_o_ai
12867 vec_vupklsh(vector
bool short __a
) {
12868 #ifdef __LITTLE_ENDIAN__
12869 return (vector
bool int)__builtin_altivec_vupkhsh((vector
short)__a
);
12871 return (vector
bool int)__builtin_altivec_vupklsh((vector
short)__a
);
12875 static __inline__ vector
unsigned int __ATTRS_o_ai
12876 vec_vupklsh(vector pixel __a
) {
12877 #ifdef __LITTLE_ENDIAN__
12878 return (vector
unsigned int)__builtin_altivec_vupkhpx((vector
short)__a
);
12880 return (vector
unsigned int)__builtin_altivec_vupklpx((vector
short)__a
);
12886 #ifdef __POWER8_VECTOR__
12887 static __inline__ vector
long long __ATTRS_o_ai
vec_vupklsw(vector
int __a
) {
12888 #ifdef __LITTLE_ENDIAN__
12889 return __builtin_altivec_vupkhsw(__a
);
12891 return __builtin_altivec_vupklsw(__a
);
12895 static __inline__ vector
bool long long __ATTRS_o_ai
12896 vec_vupklsw(vector
bool int __a
) {
12897 #ifdef __LITTLE_ENDIAN__
12898 return (vector
bool long long)__builtin_altivec_vupkhsw((vector
int)__a
);
12900 return (vector
bool long long)__builtin_altivec_vupklsw((vector
int)__a
);
12909 static __inline__ vector
bool int __ATTRS_o_ai
12910 vec_vsx_ld(int __a
, const vector
bool int *__b
) {
12911 return (vector
bool int)__builtin_vsx_lxvw4x(__a
, __b
);
12914 static __inline__ vector
signed int __ATTRS_o_ai
12915 vec_vsx_ld(int __a
, const vector
signed int *__b
) {
12916 return (vector
signed int)__builtin_vsx_lxvw4x(__a
, __b
);
12919 static __inline__ vector
signed int __ATTRS_o_ai
12920 vec_vsx_ld(int __a
, const signed int *__b
) {
12921 return (vector
signed int)__builtin_vsx_lxvw4x(__a
, __b
);
12924 static __inline__ vector
unsigned int __ATTRS_o_ai
12925 vec_vsx_ld(int __a
, const vector
unsigned int *__b
) {
12926 return (vector
unsigned int)__builtin_vsx_lxvw4x(__a
, __b
);
12929 static __inline__ vector
unsigned int __ATTRS_o_ai
12930 vec_vsx_ld(int __a
, const unsigned int *__b
) {
12931 return (vector
unsigned int)__builtin_vsx_lxvw4x(__a
, __b
);
12934 static __inline__ vector
float __ATTRS_o_ai
12935 vec_vsx_ld(int __a
, const vector
float *__b
) {
12936 return (vector
float)__builtin_vsx_lxvw4x(__a
, __b
);
12939 static __inline__ vector
float __ATTRS_o_ai
vec_vsx_ld(int __a
,
12940 const float *__b
) {
12941 return (vector
float)__builtin_vsx_lxvw4x(__a
, __b
);
12944 static __inline__ vector
signed long long __ATTRS_o_ai
12945 vec_vsx_ld(int __a
, const vector
signed long long *__b
) {
12946 return (vector
signed long long)__builtin_vsx_lxvd2x(__a
, __b
);
12949 static __inline__ vector
unsigned long long __ATTRS_o_ai
12950 vec_vsx_ld(int __a
, const vector
unsigned long long *__b
) {
12951 return (vector
unsigned long long)__builtin_vsx_lxvd2x(__a
, __b
);
12954 static __inline__ vector
double __ATTRS_o_ai
12955 vec_vsx_ld(int __a
, const vector
double *__b
) {
12956 return (vector
double)__builtin_vsx_lxvd2x(__a
, __b
);
12959 static __inline__ vector
double __ATTRS_o_ai
12960 vec_vsx_ld(int __a
, const double *__b
) {
12961 return (vector
double)__builtin_vsx_lxvd2x(__a
, __b
);
12964 static __inline__ vector
bool short __ATTRS_o_ai
12965 vec_vsx_ld(int __a
, const vector
bool short *__b
) {
12966 return (vector
bool short)__builtin_vsx_lxvw4x(__a
, __b
);
12969 static __inline__ vector
signed short __ATTRS_o_ai
12970 vec_vsx_ld(int __a
, const vector
signed short *__b
) {
12971 return (vector
signed short)__builtin_vsx_lxvw4x(__a
, __b
);
12974 static __inline__ vector
signed short __ATTRS_o_ai
12975 vec_vsx_ld(int __a
, const signed short *__b
) {
12976 return (vector
signed short)__builtin_vsx_lxvw4x(__a
, __b
);
12979 static __inline__ vector
unsigned short __ATTRS_o_ai
12980 vec_vsx_ld(int __a
, const vector
unsigned short *__b
) {
12981 return (vector
unsigned short)__builtin_vsx_lxvw4x(__a
, __b
);
12984 static __inline__ vector
unsigned short __ATTRS_o_ai
12985 vec_vsx_ld(int __a
, const unsigned short *__b
) {
12986 return (vector
unsigned short)__builtin_vsx_lxvw4x(__a
, __b
);
12989 static __inline__ vector
bool char __ATTRS_o_ai
12990 vec_vsx_ld(int __a
, const vector
bool char *__b
) {
12991 return (vector
bool char)__builtin_vsx_lxvw4x(__a
, __b
);
12994 static __inline__ vector
signed char __ATTRS_o_ai
12995 vec_vsx_ld(int __a
, const vector
signed char *__b
) {
12996 return (vector
signed char)__builtin_vsx_lxvw4x(__a
, __b
);
12999 static __inline__ vector
signed char __ATTRS_o_ai
13000 vec_vsx_ld(int __a
, const signed char *__b
) {
13001 return (vector
signed char)__builtin_vsx_lxvw4x(__a
, __b
);
13004 static __inline__ vector
unsigned char __ATTRS_o_ai
13005 vec_vsx_ld(int __a
, const vector
unsigned char *__b
) {
13006 return (vector
unsigned char)__builtin_vsx_lxvw4x(__a
, __b
);
13009 static __inline__ vector
unsigned char __ATTRS_o_ai
13010 vec_vsx_ld(int __a
, const unsigned char *__b
) {
13011 return (vector
unsigned char)__builtin_vsx_lxvw4x(__a
, __b
);
13020 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool int __a
, int __b
,
13021 vector
bool int *__c
) {
13022 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13025 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool int __a
, int __b
,
13027 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13030 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool int __a
, int __b
,
13031 unsigned int *__c
) {
13032 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13035 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed int __a
, int __b
,
13036 vector
signed int *__c
) {
13037 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13040 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed int __a
, int __b
,
13042 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13045 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned int __a
, int __b
,
13046 vector
unsigned int *__c
) {
13047 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13050 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned int __a
, int __b
,
13051 unsigned int *__c
) {
13052 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13055 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
float __a
, int __b
,
13056 vector
float *__c
) {
13057 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13060 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
float __a
, int __b
,
13062 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13065 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed long long __a
,
13067 vector
signed long long *__c
) {
13068 __builtin_vsx_stxvd2x((vector
double)__a
, __b
, __c
);
13071 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned long long __a
,
13073 vector
unsigned long long *__c
) {
13074 __builtin_vsx_stxvd2x((vector
double)__a
, __b
, __c
);
13077 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
double __a
, int __b
,
13078 vector
double *__c
) {
13079 __builtin_vsx_stxvd2x((vector
double)__a
, __b
, __c
);
13082 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
double __a
, int __b
,
13084 __builtin_vsx_stxvd2x((vector
double)__a
, __b
, __c
);
13087 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool short __a
, int __b
,
13088 vector
bool short *__c
) {
13089 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13092 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool short __a
, int __b
,
13093 signed short *__c
) {
13094 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13097 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool short __a
, int __b
,
13098 unsigned short *__c
) {
13099 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13101 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed short __a
, int __b
,
13102 vector
signed short *__c
) {
13103 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13106 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed short __a
, int __b
,
13107 signed short *__c
) {
13108 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13111 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned short __a
,
13113 vector
unsigned short *__c
) {
13114 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13117 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned short __a
,
13118 int __b
, unsigned short *__c
) {
13119 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13122 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool char __a
, int __b
,
13123 vector
bool char *__c
) {
13124 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13127 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool char __a
, int __b
,
13128 signed char *__c
) {
13129 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13132 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
bool char __a
, int __b
,
13133 unsigned char *__c
) {
13134 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13137 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed char __a
, int __b
,
13138 vector
signed char *__c
) {
13139 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13142 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
signed char __a
, int __b
,
13143 signed char *__c
) {
13144 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13147 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned char __a
,
13149 vector
unsigned char *__c
) {
13150 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13153 static __inline__
void __ATTRS_o_ai
vec_vsx_st(vector
unsigned char __a
,
13154 int __b
, unsigned char *__c
) {
13155 __builtin_vsx_stxvw4x((vector
int)__a
, __b
, __c
);
13161 #define vec_xxpermdi __builtin_vsx_xxpermdi
13162 #define vec_xxsldwi __builtin_vsx_xxsldwi
13163 #define vec_permi(__a, __b, __c) \
13164 _Generic((__a), vector signed long long \
13165 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13166 (((__c)&0x1) + 2)), \
13167 vector unsigned long long \
13168 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13169 (((__c)&0x1) + 2)), \
13171 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13172 (((__c)&0x1) + 2)))
13177 #define __builtin_altivec_vxor vec_xor
13179 static __inline__ vector
signed char __ATTRS_o_ai
13180 vec_xor(vector
signed char __a
, vector
signed char __b
) {
13184 static __inline__ vector
signed char __ATTRS_o_ai
13185 vec_xor(vector
bool char __a
, vector
signed char __b
) {
13186 return (vector
signed char)__a
^ __b
;
13189 static __inline__ vector
signed char __ATTRS_o_ai
13190 vec_xor(vector
signed char __a
, vector
bool char __b
) {
13191 return __a
^ (vector
signed char)__b
;
13194 static __inline__ vector
unsigned char __ATTRS_o_ai
13195 vec_xor(vector
unsigned char __a
, vector
unsigned char __b
) {
13199 static __inline__ vector
unsigned char __ATTRS_o_ai
13200 vec_xor(vector
bool char __a
, vector
unsigned char __b
) {
13201 return (vector
unsigned char)__a
^ __b
;
13204 static __inline__ vector
unsigned char __ATTRS_o_ai
13205 vec_xor(vector
unsigned char __a
, vector
bool char __b
) {
13206 return __a
^ (vector
unsigned char)__b
;
13209 static __inline__ vector
bool char __ATTRS_o_ai
vec_xor(vector
bool char __a
,
13210 vector
bool char __b
) {
13214 static __inline__ vector
short __ATTRS_o_ai
vec_xor(vector
short __a
,
13215 vector
short __b
) {
13219 static __inline__ vector
short __ATTRS_o_ai
vec_xor(vector
bool short __a
,
13220 vector
short __b
) {
13221 return (vector
short)__a
^ __b
;
13224 static __inline__ vector
short __ATTRS_o_ai
vec_xor(vector
short __a
,
13225 vector
bool short __b
) {
13226 return __a
^ (vector
short)__b
;
13229 static __inline__ vector
unsigned short __ATTRS_o_ai
13230 vec_xor(vector
unsigned short __a
, vector
unsigned short __b
) {
13234 static __inline__ vector
unsigned short __ATTRS_o_ai
13235 vec_xor(vector
bool short __a
, vector
unsigned short __b
) {
13236 return (vector
unsigned short)__a
^ __b
;
13239 static __inline__ vector
unsigned short __ATTRS_o_ai
13240 vec_xor(vector
unsigned short __a
, vector
bool short __b
) {
13241 return __a
^ (vector
unsigned short)__b
;
13244 static __inline__ vector
bool short __ATTRS_o_ai
13245 vec_xor(vector
bool short __a
, vector
bool short __b
) {
13249 static __inline__ vector
int __ATTRS_o_ai
vec_xor(vector
int __a
,
13254 static __inline__ vector
int __ATTRS_o_ai
vec_xor(vector
bool int __a
,
13256 return (vector
int)__a
^ __b
;
13259 static __inline__ vector
int __ATTRS_o_ai
vec_xor(vector
int __a
,
13260 vector
bool int __b
) {
13261 return __a
^ (vector
int)__b
;
13264 static __inline__ vector
unsigned int __ATTRS_o_ai
13265 vec_xor(vector
unsigned int __a
, vector
unsigned int __b
) {
13269 static __inline__ vector
unsigned int __ATTRS_o_ai
13270 vec_xor(vector
bool int __a
, vector
unsigned int __b
) {
13271 return (vector
unsigned int)__a
^ __b
;
13274 static __inline__ vector
unsigned int __ATTRS_o_ai
13275 vec_xor(vector
unsigned int __a
, vector
bool int __b
) {
13276 return __a
^ (vector
unsigned int)__b
;
13279 static __inline__ vector
bool int __ATTRS_o_ai
vec_xor(vector
bool int __a
,
13280 vector
bool int __b
) {
13284 static __inline__ vector
float __ATTRS_o_ai
vec_xor(vector
float __a
,
13285 vector
float __b
) {
13286 vector
unsigned int __res
=
13287 (vector
unsigned int)__a
^ (vector
unsigned int)__b
;
13288 return (vector
float)__res
;
13291 static __inline__ vector
float __ATTRS_o_ai
vec_xor(vector
bool int __a
,
13292 vector
float __b
) {
13293 vector
unsigned int __res
=
13294 (vector
unsigned int)__a
^ (vector
unsigned int)__b
;
13295 return (vector
float)__res
;
13298 static __inline__ vector
float __ATTRS_o_ai
vec_xor(vector
float __a
,
13299 vector
bool int __b
) {
13300 vector
unsigned int __res
=
13301 (vector
unsigned int)__a
^ (vector
unsigned int)__b
;
13302 return (vector
float)__res
;
13306 static __inline__ vector
signed long long __ATTRS_o_ai
13307 vec_xor(vector
signed long long __a
, vector
signed long long __b
) {
13311 static __inline__ vector
signed long long __ATTRS_o_ai
13312 vec_xor(vector
bool long long __a
, vector
signed long long __b
) {
13313 return (vector
signed long long)__a
^ __b
;
13316 static __inline__ vector
signed long long __ATTRS_o_ai
13317 vec_xor(vector
signed long long __a
, vector
bool long long __b
) {
13318 return __a
^ (vector
signed long long)__b
;
13321 static __inline__ vector
unsigned long long __ATTRS_o_ai
13322 vec_xor(vector
unsigned long long __a
, vector
unsigned long long __b
) {
13326 static __inline__ vector
unsigned long long __ATTRS_o_ai
13327 vec_xor(vector
bool long long __a
, vector
unsigned long long __b
) {
13328 return (vector
unsigned long long)__a
^ __b
;
13331 static __inline__ vector
unsigned long long __ATTRS_o_ai
13332 vec_xor(vector
unsigned long long __a
, vector
bool long long __b
) {
13333 return __a
^ (vector
unsigned long long)__b
;
13336 static __inline__ vector
bool long long __ATTRS_o_ai
13337 vec_xor(vector
bool long long __a
, vector
bool long long __b
) {
13341 static __inline__ vector
double __ATTRS_o_ai
vec_xor(vector
double __a
,
13342 vector
double __b
) {
13343 return (vector
double)((vector
unsigned long long)__a
^
13344 (vector
unsigned long long)__b
);
13347 static __inline__ vector
double __ATTRS_o_ai
13348 vec_xor(vector
double __a
, vector
bool long long __b
) {
13349 return (vector
double)((vector
unsigned long long)__a
^
13350 (vector
unsigned long long)__b
);
13353 static __inline__ vector
double __ATTRS_o_ai
vec_xor(vector
bool long long __a
,
13354 vector
double __b
) {
13355 return (vector
double)((vector
unsigned long long)__a
^
13356 (vector
unsigned long long)__b
);
13362 static __inline__ vector
signed char __ATTRS_o_ai
13363 vec_vxor(vector
signed char __a
, vector
signed char __b
) {
13367 static __inline__ vector
signed char __ATTRS_o_ai
13368 vec_vxor(vector
bool char __a
, vector
signed char __b
) {
13369 return (vector
signed char)__a
^ __b
;
13372 static __inline__ vector
signed char __ATTRS_o_ai
13373 vec_vxor(vector
signed char __a
, vector
bool char __b
) {
13374 return __a
^ (vector
signed char)__b
;
13377 static __inline__ vector
unsigned char __ATTRS_o_ai
13378 vec_vxor(vector
unsigned char __a
, vector
unsigned char __b
) {
13382 static __inline__ vector
unsigned char __ATTRS_o_ai
13383 vec_vxor(vector
bool char __a
, vector
unsigned char __b
) {
13384 return (vector
unsigned char)__a
^ __b
;
13387 static __inline__ vector
unsigned char __ATTRS_o_ai
13388 vec_vxor(vector
unsigned char __a
, vector
bool char __b
) {
13389 return __a
^ (vector
unsigned char)__b
;
13392 static __inline__ vector
bool char __ATTRS_o_ai
vec_vxor(vector
bool char __a
,
13393 vector
bool char __b
) {
13397 static __inline__ vector
short __ATTRS_o_ai
vec_vxor(vector
short __a
,
13398 vector
short __b
) {
13402 static __inline__ vector
short __ATTRS_o_ai
vec_vxor(vector
bool short __a
,
13403 vector
short __b
) {
13404 return (vector
short)__a
^ __b
;
13407 static __inline__ vector
short __ATTRS_o_ai
vec_vxor(vector
short __a
,
13408 vector
bool short __b
) {
13409 return __a
^ (vector
short)__b
;
13412 static __inline__ vector
unsigned short __ATTRS_o_ai
13413 vec_vxor(vector
unsigned short __a
, vector
unsigned short __b
) {
13417 static __inline__ vector
unsigned short __ATTRS_o_ai
13418 vec_vxor(vector
bool short __a
, vector
unsigned short __b
) {
13419 return (vector
unsigned short)__a
^ __b
;
13422 static __inline__ vector
unsigned short __ATTRS_o_ai
13423 vec_vxor(vector
unsigned short __a
, vector
bool short __b
) {
13424 return __a
^ (vector
unsigned short)__b
;
13427 static __inline__ vector
bool short __ATTRS_o_ai
13428 vec_vxor(vector
bool short __a
, vector
bool short __b
) {
13432 static __inline__ vector
int __ATTRS_o_ai
vec_vxor(vector
int __a
,
13437 static __inline__ vector
int __ATTRS_o_ai
vec_vxor(vector
bool int __a
,
13439 return (vector
int)__a
^ __b
;
13442 static __inline__ vector
int __ATTRS_o_ai
vec_vxor(vector
int __a
,
13443 vector
bool int __b
) {
13444 return __a
^ (vector
int)__b
;
13447 static __inline__ vector
unsigned int __ATTRS_o_ai
13448 vec_vxor(vector
unsigned int __a
, vector
unsigned int __b
) {
13452 static __inline__ vector
unsigned int __ATTRS_o_ai
13453 vec_vxor(vector
bool int __a
, vector
unsigned int __b
) {
13454 return (vector
unsigned int)__a
^ __b
;
13457 static __inline__ vector
unsigned int __ATTRS_o_ai
13458 vec_vxor(vector
unsigned int __a
, vector
bool int __b
) {
13459 return __a
^ (vector
unsigned int)__b
;
13462 static __inline__ vector
bool int __ATTRS_o_ai
vec_vxor(vector
bool int __a
,
13463 vector
bool int __b
) {
13467 static __inline__ vector
float __ATTRS_o_ai
vec_vxor(vector
float __a
,
13468 vector
float __b
) {
13469 vector
unsigned int __res
=
13470 (vector
unsigned int)__a
^ (vector
unsigned int)__b
;
13471 return (vector
float)__res
;
13474 static __inline__ vector
float __ATTRS_o_ai
vec_vxor(vector
bool int __a
,
13475 vector
float __b
) {
13476 vector
unsigned int __res
=
13477 (vector
unsigned int)__a
^ (vector
unsigned int)__b
;
13478 return (vector
float)__res
;
13481 static __inline__ vector
float __ATTRS_o_ai
vec_vxor(vector
float __a
,
13482 vector
bool int __b
) {
13483 vector
unsigned int __res
=
13484 (vector
unsigned int)__a
^ (vector
unsigned int)__b
;
13485 return (vector
float)__res
;
13489 static __inline__ vector
signed long long __ATTRS_o_ai
13490 vec_vxor(vector
signed long long __a
, vector
signed long long __b
) {
13494 static __inline__ vector
signed long long __ATTRS_o_ai
13495 vec_vxor(vector
bool long long __a
, vector
signed long long __b
) {
13496 return (vector
signed long long)__a
^ __b
;
13499 static __inline__ vector
signed long long __ATTRS_o_ai
13500 vec_vxor(vector
signed long long __a
, vector
bool long long __b
) {
13501 return __a
^ (vector
signed long long)__b
;
13504 static __inline__ vector
unsigned long long __ATTRS_o_ai
13505 vec_vxor(vector
unsigned long long __a
, vector
unsigned long long __b
) {
13509 static __inline__ vector
unsigned long long __ATTRS_o_ai
13510 vec_vxor(vector
bool long long __a
, vector
unsigned long long __b
) {
13511 return (vector
unsigned long long)__a
^ __b
;
13514 static __inline__ vector
unsigned long long __ATTRS_o_ai
13515 vec_vxor(vector
unsigned long long __a
, vector
bool long long __b
) {
13516 return __a
^ (vector
unsigned long long)__b
;
13519 static __inline__ vector
bool long long __ATTRS_o_ai
13520 vec_vxor(vector
bool long long __a
, vector
bool long long __b
) {
13525 /* ------------------------ extensions for CBEA ----------------------------- */
13529 static __inline__
signed char __ATTRS_o_ai
vec_extract(vector
signed char __a
,
13531 return __a
[__b
& 0xf];
13534 static __inline__
unsigned char __ATTRS_o_ai
13535 vec_extract(vector
unsigned char __a
, signed int __b
) {
13536 return __a
[__b
& 0xf];
13539 static __inline__
unsigned char __ATTRS_o_ai
vec_extract(vector
bool char __a
,
13541 return __a
[__b
& 0xf];
13544 static __inline__
signed short __ATTRS_o_ai
vec_extract(vector
signed short __a
,
13546 return __a
[__b
& 0x7];
13549 static __inline__
unsigned short __ATTRS_o_ai
13550 vec_extract(vector
unsigned short __a
, signed int __b
) {
13551 return __a
[__b
& 0x7];
13554 static __inline__
unsigned short __ATTRS_o_ai
vec_extract(vector
bool short __a
,
13556 return __a
[__b
& 0x7];
13559 static __inline__
signed int __ATTRS_o_ai
vec_extract(vector
signed int __a
,
13561 return __a
[__b
& 0x3];
13564 static __inline__
unsigned int __ATTRS_o_ai
vec_extract(vector
unsigned int __a
,
13566 return __a
[__b
& 0x3];
13569 static __inline__
unsigned int __ATTRS_o_ai
vec_extract(vector
bool int __a
,
13571 return __a
[__b
& 0x3];
13575 static __inline__
signed long long __ATTRS_o_ai
13576 vec_extract(vector
signed long long __a
, signed int __b
) {
13577 return __a
[__b
& 0x1];
13580 static __inline__
unsigned long long __ATTRS_o_ai
13581 vec_extract(vector
unsigned long long __a
, signed int __b
) {
13582 return __a
[__b
& 0x1];
13585 static __inline__
unsigned long long __ATTRS_o_ai
13586 vec_extract(vector
bool long long __a
, signed int __b
) {
13587 return __a
[__b
& 0x1];
13590 static __inline__
double __ATTRS_o_ai
vec_extract(vector
double __a
,
13592 return __a
[__b
& 0x1];
13596 static __inline__
float __ATTRS_o_ai
vec_extract(vector
float __a
,
13598 return __a
[__b
& 0x3];
13601 #ifdef __POWER9_VECTOR__
13603 #define vec_insert4b __builtin_vsx_insertword
13604 #define vec_extract4b __builtin_vsx_extractuword
13606 /* vec_extract_exp */
13608 static __inline__ vector
unsigned int __ATTRS_o_ai
13609 vec_extract_exp(vector
float __a
) {
13610 return __builtin_vsx_xvxexpsp(__a
);
13613 static __inline__ vector
unsigned long long __ATTRS_o_ai
13614 vec_extract_exp(vector
double __a
) {
13615 return __builtin_vsx_xvxexpdp(__a
);
13618 /* vec_extract_sig */
13620 static __inline__ vector
unsigned int __ATTRS_o_ai
13621 vec_extract_sig(vector
float __a
) {
13622 return __builtin_vsx_xvxsigsp(__a
);
13625 static __inline__ vector
unsigned long long __ATTRS_o_ai
13626 vec_extract_sig (vector
double __a
) {
13627 return __builtin_vsx_xvxsigdp(__a
);
13630 static __inline__ vector
float __ATTRS_o_ai
13631 vec_extract_fp32_from_shorth(vector
unsigned short __a
) {
13632 vector
unsigned short __b
=
13633 #ifdef __LITTLE_ENDIAN__
13634 __builtin_shufflevector(__a
, __a
, 0, -1, 1, -1, 2, -1, 3, -1);
13636 __builtin_shufflevector(__a
, __a
, -1, 0, -1, 1, -1, 2, -1, 3);
13638 return __builtin_vsx_xvcvhpsp(__b
);
13641 static __inline__ vector
float __ATTRS_o_ai
13642 vec_extract_fp32_from_shortl(vector
unsigned short __a
) {
13643 vector
unsigned short __b
=
13644 #ifdef __LITTLE_ENDIAN__
13645 __builtin_shufflevector(__a
, __a
, 4, -1, 5, -1, 6, -1, 7, -1);
13647 __builtin_shufflevector(__a
, __a
, -1, 4, -1, 5, -1, 6, -1, 7);
13649 return __builtin_vsx_xvcvhpsp(__b
);
13651 #endif /* __POWER9_VECTOR__ */
13655 static __inline__ vector
signed char __ATTRS_o_ai
13656 vec_insert(signed char __a
, vector
signed char __b
, int __c
) {
13657 __b
[__c
& 0xF] = __a
;
13661 static __inline__ vector
unsigned char __ATTRS_o_ai
13662 vec_insert(unsigned char __a
, vector
unsigned char __b
, int __c
) {
13663 __b
[__c
& 0xF] = __a
;
13667 static __inline__ vector
bool char __ATTRS_o_ai
vec_insert(unsigned char __a
,
13668 vector
bool char __b
,
13670 __b
[__c
& 0xF] = __a
;
13674 static __inline__ vector
signed short __ATTRS_o_ai
13675 vec_insert(signed short __a
, vector
signed short __b
, int __c
) {
13676 __b
[__c
& 0x7] = __a
;
13680 static __inline__ vector
unsigned short __ATTRS_o_ai
13681 vec_insert(unsigned short __a
, vector
unsigned short __b
, int __c
) {
13682 __b
[__c
& 0x7] = __a
;
13686 static __inline__ vector
bool short __ATTRS_o_ai
13687 vec_insert(unsigned short __a
, vector
bool short __b
, int __c
) {
13688 __b
[__c
& 0x7] = __a
;
13692 static __inline__ vector
signed int __ATTRS_o_ai
13693 vec_insert(signed int __a
, vector
signed int __b
, int __c
) {
13694 __b
[__c
& 0x3] = __a
;
13698 static __inline__ vector
unsigned int __ATTRS_o_ai
13699 vec_insert(unsigned int __a
, vector
unsigned int __b
, int __c
) {
13700 __b
[__c
& 0x3] = __a
;
13704 static __inline__ vector
bool int __ATTRS_o_ai
vec_insert(unsigned int __a
,
13705 vector
bool int __b
,
13707 __b
[__c
& 0x3] = __a
;
13712 static __inline__ vector
signed long long __ATTRS_o_ai
13713 vec_insert(signed long long __a
, vector
signed long long __b
, int __c
) {
13714 __b
[__c
& 0x1] = __a
;
13718 static __inline__ vector
unsigned long long __ATTRS_o_ai
13719 vec_insert(unsigned long long __a
, vector
unsigned long long __b
, int __c
) {
13720 __b
[__c
& 0x1] = __a
;
13724 static __inline__ vector
bool long long __ATTRS_o_ai
13725 vec_insert(unsigned long long __a
, vector
bool long long __b
, int __c
) {
13726 __b
[__c
& 0x1] = __a
;
13729 static __inline__ vector
double __ATTRS_o_ai
vec_insert(double __a
,
13732 __b
[__c
& 0x1] = __a
;
13737 static __inline__ vector
float __ATTRS_o_ai
vec_insert(float __a
,
13740 __b
[__c
& 0x3] = __a
;
13746 static __inline__ vector
signed char __ATTRS_o_ai
13747 vec_lvlx(int __a
, const signed char *__b
) {
13748 return vec_perm(vec_ld(__a
, __b
), (vector
signed char)(0),
13749 vec_lvsl(__a
, __b
));
13752 static __inline__ vector
signed char __ATTRS_o_ai
13753 vec_lvlx(int __a
, const vector
signed char *__b
) {
13754 return vec_perm(vec_ld(__a
, __b
), (vector
signed char)(0),
13755 vec_lvsl(__a
, (unsigned char *)__b
));
13758 static __inline__ vector
unsigned char __ATTRS_o_ai
13759 vec_lvlx(int __a
, const unsigned char *__b
) {
13760 return vec_perm(vec_ld(__a
, __b
), (vector
unsigned char)(0),
13761 vec_lvsl(__a
, __b
));
13764 static __inline__ vector
unsigned char __ATTRS_o_ai
13765 vec_lvlx(int __a
, const vector
unsigned char *__b
) {
13766 return vec_perm(vec_ld(__a
, __b
), (vector
unsigned char)(0),
13767 vec_lvsl(__a
, (unsigned char *)__b
));
13770 static __inline__ vector
bool char __ATTRS_o_ai
13771 vec_lvlx(int __a
, const vector
bool char *__b
) {
13772 return vec_perm(vec_ld(__a
, __b
), (vector
bool char)(0),
13773 vec_lvsl(__a
, (unsigned char *)__b
));
13776 static __inline__ vector
short __ATTRS_o_ai
vec_lvlx(int __a
,
13777 const short *__b
) {
13778 return vec_perm(vec_ld(__a
, __b
), (vector
short)(0), vec_lvsl(__a
, __b
));
13781 static __inline__ vector
short __ATTRS_o_ai
vec_lvlx(int __a
,
13782 const vector
short *__b
) {
13783 return vec_perm(vec_ld(__a
, __b
), (vector
short)(0),
13784 vec_lvsl(__a
, (unsigned char *)__b
));
13787 static __inline__ vector
unsigned short __ATTRS_o_ai
13788 vec_lvlx(int __a
, const unsigned short *__b
) {
13789 return vec_perm(vec_ld(__a
, __b
), (vector
unsigned short)(0),
13790 vec_lvsl(__a
, __b
));
13793 static __inline__ vector
unsigned short __ATTRS_o_ai
13794 vec_lvlx(int __a
, const vector
unsigned short *__b
) {
13795 return vec_perm(vec_ld(__a
, __b
), (vector
unsigned short)(0),
13796 vec_lvsl(__a
, (unsigned char *)__b
));
13799 static __inline__ vector
bool short __ATTRS_o_ai
13800 vec_lvlx(int __a
, const vector
bool short *__b
) {
13801 return vec_perm(vec_ld(__a
, __b
), (vector
bool short)(0),
13802 vec_lvsl(__a
, (unsigned char *)__b
));
13805 static __inline__ vector pixel __ATTRS_o_ai
vec_lvlx(int __a
,
13806 const vector pixel
*__b
) {
13807 return vec_perm(vec_ld(__a
, __b
), (vector pixel
)(0),
13808 vec_lvsl(__a
, (unsigned char *)__b
));
13811 static __inline__ vector
int __ATTRS_o_ai
vec_lvlx(int __a
, const int *__b
) {
13812 return vec_perm(vec_ld(__a
, __b
), (vector
int)(0), vec_lvsl(__a
, __b
));
13815 static __inline__ vector
int __ATTRS_o_ai
vec_lvlx(int __a
,
13816 const vector
int *__b
) {
13817 return vec_perm(vec_ld(__a
, __b
), (vector
int)(0),
13818 vec_lvsl(__a
, (unsigned char *)__b
));
13821 static __inline__ vector
unsigned int __ATTRS_o_ai
13822 vec_lvlx(int __a
, const unsigned int *__b
) {
13823 return vec_perm(vec_ld(__a
, __b
), (vector
unsigned int)(0),
13824 vec_lvsl(__a
, __b
));
13827 static __inline__ vector
unsigned int __ATTRS_o_ai
13828 vec_lvlx(int __a
, const vector
unsigned int *__b
) {
13829 return vec_perm(vec_ld(__a
, __b
), (vector
unsigned int)(0),
13830 vec_lvsl(__a
, (unsigned char *)__b
));
13833 static __inline__ vector
bool int __ATTRS_o_ai
13834 vec_lvlx(int __a
, const vector
bool int *__b
) {
13835 return vec_perm(vec_ld(__a
, __b
), (vector
bool int)(0),
13836 vec_lvsl(__a
, (unsigned char *)__b
));
13839 static __inline__ vector
float __ATTRS_o_ai
vec_lvlx(int __a
,
13840 const float *__b
) {
13841 return vec_perm(vec_ld(__a
, __b
), (vector
float)(0), vec_lvsl(__a
, __b
));
13844 static __inline__ vector
float __ATTRS_o_ai
vec_lvlx(int __a
,
13845 const vector
float *__b
) {
13846 return vec_perm(vec_ld(__a
, __b
), (vector
float)(0),
13847 vec_lvsl(__a
, (unsigned char *)__b
));
13852 static __inline__ vector
signed char __ATTRS_o_ai
13853 vec_lvlxl(int __a
, const signed char *__b
) {
13854 return vec_perm(vec_ldl(__a
, __b
), (vector
signed char)(0),
13855 vec_lvsl(__a
, __b
));
13858 static __inline__ vector
signed char __ATTRS_o_ai
13859 vec_lvlxl(int __a
, const vector
signed char *__b
) {
13860 return vec_perm(vec_ldl(__a
, __b
), (vector
signed char)(0),
13861 vec_lvsl(__a
, (unsigned char *)__b
));
13864 static __inline__ vector
unsigned char __ATTRS_o_ai
13865 vec_lvlxl(int __a
, const unsigned char *__b
) {
13866 return vec_perm(vec_ldl(__a
, __b
), (vector
unsigned char)(0),
13867 vec_lvsl(__a
, __b
));
13870 static __inline__ vector
unsigned char __ATTRS_o_ai
13871 vec_lvlxl(int __a
, const vector
unsigned char *__b
) {
13872 return vec_perm(vec_ldl(__a
, __b
), (vector
unsigned char)(0),
13873 vec_lvsl(__a
, (unsigned char *)__b
));
13876 static __inline__ vector
bool char __ATTRS_o_ai
13877 vec_lvlxl(int __a
, const vector
bool char *__b
) {
13878 return vec_perm(vec_ldl(__a
, __b
), (vector
bool char)(0),
13879 vec_lvsl(__a
, (unsigned char *)__b
));
13882 static __inline__ vector
short __ATTRS_o_ai
vec_lvlxl(int __a
,
13883 const short *__b
) {
13884 return vec_perm(vec_ldl(__a
, __b
), (vector
short)(0), vec_lvsl(__a
, __b
));
13887 static __inline__ vector
short __ATTRS_o_ai
vec_lvlxl(int __a
,
13888 const vector
short *__b
) {
13889 return vec_perm(vec_ldl(__a
, __b
), (vector
short)(0),
13890 vec_lvsl(__a
, (unsigned char *)__b
));
13893 static __inline__ vector
unsigned short __ATTRS_o_ai
13894 vec_lvlxl(int __a
, const unsigned short *__b
) {
13895 return vec_perm(vec_ldl(__a
, __b
), (vector
unsigned short)(0),
13896 vec_lvsl(__a
, __b
));
13899 static __inline__ vector
unsigned short __ATTRS_o_ai
13900 vec_lvlxl(int __a
, const vector
unsigned short *__b
) {
13901 return vec_perm(vec_ldl(__a
, __b
), (vector
unsigned short)(0),
13902 vec_lvsl(__a
, (unsigned char *)__b
));
13905 static __inline__ vector
bool short __ATTRS_o_ai
13906 vec_lvlxl(int __a
, const vector
bool short *__b
) {
13907 return vec_perm(vec_ldl(__a
, __b
), (vector
bool short)(0),
13908 vec_lvsl(__a
, (unsigned char *)__b
));
13911 static __inline__ vector pixel __ATTRS_o_ai
vec_lvlxl(int __a
,
13912 const vector pixel
*__b
) {
13913 return vec_perm(vec_ldl(__a
, __b
), (vector pixel
)(0),
13914 vec_lvsl(__a
, (unsigned char *)__b
));
13917 static __inline__ vector
int __ATTRS_o_ai
vec_lvlxl(int __a
, const int *__b
) {
13918 return vec_perm(vec_ldl(__a
, __b
), (vector
int)(0), vec_lvsl(__a
, __b
));
13921 static __inline__ vector
int __ATTRS_o_ai
vec_lvlxl(int __a
,
13922 const vector
int *__b
) {
13923 return vec_perm(vec_ldl(__a
, __b
), (vector
int)(0),
13924 vec_lvsl(__a
, (unsigned char *)__b
));
13927 static __inline__ vector
unsigned int __ATTRS_o_ai
13928 vec_lvlxl(int __a
, const unsigned int *__b
) {
13929 return vec_perm(vec_ldl(__a
, __b
), (vector
unsigned int)(0),
13930 vec_lvsl(__a
, __b
));
13933 static __inline__ vector
unsigned int __ATTRS_o_ai
13934 vec_lvlxl(int __a
, const vector
unsigned int *__b
) {
13935 return vec_perm(vec_ldl(__a
, __b
), (vector
unsigned int)(0),
13936 vec_lvsl(__a
, (unsigned char *)__b
));
13939 static __inline__ vector
bool int __ATTRS_o_ai
13940 vec_lvlxl(int __a
, const vector
bool int *__b
) {
13941 return vec_perm(vec_ldl(__a
, __b
), (vector
bool int)(0),
13942 vec_lvsl(__a
, (unsigned char *)__b
));
13945 static __inline__ vector
float __ATTRS_o_ai
vec_lvlxl(int __a
,
13946 const float *__b
) {
13947 return vec_perm(vec_ldl(__a
, __b
), (vector
float)(0), vec_lvsl(__a
, __b
));
13950 static __inline__ vector
float __ATTRS_o_ai
vec_lvlxl(int __a
,
13951 vector
float *__b
) {
13952 return vec_perm(vec_ldl(__a
, __b
), (vector
float)(0),
13953 vec_lvsl(__a
, (unsigned char *)__b
));
13958 static __inline__ vector
signed char __ATTRS_o_ai
13959 vec_lvrx(int __a
, const signed char *__b
) {
13960 return vec_perm((vector
signed char)(0), vec_ld(__a
, __b
),
13961 vec_lvsl(__a
, __b
));
13964 static __inline__ vector
signed char __ATTRS_o_ai
13965 vec_lvrx(int __a
, const vector
signed char *__b
) {
13966 return vec_perm((vector
signed char)(0), vec_ld(__a
, __b
),
13967 vec_lvsl(__a
, (unsigned char *)__b
));
13970 static __inline__ vector
unsigned char __ATTRS_o_ai
13971 vec_lvrx(int __a
, const unsigned char *__b
) {
13972 return vec_perm((vector
unsigned char)(0), vec_ld(__a
, __b
),
13973 vec_lvsl(__a
, __b
));
13976 static __inline__ vector
unsigned char __ATTRS_o_ai
13977 vec_lvrx(int __a
, const vector
unsigned char *__b
) {
13978 return vec_perm((vector
unsigned char)(0), vec_ld(__a
, __b
),
13979 vec_lvsl(__a
, (unsigned char *)__b
));
13982 static __inline__ vector
bool char __ATTRS_o_ai
13983 vec_lvrx(int __a
, const vector
bool char *__b
) {
13984 return vec_perm((vector
bool char)(0), vec_ld(__a
, __b
),
13985 vec_lvsl(__a
, (unsigned char *)__b
));
13988 static __inline__ vector
short __ATTRS_o_ai
vec_lvrx(int __a
,
13989 const short *__b
) {
13990 return vec_perm((vector
short)(0), vec_ld(__a
, __b
), vec_lvsl(__a
, __b
));
13993 static __inline__ vector
short __ATTRS_o_ai
vec_lvrx(int __a
,
13994 const vector
short *__b
) {
13995 return vec_perm((vector
short)(0), vec_ld(__a
, __b
),
13996 vec_lvsl(__a
, (unsigned char *)__b
));
13999 static __inline__ vector
unsigned short __ATTRS_o_ai
14000 vec_lvrx(int __a
, const unsigned short *__b
) {
14001 return vec_perm((vector
unsigned short)(0), vec_ld(__a
, __b
),
14002 vec_lvsl(__a
, __b
));
14005 static __inline__ vector
unsigned short __ATTRS_o_ai
14006 vec_lvrx(int __a
, const vector
unsigned short *__b
) {
14007 return vec_perm((vector
unsigned short)(0), vec_ld(__a
, __b
),
14008 vec_lvsl(__a
, (unsigned char *)__b
));
14011 static __inline__ vector
bool short __ATTRS_o_ai
14012 vec_lvrx(int __a
, const vector
bool short *__b
) {
14013 return vec_perm((vector
bool short)(0), vec_ld(__a
, __b
),
14014 vec_lvsl(__a
, (unsigned char *)__b
));
14017 static __inline__ vector pixel __ATTRS_o_ai
vec_lvrx(int __a
,
14018 const vector pixel
*__b
) {
14019 return vec_perm((vector pixel
)(0), vec_ld(__a
, __b
),
14020 vec_lvsl(__a
, (unsigned char *)__b
));
14023 static __inline__ vector
int __ATTRS_o_ai
vec_lvrx(int __a
, const int *__b
) {
14024 return vec_perm((vector
int)(0), vec_ld(__a
, __b
), vec_lvsl(__a
, __b
));
14027 static __inline__ vector
int __ATTRS_o_ai
vec_lvrx(int __a
,
14028 const vector
int *__b
) {
14029 return vec_perm((vector
int)(0), vec_ld(__a
, __b
),
14030 vec_lvsl(__a
, (unsigned char *)__b
));
14033 static __inline__ vector
unsigned int __ATTRS_o_ai
14034 vec_lvrx(int __a
, const unsigned int *__b
) {
14035 return vec_perm((vector
unsigned int)(0), vec_ld(__a
, __b
),
14036 vec_lvsl(__a
, __b
));
14039 static __inline__ vector
unsigned int __ATTRS_o_ai
14040 vec_lvrx(int __a
, const vector
unsigned int *__b
) {
14041 return vec_perm((vector
unsigned int)(0), vec_ld(__a
, __b
),
14042 vec_lvsl(__a
, (unsigned char *)__b
));
14045 static __inline__ vector
bool int __ATTRS_o_ai
14046 vec_lvrx(int __a
, const vector
bool int *__b
) {
14047 return vec_perm((vector
bool int)(0), vec_ld(__a
, __b
),
14048 vec_lvsl(__a
, (unsigned char *)__b
));
14051 static __inline__ vector
float __ATTRS_o_ai
vec_lvrx(int __a
,
14052 const float *__b
) {
14053 return vec_perm((vector
float)(0), vec_ld(__a
, __b
), vec_lvsl(__a
, __b
));
14056 static __inline__ vector
float __ATTRS_o_ai
vec_lvrx(int __a
,
14057 const vector
float *__b
) {
14058 return vec_perm((vector
float)(0), vec_ld(__a
, __b
),
14059 vec_lvsl(__a
, (unsigned char *)__b
));
14064 static __inline__ vector
signed char __ATTRS_o_ai
14065 vec_lvrxl(int __a
, const signed char *__b
) {
14066 return vec_perm((vector
signed char)(0), vec_ldl(__a
, __b
),
14067 vec_lvsl(__a
, __b
));
14070 static __inline__ vector
signed char __ATTRS_o_ai
14071 vec_lvrxl(int __a
, const vector
signed char *__b
) {
14072 return vec_perm((vector
signed char)(0), vec_ldl(__a
, __b
),
14073 vec_lvsl(__a
, (unsigned char *)__b
));
14076 static __inline__ vector
unsigned char __ATTRS_o_ai
14077 vec_lvrxl(int __a
, const unsigned char *__b
) {
14078 return vec_perm((vector
unsigned char)(0), vec_ldl(__a
, __b
),
14079 vec_lvsl(__a
, __b
));
14082 static __inline__ vector
unsigned char __ATTRS_o_ai
14083 vec_lvrxl(int __a
, const vector
unsigned char *__b
) {
14084 return vec_perm((vector
unsigned char)(0), vec_ldl(__a
, __b
),
14085 vec_lvsl(__a
, (unsigned char *)__b
));
14088 static __inline__ vector
bool char __ATTRS_o_ai
14089 vec_lvrxl(int __a
, const vector
bool char *__b
) {
14090 return vec_perm((vector
bool char)(0), vec_ldl(__a
, __b
),
14091 vec_lvsl(__a
, (unsigned char *)__b
));
14094 static __inline__ vector
short __ATTRS_o_ai
vec_lvrxl(int __a
,
14095 const short *__b
) {
14096 return vec_perm((vector
short)(0), vec_ldl(__a
, __b
), vec_lvsl(__a
, __b
));
14099 static __inline__ vector
short __ATTRS_o_ai
vec_lvrxl(int __a
,
14100 const vector
short *__b
) {
14101 return vec_perm((vector
short)(0), vec_ldl(__a
, __b
),
14102 vec_lvsl(__a
, (unsigned char *)__b
));
14105 static __inline__ vector
unsigned short __ATTRS_o_ai
14106 vec_lvrxl(int __a
, const unsigned short *__b
) {
14107 return vec_perm((vector
unsigned short)(0), vec_ldl(__a
, __b
),
14108 vec_lvsl(__a
, __b
));
14111 static __inline__ vector
unsigned short __ATTRS_o_ai
14112 vec_lvrxl(int __a
, const vector
unsigned short *__b
) {
14113 return vec_perm((vector
unsigned short)(0), vec_ldl(__a
, __b
),
14114 vec_lvsl(__a
, (unsigned char *)__b
));
14117 static __inline__ vector
bool short __ATTRS_o_ai
14118 vec_lvrxl(int __a
, const vector
bool short *__b
) {
14119 return vec_perm((vector
bool short)(0), vec_ldl(__a
, __b
),
14120 vec_lvsl(__a
, (unsigned char *)__b
));
14123 static __inline__ vector pixel __ATTRS_o_ai
vec_lvrxl(int __a
,
14124 const vector pixel
*__b
) {
14125 return vec_perm((vector pixel
)(0), vec_ldl(__a
, __b
),
14126 vec_lvsl(__a
, (unsigned char *)__b
));
14129 static __inline__ vector
int __ATTRS_o_ai
vec_lvrxl(int __a
, const int *__b
) {
14130 return vec_perm((vector
int)(0), vec_ldl(__a
, __b
), vec_lvsl(__a
, __b
));
14133 static __inline__ vector
int __ATTRS_o_ai
vec_lvrxl(int __a
,
14134 const vector
int *__b
) {
14135 return vec_perm((vector
int)(0), vec_ldl(__a
, __b
),
14136 vec_lvsl(__a
, (unsigned char *)__b
));
14139 static __inline__ vector
unsigned int __ATTRS_o_ai
14140 vec_lvrxl(int __a
, const unsigned int *__b
) {
14141 return vec_perm((vector
unsigned int)(0), vec_ldl(__a
, __b
),
14142 vec_lvsl(__a
, __b
));
14145 static __inline__ vector
unsigned int __ATTRS_o_ai
14146 vec_lvrxl(int __a
, const vector
unsigned int *__b
) {
14147 return vec_perm((vector
unsigned int)(0), vec_ldl(__a
, __b
),
14148 vec_lvsl(__a
, (unsigned char *)__b
));
14151 static __inline__ vector
bool int __ATTRS_o_ai
14152 vec_lvrxl(int __a
, const vector
bool int *__b
) {
14153 return vec_perm((vector
bool int)(0), vec_ldl(__a
, __b
),
14154 vec_lvsl(__a
, (unsigned char *)__b
));
14157 static __inline__ vector
float __ATTRS_o_ai
vec_lvrxl(int __a
,
14158 const float *__b
) {
14159 return vec_perm((vector
float)(0), vec_ldl(__a
, __b
), vec_lvsl(__a
, __b
));
14162 static __inline__ vector
float __ATTRS_o_ai
vec_lvrxl(int __a
,
14163 const vector
float *__b
) {
14164 return vec_perm((vector
float)(0), vec_ldl(__a
, __b
),
14165 vec_lvsl(__a
, (unsigned char *)__b
));
14170 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
signed char __a
, int __b
,
14171 signed char *__c
) {
14172 return vec_st(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14176 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
signed char __a
, int __b
,
14177 vector
signed char *__c
) {
14179 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14183 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
unsigned char __a
, int __b
,
14184 unsigned char *__c
) {
14185 return vec_st(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14189 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
unsigned char __a
, int __b
,
14190 vector
unsigned char *__c
) {
14192 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14196 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
bool char __a
, int __b
,
14197 vector
bool char *__c
) {
14199 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14203 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
short __a
, int __b
,
14205 return vec_st(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14209 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
short __a
, int __b
,
14210 vector
short *__c
) {
14212 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14216 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
unsigned short __a
,
14217 int __b
, unsigned short *__c
) {
14218 return vec_st(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14222 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
unsigned short __a
,
14224 vector
unsigned short *__c
) {
14226 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14230 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
bool short __a
, int __b
,
14231 vector
bool short *__c
) {
14233 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14237 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector pixel __a
, int __b
,
14238 vector pixel
*__c
) {
14240 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14244 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
int __a
, int __b
,
14246 return vec_st(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14250 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
int __a
, int __b
,
14253 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14257 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
unsigned int __a
, int __b
,
14258 unsigned int *__c
) {
14259 return vec_st(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14263 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
unsigned int __a
, int __b
,
14264 vector
unsigned int *__c
) {
14266 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14270 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
bool int __a
, int __b
,
14271 vector
bool int *__c
) {
14273 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14277 static __inline__
void __ATTRS_o_ai
vec_stvlx(vector
float __a
, int __b
,
14278 vector
float *__c
) {
14280 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14286 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
signed char __a
, int __b
,
14287 signed char *__c
) {
14288 return vec_stl(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14292 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
signed char __a
, int __b
,
14293 vector
signed char *__c
) {
14295 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14299 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
unsigned char __a
,
14300 int __b
, unsigned char *__c
) {
14301 return vec_stl(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14305 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
unsigned char __a
,
14307 vector
unsigned char *__c
) {
14309 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14313 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
bool char __a
, int __b
,
14314 vector
bool char *__c
) {
14316 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14320 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
short __a
, int __b
,
14322 return vec_stl(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14326 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
short __a
, int __b
,
14327 vector
short *__c
) {
14329 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14333 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
unsigned short __a
,
14334 int __b
, unsigned short *__c
) {
14335 return vec_stl(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14339 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
unsigned short __a
,
14341 vector
unsigned short *__c
) {
14343 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14347 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
bool short __a
, int __b
,
14348 vector
bool short *__c
) {
14350 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14354 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector pixel __a
, int __b
,
14355 vector pixel
*__c
) {
14357 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14361 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
int __a
, int __b
,
14363 return vec_stl(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14367 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
int __a
, int __b
,
14370 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14374 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
unsigned int __a
, int __b
,
14375 unsigned int *__c
) {
14376 return vec_stl(vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, __c
)), __b
,
14380 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
unsigned int __a
, int __b
,
14381 vector
unsigned int *__c
) {
14383 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14387 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
bool int __a
, int __b
,
14388 vector
bool int *__c
) {
14390 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14394 static __inline__
void __ATTRS_o_ai
vec_stvlxl(vector
float __a
, int __b
,
14395 vector
float *__c
) {
14397 vec_perm(vec_lvrx(__b
, __c
), __a
, vec_lvsr(__b
, (unsigned char *)__c
)),
14403 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
signed char __a
, int __b
,
14404 signed char *__c
) {
14405 return vec_st(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14409 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
signed char __a
, int __b
,
14410 vector
signed char *__c
) {
14412 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14416 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
unsigned char __a
, int __b
,
14417 unsigned char *__c
) {
14418 return vec_st(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14422 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
unsigned char __a
, int __b
,
14423 vector
unsigned char *__c
) {
14425 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14429 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
bool char __a
, int __b
,
14430 vector
bool char *__c
) {
14432 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14436 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
short __a
, int __b
,
14438 return vec_st(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14442 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
short __a
, int __b
,
14443 vector
short *__c
) {
14445 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14449 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
unsigned short __a
,
14450 int __b
, unsigned short *__c
) {
14451 return vec_st(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14455 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
unsigned short __a
,
14457 vector
unsigned short *__c
) {
14459 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14463 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
bool short __a
, int __b
,
14464 vector
bool short *__c
) {
14466 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14470 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector pixel __a
, int __b
,
14471 vector pixel
*__c
) {
14473 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14477 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
int __a
, int __b
,
14479 return vec_st(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14483 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
int __a
, int __b
,
14486 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14490 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
unsigned int __a
, int __b
,
14491 unsigned int *__c
) {
14492 return vec_st(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14496 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
unsigned int __a
, int __b
,
14497 vector
unsigned int *__c
) {
14499 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14503 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
bool int __a
, int __b
,
14504 vector
bool int *__c
) {
14506 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14510 static __inline__
void __ATTRS_o_ai
vec_stvrx(vector
float __a
, int __b
,
14511 vector
float *__c
) {
14513 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14519 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
signed char __a
, int __b
,
14520 signed char *__c
) {
14521 return vec_stl(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14525 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
signed char __a
, int __b
,
14526 vector
signed char *__c
) {
14528 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14532 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
unsigned char __a
,
14533 int __b
, unsigned char *__c
) {
14534 return vec_stl(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14538 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
unsigned char __a
,
14540 vector
unsigned char *__c
) {
14542 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14546 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
bool char __a
, int __b
,
14547 vector
bool char *__c
) {
14549 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14553 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
short __a
, int __b
,
14555 return vec_stl(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14559 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
short __a
, int __b
,
14560 vector
short *__c
) {
14562 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14566 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
unsigned short __a
,
14567 int __b
, unsigned short *__c
) {
14568 return vec_stl(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14572 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
unsigned short __a
,
14574 vector
unsigned short *__c
) {
14576 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14580 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
bool short __a
, int __b
,
14581 vector
bool short *__c
) {
14583 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14587 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector pixel __a
, int __b
,
14588 vector pixel
*__c
) {
14590 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14594 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
int __a
, int __b
,
14596 return vec_stl(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14600 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
int __a
, int __b
,
14603 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14607 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
unsigned int __a
, int __b
,
14608 unsigned int *__c
) {
14609 return vec_stl(vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, __c
)), __b
,
14613 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
unsigned int __a
, int __b
,
14614 vector
unsigned int *__c
) {
14616 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14620 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
bool int __a
, int __b
,
14621 vector
bool int *__c
) {
14623 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14627 static __inline__
void __ATTRS_o_ai
vec_stvrxl(vector
float __a
, int __b
,
14628 vector
float *__c
) {
14630 vec_perm(__a
, vec_lvlx(__b
, __c
), vec_lvsr(__b
, (unsigned char *)__c
)),
14636 static __inline__ vector
signed char __ATTRS_o_ai
vec_promote(signed char __a
,
14638 vector
signed char __res
= (vector
signed char)(0);
14639 __res
[__b
& 0x7] = __a
;
14643 static __inline__ vector
unsigned char __ATTRS_o_ai
14644 vec_promote(unsigned char __a
, int __b
) {
14645 vector
unsigned char __res
= (vector
unsigned char)(0);
14646 __res
[__b
& 0x7] = __a
;
14650 static __inline__ vector
short __ATTRS_o_ai
vec_promote(short __a
, int __b
) {
14651 vector
short __res
= (vector
short)(0);
14652 __res
[__b
& 0x7] = __a
;
14656 static __inline__ vector
unsigned short __ATTRS_o_ai
14657 vec_promote(unsigned short __a
, int __b
) {
14658 vector
unsigned short __res
= (vector
unsigned short)(0);
14659 __res
[__b
& 0x7] = __a
;
14663 static __inline__ vector
int __ATTRS_o_ai
vec_promote(int __a
, int __b
) {
14664 vector
int __res
= (vector
int)(0);
14665 __res
[__b
& 0x3] = __a
;
14669 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_promote(unsigned int __a
,
14671 vector
unsigned int __res
= (vector
unsigned int)(0);
14672 __res
[__b
& 0x3] = __a
;
14676 static __inline__ vector
float __ATTRS_o_ai
vec_promote(float __a
, int __b
) {
14677 vector
float __res
= (vector
float)(0);
14678 __res
[__b
& 0x3] = __a
;
14683 static __inline__ vector
double __ATTRS_o_ai
vec_promote(double __a
, int __b
) {
14684 vector
double __res
= (vector
double)(0);
14685 __res
[__b
& 0x1] = __a
;
14689 static __inline__ vector
signed long long __ATTRS_o_ai
14690 vec_promote(signed long long __a
, int __b
) {
14691 vector
signed long long __res
= (vector
signed long long)(0);
14692 __res
[__b
& 0x1] = __a
;
14696 static __inline__ vector
unsigned long long __ATTRS_o_ai
14697 vec_promote(unsigned long long __a
, int __b
) {
14698 vector
unsigned long long __res
= (vector
unsigned long long)(0);
14699 __res
[__b
& 0x1] = __a
;
14706 static __inline__ vector
signed char __ATTRS_o_ai
vec_splats(signed char __a
) {
14707 return (vector
signed char)(__a
);
14710 static __inline__ vector
unsigned char __ATTRS_o_ai
14711 vec_splats(unsigned char __a
) {
14712 return (vector
unsigned char)(__a
);
14715 static __inline__ vector
short __ATTRS_o_ai
vec_splats(short __a
) {
14716 return (vector
short)(__a
);
14719 static __inline__ vector
unsigned short __ATTRS_o_ai
14720 vec_splats(unsigned short __a
) {
14721 return (vector
unsigned short)(__a
);
14724 static __inline__ vector
int __ATTRS_o_ai
vec_splats(int __a
) {
14725 return (vector
int)(__a
);
14728 static __inline__ vector
unsigned int __ATTRS_o_ai
14729 vec_splats(unsigned int __a
) {
14730 return (vector
unsigned int)(__a
);
14734 static __inline__ vector
signed long long __ATTRS_o_ai
14735 vec_splats(signed long long __a
) {
14736 return (vector
signed long long)(__a
);
14739 static __inline__ vector
unsigned long long __ATTRS_o_ai
14740 vec_splats(unsigned long long __a
) {
14741 return (vector
unsigned long long)(__a
);
14744 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
14745 defined(__SIZEOF_INT128__)
14746 static __inline__ vector
signed __int128 __ATTRS_o_ai
14747 vec_splats(signed __int128 __a
) {
14748 return (vector
signed __int128
)(__a
);
14751 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
14752 vec_splats(unsigned __int128 __a
) {
14753 return (vector
unsigned __int128
)(__a
);
14758 static __inline__ vector
double __ATTRS_o_ai
vec_splats(double __a
) {
14759 return (vector
double)(__a
);
14763 static __inline__ vector
float __ATTRS_o_ai
vec_splats(float __a
) {
14764 return (vector
float)(__a
);
14767 /* ----------------------------- predicates --------------------------------- */
14771 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
signed char __a
,
14772 vector
signed char __b
) {
14773 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14777 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
signed char __a
,
14778 vector
bool char __b
) {
14779 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14783 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned char __a
,
14784 vector
unsigned char __b
) {
14785 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14789 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned char __a
,
14790 vector
bool char __b
) {
14791 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14795 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool char __a
,
14796 vector
signed char __b
) {
14797 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14801 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool char __a
,
14802 vector
unsigned char __b
) {
14803 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14807 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool char __a
,
14808 vector
bool char __b
) {
14809 return __builtin_altivec_vcmpequb_p(__CR6_LT
, (vector
char)__a
,
14813 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
short __a
,
14814 vector
short __b
) {
14815 return __builtin_altivec_vcmpequh_p(__CR6_LT
, __a
, __b
);
14818 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
short __a
,
14819 vector
bool short __b
) {
14820 return __builtin_altivec_vcmpequh_p(__CR6_LT
, __a
, (vector
short)__b
);
14823 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned short __a
,
14824 vector
unsigned short __b
) {
14825 return __builtin_altivec_vcmpequh_p(__CR6_LT
, (vector
short)__a
,
14826 (vector
short)__b
);
14829 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned short __a
,
14830 vector
bool short __b
) {
14831 return __builtin_altivec_vcmpequh_p(__CR6_LT
, (vector
short)__a
,
14832 (vector
short)__b
);
14835 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool short __a
,
14836 vector
short __b
) {
14837 return __builtin_altivec_vcmpequh_p(__CR6_LT
, (vector
short)__a
,
14838 (vector
short)__b
);
14841 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool short __a
,
14842 vector
unsigned short __b
) {
14843 return __builtin_altivec_vcmpequh_p(__CR6_LT
, (vector
short)__a
,
14844 (vector
short)__b
);
14847 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool short __a
,
14848 vector
bool short __b
) {
14849 return __builtin_altivec_vcmpequh_p(__CR6_LT
, (vector
short)__a
,
14850 (vector
short)__b
);
14853 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector pixel __a
,
14854 vector pixel __b
) {
14855 return __builtin_altivec_vcmpequh_p(__CR6_LT
, (vector
short)__a
,
14856 (vector
short)__b
);
14859 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
int __a
, vector
int __b
) {
14860 return __builtin_altivec_vcmpequw_p(__CR6_LT
, __a
, __b
);
14863 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
int __a
,
14864 vector
bool int __b
) {
14865 return __builtin_altivec_vcmpequw_p(__CR6_LT
, __a
, (vector
int)__b
);
14868 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned int __a
,
14869 vector
unsigned int __b
) {
14870 return __builtin_altivec_vcmpequw_p(__CR6_LT
, (vector
int)__a
,
14874 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned int __a
,
14875 vector
bool int __b
) {
14876 return __builtin_altivec_vcmpequw_p(__CR6_LT
, (vector
int)__a
,
14880 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool int __a
,
14882 return __builtin_altivec_vcmpequw_p(__CR6_LT
, (vector
int)__a
,
14886 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool int __a
,
14887 vector
unsigned int __b
) {
14888 return __builtin_altivec_vcmpequw_p(__CR6_LT
, (vector
int)__a
,
14892 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool int __a
,
14893 vector
bool int __b
) {
14894 return __builtin_altivec_vcmpequw_p(__CR6_LT
, (vector
int)__a
,
14899 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
signed long long __a
,
14900 vector
signed long long __b
) {
14901 #ifdef __POWER8_VECTOR__
14902 return __builtin_altivec_vcmpequd_p(__CR6_LT
, __a
, __b
);
14904 // No vcmpequd on Power7 so we xor the two vectors and compare against zero as
14905 // 32-bit elements.
14906 return vec_all_eq((vector
signed int)vec_xor(__a
, __b
), (vector
signed int)0);
14910 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
long long __a
,
14911 vector
bool long long __b
) {
14912 return vec_all_eq((vector
signed long long)__a
, (vector
signed long long)__b
);
14915 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned long long __a
,
14916 vector
unsigned long long __b
) {
14917 return vec_all_eq((vector
signed long long)__a
, (vector
signed long long)__b
);
14920 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned long long __a
,
14921 vector
bool long long __b
) {
14922 return vec_all_eq((vector
signed long long)__a
, (vector
signed long long)__b
);
14925 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool long long __a
,
14926 vector
long long __b
) {
14927 return vec_all_eq((vector
signed long long)__a
, (vector
signed long long)__b
);
14930 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool long long __a
,
14931 vector
unsigned long long __b
) {
14932 return vec_all_eq((vector
signed long long)__a
, (vector
signed long long)__b
);
14935 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool long long __a
,
14936 vector
bool long long __b
) {
14937 return vec_all_eq((vector
signed long long)__a
, (vector
signed long long)__b
);
14941 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
float __a
,
14942 vector
float __b
) {
14944 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT
, __a
, __b
);
14946 return __builtin_altivec_vcmpeqfp_p(__CR6_LT
, __a
, __b
);
14951 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
double __a
,
14952 vector
double __b
) {
14953 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT
, __a
, __b
);
14957 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
14958 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
signed __int128 __a
,
14959 vector
signed __int128 __b
) {
14960 return __builtin_altivec_vcmpequq_p(__CR6_LT
, (vector
unsigned __int128
)__a
,
14961 (vector
signed __int128
)__b
);
14964 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
unsigned __int128 __a
,
14965 vector
unsigned __int128 __b
) {
14966 return __builtin_altivec_vcmpequq_p(__CR6_LT
, __a
,
14967 (vector
signed __int128
)__b
);
14970 static __inline__
int __ATTRS_o_ai
vec_all_eq(vector
bool __int128 __a
,
14971 vector
bool __int128 __b
) {
14972 return __builtin_altivec_vcmpequq_p(__CR6_LT
, (vector
unsigned __int128
)__a
,
14973 (vector
signed __int128
)__b
);
14979 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
signed char __a
,
14980 vector
signed char __b
) {
14981 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ
, __b
, __a
);
14984 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
signed char __a
,
14985 vector
bool char __b
) {
14986 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ
, (vector
signed char)__b
, __a
);
14989 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned char __a
,
14990 vector
unsigned char __b
) {
14991 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, __b
, __a
);
14994 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned char __a
,
14995 vector
bool char __b
) {
14996 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, (vector
unsigned char)__b
, __a
);
14999 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool char __a
,
15000 vector
signed char __b
) {
15001 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ
, __b
, (vector
signed char)__a
);
15004 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool char __a
,
15005 vector
unsigned char __b
) {
15006 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, __b
, (vector
unsigned char)__a
);
15009 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool char __a
,
15010 vector
bool char __b
) {
15011 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, (vector
unsigned char)__b
,
15012 (vector
unsigned char)__a
);
15015 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
short __a
,
15016 vector
short __b
) {
15017 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ
, __b
, __a
);
15020 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
short __a
,
15021 vector
bool short __b
) {
15022 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ
, (vector
short)__b
, __a
);
15025 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned short __a
,
15026 vector
unsigned short __b
) {
15027 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, __b
, __a
);
15030 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned short __a
,
15031 vector
bool short __b
) {
15032 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, (vector
unsigned short)__b
,
15036 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool short __a
,
15037 vector
short __b
) {
15038 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ
, __b
, (vector
signed short)__a
);
15041 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool short __a
,
15042 vector
unsigned short __b
) {
15043 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, __b
,
15044 (vector
unsigned short)__a
);
15047 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool short __a
,
15048 vector
bool short __b
) {
15049 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, (vector
unsigned short)__b
,
15050 (vector
unsigned short)__a
);
15053 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
int __a
, vector
int __b
) {
15054 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ
, __b
, __a
);
15057 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
int __a
,
15058 vector
bool int __b
) {
15059 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ
, (vector
int)__b
, __a
);
15062 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned int __a
,
15063 vector
unsigned int __b
) {
15064 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, __b
, __a
);
15067 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned int __a
,
15068 vector
bool int __b
) {
15069 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, (vector
unsigned int)__b
, __a
);
15072 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool int __a
,
15074 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ
, __b
, (vector
signed int)__a
);
15077 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool int __a
,
15078 vector
unsigned int __b
) {
15079 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, __b
, (vector
unsigned int)__a
);
15082 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool int __a
,
15083 vector
bool int __b
) {
15084 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, (vector
unsigned int)__b
,
15085 (vector
unsigned int)__a
);
15089 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
signed long long __a
,
15090 vector
signed long long __b
) {
15091 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ
, __b
, __a
);
15093 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
signed long long __a
,
15094 vector
bool long long __b
) {
15095 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ
, (vector
signed long long)__b
,
15099 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned long long __a
,
15100 vector
unsigned long long __b
) {
15101 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, __b
, __a
);
15104 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned long long __a
,
15105 vector
bool long long __b
) {
15106 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, (vector
unsigned long long)__b
,
15110 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool long long __a
,
15111 vector
signed long long __b
) {
15112 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ
, __b
,
15113 (vector
signed long long)__a
);
15116 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool long long __a
,
15117 vector
unsigned long long __b
) {
15118 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, __b
,
15119 (vector
unsigned long long)__a
);
15122 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
bool long long __a
,
15123 vector
bool long long __b
) {
15124 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, (vector
unsigned long long)__b
,
15125 (vector
unsigned long long)__a
);
15129 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
float __a
,
15130 vector
float __b
) {
15132 return __builtin_vsx_xvcmpgesp_p(__CR6_LT
, __a
, __b
);
15134 return __builtin_altivec_vcmpgefp_p(__CR6_LT
, __a
, __b
);
15139 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
double __a
,
15140 vector
double __b
) {
15141 return __builtin_vsx_xvcmpgedp_p(__CR6_LT
, __a
, __b
);
15145 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15146 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
signed __int128 __a
,
15147 vector
signed __int128 __b
) {
15148 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ
, __b
, __a
);
15151 static __inline__
int __ATTRS_o_ai
vec_all_ge(vector
unsigned __int128 __a
,
15152 vector
unsigned __int128 __b
) {
15153 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ
, __b
, __a
);
15159 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
signed char __a
,
15160 vector
signed char __b
) {
15161 return __builtin_altivec_vcmpgtsb_p(__CR6_LT
, __a
, __b
);
15164 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
signed char __a
,
15165 vector
bool char __b
) {
15166 return __builtin_altivec_vcmpgtsb_p(__CR6_LT
, __a
, (vector
signed char)__b
);
15169 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned char __a
,
15170 vector
unsigned char __b
) {
15171 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, __a
, __b
);
15174 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned char __a
,
15175 vector
bool char __b
) {
15176 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, __a
, (vector
unsigned char)__b
);
15179 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool char __a
,
15180 vector
signed char __b
) {
15181 return __builtin_altivec_vcmpgtsb_p(__CR6_LT
, (vector
signed char)__a
, __b
);
15184 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool char __a
,
15185 vector
unsigned char __b
) {
15186 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, (vector
unsigned char)__a
, __b
);
15189 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool char __a
,
15190 vector
bool char __b
) {
15191 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, (vector
unsigned char)__a
,
15192 (vector
unsigned char)__b
);
15195 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
short __a
,
15196 vector
short __b
) {
15197 return __builtin_altivec_vcmpgtsh_p(__CR6_LT
, __a
, __b
);
15200 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
short __a
,
15201 vector
bool short __b
) {
15202 return __builtin_altivec_vcmpgtsh_p(__CR6_LT
, __a
, (vector
short)__b
);
15205 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned short __a
,
15206 vector
unsigned short __b
) {
15207 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, __a
, __b
);
15210 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned short __a
,
15211 vector
bool short __b
) {
15212 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, __a
,
15213 (vector
unsigned short)__b
);
15216 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool short __a
,
15217 vector
short __b
) {
15218 return __builtin_altivec_vcmpgtsh_p(__CR6_LT
, (vector
signed short)__a
, __b
);
15221 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool short __a
,
15222 vector
unsigned short __b
) {
15223 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, (vector
unsigned short)__a
,
15227 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool short __a
,
15228 vector
bool short __b
) {
15229 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, (vector
unsigned short)__a
,
15230 (vector
unsigned short)__b
);
15233 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
int __a
, vector
int __b
) {
15234 return __builtin_altivec_vcmpgtsw_p(__CR6_LT
, __a
, __b
);
15237 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
int __a
,
15238 vector
bool int __b
) {
15239 return __builtin_altivec_vcmpgtsw_p(__CR6_LT
, __a
, (vector
int)__b
);
15242 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned int __a
,
15243 vector
unsigned int __b
) {
15244 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, __a
, __b
);
15247 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned int __a
,
15248 vector
bool int __b
) {
15249 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, __a
, (vector
unsigned int)__b
);
15252 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool int __a
,
15254 return __builtin_altivec_vcmpgtsw_p(__CR6_LT
, (vector
signed int)__a
, __b
);
15257 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool int __a
,
15258 vector
unsigned int __b
) {
15259 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, (vector
unsigned int)__a
, __b
);
15262 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool int __a
,
15263 vector
bool int __b
) {
15264 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, (vector
unsigned int)__a
,
15265 (vector
unsigned int)__b
);
15269 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
signed long long __a
,
15270 vector
signed long long __b
) {
15271 return __builtin_altivec_vcmpgtsd_p(__CR6_LT
, __a
, __b
);
15273 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
signed long long __a
,
15274 vector
bool long long __b
) {
15275 return __builtin_altivec_vcmpgtsd_p(__CR6_LT
, __a
,
15276 (vector
signed long long)__b
);
15279 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned long long __a
,
15280 vector
unsigned long long __b
) {
15281 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, __a
, __b
);
15284 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned long long __a
,
15285 vector
bool long long __b
) {
15286 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, __a
,
15287 (vector
unsigned long long)__b
);
15290 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool long long __a
,
15291 vector
signed long long __b
) {
15292 return __builtin_altivec_vcmpgtsd_p(__CR6_LT
, (vector
signed long long)__a
,
15296 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool long long __a
,
15297 vector
unsigned long long __b
) {
15298 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, (vector
unsigned long long)__a
,
15302 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
bool long long __a
,
15303 vector
bool long long __b
) {
15304 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, (vector
unsigned long long)__a
,
15305 (vector
unsigned long long)__b
);
15309 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
float __a
,
15310 vector
float __b
) {
15312 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT
, __a
, __b
);
15314 return __builtin_altivec_vcmpgtfp_p(__CR6_LT
, __a
, __b
);
15319 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
double __a
,
15320 vector
double __b
) {
15321 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT
, __a
, __b
);
15325 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15326 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
signed __int128 __a
,
15327 vector
signed __int128 __b
) {
15328 return __builtin_altivec_vcmpgtsq_p(__CR6_LT
, __a
, __b
);
15331 static __inline__
int __ATTRS_o_ai
vec_all_gt(vector
unsigned __int128 __a
,
15332 vector
unsigned __int128 __b
) {
15333 return __builtin_altivec_vcmpgtuq_p(__CR6_LT
, __a
, __b
);
15339 static __inline__
int __attribute__((__always_inline__
))
15340 vec_all_in(vector
float __a
, vector
float __b
) {
15341 return __builtin_altivec_vcmpbfp_p(__CR6_EQ
, __a
, __b
);
15346 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
signed char __a
,
15347 vector
signed char __b
) {
15348 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ
, __a
, __b
);
15351 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
signed char __a
,
15352 vector
bool char __b
) {
15353 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ
, __a
, (vector
signed char)__b
);
15356 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned char __a
,
15357 vector
unsigned char __b
) {
15358 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, __a
, __b
);
15361 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned char __a
,
15362 vector
bool char __b
) {
15363 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, __a
, (vector
unsigned char)__b
);
15366 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool char __a
,
15367 vector
signed char __b
) {
15368 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ
, (vector
signed char)__a
, __b
);
15371 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool char __a
,
15372 vector
unsigned char __b
) {
15373 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, (vector
unsigned char)__a
, __b
);
15376 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool char __a
,
15377 vector
bool char __b
) {
15378 return __builtin_altivec_vcmpgtub_p(__CR6_EQ
, (vector
unsigned char)__a
,
15379 (vector
unsigned char)__b
);
15382 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
short __a
,
15383 vector
short __b
) {
15384 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ
, __a
, __b
);
15387 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
short __a
,
15388 vector
bool short __b
) {
15389 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ
, __a
, (vector
short)__b
);
15392 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned short __a
,
15393 vector
unsigned short __b
) {
15394 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, __a
, __b
);
15397 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned short __a
,
15398 vector
bool short __b
) {
15399 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, __a
,
15400 (vector
unsigned short)__b
);
15403 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool short __a
,
15404 vector
short __b
) {
15405 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ
, (vector
signed short)__a
, __b
);
15408 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool short __a
,
15409 vector
unsigned short __b
) {
15410 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, (vector
unsigned short)__a
,
15414 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool short __a
,
15415 vector
bool short __b
) {
15416 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ
, (vector
unsigned short)__a
,
15417 (vector
unsigned short)__b
);
15420 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
int __a
, vector
int __b
) {
15421 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ
, __a
, __b
);
15424 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
int __a
,
15425 vector
bool int __b
) {
15426 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ
, __a
, (vector
int)__b
);
15429 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned int __a
,
15430 vector
unsigned int __b
) {
15431 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, __a
, __b
);
15434 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned int __a
,
15435 vector
bool int __b
) {
15436 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, __a
, (vector
unsigned int)__b
);
15439 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool int __a
,
15441 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ
, (vector
signed int)__a
, __b
);
15444 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool int __a
,
15445 vector
unsigned int __b
) {
15446 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, (vector
unsigned int)__a
, __b
);
15449 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool int __a
,
15450 vector
bool int __b
) {
15451 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ
, (vector
unsigned int)__a
,
15452 (vector
unsigned int)__b
);
15456 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
signed long long __a
,
15457 vector
signed long long __b
) {
15458 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ
, __a
, __b
);
15461 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned long long __a
,
15462 vector
unsigned long long __b
) {
15463 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, __a
, __b
);
15466 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
signed long long __a
,
15467 vector
bool long long __b
) {
15468 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ
, __a
,
15469 (vector
signed long long)__b
);
15472 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned long long __a
,
15473 vector
bool long long __b
) {
15474 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, __a
,
15475 (vector
unsigned long long)__b
);
15478 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool long long __a
,
15479 vector
signed long long __b
) {
15480 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ
, (vector
signed long long)__a
,
15484 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool long long __a
,
15485 vector
unsigned long long __b
) {
15486 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, (vector
unsigned long long)__a
,
15490 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
bool long long __a
,
15491 vector
bool long long __b
) {
15492 return __builtin_altivec_vcmpgtud_p(__CR6_EQ
, (vector
unsigned long long)__a
,
15493 (vector
unsigned long long)__b
);
15497 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
float __a
,
15498 vector
float __b
) {
15500 return __builtin_vsx_xvcmpgesp_p(__CR6_LT
, __b
, __a
);
15502 return __builtin_altivec_vcmpgefp_p(__CR6_LT
, __b
, __a
);
15507 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
double __a
,
15508 vector
double __b
) {
15509 return __builtin_vsx_xvcmpgedp_p(__CR6_LT
, __b
, __a
);
15513 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15514 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
signed __int128 __a
,
15515 vector
signed __int128 __b
) {
15516 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ
, __a
, __b
);
15519 static __inline__
int __ATTRS_o_ai
vec_all_le(vector
unsigned __int128 __a
,
15520 vector
unsigned __int128 __b
) {
15521 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ
, __a
, __b
);
15527 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
signed char __a
,
15528 vector
signed char __b
) {
15529 return __builtin_altivec_vcmpgtsb_p(__CR6_LT
, __b
, __a
);
15532 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
signed char __a
,
15533 vector
bool char __b
) {
15534 return __builtin_altivec_vcmpgtsb_p(__CR6_LT
, (vector
signed char)__b
, __a
);
15537 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned char __a
,
15538 vector
unsigned char __b
) {
15539 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, __b
, __a
);
15542 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned char __a
,
15543 vector
bool char __b
) {
15544 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, (vector
unsigned char)__b
, __a
);
15547 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool char __a
,
15548 vector
signed char __b
) {
15549 return __builtin_altivec_vcmpgtsb_p(__CR6_LT
, __b
, (vector
signed char)__a
);
15552 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool char __a
,
15553 vector
unsigned char __b
) {
15554 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, __b
, (vector
unsigned char)__a
);
15557 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool char __a
,
15558 vector
bool char __b
) {
15559 return __builtin_altivec_vcmpgtub_p(__CR6_LT
, (vector
unsigned char)__b
,
15560 (vector
unsigned char)__a
);
15563 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
short __a
,
15564 vector
short __b
) {
15565 return __builtin_altivec_vcmpgtsh_p(__CR6_LT
, __b
, __a
);
15568 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
short __a
,
15569 vector
bool short __b
) {
15570 return __builtin_altivec_vcmpgtsh_p(__CR6_LT
, (vector
short)__b
, __a
);
15573 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned short __a
,
15574 vector
unsigned short __b
) {
15575 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, __b
, __a
);
15578 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned short __a
,
15579 vector
bool short __b
) {
15580 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, (vector
unsigned short)__b
,
15584 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool short __a
,
15585 vector
short __b
) {
15586 return __builtin_altivec_vcmpgtsh_p(__CR6_LT
, __b
, (vector
signed short)__a
);
15589 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool short __a
,
15590 vector
unsigned short __b
) {
15591 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, __b
,
15592 (vector
unsigned short)__a
);
15595 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool short __a
,
15596 vector
bool short __b
) {
15597 return __builtin_altivec_vcmpgtuh_p(__CR6_LT
, (vector
unsigned short)__b
,
15598 (vector
unsigned short)__a
);
15601 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
int __a
, vector
int __b
) {
15602 return __builtin_altivec_vcmpgtsw_p(__CR6_LT
, __b
, __a
);
15605 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
int __a
,
15606 vector
bool int __b
) {
15607 return __builtin_altivec_vcmpgtsw_p(__CR6_LT
, (vector
int)__b
, __a
);
15610 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned int __a
,
15611 vector
unsigned int __b
) {
15612 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, __b
, __a
);
15615 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned int __a
,
15616 vector
bool int __b
) {
15617 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, (vector
unsigned int)__b
, __a
);
15620 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool int __a
,
15622 return __builtin_altivec_vcmpgtsw_p(__CR6_LT
, __b
, (vector
signed int)__a
);
15625 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool int __a
,
15626 vector
unsigned int __b
) {
15627 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, __b
, (vector
unsigned int)__a
);
15630 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool int __a
,
15631 vector
bool int __b
) {
15632 return __builtin_altivec_vcmpgtuw_p(__CR6_LT
, (vector
unsigned int)__b
,
15633 (vector
unsigned int)__a
);
15637 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
signed long long __a
,
15638 vector
signed long long __b
) {
15639 return __builtin_altivec_vcmpgtsd_p(__CR6_LT
, __b
, __a
);
15642 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned long long __a
,
15643 vector
unsigned long long __b
) {
15644 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, __b
, __a
);
15647 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
signed long long __a
,
15648 vector
bool long long __b
) {
15649 return __builtin_altivec_vcmpgtsd_p(__CR6_LT
, (vector
signed long long)__b
,
15653 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned long long __a
,
15654 vector
bool long long __b
) {
15655 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, (vector
unsigned long long)__b
,
15659 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool long long __a
,
15660 vector
signed long long __b
) {
15661 return __builtin_altivec_vcmpgtsd_p(__CR6_LT
, __b
,
15662 (vector
signed long long)__a
);
15665 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool long long __a
,
15666 vector
unsigned long long __b
) {
15667 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, __b
,
15668 (vector
unsigned long long)__a
);
15671 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
bool long long __a
,
15672 vector
bool long long __b
) {
15673 return __builtin_altivec_vcmpgtud_p(__CR6_LT
, (vector
unsigned long long)__b
,
15674 (vector
unsigned long long)__a
);
15678 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
float __a
,
15679 vector
float __b
) {
15681 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT
, __b
, __a
);
15683 return __builtin_altivec_vcmpgtfp_p(__CR6_LT
, __b
, __a
);
15688 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
double __a
,
15689 vector
double __b
) {
15690 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT
, __b
, __a
);
15694 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15695 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
signed __int128 __a
,
15696 vector
signed __int128 __b
) {
15697 return __builtin_altivec_vcmpgtsq_p(__CR6_LT
, __b
, __a
);
15700 static __inline__
int __ATTRS_o_ai
vec_all_lt(vector
unsigned __int128 __a
,
15701 vector
unsigned __int128 __b
) {
15702 return __builtin_altivec_vcmpgtuq_p(__CR6_LT
, __b
, __a
);
15708 static __inline__
int __ATTRS_o_ai
vec_all_nan(vector
float __a
) {
15710 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ
, __a
, __a
);
15712 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ
, __a
, __a
);
15717 static __inline__
int __ATTRS_o_ai
vec_all_nan(vector
double __a
) {
15718 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ
, __a
, __a
);
15724 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
signed char __a
,
15725 vector
signed char __b
) {
15726 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15730 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
signed char __a
,
15731 vector
bool char __b
) {
15732 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15736 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned char __a
,
15737 vector
unsigned char __b
) {
15738 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15742 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned char __a
,
15743 vector
bool char __b
) {
15744 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15748 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool char __a
,
15749 vector
signed char __b
) {
15750 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15754 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool char __a
,
15755 vector
unsigned char __b
) {
15756 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15760 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool char __a
,
15761 vector
bool char __b
) {
15762 return __builtin_altivec_vcmpequb_p(__CR6_EQ
, (vector
char)__a
,
15766 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
short __a
,
15767 vector
short __b
) {
15768 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, __a
, __b
);
15771 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
short __a
,
15772 vector
bool short __b
) {
15773 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, __a
, (vector
short)__b
);
15776 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned short __a
,
15777 vector
unsigned short __b
) {
15778 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, (vector
short)__a
,
15779 (vector
short)__b
);
15782 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned short __a
,
15783 vector
bool short __b
) {
15784 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, (vector
short)__a
,
15785 (vector
short)__b
);
15788 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool short __a
,
15789 vector
short __b
) {
15790 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, (vector
short)__a
,
15791 (vector
short)__b
);
15794 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool short __a
,
15795 vector
unsigned short __b
) {
15796 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, (vector
short)__a
,
15797 (vector
short)__b
);
15800 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool short __a
,
15801 vector
bool short __b
) {
15802 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, (vector
short)__a
,
15803 (vector
short)__b
);
15806 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector pixel __a
,
15807 vector pixel __b
) {
15808 return __builtin_altivec_vcmpequh_p(__CR6_EQ
, (vector
short)__a
,
15809 (vector
short)__b
);
15812 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
int __a
, vector
int __b
) {
15813 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, __a
, __b
);
15816 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
int __a
,
15817 vector
bool int __b
) {
15818 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, __a
, (vector
int)__b
);
15821 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned int __a
,
15822 vector
unsigned int __b
) {
15823 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, (vector
int)__a
,
15827 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned int __a
,
15828 vector
bool int __b
) {
15829 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, (vector
int)__a
,
15833 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool int __a
,
15835 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, (vector
int)__a
,
15839 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool int __a
,
15840 vector
unsigned int __b
) {
15841 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, (vector
int)__a
,
15845 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool int __a
,
15846 vector
bool int __b
) {
15847 return __builtin_altivec_vcmpequw_p(__CR6_EQ
, (vector
int)__a
,
15852 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
signed long long __a
,
15853 vector
signed long long __b
) {
15854 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, __a
, __b
);
15857 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned long long __a
,
15858 vector
unsigned long long __b
) {
15859 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, (vector
long long)__a
,
15860 (vector
long long)__b
);
15863 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
signed long long __a
,
15864 vector
bool long long __b
) {
15865 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, __a
,
15866 (vector
signed long long)__b
);
15869 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned long long __a
,
15870 vector
bool long long __b
) {
15871 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, (vector
signed long long)__a
,
15872 (vector
signed long long)__b
);
15875 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool long long __a
,
15876 vector
signed long long __b
) {
15877 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, (vector
signed long long)__a
,
15878 (vector
signed long long)__b
);
15881 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool long long __a
,
15882 vector
unsigned long long __b
) {
15883 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, (vector
signed long long)__a
,
15884 (vector
signed long long)__b
);
15887 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool long long __a
,
15888 vector
bool long long __b
) {
15889 return __builtin_altivec_vcmpequd_p(__CR6_EQ
, (vector
signed long long)__a
,
15890 (vector
signed long long)__b
);
15894 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
float __a
,
15895 vector
float __b
) {
15897 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ
, __a
, __b
);
15899 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ
, __a
, __b
);
15904 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
double __a
,
15905 vector
double __b
) {
15906 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ
, __a
, __b
);
15910 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15911 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
signed __int128 __a
,
15912 vector
signed __int128 __b
) {
15913 return __builtin_altivec_vcmpequq_p(__CR6_EQ
, (vector
unsigned __int128
)__a
,
15917 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
unsigned __int128 __a
,
15918 vector
unsigned __int128 __b
) {
15919 return __builtin_altivec_vcmpequq_p(__CR6_EQ
, __a
,
15920 (vector
signed __int128
)__b
);
15923 static __inline__
int __ATTRS_o_ai
vec_all_ne(vector
bool __int128 __a
,
15924 vector
bool __int128 __b
) {
15925 return __builtin_altivec_vcmpequq_p(__CR6_EQ
, (vector
unsigned __int128
)__a
,
15926 (vector
signed __int128
)__b
);
15932 static __inline__
int __ATTRS_o_ai
vec_all_nge(vector
float __a
,
15933 vector
float __b
) {
15935 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ
, __a
, __b
);
15937 return __builtin_altivec_vcmpgefp_p(__CR6_EQ
, __a
, __b
);
15942 static __inline__
int __ATTRS_o_ai
vec_all_nge(vector
double __a
,
15943 vector
double __b
) {
15944 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ
, __a
, __b
);
15950 static __inline__
int __ATTRS_o_ai
vec_all_ngt(vector
float __a
,
15951 vector
float __b
) {
15953 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ
, __a
, __b
);
15955 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ
, __a
, __b
);
15960 static __inline__
int __ATTRS_o_ai
vec_all_ngt(vector
double __a
,
15961 vector
double __b
) {
15962 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ
, __a
, __b
);
15968 static __inline__
int __ATTRS_o_ai
15969 vec_all_nle(vector
float __a
, vector
float __b
) {
15971 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ
, __b
, __a
);
15973 return __builtin_altivec_vcmpgefp_p(__CR6_EQ
, __b
, __a
);
15978 static __inline__
int __ATTRS_o_ai
vec_all_nle(vector
double __a
,
15979 vector
double __b
) {
15980 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ
, __b
, __a
);
15986 static __inline__
int __ATTRS_o_ai
15987 vec_all_nlt(vector
float __a
, vector
float __b
) {
15989 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ
, __b
, __a
);
15991 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ
, __b
, __a
);
15996 static __inline__
int __ATTRS_o_ai
vec_all_nlt(vector
double __a
,
15997 vector
double __b
) {
15998 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ
, __b
, __a
);
16002 /* vec_all_numeric */
16004 static __inline__
int __ATTRS_o_ai
16005 vec_all_numeric(vector
float __a
) {
16007 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT
, __a
, __a
);
16009 return __builtin_altivec_vcmpeqfp_p(__CR6_LT
, __a
, __a
);
16014 static __inline__
int __ATTRS_o_ai
vec_all_numeric(vector
double __a
) {
16015 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT
, __a
, __a
);
16021 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
signed char __a
,
16022 vector
signed char __b
) {
16023 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16027 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
signed char __a
,
16028 vector
bool char __b
) {
16029 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16033 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned char __a
,
16034 vector
unsigned char __b
) {
16035 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16039 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned char __a
,
16040 vector
bool char __b
) {
16041 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16045 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool char __a
,
16046 vector
signed char __b
) {
16047 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16051 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool char __a
,
16052 vector
unsigned char __b
) {
16053 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16057 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool char __a
,
16058 vector
bool char __b
) {
16059 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV
, (vector
char)__a
,
16063 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
short __a
,
16064 vector
short __b
) {
16065 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, __a
, __b
);
16068 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
short __a
,
16069 vector
bool short __b
) {
16070 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, __a
, (vector
short)__b
);
16073 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned short __a
,
16074 vector
unsigned short __b
) {
16075 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, (vector
short)__a
,
16076 (vector
short)__b
);
16079 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned short __a
,
16080 vector
bool short __b
) {
16081 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, (vector
short)__a
,
16082 (vector
short)__b
);
16085 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool short __a
,
16086 vector
short __b
) {
16087 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, (vector
short)__a
,
16088 (vector
short)__b
);
16091 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool short __a
,
16092 vector
unsigned short __b
) {
16093 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, (vector
short)__a
,
16094 (vector
short)__b
);
16097 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool short __a
,
16098 vector
bool short __b
) {
16099 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, (vector
short)__a
,
16100 (vector
short)__b
);
16103 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector pixel __a
,
16104 vector pixel __b
) {
16105 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV
, (vector
short)__a
,
16106 (vector
short)__b
);
16109 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
int __a
, vector
int __b
) {
16110 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, __a
, __b
);
16113 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
int __a
,
16114 vector
bool int __b
) {
16115 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, __a
, (vector
int)__b
);
16118 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned int __a
,
16119 vector
unsigned int __b
) {
16120 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, (vector
int)__a
,
16124 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned int __a
,
16125 vector
bool int __b
) {
16126 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, (vector
int)__a
,
16130 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool int __a
,
16132 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, (vector
int)__a
,
16136 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool int __a
,
16137 vector
unsigned int __b
) {
16138 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, (vector
int)__a
,
16142 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool int __a
,
16143 vector
bool int __b
) {
16144 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV
, (vector
int)__a
,
16149 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
signed long long __a
,
16150 vector
signed long long __b
) {
16151 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV
, __a
, __b
);
16154 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned long long __a
,
16155 vector
unsigned long long __b
) {
16156 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV
, (vector
long long)__a
,
16157 (vector
long long)__b
);
16160 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
signed long long __a
,
16161 vector
bool long long __b
) {
16162 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV
, __a
,
16163 (vector
signed long long)__b
);
16166 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned long long __a
,
16167 vector
bool long long __b
) {
16168 return __builtin_altivec_vcmpequd_p(
16169 __CR6_EQ_REV
, (vector
signed long long)__a
, (vector
signed long long)__b
);
16172 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool long long __a
,
16173 vector
signed long long __b
) {
16174 return __builtin_altivec_vcmpequd_p(
16175 __CR6_EQ_REV
, (vector
signed long long)__a
, (vector
signed long long)__b
);
16178 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool long long __a
,
16179 vector
unsigned long long __b
) {
16180 return __builtin_altivec_vcmpequd_p(
16181 __CR6_EQ_REV
, (vector
signed long long)__a
, (vector
signed long long)__b
);
16184 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool long long __a
,
16185 vector
bool long long __b
) {
16186 return __builtin_altivec_vcmpequd_p(
16187 __CR6_EQ_REV
, (vector
signed long long)__a
, (vector
signed long long)__b
);
16191 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
float __a
,
16192 vector
float __b
) {
16194 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV
, __a
, __b
);
16196 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV
, __a
, __b
);
16201 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
double __a
,
16202 vector
double __b
) {
16203 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV
, __a
, __b
);
16207 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16208 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
signed __int128 __a
,
16209 vector
signed __int128 __b
) {
16210 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV
,
16211 (vector
unsigned __int128
)__a
, __b
);
16214 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
unsigned __int128 __a
,
16215 vector
unsigned __int128 __b
) {
16216 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV
, __a
,
16217 (vector
signed __int128
)__b
);
16220 static __inline__
int __ATTRS_o_ai
vec_any_eq(vector
bool __int128 __a
,
16221 vector
bool __int128 __b
) {
16222 return __builtin_altivec_vcmpequq_p(
16223 __CR6_EQ_REV
, (vector
unsigned __int128
)__a
, (vector
signed __int128
)__b
);
16229 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
signed char __a
,
16230 vector
signed char __b
) {
16231 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV
, __b
, __a
);
16234 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
signed char __a
,
16235 vector
bool char __b
) {
16236 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV
, (vector
signed char)__b
,
16240 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned char __a
,
16241 vector
unsigned char __b
) {
16242 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, __b
, __a
);
16245 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned char __a
,
16246 vector
bool char __b
) {
16247 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, (vector
unsigned char)__b
,
16251 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool char __a
,
16252 vector
signed char __b
) {
16253 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV
, __b
,
16254 (vector
signed char)__a
);
16257 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool char __a
,
16258 vector
unsigned char __b
) {
16259 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, __b
,
16260 (vector
unsigned char)__a
);
16263 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool char __a
,
16264 vector
bool char __b
) {
16265 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, (vector
unsigned char)__b
,
16266 (vector
unsigned char)__a
);
16269 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
short __a
,
16270 vector
short __b
) {
16271 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV
, __b
, __a
);
16274 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
short __a
,
16275 vector
bool short __b
) {
16276 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV
, (vector
short)__b
, __a
);
16279 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned short __a
,
16280 vector
unsigned short __b
) {
16281 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, __b
, __a
);
16284 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned short __a
,
16285 vector
bool short __b
) {
16286 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, (vector
unsigned short)__b
,
16290 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool short __a
,
16291 vector
short __b
) {
16292 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV
, __b
,
16293 (vector
signed short)__a
);
16296 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool short __a
,
16297 vector
unsigned short __b
) {
16298 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, __b
,
16299 (vector
unsigned short)__a
);
16302 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool short __a
,
16303 vector
bool short __b
) {
16304 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, (vector
unsigned short)__b
,
16305 (vector
unsigned short)__a
);
16308 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
int __a
, vector
int __b
) {
16309 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV
, __b
, __a
);
16312 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
int __a
,
16313 vector
bool int __b
) {
16314 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV
, (vector
int)__b
, __a
);
16317 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned int __a
,
16318 vector
unsigned int __b
) {
16319 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, __b
, __a
);
16322 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned int __a
,
16323 vector
bool int __b
) {
16324 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, (vector
unsigned int)__b
,
16328 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool int __a
,
16330 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV
, __b
,
16331 (vector
signed int)__a
);
16334 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool int __a
,
16335 vector
unsigned int __b
) {
16336 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, __b
,
16337 (vector
unsigned int)__a
);
16340 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool int __a
,
16341 vector
bool int __b
) {
16342 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, (vector
unsigned int)__b
,
16343 (vector
unsigned int)__a
);
16347 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
signed long long __a
,
16348 vector
signed long long __b
) {
16349 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV
, __b
, __a
);
16352 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned long long __a
,
16353 vector
unsigned long long __b
) {
16354 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
, __b
, __a
);
16357 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
signed long long __a
,
16358 vector
bool long long __b
) {
16359 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV
,
16360 (vector
signed long long)__b
, __a
);
16363 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned long long __a
,
16364 vector
bool long long __b
) {
16365 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
,
16366 (vector
unsigned long long)__b
, __a
);
16369 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool long long __a
,
16370 vector
signed long long __b
) {
16371 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV
, __b
,
16372 (vector
signed long long)__a
);
16375 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool long long __a
,
16376 vector
unsigned long long __b
) {
16377 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
, __b
,
16378 (vector
unsigned long long)__a
);
16381 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
bool long long __a
,
16382 vector
bool long long __b
) {
16383 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
,
16384 (vector
unsigned long long)__b
,
16385 (vector
unsigned long long)__a
);
16389 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
float __a
,
16390 vector
float __b
) {
16392 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV
, __a
, __b
);
16394 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV
, __a
, __b
);
16399 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
double __a
,
16400 vector
double __b
) {
16401 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV
, __a
, __b
);
16405 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16406 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
signed __int128 __a
,
16407 vector
signed __int128 __b
) {
16408 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV
, __b
, __a
);
16411 static __inline__
int __ATTRS_o_ai
vec_any_ge(vector
unsigned __int128 __a
,
16412 vector
unsigned __int128 __b
) {
16413 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV
, __b
, __a
);
16419 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
signed char __a
,
16420 vector
signed char __b
) {
16421 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV
, __a
, __b
);
16424 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
signed char __a
,
16425 vector
bool char __b
) {
16426 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV
, __a
,
16427 (vector
signed char)__b
);
16430 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned char __a
,
16431 vector
unsigned char __b
) {
16432 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, __a
, __b
);
16435 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned char __a
,
16436 vector
bool char __b
) {
16437 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, __a
,
16438 (vector
unsigned char)__b
);
16441 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool char __a
,
16442 vector
signed char __b
) {
16443 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV
, (vector
signed char)__a
,
16447 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool char __a
,
16448 vector
unsigned char __b
) {
16449 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, (vector
unsigned char)__a
,
16453 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool char __a
,
16454 vector
bool char __b
) {
16455 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, (vector
unsigned char)__a
,
16456 (vector
unsigned char)__b
);
16459 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
short __a
,
16460 vector
short __b
) {
16461 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV
, __a
, __b
);
16464 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
short __a
,
16465 vector
bool short __b
) {
16466 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV
, __a
, (vector
short)__b
);
16469 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned short __a
,
16470 vector
unsigned short __b
) {
16471 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, __a
, __b
);
16474 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned short __a
,
16475 vector
bool short __b
) {
16476 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, __a
,
16477 (vector
unsigned short)__b
);
16480 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool short __a
,
16481 vector
short __b
) {
16482 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV
, (vector
signed short)__a
,
16486 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool short __a
,
16487 vector
unsigned short __b
) {
16488 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, (vector
unsigned short)__a
,
16492 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool short __a
,
16493 vector
bool short __b
) {
16494 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, (vector
unsigned short)__a
,
16495 (vector
unsigned short)__b
);
16498 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
int __a
, vector
int __b
) {
16499 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV
, __a
, __b
);
16502 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
int __a
,
16503 vector
bool int __b
) {
16504 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV
, __a
, (vector
int)__b
);
16507 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned int __a
,
16508 vector
unsigned int __b
) {
16509 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, __a
, __b
);
16512 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned int __a
,
16513 vector
bool int __b
) {
16514 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, __a
,
16515 (vector
unsigned int)__b
);
16518 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool int __a
,
16520 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV
, (vector
signed int)__a
,
16524 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool int __a
,
16525 vector
unsigned int __b
) {
16526 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, (vector
unsigned int)__a
,
16530 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool int __a
,
16531 vector
bool int __b
) {
16532 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, (vector
unsigned int)__a
,
16533 (vector
unsigned int)__b
);
16537 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
signed long long __a
,
16538 vector
signed long long __b
) {
16539 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV
, __a
, __b
);
16542 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned long long __a
,
16543 vector
unsigned long long __b
) {
16544 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
, __a
, __b
);
16547 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
signed long long __a
,
16548 vector
bool long long __b
) {
16549 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV
, __a
,
16550 (vector
signed long long)__b
);
16553 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned long long __a
,
16554 vector
bool long long __b
) {
16555 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
, __a
,
16556 (vector
unsigned long long)__b
);
16559 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool long long __a
,
16560 vector
signed long long __b
) {
16561 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV
,
16562 (vector
signed long long)__a
, __b
);
16565 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool long long __a
,
16566 vector
unsigned long long __b
) {
16567 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
,
16568 (vector
unsigned long long)__a
, __b
);
16571 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
bool long long __a
,
16572 vector
bool long long __b
) {
16573 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
,
16574 (vector
unsigned long long)__a
,
16575 (vector
unsigned long long)__b
);
16579 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
float __a
,
16580 vector
float __b
) {
16582 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV
, __a
, __b
);
16584 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV
, __a
, __b
);
16589 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
double __a
,
16590 vector
double __b
) {
16591 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV
, __a
, __b
);
16595 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16596 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
signed __int128 __a
,
16597 vector
signed __int128 __b
) {
16598 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV
, __a
, __b
);
16601 static __inline__
int __ATTRS_o_ai
vec_any_gt(vector
unsigned __int128 __a
,
16602 vector
unsigned __int128 __b
) {
16603 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV
, __a
, __b
);
16609 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
signed char __a
,
16610 vector
signed char __b
) {
16611 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV
, __a
, __b
);
16614 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
signed char __a
,
16615 vector
bool char __b
) {
16616 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV
, __a
,
16617 (vector
signed char)__b
);
16620 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned char __a
,
16621 vector
unsigned char __b
) {
16622 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, __a
, __b
);
16625 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned char __a
,
16626 vector
bool char __b
) {
16627 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, __a
,
16628 (vector
unsigned char)__b
);
16631 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool char __a
,
16632 vector
signed char __b
) {
16633 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV
, (vector
signed char)__a
,
16637 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool char __a
,
16638 vector
unsigned char __b
) {
16639 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, (vector
unsigned char)__a
,
16643 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool char __a
,
16644 vector
bool char __b
) {
16645 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV
, (vector
unsigned char)__a
,
16646 (vector
unsigned char)__b
);
16649 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
short __a
,
16650 vector
short __b
) {
16651 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV
, __a
, __b
);
16654 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
short __a
,
16655 vector
bool short __b
) {
16656 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV
, __a
, (vector
short)__b
);
16659 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned short __a
,
16660 vector
unsigned short __b
) {
16661 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, __a
, __b
);
16664 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned short __a
,
16665 vector
bool short __b
) {
16666 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, __a
,
16667 (vector
unsigned short)__b
);
16670 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool short __a
,
16671 vector
short __b
) {
16672 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV
, (vector
signed short)__a
,
16676 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool short __a
,
16677 vector
unsigned short __b
) {
16678 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, (vector
unsigned short)__a
,
16682 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool short __a
,
16683 vector
bool short __b
) {
16684 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV
, (vector
unsigned short)__a
,
16685 (vector
unsigned short)__b
);
16688 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
int __a
, vector
int __b
) {
16689 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV
, __a
, __b
);
16692 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
int __a
,
16693 vector
bool int __b
) {
16694 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV
, __a
, (vector
int)__b
);
16697 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned int __a
,
16698 vector
unsigned int __b
) {
16699 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, __a
, __b
);
16702 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned int __a
,
16703 vector
bool int __b
) {
16704 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, __a
,
16705 (vector
unsigned int)__b
);
16708 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool int __a
,
16710 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV
, (vector
signed int)__a
,
16714 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool int __a
,
16715 vector
unsigned int __b
) {
16716 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, (vector
unsigned int)__a
,
16720 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool int __a
,
16721 vector
bool int __b
) {
16722 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV
, (vector
unsigned int)__a
,
16723 (vector
unsigned int)__b
);
16727 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
signed long long __a
,
16728 vector
signed long long __b
) {
16729 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV
, __a
, __b
);
16732 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned long long __a
,
16733 vector
unsigned long long __b
) {
16734 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
, __a
, __b
);
16737 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
signed long long __a
,
16738 vector
bool long long __b
) {
16739 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV
, __a
,
16740 (vector
signed long long)__b
);
16743 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned long long __a
,
16744 vector
bool long long __b
) {
16745 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
, __a
,
16746 (vector
unsigned long long)__b
);
16749 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool long long __a
,
16750 vector
signed long long __b
) {
16751 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV
,
16752 (vector
signed long long)__a
, __b
);
16755 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool long long __a
,
16756 vector
unsigned long long __b
) {
16757 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
,
16758 (vector
unsigned long long)__a
, __b
);
16761 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
bool long long __a
,
16762 vector
bool long long __b
) {
16763 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV
,
16764 (vector
unsigned long long)__a
,
16765 (vector
unsigned long long)__b
);
16769 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
float __a
,
16770 vector
float __b
) {
16772 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV
, __b
, __a
);
16774 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV
, __b
, __a
);
16779 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
double __a
,
16780 vector
double __b
) {
16781 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV
, __b
, __a
);
16785 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16786 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
signed __int128 __a
,
16787 vector
signed __int128 __b
) {
16788 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV
, __a
, __b
);
16791 static __inline__
int __ATTRS_o_ai
vec_any_le(vector
unsigned __int128 __a
,
16792 vector
unsigned __int128 __b
) {
16793 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV
, __a
, __b
);
16799 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
signed char __a
,
16800 vector
signed char __b
) {
16801 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV
, __b
, __a
);
16804 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
signed char __a
,
16805 vector
bool char __b
) {
16806 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV
, (vector
signed char)__b
,
16810 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned char __a
,
16811 vector
unsigned char __b
) {
16812 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, __b
, __a
);
16815 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned char __a
,
16816 vector
bool char __b
) {
16817 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, (vector
unsigned char)__b
,
16821 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool char __a
,
16822 vector
signed char __b
) {
16823 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV
, __b
,
16824 (vector
signed char)__a
);
16827 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool char __a
,
16828 vector
unsigned char __b
) {
16829 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, __b
,
16830 (vector
unsigned char)__a
);
16833 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool char __a
,
16834 vector
bool char __b
) {
16835 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV
, (vector
unsigned char)__b
,
16836 (vector
unsigned char)__a
);
16839 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
short __a
,
16840 vector
short __b
) {
16841 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV
, __b
, __a
);
16844 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
short __a
,
16845 vector
bool short __b
) {
16846 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV
, (vector
short)__b
, __a
);
16849 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned short __a
,
16850 vector
unsigned short __b
) {
16851 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, __b
, __a
);
16854 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned short __a
,
16855 vector
bool short __b
) {
16856 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, (vector
unsigned short)__b
,
16860 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool short __a
,
16861 vector
short __b
) {
16862 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV
, __b
,
16863 (vector
signed short)__a
);
16866 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool short __a
,
16867 vector
unsigned short __b
) {
16868 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, __b
,
16869 (vector
unsigned short)__a
);
16872 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool short __a
,
16873 vector
bool short __b
) {
16874 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV
, (vector
unsigned short)__b
,
16875 (vector
unsigned short)__a
);
16878 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
int __a
, vector
int __b
) {
16879 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV
, __b
, __a
);
16882 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
int __a
,
16883 vector
bool int __b
) {
16884 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV
, (vector
int)__b
, __a
);
16887 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned int __a
,
16888 vector
unsigned int __b
) {
16889 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, __b
, __a
);
16892 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned int __a
,
16893 vector
bool int __b
) {
16894 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, (vector
unsigned int)__b
,
16898 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool int __a
,
16900 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV
, __b
,
16901 (vector
signed int)__a
);
16904 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool int __a
,
16905 vector
unsigned int __b
) {
16906 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, __b
,
16907 (vector
unsigned int)__a
);
16910 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool int __a
,
16911 vector
bool int __b
) {
16912 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV
, (vector
unsigned int)__b
,
16913 (vector
unsigned int)__a
);
16917 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
signed long long __a
,
16918 vector
signed long long __b
) {
16919 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV
, __b
, __a
);
16922 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned long long __a
,
16923 vector
unsigned long long __b
) {
16924 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
, __b
, __a
);
16927 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
signed long long __a
,
16928 vector
bool long long __b
) {
16929 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV
,
16930 (vector
signed long long)__b
, __a
);
16933 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned long long __a
,
16934 vector
bool long long __b
) {
16935 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
,
16936 (vector
unsigned long long)__b
, __a
);
16939 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool long long __a
,
16940 vector
signed long long __b
) {
16941 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV
, __b
,
16942 (vector
signed long long)__a
);
16945 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool long long __a
,
16946 vector
unsigned long long __b
) {
16947 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
, __b
,
16948 (vector
unsigned long long)__a
);
16951 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
bool long long __a
,
16952 vector
bool long long __b
) {
16953 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV
,
16954 (vector
unsigned long long)__b
,
16955 (vector
unsigned long long)__a
);
16959 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
float __a
,
16960 vector
float __b
) {
16962 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV
, __b
, __a
);
16964 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV
, __b
, __a
);
16969 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
double __a
,
16970 vector
double __b
) {
16971 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV
, __b
, __a
);
16975 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16976 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
signed __int128 __a
,
16977 vector
signed __int128 __b
) {
16978 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV
, __b
, __a
);
16981 static __inline__
int __ATTRS_o_ai
vec_any_lt(vector
unsigned __int128 __a
,
16982 vector
unsigned __int128 __b
) {
16983 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV
, __b
, __a
);
16989 static __inline__
int __ATTRS_o_ai
vec_any_nan(vector
float __a
) {
16991 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV
, __a
, __a
);
16993 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV
, __a
, __a
);
16997 static __inline__
int __ATTRS_o_ai
vec_any_nan(vector
double __a
) {
16998 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV
, __a
, __a
);
17004 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
signed char __a
,
17005 vector
signed char __b
) {
17006 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17010 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
signed char __a
,
17011 vector
bool char __b
) {
17012 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17016 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned char __a
,
17017 vector
unsigned char __b
) {
17018 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17022 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned char __a
,
17023 vector
bool char __b
) {
17024 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17028 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool char __a
,
17029 vector
signed char __b
) {
17030 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17034 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool char __a
,
17035 vector
unsigned char __b
) {
17036 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17040 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool char __a
,
17041 vector
bool char __b
) {
17042 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV
, (vector
char)__a
,
17046 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
short __a
,
17047 vector
short __b
) {
17048 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, __a
, __b
);
17051 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
short __a
,
17052 vector
bool short __b
) {
17053 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, __a
, (vector
short)__b
);
17056 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned short __a
,
17057 vector
unsigned short __b
) {
17058 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, (vector
short)__a
,
17059 (vector
short)__b
);
17062 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned short __a
,
17063 vector
bool short __b
) {
17064 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, (vector
short)__a
,
17065 (vector
short)__b
);
17068 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool short __a
,
17069 vector
short __b
) {
17070 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, (vector
short)__a
,
17071 (vector
short)__b
);
17074 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool short __a
,
17075 vector
unsigned short __b
) {
17076 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, (vector
short)__a
,
17077 (vector
short)__b
);
17080 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool short __a
,
17081 vector
bool short __b
) {
17082 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, (vector
short)__a
,
17083 (vector
short)__b
);
17086 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector pixel __a
,
17087 vector pixel __b
) {
17088 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV
, (vector
short)__a
,
17089 (vector
short)__b
);
17092 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
int __a
, vector
int __b
) {
17093 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, __a
, __b
);
17096 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
int __a
,
17097 vector
bool int __b
) {
17098 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, __a
, (vector
int)__b
);
17101 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned int __a
,
17102 vector
unsigned int __b
) {
17103 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, (vector
int)__a
,
17107 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned int __a
,
17108 vector
bool int __b
) {
17109 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, (vector
int)__a
,
17113 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool int __a
,
17115 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, (vector
int)__a
,
17119 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool int __a
,
17120 vector
unsigned int __b
) {
17121 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, (vector
int)__a
,
17125 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool int __a
,
17126 vector
bool int __b
) {
17127 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV
, (vector
int)__a
,
17132 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
signed long long __a
,
17133 vector
signed long long __b
) {
17134 #ifdef __POWER8_VECTOR__
17135 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV
, __a
, __b
);
17137 // Take advantage of the optimized sequence for vec_all_eq when vcmpequd is
17139 return !vec_all_eq(__a
, __b
);
17143 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned long long __a
,
17144 vector
unsigned long long __b
) {
17145 return vec_any_ne((vector
signed long long)__a
, (vector
signed long long)__b
);
17148 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
signed long long __a
,
17149 vector
bool long long __b
) {
17150 return vec_any_ne((vector
signed long long)__a
, (vector
signed long long)__b
);
17153 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned long long __a
,
17154 vector
bool long long __b
) {
17155 return vec_any_ne((vector
signed long long)__a
, (vector
signed long long)__b
);
17158 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool long long __a
,
17159 vector
signed long long __b
) {
17160 return vec_any_ne((vector
signed long long)__a
, (vector
signed long long)__b
);
17163 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool long long __a
,
17164 vector
unsigned long long __b
) {
17165 return vec_any_ne((vector
signed long long)__a
, (vector
signed long long)__b
);
17168 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool long long __a
,
17169 vector
bool long long __b
) {
17170 return vec_any_ne((vector
signed long long)__a
, (vector
signed long long)__b
);
17174 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
float __a
,
17175 vector
float __b
) {
17177 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV
, __a
, __b
);
17179 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV
, __a
, __b
);
17184 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
double __a
,
17185 vector
double __b
) {
17186 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV
, __a
, __b
);
17190 #if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
17191 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
signed __int128 __a
,
17192 vector
signed __int128 __b
) {
17193 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV
,
17194 (vector
unsigned __int128
)__a
, __b
);
17197 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
unsigned __int128 __a
,
17198 vector
unsigned __int128 __b
) {
17199 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV
, __a
,
17200 (vector
signed __int128
)__b
);
17203 static __inline__
int __ATTRS_o_ai
vec_any_ne(vector
bool __int128 __a
,
17204 vector
bool __int128 __b
) {
17205 return __builtin_altivec_vcmpequq_p(
17206 __CR6_LT_REV
, (vector
unsigned __int128
)__a
, (vector
signed __int128
)__b
);
17212 static __inline__
int __ATTRS_o_ai
vec_any_nge(vector
float __a
,
17213 vector
float __b
) {
17215 return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV
, __a
, __b
);
17217 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV
, __a
, __b
);
17222 static __inline__
int __ATTRS_o_ai
vec_any_nge(vector
double __a
,
17223 vector
double __b
) {
17224 return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV
, __a
, __b
);
17230 static __inline__
int __ATTRS_o_ai
vec_any_ngt(vector
float __a
,
17231 vector
float __b
) {
17233 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV
, __a
, __b
);
17235 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV
, __a
, __b
);
17240 static __inline__
int __ATTRS_o_ai
vec_any_ngt(vector
double __a
,
17241 vector
double __b
) {
17242 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV
, __a
, __b
);
17248 static __inline__
int __ATTRS_o_ai
vec_any_nle(vector
float __a
,
17249 vector
float __b
) {
17251 return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV
, __b
, __a
);
17253 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV
, __b
, __a
);
17258 static __inline__
int __ATTRS_o_ai
vec_any_nle(vector
double __a
,
17259 vector
double __b
) {
17260 return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV
, __b
, __a
);
17266 static __inline__
int __ATTRS_o_ai
vec_any_nlt(vector
float __a
,
17267 vector
float __b
) {
17269 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV
, __b
, __a
);
17271 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV
, __b
, __a
);
17276 static __inline__
int __ATTRS_o_ai
vec_any_nlt(vector
double __a
,
17277 vector
double __b
) {
17278 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV
, __b
, __a
);
17282 /* vec_any_numeric */
17284 static __inline__
int __ATTRS_o_ai
vec_any_numeric(vector
float __a
) {
17286 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV
, __a
, __a
);
17288 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV
, __a
, __a
);
17293 static __inline__
int __ATTRS_o_ai
vec_any_numeric(vector
double __a
) {
17294 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV
, __a
, __a
);
17300 static __inline__
int __attribute__((__always_inline__
))
17301 vec_any_out(vector
float __a
, vector
float __b
) {
17302 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV
, __a
, __b
);
17305 /* Power 8 Crypto functions
17306 Note: We diverge from the current GCC implementation with regard
17307 to cryptography and related functions as follows:
17308 - Only the SHA and AES instructions and builtins are disabled by -mno-crypto
17309 - The remaining ones are only available on Power8 and up so
17310 require -mpower8-vector
17311 The justification for this is that export requirements require that
17312 Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
17313 support). As a result, we need to be able to turn off support for those.
17314 The remaining ones (currently controlled by -mcrypto for GCC) still
17315 need to be provided on compliant hardware even if Vector.Crypto is not
17319 #define vec_sbox_be __builtin_altivec_crypto_vsbox
17320 #define vec_cipher_be __builtin_altivec_crypto_vcipher
17321 #define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
17322 #define vec_ncipher_be __builtin_altivec_crypto_vncipher
17323 #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
17326 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
17327 __builtin_crypto_vsbox(vector
unsigned char __a
) {
17328 return __builtin_altivec_crypto_vsbox(__a
);
17331 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
17332 __builtin_crypto_vcipher(vector
unsigned char __a
,
17333 vector
unsigned char __b
) {
17334 return __builtin_altivec_crypto_vcipher(__a
, __b
);
17337 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
17338 __builtin_crypto_vcipherlast(vector
unsigned char __a
,
17339 vector
unsigned char __b
) {
17340 return __builtin_altivec_crypto_vcipherlast(__a
, __b
);
17343 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
17344 __builtin_crypto_vncipher(vector
unsigned char __a
,
17345 vector
unsigned char __b
) {
17346 return __builtin_altivec_crypto_vncipher(__a
, __b
);
17349 static __inline__ vector
unsigned char __attribute__((__always_inline__
))
17350 __builtin_crypto_vncipherlast(vector
unsigned char __a
,
17351 vector
unsigned char __b
) {
17352 return __builtin_altivec_crypto_vncipherlast(__a
, __b
);
17354 #endif /* __VSX__ */
17356 #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
17357 #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
17359 #define vec_shasigma_be(X, Y, Z) \
17360 _Generic((X), vector unsigned int \
17361 : __builtin_crypto_vshasigmaw, vector unsigned long long \
17362 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
17365 #ifdef __POWER8_VECTOR__
17366 static __inline__ vector
bool char __ATTRS_o_ai
17367 vec_permxor(vector
bool char __a
, vector
bool char __b
,
17368 vector
bool char __c
) {
17369 return (vector
bool char)__builtin_altivec_crypto_vpermxor(
17370 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
17371 (vector
unsigned char)__c
);
17374 static __inline__ vector
signed char __ATTRS_o_ai
17375 vec_permxor(vector
signed char __a
, vector
signed char __b
,
17376 vector
signed char __c
) {
17377 return (vector
signed char)__builtin_altivec_crypto_vpermxor(
17378 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
17379 (vector
unsigned char)__c
);
17382 static __inline__ vector
unsigned char __ATTRS_o_ai
17383 vec_permxor(vector
unsigned char __a
, vector
unsigned char __b
,
17384 vector
unsigned char __c
) {
17385 return __builtin_altivec_crypto_vpermxor(__a
, __b
, __c
);
17388 static __inline__ vector
unsigned char __ATTRS_o_ai
17389 __builtin_crypto_vpermxor(vector
unsigned char __a
, vector
unsigned char __b
,
17390 vector
unsigned char __c
) {
17391 return __builtin_altivec_crypto_vpermxor(__a
, __b
, __c
);
17394 static __inline__ vector
unsigned short __ATTRS_o_ai
17395 __builtin_crypto_vpermxor(vector
unsigned short __a
, vector
unsigned short __b
,
17396 vector
unsigned short __c
) {
17397 return (vector
unsigned short)__builtin_altivec_crypto_vpermxor(
17398 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
17399 (vector
unsigned char)__c
);
17402 static __inline__ vector
unsigned int __ATTRS_o_ai
__builtin_crypto_vpermxor(
17403 vector
unsigned int __a
, vector
unsigned int __b
, vector
unsigned int __c
) {
17404 return (vector
unsigned int)__builtin_altivec_crypto_vpermxor(
17405 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
17406 (vector
unsigned char)__c
);
17409 static __inline__ vector
unsigned long long __ATTRS_o_ai
17410 __builtin_crypto_vpermxor(vector
unsigned long long __a
,
17411 vector
unsigned long long __b
,
17412 vector
unsigned long long __c
) {
17413 return (vector
unsigned long long)__builtin_altivec_crypto_vpermxor(
17414 (vector
unsigned char)__a
, (vector
unsigned char)__b
,
17415 (vector
unsigned char)__c
);
17418 static __inline__ vector
unsigned char __ATTRS_o_ai
17419 __builtin_crypto_vpmsumb(vector
unsigned char __a
, vector
unsigned char __b
) {
17420 return __builtin_altivec_crypto_vpmsumb(__a
, __b
);
17423 static __inline__ vector
unsigned short __ATTRS_o_ai
17424 __builtin_crypto_vpmsumb(vector
unsigned short __a
, vector
unsigned short __b
) {
17425 return __builtin_altivec_crypto_vpmsumh(__a
, __b
);
17428 static __inline__ vector
unsigned int __ATTRS_o_ai
17429 __builtin_crypto_vpmsumb(vector
unsigned int __a
, vector
unsigned int __b
) {
17430 return __builtin_altivec_crypto_vpmsumw(__a
, __b
);
17433 static __inline__ vector
unsigned long long __ATTRS_o_ai
17434 __builtin_crypto_vpmsumb(vector
unsigned long long __a
,
17435 vector
unsigned long long __b
) {
17436 return __builtin_altivec_crypto_vpmsumd(__a
, __b
);
17439 static __inline__ vector
signed char __ATTRS_o_ai
17440 vec_vgbbd(vector
signed char __a
) {
17441 return (vector
signed char)__builtin_altivec_vgbbd((vector
unsigned char)__a
);
17444 #define vec_pmsum_be __builtin_crypto_vpmsumb
17445 #define vec_gb __builtin_altivec_vgbbd
17447 static __inline__ vector
unsigned char __ATTRS_o_ai
17448 vec_vgbbd(vector
unsigned char __a
) {
17449 return __builtin_altivec_vgbbd(__a
);
17452 static __inline__ vector
signed long long __ATTRS_o_ai
17453 vec_gbb(vector
signed long long __a
) {
17454 return (vector
signed long long)__builtin_altivec_vgbbd(
17455 (vector
unsigned char)__a
);
17458 static __inline__ vector
unsigned long long __ATTRS_o_ai
17459 vec_gbb(vector
unsigned long long __a
) {
17460 return (vector
unsigned long long)__builtin_altivec_vgbbd(
17461 (vector
unsigned char)__a
);
17464 static __inline__ vector
long long __ATTRS_o_ai
17465 vec_vbpermq(vector
signed char __a
, vector
signed char __b
) {
17466 return (vector
long long)__builtin_altivec_vbpermq((vector
unsigned char)__a
,
17467 (vector
unsigned char)__b
);
17470 static __inline__ vector
long long __ATTRS_o_ai
17471 vec_vbpermq(vector
unsigned char __a
, vector
unsigned char __b
) {
17472 return (vector
long long)__builtin_altivec_vbpermq(__a
, __b
);
17475 #if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
17476 static __inline__ vector
unsigned long long __ATTRS_o_ai
17477 vec_bperm(vector
unsigned __int128 __a
, vector
unsigned char __b
) {
17478 return __builtin_altivec_vbpermq((vector
unsigned char)__a
,
17479 (vector
unsigned char)__b
);
17482 static __inline__ vector
unsigned char __ATTRS_o_ai
17483 vec_bperm(vector
unsigned char __a
, vector
unsigned char __b
) {
17484 return (vector
unsigned char)__builtin_altivec_vbpermq(__a
, __b
);
17486 #endif // __POWER8_VECTOR__
17487 #ifdef __POWER9_VECTOR__
17488 static __inline__ vector
unsigned long long __ATTRS_o_ai
17489 vec_bperm(vector
unsigned long long __a
, vector
unsigned char __b
) {
17490 return __builtin_altivec_vbpermd(__a
, __b
);
17497 static inline __ATTRS_o_ai vector
bool char vec_reve(vector
bool char __a
) {
17498 return __builtin_shufflevector(__a
, __a
, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17502 static inline __ATTRS_o_ai vector
signed char vec_reve(vector
signed char __a
) {
17503 return __builtin_shufflevector(__a
, __a
, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17507 static inline __ATTRS_o_ai vector
unsigned char
17508 vec_reve(vector
unsigned char __a
) {
17509 return __builtin_shufflevector(__a
, __a
, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17513 static inline __ATTRS_o_ai vector
bool int vec_reve(vector
bool int __a
) {
17514 return __builtin_shufflevector(__a
, __a
, 3, 2, 1, 0);
17517 static inline __ATTRS_o_ai vector
signed int vec_reve(vector
signed int __a
) {
17518 return __builtin_shufflevector(__a
, __a
, 3, 2, 1, 0);
17521 static inline __ATTRS_o_ai vector
unsigned int
17522 vec_reve(vector
unsigned int __a
) {
17523 return __builtin_shufflevector(__a
, __a
, 3, 2, 1, 0);
17526 static inline __ATTRS_o_ai vector
bool short vec_reve(vector
bool short __a
) {
17527 return __builtin_shufflevector(__a
, __a
, 7, 6, 5, 4, 3, 2, 1, 0);
17530 static inline __ATTRS_o_ai vector
signed short
17531 vec_reve(vector
signed short __a
) {
17532 return __builtin_shufflevector(__a
, __a
, 7, 6, 5, 4, 3, 2, 1, 0);
17535 static inline __ATTRS_o_ai vector
unsigned short
17536 vec_reve(vector
unsigned short __a
) {
17537 return __builtin_shufflevector(__a
, __a
, 7, 6, 5, 4, 3, 2, 1, 0);
17540 static inline __ATTRS_o_ai vector
float vec_reve(vector
float __a
) {
17541 return __builtin_shufflevector(__a
, __a
, 3, 2, 1, 0);
17545 static inline __ATTRS_o_ai vector
bool long long
17546 vec_reve(vector
bool long long __a
) {
17547 return __builtin_shufflevector(__a
, __a
, 1, 0);
17550 static inline __ATTRS_o_ai vector
signed long long
17551 vec_reve(vector
signed long long __a
) {
17552 return __builtin_shufflevector(__a
, __a
, 1, 0);
17555 static inline __ATTRS_o_ai vector
unsigned long long
17556 vec_reve(vector
unsigned long long __a
) {
17557 return __builtin_shufflevector(__a
, __a
, 1, 0);
17560 static inline __ATTRS_o_ai vector
double vec_reve(vector
double __a
) {
17561 return __builtin_shufflevector(__a
, __a
, 1, 0);
17566 static __inline__ vector
bool char __ATTRS_o_ai
17567 vec_revb(vector
bool char __a
) {
17571 static __inline__ vector
signed char __ATTRS_o_ai
17572 vec_revb(vector
signed char __a
) {
17576 static __inline__ vector
unsigned char __ATTRS_o_ai
17577 vec_revb(vector
unsigned char __a
) {
17581 static __inline__ vector
bool short __ATTRS_o_ai
17582 vec_revb(vector
bool short __a
) {
17583 vector
unsigned char __indices
=
17584 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17585 return vec_perm(__a
, __a
, __indices
);
17588 static __inline__ vector
signed short __ATTRS_o_ai
17589 vec_revb(vector
signed short __a
) {
17590 vector
unsigned char __indices
=
17591 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17592 return vec_perm(__a
, __a
, __indices
);
17595 static __inline__ vector
unsigned short __ATTRS_o_ai
17596 vec_revb(vector
unsigned short __a
) {
17597 vector
unsigned char __indices
=
17598 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17599 return vec_perm(__a
, __a
, __indices
);
17602 static __inline__ vector
bool int __ATTRS_o_ai
17603 vec_revb(vector
bool int __a
) {
17604 vector
unsigned char __indices
=
17605 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17606 return vec_perm(__a
, __a
, __indices
);
17609 static __inline__ vector
signed int __ATTRS_o_ai
17610 vec_revb(vector
signed int __a
) {
17611 vector
unsigned char __indices
=
17612 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17613 return vec_perm(__a
, __a
, __indices
);
17616 static __inline__ vector
unsigned int __ATTRS_o_ai
17617 vec_revb(vector
unsigned int __a
) {
17618 vector
unsigned char __indices
=
17619 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17620 return vec_perm(__a
, __a
, __indices
);
17623 static __inline__ vector
float __ATTRS_o_ai
17624 vec_revb(vector
float __a
) {
17625 vector
unsigned char __indices
=
17626 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17627 return vec_perm(__a
, __a
, __indices
);
17631 static __inline__ vector
bool long long __ATTRS_o_ai
17632 vec_revb(vector
bool long long __a
) {
17633 vector
unsigned char __indices
=
17634 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17635 return vec_perm(__a
, __a
, __indices
);
17638 static __inline__ vector
signed long long __ATTRS_o_ai
17639 vec_revb(vector
signed long long __a
) {
17640 vector
unsigned char __indices
=
17641 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17642 return vec_perm(__a
, __a
, __indices
);
17645 static __inline__ vector
unsigned long long __ATTRS_o_ai
17646 vec_revb(vector
unsigned long long __a
) {
17647 vector
unsigned char __indices
=
17648 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17649 return vec_perm(__a
, __a
, __indices
);
17652 static __inline__ vector
double __ATTRS_o_ai
17653 vec_revb(vector
double __a
) {
17654 vector
unsigned char __indices
=
17655 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17656 return vec_perm(__a
, __a
, __indices
);
17658 #endif /* End __VSX__ */
17660 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17661 defined(__SIZEOF_INT128__)
17662 static __inline__ vector
signed __int128 __ATTRS_o_ai
17663 vec_revb(vector
signed __int128 __a
) {
17664 vector
unsigned char __indices
=
17665 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17666 return (vector
signed __int128
)vec_perm((vector
signed int)__a
,
17667 (vector
signed int)__a
,
17671 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
17672 vec_revb(vector
unsigned __int128 __a
) {
17673 vector
unsigned char __indices
=
17674 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17675 return (vector
unsigned __int128
)vec_perm((vector
signed int)__a
,
17676 (vector
signed int)__a
,
17679 #endif /* END __POWER8_VECTOR__ && __powerpc64__ */
17683 #define vec_xld2 vec_xl
17684 #define vec_xlw4 vec_xl
17685 typedef vector
signed char unaligned_vec_schar
__attribute__((aligned(1)));
17686 typedef vector
unsigned char unaligned_vec_uchar
__attribute__((aligned(1)));
17687 typedef vector
signed short unaligned_vec_sshort
__attribute__((aligned(1)));
17688 typedef vector
unsigned short unaligned_vec_ushort
__attribute__((aligned(1)));
17689 typedef vector
signed int unaligned_vec_sint
__attribute__((aligned(1)));
17690 typedef vector
unsigned int unaligned_vec_uint
__attribute__((aligned(1)));
17691 typedef vector
float unaligned_vec_float
__attribute__((aligned(1)));
17693 static inline __ATTRS_o_ai vector
signed char vec_xl(ptrdiff_t __offset
,
17694 const signed char *__ptr
) {
17695 return *(unaligned_vec_schar
*)(__ptr
+ __offset
);
17698 static inline __ATTRS_o_ai vector
unsigned char
17699 vec_xl(ptrdiff_t __offset
, const unsigned char *__ptr
) {
17700 return *(unaligned_vec_uchar
*)(__ptr
+ __offset
);
17703 static inline __ATTRS_o_ai vector
signed short
17704 vec_xl(ptrdiff_t __offset
, const signed short *__ptr
) {
17705 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17706 return *(unaligned_vec_sshort
*)__addr
;
17709 static inline __ATTRS_o_ai vector
unsigned short
17710 vec_xl(ptrdiff_t __offset
, const unsigned short *__ptr
) {
17711 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17712 return *(unaligned_vec_ushort
*)__addr
;
17715 static inline __ATTRS_o_ai vector
signed int vec_xl(ptrdiff_t __offset
,
17716 const signed int *__ptr
) {
17717 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17718 return *(unaligned_vec_sint
*)__addr
;
17721 static inline __ATTRS_o_ai vector
unsigned int
17722 vec_xl(ptrdiff_t __offset
, const unsigned int *__ptr
) {
17723 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17724 return *(unaligned_vec_uint
*)__addr
;
17727 static inline __ATTRS_o_ai vector
float vec_xl(ptrdiff_t __offset
,
17728 const float *__ptr
) {
17729 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17730 return *(unaligned_vec_float
*)__addr
;
17734 typedef vector
signed long long unaligned_vec_sll
__attribute__((aligned(1)));
17735 typedef vector
unsigned long long unaligned_vec_ull
__attribute__((aligned(1)));
17736 typedef vector
double unaligned_vec_double
__attribute__((aligned(1)));
17738 static inline __ATTRS_o_ai vector
signed long long
17739 vec_xl(ptrdiff_t __offset
, const signed long long *__ptr
) {
17740 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17741 return *(unaligned_vec_sll
*)__addr
;
17744 static inline __ATTRS_o_ai vector
unsigned long long
17745 vec_xl(ptrdiff_t __offset
, const unsigned long long *__ptr
) {
17746 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17747 return *(unaligned_vec_ull
*)__addr
;
17750 static inline __ATTRS_o_ai vector
double vec_xl(ptrdiff_t __offset
,
17751 const double *__ptr
) {
17752 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17753 return *(unaligned_vec_double
*)__addr
;
17757 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17758 defined(__SIZEOF_INT128__)
17759 typedef vector
signed __int128 unaligned_vec_si128
__attribute__((aligned(1)));
17760 typedef vector
unsigned __int128 unaligned_vec_ui128
17761 __attribute__((aligned(1)));
17762 static inline __ATTRS_o_ai vector
signed __int128
17763 vec_xl(ptrdiff_t __offset
, const signed __int128
*__ptr
) {
17764 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17765 return *(unaligned_vec_si128
*)__addr
;
17768 static inline __ATTRS_o_ai vector
unsigned __int128
17769 vec_xl(ptrdiff_t __offset
, const unsigned __int128
*__ptr
) {
17770 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17771 return *(unaligned_vec_ui128
*)__addr
;
17777 #ifdef __LITTLE_ENDIAN__
17778 static __inline__ vector
signed char __ATTRS_o_ai
17779 vec_xl_be(ptrdiff_t __offset
, const signed char *__ptr
) {
17780 vector
signed char __vec
= (vector
signed char)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17781 return __builtin_shufflevector(__vec
, __vec
, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17782 13, 12, 11, 10, 9, 8);
17785 static __inline__ vector
unsigned char __ATTRS_o_ai
17786 vec_xl_be(ptrdiff_t __offset
, const unsigned char *__ptr
) {
17787 vector
unsigned char __vec
= (vector
unsigned char)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17788 return __builtin_shufflevector(__vec
, __vec
, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17789 13, 12, 11, 10, 9, 8);
17792 static __inline__ vector
signed short __ATTRS_o_ai
17793 vec_xl_be(ptrdiff_t __offset
, const signed short *__ptr
) {
17794 vector
signed short __vec
= (vector
signed short)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17795 return __builtin_shufflevector(__vec
, __vec
, 3, 2, 1, 0, 7, 6, 5, 4);
17798 static __inline__ vector
unsigned short __ATTRS_o_ai
17799 vec_xl_be(ptrdiff_t __offset
, const unsigned short *__ptr
) {
17800 vector
unsigned short __vec
= (vector
unsigned short)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17801 return __builtin_shufflevector(__vec
, __vec
, 3, 2, 1, 0, 7, 6, 5, 4);
17804 static __inline__ vector
signed int __ATTRS_o_ai
17805 vec_xl_be(signed long long __offset
, const signed int *__ptr
) {
17806 return (vector
signed int)__builtin_vsx_lxvw4x_be(__offset
, __ptr
);
17809 static __inline__ vector
unsigned int __ATTRS_o_ai
17810 vec_xl_be(signed long long __offset
, const unsigned int *__ptr
) {
17811 return (vector
unsigned int)__builtin_vsx_lxvw4x_be(__offset
, __ptr
);
17814 static __inline__ vector
float __ATTRS_o_ai
17815 vec_xl_be(signed long long __offset
, const float *__ptr
) {
17816 return (vector
float)__builtin_vsx_lxvw4x_be(__offset
, __ptr
);
17820 static __inline__ vector
signed long long __ATTRS_o_ai
17821 vec_xl_be(signed long long __offset
, const signed long long *__ptr
) {
17822 return (vector
signed long long)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17825 static __inline__ vector
unsigned long long __ATTRS_o_ai
17826 vec_xl_be(signed long long __offset
, const unsigned long long *__ptr
) {
17827 return (vector
unsigned long long)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17830 static __inline__ vector
double __ATTRS_o_ai
17831 vec_xl_be(signed long long __offset
, const double *__ptr
) {
17832 return (vector
double)__builtin_vsx_lxvd2x_be(__offset
, __ptr
);
17836 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17837 defined(__SIZEOF_INT128__)
17838 static __inline__ vector
signed __int128 __ATTRS_o_ai
17839 vec_xl_be(signed long long __offset
, const signed __int128
*__ptr
) {
17840 return vec_xl(__offset
, __ptr
);
17843 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
17844 vec_xl_be(signed long long __offset
, const unsigned __int128
*__ptr
) {
17845 return vec_xl(__offset
, __ptr
);
17849 #define vec_xl_be vec_xl
17852 #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17853 defined(__SIZEOF_INT128__)
17857 static __inline__ vector
signed __int128 __ATTRS_o_ai
17858 vec_xl_sext(ptrdiff_t __offset
, const signed char *__pointer
) {
17859 return (vector
signed __int128
)*(__pointer
+ __offset
);
17862 static __inline__ vector
signed __int128 __ATTRS_o_ai
17863 vec_xl_sext(ptrdiff_t __offset
, const signed short *__pointer
) {
17864 return (vector
signed __int128
)*(__pointer
+ __offset
);
17867 static __inline__ vector
signed __int128 __ATTRS_o_ai
17868 vec_xl_sext(ptrdiff_t __offset
, const signed int *__pointer
) {
17869 return (vector
signed __int128
)*(__pointer
+ __offset
);
17872 static __inline__ vector
signed __int128 __ATTRS_o_ai
17873 vec_xl_sext(ptrdiff_t __offset
, const signed long long *__pointer
) {
17874 return (vector
signed __int128
)*(__pointer
+ __offset
);
17879 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
17880 vec_xl_zext(ptrdiff_t __offset
, const unsigned char *__pointer
) {
17881 return (vector
unsigned __int128
)*(__pointer
+ __offset
);
17884 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
17885 vec_xl_zext(ptrdiff_t __offset
, const unsigned short *__pointer
) {
17886 return (vector
unsigned __int128
)*(__pointer
+ __offset
);
17889 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
17890 vec_xl_zext(ptrdiff_t __offset
, const unsigned int *__pointer
) {
17891 return (vector
unsigned __int128
)*(__pointer
+ __offset
);
17894 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
17895 vec_xl_zext(ptrdiff_t __offset
, const unsigned long long *__pointer
) {
17896 return (vector
unsigned __int128
)*(__pointer
+ __offset
);
17903 static __inline__ vector
signed long long __ATTRS_o_ai
17904 vec_xlds(ptrdiff_t __offset
, const signed long long *__ptr
) {
17905 signed long long *__addr
= (signed long long*)((signed char *)__ptr
+ __offset
);
17906 return (vector
signed long long) *__addr
;
17909 static __inline__ vector
unsigned long long __ATTRS_o_ai
17910 vec_xlds(ptrdiff_t __offset
, const unsigned long long *__ptr
) {
17911 unsigned long long *__addr
= (unsigned long long *)((signed char *)__ptr
+ __offset
);
17912 return (unaligned_vec_ull
) *__addr
;
17915 static __inline__ vector
double __ATTRS_o_ai
vec_xlds(ptrdiff_t __offset
,
17916 const double *__ptr
) {
17917 double *__addr
= (double*)((signed char *)__ptr
+ __offset
);
17918 return (unaligned_vec_double
) *__addr
;
17921 /* vec_load_splats */
17922 static __inline__ vector
signed int __ATTRS_o_ai
17923 vec_load_splats(signed long long __offset
, const signed int *__ptr
) {
17924 signed int *__addr
= (signed int*)((signed char *)__ptr
+ __offset
);
17925 return (vector
signed int)*__addr
;
17928 static __inline__ vector
signed int __ATTRS_o_ai
17929 vec_load_splats(unsigned long long __offset
, const signed int *__ptr
) {
17930 signed int *__addr
= (signed int*)((signed char *)__ptr
+ __offset
);
17931 return (vector
signed int)*__addr
;
17934 static __inline__ vector
unsigned int __ATTRS_o_ai
17935 vec_load_splats(signed long long __offset
, const unsigned int *__ptr
) {
17936 unsigned int *__addr
= (unsigned int*)((signed char *)__ptr
+ __offset
);
17937 return (vector
unsigned int)*__addr
;
17940 static __inline__ vector
unsigned int __ATTRS_o_ai
17941 vec_load_splats(unsigned long long __offset
, const unsigned int *__ptr
) {
17942 unsigned int *__addr
= (unsigned int*)((signed char *)__ptr
+ __offset
);
17943 return (vector
unsigned int)*__addr
;
17946 static __inline__ vector
float __ATTRS_o_ai
17947 vec_load_splats(signed long long __offset
, const float *__ptr
) {
17948 float *__addr
= (float*)((signed char *)__ptr
+ __offset
);
17949 return (vector
float)*__addr
;
17952 static __inline__ vector
float __ATTRS_o_ai
17953 vec_load_splats(unsigned long long __offset
, const float *__ptr
) {
17954 float *__addr
= (float*)((signed char *)__ptr
+ __offset
);
17955 return (vector
float)*__addr
;
17961 #define vec_xstd2 vec_xst
17962 #define vec_xstw4 vec_xst
17963 static inline __ATTRS_o_ai
void
17964 vec_xst(vector
signed char __vec
, ptrdiff_t __offset
, signed char *__ptr
) {
17965 *(unaligned_vec_schar
*)(__ptr
+ __offset
) = __vec
;
17968 static inline __ATTRS_o_ai
void
17969 vec_xst(vector
unsigned char __vec
, ptrdiff_t __offset
, unsigned char *__ptr
) {
17970 *(unaligned_vec_uchar
*)(__ptr
+ __offset
) = __vec
;
17973 static inline __ATTRS_o_ai
void
17974 vec_xst(vector
signed short __vec
, ptrdiff_t __offset
, signed short *__ptr
) {
17975 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17976 *(unaligned_vec_sshort
*)__addr
= __vec
;
17979 static inline __ATTRS_o_ai
void vec_xst(vector
unsigned short __vec
,
17980 ptrdiff_t __offset
,
17981 unsigned short *__ptr
) {
17982 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17983 *(unaligned_vec_ushort
*)__addr
= __vec
;
17986 static inline __ATTRS_o_ai
void vec_xst(vector
signed int __vec
,
17987 ptrdiff_t __offset
, signed int *__ptr
) {
17988 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17989 *(unaligned_vec_sint
*)__addr
= __vec
;
17992 static inline __ATTRS_o_ai
void
17993 vec_xst(vector
unsigned int __vec
, ptrdiff_t __offset
, unsigned int *__ptr
) {
17994 signed char *__addr
= (signed char *)__ptr
+ __offset
;
17995 *(unaligned_vec_uint
*)__addr
= __vec
;
17998 static inline __ATTRS_o_ai
void vec_xst(vector
float __vec
, ptrdiff_t __offset
,
18000 signed char *__addr
= (signed char *)__ptr
+ __offset
;
18001 *(unaligned_vec_float
*)__addr
= __vec
;
18005 static inline __ATTRS_o_ai
void vec_xst(vector
signed long long __vec
,
18006 ptrdiff_t __offset
,
18007 signed long long *__ptr
) {
18008 signed char *__addr
= (signed char *)__ptr
+ __offset
;
18009 *(unaligned_vec_sll
*)__addr
= __vec
;
18012 static inline __ATTRS_o_ai
void vec_xst(vector
unsigned long long __vec
,
18013 ptrdiff_t __offset
,
18014 unsigned long long *__ptr
) {
18015 signed char *__addr
= (signed char *)__ptr
+ __offset
;
18016 *(unaligned_vec_ull
*)__addr
= __vec
;
18019 static inline __ATTRS_o_ai
void vec_xst(vector
double __vec
, ptrdiff_t __offset
,
18021 signed char *__addr
= (signed char *)__ptr
+ __offset
;
18022 *(unaligned_vec_double
*)__addr
= __vec
;
18026 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18027 defined(__SIZEOF_INT128__)
18028 static inline __ATTRS_o_ai
void vec_xst(vector
signed __int128 __vec
,
18029 ptrdiff_t __offset
,
18030 signed __int128
*__ptr
) {
18031 signed char *__addr
= (signed char *)__ptr
+ __offset
;
18032 *(unaligned_vec_si128
*)__addr
= __vec
;
18035 static inline __ATTRS_o_ai
void vec_xst(vector
unsigned __int128 __vec
,
18036 ptrdiff_t __offset
,
18037 unsigned __int128
*__ptr
) {
18038 signed char *__addr
= (signed char *)__ptr
+ __offset
;
18039 *(unaligned_vec_ui128
*)__addr
= __vec
;
18043 /* vec_xst_trunc */
18045 #if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
18046 defined(__SIZEOF_INT128__)
18047 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
signed __int128 __vec
,
18048 ptrdiff_t __offset
,
18049 signed char *__ptr
) {
18050 *(__ptr
+ __offset
) = (signed char)__vec
[0];
18053 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
unsigned __int128 __vec
,
18054 ptrdiff_t __offset
,
18055 unsigned char *__ptr
) {
18056 *(__ptr
+ __offset
) = (unsigned char)__vec
[0];
18059 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
signed __int128 __vec
,
18060 ptrdiff_t __offset
,
18061 signed short *__ptr
) {
18062 *(__ptr
+ __offset
) = (signed short)__vec
[0];
18065 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
unsigned __int128 __vec
,
18066 ptrdiff_t __offset
,
18067 unsigned short *__ptr
) {
18068 *(__ptr
+ __offset
) = (unsigned short)__vec
[0];
18071 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
signed __int128 __vec
,
18072 ptrdiff_t __offset
,
18073 signed int *__ptr
) {
18074 *(__ptr
+ __offset
) = (signed int)__vec
[0];
18077 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
unsigned __int128 __vec
,
18078 ptrdiff_t __offset
,
18079 unsigned int *__ptr
) {
18080 *(__ptr
+ __offset
) = (unsigned int)__vec
[0];
18083 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
signed __int128 __vec
,
18084 ptrdiff_t __offset
,
18085 signed long long *__ptr
) {
18086 *(__ptr
+ __offset
) = (signed long long)__vec
[0];
18089 static inline __ATTRS_o_ai
void vec_xst_trunc(vector
unsigned __int128 __vec
,
18090 ptrdiff_t __offset
,
18091 unsigned long long *__ptr
) {
18092 *(__ptr
+ __offset
) = (unsigned long long)__vec
[0];
18098 #ifdef __LITTLE_ENDIAN__
18099 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
signed char __vec
,
18100 signed long long __offset
,
18101 signed char *__ptr
) {
18102 vector
signed char __tmp
=
18103 __builtin_shufflevector(__vec
, __vec
, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
18104 13, 12, 11, 10, 9, 8);
18105 typedef __attribute__((vector_size(sizeof(__tmp
)))) double __vector_double
;
18106 __builtin_vsx_stxvd2x_be((__vector_double
)__tmp
, __offset
, __ptr
);
18109 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
unsigned char __vec
,
18110 signed long long __offset
,
18111 unsigned char *__ptr
) {
18112 vector
unsigned char __tmp
=
18113 __builtin_shufflevector(__vec
, __vec
, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
18114 13, 12, 11, 10, 9, 8);
18115 typedef __attribute__((vector_size(sizeof(__tmp
)))) double __vector_double
;
18116 __builtin_vsx_stxvd2x_be((__vector_double
)__tmp
, __offset
, __ptr
);
18119 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
signed short __vec
,
18120 signed long long __offset
,
18121 signed short *__ptr
) {
18122 vector
signed short __tmp
=
18123 __builtin_shufflevector(__vec
, __vec
, 3, 2, 1, 0, 7, 6, 5, 4);
18124 typedef __attribute__((vector_size(sizeof(__tmp
)))) double __vector_double
;
18125 __builtin_vsx_stxvd2x_be((__vector_double
)__tmp
, __offset
, __ptr
);
18128 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
unsigned short __vec
,
18129 signed long long __offset
,
18130 unsigned short *__ptr
) {
18131 vector
unsigned short __tmp
=
18132 __builtin_shufflevector(__vec
, __vec
, 3, 2, 1, 0, 7, 6, 5, 4);
18133 typedef __attribute__((vector_size(sizeof(__tmp
)))) double __vector_double
;
18134 __builtin_vsx_stxvd2x_be((__vector_double
)__tmp
, __offset
, __ptr
);
18137 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
signed int __vec
,
18138 signed long long __offset
,
18139 signed int *__ptr
) {
18140 __builtin_vsx_stxvw4x_be(__vec
, __offset
, __ptr
);
18143 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
unsigned int __vec
,
18144 signed long long __offset
,
18145 unsigned int *__ptr
) {
18146 __builtin_vsx_stxvw4x_be((vector
int)__vec
, __offset
, __ptr
);
18149 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
float __vec
,
18150 signed long long __offset
,
18152 __builtin_vsx_stxvw4x_be((vector
int)__vec
, __offset
, __ptr
);
18156 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
signed long long __vec
,
18157 signed long long __offset
,
18158 signed long long *__ptr
) {
18159 __builtin_vsx_stxvd2x_be((vector
double)__vec
, __offset
, __ptr
);
18162 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
unsigned long long __vec
,
18163 signed long long __offset
,
18164 unsigned long long *__ptr
) {
18165 __builtin_vsx_stxvd2x_be((vector
double)__vec
, __offset
, __ptr
);
18168 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
double __vec
,
18169 signed long long __offset
,
18171 __builtin_vsx_stxvd2x_be((vector
double)__vec
, __offset
, __ptr
);
18175 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18176 defined(__SIZEOF_INT128__)
18177 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
signed __int128 __vec
,
18178 signed long long __offset
,
18179 signed __int128
*__ptr
) {
18180 vec_xst(__vec
, __offset
, __ptr
);
18183 static __inline__
void __ATTRS_o_ai
vec_xst_be(vector
unsigned __int128 __vec
,
18184 signed long long __offset
,
18185 unsigned __int128
*__ptr
) {
18186 vec_xst(__vec
, __offset
, __ptr
);
18190 #define vec_xst_be vec_xst
18193 #ifdef __POWER9_VECTOR__
18194 #define vec_test_data_class(__a, __b) \
18196 (__a), vector float \
18197 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
18199 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
18202 #endif /* #ifdef __POWER9_VECTOR__ */
18204 static vector
float __ATTRS_o_ai
vec_neg(vector
float __a
) {
18209 static vector
double __ATTRS_o_ai
vec_neg(vector
double __a
) {
18216 static vector
long long __ATTRS_o_ai
vec_neg(vector
long long __a
) {
18221 static vector
signed int __ATTRS_o_ai
vec_neg(vector
signed int __a
) {
18225 static vector
signed short __ATTRS_o_ai
vec_neg(vector
signed short __a
) {
18229 static vector
signed char __ATTRS_o_ai
vec_neg(vector
signed char __a
) {
18233 static vector
float __ATTRS_o_ai
vec_nabs(vector
float __a
) {
18234 return - vec_abs(__a
);
18238 static vector
double __ATTRS_o_ai
vec_nabs(vector
double __a
) {
18239 return - vec_abs(__a
);
18244 #ifdef __POWER8_VECTOR__
18245 static vector
long long __ATTRS_o_ai
vec_nabs(vector
long long __a
) {
18246 return __builtin_altivec_vminsd(__a
, -__a
);
18250 static vector
signed int __ATTRS_o_ai
vec_nabs(vector
signed int __a
) {
18251 return __builtin_altivec_vminsw(__a
, -__a
);
18254 static vector
signed short __ATTRS_o_ai
vec_nabs(vector
signed short __a
) {
18255 return __builtin_altivec_vminsh(__a
, -__a
);
18258 static vector
signed char __ATTRS_o_ai
vec_nabs(vector
signed char __a
) {
18259 return __builtin_altivec_vminsb(__a
, -__a
);
18262 static vector
float __ATTRS_o_ai
vec_recipdiv(vector
float __a
,
18263 vector
float __b
) {
18264 return __builtin_ppc_recipdivf(__a
, __b
);
18268 static vector
double __ATTRS_o_ai
vec_recipdiv(vector
double __a
,
18269 vector
double __b
) {
18270 return __builtin_ppc_recipdivd(__a
, __b
);
18274 #ifdef __POWER10_VECTOR__
18278 static __inline__
unsigned int __ATTRS_o_ai
18279 vec_extractm(vector
unsigned char __a
) {
18280 return __builtin_altivec_vextractbm(__a
);
18283 static __inline__
unsigned int __ATTRS_o_ai
18284 vec_extractm(vector
unsigned short __a
) {
18285 return __builtin_altivec_vextracthm(__a
);
18288 static __inline__
unsigned int __ATTRS_o_ai
18289 vec_extractm(vector
unsigned int __a
) {
18290 return __builtin_altivec_vextractwm(__a
);
18293 static __inline__
unsigned int __ATTRS_o_ai
18294 vec_extractm(vector
unsigned long long __a
) {
18295 return __builtin_altivec_vextractdm(__a
);
18298 #ifdef __SIZEOF_INT128__
18299 static __inline__
unsigned int __ATTRS_o_ai
18300 vec_extractm(vector
unsigned __int128 __a
) {
18301 return __builtin_altivec_vextractqm(__a
);
18307 static __inline__ vector
unsigned char __ATTRS_o_ai
18308 vec_expandm(vector
unsigned char __a
) {
18309 return __builtin_altivec_vexpandbm(__a
);
18312 static __inline__ vector
unsigned short __ATTRS_o_ai
18313 vec_expandm(vector
unsigned short __a
) {
18314 return __builtin_altivec_vexpandhm(__a
);
18317 static __inline__ vector
unsigned int __ATTRS_o_ai
18318 vec_expandm(vector
unsigned int __a
) {
18319 return __builtin_altivec_vexpandwm(__a
);
18322 static __inline__ vector
unsigned long long __ATTRS_o_ai
18323 vec_expandm(vector
unsigned long long __a
) {
18324 return __builtin_altivec_vexpanddm(__a
);
18327 #ifdef __SIZEOF_INT128__
18328 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
18329 vec_expandm(vector
unsigned __int128 __a
) {
18330 return __builtin_altivec_vexpandqm(__a
);
18336 #define vec_cntm(__a, __mp) \
18337 _Generic((__a), vector unsigned char \
18338 : __builtin_altivec_vcntmbb((vector unsigned char)(__a), \
18339 (unsigned char)(__mp)), \
18340 vector unsigned short \
18341 : __builtin_altivec_vcntmbh((vector unsigned short)(__a), \
18342 (unsigned char)(__mp)), \
18343 vector unsigned int \
18344 : __builtin_altivec_vcntmbw((vector unsigned int)(__a), \
18345 (unsigned char)(__mp)), \
18346 vector unsigned long long \
18347 : __builtin_altivec_vcntmbd((vector unsigned long long)(__a), \
18348 (unsigned char)(__mp)))
18350 /* vec_gen[b|h|w|d|q]m */
18352 static __inline__ vector
unsigned char __ATTRS_o_ai
18353 vec_genbm(unsigned long long __bm
) {
18354 return __builtin_altivec_mtvsrbm(__bm
);
18357 static __inline__ vector
unsigned short __ATTRS_o_ai
18358 vec_genhm(unsigned long long __bm
) {
18359 return __builtin_altivec_mtvsrhm(__bm
);
18362 static __inline__ vector
unsigned int __ATTRS_o_ai
18363 vec_genwm(unsigned long long __bm
) {
18364 return __builtin_altivec_mtvsrwm(__bm
);
18367 static __inline__ vector
unsigned long long __ATTRS_o_ai
18368 vec_gendm(unsigned long long __bm
) {
18369 return __builtin_altivec_mtvsrdm(__bm
);
18372 #ifdef __SIZEOF_INT128__
18373 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
18374 vec_genqm(unsigned long long __bm
) {
18375 return __builtin_altivec_mtvsrqm(__bm
);
18381 static __inline__ vector
unsigned long long __ATTRS_o_ai
18382 vec_pdep(vector
unsigned long long __a
, vector
unsigned long long __b
) {
18383 return __builtin_altivec_vpdepd(__a
, __b
);
18388 static __inline__ vector
unsigned long long __ATTRS_o_ai
18389 vec_pext(vector
unsigned long long __a
, vector
unsigned long long __b
) {
18390 return __builtin_altivec_vpextd(__a
, __b
);
18395 static __inline__ vector
unsigned long long __ATTRS_o_ai
18396 vec_cfuge(vector
unsigned long long __a
, vector
unsigned long long __b
) {
18397 return __builtin_altivec_vcfuged(__a
, __b
);
18402 #define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)
18404 /* vec_ternarylogic */
18406 #ifdef __SIZEOF_INT128__
18407 #define vec_ternarylogic(__a, __b, __c, __imm) \
18408 _Generic((__a), vector unsigned char \
18409 : (vector unsigned char)__builtin_vsx_xxeval( \
18410 (vector unsigned long long)(__a), \
18411 (vector unsigned long long)(__b), \
18412 (vector unsigned long long)(__c), (__imm)), \
18413 vector unsigned short \
18414 : (vector unsigned short)__builtin_vsx_xxeval( \
18415 (vector unsigned long long)(__a), \
18416 (vector unsigned long long)(__b), \
18417 (vector unsigned long long)(__c), (__imm)), \
18418 vector unsigned int \
18419 : (vector unsigned int)__builtin_vsx_xxeval( \
18420 (vector unsigned long long)(__a), \
18421 (vector unsigned long long)(__b), \
18422 (vector unsigned long long)(__c), (__imm)), \
18423 vector unsigned long long \
18424 : (vector unsigned long long)__builtin_vsx_xxeval( \
18425 (vector unsigned long long)(__a), \
18426 (vector unsigned long long)(__b), \
18427 (vector unsigned long long)(__c), (__imm)), \
18428 vector unsigned __int128 \
18429 : (vector unsigned __int128)__builtin_vsx_xxeval( \
18430 (vector unsigned long long)(__a), \
18431 (vector unsigned long long)(__b), \
18432 (vector unsigned long long)(__c), (__imm)))
18434 #define vec_ternarylogic(__a, __b, __c, __imm) \
18435 _Generic((__a), vector unsigned char \
18436 : (vector unsigned char)__builtin_vsx_xxeval( \
18437 (vector unsigned long long)(__a), \
18438 (vector unsigned long long)(__b), \
18439 (vector unsigned long long)(__c), (__imm)), \
18440 vector unsigned short \
18441 : (vector unsigned short)__builtin_vsx_xxeval( \
18442 (vector unsigned long long)(__a), \
18443 (vector unsigned long long)(__b), \
18444 (vector unsigned long long)(__c), (__imm)), \
18445 vector unsigned int \
18446 : (vector unsigned int)__builtin_vsx_xxeval( \
18447 (vector unsigned long long)(__a), \
18448 (vector unsigned long long)(__b), \
18449 (vector unsigned long long)(__c), (__imm)), \
18450 vector unsigned long long \
18451 : (vector unsigned long long)__builtin_vsx_xxeval( \
18452 (vector unsigned long long)(__a), \
18453 (vector unsigned long long)(__b), \
18454 (vector unsigned long long)(__c), (__imm)))
18455 #endif /* __SIZEOF_INT128__ */
18456 #endif /* __VSX__ */
18461 #define vec_genpcvm(__a, __imm) \
18463 (__a), vector unsigned char \
18464 : __builtin_vsx_xxgenpcvbm((vector unsigned char)(__a), (int)(__imm)), \
18465 vector unsigned short \
18466 : __builtin_vsx_xxgenpcvhm((vector unsigned short)(__a), (int)(__imm)), \
18467 vector unsigned int \
18468 : __builtin_vsx_xxgenpcvwm((vector unsigned int)(__a), (int)(__imm)), \
18469 vector unsigned long long \
18470 : __builtin_vsx_xxgenpcvdm((vector unsigned long long)(__a), \
18472 #endif /* __VSX__ */
18474 /* vec_clr_first */
18476 static __inline__ vector
signed char __ATTRS_o_ai
18477 vec_clr_first(vector
signed char __a
, unsigned int __n
) {
18478 #ifdef __LITTLE_ENDIAN__
18479 return (vector
signed char)__builtin_altivec_vclrrb((vector
unsigned char)__a
,
18482 return (vector
signed char)__builtin_altivec_vclrlb((vector
unsigned char)__a
,
18487 static __inline__ vector
unsigned char __ATTRS_o_ai
18488 vec_clr_first(vector
unsigned char __a
, unsigned int __n
) {
18489 #ifdef __LITTLE_ENDIAN__
18490 return (vector
unsigned char)__builtin_altivec_vclrrb(
18491 (vector
unsigned char)__a
, __n
);
18493 return (vector
unsigned char)__builtin_altivec_vclrlb(
18494 (vector
unsigned char)__a
, __n
);
18500 static __inline__ vector
signed char __ATTRS_o_ai
18501 vec_clr_last(vector
signed char __a
, unsigned int __n
) {
18502 #ifdef __LITTLE_ENDIAN__
18503 return (vector
signed char)__builtin_altivec_vclrlb((vector
unsigned char)__a
,
18506 return (vector
signed char)__builtin_altivec_vclrrb((vector
unsigned char)__a
,
18511 static __inline__ vector
unsigned char __ATTRS_o_ai
18512 vec_clr_last(vector
unsigned char __a
, unsigned int __n
) {
18513 #ifdef __LITTLE_ENDIAN__
18514 return (vector
unsigned char)__builtin_altivec_vclrlb(
18515 (vector
unsigned char)__a
, __n
);
18517 return (vector
unsigned char)__builtin_altivec_vclrrb(
18518 (vector
unsigned char)__a
, __n
);
18524 static __inline__ vector
unsigned long long __ATTRS_o_ai
18525 vec_cntlzm(vector
unsigned long long __a
, vector
unsigned long long __b
) {
18526 return __builtin_altivec_vclzdm(__a
, __b
);
18531 static __inline__ vector
unsigned long long __ATTRS_o_ai
18532 vec_cnttzm(vector
unsigned long long __a
, vector
unsigned long long __b
) {
18533 return __builtin_altivec_vctzdm(__a
, __b
);
18538 static __inline__ vector
signed int __ATTRS_o_ai
18539 vec_mod(vector
signed int __a
, vector
signed int __b
) {
18543 static __inline__ vector
unsigned int __ATTRS_o_ai
18544 vec_mod(vector
unsigned int __a
, vector
unsigned int __b
) {
18548 static __inline__ vector
signed long long __ATTRS_o_ai
18549 vec_mod(vector
signed long long __a
, vector
signed long long __b
) {
18553 static __inline__ vector
unsigned long long __ATTRS_o_ai
18554 vec_mod(vector
unsigned long long __a
, vector
unsigned long long __b
) {
18558 #ifdef __SIZEOF_INT128__
18559 static __inline__ vector
signed __int128 __ATTRS_o_ai
18560 vec_mod(vector
signed __int128 __a
, vector
signed __int128 __b
) {
18564 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
18565 vec_mod(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
18571 #define vec_sldb(__a, __b, __c) \
18573 (__a), vector unsigned char \
18574 : (vector unsigned char)__builtin_altivec_vsldbi( \
18575 (vector unsigned char)__a, (vector unsigned char)__b, \
18577 vector signed char \
18578 : (vector signed char)__builtin_altivec_vsldbi( \
18579 (vector unsigned char)__a, (vector unsigned char)__b, \
18581 vector unsigned short \
18582 : (vector unsigned short)__builtin_altivec_vsldbi( \
18583 (vector unsigned char)__a, (vector unsigned char)__b, \
18585 vector signed short \
18586 : (vector signed short)__builtin_altivec_vsldbi( \
18587 (vector unsigned char)__a, (vector unsigned char)__b, \
18589 vector unsigned int \
18590 : (vector unsigned int)__builtin_altivec_vsldbi( \
18591 (vector unsigned char)__a, (vector unsigned char)__b, \
18593 vector signed int \
18594 : (vector signed int)__builtin_altivec_vsldbi((vector unsigned char)__a, \
18595 (vector unsigned char)__b, \
18597 vector unsigned long long \
18598 : (vector unsigned long long)__builtin_altivec_vsldbi( \
18599 (vector unsigned char)__a, (vector unsigned char)__b, \
18601 vector signed long long \
18602 : (vector signed long long)__builtin_altivec_vsldbi( \
18603 (vector unsigned char)__a, (vector unsigned char)__b, (__c & 0x7)))
18606 #define vec_srdb(__a, __b, __c) \
18608 (__a), vector unsigned char \
18609 : (vector unsigned char)__builtin_altivec_vsrdbi( \
18610 (vector unsigned char)__a, (vector unsigned char)__b, \
18612 vector signed char \
18613 : (vector signed char)__builtin_altivec_vsrdbi( \
18614 (vector unsigned char)__a, (vector unsigned char)__b, \
18616 vector unsigned short \
18617 : (vector unsigned short)__builtin_altivec_vsrdbi( \
18618 (vector unsigned char)__a, (vector unsigned char)__b, \
18620 vector signed short \
18621 : (vector signed short)__builtin_altivec_vsrdbi( \
18622 (vector unsigned char)__a, (vector unsigned char)__b, \
18624 vector unsigned int \
18625 : (vector unsigned int)__builtin_altivec_vsrdbi( \
18626 (vector unsigned char)__a, (vector unsigned char)__b, \
18628 vector signed int \
18629 : (vector signed int)__builtin_altivec_vsrdbi((vector unsigned char)__a, \
18630 (vector unsigned char)__b, \
18632 vector unsigned long long \
18633 : (vector unsigned long long)__builtin_altivec_vsrdbi( \
18634 (vector unsigned char)__a, (vector unsigned char)__b, \
18636 vector signed long long \
18637 : (vector signed long long)__builtin_altivec_vsrdbi( \
18638 (vector unsigned char)__a, (vector unsigned char)__b, (__c & 0x7)))
18642 static __inline__ vector
unsigned char __ATTRS_o_ai
18643 vec_insertl(unsigned char __a
, vector
unsigned char __b
, unsigned int __c
) {
18644 #ifdef __LITTLE_ENDIAN__
18645 return __builtin_altivec_vinsbrx(__b
, __c
, __a
);
18647 return __builtin_altivec_vinsblx(__b
, __c
, __a
);
18651 static __inline__ vector
unsigned short __ATTRS_o_ai
18652 vec_insertl(unsigned short __a
, vector
unsigned short __b
, unsigned int __c
) {
18653 #ifdef __LITTLE_ENDIAN__
18654 return __builtin_altivec_vinshrx(__b
, __c
, __a
);
18656 return __builtin_altivec_vinshlx(__b
, __c
, __a
);
18660 static __inline__ vector
unsigned int __ATTRS_o_ai
18661 vec_insertl(unsigned int __a
, vector
unsigned int __b
, unsigned int __c
) {
18662 #ifdef __LITTLE_ENDIAN__
18663 return __builtin_altivec_vinswrx(__b
, __c
, __a
);
18665 return __builtin_altivec_vinswlx(__b
, __c
, __a
);
18669 static __inline__ vector
unsigned long long __ATTRS_o_ai
18670 vec_insertl(unsigned long long __a
, vector
unsigned long long __b
,
18671 unsigned int __c
) {
18672 #ifdef __LITTLE_ENDIAN__
18673 return __builtin_altivec_vinsdrx(__b
, __c
, __a
);
18675 return __builtin_altivec_vinsdlx(__b
, __c
, __a
);
18679 static __inline__ vector
unsigned char __ATTRS_o_ai
18680 vec_insertl(vector
unsigned char __a
, vector
unsigned char __b
,
18681 unsigned int __c
) {
18682 #ifdef __LITTLE_ENDIAN__
18683 return __builtin_altivec_vinsbvrx(__b
, __c
, __a
);
18685 return __builtin_altivec_vinsbvlx(__b
, __c
, __a
);
18689 static __inline__ vector
unsigned short __ATTRS_o_ai
18690 vec_insertl(vector
unsigned short __a
, vector
unsigned short __b
,
18691 unsigned int __c
) {
18692 #ifdef __LITTLE_ENDIAN__
18693 return __builtin_altivec_vinshvrx(__b
, __c
, __a
);
18695 return __builtin_altivec_vinshvlx(__b
, __c
, __a
);
18699 static __inline__ vector
unsigned int __ATTRS_o_ai
18700 vec_insertl(vector
unsigned int __a
, vector
unsigned int __b
,
18701 unsigned int __c
) {
18702 #ifdef __LITTLE_ENDIAN__
18703 return __builtin_altivec_vinswvrx(__b
, __c
, __a
);
18705 return __builtin_altivec_vinswvlx(__b
, __c
, __a
);
18711 static __inline__ vector
unsigned char __ATTRS_o_ai
18712 vec_inserth(unsigned char __a
, vector
unsigned char __b
, unsigned int __c
) {
18713 #ifdef __LITTLE_ENDIAN__
18714 return __builtin_altivec_vinsblx(__b
, __c
, __a
);
18716 return __builtin_altivec_vinsbrx(__b
, __c
, __a
);
18720 static __inline__ vector
unsigned short __ATTRS_o_ai
18721 vec_inserth(unsigned short __a
, vector
unsigned short __b
, unsigned int __c
) {
18722 #ifdef __LITTLE_ENDIAN__
18723 return __builtin_altivec_vinshlx(__b
, __c
, __a
);
18725 return __builtin_altivec_vinshrx(__b
, __c
, __a
);
18729 static __inline__ vector
unsigned int __ATTRS_o_ai
18730 vec_inserth(unsigned int __a
, vector
unsigned int __b
, unsigned int __c
) {
18731 #ifdef __LITTLE_ENDIAN__
18732 return __builtin_altivec_vinswlx(__b
, __c
, __a
);
18734 return __builtin_altivec_vinswrx(__b
, __c
, __a
);
18738 static __inline__ vector
unsigned long long __ATTRS_o_ai
18739 vec_inserth(unsigned long long __a
, vector
unsigned long long __b
,
18740 unsigned int __c
) {
18741 #ifdef __LITTLE_ENDIAN__
18742 return __builtin_altivec_vinsdlx(__b
, __c
, __a
);
18744 return __builtin_altivec_vinsdrx(__b
, __c
, __a
);
18748 static __inline__ vector
unsigned char __ATTRS_o_ai
18749 vec_inserth(vector
unsigned char __a
, vector
unsigned char __b
,
18750 unsigned int __c
) {
18751 #ifdef __LITTLE_ENDIAN__
18752 return __builtin_altivec_vinsbvlx(__b
, __c
, __a
);
18754 return __builtin_altivec_vinsbvrx(__b
, __c
, __a
);
18758 static __inline__ vector
unsigned short __ATTRS_o_ai
18759 vec_inserth(vector
unsigned short __a
, vector
unsigned short __b
,
18760 unsigned int __c
) {
18761 #ifdef __LITTLE_ENDIAN__
18762 return __builtin_altivec_vinshvlx(__b
, __c
, __a
);
18764 return __builtin_altivec_vinshvrx(__b
, __c
, __a
);
18768 static __inline__ vector
unsigned int __ATTRS_o_ai
18769 vec_inserth(vector
unsigned int __a
, vector
unsigned int __b
,
18770 unsigned int __c
) {
18771 #ifdef __LITTLE_ENDIAN__
18772 return __builtin_altivec_vinswvlx(__b
, __c
, __a
);
18774 return __builtin_altivec_vinswvrx(__b
, __c
, __a
);
18780 static __inline__ vector
unsigned long long __ATTRS_o_ai
vec_extractl(
18781 vector
unsigned char __a
, vector
unsigned char __b
, unsigned int __c
) {
18782 #ifdef __LITTLE_ENDIAN__
18783 return __builtin_altivec_vextdubvrx(__a
, __b
, __c
);
18785 vector
unsigned long long __ret
= __builtin_altivec_vextdubvlx(__a
, __b
, __c
);
18786 return vec_sld(__ret
, __ret
, 8);
18790 static __inline__ vector
unsigned long long __ATTRS_o_ai
vec_extractl(
18791 vector
unsigned short __a
, vector
unsigned short __b
, unsigned int __c
) {
18792 #ifdef __LITTLE_ENDIAN__
18793 return __builtin_altivec_vextduhvrx(__a
, __b
, __c
);
18795 vector
unsigned long long __ret
= __builtin_altivec_vextduhvlx(__a
, __b
, __c
);
18796 return vec_sld(__ret
, __ret
, 8);
18800 static __inline__ vector
unsigned long long __ATTRS_o_ai
vec_extractl(
18801 vector
unsigned int __a
, vector
unsigned int __b
, unsigned int __c
) {
18802 #ifdef __LITTLE_ENDIAN__
18803 return __builtin_altivec_vextduwvrx(__a
, __b
, __c
);
18805 vector
unsigned long long __ret
= __builtin_altivec_vextduwvlx(__a
, __b
, __c
);
18806 return vec_sld(__ret
, __ret
, 8);
18810 static __inline__ vector
unsigned long long __ATTRS_o_ai
18811 vec_extractl(vector
unsigned long long __a
, vector
unsigned long long __b
,
18812 unsigned int __c
) {
18813 #ifdef __LITTLE_ENDIAN__
18814 return __builtin_altivec_vextddvrx(__a
, __b
, __c
);
18816 vector
unsigned long long __ret
= __builtin_altivec_vextddvlx(__a
, __b
, __c
);
18817 return vec_sld(__ret
, __ret
, 8);
18823 static __inline__ vector
unsigned long long __ATTRS_o_ai
vec_extracth(
18824 vector
unsigned char __a
, vector
unsigned char __b
, unsigned int __c
) {
18825 #ifdef __LITTLE_ENDIAN__
18826 return __builtin_altivec_vextdubvlx(__a
, __b
, __c
);
18828 vector
unsigned long long __ret
= __builtin_altivec_vextdubvrx(__a
, __b
, __c
);
18829 return vec_sld(__ret
, __ret
, 8);
18833 static __inline__ vector
unsigned long long __ATTRS_o_ai
vec_extracth(
18834 vector
unsigned short __a
, vector
unsigned short __b
, unsigned int __c
) {
18835 #ifdef __LITTLE_ENDIAN__
18836 return __builtin_altivec_vextduhvlx(__a
, __b
, __c
);
18838 vector
unsigned long long __ret
= __builtin_altivec_vextduhvrx(__a
, __b
, __c
);
18839 return vec_sld(__ret
, __ret
, 8);
18843 static __inline__ vector
unsigned long long __ATTRS_o_ai
vec_extracth(
18844 vector
unsigned int __a
, vector
unsigned int __b
, unsigned int __c
) {
18845 #ifdef __LITTLE_ENDIAN__
18846 return __builtin_altivec_vextduwvlx(__a
, __b
, __c
);
18848 vector
unsigned long long __ret
= __builtin_altivec_vextduwvrx(__a
, __b
, __c
);
18849 return vec_sld(__ret
, __ret
, 8);
18853 static __inline__ vector
unsigned long long __ATTRS_o_ai
18854 vec_extracth(vector
unsigned long long __a
, vector
unsigned long long __b
,
18855 unsigned int __c
) {
18856 #ifdef __LITTLE_ENDIAN__
18857 return __builtin_altivec_vextddvlx(__a
, __b
, __c
);
18859 vector
unsigned long long __ret
= __builtin_altivec_vextddvrx(__a
, __b
, __c
);
18860 return vec_sld(__ret
, __ret
, 8);
18867 #define vec_permx(__a, __b, __c, __d) \
18869 (__a), vector unsigned char \
18870 : (vector unsigned char)__builtin_vsx_xxpermx( \
18871 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18872 vector signed char \
18873 : (vector signed char)__builtin_vsx_xxpermx( \
18874 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18875 vector unsigned short \
18876 : (vector unsigned short)__builtin_vsx_xxpermx( \
18877 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18878 vector signed short \
18879 : (vector signed short)__builtin_vsx_xxpermx( \
18880 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18881 vector unsigned int \
18882 : (vector unsigned int)__builtin_vsx_xxpermx( \
18883 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18884 vector signed int \
18885 : (vector signed int)__builtin_vsx_xxpermx( \
18886 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18887 vector unsigned long long \
18888 : (vector unsigned long long)__builtin_vsx_xxpermx( \
18889 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18890 vector signed long long \
18891 : (vector signed long long)__builtin_vsx_xxpermx( \
18892 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18894 : (vector float)__builtin_vsx_xxpermx( \
18895 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18897 : (vector double)__builtin_vsx_xxpermx( \
18898 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d))
18902 static __inline__ vector
signed char __ATTRS_o_ai
18903 vec_blendv(vector
signed char __a
, vector
signed char __b
,
18904 vector
unsigned char __c
) {
18905 return (vector
signed char)__builtin_vsx_xxblendvb(
18906 (vector
unsigned char)__a
, (vector
unsigned char)__b
, __c
);
18909 static __inline__ vector
unsigned char __ATTRS_o_ai
18910 vec_blendv(vector
unsigned char __a
, vector
unsigned char __b
,
18911 vector
unsigned char __c
) {
18912 return __builtin_vsx_xxblendvb(__a
, __b
, __c
);
18915 static __inline__ vector
signed short __ATTRS_o_ai
18916 vec_blendv(vector
signed short __a
, vector
signed short __b
,
18917 vector
unsigned short __c
) {
18918 return (vector
signed short)__builtin_vsx_xxblendvh(
18919 (vector
unsigned short)__a
, (vector
unsigned short)__b
, __c
);
18922 static __inline__ vector
unsigned short __ATTRS_o_ai
18923 vec_blendv(vector
unsigned short __a
, vector
unsigned short __b
,
18924 vector
unsigned short __c
) {
18925 return __builtin_vsx_xxblendvh(__a
, __b
, __c
);
18928 static __inline__ vector
signed int __ATTRS_o_ai
18929 vec_blendv(vector
signed int __a
, vector
signed int __b
,
18930 vector
unsigned int __c
) {
18931 return (vector
signed int)__builtin_vsx_xxblendvw(
18932 (vector
unsigned int)__a
, (vector
unsigned int)__b
, __c
);
18935 static __inline__ vector
unsigned int __ATTRS_o_ai
18936 vec_blendv(vector
unsigned int __a
, vector
unsigned int __b
,
18937 vector
unsigned int __c
) {
18938 return __builtin_vsx_xxblendvw(__a
, __b
, __c
);
18941 static __inline__ vector
signed long long __ATTRS_o_ai
18942 vec_blendv(vector
signed long long __a
, vector
signed long long __b
,
18943 vector
unsigned long long __c
) {
18944 return (vector
signed long long)__builtin_vsx_xxblendvd(
18945 (vector
unsigned long long)__a
, (vector
unsigned long long)__b
, __c
);
18948 static __inline__ vector
unsigned long long __ATTRS_o_ai
18949 vec_blendv(vector
unsigned long long __a
, vector
unsigned long long __b
,
18950 vector
unsigned long long __c
) {
18951 return (vector
unsigned long long)__builtin_vsx_xxblendvd(__a
, __b
, __c
);
18954 static __inline__ vector
float __ATTRS_o_ai
18955 vec_blendv(vector
float __a
, vector
float __b
, vector
unsigned int __c
) {
18956 return (vector
float)__builtin_vsx_xxblendvw((vector
unsigned int)__a
,
18957 (vector
unsigned int)__b
, __c
);
18960 static __inline__ vector
double __ATTRS_o_ai
18961 vec_blendv(vector
double __a
, vector
double __b
,
18962 vector
unsigned long long __c
) {
18963 return (vector
double)__builtin_vsx_xxblendvd(
18964 (vector
unsigned long long)__a
, (vector
unsigned long long)__b
, __c
);
18967 #define vec_replace_unaligned(__a, __b, __c) \
18968 _Generic((__a), vector signed int \
18969 : __builtin_altivec_vinsw((vector unsigned char)__a, \
18970 (unsigned int)__b, __c), \
18971 vector unsigned int \
18972 : __builtin_altivec_vinsw((vector unsigned char)__a, \
18973 (unsigned int)__b, __c), \
18974 vector unsigned long long \
18975 : __builtin_altivec_vinsd((vector unsigned char)__a, \
18976 (unsigned long long)__b, __c), \
18977 vector signed long long \
18978 : __builtin_altivec_vinsd((vector unsigned char)__a, \
18979 (unsigned long long)__b, __c), \
18981 : __builtin_altivec_vinsw((vector unsigned char)__a, \
18982 (unsigned int)__b, __c), \
18984 : __builtin_altivec_vinsd((vector unsigned char)__a, \
18985 (unsigned long long)__b, __c))
18987 #define vec_replace_elt(__a, __b, __c) \
18988 _Generic((__a), vector signed int \
18989 : (vector signed int)__builtin_altivec_vinsw_elt( \
18990 (vector unsigned char)__a, (unsigned int)__b, __c), \
18991 vector unsigned int \
18992 : (vector unsigned int)__builtin_altivec_vinsw_elt( \
18993 (vector unsigned char)__a, (unsigned int)__b, __c), \
18994 vector unsigned long long \
18995 : (vector unsigned long long)__builtin_altivec_vinsd_elt( \
18996 (vector unsigned char)__a, (unsigned long long)__b, __c), \
18997 vector signed long long \
18998 : (vector signed long long)__builtin_altivec_vinsd_elt( \
18999 (vector unsigned char)__a, (unsigned long long)__b, __c), \
19001 : (vector float)__builtin_altivec_vinsw_elt( \
19002 (vector unsigned char)__a, (unsigned int)__b, __c), \
19004 : (vector double)__builtin_altivec_vinsd_elt( \
19005 (vector unsigned char)__a, (unsigned long long)__b, __c))
19009 #define vec_splati(__a) \
19010 _Generic((__a), signed int \
19011 : ((vector signed int)__a), unsigned int \
19012 : ((vector unsigned int)__a), float \
19013 : ((vector float)__a))
19017 static __inline__ vector
double __ATTRS_o_ai
vec_splatid(const float __a
) {
19018 return ((vector
double)((double)__a
));
19021 /* vec_splati_ins */
19023 static __inline__ vector
signed int __ATTRS_o_ai
vec_splati_ins(
19024 vector
signed int __a
, const unsigned int __b
, const signed int __c
) {
19025 const unsigned int __d
= __b
& 0x01;
19026 #ifdef __LITTLE_ENDIAN__
19027 __a
[1 - __d
] = __c
;
19028 __a
[3 - __d
] = __c
;
19031 __a
[2 + __d
] = __c
;
19036 static __inline__ vector
unsigned int __ATTRS_o_ai
vec_splati_ins(
19037 vector
unsigned int __a
, const unsigned int __b
, const unsigned int __c
) {
19038 const unsigned int __d
= __b
& 0x01;
19039 #ifdef __LITTLE_ENDIAN__
19040 __a
[1 - __d
] = __c
;
19041 __a
[3 - __d
] = __c
;
19044 __a
[2 + __d
] = __c
;
19049 static __inline__ vector
float __ATTRS_o_ai
19050 vec_splati_ins(vector
float __a
, const unsigned int __b
, const float __c
) {
19051 const unsigned int __d
= __b
& 0x01;
19052 #ifdef __LITTLE_ENDIAN__
19053 __a
[1 - __d
] = __c
;
19054 __a
[3 - __d
] = __c
;
19057 __a
[2 + __d
] = __c
;
19062 /* vec_test_lsbb_all_ones */
19064 static __inline__
int __ATTRS_o_ai
19065 vec_test_lsbb_all_ones(vector
unsigned char __a
) {
19066 return __builtin_vsx_xvtlsbb(__a
, 1);
19069 /* vec_test_lsbb_all_zeros */
19071 static __inline__
int __ATTRS_o_ai
19072 vec_test_lsbb_all_zeros(vector
unsigned char __a
) {
19073 return __builtin_vsx_xvtlsbb(__a
, 0);
19075 #endif /* __VSX__ */
19079 static __inline__ vector
unsigned char __ATTRS_o_ai
19080 vec_stril(vector
unsigned char __a
) {
19081 #ifdef __LITTLE_ENDIAN__
19082 return (vector
unsigned char)__builtin_altivec_vstribr(
19083 (vector
unsigned char)__a
);
19085 return (vector
unsigned char)__builtin_altivec_vstribl(
19086 (vector
unsigned char)__a
);
19090 static __inline__ vector
signed char __ATTRS_o_ai
19091 vec_stril(vector
signed char __a
) {
19092 #ifdef __LITTLE_ENDIAN__
19093 return (vector
signed char)__builtin_altivec_vstribr(
19094 (vector
unsigned char)__a
);
19096 return (vector
signed char)__builtin_altivec_vstribl(
19097 (vector
unsigned char)__a
);
19101 static __inline__ vector
unsigned short __ATTRS_o_ai
19102 vec_stril(vector
unsigned short __a
) {
19103 #ifdef __LITTLE_ENDIAN__
19104 return (vector
unsigned short)__builtin_altivec_vstrihr(
19105 (vector
signed short)__a
);
19107 return (vector
unsigned short)__builtin_altivec_vstrihl(
19108 (vector
signed short)__a
);
19112 static __inline__ vector
signed short __ATTRS_o_ai
19113 vec_stril(vector
signed short __a
) {
19114 #ifdef __LITTLE_ENDIAN__
19115 return __builtin_altivec_vstrihr(__a
);
19117 return __builtin_altivec_vstrihl(__a
);
19123 static __inline__
int __ATTRS_o_ai
vec_stril_p(vector
unsigned char __a
) {
19124 #ifdef __LITTLE_ENDIAN__
19125 return __builtin_altivec_vstribr_p(__CR6_EQ
, (vector
unsigned char)__a
);
19127 return __builtin_altivec_vstribl_p(__CR6_EQ
, (vector
unsigned char)__a
);
19131 static __inline__
int __ATTRS_o_ai
vec_stril_p(vector
signed char __a
) {
19132 #ifdef __LITTLE_ENDIAN__
19133 return __builtin_altivec_vstribr_p(__CR6_EQ
, (vector
unsigned char)__a
);
19135 return __builtin_altivec_vstribl_p(__CR6_EQ
, (vector
unsigned char)__a
);
19139 static __inline__
int __ATTRS_o_ai
vec_stril_p(vector
unsigned short __a
) {
19140 #ifdef __LITTLE_ENDIAN__
19141 return __builtin_altivec_vstrihr_p(__CR6_EQ
, (vector
signed short)__a
);
19143 return __builtin_altivec_vstrihl_p(__CR6_EQ
, (vector
signed short)__a
);
19147 static __inline__
int __ATTRS_o_ai
vec_stril_p(vector
signed short __a
) {
19148 #ifdef __LITTLE_ENDIAN__
19149 return __builtin_altivec_vstrihr_p(__CR6_EQ
, __a
);
19151 return __builtin_altivec_vstrihl_p(__CR6_EQ
, __a
);
19157 static __inline__ vector
unsigned char __ATTRS_o_ai
19158 vec_strir(vector
unsigned char __a
) {
19159 #ifdef __LITTLE_ENDIAN__
19160 return (vector
unsigned char)__builtin_altivec_vstribl(
19161 (vector
unsigned char)__a
);
19163 return (vector
unsigned char)__builtin_altivec_vstribr(
19164 (vector
unsigned char)__a
);
19168 static __inline__ vector
signed char __ATTRS_o_ai
19169 vec_strir(vector
signed char __a
) {
19170 #ifdef __LITTLE_ENDIAN__
19171 return (vector
signed char)__builtin_altivec_vstribl(
19172 (vector
unsigned char)__a
);
19174 return (vector
signed char)__builtin_altivec_vstribr(
19175 (vector
unsigned char)__a
);
19179 static __inline__ vector
unsigned short __ATTRS_o_ai
19180 vec_strir(vector
unsigned short __a
) {
19181 #ifdef __LITTLE_ENDIAN__
19182 return (vector
unsigned short)__builtin_altivec_vstrihl(
19183 (vector
signed short)__a
);
19185 return (vector
unsigned short)__builtin_altivec_vstrihr(
19186 (vector
signed short)__a
);
19190 static __inline__ vector
signed short __ATTRS_o_ai
19191 vec_strir(vector
signed short __a
) {
19192 #ifdef __LITTLE_ENDIAN__
19193 return __builtin_altivec_vstrihl(__a
);
19195 return __builtin_altivec_vstrihr(__a
);
19201 static __inline__
int __ATTRS_o_ai
vec_strir_p(vector
unsigned char __a
) {
19202 #ifdef __LITTLE_ENDIAN__
19203 return __builtin_altivec_vstribl_p(__CR6_EQ
, (vector
unsigned char)__a
);
19205 return __builtin_altivec_vstribr_p(__CR6_EQ
, (vector
unsigned char)__a
);
19209 static __inline__
int __ATTRS_o_ai
vec_strir_p(vector
signed char __a
) {
19210 #ifdef __LITTLE_ENDIAN__
19211 return __builtin_altivec_vstribl_p(__CR6_EQ
, (vector
unsigned char)__a
);
19213 return __builtin_altivec_vstribr_p(__CR6_EQ
, (vector
unsigned char)__a
);
19217 static __inline__
int __ATTRS_o_ai
vec_strir_p(vector
unsigned short __a
) {
19218 #ifdef __LITTLE_ENDIAN__
19219 return __builtin_altivec_vstrihl_p(__CR6_EQ
, (vector
signed short)__a
);
19221 return __builtin_altivec_vstrihr_p(__CR6_EQ
, (vector
signed short)__a
);
19225 static __inline__
int __ATTRS_o_ai
vec_strir_p(vector
signed short __a
) {
19226 #ifdef __LITTLE_ENDIAN__
19227 return __builtin_altivec_vstrihl_p(__CR6_EQ
, __a
);
19229 return __builtin_altivec_vstrihr_p(__CR6_EQ
, __a
);
19233 /* vs[l | r | ra] */
19235 #ifdef __SIZEOF_INT128__
19236 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
19237 vec_sl(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
19238 return __a
<< (__b
% (vector
unsigned __int128
)(sizeof(unsigned __int128
) *
19242 static __inline__ vector
signed __int128 __ATTRS_o_ai
19243 vec_sl(vector
signed __int128 __a
, vector
unsigned __int128 __b
) {
19244 return __a
<< (__b
% (vector
unsigned __int128
)(sizeof(unsigned __int128
) *
19248 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
19249 vec_sr(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
19250 return __a
>> (__b
% (vector
unsigned __int128
)(sizeof(unsigned __int128
) *
19254 static __inline__ vector
signed __int128 __ATTRS_o_ai
19255 vec_sr(vector
signed __int128 __a
, vector
unsigned __int128 __b
) {
19257 vector
signed __int128
)(((vector
unsigned __int128
)__a
) >>
19259 (vector
unsigned __int128
)(sizeof(
19260 unsigned __int128
) *
19264 static __inline__ vector
unsigned __int128 __ATTRS_o_ai
19265 vec_sra(vector
unsigned __int128 __a
, vector
unsigned __int128 __b
) {
19267 vector
unsigned __int128
)(((vector
signed __int128
)__a
) >>
19269 (vector
unsigned __int128
)(sizeof(
19270 unsigned __int128
) *
19274 static __inline__ vector
signed __int128 __ATTRS_o_ai
19275 vec_sra(vector
signed __int128 __a
, vector
unsigned __int128 __b
) {
19276 return __a
>> (__b
% (vector
unsigned __int128
)(sizeof(unsigned __int128
) *
19280 #endif /* __SIZEOF_INT128__ */
19281 #endif /* __POWER10_VECTOR__ */
19283 #ifdef __POWER8_VECTOR__
19284 #define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))
19285 #define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))
19287 static __inline__
long __bcdadd_ofl(vector
unsigned char __a
,
19288 vector
unsigned char __b
) {
19289 return __builtin_ppc_bcdadd_p(__CR6_SO
, __a
, __b
);
19292 static __inline__
long __bcdsub_ofl(vector
unsigned char __a
,
19293 vector
unsigned char __b
) {
19294 return __builtin_ppc_bcdsub_p(__CR6_SO
, __a
, __b
);
19297 static __inline__
long __bcd_invalid(vector
unsigned char __a
) {
19298 return __builtin_ppc_bcdsub_p(__CR6_SO
, __a
, __a
);
19301 static __inline__
long __bcdcmpeq(vector
unsigned char __a
,
19302 vector
unsigned char __b
) {
19303 return __builtin_ppc_bcdsub_p(__CR6_EQ
, __a
, __b
);
19306 static __inline__
long __bcdcmplt(vector
unsigned char __a
,
19307 vector
unsigned char __b
) {
19308 return __builtin_ppc_bcdsub_p(__CR6_LT
, __a
, __b
);
19311 static __inline__
long __bcdcmpgt(vector
unsigned char __a
,
19312 vector
unsigned char __b
) {
19313 return __builtin_ppc_bcdsub_p(__CR6_GT
, __a
, __b
);
19316 static __inline__
long __bcdcmple(vector
unsigned char __a
,
19317 vector
unsigned char __b
) {
19318 return __builtin_ppc_bcdsub_p(__CR6_GT_REV
, __a
, __b
);
19321 static __inline__
long __bcdcmpge(vector
unsigned char __a
,
19322 vector
unsigned char __b
) {
19323 return __builtin_ppc_bcdsub_p(__CR6_LT_REV
, __a
, __b
);
19326 #endif // __POWER8_VECTOR__
19328 #undef __ATTRS_o_ai
19330 #endif /* __ALTIVEC_H */