clang 24.0.0git
altivec.h
Go to the documentation of this file.
1/*===---- altivec.h - Standard header for type generic math ---------------===*\
2 *
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
6 *
7\*===----------------------------------------------------------------------===*/
8
9#ifndef __ALTIVEC_H
10#define __ALTIVEC_H
11
12#ifndef __ALTIVEC__
13#error "AltiVec support not enabled"
14#endif
15
16/* Constants for mapping CR6 bits to predicate result. */
17
18#define __CR6_EQ 0
19#define __CR6_EQ_REV 1
20#define __CR6_LT 2
21#define __CR6_LT_REV 3
22#define __CR6_GT 4
23#define __CR6_GT_REV 5
24#define __CR6_SO 6
25#define __CR6_SO_REV 7
26
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)
45
46#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
47
48#include <stddef.h>
49
50static __inline__ vector signed char __ATTRS_o_ai vec_perm(
51 vector signed char __a, vector signed char __b, vector unsigned char __c);
52
53static __inline__ vector unsigned char __ATTRS_o_ai
54vec_perm(vector unsigned char __a, vector unsigned char __b,
55 vector unsigned char __c);
56
57static __inline__ vector bool char __ATTRS_o_ai
58vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
59
60static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
61 vector signed short __b,
62 vector unsigned char __c);
63
64static __inline__ vector unsigned short __ATTRS_o_ai
65vec_perm(vector unsigned short __a, vector unsigned short __b,
66 vector unsigned char __c);
67
68static __inline__ vector bool short __ATTRS_o_ai vec_perm(
69 vector bool short __a, vector bool short __b, vector unsigned char __c);
70
71static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
72 vector pixel __b,
73 vector unsigned char __c);
74
75static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
76 vector signed int __b,
77 vector unsigned char __c);
78
79static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
80 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
81
82static __inline__ vector bool int __ATTRS_o_ai
83vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
84
85static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
86 vector float __b,
87 vector unsigned char __c);
88
89#ifdef __VSX__
90static __inline__ vector long long __ATTRS_o_ai
91vec_perm(vector signed long long __a, vector signed long long __b,
92 vector unsigned char __c);
93
94static __inline__ vector unsigned long long __ATTRS_o_ai
95vec_perm(vector unsigned long long __a, vector unsigned long long __b,
96 vector unsigned char __c);
97
98static __inline__ vector bool long long __ATTRS_o_ai
99vec_perm(vector bool long long __a, vector bool long long __b,
100 vector unsigned char __c);
101
102static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
103 vector double __b,
104 vector unsigned char __c);
105#endif
106
107static __inline__ vector unsigned char __ATTRS_o_ai
108vec_xor(vector unsigned char __a, vector unsigned char __b);
109
110/* vec_abs */
111
112#define __builtin_altivec_abs_v16qi vec_abs
113#define __builtin_altivec_abs_v8hi vec_abs
114#define __builtin_altivec_abs_v4si vec_abs
115
116static __inline__ vector signed char __ATTRS_o_ai
117vec_abs(vector signed char __a) {
118 return __builtin_altivec_vmaxsb(__a, -__a);
119}
120
121static __inline__ vector signed short __ATTRS_o_ai
122vec_abs(vector signed short __a) {
123 return __builtin_altivec_vmaxsh(__a, -__a);
124}
125
126static __inline__ vector signed int __ATTRS_o_ai
127vec_abs(vector signed int __a) {
128 return __builtin_altivec_vmaxsw(__a, -__a);
129}
130
131#ifdef __POWER8_VECTOR__
132static __inline__ vector signed long long __ATTRS_o_ai
133vec_abs(vector signed long long __a) {
134 return __builtin_altivec_vmaxsd(__a, -__a);
135}
136#endif
137
138static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
139#ifdef __VSX__
140 return __builtin_vsx_xvabssp(__a);
141#else
142 vector unsigned int __res =
143 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
144 return (vector float)__res;
145#endif
146}
147
148#ifdef __VSX__
149static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
150 return __builtin_vsx_xvabsdp(__a);
151}
152#endif
153
154/* vec_abss */
155#define __builtin_altivec_abss_v16qi vec_abss
156#define __builtin_altivec_abss_v8hi vec_abss
157#define __builtin_altivec_abss_v4si vec_abss
158
159static __inline__ vector signed char __ATTRS_o_ai
160vec_abss(vector signed char __a) {
161 return __builtin_altivec_vmaxsb(
162 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
163}
164
165static __inline__ vector signed short __ATTRS_o_ai
166vec_abss(vector signed short __a) {
167 return __builtin_altivec_vmaxsh(
168 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
169}
170
171static __inline__ vector signed int __ATTRS_o_ai
172vec_abss(vector signed int __a) {
173 return __builtin_altivec_vmaxsw(
174 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
175}
176
177/* vec_absd */
178#if defined(__POWER9_VECTOR__)
179
180static __inline__ vector unsigned char __ATTRS_o_ai
181vec_absd(vector unsigned char __a, vector unsigned char __b) {
182 return __builtin_altivec_vabsdub(__a, __b);
183}
184
185static __inline__ vector unsigned short __ATTRS_o_ai
186vec_absd(vector unsigned short __a, vector unsigned short __b) {
187 return __builtin_altivec_vabsduh(__a, __b);
188}
189
190static __inline__ vector unsigned int __ATTRS_o_ai
191vec_absd(vector unsigned int __a, vector unsigned int __b) {
192 return __builtin_altivec_vabsduw(__a, __b);
193}
194
195#endif /* End __POWER9_VECTOR__ */
196
197/* vec_add */
198
199static __inline__ vector signed char __ATTRS_o_ai
200vec_add(vector signed char __a, vector signed char __b) {
201 return __a + __b;
202}
203
204static __inline__ vector signed char __ATTRS_o_ai
205vec_add(vector bool char __a, vector signed char __b) {
206 return (vector signed char)__a + __b;
207}
208
209static __inline__ vector signed char __ATTRS_o_ai
210vec_add(vector signed char __a, vector bool char __b) {
211 return __a + (vector signed char)__b;
212}
213
214static __inline__ vector unsigned char __ATTRS_o_ai
215vec_add(vector unsigned char __a, vector unsigned char __b) {
216 return __a + __b;
217}
218
219static __inline__ vector unsigned char __ATTRS_o_ai
220vec_add(vector bool char __a, vector unsigned char __b) {
221 return (vector unsigned char)__a + __b;
222}
223
224static __inline__ vector unsigned char __ATTRS_o_ai
225vec_add(vector unsigned char __a, vector bool char __b) {
226 return __a + (vector unsigned char)__b;
227}
228
229static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
230 vector short __b) {
231 return __a + __b;
232}
233
234static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
235 vector short __b) {
236 return (vector short)__a + __b;
237}
238
239static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
240 vector bool short __b) {
241 return __a + (vector short)__b;
242}
243
244static __inline__ vector unsigned short __ATTRS_o_ai
245vec_add(vector unsigned short __a, vector unsigned short __b) {
246 return __a + __b;
247}
248
249static __inline__ vector unsigned short __ATTRS_o_ai
250vec_add(vector bool short __a, vector unsigned short __b) {
251 return (vector unsigned short)__a + __b;
252}
253
254static __inline__ vector unsigned short __ATTRS_o_ai
255vec_add(vector unsigned short __a, vector bool short __b) {
256 return __a + (vector unsigned short)__b;
257}
258
259static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
260 vector int __b) {
261 return __a + __b;
262}
263
264static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
265 vector int __b) {
266 return (vector int)__a + __b;
267}
268
269static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
270 vector bool int __b) {
271 return __a + (vector int)__b;
272}
273
274static __inline__ vector unsigned int __ATTRS_o_ai
275vec_add(vector unsigned int __a, vector unsigned int __b) {
276 return __a + __b;
277}
278
279static __inline__ vector unsigned int __ATTRS_o_ai
280vec_add(vector bool int __a, vector unsigned int __b) {
281 return (vector unsigned int)__a + __b;
282}
283
284static __inline__ vector unsigned int __ATTRS_o_ai
285vec_add(vector unsigned int __a, vector bool int __b) {
286 return __a + (vector unsigned int)__b;
287}
288
289#ifdef __POWER8_VECTOR__
290static __inline__ vector signed long long __ATTRS_o_ai
291vec_add(vector signed long long __a, vector signed long long __b) {
292 return __a + __b;
293}
294
295static __inline__ vector unsigned long long __ATTRS_o_ai
296vec_add(vector unsigned long long __a, vector unsigned long long __b) {
297 return __a + __b;
298}
299
300#ifdef __SIZEOF_INT128__
301static __inline__ vector signed __int128 __ATTRS_o_ai
302vec_add(vector signed __int128 __a, vector signed __int128 __b) {
303 return __a + __b;
304}
305
306static __inline__ vector unsigned __int128 __ATTRS_o_ai
307vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
308 return __a + __b;
309}
310#endif
311
312static __inline__ vector unsigned char __attribute__((__always_inline__))
313vec_add_u128(vector unsigned char __a, vector unsigned char __b) {
314 return (vector unsigned char)__builtin_altivec_vadduqm(__a, __b);
315}
316#elif defined(__VSX__)
317static __inline__ vector signed long long __ATTRS_o_ai
318vec_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.
322 return __a + __b;
323#else
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);
332#endif
333}
334
335static __inline__ vector unsigned long long __ATTRS_o_ai
336vec_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);
339}
340#endif // __POWER8_VECTOR__
341
342static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
343 vector float __b) {
344 return __a + __b;
345}
346
347#ifdef __VSX__
348static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
349 vector double __b) {
350 return __a + __b;
351}
352#endif // __VSX__
353
354/* vec_adde */
355
356#ifdef __POWER8_VECTOR__
357#ifdef __SIZEOF_INT128__
358static __inline__ vector signed __int128 __ATTRS_o_ai
359vec_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);
364}
365
366static __inline__ vector unsigned __int128 __ATTRS_o_ai
367vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
368 vector unsigned __int128 __c) {
369 return __builtin_altivec_vaddeuqm(__a, __b, __c);
370}
371#endif
372
373static __inline__ vector unsigned char __attribute__((__always_inline__))
374vec_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);
379}
380#endif
381
382static __inline__ vector signed int __ATTRS_o_ai
383vec_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);
388}
389
390static __inline__ vector unsigned int __ATTRS_o_ai
391vec_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);
396}
397
398/* vec_addec */
399
400#ifdef __POWER8_VECTOR__
401#ifdef __SIZEOF_INT128__
402static __inline__ vector signed __int128 __ATTRS_o_ai
403vec_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);
408}
409
410static __inline__ vector unsigned __int128 __ATTRS_o_ai
411vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
412 vector unsigned __int128 __c) {
413 return __builtin_altivec_vaddecuq(__a, __b, __c);
414}
415#endif
416
417static __inline__ vector unsigned char __attribute__((__always_inline__))
418vec_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);
423}
424
425#ifdef __powerpc64__
426static __inline__ vector signed int __ATTRS_o_ai
427vec_addec(vector signed int __a, vector signed int __b,
428 vector signed int __c) {
429
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;
443 }
444
445 vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
446 return ret;
447}
448
449static __inline__ vector unsigned int __ATTRS_o_ai
450vec_addec(vector unsigned int __a, vector unsigned int __b,
451 vector unsigned int __c) {
452
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;
463 }
464
465 vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
466 return ret;
467}
468#endif // __powerpc64__
469#endif // __POWER8_VECTOR__
470
471/* vec_vaddubm */
472
473#define __builtin_altivec_vaddubm vec_vaddubm
474
475static __inline__ vector signed char __ATTRS_o_ai
476vec_vaddubm(vector signed char __a, vector signed char __b) {
477 return __a + __b;
478}
479
480static __inline__ vector signed char __ATTRS_o_ai
481vec_vaddubm(vector bool char __a, vector signed char __b) {
482 return (vector signed char)__a + __b;
483}
484
485static __inline__ vector signed char __ATTRS_o_ai
486vec_vaddubm(vector signed char __a, vector bool char __b) {
487 return __a + (vector signed char)__b;
488}
489
490static __inline__ vector unsigned char __ATTRS_o_ai
491vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
492 return __a + __b;
493}
494
495static __inline__ vector unsigned char __ATTRS_o_ai
496vec_vaddubm(vector bool char __a, vector unsigned char __b) {
497 return (vector unsigned char)__a + __b;
498}
499
500static __inline__ vector unsigned char __ATTRS_o_ai
501vec_vaddubm(vector unsigned char __a, vector bool char __b) {
502 return __a + (vector unsigned char)__b;
503}
504
505/* vec_vadduhm */
506
507#define __builtin_altivec_vadduhm vec_vadduhm
508
509static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
510 vector short __b) {
511 return __a + __b;
512}
513
514static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
515 vector short __b) {
516 return (vector short)__a + __b;
517}
518
519static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
520 vector bool short __b) {
521 return __a + (vector short)__b;
522}
523
524static __inline__ vector unsigned short __ATTRS_o_ai
525vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
526 return __a + __b;
527}
528
529static __inline__ vector unsigned short __ATTRS_o_ai
530vec_vadduhm(vector bool short __a, vector unsigned short __b) {
531 return (vector unsigned short)__a + __b;
532}
533
534static __inline__ vector unsigned short __ATTRS_o_ai
535vec_vadduhm(vector unsigned short __a, vector bool short __b) {
536 return __a + (vector unsigned short)__b;
537}
538
539/* vec_vadduwm */
540
541#define __builtin_altivec_vadduwm vec_vadduwm
542
543static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
544 vector int __b) {
545 return __a + __b;
546}
547
548static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
549 vector int __b) {
550 return (vector int)__a + __b;
551}
552
553static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
554 vector bool int __b) {
555 return __a + (vector int)__b;
556}
557
558static __inline__ vector unsigned int __ATTRS_o_ai
559vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
560 return __a + __b;
561}
562
563static __inline__ vector unsigned int __ATTRS_o_ai
564vec_vadduwm(vector bool int __a, vector unsigned int __b) {
565 return (vector unsigned int)__a + __b;
566}
567
568static __inline__ vector unsigned int __ATTRS_o_ai
569vec_vadduwm(vector unsigned int __a, vector bool int __b) {
570 return __a + (vector unsigned int)__b;
571}
572
573/* vec_vaddfp */
574
575#define __builtin_altivec_vaddfp vec_vaddfp
576
577static __inline__ vector float __attribute__((__always_inline__))
578vec_vaddfp(vector float __a, vector float __b) {
579 return __a + __b;
580}
581
582/* vec_addc */
583
584static __inline__ vector signed int __ATTRS_o_ai
585vec_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);
588}
589
590static __inline__ vector unsigned int __ATTRS_o_ai
591vec_addc(vector unsigned int __a, vector unsigned int __b) {
592 return __builtin_altivec_vaddcuw(__a, __b);
593}
594
595#ifdef __POWER8_VECTOR__
596#ifdef __SIZEOF_INT128__
597static __inline__ vector signed __int128 __ATTRS_o_ai
598vec_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);
601}
602
603static __inline__ vector unsigned __int128 __ATTRS_o_ai
604vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
605 return __builtin_altivec_vaddcuq(__a, __b);
606}
607#endif
608
609static __inline__ vector unsigned char __attribute__((__always_inline__))
610vec_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);
613}
614#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
615
616/* vec_vaddcuw */
617
618static __inline__ vector unsigned int __attribute__((__always_inline__))
619vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
620 return __builtin_altivec_vaddcuw(__a, __b);
621}
622
623/* vec_adds */
624
625static __inline__ vector signed char __ATTRS_o_ai
626vec_adds(vector signed char __a, vector signed char __b) {
627 return __builtin_altivec_vaddsbs(__a, __b);
628}
629
630static __inline__ vector signed char __ATTRS_o_ai
631vec_adds(vector bool char __a, vector signed char __b) {
632 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
633}
634
635static __inline__ vector signed char __ATTRS_o_ai
636vec_adds(vector signed char __a, vector bool char __b) {
637 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
638}
639
640static __inline__ vector unsigned char __ATTRS_o_ai
641vec_adds(vector unsigned char __a, vector unsigned char __b) {
642 return __builtin_altivec_vaddubs(__a, __b);
643}
644
645static __inline__ vector unsigned char __ATTRS_o_ai
646vec_adds(vector bool char __a, vector unsigned char __b) {
647 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
648}
649
650static __inline__ vector unsigned char __ATTRS_o_ai
651vec_adds(vector unsigned char __a, vector bool char __b) {
652 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
653}
654
655static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
656 vector short __b) {
657 return __builtin_altivec_vaddshs(__a, __b);
658}
659
660static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
661 vector short __b) {
662 return __builtin_altivec_vaddshs((vector short)__a, __b);
663}
664
665static __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);
668}
669
670static __inline__ vector unsigned short __ATTRS_o_ai
671vec_adds(vector unsigned short __a, vector unsigned short __b) {
672 return __builtin_altivec_vadduhs(__a, __b);
673}
674
675static __inline__ vector unsigned short __ATTRS_o_ai
676vec_adds(vector bool short __a, vector unsigned short __b) {
677 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
678}
679
680static __inline__ vector unsigned short __ATTRS_o_ai
681vec_adds(vector unsigned short __a, vector bool short __b) {
682 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
683}
684
685static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
686 vector int __b) {
687 return __builtin_altivec_vaddsws(__a, __b);
688}
689
690static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
691 vector int __b) {
692 return __builtin_altivec_vaddsws((vector int)__a, __b);
693}
694
695static __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);
698}
699
700static __inline__ vector unsigned int __ATTRS_o_ai
701vec_adds(vector unsigned int __a, vector unsigned int __b) {
702 return __builtin_altivec_vadduws(__a, __b);
703}
704
705static __inline__ vector unsigned int __ATTRS_o_ai
706vec_adds(vector bool int __a, vector unsigned int __b) {
707 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
708}
709
710static __inline__ vector unsigned int __ATTRS_o_ai
711vec_adds(vector unsigned int __a, vector bool int __b) {
712 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
713}
714
715/* vec_vaddsbs */
716
717static __inline__ vector signed char __ATTRS_o_ai
718vec_vaddsbs(vector signed char __a, vector signed char __b) {
719 return __builtin_altivec_vaddsbs(__a, __b);
720}
721
722static __inline__ vector signed char __ATTRS_o_ai
723vec_vaddsbs(vector bool char __a, vector signed char __b) {
724 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
725}
726
727static __inline__ vector signed char __ATTRS_o_ai
728vec_vaddsbs(vector signed char __a, vector bool char __b) {
729 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
730}
731
732/* vec_vaddubs */
733
734static __inline__ vector unsigned char __ATTRS_o_ai
735vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
736 return __builtin_altivec_vaddubs(__a, __b);
737}
738
739static __inline__ vector unsigned char __ATTRS_o_ai
740vec_vaddubs(vector bool char __a, vector unsigned char __b) {
741 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
742}
743
744static __inline__ vector unsigned char __ATTRS_o_ai
745vec_vaddubs(vector unsigned char __a, vector bool char __b) {
746 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
747}
748
749/* vec_vaddshs */
750
751static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
752 vector short __b) {
753 return __builtin_altivec_vaddshs(__a, __b);
754}
755
756static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
757 vector short __b) {
758 return __builtin_altivec_vaddshs((vector short)__a, __b);
759}
760
761static __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);
764}
765
766/* vec_vadduhs */
767
768static __inline__ vector unsigned short __ATTRS_o_ai
769vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
770 return __builtin_altivec_vadduhs(__a, __b);
771}
772
773static __inline__ vector unsigned short __ATTRS_o_ai
774vec_vadduhs(vector bool short __a, vector unsigned short __b) {
775 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
776}
777
778static __inline__ vector unsigned short __ATTRS_o_ai
779vec_vadduhs(vector unsigned short __a, vector bool short __b) {
780 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
781}
782
783/* vec_vaddsws */
784
785static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
786 vector int __b) {
787 return __builtin_altivec_vaddsws(__a, __b);
788}
789
790static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
791 vector int __b) {
792 return __builtin_altivec_vaddsws((vector int)__a, __b);
793}
794
795static __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);
798}
799
800/* vec_vadduws */
801
802static __inline__ vector unsigned int __ATTRS_o_ai
803vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
804 return __builtin_altivec_vadduws(__a, __b);
805}
806
807static __inline__ vector unsigned int __ATTRS_o_ai
808vec_vadduws(vector bool int __a, vector unsigned int __b) {
809 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
810}
811
812static __inline__ vector unsigned int __ATTRS_o_ai
813vec_vadduws(vector unsigned int __a, vector bool int __b) {
814 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
815}
816
817#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
818 defined(__SIZEOF_INT128__)
819/* vec_vadduqm */
820
821static __inline__ vector signed __int128 __ATTRS_o_ai
822vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
823 return __a + __b;
824}
825
826static __inline__ vector unsigned __int128 __ATTRS_o_ai
827vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
828 return __a + __b;
829}
830
831/* vec_vaddeuqm */
832
833static __inline__ vector signed __int128 __ATTRS_o_ai
834vec_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);
839}
840
841static __inline__ vector unsigned __int128 __ATTRS_o_ai
842vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
843 vector unsigned __int128 __c) {
844 return __builtin_altivec_vaddeuqm(__a, __b, __c);
845}
846
847/* vec_vaddcuq */
848
849static __inline__ vector signed __int128 __ATTRS_o_ai
850vec_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);
853}
854
855static __inline__ vector unsigned __int128 __ATTRS_o_ai
856vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
857 return __builtin_altivec_vaddcuq(__a, __b);
858}
859
860/* vec_vaddecuq */
861
862static __inline__ vector signed __int128 __ATTRS_o_ai
863vec_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);
868}
869
870static __inline__ vector unsigned __int128 __ATTRS_o_ai
871vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
872 vector unsigned __int128 __c) {
873 return __builtin_altivec_vaddecuq(__a, __b, __c);
874}
875#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
876
877/* vec_and */
878
879#define __builtin_altivec_vand vec_and
880
881static __inline__ vector signed char __ATTRS_o_ai
882vec_and(vector signed char __a, vector signed char __b) {
883 return __a & __b;
884}
885
886static __inline__ vector signed char __ATTRS_o_ai
887vec_and(vector bool char __a, vector signed char __b) {
888 return (vector signed char)__a & __b;
889}
890
891static __inline__ vector signed char __ATTRS_o_ai
892vec_and(vector signed char __a, vector bool char __b) {
893 return __a & (vector signed char)__b;
894}
895
896static __inline__ vector unsigned char __ATTRS_o_ai
897vec_and(vector unsigned char __a, vector unsigned char __b) {
898 return __a & __b;
899}
900
901static __inline__ vector unsigned char __ATTRS_o_ai
902vec_and(vector bool char __a, vector unsigned char __b) {
903 return (vector unsigned char)__a & __b;
904}
905
906static __inline__ vector unsigned char __ATTRS_o_ai
907vec_and(vector unsigned char __a, vector bool char __b) {
908 return __a & (vector unsigned char)__b;
909}
910
911static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
912 vector bool char __b) {
913 return __a & __b;
914}
915
916static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
917 vector short __b) {
918 return __a & __b;
919}
920
921static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
922 vector short __b) {
923 return (vector short)__a & __b;
924}
925
926static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
927 vector bool short __b) {
928 return __a & (vector short)__b;
929}
930
931static __inline__ vector unsigned short __ATTRS_o_ai
932vec_and(vector unsigned short __a, vector unsigned short __b) {
933 return __a & __b;
934}
935
936static __inline__ vector unsigned short __ATTRS_o_ai
937vec_and(vector bool short __a, vector unsigned short __b) {
938 return (vector unsigned short)__a & __b;
939}
940
941static __inline__ vector unsigned short __ATTRS_o_ai
942vec_and(vector unsigned short __a, vector bool short __b) {
943 return __a & (vector unsigned short)__b;
944}
945
946static __inline__ vector bool short __ATTRS_o_ai
947vec_and(vector bool short __a, vector bool short __b) {
948 return __a & __b;
949}
950
951static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
952 vector int __b) {
953 return __a & __b;
954}
955
956static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
957 vector int __b) {
958 return (vector int)__a & __b;
959}
960
961static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
962 vector bool int __b) {
963 return __a & (vector int)__b;
964}
965
966static __inline__ vector unsigned int __ATTRS_o_ai
967vec_and(vector unsigned int __a, vector unsigned int __b) {
968 return __a & __b;
969}
970
971static __inline__ vector unsigned int __ATTRS_o_ai
972vec_and(vector bool int __a, vector unsigned int __b) {
973 return (vector unsigned int)__a & __b;
974}
975
976static __inline__ vector unsigned int __ATTRS_o_ai
977vec_and(vector unsigned int __a, vector bool int __b) {
978 return __a & (vector unsigned int)__b;
979}
980
981static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
982 vector bool int __b) {
983 return __a & __b;
984}
985
986static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
987 vector float __b) {
988 vector unsigned int __res =
989 (vector unsigned int)__a & (vector unsigned int)__b;
990 return (vector float)__res;
991}
992
993static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
994 vector float __b) {
995 vector unsigned int __res =
996 (vector unsigned int)__a & (vector unsigned int)__b;
997 return (vector float)__res;
998}
999
1000static __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;
1005}
1006
1007#ifdef __VSX__
1008static __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;
1013}
1014
1015static __inline__ vector double __ATTRS_o_ai
1016vec_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;
1020}
1021
1022static __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;
1027}
1028
1029static __inline__ vector signed long long __ATTRS_o_ai
1030vec_and(vector signed long long __a, vector signed long long __b) {
1031 return __a & __b;
1032}
1033
1034static __inline__ vector signed long long __ATTRS_o_ai
1035vec_and(vector bool long long __a, vector signed long long __b) {
1036 return (vector signed long long)__a & __b;
1037}
1038
1039static __inline__ vector signed long long __ATTRS_o_ai
1040vec_and(vector signed long long __a, vector bool long long __b) {
1041 return __a & (vector signed long long)__b;
1042}
1043
1044static __inline__ vector unsigned long long __ATTRS_o_ai
1045vec_and(vector unsigned long long __a, vector unsigned long long __b) {
1046 return __a & __b;
1047}
1048
1049static __inline__ vector unsigned long long __ATTRS_o_ai
1050vec_and(vector bool long long __a, vector unsigned long long __b) {
1051 return (vector unsigned long long)__a & __b;
1052}
1053
1054static __inline__ vector unsigned long long __ATTRS_o_ai
1055vec_and(vector unsigned long long __a, vector bool long long __b) {
1056 return __a & (vector unsigned long long)__b;
1057}
1058
1059static __inline__ vector bool long long __ATTRS_o_ai
1060vec_and(vector bool long long __a, vector bool long long __b) {
1061 return __a & __b;
1062}
1063#endif
1064
1065/* vec_vand */
1066
1067static __inline__ vector signed char __ATTRS_o_ai
1068vec_vand(vector signed char __a, vector signed char __b) {
1069 return __a & __b;
1070}
1071
1072static __inline__ vector signed char __ATTRS_o_ai
1073vec_vand(vector bool char __a, vector signed char __b) {
1074 return (vector signed char)__a & __b;
1075}
1076
1077static __inline__ vector signed char __ATTRS_o_ai
1078vec_vand(vector signed char __a, vector bool char __b) {
1079 return __a & (vector signed char)__b;
1080}
1081
1082static __inline__ vector unsigned char __ATTRS_o_ai
1083vec_vand(vector unsigned char __a, vector unsigned char __b) {
1084 return __a & __b;
1085}
1086
1087static __inline__ vector unsigned char __ATTRS_o_ai
1088vec_vand(vector bool char __a, vector unsigned char __b) {
1089 return (vector unsigned char)__a & __b;
1090}
1091
1092static __inline__ vector unsigned char __ATTRS_o_ai
1093vec_vand(vector unsigned char __a, vector bool char __b) {
1094 return __a & (vector unsigned char)__b;
1095}
1096
1097static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1098 vector bool char __b) {
1099 return __a & __b;
1100}
1101
1102static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1103 vector short __b) {
1104 return __a & __b;
1105}
1106
1107static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1108 vector short __b) {
1109 return (vector short)__a & __b;
1110}
1111
1112static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1113 vector bool short __b) {
1114 return __a & (vector short)__b;
1115}
1116
1117static __inline__ vector unsigned short __ATTRS_o_ai
1118vec_vand(vector unsigned short __a, vector unsigned short __b) {
1119 return __a & __b;
1120}
1121
1122static __inline__ vector unsigned short __ATTRS_o_ai
1123vec_vand(vector bool short __a, vector unsigned short __b) {
1124 return (vector unsigned short)__a & __b;
1125}
1126
1127static __inline__ vector unsigned short __ATTRS_o_ai
1128vec_vand(vector unsigned short __a, vector bool short __b) {
1129 return __a & (vector unsigned short)__b;
1130}
1131
1132static __inline__ vector bool short __ATTRS_o_ai
1133vec_vand(vector bool short __a, vector bool short __b) {
1134 return __a & __b;
1135}
1136
1137static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1138 vector int __b) {
1139 return __a & __b;
1140}
1141
1142static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1143 vector int __b) {
1144 return (vector int)__a & __b;
1145}
1146
1147static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1148 vector bool int __b) {
1149 return __a & (vector int)__b;
1150}
1151
1152static __inline__ vector unsigned int __ATTRS_o_ai
1153vec_vand(vector unsigned int __a, vector unsigned int __b) {
1154 return __a & __b;
1155}
1156
1157static __inline__ vector unsigned int __ATTRS_o_ai
1158vec_vand(vector bool int __a, vector unsigned int __b) {
1159 return (vector unsigned int)__a & __b;
1160}
1161
1162static __inline__ vector unsigned int __ATTRS_o_ai
1163vec_vand(vector unsigned int __a, vector bool int __b) {
1164 return __a & (vector unsigned int)__b;
1165}
1166
1167static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1168 vector bool int __b) {
1169 return __a & __b;
1170}
1171
1172static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1173 vector float __b) {
1174 vector unsigned int __res =
1175 (vector unsigned int)__a & (vector unsigned int)__b;
1176 return (vector float)__res;
1177}
1178
1179static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1180 vector float __b) {
1181 vector unsigned int __res =
1182 (vector unsigned int)__a & (vector unsigned int)__b;
1183 return (vector float)__res;
1184}
1185
1186static __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;
1191}
1192
1193#ifdef __VSX__
1194static __inline__ vector signed long long __ATTRS_o_ai
1195vec_vand(vector signed long long __a, vector signed long long __b) {
1196 return __a & __b;
1197}
1198
1199static __inline__ vector signed long long __ATTRS_o_ai
1200vec_vand(vector bool long long __a, vector signed long long __b) {
1201 return (vector signed long long)__a & __b;
1202}
1203
1204static __inline__ vector signed long long __ATTRS_o_ai
1205vec_vand(vector signed long long __a, vector bool long long __b) {
1206 return __a & (vector signed long long)__b;
1207}
1208
1209static __inline__ vector unsigned long long __ATTRS_o_ai
1210vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1211 return __a & __b;
1212}
1213
1214static __inline__ vector unsigned long long __ATTRS_o_ai
1215vec_vand(vector bool long long __a, vector unsigned long long __b) {
1216 return (vector unsigned long long)__a & __b;
1217}
1218
1219static __inline__ vector unsigned long long __ATTRS_o_ai
1220vec_vand(vector unsigned long long __a, vector bool long long __b) {
1221 return __a & (vector unsigned long long)__b;
1222}
1223
1224static __inline__ vector bool long long __ATTRS_o_ai
1225vec_vand(vector bool long long __a, vector bool long long __b) {
1226 return __a & __b;
1227}
1228#endif
1229
1230/* vec_andc */
1231
1232#define __builtin_altivec_vandc vec_andc
1233
1234static __inline__ vector signed char __ATTRS_o_ai
1235vec_andc(vector signed char __a, vector signed char __b) {
1236 return __a & ~__b;
1237}
1238
1239static __inline__ vector signed char __ATTRS_o_ai
1240vec_andc(vector bool char __a, vector signed char __b) {
1241 return (vector signed char)__a & ~__b;
1242}
1243
1244static __inline__ vector signed char __ATTRS_o_ai
1245vec_andc(vector signed char __a, vector bool char __b) {
1246 return __a & ~(vector signed char)__b;
1247}
1248
1249static __inline__ vector unsigned char __ATTRS_o_ai
1250vec_andc(vector unsigned char __a, vector unsigned char __b) {
1251 return __a & ~__b;
1252}
1253
1254static __inline__ vector unsigned char __ATTRS_o_ai
1255vec_andc(vector bool char __a, vector unsigned char __b) {
1256 return (vector unsigned char)__a & ~__b;
1257}
1258
1259static __inline__ vector unsigned char __ATTRS_o_ai
1260vec_andc(vector unsigned char __a, vector bool char __b) {
1261 return __a & ~(vector unsigned char)__b;
1262}
1263
1264static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1265 vector bool char __b) {
1266 return __a & ~__b;
1267}
1268
1269static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1270 vector short __b) {
1271 return __a & ~__b;
1272}
1273
1274static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1275 vector short __b) {
1276 return (vector short)__a & ~__b;
1277}
1278
1279static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1280 vector bool short __b) {
1281 return __a & ~(vector short)__b;
1282}
1283
1284static __inline__ vector unsigned short __ATTRS_o_ai
1285vec_andc(vector unsigned short __a, vector unsigned short __b) {
1286 return __a & ~__b;
1287}
1288
1289static __inline__ vector unsigned short __ATTRS_o_ai
1290vec_andc(vector bool short __a, vector unsigned short __b) {
1291 return (vector unsigned short)__a & ~__b;
1292}
1293
1294static __inline__ vector unsigned short __ATTRS_o_ai
1295vec_andc(vector unsigned short __a, vector bool short __b) {
1296 return __a & ~(vector unsigned short)__b;
1297}
1298
1299static __inline__ vector bool short __ATTRS_o_ai
1300vec_andc(vector bool short __a, vector bool short __b) {
1301 return __a & ~__b;
1302}
1303
1304static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1305 vector int __b) {
1306 return __a & ~__b;
1307}
1308
1309static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1310 vector int __b) {
1311 return (vector int)__a & ~__b;
1312}
1313
1314static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1315 vector bool int __b) {
1316 return __a & ~(vector int)__b;
1317}
1318
1319static __inline__ vector unsigned int __ATTRS_o_ai
1320vec_andc(vector unsigned int __a, vector unsigned int __b) {
1321 return __a & ~__b;
1322}
1323
1324static __inline__ vector unsigned int __ATTRS_o_ai
1325vec_andc(vector bool int __a, vector unsigned int __b) {
1326 return (vector unsigned int)__a & ~__b;
1327}
1328
1329static __inline__ vector unsigned int __ATTRS_o_ai
1330vec_andc(vector unsigned int __a, vector bool int __b) {
1331 return __a & ~(vector unsigned int)__b;
1332}
1333
1334static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1335 vector bool int __b) {
1336 return __a & ~__b;
1337}
1338
1339static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1340 vector float __b) {
1341 vector unsigned int __res =
1342 (vector unsigned int)__a & ~(vector unsigned int)__b;
1343 return (vector float)__res;
1344}
1345
1346static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1347 vector float __b) {
1348 vector unsigned int __res =
1349 (vector unsigned int)__a & ~(vector unsigned int)__b;
1350 return (vector float)__res;
1351}
1352
1353static __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;
1358}
1359
1360#ifdef __VSX__
1361static __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;
1366}
1367
1368static __inline__ vector double __ATTRS_o_ai
1369vec_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;
1373}
1374
1375static __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;
1380}
1381
1382static __inline__ vector signed long long __ATTRS_o_ai
1383vec_andc(vector signed long long __a, vector signed long long __b) {
1384 return __a & ~__b;
1385}
1386
1387static __inline__ vector signed long long __ATTRS_o_ai
1388vec_andc(vector bool long long __a, vector signed long long __b) {
1389 return (vector signed long long)__a & ~__b;
1390}
1391
1392static __inline__ vector signed long long __ATTRS_o_ai
1393vec_andc(vector signed long long __a, vector bool long long __b) {
1394 return __a & ~(vector signed long long)__b;
1395}
1396
1397static __inline__ vector unsigned long long __ATTRS_o_ai
1398vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1399 return __a & ~__b;
1400}
1401
1402static __inline__ vector unsigned long long __ATTRS_o_ai
1403vec_andc(vector bool long long __a, vector unsigned long long __b) {
1404 return (vector unsigned long long)__a & ~__b;
1405}
1406
1407static __inline__ vector unsigned long long __ATTRS_o_ai
1408vec_andc(vector unsigned long long __a, vector bool long long __b) {
1409 return __a & ~(vector unsigned long long)__b;
1410}
1411
1412static __inline__ vector bool long long __ATTRS_o_ai
1413vec_andc(vector bool long long __a, vector bool long long __b) {
1414 return __a & ~__b;
1415}
1416#endif
1417
1418/* vec_vandc */
1419
1420static __inline__ vector signed char __ATTRS_o_ai
1421vec_vandc(vector signed char __a, vector signed char __b) {
1422 return __a & ~__b;
1423}
1424
1425static __inline__ vector signed char __ATTRS_o_ai
1426vec_vandc(vector bool char __a, vector signed char __b) {
1427 return (vector signed char)__a & ~__b;
1428}
1429
1430static __inline__ vector signed char __ATTRS_o_ai
1431vec_vandc(vector signed char __a, vector bool char __b) {
1432 return __a & ~(vector signed char)__b;
1433}
1434
1435static __inline__ vector unsigned char __ATTRS_o_ai
1436vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1437 return __a & ~__b;
1438}
1439
1440static __inline__ vector unsigned char __ATTRS_o_ai
1441vec_vandc(vector bool char __a, vector unsigned char __b) {
1442 return (vector unsigned char)__a & ~__b;
1443}
1444
1445static __inline__ vector unsigned char __ATTRS_o_ai
1446vec_vandc(vector unsigned char __a, vector bool char __b) {
1447 return __a & ~(vector unsigned char)__b;
1448}
1449
1450static __inline__ vector bool char __ATTRS_o_ai
1451vec_vandc(vector bool char __a, vector bool char __b) {
1452 return __a & ~__b;
1453}
1454
1455static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1456 vector short __b) {
1457 return __a & ~__b;
1458}
1459
1460static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1461 vector short __b) {
1462 return (vector short)__a & ~__b;
1463}
1464
1465static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1466 vector bool short __b) {
1467 return __a & ~(vector short)__b;
1468}
1469
1470static __inline__ vector unsigned short __ATTRS_o_ai
1471vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1472 return __a & ~__b;
1473}
1474
1475static __inline__ vector unsigned short __ATTRS_o_ai
1476vec_vandc(vector bool short __a, vector unsigned short __b) {
1477 return (vector unsigned short)__a & ~__b;
1478}
1479
1480static __inline__ vector unsigned short __ATTRS_o_ai
1481vec_vandc(vector unsigned short __a, vector bool short __b) {
1482 return __a & ~(vector unsigned short)__b;
1483}
1484
1485static __inline__ vector bool short __ATTRS_o_ai
1486vec_vandc(vector bool short __a, vector bool short __b) {
1487 return __a & ~__b;
1488}
1489
1490static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1491 vector int __b) {
1492 return __a & ~__b;
1493}
1494
1495static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1496 vector int __b) {
1497 return (vector int)__a & ~__b;
1498}
1499
1500static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1501 vector bool int __b) {
1502 return __a & ~(vector int)__b;
1503}
1504
1505static __inline__ vector unsigned int __ATTRS_o_ai
1506vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1507 return __a & ~__b;
1508}
1509
1510static __inline__ vector unsigned int __ATTRS_o_ai
1511vec_vandc(vector bool int __a, vector unsigned int __b) {
1512 return (vector unsigned int)__a & ~__b;
1513}
1514
1515static __inline__ vector unsigned int __ATTRS_o_ai
1516vec_vandc(vector unsigned int __a, vector bool int __b) {
1517 return __a & ~(vector unsigned int)__b;
1518}
1519
1520static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1521 vector bool int __b) {
1522 return __a & ~__b;
1523}
1524
1525static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1526 vector float __b) {
1527 vector unsigned int __res =
1528 (vector unsigned int)__a & ~(vector unsigned int)__b;
1529 return (vector float)__res;
1530}
1531
1532static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1533 vector float __b) {
1534 vector unsigned int __res =
1535 (vector unsigned int)__a & ~(vector unsigned int)__b;
1536 return (vector float)__res;
1537}
1538
1539static __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;
1544}
1545
1546#ifdef __VSX__
1547static __inline__ vector signed long long __ATTRS_o_ai
1548vec_vandc(vector signed long long __a, vector signed long long __b) {
1549 return __a & ~__b;
1550}
1551
1552static __inline__ vector signed long long __ATTRS_o_ai
1553vec_vandc(vector bool long long __a, vector signed long long __b) {
1554 return (vector signed long long)__a & ~__b;
1555}
1556
1557static __inline__ vector signed long long __ATTRS_o_ai
1558vec_vandc(vector signed long long __a, vector bool long long __b) {
1559 return __a & ~(vector signed long long)__b;
1560}
1561
1562static __inline__ vector unsigned long long __ATTRS_o_ai
1563vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1564 return __a & ~__b;
1565}
1566
1567static __inline__ vector unsigned long long __ATTRS_o_ai
1568vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1569 return (vector unsigned long long)__a & ~__b;
1570}
1571
1572static __inline__ vector unsigned long long __ATTRS_o_ai
1573vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1574 return __a & ~(vector unsigned long long)__b;
1575}
1576
1577static __inline__ vector bool long long __ATTRS_o_ai
1578vec_vandc(vector bool long long __a, vector bool long long __b) {
1579 return __a & ~__b;
1580}
1581#endif
1582
1583/* vec_avg */
1584
1585static __inline__ vector signed char __ATTRS_o_ai
1586vec_avg(vector signed char __a, vector signed char __b) {
1587 return __builtin_altivec_vavgsb(__a, __b);
1588}
1589
1590static __inline__ vector unsigned char __ATTRS_o_ai
1591vec_avg(vector unsigned char __a, vector unsigned char __b) {
1592 return __builtin_altivec_vavgub(__a, __b);
1593}
1594
1595static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1596 vector short __b) {
1597 return __builtin_altivec_vavgsh(__a, __b);
1598}
1599
1600static __inline__ vector unsigned short __ATTRS_o_ai
1601vec_avg(vector unsigned short __a, vector unsigned short __b) {
1602 return __builtin_altivec_vavguh(__a, __b);
1603}
1604
1605static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1606 vector int __b) {
1607 return __builtin_altivec_vavgsw(__a, __b);
1608}
1609
1610static __inline__ vector unsigned int __ATTRS_o_ai
1611vec_avg(vector unsigned int __a, vector unsigned int __b) {
1612 return __builtin_altivec_vavguw(__a, __b);
1613}
1614
1615/* vec_vavgsb */
1616
1617static __inline__ vector signed char __attribute__((__always_inline__))
1618vec_vavgsb(vector signed char __a, vector signed char __b) {
1619 return __builtin_altivec_vavgsb(__a, __b);
1620}
1621
1622/* vec_vavgub */
1623
1624static __inline__ vector unsigned char __attribute__((__always_inline__))
1625vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1626 return __builtin_altivec_vavgub(__a, __b);
1627}
1628
1629/* vec_vavgsh */
1630
1631static __inline__ vector short __attribute__((__always_inline__))
1632vec_vavgsh(vector short __a, vector short __b) {
1633 return __builtin_altivec_vavgsh(__a, __b);
1634}
1635
1636/* vec_vavguh */
1637
1638static __inline__ vector unsigned short __attribute__((__always_inline__))
1639vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1640 return __builtin_altivec_vavguh(__a, __b);
1641}
1642
1643/* vec_vavgsw */
1644
1645static __inline__ vector int __attribute__((__always_inline__))
1646vec_vavgsw(vector int __a, vector int __b) {
1647 return __builtin_altivec_vavgsw(__a, __b);
1648}
1649
1650/* vec_vavguw */
1651
1652static __inline__ vector unsigned int __attribute__((__always_inline__))
1653vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1654 return __builtin_altivec_vavguw(__a, __b);
1655}
1656
1657/* vec_ceil */
1658
1659static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1660#ifdef __VSX__
1661 return __builtin_vsx_xvrspip(__a);
1662#else
1663 return __builtin_altivec_vrfip(__a);
1664#endif
1665}
1666
1667#ifdef __VSX__
1668static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1669 return __builtin_vsx_xvrdpip(__a);
1670}
1671#endif
1672
1673/* vec_roundp */
1674static __inline__ vector float __ATTRS_o_ai vec_roundp(vector float __a) {
1675 return vec_ceil(__a);
1676}
1677
1678#ifdef __VSX__
1679static __inline__ vector double __ATTRS_o_ai vec_roundp(vector double __a) {
1680 return vec_ceil(__a);
1681}
1682#endif
1683
1684/* vec_vrfip */
1685
1686static __inline__ vector float __attribute__((__always_inline__))
1687vec_vrfip(vector float __a) {
1688 return __builtin_altivec_vrfip(__a);
1689}
1690
1691/* vec_cmpb */
1692
1693static __inline__ vector int __attribute__((__always_inline__))
1694vec_cmpb(vector float __a, vector float __b) {
1695 return __builtin_altivec_vcmpbfp(__a, __b);
1696}
1697
1698/* vec_vcmpbfp */
1699
1700static __inline__ vector int __attribute__((__always_inline__))
1701vec_vcmpbfp(vector float __a, vector float __b) {
1702 return __builtin_altivec_vcmpbfp(__a, __b);
1703}
1704
1705/* vec_cmpeq */
1706
1707static __inline__ vector bool char __ATTRS_o_ai
1708vec_cmpeq(vector signed char __a, vector signed char __b) {
1709 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1710 (vector char)__b);
1711}
1712
1713static __inline__ vector bool char __ATTRS_o_ai
1714vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1715 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1716 (vector char)__b);
1717}
1718
1719static __inline__ vector bool char __ATTRS_o_ai
1720vec_cmpeq(vector bool char __a, vector bool char __b) {
1721 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1722 (vector char)__b);
1723}
1724
1725static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1726 vector short __b) {
1727 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1728}
1729
1730static __inline__ vector bool short __ATTRS_o_ai
1731vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1732 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1733 (vector short)__b);
1734}
1735
1736static __inline__ vector bool short __ATTRS_o_ai
1737vec_cmpeq(vector bool short __a, vector bool short __b) {
1738 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1739 (vector short)__b);
1740}
1741
1742static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1743 vector int __b) {
1744 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1745}
1746
1747static __inline__ vector bool int __ATTRS_o_ai
1748vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1749 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1750 (vector int)__b);
1751}
1752
1753static __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,
1756 (vector int)__b);
1757}
1758
1759#ifdef __POWER8_VECTOR__
1760static __inline__ vector bool long long __ATTRS_o_ai
1761vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1762 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1763}
1764
1765static __inline__ vector bool long long __ATTRS_o_ai
1766vec_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);
1769}
1770
1771static __inline__ vector bool long long __ATTRS_o_ai
1772vec_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);
1775}
1776#elif defined(__VSX__)
1777static __inline__ vector bool long long __ATTRS_o_ai
1778vec_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,
1784 1, 3, 3);
1785#else
1786 __wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 1, 2, 3, 0);
1787 return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 0,
1788 0, 2, 2);
1789#endif
1790}
1791
1792static __inline__ vector bool long long __ATTRS_o_ai
1793vec_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);
1795}
1796
1797static __inline__ vector bool long long __ATTRS_o_ai
1798vec_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);
1800}
1801#endif
1802
1803static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1804 vector float __b) {
1805#ifdef __VSX__
1806 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1807#else
1808 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1809#endif
1810}
1811
1812#ifdef __VSX__
1813static __inline__ vector bool long long __ATTRS_o_ai
1814vec_cmpeq(vector double __a, vector double __b) {
1815 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1816}
1817#endif
1818
1819#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1820static __inline__ vector bool __int128 __ATTRS_o_ai
1821vec_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);
1824}
1825
1826static __inline__ vector bool __int128 __ATTRS_o_ai
1827vec_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);
1830}
1831
1832static __inline__ vector bool __int128 __ATTRS_o_ai
1833vec_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);
1836}
1837#endif
1838
1839#ifdef __POWER9_VECTOR__
1840/* vec_cmpne */
1841
1842static __inline__ vector bool char __ATTRS_o_ai
1843vec_cmpne(vector bool char __a, vector bool char __b) {
1844 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1845 (vector char)__b);
1846}
1847
1848static __inline__ vector bool char __ATTRS_o_ai
1849vec_cmpne(vector signed char __a, vector signed char __b) {
1850 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1851 (vector char)__b);
1852}
1853
1854static __inline__ vector bool char __ATTRS_o_ai
1855vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1856 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1857 (vector char)__b);
1858}
1859
1860static __inline__ vector bool short __ATTRS_o_ai
1861vec_cmpne(vector bool short __a, vector bool short __b) {
1862 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1863 (vector short)__b);
1864}
1865
1866static __inline__ vector bool short __ATTRS_o_ai
1867vec_cmpne(vector signed short __a, vector signed short __b) {
1868 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1869 (vector short)__b);
1870}
1871
1872static __inline__ vector bool short __ATTRS_o_ai
1873vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1874 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1875 (vector short)__b);
1876}
1877
1878static __inline__ vector bool int __ATTRS_o_ai
1879vec_cmpne(vector bool int __a, vector bool int __b) {
1880 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1881 (vector int)__b);
1882}
1883
1884static __inline__ vector bool int __ATTRS_o_ai
1885vec_cmpne(vector signed int __a, vector signed int __b) {
1886 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1887 (vector int)__b);
1888}
1889
1890static __inline__ vector bool int __ATTRS_o_ai
1891vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1892 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1893 (vector int)__b);
1894}
1895
1896static __inline__ vector bool int __ATTRS_o_ai
1897vec_cmpne(vector float __a, vector float __b) {
1898 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1899 (vector int)__b);
1900}
1901
1902#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
1903static __inline__ vector bool __int128 __ATTRS_o_ai
1904vec_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));
1907}
1908
1909static __inline__ vector bool __int128 __ATTRS_o_ai
1910vec_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));
1913}
1914
1915static __inline__ vector bool __int128 __ATTRS_o_ai
1916vec_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));
1919}
1920#endif
1921
1922/* vec_cmpnez */
1923
1924static __inline__ vector bool char __ATTRS_o_ai
1925vec_cmpnez(vector signed char __a, vector signed char __b) {
1926 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1927 (vector char)__b);
1928}
1929
1930static __inline__ vector bool char __ATTRS_o_ai
1931vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1932 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1933 (vector char)__b);
1934}
1935
1936static __inline__ vector bool short __ATTRS_o_ai
1937vec_cmpnez(vector signed short __a, vector signed short __b) {
1938 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1939 (vector short)__b);
1940}
1941
1942static __inline__ vector bool short __ATTRS_o_ai
1943vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1944 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1945 (vector short)__b);
1946}
1947
1948static __inline__ vector bool int __ATTRS_o_ai
1949vec_cmpnez(vector signed int __a, vector signed int __b) {
1950 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1951 (vector int)__b);
1952}
1953
1954static __inline__ vector bool int __ATTRS_o_ai
1955vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1956 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1957 (vector int)__b);
1958}
1959
1960static __inline__ signed int __ATTRS_o_ai
1961vec_cntlz_lsbb(vector signed char __a) {
1962#ifdef __LITTLE_ENDIAN__
1963 return __builtin_altivec_vctzlsbb((vector unsigned char)__a);
1964#else
1965 return __builtin_altivec_vclzlsbb((vector unsigned char)__a);
1966#endif
1967}
1968
1969static __inline__ signed int __ATTRS_o_ai
1970vec_cntlz_lsbb(vector unsigned char __a) {
1971#ifdef __LITTLE_ENDIAN__
1972 return __builtin_altivec_vctzlsbb((vector unsigned char)__a);
1973#else
1974 return __builtin_altivec_vclzlsbb(__a);
1975#endif
1976}
1977
1978static __inline__ signed int __ATTRS_o_ai
1979vec_cnttz_lsbb(vector signed char __a) {
1980#ifdef __LITTLE_ENDIAN__
1981 return __builtin_altivec_vclzlsbb((vector unsigned char)__a);
1982#else
1983 return __builtin_altivec_vctzlsbb((vector unsigned char)__a);
1984#endif
1985}
1986
1987static __inline__ signed int __ATTRS_o_ai
1988vec_cnttz_lsbb(vector unsigned char __a) {
1989#ifdef __LITTLE_ENDIAN__
1990 return __builtin_altivec_vclzlsbb(__a);
1991#else
1992 return __builtin_altivec_vctzlsbb(__a);
1993#endif
1994}
1995
1996static __inline__ vector unsigned int __ATTRS_o_ai
1997vec_parity_lsbb(vector unsigned int __a) {
1998 return __builtin_altivec_vprtybw(__a);
1999}
2000
2001static __inline__ vector unsigned int __ATTRS_o_ai
2002vec_parity_lsbb(vector signed int __a) {
2003 return __builtin_altivec_vprtybw((vector unsigned int)__a);
2004}
2005
2006#ifdef __SIZEOF_INT128__
2007static __inline__ vector unsigned __int128 __ATTRS_o_ai
2008vec_parity_lsbb(vector unsigned __int128 __a) {
2009 return __builtin_altivec_vprtybq(__a);
2010}
2011
2012static __inline__ vector unsigned __int128 __ATTRS_o_ai
2013vec_parity_lsbb(vector signed __int128 __a) {
2014 return __builtin_altivec_vprtybq((vector unsigned __int128)__a);
2015}
2016#endif
2017
2018static __inline__ vector unsigned long long __ATTRS_o_ai
2019vec_parity_lsbb(vector unsigned long long __a) {
2020 return __builtin_altivec_vprtybd(__a);
2021}
2022
2023static __inline__ vector unsigned long long __ATTRS_o_ai
2024vec_parity_lsbb(vector signed long long __a) {
2025 return __builtin_altivec_vprtybd((vector unsigned long long)__a);
2026}
2027
2028#else
2029/* vec_cmpne */
2030
2031static __inline__ vector bool char __ATTRS_o_ai
2032vec_cmpne(vector bool char __a, vector bool char __b) {
2033 return ~(vec_cmpeq(__a, __b));
2034}
2035
2036static __inline__ vector bool char __ATTRS_o_ai
2037vec_cmpne(vector signed char __a, vector signed char __b) {
2038 return ~(vec_cmpeq(__a, __b));
2039}
2040
2041static __inline__ vector bool char __ATTRS_o_ai
2042vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
2043 return ~(vec_cmpeq(__a, __b));
2044}
2045
2046static __inline__ vector bool short __ATTRS_o_ai
2047vec_cmpne(vector bool short __a, vector bool short __b) {
2048 return ~(vec_cmpeq(__a, __b));
2049}
2050
2051static __inline__ vector bool short __ATTRS_o_ai
2052vec_cmpne(vector signed short __a, vector signed short __b) {
2053 return ~(vec_cmpeq(__a, __b));
2054}
2055
2056static __inline__ vector bool short __ATTRS_o_ai
2057vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
2058 return ~(vec_cmpeq(__a, __b));
2059}
2060
2061static __inline__ vector bool int __ATTRS_o_ai
2062vec_cmpne(vector bool int __a, vector bool int __b) {
2063 return ~(vec_cmpeq(__a, __b));
2064}
2065
2066static __inline__ vector bool int __ATTRS_o_ai
2067vec_cmpne(vector signed int __a, vector signed int __b) {
2068 return ~(vec_cmpeq(__a, __b));
2069}
2070
2071static __inline__ vector bool int __ATTRS_o_ai
2072vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
2073 return ~(vec_cmpeq(__a, __b));
2074}
2075
2076static __inline__ vector bool int __ATTRS_o_ai
2077vec_cmpne(vector float __a, vector float __b) {
2078 return ~(vec_cmpeq(__a, __b));
2079}
2080#endif
2081
2082#ifdef __POWER8_VECTOR__
2083static __inline__ vector bool long long __ATTRS_o_ai
2084vec_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));
2087}
2088
2089static __inline__ vector bool long long __ATTRS_o_ai
2090vec_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));
2093}
2094
2095static __inline__ vector bool long long __ATTRS_o_ai
2096vec_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));
2099}
2100#elif defined(__VSX__)
2101static __inline__ vector bool long long __ATTRS_o_ai
2102vec_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));
2105}
2106
2107static __inline__ vector bool long long __ATTRS_o_ai
2108vec_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));
2111}
2112
2113static __inline__ vector bool long long __ATTRS_o_ai
2114vec_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));
2117}
2118#endif
2119
2120#ifdef __POWER8_VECTOR__
2121static __inline__ vector bool long long __ATTRS_o_ai
2122vec_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));
2125}
2126#endif
2127
2128/* vec_cmpgt */
2129
2130static __inline__ vector bool char __ATTRS_o_ai
2131vec_cmpgt(vector signed char __a, vector signed char __b) {
2132 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2133}
2134
2135static __inline__ vector bool char __ATTRS_o_ai
2136vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
2137 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2138}
2139
2140static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
2141 vector short __b) {
2142 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2143}
2144
2145static __inline__ vector bool short __ATTRS_o_ai
2146vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
2147 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2148}
2149
2150static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
2151 vector int __b) {
2152 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2153}
2154
2155static __inline__ vector bool int __ATTRS_o_ai
2156vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
2157 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2158}
2159
2160#ifdef __POWER8_VECTOR__
2161static __inline__ vector bool long long __ATTRS_o_ai
2162vec_cmpgt(vector signed long long __a, vector signed long long __b) {
2163 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
2164}
2165
2166static __inline__ vector bool long long __ATTRS_o_ai
2167vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2168 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
2169}
2170#elif defined(__VSX__)
2171static __inline__ vector bool long long __ATTRS_o_ai
2172vec_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,
2183 3);
2184#else
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,
2188 2);
2189#endif
2190}
2191
2192static __inline__ vector bool long long __ATTRS_o_ai
2193vec_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;
2200 __ugtw |= __eqw;
2201 return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 1, 1, 3,
2202 3);
2203#else
2204 __eqw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;
2205 __ugtw |= __eqw;
2206 return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 0, 0, 2,
2207 2);
2208#endif
2209}
2210#endif
2211
2212static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
2213 vector float __b) {
2214#ifdef __VSX__
2215 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
2216#else
2217 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2218#endif
2219}
2220
2221#ifdef __VSX__
2222static __inline__ vector bool long long __ATTRS_o_ai
2223vec_cmpgt(vector double __a, vector double __b) {
2224 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
2225}
2226#endif
2227
2228#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2229static __inline__ vector bool __int128 __ATTRS_o_ai
2230vec_cmpgt(vector signed __int128 __a, vector signed __int128 __b) {
2231 return (vector bool __int128)__builtin_altivec_vcmpgtsq(__a, __b);
2232}
2233
2234static __inline__ vector bool __int128 __ATTRS_o_ai
2235vec_cmpgt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2236 return (vector bool __int128)__builtin_altivec_vcmpgtuq(__a, __b);
2237}
2238#endif
2239
2240/* vec_cmpge */
2241
2242static __inline__ vector bool char __ATTRS_o_ai
2243vec_cmpge(vector signed char __a, vector signed char __b) {
2244 return ~(vec_cmpgt(__b, __a));
2245}
2246
2247static __inline__ vector bool char __ATTRS_o_ai
2248vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
2249 return ~(vec_cmpgt(__b, __a));
2250}
2251
2252static __inline__ vector bool short __ATTRS_o_ai
2253vec_cmpge(vector signed short __a, vector signed short __b) {
2254 return ~(vec_cmpgt(__b, __a));
2255}
2256
2257static __inline__ vector bool short __ATTRS_o_ai
2258vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
2259 return ~(vec_cmpgt(__b, __a));
2260}
2261
2262static __inline__ vector bool int __ATTRS_o_ai
2263vec_cmpge(vector signed int __a, vector signed int __b) {
2264 return ~(vec_cmpgt(__b, __a));
2265}
2266
2267static __inline__ vector bool int __ATTRS_o_ai
2268vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
2269 return ~(vec_cmpgt(__b, __a));
2270}
2271
2272static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2273 vector float __b) {
2274#ifdef __VSX__
2275 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2276#else
2277 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2278#endif
2279}
2280
2281#ifdef __VSX__
2282static __inline__ vector bool long long __ATTRS_o_ai
2283vec_cmpge(vector double __a, vector double __b) {
2284 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2285}
2286
2287static __inline__ vector bool long long __ATTRS_o_ai
2288vec_cmpge(vector signed long long __a, vector signed long long __b) {
2289 return ~(vec_cmpgt(__b, __a));
2290}
2291
2292static __inline__ vector bool long long __ATTRS_o_ai
2293vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2294 return ~(vec_cmpgt(__b, __a));
2295}
2296#endif
2297
2298#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2299static __inline__ vector bool __int128 __ATTRS_o_ai
2300vec_cmpge(vector signed __int128 __a, vector signed __int128 __b) {
2301 return ~(vec_cmpgt(__b, __a));
2302}
2303
2304static __inline__ vector bool __int128 __ATTRS_o_ai
2305vec_cmpge(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2306 return ~(vec_cmpgt(__b, __a));
2307}
2308#endif
2309
2310/* vec_vcmpgefp */
2311
2312static __inline__ vector bool int __attribute__((__always_inline__))
2313vec_vcmpgefp(vector float __a, vector float __b) {
2314 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2315}
2316
2317/* vec_vcmpgtsb */
2318
2319static __inline__ vector bool char __attribute__((__always_inline__))
2320vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2321 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2322}
2323
2324/* vec_vcmpgtub */
2325
2326static __inline__ vector bool char __attribute__((__always_inline__))
2327vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2328 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2329}
2330
2331/* vec_vcmpgtsh */
2332
2333static __inline__ vector bool short __attribute__((__always_inline__))
2334vec_vcmpgtsh(vector short __a, vector short __b) {
2335 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2336}
2337
2338/* vec_vcmpgtuh */
2339
2340static __inline__ vector bool short __attribute__((__always_inline__))
2341vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2342 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2343}
2344
2345/* vec_vcmpgtsw */
2346
2347static __inline__ vector bool int __attribute__((__always_inline__))
2348vec_vcmpgtsw(vector int __a, vector int __b) {
2349 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2350}
2351
2352/* vec_vcmpgtuw */
2353
2354static __inline__ vector bool int __attribute__((__always_inline__))
2355vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2356 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2357}
2358
2359/* vec_vcmpgtfp */
2360
2361static __inline__ vector bool int __attribute__((__always_inline__))
2362vec_vcmpgtfp(vector float __a, vector float __b) {
2363 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2364}
2365
2366/* vec_cmple */
2367
2368static __inline__ vector bool char __ATTRS_o_ai
2369vec_cmple(vector signed char __a, vector signed char __b) {
2370 return vec_cmpge(__b, __a);
2371}
2372
2373static __inline__ vector bool char __ATTRS_o_ai
2374vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2375 return vec_cmpge(__b, __a);
2376}
2377
2378static __inline__ vector bool short __ATTRS_o_ai
2379vec_cmple(vector signed short __a, vector signed short __b) {
2380 return vec_cmpge(__b, __a);
2381}
2382
2383static __inline__ vector bool short __ATTRS_o_ai
2384vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2385 return vec_cmpge(__b, __a);
2386}
2387
2388static __inline__ vector bool int __ATTRS_o_ai
2389vec_cmple(vector signed int __a, vector signed int __b) {
2390 return vec_cmpge(__b, __a);
2391}
2392
2393static __inline__ vector bool int __ATTRS_o_ai
2394vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2395 return vec_cmpge(__b, __a);
2396}
2397
2398static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2399 vector float __b) {
2400 return vec_cmpge(__b, __a);
2401}
2402
2403#ifdef __VSX__
2404static __inline__ vector bool long long __ATTRS_o_ai
2405vec_cmple(vector double __a, vector double __b) {
2406 return vec_cmpge(__b, __a);
2407}
2408
2409static __inline__ vector bool long long __ATTRS_o_ai
2410vec_cmple(vector signed long long __a, vector signed long long __b) {
2411 return vec_cmpge(__b, __a);
2412}
2413
2414static __inline__ vector bool long long __ATTRS_o_ai
2415vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2416 return vec_cmpge(__b, __a);
2417}
2418#endif
2419
2420#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2421static __inline__ vector bool __int128 __ATTRS_o_ai
2422vec_cmple(vector signed __int128 __a, vector signed __int128 __b) {
2423 return vec_cmpge(__b, __a);
2424}
2425
2426static __inline__ vector bool __int128 __ATTRS_o_ai
2427vec_cmple(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2428 return vec_cmpge(__b, __a);
2429}
2430#endif
2431
2432/* vec_cmplt */
2433
2434static __inline__ vector bool char __ATTRS_o_ai
2435vec_cmplt(vector signed char __a, vector signed char __b) {
2436 return vec_cmpgt(__b, __a);
2437}
2438
2439static __inline__ vector bool char __ATTRS_o_ai
2440vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2441 return vec_cmpgt(__b, __a);
2442}
2443
2444static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2445 vector short __b) {
2446 return vec_cmpgt(__b, __a);
2447}
2448
2449static __inline__ vector bool short __ATTRS_o_ai
2450vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2451 return vec_cmpgt(__b, __a);
2452}
2453
2454static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2455 vector int __b) {
2456 return vec_cmpgt(__b, __a);
2457}
2458
2459static __inline__ vector bool int __ATTRS_o_ai
2460vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2461 return vec_cmpgt(__b, __a);
2462}
2463
2464static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2465 vector float __b) {
2466 return vec_cmpgt(__b, __a);
2467}
2468
2469#ifdef __VSX__
2470static __inline__ vector bool long long __ATTRS_o_ai
2471vec_cmplt(vector double __a, vector double __b) {
2472 return vec_cmpgt(__b, __a);
2473}
2474#endif
2475
2476#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
2477static __inline__ vector bool __int128 __ATTRS_o_ai
2478vec_cmplt(vector signed __int128 __a, vector signed __int128 __b) {
2479 return vec_cmpgt(__b, __a);
2480}
2481
2482static __inline__ vector bool __int128 __ATTRS_o_ai
2483vec_cmplt(vector unsigned __int128 __a, vector unsigned __int128 __b) {
2484 return vec_cmpgt(__b, __a);
2485}
2486#endif
2487
2488#ifdef __VSX__
2489static __inline__ vector bool long long __ATTRS_o_ai
2490vec_cmplt(vector signed long long __a, vector signed long long __b) {
2491 return vec_cmpgt(__b, __a);
2492}
2493
2494static __inline__ vector bool long long __ATTRS_o_ai
2495vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2496 return vec_cmpgt(__b, __a);
2497}
2498#endif
2499
2500#ifdef __POWER8_VECTOR__
2501/* vec_popcnt */
2502
2503static __inline__ vector unsigned char __ATTRS_o_ai
2504vec_popcnt(vector signed char __a) {
2505 return (vector unsigned char)__builtin_elementwise_popcount(
2506 (vector unsigned char)__a);
2507}
2508static __inline__ vector unsigned char __ATTRS_o_ai
2509vec_popcnt(vector unsigned char __a) {
2510 return __builtin_elementwise_popcount(__a);
2511}
2512static __inline__ vector unsigned short __ATTRS_o_ai
2513vec_popcnt(vector signed short __a) {
2514 return (vector unsigned short)__builtin_elementwise_popcount(
2515 (vector unsigned short)__a);
2516}
2517static __inline__ vector unsigned short __ATTRS_o_ai
2518vec_popcnt(vector unsigned short __a) {
2519 return __builtin_elementwise_popcount(__a);
2520}
2521static __inline__ vector unsigned int __ATTRS_o_ai
2522vec_popcnt(vector signed int __a) {
2523 return __builtin_elementwise_popcount((vector unsigned int)__a);
2524}
2525static __inline__ vector unsigned int __ATTRS_o_ai
2526vec_popcnt(vector unsigned int __a) {
2527 return __builtin_elementwise_popcount(__a);
2528}
2529static __inline__ vector unsigned long long __ATTRS_o_ai
2530vec_popcnt(vector signed long long __a) {
2531 return __builtin_elementwise_popcount((vector unsigned long long)__a);
2532}
2533static __inline__ vector unsigned long long __ATTRS_o_ai
2534vec_popcnt(vector unsigned long long __a) {
2535 return __builtin_elementwise_popcount(__a);
2536}
2537
2538#define vec_vclz vec_cntlz
2539/* vec_cntlz */
2540
2541static __inline__ vector signed char __ATTRS_o_ai
2542vec_cntlz(vector signed char __a) {
2543 return (vector signed char)__builtin_altivec_vclzb((vector unsigned char)__a);
2544}
2545static __inline__ vector unsigned char __ATTRS_o_ai
2546vec_cntlz(vector unsigned char __a) {
2547 return __builtin_altivec_vclzb(__a);
2548}
2549static __inline__ vector signed short __ATTRS_o_ai
2550vec_cntlz(vector signed short __a) {
2551 return (vector signed short)__builtin_altivec_vclzh(
2552 (vector unsigned short)__a);
2553}
2554static __inline__ vector unsigned short __ATTRS_o_ai
2555vec_cntlz(vector unsigned short __a) {
2556 return __builtin_altivec_vclzh(__a);
2557}
2558static __inline__ vector signed int __ATTRS_o_ai
2559vec_cntlz(vector signed int __a) {
2560 return (vector signed int)__builtin_altivec_vclzw((vector unsigned int)__a);
2561}
2562static __inline__ vector unsigned int __ATTRS_o_ai
2563vec_cntlz(vector unsigned int __a) {
2564 return __builtin_altivec_vclzw(__a);
2565}
2566static __inline__ vector signed long long __ATTRS_o_ai
2567vec_cntlz(vector signed long long __a) {
2568 return (vector signed long long)__builtin_altivec_vclzd(
2569 (vector unsigned long long)__a);
2570}
2571static __inline__ vector unsigned long long __ATTRS_o_ai
2572vec_cntlz(vector unsigned long long __a) {
2573 return __builtin_altivec_vclzd(__a);
2574}
2575#endif
2576
2577#ifdef __POWER9_VECTOR__
2578
2579/* vec_cnttz */
2580
2581static __inline__ vector signed char __ATTRS_o_ai
2582vec_cnttz(vector signed char __a) {
2583 return (vector signed char)__builtin_altivec_vctzb((vector unsigned char)__a);
2584}
2585static __inline__ vector unsigned char __ATTRS_o_ai
2586vec_cnttz(vector unsigned char __a) {
2587 return __builtin_altivec_vctzb(__a);
2588}
2589static __inline__ vector signed short __ATTRS_o_ai
2590vec_cnttz(vector signed short __a) {
2591 return (vector signed short)__builtin_altivec_vctzh(
2592 (vector unsigned short)__a);
2593}
2594static __inline__ vector unsigned short __ATTRS_o_ai
2595vec_cnttz(vector unsigned short __a) {
2596 return __builtin_altivec_vctzh(__a);
2597}
2598static __inline__ vector signed int __ATTRS_o_ai
2599vec_cnttz(vector signed int __a) {
2600 return (vector signed int)__builtin_altivec_vctzw((vector unsigned int)__a);
2601}
2602static __inline__ vector unsigned int __ATTRS_o_ai
2603vec_cnttz(vector unsigned int __a) {
2604 return __builtin_altivec_vctzw(__a);
2605}
2606static __inline__ vector signed long long __ATTRS_o_ai
2607vec_cnttz(vector signed long long __a) {
2608 return (vector signed long long)__builtin_altivec_vctzd(
2609 (vector unsigned long long)__a);
2610}
2611static __inline__ vector unsigned long long __ATTRS_o_ai
2612vec_cnttz(vector unsigned long long __a) {
2613 return __builtin_altivec_vctzd(__a);
2614}
2615
2616/* vec_first_match_index */
2617
2618static __inline__ unsigned __ATTRS_o_ai
2619vec_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));
2623#else
2624 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2625#endif
2626 if (__res[0] == 64) {
2627 return (__res[1] + 64) >> 3;
2628 }
2629 return __res[0] >> 3;
2630}
2631
2632static __inline__ unsigned __ATTRS_o_ai
2633vec_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));
2637#else
2638 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2639#endif
2640 if (__res[0] == 64) {
2641 return (__res[1] + 64) >> 3;
2642 }
2643 return __res[0] >> 3;
2644}
2645
2646static __inline__ unsigned __ATTRS_o_ai
2647vec_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));
2651#else
2652 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2653#endif
2654 if (__res[0] == 64) {
2655 return (__res[1] + 64) >> 4;
2656 }
2657 return __res[0] >> 4;
2658}
2659
2660static __inline__ unsigned __ATTRS_o_ai
2661vec_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));
2665#else
2666 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2667#endif
2668 if (__res[0] == 64) {
2669 return (__res[1] + 64) >> 4;
2670 }
2671 return __res[0] >> 4;
2672}
2673
2674static __inline__ unsigned __ATTRS_o_ai
2675vec_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));
2679#else
2680 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2681#endif
2682 if (__res[0] == 64) {
2683 return (__res[1] + 64) >> 5;
2684 }
2685 return __res[0] >> 5;
2686}
2687
2688static __inline__ unsigned __ATTRS_o_ai
2689vec_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));
2693#else
2694 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2695#endif
2696 if (__res[0] == 64) {
2697 return (__res[1] + 64) >> 5;
2698 }
2699 return __res[0] >> 5;
2700}
2701
2702/* vec_first_match_or_eos_index */
2703
2704static __inline__ unsigned __ATTRS_o_ai
2705vec_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.
2709 */
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);
2714
2715 vector unsigned long long __res =
2716#ifdef __LITTLE_ENDIAN__
2717 vec_cnttz((vector unsigned long long)__tmp2);
2718#else
2719 vec_cntlz((vector unsigned long long)__tmp2);
2720#endif
2721 if (__res[0] == 64) {
2722 return (__res[1] + 64) >> 3;
2723 }
2724 return __res[0] >> 3;
2725}
2726
2727static __inline__ unsigned __ATTRS_o_ai
2728vec_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);
2734
2735 vector unsigned long long __res =
2736#ifdef __LITTLE_ENDIAN__
2737 vec_cnttz((vector unsigned long long)__tmp2);
2738#else
2739 vec_cntlz((vector unsigned long long)__tmp2);
2740#endif
2741 if (__res[0] == 64) {
2742 return (__res[1] + 64) >> 3;
2743 }
2744 return __res[0] >> 3;
2745}
2746
2747static __inline__ unsigned __ATTRS_o_ai
2748vec_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);
2753
2754 vector unsigned long long __res =
2755#ifdef __LITTLE_ENDIAN__
2756 vec_cnttz((vector unsigned long long)__tmp2);
2757#else
2758 vec_cntlz((vector unsigned long long)__tmp2);
2759#endif
2760 if (__res[0] == 64) {
2761 return (__res[1] + 64) >> 4;
2762 }
2763 return __res[0] >> 4;
2764}
2765
2766static __inline__ unsigned __ATTRS_o_ai
2767vec_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);
2773
2774 vector unsigned long long __res =
2775#ifdef __LITTLE_ENDIAN__
2776 vec_cnttz((vector unsigned long long)__tmp2);
2777#else
2778 vec_cntlz((vector unsigned long long)__tmp2);
2779#endif
2780 if (__res[0] == 64) {
2781 return (__res[1] + 64) >> 4;
2782 }
2783 return __res[0] >> 4;
2784}
2785
2786static __inline__ unsigned __ATTRS_o_ai
2787vec_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);
2791
2792 vector unsigned long long __res =
2793#ifdef __LITTLE_ENDIAN__
2794 vec_cnttz((vector unsigned long long)__tmp2);
2795#else
2796 vec_cntlz((vector unsigned long long)__tmp2);
2797#endif
2798 if (__res[0] == 64) {
2799 return (__res[1] + 64) >> 5;
2800 }
2801 return __res[0] >> 5;
2802}
2803
2804static __inline__ unsigned __ATTRS_o_ai
2805vec_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);
2810
2811 vector unsigned long long __res =
2812#ifdef __LITTLE_ENDIAN__
2813 vec_cnttz((vector unsigned long long)__tmp2);
2814#else
2815 vec_cntlz((vector unsigned long long)__tmp2);
2816#endif
2817 if (__res[0] == 64) {
2818 return (__res[1] + 64) >> 5;
2819 }
2820 return __res[0] >> 5;
2821}
2822
2823/* vec_first_mismatch_index */
2824
2825static __inline__ unsigned __ATTRS_o_ai
2826vec_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));
2830#else
2831 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2832#endif
2833 if (__res[0] == 64) {
2834 return (__res[1] + 64) >> 3;
2835 }
2836 return __res[0] >> 3;
2837}
2838
2839static __inline__ unsigned __ATTRS_o_ai
2840vec_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));
2844#else
2845 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2846#endif
2847 if (__res[0] == 64) {
2848 return (__res[1] + 64) >> 3;
2849 }
2850 return __res[0] >> 3;
2851}
2852
2853static __inline__ unsigned __ATTRS_o_ai
2854vec_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));
2858#else
2859 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2860#endif
2861 if (__res[0] == 64) {
2862 return (__res[1] + 64) >> 4;
2863 }
2864 return __res[0] >> 4;
2865}
2866
2867static __inline__ unsigned __ATTRS_o_ai
2868vec_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));
2872#else
2873 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2874#endif
2875 if (__res[0] == 64) {
2876 return (__res[1] + 64) >> 4;
2877 }
2878 return __res[0] >> 4;
2879}
2880
2881static __inline__ unsigned __ATTRS_o_ai
2882vec_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));
2886#else
2887 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2888#endif
2889 if (__res[0] == 64) {
2890 return (__res[1] + 64) >> 5;
2891 }
2892 return __res[0] >> 5;
2893}
2894
2895static __inline__ unsigned __ATTRS_o_ai
2896vec_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));
2900#else
2901 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2902#endif
2903 if (__res[0] == 64) {
2904 return (__res[1] + 64) >> 5;
2905 }
2906 return __res[0] >> 5;
2907}
2908
2909/* vec_first_mismatch_or_eos_index */
2910
2911static __inline__ unsigned __ATTRS_o_ai
2912vec_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));
2917#else
2918 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2919#endif
2920 if (__res[0] == 64) {
2921 return (__res[1] + 64) >> 3;
2922 }
2923 return __res[0] >> 3;
2924}
2925
2926static __inline__ unsigned __ATTRS_o_ai
2927vec_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));
2932#else
2933 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2934#endif
2935 if (__res[0] == 64) {
2936 return (__res[1] + 64) >> 3;
2937 }
2938 return __res[0] >> 3;
2939}
2940
2941static __inline__ unsigned __ATTRS_o_ai
2942vec_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));
2947#else
2948 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2949#endif
2950 if (__res[0] == 64) {
2951 return (__res[1] + 64) >> 4;
2952 }
2953 return __res[0] >> 4;
2954}
2955
2956static __inline__ unsigned __ATTRS_o_ai
2957vec_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));
2962#else
2963 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2964#endif
2965 if (__res[0] == 64) {
2966 return (__res[1] + 64) >> 4;
2967 }
2968 return __res[0] >> 4;
2969}
2970
2971static __inline__ unsigned __ATTRS_o_ai
2972vec_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));
2976#else
2977 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2978#endif
2979 if (__res[0] == 64) {
2980 return (__res[1] + 64) >> 5;
2981 }
2982 return __res[0] >> 5;
2983}
2984
2985static __inline__ unsigned __ATTRS_o_ai
2986vec_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));
2991#else
2992 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2993#endif
2994 if (__res[0] == 64) {
2995 return (__res[1] + 64) >> 5;
2996 }
2997 return __res[0] >> 5;
2998}
2999
3000static __inline__ vector double __ATTRS_o_ai
3001vec_insert_exp(vector double __a, vector unsigned long long __b) {
3002 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
3003}
3004
3005static __inline__ vector double __ATTRS_o_ai
3006vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
3007 return __builtin_vsx_xviexpdp(__a,__b);
3008}
3009
3010static __inline__ vector float __ATTRS_o_ai
3011vec_insert_exp(vector float __a, vector unsigned int __b) {
3012 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
3013}
3014
3015static __inline__ vector float __ATTRS_o_ai
3016vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
3017 return __builtin_vsx_xviexpsp(__a,__b);
3018}
3019
3020#if defined(__powerpc64__)
3021static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(const signed char *__a,
3022 size_t __b) {
3023 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
3024}
3025
3026static __inline__ vector unsigned char __ATTRS_o_ai
3027vec_xl_len(const unsigned char *__a, size_t __b) {
3028 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
3029}
3030
3031static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(const signed short *__a,
3032 size_t __b) {
3033 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
3034}
3035
3036static __inline__ vector unsigned short __ATTRS_o_ai
3037vec_xl_len(const unsigned short *__a, size_t __b) {
3038 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
3039}
3040
3041static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(const signed int *__a,
3042 size_t __b) {
3043 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
3044}
3045
3046static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(const unsigned int *__a,
3047 size_t __b) {
3048 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
3049}
3050
3051static __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));
3053}
3054
3055#ifdef __SIZEOF_INT128__
3056static __inline__ vector signed __int128 __ATTRS_o_ai
3057vec_xl_len(const signed __int128 *__a, size_t __b) {
3058 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
3059}
3060
3061static __inline__ vector unsigned __int128 __ATTRS_o_ai
3062vec_xl_len(const unsigned __int128 *__a, size_t __b) {
3063 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
3064}
3065#endif
3066
3067static __inline__ vector signed long long __ATTRS_o_ai
3068vec_xl_len(const signed long long *__a, size_t __b) {
3069 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
3070}
3071
3072static __inline__ vector unsigned long long __ATTRS_o_ai
3073vec_xl_len(const unsigned long long *__a, size_t __b) {
3074 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
3075}
3076
3077static __inline__ vector double __ATTRS_o_ai vec_xl_len(const double *__a,
3078 size_t __b) {
3079 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
3080}
3081
3082static __inline__ vector unsigned char __ATTRS_o_ai
3083vec_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);
3090}
3091
3092// vec_xst_len
3093static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
3094 unsigned char *__b,
3095 size_t __c) {
3096 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3097}
3098
3099static __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));
3102}
3103
3104static __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));
3107}
3108
3109static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
3110 unsigned short *__b,
3111 size_t __c) {
3112 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3113}
3114
3115static __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));
3118}
3119
3120static __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));
3123}
3124
3125static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
3126 size_t __c) {
3127 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3128}
3129
3130#ifdef __SIZEOF_INT128__
3131static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
3132 signed __int128 *__b,
3133 size_t __c) {
3134 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3135}
3136
3137static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
3138 unsigned __int128 *__b,
3139 size_t __c) {
3140 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3141}
3142#endif
3143
3144static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
3145 signed long long *__b,
3146 size_t __c) {
3147 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3148}
3149
3150static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
3151 unsigned long long *__b,
3152 size_t __c) {
3153 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3154}
3155
3156static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
3157 size_t __c) {
3158 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
3159}
3160
3161static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
3162 unsigned char *__b,
3163 size_t __c) {
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));
3170}
3171#endif
3172#endif
3173
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))
3178#else
3179#define __vec_ldrmb __builtin_vsx_ldrmb
3180#define __vec_strmb __builtin_vsx_strmb
3181#endif
3182
3183/* vec_cpsgn */
3184
3185#ifdef __VSX__
3186static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
3187 vector float __b) {
3188 return __builtin_vsx_xvcpsgnsp(__b, __a);
3189}
3190
3191static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
3192 vector double __b) {
3193 return __builtin_vsx_xvcpsgndp(__b, __a);
3194}
3195#endif
3196
3197/* vec_ctf */
3198
3199#ifdef __VSX__
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) \
3205 _Generic((__a), \
3206 vector int: (vector float)__builtin_altivec_vcfsx((vector int)(__a), \
3207 ((__b)&0x1F)), \
3208 vector unsigned int: (vector float)__builtin_altivec_vcfux( \
3209 (vector unsigned int)(__a), ((__b)&0x1F)), \
3210 vector unsigned long long: ( \
3211 vector float)(__builtin_vsx_xvcvuxdsp( \
3212 (vector unsigned long long)(__a)) * \
3213 (vector float)(vector unsigned)((0x7f - \
3214 ((__b)&0x1F)) \
3215 << 23)), \
3216 vector signed long long: ( \
3217 vector float)(__builtin_vsx_xvcvsxdsp( \
3218 (vector signed long long)(__a)) * \
3219 (vector float)(vector unsigned)((0x7f - \
3220 ((__b)&0x1F)) \
3221 << 23)))
3222#else // __XL_COMPAT_ALTIVEC__
3223#define vec_ctf(__a, __b) \
3224 _Generic( \
3225 (__a), \
3226 vector int: (vector float)__builtin_altivec_vcfsx((vector int)(__a), \
3227 ((__b)&0x1F)), \
3228 vector unsigned int: (vector float)__builtin_altivec_vcfux( \
3229 (vector unsigned int)(__a), ((__b)&0x1F)), \
3230 vector unsigned long long: ( \
3231 vector float)(__builtin_convertvector( \
3232 (vector unsigned long long)(__a), vector double) * \
3233 (vector double)(vector unsigned long long)((0x3ffULL - \
3234 ((__b)&0x1F)) \
3235 << 52)), \
3236 vector signed long long: ( \
3237 vector float)(__builtin_convertvector( \
3238 (vector signed long long)(__a), vector double) * \
3239 (vector double)(vector unsigned long long)((0x3ffULL - \
3240 ((__b)&0x1F)) \
3241 << 52)))
3242#endif // __XL_COMPAT_ALTIVEC__
3243#else
3244#define vec_ctf(__a, __b) \
3245 _Generic((__a), \
3246 vector int: (vector float)__builtin_altivec_vcfsx((vector int)(__a), \
3247 ((__b)&0x1F)), \
3248 vector unsigned int: (vector float)__builtin_altivec_vcfux( \
3249 (vector unsigned int)(__a), ((__b)&0x1F)))
3250#endif
3251
3252/* vec_ctd */
3253#ifdef __VSX__
3254#define vec_ctd(__a, __b) \
3255 _Generic((__a), \
3256 vector signed int: ( \
3257 vec_doublee((vector signed int)(__a)) * \
3258 (vector double)(vector unsigned long long)((0x3ffULL - \
3259 ((__b)&0x1F)) \
3260 << 52)), \
3261 vector unsigned int: ( \
3262 vec_doublee((vector unsigned int)(__a)) * \
3263 (vector double)(vector unsigned long long)((0x3ffULL - \
3264 ((__b)&0x1F)) \
3265 << 52)), \
3266 vector unsigned long long: ( \
3267 __builtin_convertvector((vector unsigned long long)(__a), \
3268 vector double) * \
3269 (vector double)(vector unsigned long long)((0x3ffULL - \
3270 ((__b)&0x1F)) \
3271 << 52)), \
3272 vector signed long long: ( \
3273 __builtin_convertvector((vector signed long long)(__a), \
3274 vector double) * \
3275 (vector double)(vector unsigned long long)((0x3ffULL - \
3276 ((__b)&0x1F)) \
3277 << 52)))
3278#endif // __VSX__
3279
3280/* vec_vcfsx */
3281
3282#define vec_vcfux __builtin_altivec_vcfux
3283/* vec_vcfux */
3284
3285#define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
3286
3287/* vec_cts */
3288
3289#ifdef __VSX__
3290#ifdef __XL_COMPAT_ALTIVEC__
3291#define vec_cts(__a, __b) \
3292 _Generic((__a), \
3293 vector float: (vector signed int)__builtin_altivec_vctsxs( \
3294 (vector float)(__a), ((__b)&0x1F)), \
3295 vector double: __extension__({ \
3296 vector double __ret = \
3297 (vector double)(__a) * \
3298 (vector double)(vector unsigned long long)((0x3ffULL + \
3299 ((__b)&0x1F)) \
3300 << 52); \
3301 (vector signed long long)__builtin_vsx_xvcvdpsxws(__ret); \
3302 }))
3303#else // __XL_COMPAT_ALTIVEC__
3304#define vec_cts(__a, __b) \
3305 _Generic((__a), \
3306 vector float: (vector signed int)__builtin_altivec_vctsxs( \
3307 (vector float)(__a), ((__b)&0x1F)), \
3308 vector double: __extension__({ \
3309 vector double __ret = \
3310 (vector double)(__a) * \
3311 (vector double)(vector unsigned long long)((0x3ffULL + \
3312 ((__b)&0x1F)) \
3313 << 52); \
3314 (vector signed long long)__builtin_convertvector( \
3315 __ret, vector signed long long); \
3316 }))
3317#endif // __XL_COMPAT_ALTIVEC__
3318#else
3319#define vec_cts __builtin_altivec_vctsxs
3320#endif
3321
3322/* vec_vctsxs */
3323
3324#define vec_vctsxs __builtin_altivec_vctsxs
3325
3326/* vec_ctu */
3327
3328#ifdef __VSX__
3329#ifdef __XL_COMPAT_ALTIVEC__
3330#define vec_ctu(__a, __b) \
3331 _Generic((__a), \
3332 vector float: (vector unsigned int)__builtin_altivec_vctuxs( \
3333 (vector float)(__a), ((__b)&0x1F)), \
3334 vector double: __extension__({ \
3335 vector double __ret = \
3336 (vector double)(__a) * \
3337 (vector double)(vector unsigned long long)((0x3ffULL + \
3338 ((__b)&0x1F)) \
3339 << 52); \
3340 (vector unsigned long long)__builtin_vsx_xvcvdpuxws(__ret); \
3341 }))
3342#else // __XL_COMPAT_ALTIVEC__
3343#define vec_ctu(__a, __b) \
3344 _Generic((__a), \
3345 vector float: (vector unsigned int)__builtin_altivec_vctuxs( \
3346 (vector float)(__a), ((__b)&0x1F)), \
3347 vector double: __extension__({ \
3348 vector double __ret = \
3349 (vector double)(__a) * \
3350 (vector double)(vector unsigned long long)((0x3ffULL + \
3351 ((__b)&0x1F)) \
3352 << 52); \
3353 (vector unsigned long long)__builtin_convertvector( \
3354 __ret, vector unsigned long long); \
3355 }))
3356#endif // __XL_COMPAT_ALTIVEC__
3357#else
3358#define vec_ctu __builtin_altivec_vctuxs
3359#endif
3360
3361#ifdef __LITTLE_ENDIAN__
3362/* vec_ctsl */
3363
3364#ifdef __VSX__
3365#define vec_ctsl(__a, __b) \
3366 _Generic( \
3367 (__a), vector float \
3368 : __extension__({ \
3369 vector float __ret = \
3370 (vector float)(__a) * \
3371 (vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) << 23); \
3372 __builtin_vsx_xvcvspsxds(__builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3373 }), \
3374 vector double \
3375 : __extension__({ \
3376 vector double __ret = \
3377 (vector double)(__a) * \
3378 (vector double)(vector unsigned long long)((0x3ffULL + \
3379 ((__b)&0x1F)) \
3380 << 52); \
3381 __builtin_convertvector(__ret, vector signed long long); \
3382 }))
3383
3384/* vec_ctul */
3385
3386#define vec_ctul(__a, __b) \
3387 _Generic( \
3388 (__a), vector float \
3389 : __extension__({ \
3390 vector float __ret = \
3391 (vector float)(__a) * \
3392 (vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) << 23); \
3393 __builtin_vsx_xvcvspuxds(__builtin_vsx_xxsldwi(__ret, __ret, 1)); \
3394 }), \
3395 vector double \
3396 : __extension__({ \
3397 vector double __ret = \
3398 (vector double)(__a) * \
3399 (vector double)(vector unsigned long long)((0x3ffULL + \
3400 ((__b)&0x1F)) \
3401 << 52); \
3402 __builtin_convertvector(__ret, vector unsigned long long); \
3403 }))
3404#endif
3405#else // __LITTLE_ENDIAN__
3406/* vec_ctsl */
3407
3408#ifdef __VSX__
3409#define vec_ctsl(__a, __b) \
3410 _Generic((__a), \
3411 vector float: __extension__({ \
3412 vector float __ret = \
3413 (vector float)(__a) * \
3414 (vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) << 23); \
3415 __builtin_vsx_xvcvspsxds(__ret); \
3416 }), \
3417 vector double: __extension__({ \
3418 vector double __ret = \
3419 (vector double)(__a) * \
3420 (vector double)(vector unsigned long long)((0x3ffULL + \
3421 ((__b)&0x1F)) \
3422 << 52); \
3423 __builtin_convertvector(__ret, vector signed long long); \
3424 }))
3425
3426/* vec_ctul */
3427
3428#define vec_ctul(__a, __b) \
3429 _Generic((__a), vector float \
3430 : __extension__({ \
3431 vector float __ret = \
3432 (vector float)(__a) * \
3433 (vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) \
3434 << 23); \
3435 __builtin_vsx_xvcvspuxds(__ret); \
3436 }), \
3437 vector double \
3438 : __extension__({ \
3439 vector double __ret = \
3440 (vector double)(__a) * \
3441 (vector double)(vector unsigned long long)((0x3ffULL + \
3442 ((__b)&0x1F)) \
3443 << 52); \
3444 __builtin_convertvector(__ret, vector unsigned long long); \
3445 }))
3446#endif
3447#endif // __LITTLE_ENDIAN__
3448
3449/* vec_vctuxs */
3450
3451#define vec_vctuxs __builtin_altivec_vctuxs
3452
3453/* vec_signext */
3454
3455#ifdef __POWER9_VECTOR__
3456static __inline__ vector signed int __ATTRS_o_ai
3457vec_signexti(vector signed char __a) {
3458 return __builtin_altivec_vextsb2w(__a);
3459}
3460
3461static __inline__ vector signed int __ATTRS_o_ai
3462vec_signexti(vector signed short __a) {
3463 return __builtin_altivec_vextsh2w(__a);
3464}
3465
3466static __inline__ vector signed long long __ATTRS_o_ai
3467vec_signextll(vector signed char __a) {
3468 return __builtin_altivec_vextsb2d(__a);
3469}
3470
3471static __inline__ vector signed long long __ATTRS_o_ai
3472vec_signextll(vector signed short __a) {
3473 return __builtin_altivec_vextsh2d(__a);
3474}
3475
3476static __inline__ vector signed long long __ATTRS_o_ai
3477vec_signextll(vector signed int __a) {
3478 return __builtin_altivec_vextsw2d(__a);
3479}
3480#endif
3481
3482#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3483static __inline__ vector signed __int128 __ATTRS_o_ai
3484vec_signextq(vector signed long long __a) {
3485 return __builtin_altivec_vextsd2q(__a);
3486}
3487#endif
3488
3489/* vec_signed */
3490
3491static __inline__ vector signed int __ATTRS_o_ai
3492vec_sld(vector signed int, vector signed int, unsigned const int __c);
3493
3494static __inline__ vector signed int __ATTRS_o_ai
3495vec_signed(vector float __a) {
3496 return __builtin_convertvector(__a, vector signed int);
3497}
3498
3499#ifdef __VSX__
3500static __inline__ vector signed long long __ATTRS_o_ai
3501vec_signed(vector double __a) {
3502 return __builtin_convertvector(__a, vector signed long long);
3503}
3504
3505static __inline__ vector signed int __attribute__((__always_inline__))
3506vec_signed2(vector double __a, vector double __b) {
3507 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
3508}
3509
3510static __inline__ vector signed int __ATTRS_o_ai
3511vec_signede(vector double __a) {
3512#ifdef __LITTLE_ENDIAN__
3513 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3514 return vec_sld(__ret, __ret, 12);
3515#else
3516 return __builtin_vsx_xvcvdpsxws(__a);
3517#endif
3518}
3519
3520static __inline__ vector signed int __ATTRS_o_ai
3521vec_signedo(vector double __a) {
3522#ifdef __LITTLE_ENDIAN__
3523 return __builtin_vsx_xvcvdpsxws(__a);
3524#else
3525 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3526 return vec_sld(__ret, __ret, 12);
3527#endif
3528}
3529#endif
3530
3531/* vec_unsigned */
3532
3533static __inline__ vector unsigned int __ATTRS_o_ai
3534vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3535
3536static __inline__ vector unsigned int __ATTRS_o_ai
3537vec_unsigned(vector float __a) {
3538 return __builtin_convertvector(__a, vector unsigned int);
3539}
3540
3541#ifdef __VSX__
3542static __inline__ vector unsigned long long __ATTRS_o_ai
3543vec_unsigned(vector double __a) {
3544 return __builtin_convertvector(__a, vector unsigned long long);
3545}
3546
3547static __inline__ vector unsigned int __attribute__((__always_inline__))
3548vec_unsigned2(vector double __a, vector double __b) {
3549 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3550}
3551
3552static __inline__ vector unsigned int __ATTRS_o_ai
3553vec_unsignede(vector double __a) {
3554#ifdef __LITTLE_ENDIAN__
3555 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3556 return vec_sld(__ret, __ret, 12);
3557#else
3558 return __builtin_vsx_xvcvdpuxws(__a);
3559#endif
3560}
3561
3562static __inline__ vector unsigned int __ATTRS_o_ai
3563vec_unsignedo(vector double __a) {
3564#ifdef __LITTLE_ENDIAN__
3565 return __builtin_vsx_xvcvdpuxws(__a);
3566#else
3567 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3568 return vec_sld(__ret, __ret, 12);
3569#endif
3570}
3571#endif
3572
3573/* vec_float */
3574
3575static __inline__ vector float __ATTRS_o_ai
3576vec_sld(vector float, vector float, unsigned const int __c);
3577
3578static __inline__ vector float __ATTRS_o_ai
3579vec_float(vector signed int __a) {
3580 return __builtin_convertvector(__a, vector float);
3581}
3582
3583static __inline__ vector float __ATTRS_o_ai
3584vec_float(vector unsigned int __a) {
3585 return __builtin_convertvector(__a, vector float);
3586}
3587
3588#ifdef __VSX__
3589static __inline__ vector float __ATTRS_o_ai
3590vec_float2(vector signed long long __a, vector signed long long __b) {
3591 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3592}
3593
3594static __inline__ vector float __ATTRS_o_ai
3595vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3596 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3597}
3598
3599static __inline__ vector float __ATTRS_o_ai
3600vec_float2(vector double __a, vector double __b) {
3601 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3602}
3603
3604static __inline__ vector float __ATTRS_o_ai
3605vec_floate(vector signed long long __a) {
3606#ifdef __LITTLE_ENDIAN__
3607 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3608 return vec_sld(__ret, __ret, 12);
3609#else
3610 return __builtin_vsx_xvcvsxdsp(__a);
3611#endif
3612}
3613
3614static __inline__ vector float __ATTRS_o_ai
3615vec_floate(vector unsigned long long __a) {
3616#ifdef __LITTLE_ENDIAN__
3617 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3618 return vec_sld(__ret, __ret, 12);
3619#else
3620 return __builtin_vsx_xvcvuxdsp(__a);
3621#endif
3622}
3623
3624static __inline__ vector float __ATTRS_o_ai
3625vec_floate(vector double __a) {
3626#ifdef __LITTLE_ENDIAN__
3627 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3628 return vec_sld(__ret, __ret, 12);
3629#else
3630 return __builtin_vsx_xvcvdpsp(__a);
3631#endif
3632}
3633
3634static __inline__ vector float __ATTRS_o_ai
3635vec_floato(vector signed long long __a) {
3636#ifdef __LITTLE_ENDIAN__
3637 return __builtin_vsx_xvcvsxdsp(__a);
3638#else
3639 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3640 return vec_sld(__ret, __ret, 12);
3641#endif
3642}
3643
3644static __inline__ vector float __ATTRS_o_ai
3645vec_floato(vector unsigned long long __a) {
3646#ifdef __LITTLE_ENDIAN__
3647 return __builtin_vsx_xvcvuxdsp(__a);
3648#else
3649 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3650 return vec_sld(__ret, __ret, 12);
3651#endif
3652}
3653
3654static __inline__ vector float __ATTRS_o_ai
3655vec_floato(vector double __a) {
3656#ifdef __LITTLE_ENDIAN__
3657 return __builtin_vsx_xvcvdpsp(__a);
3658#else
3659 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3660 return vec_sld(__ret, __ret, 12);
3661#endif
3662}
3663#endif
3664
3665/* vec_double */
3666
3667#ifdef __VSX__
3668static __inline__ vector double __ATTRS_o_ai
3669vec_double(vector signed long long __a) {
3670 return __builtin_convertvector(__a, vector double);
3671}
3672
3673static __inline__ vector double __ATTRS_o_ai
3674vec_double(vector unsigned long long __a) {
3675 return __builtin_convertvector(__a, vector double);
3676}
3677
3678static __inline__ vector double __ATTRS_o_ai
3679vec_doublee(vector signed int __a) {
3680#ifdef __LITTLE_ENDIAN__
3681 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3682#else
3683 return __builtin_vsx_xvcvsxwdp(__a);
3684#endif
3685}
3686
3687static __inline__ vector double __ATTRS_o_ai
3688vec_doublee(vector unsigned int __a) {
3689#ifdef __LITTLE_ENDIAN__
3690 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3691#else
3692 return __builtin_vsx_xvcvuxwdp(__a);
3693#endif
3694}
3695
3696static __inline__ vector double __ATTRS_o_ai
3697vec_doublee(vector float __a) {
3698#ifdef __LITTLE_ENDIAN__
3699 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3700#else
3701 return __builtin_vsx_xvcvspdp(__a);
3702#endif
3703}
3704
3705static __inline__ vector double __ATTRS_o_ai
3706vec_doubleh(vector signed int __a) {
3707 vector double __ret = {__a[0], __a[1]};
3708 return __ret;
3709}
3710
3711static __inline__ vector double __ATTRS_o_ai
3712vec_doubleh(vector unsigned int __a) {
3713 vector double __ret = {__a[0], __a[1]};
3714 return __ret;
3715}
3716
3717static __inline__ vector double __ATTRS_o_ai
3718vec_doubleh(vector float __a) {
3719 vector double __ret = {__a[0], __a[1]};
3720 return __ret;
3721}
3722
3723static __inline__ vector double __ATTRS_o_ai
3724vec_doublel(vector signed int __a) {
3725 vector double __ret = {__a[2], __a[3]};
3726 return __ret;
3727}
3728
3729static __inline__ vector double __ATTRS_o_ai
3730vec_doublel(vector unsigned int __a) {
3731 vector double __ret = {__a[2], __a[3]};
3732 return __ret;
3733}
3734
3735static __inline__ vector double __ATTRS_o_ai
3736vec_doublel(vector float __a) {
3737 vector double __ret = {__a[2], __a[3]};
3738 return __ret;
3739}
3740
3741static __inline__ vector double __ATTRS_o_ai
3742vec_doubleo(vector signed int __a) {
3743#ifdef __LITTLE_ENDIAN__
3744 return __builtin_vsx_xvcvsxwdp(__a);
3745#else
3746 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3747#endif
3748}
3749
3750static __inline__ vector double __ATTRS_o_ai
3751vec_doubleo(vector unsigned int __a) {
3752#ifdef __LITTLE_ENDIAN__
3753 return __builtin_vsx_xvcvuxwdp(__a);
3754#else
3755 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3756#endif
3757}
3758
3759static __inline__ vector double __ATTRS_o_ai
3760vec_doubleo(vector float __a) {
3761#ifdef __LITTLE_ENDIAN__
3762 return __builtin_vsx_xvcvspdp(__a);
3763#else
3764 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3765#endif
3766}
3767
3768/* vec_cvf */
3769static __inline__ vector double __ATTRS_o_ai vec_cvf(vector float __a) {
3770 return vec_doublee(__a);
3771}
3772
3773static __inline__ vector float __ATTRS_o_ai vec_cvf(vector double __a) {
3774 return vec_floate(__a);
3775}
3776#endif
3777
3778/* vec_div */
3779
3780/* Integer vector divides (vectors are scalarized, elements divided
3781 and the vectors reassembled).
3782*/
3783static __inline__ vector signed char __ATTRS_o_ai
3784vec_div(vector signed char __a, vector signed char __b) {
3785 return __a / __b;
3786}
3787
3788static __inline__ vector unsigned char __ATTRS_o_ai
3789vec_div(vector unsigned char __a, vector unsigned char __b) {
3790 return __a / __b;
3791}
3792
3793static __inline__ vector signed short __ATTRS_o_ai
3794vec_div(vector signed short __a, vector signed short __b) {
3795 return __a / __b;
3796}
3797
3798static __inline__ vector unsigned short __ATTRS_o_ai
3799vec_div(vector unsigned short __a, vector unsigned short __b) {
3800 return __a / __b;
3801}
3802
3803static __inline__ vector signed int __ATTRS_o_ai
3804vec_div(vector signed int __a, vector signed int __b) {
3805 return __a / __b;
3806}
3807
3808static __inline__ vector unsigned int __ATTRS_o_ai
3809vec_div(vector unsigned int __a, vector unsigned int __b) {
3810 return __a / __b;
3811}
3812
3813#ifdef __VSX__
3814static __inline__ vector signed long long __ATTRS_o_ai
3815vec_div(vector signed long long __a, vector signed long long __b) {
3816 return __a / __b;
3817}
3818
3819static __inline__ vector unsigned long long __ATTRS_o_ai
3820vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3821 return __a / __b;
3822}
3823
3824static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3825 vector float __b) {
3826 return __a / __b;
3827}
3828
3829static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3830 vector double __b) {
3831 return __a / __b;
3832}
3833#endif
3834
3835/* vec_dive */
3836
3837#ifdef __POWER10_VECTOR__
3838static __inline__ vector signed int __ATTRS_o_ai
3839vec_dive(vector signed int __a, vector signed int __b) {
3840 return __builtin_altivec_vdivesw(__a, __b);
3841}
3842
3843static __inline__ vector unsigned int __ATTRS_o_ai
3844vec_dive(vector unsigned int __a, vector unsigned int __b) {
3845 return __builtin_altivec_vdiveuw(__a, __b);
3846}
3847
3848static __inline__ vector signed long long __ATTRS_o_ai
3849vec_dive(vector signed long long __a, vector signed long long __b) {
3850 return __builtin_altivec_vdivesd(__a, __b);
3851}
3852
3853static __inline__ vector unsigned long long __ATTRS_o_ai
3854vec_dive(vector unsigned long long __a, vector unsigned long long __b) {
3855 return __builtin_altivec_vdiveud(__a, __b);
3856}
3857
3858#ifdef __SIZEOF_INT128__
3859static __inline__ vector unsigned __int128 __ATTRS_o_ai
3860vec_dive(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3861 return __builtin_altivec_vdiveuq(__a, __b);
3862}
3863
3864static __inline__ vector signed __int128 __ATTRS_o_ai
3865vec_dive(vector signed __int128 __a, vector signed __int128 __b) {
3866 return __builtin_altivec_vdivesq(__a, __b);
3867}
3868#endif
3869#endif
3870
3871#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
3872static __inline__ vector unsigned __int128 __ATTRS_o_ai
3873vec_div(vector unsigned __int128 __a, vector unsigned __int128 __b) {
3874 return __a / __b;
3875}
3876
3877static __inline__ vector signed __int128 __ATTRS_o_ai
3878vec_div(vector signed __int128 __a, vector signed __int128 __b) {
3879 return __a / __b;
3880}
3881#endif /* __POWER10_VECTOR__ */
3882
3883/* vec_xvtdiv */
3884
3885#ifdef __VSX__
3886static __inline__ int __ATTRS_o_ai vec_test_swdiv(vector double __a,
3887 vector double __b) {
3888 return __builtin_vsx_xvtdivdp(__a, __b);
3889}
3890
3891static __inline__ int __ATTRS_o_ai vec_test_swdivs(vector float __a,
3892 vector float __b) {
3893 return __builtin_vsx_xvtdivsp(__a, __b);
3894}
3895#endif
3896
3897/* vec_dss */
3898
3899#define vec_dss __builtin_altivec_dss
3900
3901/* vec_dssall */
3902
3903static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3904 __builtin_altivec_dssall();
3905}
3906
3907/* vec_dst */
3908#define vec_dst(__PTR, __CW, __STR) \
3909 __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))
3910
3911/* vec_dstst */
3912#define vec_dstst(__PTR, __CW, __STR) \
3913 __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))
3914
3915/* vec_dststt */
3916#define vec_dststt(__PTR, __CW, __STR) \
3917 __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))
3918
3919/* vec_dstt */
3920#define vec_dstt(__PTR, __CW, __STR) \
3921 __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))
3922
3923/* vec_eqv */
3924
3925#ifdef __POWER8_VECTOR__
3926static __inline__ vector signed char __ATTRS_o_ai
3927vec_eqv(vector signed char __a, vector signed char __b) {
3928 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3929 (vector unsigned int)__b);
3930}
3931
3932static __inline__ vector unsigned char __ATTRS_o_ai
3933vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3934 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3935 (vector unsigned int)__b);
3936}
3937
3938static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3939 vector bool char __b) {
3940 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3941 (vector unsigned int)__b);
3942}
3943
3944static __inline__ vector signed short __ATTRS_o_ai
3945vec_eqv(vector signed short __a, vector signed short __b) {
3946 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3947 (vector unsigned int)__b);
3948}
3949
3950static __inline__ vector unsigned short __ATTRS_o_ai
3951vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3952 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3953 (vector unsigned int)__b);
3954}
3955
3956static __inline__ vector bool short __ATTRS_o_ai
3957vec_eqv(vector bool short __a, vector bool short __b) {
3958 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3959 (vector unsigned int)__b);
3960}
3961
3962static __inline__ vector signed int __ATTRS_o_ai
3963vec_eqv(vector signed int __a, vector signed int __b) {
3964 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3965 (vector unsigned int)__b);
3966}
3967
3968static __inline__ vector unsigned int __ATTRS_o_ai
3969vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3970 return __builtin_vsx_xxleqv(__a, __b);
3971}
3972
3973static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3974 vector bool int __b) {
3975 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3976 (vector unsigned int)__b);
3977}
3978
3979static __inline__ vector signed long long __ATTRS_o_ai
3980vec_eqv(vector signed long long __a, vector signed long long __b) {
3981 return (vector signed long long)__builtin_vsx_xxleqv(
3982 (vector unsigned int)__a, (vector unsigned int)__b);
3983}
3984
3985static __inline__ vector unsigned long long __ATTRS_o_ai
3986vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3987 return (vector unsigned long long)__builtin_vsx_xxleqv(
3988 (vector unsigned int)__a, (vector unsigned int)__b);
3989}
3990
3991static __inline__ vector bool long long __ATTRS_o_ai
3992vec_eqv(vector bool long long __a, vector bool long long __b) {
3993 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3994 (vector unsigned int)__b);
3995}
3996
3997static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3998 vector float __b) {
3999 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
4000 (vector unsigned int)__b);
4001}
4002
4003static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
4004 vector double __b) {
4005 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
4006 (vector unsigned int)__b);
4007}
4008#endif
4009
4010/* vec_expte */
4011
4012static __inline__ vector float __attribute__((__always_inline__))
4013vec_expte(vector float __a) {
4014 return __builtin_altivec_vexptefp(__a);
4015}
4016
4017/* vec_vexptefp */
4018
4019static __inline__ vector float __attribute__((__always_inline__))
4020vec_vexptefp(vector float __a) {
4021 return __builtin_altivec_vexptefp(__a);
4022}
4023
4024/* vec_floor */
4025
4026static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
4027#ifdef __VSX__
4028 return __builtin_vsx_xvrspim(__a);
4029#else
4030 return __builtin_altivec_vrfim(__a);
4031#endif
4032}
4033
4034#ifdef __VSX__
4035static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
4036 return __builtin_vsx_xvrdpim(__a);
4037}
4038#endif
4039
4040/* vec_roundm */
4041static __inline__ vector float __ATTRS_o_ai vec_roundm(vector float __a) {
4042 return vec_floor(__a);
4043}
4044
4045#ifdef __VSX__
4046static __inline__ vector double __ATTRS_o_ai vec_roundm(vector double __a) {
4047 return vec_floor(__a);
4048}
4049#endif
4050
4051/* vec_vrfim */
4052
4053static __inline__ vector float __attribute__((__always_inline__))
4054vec_vrfim(vector float __a) {
4055 return __builtin_altivec_vrfim(__a);
4056}
4057
4058/* vec_ld */
4059
4060static __inline__ vector signed char __ATTRS_o_ai
4061vec_ld(long __a, const vector signed char *__b) {
4062 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4063}
4064
4065static __inline__ vector signed char __ATTRS_o_ai
4066vec_ld(long __a, const signed char *__b) {
4067 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4068}
4069
4070static __inline__ vector unsigned char __ATTRS_o_ai
4071vec_ld(long __a, const vector unsigned char *__b) {
4072 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4073}
4074
4075static __inline__ vector unsigned char __ATTRS_o_ai
4076vec_ld(long __a, const unsigned char *__b) {
4077 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4078}
4079
4080static __inline__ vector bool char __ATTRS_o_ai
4081vec_ld(long __a, const vector bool char *__b) {
4082 return (vector bool char)__builtin_altivec_lvx(__a, __b);
4083}
4084
4085static __inline__ vector short __ATTRS_o_ai vec_ld(long __a,
4086 const vector short *__b) {
4087 return (vector short)__builtin_altivec_lvx(__a, __b);
4088}
4089
4090static __inline__ vector short __ATTRS_o_ai vec_ld(long __a, const short *__b) {
4091 return (vector short)__builtin_altivec_lvx(__a, __b);
4092}
4093
4094static __inline__ vector unsigned short __ATTRS_o_ai
4095vec_ld(long __a, const vector unsigned short *__b) {
4096 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4097}
4098
4099static __inline__ vector unsigned short __ATTRS_o_ai
4100vec_ld(long __a, const unsigned short *__b) {
4101 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4102}
4103
4104static __inline__ vector bool short __ATTRS_o_ai
4105vec_ld(long __a, const vector bool short *__b) {
4106 return (vector bool short)__builtin_altivec_lvx(__a, __b);
4107}
4108
4109static __inline__ vector pixel __ATTRS_o_ai vec_ld(long __a,
4110 const vector pixel *__b) {
4111 return (vector pixel)__builtin_altivec_lvx(__a, __b);
4112}
4113
4114static __inline__ vector int __ATTRS_o_ai vec_ld(long __a,
4115 const vector int *__b) {
4116 return (vector int)__builtin_altivec_lvx(__a, __b);
4117}
4118
4119static __inline__ vector int __ATTRS_o_ai vec_ld(long __a, const int *__b) {
4120 return (vector int)__builtin_altivec_lvx(__a, __b);
4121}
4122
4123static __inline__ vector unsigned int __ATTRS_o_ai
4124vec_ld(long __a, const vector unsigned int *__b) {
4125 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4126}
4127
4128static __inline__ vector unsigned int __ATTRS_o_ai
4129vec_ld(long __a, const unsigned int *__b) {
4130 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4131}
4132
4133static __inline__ vector bool int __ATTRS_o_ai
4134vec_ld(long __a, const vector bool int *__b) {
4135 return (vector bool int)__builtin_altivec_lvx(__a, __b);
4136}
4137
4138static __inline__ vector float __ATTRS_o_ai vec_ld(long __a,
4139 const vector float *__b) {
4140 return (vector float)__builtin_altivec_lvx(__a, __b);
4141}
4142
4143static __inline__ vector float __ATTRS_o_ai vec_ld(long __a, const float *__b) {
4144 return (vector float)__builtin_altivec_lvx(__a, __b);
4145}
4146
4147/* vec_lvx */
4148
4149static __inline__ vector signed char __ATTRS_o_ai
4150vec_lvx(long __a, const vector signed char *__b) {
4151 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4152}
4153
4154static __inline__ vector signed char __ATTRS_o_ai
4155vec_lvx(long __a, const signed char *__b) {
4156 return (vector signed char)__builtin_altivec_lvx(__a, __b);
4157}
4158
4159static __inline__ vector unsigned char __ATTRS_o_ai
4160vec_lvx(long __a, const vector unsigned char *__b) {
4161 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4162}
4163
4164static __inline__ vector unsigned char __ATTRS_o_ai
4165vec_lvx(long __a, const unsigned char *__b) {
4166 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
4167}
4168
4169static __inline__ vector bool char __ATTRS_o_ai
4170vec_lvx(long __a, const vector bool char *__b) {
4171 return (vector bool char)__builtin_altivec_lvx(__a, __b);
4172}
4173
4174static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a,
4175 const vector short *__b) {
4176 return (vector short)__builtin_altivec_lvx(__a, __b);
4177}
4178
4179static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a, const short *__b) {
4180 return (vector short)__builtin_altivec_lvx(__a, __b);
4181}
4182
4183static __inline__ vector unsigned short __ATTRS_o_ai
4184vec_lvx(long __a, const vector unsigned short *__b) {
4185 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4186}
4187
4188static __inline__ vector unsigned short __ATTRS_o_ai
4189vec_lvx(long __a, const unsigned short *__b) {
4190 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
4191}
4192
4193static __inline__ vector bool short __ATTRS_o_ai
4194vec_lvx(long __a, const vector bool short *__b) {
4195 return (vector bool short)__builtin_altivec_lvx(__a, __b);
4196}
4197
4198static __inline__ vector pixel __ATTRS_o_ai vec_lvx(long __a,
4199 const vector pixel *__b) {
4200 return (vector pixel)__builtin_altivec_lvx(__a, __b);
4201}
4202
4203static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a,
4204 const vector int *__b) {
4205 return (vector int)__builtin_altivec_lvx(__a, __b);
4206}
4207
4208static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a, const int *__b) {
4209 return (vector int)__builtin_altivec_lvx(__a, __b);
4210}
4211
4212static __inline__ vector unsigned int __ATTRS_o_ai
4213vec_lvx(long __a, const vector unsigned int *__b) {
4214 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4215}
4216
4217static __inline__ vector unsigned int __ATTRS_o_ai
4218vec_lvx(long __a, const unsigned int *__b) {
4219 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
4220}
4221
4222static __inline__ vector bool int __ATTRS_o_ai
4223vec_lvx(long __a, const vector bool int *__b) {
4224 return (vector bool int)__builtin_altivec_lvx(__a, __b);
4225}
4226
4227static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a,
4228 const vector float *__b) {
4229 return (vector float)__builtin_altivec_lvx(__a, __b);
4230}
4231
4232static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a, const float *__b) {
4233 return (vector float)__builtin_altivec_lvx(__a, __b);
4234}
4235
4236/* vec_lde */
4237
4238static __inline__ vector signed char __ATTRS_o_ai
4239vec_lde(long __a, const signed char *__b) {
4240 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
4241}
4242
4243static __inline__ vector unsigned char __ATTRS_o_ai
4244vec_lde(long __a, const unsigned char *__b) {
4245 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
4246}
4247
4248static __inline__ vector short __ATTRS_o_ai vec_lde(long __a, const short *__b) {
4249 return (vector short)__builtin_altivec_lvehx(__a, __b);
4250}
4251
4252static __inline__ vector unsigned short __ATTRS_o_ai
4253vec_lde(long __a, const unsigned short *__b) {
4254 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
4255}
4256
4257static __inline__ vector int __ATTRS_o_ai vec_lde(long __a, const int *__b) {
4258 return (vector int)__builtin_altivec_lvewx(__a, __b);
4259}
4260
4261static __inline__ vector unsigned int __ATTRS_o_ai
4262vec_lde(long __a, const unsigned int *__b) {
4263 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
4264}
4265
4266static __inline__ vector float __ATTRS_o_ai vec_lde(long __a, const float *__b) {
4267 return (vector float)__builtin_altivec_lvewx(__a, __b);
4268}
4269
4270/* vec_lvebx */
4271
4272static __inline__ vector signed char __ATTRS_o_ai
4273vec_lvebx(long __a, const signed char *__b) {
4274 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
4275}
4276
4277static __inline__ vector unsigned char __ATTRS_o_ai
4278vec_lvebx(long __a, const unsigned char *__b) {
4279 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
4280}
4281
4282/* vec_lvehx */
4283
4284static __inline__ vector short __ATTRS_o_ai vec_lvehx(long __a,
4285 const short *__b) {
4286 return (vector short)__builtin_altivec_lvehx(__a, __b);
4287}
4288
4289static __inline__ vector unsigned short __ATTRS_o_ai
4290vec_lvehx(long __a, const unsigned short *__b) {
4291 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
4292}
4293
4294/* vec_lvewx */
4295
4296static __inline__ vector int __ATTRS_o_ai vec_lvewx(long __a, const int *__b) {
4297 return (vector int)__builtin_altivec_lvewx(__a, __b);
4298}
4299
4300static __inline__ vector unsigned int __ATTRS_o_ai
4301vec_lvewx(long __a, const unsigned int *__b) {
4302 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
4303}
4304
4305static __inline__ vector float __ATTRS_o_ai vec_lvewx(long __a,
4306 const float *__b) {
4307 return (vector float)__builtin_altivec_lvewx(__a, __b);
4308}
4309
4310/* vec_ldl */
4311
4312static __inline__ vector signed char __ATTRS_o_ai
4313vec_ldl(long __a, const vector signed char *__b) {
4314 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4315}
4316
4317static __inline__ vector signed char __ATTRS_o_ai
4318vec_ldl(long __a, const signed char *__b) {
4319 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4320}
4321
4322static __inline__ vector unsigned char __ATTRS_o_ai
4323vec_ldl(long __a, const vector unsigned char *__b) {
4324 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4325}
4326
4327static __inline__ vector unsigned char __ATTRS_o_ai
4328vec_ldl(long __a, const unsigned char *__b) {
4329 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4330}
4331
4332static __inline__ vector bool char __ATTRS_o_ai
4333vec_ldl(long __a, const vector bool char *__b) {
4334 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
4335}
4336
4337static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a,
4338 const vector short *__b) {
4339 return (vector short)__builtin_altivec_lvxl(__a, __b);
4340}
4341
4342static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a, const short *__b) {
4343 return (vector short)__builtin_altivec_lvxl(__a, __b);
4344}
4345
4346static __inline__ vector unsigned short __ATTRS_o_ai
4347vec_ldl(long __a, const vector unsigned short *__b) {
4348 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4349}
4350
4351static __inline__ vector unsigned short __ATTRS_o_ai
4352vec_ldl(long __a, const unsigned short *__b) {
4353 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4354}
4355
4356static __inline__ vector bool short __ATTRS_o_ai
4357vec_ldl(long __a, const vector bool short *__b) {
4358 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
4359}
4360
4361static __inline__ vector pixel __ATTRS_o_ai vec_ldl(long __a,
4362 const vector pixel *__b) {
4363 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
4364}
4365
4366static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a,
4367 const vector int *__b) {
4368 return (vector int)__builtin_altivec_lvxl(__a, __b);
4369}
4370
4371static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a, const int *__b) {
4372 return (vector int)__builtin_altivec_lvxl(__a, __b);
4373}
4374
4375static __inline__ vector unsigned int __ATTRS_o_ai
4376vec_ldl(long __a, const vector unsigned int *__b) {
4377 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4378}
4379
4380static __inline__ vector unsigned int __ATTRS_o_ai
4381vec_ldl(long __a, const unsigned int *__b) {
4382 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4383}
4384
4385static __inline__ vector bool int __ATTRS_o_ai
4386vec_ldl(long __a, const vector bool int *__b) {
4387 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4388}
4389
4390static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a,
4391 const vector float *__b) {
4392 return (vector float)__builtin_altivec_lvxl(__a, __b);
4393}
4394
4395static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a, const float *__b) {
4396 return (vector float)__builtin_altivec_lvxl(__a, __b);
4397}
4398
4399/* vec_lvxl */
4400
4401static __inline__ vector signed char __ATTRS_o_ai
4402vec_lvxl(long __a, const vector signed char *__b) {
4403 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4404}
4405
4406static __inline__ vector signed char __ATTRS_o_ai
4407vec_lvxl(long __a, const signed char *__b) {
4408 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
4409}
4410
4411static __inline__ vector unsigned char __ATTRS_o_ai
4412vec_lvxl(long __a, const vector unsigned char *__b) {
4413 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4414}
4415
4416static __inline__ vector unsigned char __ATTRS_o_ai
4417vec_lvxl(long __a, const unsigned char *__b) {
4418 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
4419}
4420
4421static __inline__ vector bool char __ATTRS_o_ai
4422vec_lvxl(long __a, const vector bool char *__b) {
4423 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
4424}
4425
4426static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4427 const vector short *__b) {
4428 return (vector short)__builtin_altivec_lvxl(__a, __b);
4429}
4430
4431static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,
4432 const short *__b) {
4433 return (vector short)__builtin_altivec_lvxl(__a, __b);
4434}
4435
4436static __inline__ vector unsigned short __ATTRS_o_ai
4437vec_lvxl(long __a, const vector unsigned short *__b) {
4438 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4439}
4440
4441static __inline__ vector unsigned short __ATTRS_o_ai
4442vec_lvxl(long __a, const unsigned short *__b) {
4443 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
4444}
4445
4446static __inline__ vector bool short __ATTRS_o_ai
4447vec_lvxl(long __a, const vector bool short *__b) {
4448 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
4449}
4450
4451static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(long __a,
4452 const vector pixel *__b) {
4453 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
4454}
4455
4456static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a,
4457 const vector int *__b) {
4458 return (vector int)__builtin_altivec_lvxl(__a, __b);
4459}
4460
4461static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a, const int *__b) {
4462 return (vector int)__builtin_altivec_lvxl(__a, __b);
4463}
4464
4465static __inline__ vector unsigned int __ATTRS_o_ai
4466vec_lvxl(long __a, const vector unsigned int *__b) {
4467 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4468}
4469
4470static __inline__ vector unsigned int __ATTRS_o_ai
4471vec_lvxl(long __a, const unsigned int *__b) {
4472 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
4473}
4474
4475static __inline__ vector bool int __ATTRS_o_ai
4476vec_lvxl(long __a, const vector bool int *__b) {
4477 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
4478}
4479
4480static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4481 const vector float *__b) {
4482 return (vector float)__builtin_altivec_lvxl(__a, __b);
4483}
4484
4485static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,
4486 const float *__b) {
4487 return (vector float)__builtin_altivec_lvxl(__a, __b);
4488}
4489
4490/* vec_loge */
4491
4492static __inline__ vector float __attribute__((__always_inline__))
4493vec_loge(vector float __a) {
4494 return __builtin_altivec_vlogefp(__a);
4495}
4496
4497/* vec_vlogefp */
4498
4499static __inline__ vector float __attribute__((__always_inline__))
4500vec_vlogefp(vector float __a) {
4501 return __builtin_altivec_vlogefp(__a);
4502}
4503
4504/* vec_lvsl */
4505
4506#ifdef __LITTLE_ENDIAN__
4507static __inline__ vector unsigned char __ATTRS_o_ai
4508 __attribute__((__deprecated__("use assignment for unaligned little endian \
4509loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
4510 vector unsigned char mask =
4511 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4512 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4513 7, 6, 5, 4, 3, 2, 1, 0};
4514 return vec_perm(mask, mask, reverse);
4515}
4516#else
4517static __inline__ vector unsigned char __ATTRS_o_ai
4518vec_lvsl(int __a, const signed char *__b) {
4519 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4520}
4521#endif
4522
4523#ifdef __LITTLE_ENDIAN__
4524static __inline__ vector unsigned char __ATTRS_o_ai
4525 __attribute__((__deprecated__("use assignment for unaligned little endian \
4526loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
4527 vector unsigned char mask =
4528 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4529 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4530 7, 6, 5, 4, 3, 2, 1, 0};
4531 return vec_perm(mask, mask, reverse);
4532}
4533#else
4534static __inline__ vector unsigned char __ATTRS_o_ai
4535vec_lvsl(int __a, const unsigned char *__b) {
4536 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4537}
4538#endif
4539
4540#ifdef __LITTLE_ENDIAN__
4541static __inline__ vector unsigned char __ATTRS_o_ai
4542 __attribute__((__deprecated__("use assignment for unaligned little endian \
4543loads/stores"))) vec_lvsl(int __a, const short *__b) {
4544 vector unsigned char mask =
4545 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4546 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4547 7, 6, 5, 4, 3, 2, 1, 0};
4548 return vec_perm(mask, mask, reverse);
4549}
4550#else
4551static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4552 const short *__b) {
4553 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4554}
4555#endif
4556
4557#ifdef __LITTLE_ENDIAN__
4558static __inline__ vector unsigned char __ATTRS_o_ai
4559 __attribute__((__deprecated__("use assignment for unaligned little endian \
4560loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
4561 vector unsigned char mask =
4562 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4563 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4564 7, 6, 5, 4, 3, 2, 1, 0};
4565 return vec_perm(mask, mask, reverse);
4566}
4567#else
4568static __inline__ vector unsigned char __ATTRS_o_ai
4569vec_lvsl(int __a, const unsigned short *__b) {
4570 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4571}
4572#endif
4573
4574#ifdef __LITTLE_ENDIAN__
4575static __inline__ vector unsigned char __ATTRS_o_ai
4576 __attribute__((__deprecated__("use assignment for unaligned little endian \
4577loads/stores"))) vec_lvsl(int __a, const int *__b) {
4578 vector unsigned char mask =
4579 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4580 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4581 7, 6, 5, 4, 3, 2, 1, 0};
4582 return vec_perm(mask, mask, reverse);
4583}
4584#else
4585static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4586 const int *__b) {
4587 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4588}
4589#endif
4590
4591#ifdef __LITTLE_ENDIAN__
4592static __inline__ vector unsigned char __ATTRS_o_ai
4593 __attribute__((__deprecated__("use assignment for unaligned little endian \
4594loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
4595 vector unsigned char mask =
4596 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4597 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4598 7, 6, 5, 4, 3, 2, 1, 0};
4599 return vec_perm(mask, mask, reverse);
4600}
4601#else
4602static __inline__ vector unsigned char __ATTRS_o_ai
4603vec_lvsl(int __a, const unsigned int *__b) {
4604 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4605}
4606#endif
4607
4608#ifdef __LITTLE_ENDIAN__
4609static __inline__ vector unsigned char __ATTRS_o_ai
4610 __attribute__((__deprecated__("use assignment for unaligned little endian \
4611loads/stores"))) vec_lvsl(int __a, const float *__b) {
4612 vector unsigned char mask =
4613 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4614 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4615 7, 6, 5, 4, 3, 2, 1, 0};
4616 return vec_perm(mask, mask, reverse);
4617}
4618#else
4619static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4620 const float *__b) {
4621 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4622}
4623#endif
4624
4625/* vec_lvsr */
4626
4627#ifdef __LITTLE_ENDIAN__
4628static __inline__ vector unsigned char __ATTRS_o_ai
4629 __attribute__((__deprecated__("use assignment for unaligned little endian \
4630loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4631 vector unsigned char mask =
4632 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4633 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4634 7, 6, 5, 4, 3, 2, 1, 0};
4635 return vec_perm(mask, mask, reverse);
4636}
4637#else
4638static __inline__ vector unsigned char __ATTRS_o_ai
4639vec_lvsr(int __a, const signed char *__b) {
4640 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4641}
4642#endif
4643
4644#ifdef __LITTLE_ENDIAN__
4645static __inline__ vector unsigned char __ATTRS_o_ai
4646 __attribute__((__deprecated__("use assignment for unaligned little endian \
4647loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4648 vector unsigned char mask =
4649 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4650 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4651 7, 6, 5, 4, 3, 2, 1, 0};
4652 return vec_perm(mask, mask, reverse);
4653}
4654#else
4655static __inline__ vector unsigned char __ATTRS_o_ai
4656vec_lvsr(int __a, const unsigned char *__b) {
4657 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4658}
4659#endif
4660
4661#ifdef __LITTLE_ENDIAN__
4662static __inline__ vector unsigned char __ATTRS_o_ai
4663 __attribute__((__deprecated__("use assignment for unaligned little endian \
4664loads/stores"))) vec_lvsr(int __a, const short *__b) {
4665 vector unsigned char mask =
4666 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4667 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4668 7, 6, 5, 4, 3, 2, 1, 0};
4669 return vec_perm(mask, mask, reverse);
4670}
4671#else
4672static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4673 const short *__b) {
4674 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4675}
4676#endif
4677
4678#ifdef __LITTLE_ENDIAN__
4679static __inline__ vector unsigned char __ATTRS_o_ai
4680 __attribute__((__deprecated__("use assignment for unaligned little endian \
4681loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4682 vector unsigned char mask =
4683 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4684 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4685 7, 6, 5, 4, 3, 2, 1, 0};
4686 return vec_perm(mask, mask, reverse);
4687}
4688#else
4689static __inline__ vector unsigned char __ATTRS_o_ai
4690vec_lvsr(int __a, const unsigned short *__b) {
4691 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4692}
4693#endif
4694
4695#ifdef __LITTLE_ENDIAN__
4696static __inline__ vector unsigned char __ATTRS_o_ai
4697 __attribute__((__deprecated__("use assignment for unaligned little endian \
4698loads/stores"))) vec_lvsr(int __a, const int *__b) {
4699 vector unsigned char mask =
4700 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4701 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4702 7, 6, 5, 4, 3, 2, 1, 0};
4703 return vec_perm(mask, mask, reverse);
4704}
4705#else
4706static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4707 const int *__b) {
4708 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4709}
4710#endif
4711
4712#ifdef __LITTLE_ENDIAN__
4713static __inline__ vector unsigned char __ATTRS_o_ai
4714 __attribute__((__deprecated__("use assignment for unaligned little endian \
4715loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4716 vector unsigned char mask =
4717 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4718 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4719 7, 6, 5, 4, 3, 2, 1, 0};
4720 return vec_perm(mask, mask, reverse);
4721}
4722#else
4723static __inline__ vector unsigned char __ATTRS_o_ai
4724vec_lvsr(int __a, const unsigned int *__b) {
4725 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4726}
4727#endif
4728
4729#ifdef __LITTLE_ENDIAN__
4730static __inline__ vector unsigned char __ATTRS_o_ai
4731 __attribute__((__deprecated__("use assignment for unaligned little endian \
4732loads/stores"))) vec_lvsr(int __a, const float *__b) {
4733 vector unsigned char mask =
4734 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4735 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4736 7, 6, 5, 4, 3, 2, 1, 0};
4737 return vec_perm(mask, mask, reverse);
4738}
4739#else
4740static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4741 const float *__b) {
4742 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4743}
4744#endif
4745
4746/* vec_madd */
4747static __inline__ vector signed short __ATTRS_o_ai
4748vec_mladd(vector signed short, vector signed short, vector signed short);
4749static __inline__ vector signed short __ATTRS_o_ai
4750vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4751static __inline__ vector signed short __ATTRS_o_ai
4752vec_mladd(vector unsigned short, vector signed short, vector signed short);
4753static __inline__ vector unsigned short __ATTRS_o_ai
4754vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4755
4756static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4757 vector signed short __a, vector signed short __b, vector signed short __c) {
4758 return vec_mladd(__a, __b, __c);
4759}
4760
4761static __inline__ vector signed short __ATTRS_o_ai
4762vec_madd(vector signed short __a, vector unsigned short __b,
4763 vector unsigned short __c) {
4764 return vec_mladd(__a, __b, __c);
4765}
4766
4767static __inline__ vector signed short __ATTRS_o_ai
4768vec_madd(vector unsigned short __a, vector signed short __b,
4769 vector signed short __c) {
4770 return vec_mladd(__a, __b, __c);
4771}
4772
4773static __inline__ vector unsigned short __ATTRS_o_ai
4774vec_madd(vector unsigned short __a, vector unsigned short __b,
4775 vector unsigned short __c) {
4776 return vec_mladd(__a, __b, __c);
4777}
4778
4779static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4780 vector float __b,
4781 vector float __c) {
4782#ifdef __VSX__
4783 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4784#else
4785 return __builtin_altivec_vmaddfp(__a, __b, __c);
4786#endif
4787}
4788
4789#ifdef __VSX__
4790static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4791 vector double __b,
4792 vector double __c) {
4793 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4794}
4795#endif
4796
4797/* vec_vmaddfp */
4798
4799static __inline__ vector float __attribute__((__always_inline__))
4800vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4801 return __builtin_altivec_vmaddfp(__a, __b, __c);
4802}
4803
4804/* vec_madds */
4805
4806static __inline__ vector signed short __attribute__((__always_inline__))
4807vec_madds(vector signed short __a, vector signed short __b,
4808 vector signed short __c) {
4809 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4810}
4811
4812/* vec_vmhaddshs */
4813static __inline__ vector signed short __attribute__((__always_inline__))
4814vec_vmhaddshs(vector signed short __a, vector signed short __b,
4815 vector signed short __c) {
4816 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4817}
4818
4819/* vec_msub */
4820
4821#ifdef __VSX__
4822static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4823 vector float __b,
4824 vector float __c) {
4825 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4826}
4827
4828static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4829 vector double __b,
4830 vector double __c) {
4831 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4832}
4833#endif
4834
4835/* vec_max */
4836
4837static __inline__ vector signed char __ATTRS_o_ai
4838vec_max(vector signed char __a, vector signed char __b) {
4839 return __builtin_altivec_vmaxsb(__a, __b);
4840}
4841
4842static __inline__ vector signed char __ATTRS_o_ai
4843vec_max(vector bool char __a, vector signed char __b) {
4844 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4845}
4846
4847static __inline__ vector signed char __ATTRS_o_ai
4848vec_max(vector signed char __a, vector bool char __b) {
4849 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4850}
4851
4852static __inline__ vector unsigned char __ATTRS_o_ai
4853vec_max(vector unsigned char __a, vector unsigned char __b) {
4854 return __builtin_altivec_vmaxub(__a, __b);
4855}
4856
4857static __inline__ vector unsigned char __ATTRS_o_ai
4858vec_max(vector bool char __a, vector unsigned char __b) {
4859 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4860}
4861
4862static __inline__ vector unsigned char __ATTRS_o_ai
4863vec_max(vector unsigned char __a, vector bool char __b) {
4864 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4865}
4866
4867static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4868 vector short __b) {
4869 return __builtin_altivec_vmaxsh(__a, __b);
4870}
4871
4872static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4873 vector short __b) {
4874 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4875}
4876
4877static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4878 vector bool short __b) {
4879 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4880}
4881
4882static __inline__ vector unsigned short __ATTRS_o_ai
4883vec_max(vector unsigned short __a, vector unsigned short __b) {
4884 return __builtin_altivec_vmaxuh(__a, __b);
4885}
4886
4887static __inline__ vector unsigned short __ATTRS_o_ai
4888vec_max(vector bool short __a, vector unsigned short __b) {
4889 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4890}
4891
4892static __inline__ vector unsigned short __ATTRS_o_ai
4893vec_max(vector unsigned short __a, vector bool short __b) {
4894 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4895}
4896
4897static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4898 vector int __b) {
4899 return __builtin_altivec_vmaxsw(__a, __b);
4900}
4901
4902static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4903 vector int __b) {
4904 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4905}
4906
4907static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4908 vector bool int __b) {
4909 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4910}
4911
4912static __inline__ vector unsigned int __ATTRS_o_ai
4913vec_max(vector unsigned int __a, vector unsigned int __b) {
4914 return __builtin_altivec_vmaxuw(__a, __b);
4915}
4916
4917static __inline__ vector unsigned int __ATTRS_o_ai
4918vec_max(vector bool int __a, vector unsigned int __b) {
4919 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4920}
4921
4922static __inline__ vector unsigned int __ATTRS_o_ai
4923vec_max(vector unsigned int __a, vector bool int __b) {
4924 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4925}
4926
4927#ifdef __POWER8_VECTOR__
4928static __inline__ vector signed long long __ATTRS_o_ai
4929vec_max(vector signed long long __a, vector signed long long __b) {
4930 return __builtin_altivec_vmaxsd(__a, __b);
4931}
4932
4933static __inline__ vector signed long long __ATTRS_o_ai
4934vec_max(vector bool long long __a, vector signed long long __b) {
4935 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4936}
4937
4938static __inline__ vector signed long long __ATTRS_o_ai
4939vec_max(vector signed long long __a, vector bool long long __b) {
4940 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4941}
4942
4943static __inline__ vector unsigned long long __ATTRS_o_ai
4944vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4945 return __builtin_altivec_vmaxud(__a, __b);
4946}
4947
4948static __inline__ vector unsigned long long __ATTRS_o_ai
4949vec_max(vector bool long long __a, vector unsigned long long __b) {
4950 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4951}
4952
4953static __inline__ vector unsigned long long __ATTRS_o_ai
4954vec_max(vector unsigned long long __a, vector bool long long __b) {
4955 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4956}
4957#endif
4958
4959static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4960 vector float __b) {
4961#ifdef __VSX__
4962 return __builtin_vsx_xvmaxsp(__a, __b);
4963#else
4964 return __builtin_altivec_vmaxfp(__a, __b);
4965#endif
4966}
4967
4968#ifdef __VSX__
4969static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4970 vector double __b) {
4971 return __builtin_vsx_xvmaxdp(__a, __b);
4972}
4973#endif
4974
4975/* vec_vmaxsb */
4976
4977static __inline__ vector signed char __ATTRS_o_ai
4978vec_vmaxsb(vector signed char __a, vector signed char __b) {
4979 return __builtin_altivec_vmaxsb(__a, __b);
4980}
4981
4982static __inline__ vector signed char __ATTRS_o_ai
4983vec_vmaxsb(vector bool char __a, vector signed char __b) {
4984 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4985}
4986
4987static __inline__ vector signed char __ATTRS_o_ai
4988vec_vmaxsb(vector signed char __a, vector bool char __b) {
4989 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4990}
4991
4992/* vec_vmaxub */
4993
4994static __inline__ vector unsigned char __ATTRS_o_ai
4995vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4996 return __builtin_altivec_vmaxub(__a, __b);
4997}
4998
4999static __inline__ vector unsigned char __ATTRS_o_ai
5000vec_vmaxub(vector bool char __a, vector unsigned char __b) {
5001 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
5002}
5003
5004static __inline__ vector unsigned char __ATTRS_o_ai
5005vec_vmaxub(vector unsigned char __a, vector bool char __b) {
5006 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
5007}
5008
5009/* vec_vmaxsh */
5010
5011static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
5012 vector short __b) {
5013 return __builtin_altivec_vmaxsh(__a, __b);
5014}
5015
5016static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
5017 vector short __b) {
5018 return __builtin_altivec_vmaxsh((vector short)__a, __b);
5019}
5020
5021static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
5022 vector bool short __b) {
5023 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
5024}
5025
5026/* vec_vmaxuh */
5027
5028static __inline__ vector unsigned short __ATTRS_o_ai
5029vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
5030 return __builtin_altivec_vmaxuh(__a, __b);
5031}
5032
5033static __inline__ vector unsigned short __ATTRS_o_ai
5034vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
5035 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
5036}
5037
5038static __inline__ vector unsigned short __ATTRS_o_ai
5039vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
5040 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
5041}
5042
5043/* vec_vmaxsw */
5044
5045static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
5046 vector int __b) {
5047 return __builtin_altivec_vmaxsw(__a, __b);
5048}
5049
5050static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
5051 vector int __b) {
5052 return __builtin_altivec_vmaxsw((vector int)__a, __b);
5053}
5054
5055static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
5056 vector bool int __b) {
5057 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
5058}
5059
5060/* vec_vmaxuw */
5061
5062static __inline__ vector unsigned int __ATTRS_o_ai
5063vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
5064 return __builtin_altivec_vmaxuw(__a, __b);
5065}
5066
5067static __inline__ vector unsigned int __ATTRS_o_ai
5068vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
5069 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
5070}
5071
5072static __inline__ vector unsigned int __ATTRS_o_ai
5073vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
5074 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
5075}
5076
5077/* vec_vmaxfp */
5078
5079static __inline__ vector float __attribute__((__always_inline__))
5080vec_vmaxfp(vector float __a, vector float __b) {
5081#ifdef __VSX__
5082 return __builtin_vsx_xvmaxsp(__a, __b);
5083#else
5084 return __builtin_altivec_vmaxfp(__a, __b);
5085#endif
5086}
5087
5088/* vec_mergeh */
5089
5090static __inline__ vector signed char __ATTRS_o_ai
5091vec_mergeh(vector signed char __a, vector signed char __b) {
5092 return vec_perm(__a, __b,
5093 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5094 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5095 0x06, 0x16, 0x07, 0x17));
5096}
5097
5098static __inline__ vector unsigned char __ATTRS_o_ai
5099vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
5100 return vec_perm(__a, __b,
5101 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5102 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5103 0x06, 0x16, 0x07, 0x17));
5104}
5105
5106static __inline__ vector bool char __ATTRS_o_ai
5107vec_mergeh(vector bool char __a, vector bool char __b) {
5108 return vec_perm(__a, __b,
5109 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5110 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5111 0x06, 0x16, 0x07, 0x17));
5112}
5113
5114static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
5115 vector short __b) {
5116 return vec_perm(__a, __b,
5117 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5118 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5119 0x06, 0x07, 0x16, 0x17));
5120}
5121
5122static __inline__ vector unsigned short __ATTRS_o_ai
5123vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
5124 return vec_perm(__a, __b,
5125 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5126 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5127 0x06, 0x07, 0x16, 0x17));
5128}
5129
5130static __inline__ vector bool short __ATTRS_o_ai
5131vec_mergeh(vector bool short __a, vector bool short __b) {
5132 return vec_perm(__a, __b,
5133 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5134 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5135 0x06, 0x07, 0x16, 0x17));
5136}
5137
5138static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
5139 vector pixel __b) {
5140 return vec_perm(__a, __b,
5141 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5142 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5143 0x06, 0x07, 0x16, 0x17));
5144}
5145
5146static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
5147 vector int __b) {
5148 return vec_perm(__a, __b,
5149 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5150 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5151 0x14, 0x15, 0x16, 0x17));
5152}
5153
5154static __inline__ vector unsigned int __ATTRS_o_ai
5155vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
5156 return vec_perm(__a, __b,
5157 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5158 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5159 0x14, 0x15, 0x16, 0x17));
5160}
5161
5162static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
5163 vector bool int __b) {
5164 return vec_perm(__a, __b,
5165 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5166 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5167 0x14, 0x15, 0x16, 0x17));
5168}
5169
5170static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
5171 vector float __b) {
5172 return vec_perm(__a, __b,
5173 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5174 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5175 0x14, 0x15, 0x16, 0x17));
5176}
5177
5178#ifdef __VSX__
5179static __inline__ vector signed long long __ATTRS_o_ai
5180vec_mergeh(vector signed long long __a, vector signed long long __b) {
5181 return vec_perm(__a, __b,
5182 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5183 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5184 0x14, 0x15, 0x16, 0x17));
5185}
5186
5187static __inline__ vector signed long long __ATTRS_o_ai
5188vec_mergeh(vector signed long long __a, vector bool long long __b) {
5189 return vec_perm(__a, (vector signed long long)__b,
5190 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5191 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5192 0x14, 0x15, 0x16, 0x17));
5193}
5194
5195static __inline__ vector signed long long __ATTRS_o_ai
5196vec_mergeh(vector bool long long __a, vector signed long long __b) {
5197 return vec_perm((vector signed long long)__a, __b,
5198 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5199 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5200 0x14, 0x15, 0x16, 0x17));
5201}
5202
5203static __inline__ vector unsigned long long __ATTRS_o_ai
5204vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
5205 return vec_perm(__a, __b,
5206 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5207 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5208 0x14, 0x15, 0x16, 0x17));
5209}
5210
5211static __inline__ vector unsigned long long __ATTRS_o_ai
5212vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
5213 return vec_perm(__a, (vector unsigned long long)__b,
5214 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5215 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5216 0x14, 0x15, 0x16, 0x17));
5217}
5218
5219static __inline__ vector unsigned long long __ATTRS_o_ai
5220vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
5221 return vec_perm((vector unsigned long long)__a, __b,
5222 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5223 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5224 0x14, 0x15, 0x16, 0x17));
5225}
5226
5227static __inline__ vector bool long long __ATTRS_o_ai
5228vec_mergeh(vector bool long long __a, vector bool long long __b) {
5229 return vec_perm(__a, __b,
5230 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5231 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5232 0x14, 0x15, 0x16, 0x17));
5233}
5234
5235static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
5236 vector double __b) {
5237 return vec_perm(__a, __b,
5238 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5239 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5240 0x14, 0x15, 0x16, 0x17));
5241}
5242static __inline__ vector double __ATTRS_o_ai
5243vec_mergeh(vector double __a, vector bool long long __b) {
5244 return vec_perm(__a, (vector double)__b,
5245 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5246 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5247 0x14, 0x15, 0x16, 0x17));
5248}
5249static __inline__ vector double __ATTRS_o_ai
5250vec_mergeh(vector bool long long __a, vector double __b) {
5251 return vec_perm((vector double)__a, __b,
5252 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
5253 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
5254 0x14, 0x15, 0x16, 0x17));
5255}
5256#endif
5257
5258/* vec_vmrghb */
5259
5260#define __builtin_altivec_vmrghb vec_vmrghb
5261
5262static __inline__ vector signed char __ATTRS_o_ai
5263vec_vmrghb(vector signed char __a, vector signed char __b) {
5264 return vec_perm(__a, __b,
5265 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5266 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5267 0x06, 0x16, 0x07, 0x17));
5268}
5269
5270static __inline__ vector unsigned char __ATTRS_o_ai
5271vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
5272 return vec_perm(__a, __b,
5273 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5274 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5275 0x06, 0x16, 0x07, 0x17));
5276}
5277
5278static __inline__ vector bool char __ATTRS_o_ai
5279vec_vmrghb(vector bool char __a, vector bool char __b) {
5280 return vec_perm(__a, __b,
5281 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
5282 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
5283 0x06, 0x16, 0x07, 0x17));
5284}
5285
5286/* vec_vmrghh */
5287
5288#define __builtin_altivec_vmrghh vec_vmrghh
5289
5290static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
5291 vector short __b) {
5292 return vec_perm(__a, __b,
5293 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5294 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5295 0x06, 0x07, 0x16, 0x17));
5296}
5297
5298static __inline__ vector unsigned short __ATTRS_o_ai
5299vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
5300 return vec_perm(__a, __b,
5301 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5302 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5303 0x06, 0x07, 0x16, 0x17));
5304}
5305
5306static __inline__ vector bool short __ATTRS_o_ai
5307vec_vmrghh(vector bool short __a, vector bool short __b) {
5308 return vec_perm(__a, __b,
5309 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5310 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5311 0x06, 0x07, 0x16, 0x17));
5312}
5313
5314static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
5315 vector pixel __b) {
5316 return vec_perm(__a, __b,
5317 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
5318 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
5319 0x06, 0x07, 0x16, 0x17));
5320}
5321
5322/* vec_vmrghw */
5323
5324#define __builtin_altivec_vmrghw vec_vmrghw
5325
5326static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
5327 vector int __b) {
5328 return vec_perm(__a, __b,
5329 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5330 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5331 0x14, 0x15, 0x16, 0x17));
5332}
5333
5334static __inline__ vector unsigned int __ATTRS_o_ai
5335vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
5336 return vec_perm(__a, __b,
5337 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5338 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5339 0x14, 0x15, 0x16, 0x17));
5340}
5341
5342static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
5343 vector bool int __b) {
5344 return vec_perm(__a, __b,
5345 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5346 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5347 0x14, 0x15, 0x16, 0x17));
5348}
5349
5350static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
5351 vector float __b) {
5352 return vec_perm(__a, __b,
5353 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5354 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
5355 0x14, 0x15, 0x16, 0x17));
5356}
5357
5358/* vec_mergel */
5359
5360static __inline__ vector signed char __ATTRS_o_ai
5361vec_mergel(vector signed char __a, vector signed char __b) {
5362 return vec_perm(__a, __b,
5363 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5364 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5365 0x0E, 0x1E, 0x0F, 0x1F));
5366}
5367
5368static __inline__ vector unsigned char __ATTRS_o_ai
5369vec_mergel(vector unsigned char __a, vector unsigned char __b) {
5370 return vec_perm(__a, __b,
5371 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5372 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5373 0x0E, 0x1E, 0x0F, 0x1F));
5374}
5375
5376static __inline__ vector bool char __ATTRS_o_ai
5377vec_mergel(vector bool char __a, vector bool char __b) {
5378 return vec_perm(__a, __b,
5379 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5380 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5381 0x0E, 0x1E, 0x0F, 0x1F));
5382}
5383
5384static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
5385 vector short __b) {
5386 return vec_perm(__a, __b,
5387 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5388 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5389 0x0E, 0x0F, 0x1E, 0x1F));
5390}
5391
5392static __inline__ vector unsigned short __ATTRS_o_ai
5393vec_mergel(vector unsigned short __a, vector unsigned short __b) {
5394 return vec_perm(__a, __b,
5395 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5396 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5397 0x0E, 0x0F, 0x1E, 0x1F));
5398}
5399
5400static __inline__ vector bool short __ATTRS_o_ai
5401vec_mergel(vector bool short __a, vector bool short __b) {
5402 return vec_perm(__a, __b,
5403 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5404 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5405 0x0E, 0x0F, 0x1E, 0x1F));
5406}
5407
5408static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
5409 vector pixel __b) {
5410 return vec_perm(__a, __b,
5411 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5412 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5413 0x0E, 0x0F, 0x1E, 0x1F));
5414}
5415
5416static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
5417 vector int __b) {
5418 return vec_perm(__a, __b,
5419 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5420 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5421 0x1C, 0x1D, 0x1E, 0x1F));
5422}
5423
5424static __inline__ vector unsigned int __ATTRS_o_ai
5425vec_mergel(vector unsigned int __a, vector unsigned int __b) {
5426 return vec_perm(__a, __b,
5427 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5428 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5429 0x1C, 0x1D, 0x1E, 0x1F));
5430}
5431
5432static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
5433 vector bool int __b) {
5434 return vec_perm(__a, __b,
5435 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5436 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5437 0x1C, 0x1D, 0x1E, 0x1F));
5438}
5439
5440static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
5441 vector float __b) {
5442 return vec_perm(__a, __b,
5443 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5444 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5445 0x1C, 0x1D, 0x1E, 0x1F));
5446}
5447
5448#ifdef __VSX__
5449static __inline__ vector signed long long __ATTRS_o_ai
5450vec_mergel(vector signed long long __a, vector signed long long __b) {
5451 return vec_perm(__a, __b,
5452 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5453 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5454 0x1C, 0x1D, 0x1E, 0x1F));
5455}
5456static __inline__ vector signed long long __ATTRS_o_ai
5457vec_mergel(vector signed long long __a, vector bool long long __b) {
5458 return vec_perm(__a, (vector signed long long)__b,
5459 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5460 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5461 0x1C, 0x1D, 0x1E, 0x1F));
5462}
5463static __inline__ vector signed long long __ATTRS_o_ai
5464vec_mergel(vector bool long long __a, vector signed long long __b) {
5465 return vec_perm((vector signed long long)__a, __b,
5466 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5467 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5468 0x1C, 0x1D, 0x1E, 0x1F));
5469}
5470static __inline__ vector unsigned long long __ATTRS_o_ai
5471vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
5472 return vec_perm(__a, __b,
5473 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5474 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5475 0x1C, 0x1D, 0x1E, 0x1F));
5476}
5477static __inline__ vector unsigned long long __ATTRS_o_ai
5478vec_mergel(vector unsigned long long __a, vector bool long long __b) {
5479 return vec_perm(__a, (vector unsigned long long)__b,
5480 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5481 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5482 0x1C, 0x1D, 0x1E, 0x1F));
5483}
5484static __inline__ vector unsigned long long __ATTRS_o_ai
5485vec_mergel(vector bool long long __a, vector unsigned long long __b) {
5486 return vec_perm((vector unsigned long long)__a, __b,
5487 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5488 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5489 0x1C, 0x1D, 0x1E, 0x1F));
5490}
5491static __inline__ vector bool long long __ATTRS_o_ai
5492vec_mergel(vector bool long long __a, vector bool long long __b) {
5493 return vec_perm(__a, __b,
5494 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5495 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5496 0x1C, 0x1D, 0x1E, 0x1F));
5497}
5498static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
5499 vector double __b) {
5500 return vec_perm(__a, __b,
5501 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5502 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5503 0x1C, 0x1D, 0x1E, 0x1F));
5504}
5505static __inline__ vector double __ATTRS_o_ai
5506vec_mergel(vector double __a, vector bool long long __b) {
5507 return vec_perm(__a, (vector double)__b,
5508 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5509 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5510 0x1C, 0x1D, 0x1E, 0x1F));
5511}
5512static __inline__ vector double __ATTRS_o_ai
5513vec_mergel(vector bool long long __a, vector double __b) {
5514 return vec_perm((vector double)__a, __b,
5515 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
5516 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
5517 0x1C, 0x1D, 0x1E, 0x1F));
5518}
5519#endif
5520
5521/* vec_vmrglb */
5522
5523#define __builtin_altivec_vmrglb vec_vmrglb
5524
5525static __inline__ vector signed char __ATTRS_o_ai
5526vec_vmrglb(vector signed char __a, vector signed char __b) {
5527 return vec_perm(__a, __b,
5528 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5529 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5530 0x0E, 0x1E, 0x0F, 0x1F));
5531}
5532
5533static __inline__ vector unsigned char __ATTRS_o_ai
5534vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
5535 return vec_perm(__a, __b,
5536 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5537 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5538 0x0E, 0x1E, 0x0F, 0x1F));
5539}
5540
5541static __inline__ vector bool char __ATTRS_o_ai
5542vec_vmrglb(vector bool char __a, vector bool char __b) {
5543 return vec_perm(__a, __b,
5544 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
5545 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
5546 0x0E, 0x1E, 0x0F, 0x1F));
5547}
5548
5549/* vec_vmrglh */
5550
5551#define __builtin_altivec_vmrglh vec_vmrglh
5552
5553static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
5554 vector short __b) {
5555 return vec_perm(__a, __b,
5556 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5557 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5558 0x0E, 0x0F, 0x1E, 0x1F));
5559}
5560
5561static __inline__ vector unsigned short __ATTRS_o_ai
5562vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
5563 return vec_perm(__a, __b,
5564 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5565 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5566 0x0E, 0x0F, 0x1E, 0x1F));
5567}
5568
5569static __inline__ vector bool short __ATTRS_o_ai
5570vec_vmrglh(vector bool short __a, vector bool short __b) {
5571 return vec_perm(__a, __b,
5572 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5573 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5574 0x0E, 0x0F, 0x1E, 0x1F));
5575}
5576
5577static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
5578 vector pixel __b) {
5579 return vec_perm(__a, __b,
5580 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5581 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5582 0x0E, 0x0F, 0x1E, 0x1F));
5583}
5584
5585/* vec_vmrglw */
5586
5587#define __builtin_altivec_vmrglw vec_vmrglw
5588
5589static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
5590 vector int __b) {
5591 return vec_perm(__a, __b,
5592 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5593 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5594 0x1C, 0x1D, 0x1E, 0x1F));
5595}
5596
5597static __inline__ vector unsigned int __ATTRS_o_ai
5598vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
5599 return vec_perm(__a, __b,
5600 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5601 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5602 0x1C, 0x1D, 0x1E, 0x1F));
5603}
5604
5605static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
5606 vector bool int __b) {
5607 return vec_perm(__a, __b,
5608 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5609 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5610 0x1C, 0x1D, 0x1E, 0x1F));
5611}
5612
5613static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5614 vector float __b) {
5615 return vec_perm(__a, __b,
5616 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5617 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5618 0x1C, 0x1D, 0x1E, 0x1F));
5619}
5620
5621#ifdef __POWER8_VECTOR__
5622/* vec_mergee */
5623
5624static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5625 vector bool int __b) {
5626 return vec_perm(__a, __b,
5627 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5628 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5629 0x18, 0x19, 0x1A, 0x1B));
5630}
5631
5632static __inline__ vector signed int __ATTRS_o_ai
5633vec_mergee(vector signed int __a, vector signed int __b) {
5634 return vec_perm(__a, __b,
5635 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5636 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5637 0x18, 0x19, 0x1A, 0x1B));
5638}
5639
5640static __inline__ vector unsigned int __ATTRS_o_ai
5641vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5642 return vec_perm(__a, __b,
5643 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5644 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5645 0x18, 0x19, 0x1A, 0x1B));
5646}
5647
5648static __inline__ vector bool long long __ATTRS_o_ai
5649vec_mergee(vector bool long long __a, vector bool long long __b) {
5650 return vec_mergeh(__a, __b);
5651}
5652
5653static __inline__ vector signed long long __ATTRS_o_ai
5654vec_mergee(vector signed long long __a, vector signed long long __b) {
5655 return vec_mergeh(__a, __b);
5656}
5657
5658static __inline__ vector unsigned long long __ATTRS_o_ai
5659vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5660 return vec_mergeh(__a, __b);
5661}
5662
5663static __inline__ vector float __ATTRS_o_ai
5664vec_mergee(vector float __a, vector float __b) {
5665 return vec_perm(__a, __b,
5666 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5667 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5668 0x18, 0x19, 0x1A, 0x1B));
5669}
5670
5671static __inline__ vector double __ATTRS_o_ai
5672vec_mergee(vector double __a, vector double __b) {
5673 return vec_mergeh(__a, __b);
5674}
5675
5676/* vec_mergeo */
5677
5678static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5679 vector bool int __b) {
5680 return vec_perm(__a, __b,
5681 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5682 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5683 0x1C, 0x1D, 0x1E, 0x1F));
5684}
5685
5686static __inline__ vector signed int __ATTRS_o_ai
5687vec_mergeo(vector signed int __a, vector signed int __b) {
5688 return vec_perm(__a, __b,
5689 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5690 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5691 0x1C, 0x1D, 0x1E, 0x1F));
5692}
5693
5694static __inline__ vector unsigned int __ATTRS_o_ai
5695vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5696 return vec_perm(__a, __b,
5697 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5698 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5699 0x1C, 0x1D, 0x1E, 0x1F));
5700}
5701
5702static __inline__ vector bool long long __ATTRS_o_ai
5703vec_mergeo(vector bool long long __a, vector bool long long __b) {
5704 return vec_mergel(__a, __b);
5705}
5706
5707static __inline__ vector signed long long __ATTRS_o_ai
5708vec_mergeo(vector signed long long __a, vector signed long long __b) {
5709 return vec_mergel(__a, __b);
5710}
5711
5712static __inline__ vector unsigned long long __ATTRS_o_ai
5713vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5714 return vec_mergel(__a, __b);
5715}
5716
5717static __inline__ vector float __ATTRS_o_ai
5718vec_mergeo(vector float __a, vector float __b) {
5719 return vec_perm(__a, __b,
5720 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5721 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5722 0x1C, 0x1D, 0x1E, 0x1F));
5723}
5724
5725static __inline__ vector double __ATTRS_o_ai
5726vec_mergeo(vector double __a, vector double __b) {
5727 return vec_mergel(__a, __b);
5728}
5729
5730#endif
5731
5732/* vec_mfvscr */
5733
5734static __inline__ vector unsigned short __attribute__((__always_inline__))
5735vec_mfvscr(void) {
5736 return __builtin_altivec_mfvscr();
5737}
5738
5739/* vec_min */
5740
5741static __inline__ vector signed char __ATTRS_o_ai
5742vec_min(vector signed char __a, vector signed char __b) {
5743 return __builtin_altivec_vminsb(__a, __b);
5744}
5745
5746static __inline__ vector signed char __ATTRS_o_ai
5747vec_min(vector bool char __a, vector signed char __b) {
5748 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5749}
5750
5751static __inline__ vector signed char __ATTRS_o_ai
5752vec_min(vector signed char __a, vector bool char __b) {
5753 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5754}
5755
5756static __inline__ vector unsigned char __ATTRS_o_ai
5757vec_min(vector unsigned char __a, vector unsigned char __b) {
5758 return __builtin_altivec_vminub(__a, __b);
5759}
5760
5761static __inline__ vector unsigned char __ATTRS_o_ai
5762vec_min(vector bool char __a, vector unsigned char __b) {
5763 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5764}
5765
5766static __inline__ vector unsigned char __ATTRS_o_ai
5767vec_min(vector unsigned char __a, vector bool char __b) {
5768 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5769}
5770
5771static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5772 vector short __b) {
5773 return __builtin_altivec_vminsh(__a, __b);
5774}
5775
5776static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5777 vector short __b) {
5778 return __builtin_altivec_vminsh((vector short)__a, __b);
5779}
5780
5781static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5782 vector bool short __b) {
5783 return __builtin_altivec_vminsh(__a, (vector short)__b);
5784}
5785
5786static __inline__ vector unsigned short __ATTRS_o_ai
5787vec_min(vector unsigned short __a, vector unsigned short __b) {
5788 return __builtin_altivec_vminuh(__a, __b);
5789}
5790
5791static __inline__ vector unsigned short __ATTRS_o_ai
5792vec_min(vector bool short __a, vector unsigned short __b) {
5793 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5794}
5795
5796static __inline__ vector unsigned short __ATTRS_o_ai
5797vec_min(vector unsigned short __a, vector bool short __b) {
5798 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5799}
5800
5801static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5802 vector int __b) {
5803 return __builtin_altivec_vminsw(__a, __b);
5804}
5805
5806static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5807 vector int __b) {
5808 return __builtin_altivec_vminsw((vector int)__a, __b);
5809}
5810
5811static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5812 vector bool int __b) {
5813 return __builtin_altivec_vminsw(__a, (vector int)__b);
5814}
5815
5816static __inline__ vector unsigned int __ATTRS_o_ai
5817vec_min(vector unsigned int __a, vector unsigned int __b) {
5818 return __builtin_altivec_vminuw(__a, __b);
5819}
5820
5821static __inline__ vector unsigned int __ATTRS_o_ai
5822vec_min(vector bool int __a, vector unsigned int __b) {
5823 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5824}
5825
5826static __inline__ vector unsigned int __ATTRS_o_ai
5827vec_min(vector unsigned int __a, vector bool int __b) {
5828 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5829}
5830
5831#ifdef __POWER8_VECTOR__
5832static __inline__ vector signed long long __ATTRS_o_ai
5833vec_min(vector signed long long __a, vector signed long long __b) {
5834 return __builtin_altivec_vminsd(__a, __b);
5835}
5836
5837static __inline__ vector signed long long __ATTRS_o_ai
5838vec_min(vector bool long long __a, vector signed long long __b) {
5839 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5840}
5841
5842static __inline__ vector signed long long __ATTRS_o_ai
5843vec_min(vector signed long long __a, vector bool long long __b) {
5844 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5845}
5846
5847static __inline__ vector unsigned long long __ATTRS_o_ai
5848vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5849 return __builtin_altivec_vminud(__a, __b);
5850}
5851
5852static __inline__ vector unsigned long long __ATTRS_o_ai
5853vec_min(vector bool long long __a, vector unsigned long long __b) {
5854 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5855}
5856
5857static __inline__ vector unsigned long long __ATTRS_o_ai
5858vec_min(vector unsigned long long __a, vector bool long long __b) {
5859 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5860}
5861#endif
5862
5863static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5864 vector float __b) {
5865#ifdef __VSX__
5866 return __builtin_vsx_xvminsp(__a, __b);
5867#else
5868 return __builtin_altivec_vminfp(__a, __b);
5869#endif
5870}
5871
5872#ifdef __VSX__
5873static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5874 vector double __b) {
5875 return __builtin_vsx_xvmindp(__a, __b);
5876}
5877#endif
5878
5879/* vec_vminsb */
5880
5881static __inline__ vector signed char __ATTRS_o_ai
5882vec_vminsb(vector signed char __a, vector signed char __b) {
5883 return __builtin_altivec_vminsb(__a, __b);
5884}
5885
5886static __inline__ vector signed char __ATTRS_o_ai
5887vec_vminsb(vector bool char __a, vector signed char __b) {
5888 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5889}
5890
5891static __inline__ vector signed char __ATTRS_o_ai
5892vec_vminsb(vector signed char __a, vector bool char __b) {
5893 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5894}
5895
5896/* vec_vminub */
5897
5898static __inline__ vector unsigned char __ATTRS_o_ai
5899vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5900 return __builtin_altivec_vminub(__a, __b);
5901}
5902
5903static __inline__ vector unsigned char __ATTRS_o_ai
5904vec_vminub(vector bool char __a, vector unsigned char __b) {
5905 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5906}
5907
5908static __inline__ vector unsigned char __ATTRS_o_ai
5909vec_vminub(vector unsigned char __a, vector bool char __b) {
5910 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5911}
5912
5913/* vec_vminsh */
5914
5915static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5916 vector short __b) {
5917 return __builtin_altivec_vminsh(__a, __b);
5918}
5919
5920static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5921 vector short __b) {
5922 return __builtin_altivec_vminsh((vector short)__a, __b);
5923}
5924
5925static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5926 vector bool short __b) {
5927 return __builtin_altivec_vminsh(__a, (vector short)__b);
5928}
5929
5930/* vec_vminuh */
5931
5932static __inline__ vector unsigned short __ATTRS_o_ai
5933vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5934 return __builtin_altivec_vminuh(__a, __b);
5935}
5936
5937static __inline__ vector unsigned short __ATTRS_o_ai
5938vec_vminuh(vector bool short __a, vector unsigned short __b) {
5939 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5940}
5941
5942static __inline__ vector unsigned short __ATTRS_o_ai
5943vec_vminuh(vector unsigned short __a, vector bool short __b) {
5944 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5945}
5946
5947/* vec_vminsw */
5948
5949static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5950 vector int __b) {
5951 return __builtin_altivec_vminsw(__a, __b);
5952}
5953
5954static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5955 vector int __b) {
5956 return __builtin_altivec_vminsw((vector int)__a, __b);
5957}
5958
5959static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5960 vector bool int __b) {
5961 return __builtin_altivec_vminsw(__a, (vector int)__b);
5962}
5963
5964/* vec_vminuw */
5965
5966static __inline__ vector unsigned int __ATTRS_o_ai
5967vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5968 return __builtin_altivec_vminuw(__a, __b);
5969}
5970
5971static __inline__ vector unsigned int __ATTRS_o_ai
5972vec_vminuw(vector bool int __a, vector unsigned int __b) {
5973 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5974}
5975
5976static __inline__ vector unsigned int __ATTRS_o_ai
5977vec_vminuw(vector unsigned int __a, vector bool int __b) {
5978 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5979}
5980
5981/* vec_vminfp */
5982
5983static __inline__ vector float __attribute__((__always_inline__))
5984vec_vminfp(vector float __a, vector float __b) {
5985#ifdef __VSX__
5986 return __builtin_vsx_xvminsp(__a, __b);
5987#else
5988 return __builtin_altivec_vminfp(__a, __b);
5989#endif
5990}
5991
5992/* vec_mladd */
5993
5994#define __builtin_altivec_vmladduhm vec_mladd
5995
5996static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5997 vector short __b,
5998 vector short __c) {
5999 return __a * __b + __c;
6000}
6001
6002static __inline__ vector short __ATTRS_o_ai vec_mladd(
6003 vector short __a, vector unsigned short __b, vector unsigned short __c) {
6004 return __a * (vector short)__b + (vector short)__c;
6005}
6006
6007static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
6008 vector short __b,
6009 vector short __c) {
6010 return (vector short)__a * __b + __c;
6011}
6012
6013static __inline__ vector unsigned short __ATTRS_o_ai
6014vec_mladd(vector unsigned short __a, vector unsigned short __b,
6015 vector unsigned short __c) {
6016 return __a * __b + __c;
6017}
6018
6019/* vec_vmladduhm */
6020
6021static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
6022 vector short __b,
6023 vector short __c) {
6024 return __a * __b + __c;
6025}
6026
6027static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
6028 vector short __a, vector unsigned short __b, vector unsigned short __c) {
6029 return __a * (vector short)__b + (vector short)__c;
6030}
6031
6032static __inline__ vector short __ATTRS_o_ai
6033vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
6034 return (vector short)__a * __b + __c;
6035}
6036
6037static __inline__ vector unsigned short __ATTRS_o_ai
6038vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
6039 vector unsigned short __c) {
6040 return __a * __b + __c;
6041}
6042
6043/* vec_mradds */
6044
6045static __inline__ vector short __attribute__((__always_inline__))
6046vec_mradds(vector short __a, vector short __b, vector short __c) {
6047 return __builtin_altivec_vmhraddshs(__a, __b, __c);
6048}
6049
6050/* vec_vmhraddshs */
6051
6052static __inline__ vector short __attribute__((__always_inline__))
6053vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
6054 return __builtin_altivec_vmhraddshs(__a, __b, __c);
6055}
6056
6057/* vec_msum */
6058
6059static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
6060 vector unsigned char __b,
6061 vector int __c) {
6062 return __builtin_altivec_vmsummbm(__a, __b, __c);
6063}
6064
6065static __inline__ vector unsigned int __ATTRS_o_ai
6066vec_msum(vector unsigned char __a, vector unsigned char __b,
6067 vector unsigned int __c) {
6068 return __builtin_altivec_vmsumubm(__a, __b, __c);
6069}
6070
6071static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
6072 vector short __b,
6073 vector int __c) {
6074 return __builtin_altivec_vmsumshm(__a, __b, __c);
6075}
6076
6077static __inline__ vector unsigned int __ATTRS_o_ai
6078vec_msum(vector unsigned short __a, vector unsigned short __b,
6079 vector unsigned int __c) {
6080 return __builtin_altivec_vmsumuhm(__a, __b, __c);
6081}
6082
6083#if defined(__POWER9_VECTOR__) && defined(__SIZEOF_INT128__)
6084static __inline__ vector unsigned __int128
6085 __ATTRS_o_ai vec_msum(vector unsigned long long __a,
6086 vector unsigned long long __b,
6087 vector unsigned __int128 __c) {
6088 return __builtin_altivec_vmsumudm(__a, __b, __c);
6089}
6090#endif
6091
6092/* vec_msumc */
6093
6094#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6095static __inline__ vector unsigned __int128 __ATTRS_o_ai
6096vec_msumc(vector unsigned long long __a, vector unsigned long long __b,
6097 vector unsigned __int128 __c) {
6098 return __builtin_altivec_vmsumcud(__a, __b, __c);
6099}
6100#endif
6101
6102/* vec_vmsummbm */
6103
6104static __inline__ vector int __attribute__((__always_inline__))
6105vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
6106 return __builtin_altivec_vmsummbm(__a, __b, __c);
6107}
6108
6109/* vec_vmsumubm */
6110
6111static __inline__ vector unsigned int __attribute__((__always_inline__))
6112vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
6113 vector unsigned int __c) {
6114 return __builtin_altivec_vmsumubm(__a, __b, __c);
6115}
6116
6117/* vec_vmsumshm */
6118
6119static __inline__ vector int __attribute__((__always_inline__))
6120vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
6121 return __builtin_altivec_vmsumshm(__a, __b, __c);
6122}
6123
6124/* vec_vmsumuhm */
6125
6126static __inline__ vector unsigned int __attribute__((__always_inline__))
6127vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
6128 vector unsigned int __c) {
6129 return __builtin_altivec_vmsumuhm(__a, __b, __c);
6130}
6131
6132/* vec_msums */
6133
6134static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
6135 vector short __b,
6136 vector int __c) {
6137 return __builtin_altivec_vmsumshs(__a, __b, __c);
6138}
6139
6140static __inline__ vector unsigned int __ATTRS_o_ai
6141vec_msums(vector unsigned short __a, vector unsigned short __b,
6142 vector unsigned int __c) {
6143 return __builtin_altivec_vmsumuhs(__a, __b, __c);
6144}
6145
6146/* vec_vmsumshs */
6147
6148static __inline__ vector int __attribute__((__always_inline__))
6149vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
6150 return __builtin_altivec_vmsumshs(__a, __b, __c);
6151}
6152
6153/* vec_vmsumuhs */
6154
6155static __inline__ vector unsigned int __attribute__((__always_inline__))
6156vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
6157 vector unsigned int __c) {
6158 return __builtin_altivec_vmsumuhs(__a, __b, __c);
6159}
6160
6161#if defined(__POWER9_VECTOR__) && defined(__SIZEOF_INT128__)
6162/* vec_vmsumudm */
6163
6164static __inline__ vector unsigned __int128 __attribute__((__always_inline__))
6165vec_vmsumudm(vector unsigned long long __a, vector unsigned long long __b,
6166 vector unsigned __int128 __c) {
6167 return __builtin_altivec_vmsumudm(__a, __b, __c);
6168}
6169#endif
6170
6171/* vec_mtvscr */
6172
6173static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
6174 __builtin_altivec_mtvscr((vector int)__a);
6175}
6176
6177static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
6178 __builtin_altivec_mtvscr((vector int)__a);
6179}
6180
6181static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
6182 __builtin_altivec_mtvscr((vector int)__a);
6183}
6184
6185static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
6186 __builtin_altivec_mtvscr((vector int)__a);
6187}
6188
6189static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
6190 __builtin_altivec_mtvscr((vector int)__a);
6191}
6192
6193static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
6194 __builtin_altivec_mtvscr((vector int)__a);
6195}
6196
6197static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
6198 __builtin_altivec_mtvscr((vector int)__a);
6199}
6200
6201static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
6202 __builtin_altivec_mtvscr((vector int)__a);
6203}
6204
6205static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
6206 __builtin_altivec_mtvscr((vector int)__a);
6207}
6208
6209static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
6210 __builtin_altivec_mtvscr((vector int)__a);
6211}
6212
6213static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
6214 __builtin_altivec_mtvscr((vector int)__a);
6215}
6216
6217/* vec_mul */
6218
6219/* Integer vector multiplication will involve multiplication of the odd/even
6220 elements separately, then truncating the results and moving to the
6221 result vector.
6222*/
6223static __inline__ vector signed char __ATTRS_o_ai
6224vec_mul(vector signed char __a, vector signed char __b) {
6225 return __a * __b;
6226}
6227
6228static __inline__ vector unsigned char __ATTRS_o_ai
6229vec_mul(vector unsigned char __a, vector unsigned char __b) {
6230 return __a * __b;
6231}
6232
6233static __inline__ vector signed short __ATTRS_o_ai
6234vec_mul(vector signed short __a, vector signed short __b) {
6235 return __a * __b;
6236}
6237
6238static __inline__ vector unsigned short __ATTRS_o_ai
6239vec_mul(vector unsigned short __a, vector unsigned short __b) {
6240 return __a * __b;
6241}
6242
6243static __inline__ vector signed int __ATTRS_o_ai
6244vec_mul(vector signed int __a, vector signed int __b) {
6245 return __a * __b;
6246}
6247
6248static __inline__ vector unsigned int __ATTRS_o_ai
6249vec_mul(vector unsigned int __a, vector unsigned int __b) {
6250 return __a * __b;
6251}
6252
6253#ifdef __VSX__
6254static __inline__ vector signed long long __ATTRS_o_ai
6255vec_mul(vector signed long long __a, vector signed long long __b) {
6256 return __a * __b;
6257}
6258
6259static __inline__ vector unsigned long long __ATTRS_o_ai
6260vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
6261 return __a * __b;
6262}
6263#endif
6264
6265static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
6266 vector float __b) {
6267 return __a * __b;
6268}
6269
6270#ifdef __VSX__
6271static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
6272 vector double __b) {
6273 return __a * __b;
6274}
6275#endif
6276
6277/* The vmulos* and vmules* instructions have a big endian bias, so
6278 we must reverse the meaning of "even" and "odd" for little endian. */
6279
6280/* vec_mule */
6281
6282static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
6283 vector signed char __b) {
6284#ifdef __LITTLE_ENDIAN__
6285 return __builtin_altivec_vmulosb(__a, __b);
6286#else
6287 return __builtin_altivec_vmulesb(__a, __b);
6288#endif
6289}
6290
6291static __inline__ vector unsigned short __ATTRS_o_ai
6292vec_mule(vector unsigned char __a, vector unsigned char __b) {
6293#ifdef __LITTLE_ENDIAN__
6294 return __builtin_altivec_vmuloub(__a, __b);
6295#else
6296 return __builtin_altivec_vmuleub(__a, __b);
6297#endif
6298}
6299
6300static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
6301 vector short __b) {
6302#ifdef __LITTLE_ENDIAN__
6303 return __builtin_altivec_vmulosh(__a, __b);
6304#else
6305 return __builtin_altivec_vmulesh(__a, __b);
6306#endif
6307}
6308
6309static __inline__ vector unsigned int __ATTRS_o_ai
6310vec_mule(vector unsigned short __a, vector unsigned short __b) {
6311#ifdef __LITTLE_ENDIAN__
6312 return __builtin_altivec_vmulouh(__a, __b);
6313#else
6314 return __builtin_altivec_vmuleuh(__a, __b);
6315#endif
6316}
6317
6318#ifdef __POWER8_VECTOR__
6319static __inline__ vector signed long long __ATTRS_o_ai
6320vec_mule(vector signed int __a, vector signed int __b) {
6321#ifdef __LITTLE_ENDIAN__
6322 return __builtin_altivec_vmulosw(__a, __b);
6323#else
6324 return __builtin_altivec_vmulesw(__a, __b);
6325#endif
6326}
6327
6328static __inline__ vector unsigned long long __ATTRS_o_ai
6329vec_mule(vector unsigned int __a, vector unsigned int __b) {
6330#ifdef __LITTLE_ENDIAN__
6331 return __builtin_altivec_vmulouw(__a, __b);
6332#else
6333 return __builtin_altivec_vmuleuw(__a, __b);
6334#endif
6335}
6336#endif
6337
6338#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6339static __inline__ vector signed __int128 __ATTRS_o_ai
6340vec_mule(vector signed long long __a, vector signed long long __b) {
6341#ifdef __LITTLE_ENDIAN__
6342 return __builtin_altivec_vmulosd(__a, __b);
6343#else
6344 return __builtin_altivec_vmulesd(__a, __b);
6345#endif
6346}
6347
6348static __inline__ vector unsigned __int128 __ATTRS_o_ai
6349vec_mule(vector unsigned long long __a, vector unsigned long long __b) {
6350#ifdef __LITTLE_ENDIAN__
6351 return __builtin_altivec_vmuloud(__a, __b);
6352#else
6353 return __builtin_altivec_vmuleud(__a, __b);
6354#endif
6355}
6356#endif
6357
6358/* vec_vmulesb */
6359
6360static __inline__ vector short __attribute__((__always_inline__))
6361vec_vmulesb(vector signed char __a, vector signed char __b) {
6362#ifdef __LITTLE_ENDIAN__
6363 return __builtin_altivec_vmulosb(__a, __b);
6364#else
6365 return __builtin_altivec_vmulesb(__a, __b);
6366#endif
6367}
6368
6369/* vec_vmuleub */
6370
6371static __inline__ vector unsigned short __attribute__((__always_inline__))
6372vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
6373#ifdef __LITTLE_ENDIAN__
6374 return __builtin_altivec_vmuloub(__a, __b);
6375#else
6376 return __builtin_altivec_vmuleub(__a, __b);
6377#endif
6378}
6379
6380/* vec_vmulesh */
6381
6382static __inline__ vector int __attribute__((__always_inline__))
6383vec_vmulesh(vector short __a, vector short __b) {
6384#ifdef __LITTLE_ENDIAN__
6385 return __builtin_altivec_vmulosh(__a, __b);
6386#else
6387 return __builtin_altivec_vmulesh(__a, __b);
6388#endif
6389}
6390
6391/* vec_vmuleuh */
6392
6393static __inline__ vector unsigned int __attribute__((__always_inline__))
6394vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
6395#ifdef __LITTLE_ENDIAN__
6396 return __builtin_altivec_vmulouh(__a, __b);
6397#else
6398 return __builtin_altivec_vmuleuh(__a, __b);
6399#endif
6400}
6401
6402/* vec_mulh */
6403
6404#ifdef __POWER10_VECTOR__
6405static __inline__ vector signed int __ATTRS_o_ai
6406vec_mulh(vector signed int __a, vector signed int __b) {
6407 return __builtin_altivec_vmulhsw(__a, __b);
6408}
6409
6410static __inline__ vector unsigned int __ATTRS_o_ai
6411vec_mulh(vector unsigned int __a, vector unsigned int __b) {
6412 return __builtin_altivec_vmulhuw(__a, __b);
6413}
6414
6415static __inline__ vector signed long long __ATTRS_o_ai
6416vec_mulh(vector signed long long __a, vector signed long long __b) {
6417 return __builtin_altivec_vmulhsd(__a, __b);
6418}
6419
6420static __inline__ vector unsigned long long __ATTRS_o_ai
6421vec_mulh(vector unsigned long long __a, vector unsigned long long __b) {
6422 return __builtin_altivec_vmulhud(__a, __b);
6423}
6424#endif
6425
6426#ifdef __FUTURE_VECTOR__
6427static __inline__ vector signed short
6428 __ATTRS_o_ai vec_mulh(vector signed short __a, vector signed short __b) {
6429 return __builtin_altivec_vmulhsh(__a, __b);
6430}
6431
6432static __inline__ vector unsigned short __ATTRS_o_ai
6433vec_mulh(vector unsigned short __a, vector unsigned short __b) {
6434 return __builtin_altivec_vmulhuh(__a, __b);
6435}
6436#endif
6437
6438/* vec_mulo */
6439
6440static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
6441 vector signed char __b) {
6442#ifdef __LITTLE_ENDIAN__
6443 return __builtin_altivec_vmulesb(__a, __b);
6444#else
6445 return __builtin_altivec_vmulosb(__a, __b);
6446#endif
6447}
6448
6449static __inline__ vector unsigned short __ATTRS_o_ai
6450vec_mulo(vector unsigned char __a, vector unsigned char __b) {
6451#ifdef __LITTLE_ENDIAN__
6452 return __builtin_altivec_vmuleub(__a, __b);
6453#else
6454 return __builtin_altivec_vmuloub(__a, __b);
6455#endif
6456}
6457
6458static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
6459 vector short __b) {
6460#ifdef __LITTLE_ENDIAN__
6461 return __builtin_altivec_vmulesh(__a, __b);
6462#else
6463 return __builtin_altivec_vmulosh(__a, __b);
6464#endif
6465}
6466
6467static __inline__ vector unsigned int __ATTRS_o_ai
6468vec_mulo(vector unsigned short __a, vector unsigned short __b) {
6469#ifdef __LITTLE_ENDIAN__
6470 return __builtin_altivec_vmuleuh(__a, __b);
6471#else
6472 return __builtin_altivec_vmulouh(__a, __b);
6473#endif
6474}
6475
6476#ifdef __POWER8_VECTOR__
6477static __inline__ vector signed long long __ATTRS_o_ai
6478vec_mulo(vector signed int __a, vector signed int __b) {
6479#ifdef __LITTLE_ENDIAN__
6480 return __builtin_altivec_vmulesw(__a, __b);
6481#else
6482 return __builtin_altivec_vmulosw(__a, __b);
6483#endif
6484}
6485
6486static __inline__ vector unsigned long long __ATTRS_o_ai
6487vec_mulo(vector unsigned int __a, vector unsigned int __b) {
6488#ifdef __LITTLE_ENDIAN__
6489 return __builtin_altivec_vmuleuw(__a, __b);
6490#else
6491 return __builtin_altivec_vmulouw(__a, __b);
6492#endif
6493}
6494#endif
6495
6496#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
6497static __inline__ vector signed __int128 __ATTRS_o_ai
6498vec_mulo(vector signed long long __a, vector signed long long __b) {
6499#ifdef __LITTLE_ENDIAN__
6500 return __builtin_altivec_vmulesd(__a, __b);
6501#else
6502 return __builtin_altivec_vmulosd(__a, __b);
6503#endif
6504}
6505
6506static __inline__ vector unsigned __int128 __ATTRS_o_ai
6507vec_mulo(vector unsigned long long __a, vector unsigned long long __b) {
6508#ifdef __LITTLE_ENDIAN__
6509 return __builtin_altivec_vmuleud(__a, __b);
6510#else
6511 return __builtin_altivec_vmuloud(__a, __b);
6512#endif
6513}
6514#endif
6515
6516/* vec_vmulosb */
6517
6518static __inline__ vector short __attribute__((__always_inline__))
6519vec_vmulosb(vector signed char __a, vector signed char __b) {
6520#ifdef __LITTLE_ENDIAN__
6521 return __builtin_altivec_vmulesb(__a, __b);
6522#else
6523 return __builtin_altivec_vmulosb(__a, __b);
6524#endif
6525}
6526
6527/* vec_vmuloub */
6528
6529static __inline__ vector unsigned short __attribute__((__always_inline__))
6530vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
6531#ifdef __LITTLE_ENDIAN__
6532 return __builtin_altivec_vmuleub(__a, __b);
6533#else
6534 return __builtin_altivec_vmuloub(__a, __b);
6535#endif
6536}
6537
6538/* vec_vmulosh */
6539
6540static __inline__ vector int __attribute__((__always_inline__))
6541vec_vmulosh(vector short __a, vector short __b) {
6542#ifdef __LITTLE_ENDIAN__
6543 return __builtin_altivec_vmulesh(__a, __b);
6544#else
6545 return __builtin_altivec_vmulosh(__a, __b);
6546#endif
6547}
6548
6549/* vec_vmulouh */
6550
6551static __inline__ vector unsigned int __attribute__((__always_inline__))
6552vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
6553#ifdef __LITTLE_ENDIAN__
6554 return __builtin_altivec_vmuleuh(__a, __b);
6555#else
6556 return __builtin_altivec_vmulouh(__a, __b);
6557#endif
6558}
6559
6560/* vec_nand */
6561
6562#ifdef __POWER8_VECTOR__
6563static __inline__ vector signed char __ATTRS_o_ai
6564vec_nand(vector signed char __a, vector signed char __b) {
6565 return ~(__a & __b);
6566}
6567
6568static __inline__ vector signed char __ATTRS_o_ai
6569vec_nand(vector signed char __a, vector bool char __b) {
6570 return ~(__a & (vector signed char)__b);
6571}
6572
6573static __inline__ vector signed char __ATTRS_o_ai
6574vec_nand(vector bool char __a, vector signed char __b) {
6575 return (vector signed char)~(__a & (vector bool char)__b);
6576}
6577
6578static __inline__ vector unsigned char __ATTRS_o_ai
6579vec_nand(vector unsigned char __a, vector unsigned char __b) {
6580 return ~(__a & __b);
6581}
6582
6583static __inline__ vector unsigned char __ATTRS_o_ai
6584vec_nand(vector unsigned char __a, vector bool char __b) {
6585 return ~(__a & (vector unsigned char)__b);
6586}
6587
6588static __inline__ vector unsigned char __ATTRS_o_ai
6589vec_nand(vector bool char __a, vector unsigned char __b) {
6590 return (vector unsigned char)~(__a & (vector bool char)__b);
6591}
6592
6593static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
6594 vector bool char __b) {
6595 return ~(__a & __b);
6596}
6597
6598static __inline__ vector signed short __ATTRS_o_ai
6599vec_nand(vector signed short __a, vector signed short __b) {
6600 return ~(__a & __b);
6601}
6602
6603static __inline__ vector signed short __ATTRS_o_ai
6604vec_nand(vector signed short __a, vector bool short __b) {
6605 return ~(__a & (vector signed short)__b);
6606}
6607
6608static __inline__ vector signed short __ATTRS_o_ai
6609vec_nand(vector bool short __a, vector signed short __b) {
6610 return (vector signed short)~(__a & (vector bool short)__b);
6611}
6612
6613static __inline__ vector unsigned short __ATTRS_o_ai
6614vec_nand(vector unsigned short __a, vector unsigned short __b) {
6615 return ~(__a & __b);
6616}
6617
6618static __inline__ vector unsigned short __ATTRS_o_ai
6619vec_nand(vector unsigned short __a, vector bool short __b) {
6620 return ~(__a & (vector unsigned short)__b);
6621}
6622
6623static __inline__ vector bool short __ATTRS_o_ai
6624vec_nand(vector bool short __a, vector bool short __b) {
6625 return ~(__a & __b);
6626}
6627
6628static __inline__ vector signed int __ATTRS_o_ai
6629vec_nand(vector signed int __a, vector signed int __b) {
6630 return ~(__a & __b);
6631}
6632
6633static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
6634 vector bool int __b) {
6635 return ~(__a & (vector signed int)__b);
6636}
6637
6638static __inline__ vector signed int __ATTRS_o_ai
6639vec_nand(vector bool int __a, vector signed int __b) {
6640 return (vector signed int)~(__a & (vector bool int)__b);
6641}
6642
6643static __inline__ vector unsigned int __ATTRS_o_ai
6644vec_nand(vector unsigned int __a, vector unsigned int __b) {
6645 return ~(__a & __b);
6646}
6647
6648static __inline__ vector unsigned int __ATTRS_o_ai
6649vec_nand(vector unsigned int __a, vector bool int __b) {
6650 return ~(__a & (vector unsigned int)__b);
6651}
6652
6653static __inline__ vector unsigned int __ATTRS_o_ai
6654vec_nand(vector bool int __a, vector unsigned int __b) {
6655 return (vector unsigned int)~(__a & (vector bool int)__b);
6656}
6657
6658static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
6659 vector bool int __b) {
6660 return ~(__a & __b);
6661}
6662
6663static __inline__ vector float __ATTRS_o_ai
6664vec_nand(vector float __a, vector float __b) {
6665 return (vector float)(~((vector unsigned int)__a &
6666 (vector unsigned int)__b));
6667}
6668
6669static __inline__ vector signed long long __ATTRS_o_ai
6670vec_nand(vector signed long long __a, vector signed long long __b) {
6671 return ~(__a & __b);
6672}
6673
6674static __inline__ vector signed long long __ATTRS_o_ai
6675vec_nand(vector signed long long __a, vector bool long long __b) {
6676 return ~(__a & (vector signed long long)__b);
6677}
6678
6679static __inline__ vector signed long long __ATTRS_o_ai
6680vec_nand(vector bool long long __a, vector signed long long __b) {
6681 return (vector signed long long)~(__a & (vector bool long long)__b);
6682}
6683
6684static __inline__ vector unsigned long long __ATTRS_o_ai
6685vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
6686 return ~(__a & __b);
6687}
6688
6689static __inline__ vector unsigned long long __ATTRS_o_ai
6690vec_nand(vector unsigned long long __a, vector bool long long __b) {
6691 return ~(__a & (vector unsigned long long)__b);
6692}
6693
6694static __inline__ vector unsigned long long __ATTRS_o_ai
6695vec_nand(vector bool long long __a, vector unsigned long long __b) {
6696 return (vector unsigned long long)~(__a & (vector bool long long)__b);
6697}
6698
6699static __inline__ vector bool long long __ATTRS_o_ai
6700vec_nand(vector bool long long __a, vector bool long long __b) {
6701 return ~(__a & __b);
6702}
6703
6704static __inline__ vector double __ATTRS_o_ai
6705vec_nand(vector double __a, vector double __b) {
6706 return (vector double)(~((vector unsigned long long)__a &
6707 (vector unsigned long long)__b));
6708}
6709
6710#endif
6711
6712/* vec_nmadd */
6713
6714#ifdef __VSX__
6715static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6716 vector float __b,
6717 vector float __c) {
6718 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6719}
6720
6721static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6722 vector double __b,
6723 vector double __c) {
6724 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6725}
6726#endif
6727
6728/* vec_nmsub */
6729
6730static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6731 vector float __b,
6732 vector float __c) {
6733#ifdef __VSX__
6734 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6735#else
6736 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6737#endif
6738}
6739
6740#ifdef __VSX__
6741static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6742 vector double __b,
6743 vector double __c) {
6744 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6745}
6746#endif
6747
6748/* vec_vnmsubfp */
6749
6750static __inline__ vector float __attribute__((__always_inline__))
6751vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6752 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6753}
6754
6755/* vec_nor */
6756
6757#define __builtin_altivec_vnor vec_nor
6758
6759static __inline__ vector signed char __ATTRS_o_ai
6760vec_nor(vector signed char __a, vector signed char __b) {
6761 return ~(__a | __b);
6762}
6763
6764static __inline__ vector unsigned char __ATTRS_o_ai
6765vec_nor(vector unsigned char __a, vector unsigned char __b) {
6766 return ~(__a | __b);
6767}
6768
6769static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6770 vector bool char __b) {
6771 return ~(__a | __b);
6772}
6773
6774static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6775 vector short __b) {
6776 return ~(__a | __b);
6777}
6778
6779static __inline__ vector unsigned short __ATTRS_o_ai
6780vec_nor(vector unsigned short __a, vector unsigned short __b) {
6781 return ~(__a | __b);
6782}
6783
6784static __inline__ vector bool short __ATTRS_o_ai
6785vec_nor(vector bool short __a, vector bool short __b) {
6786 return ~(__a | __b);
6787}
6788
6789static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6790 vector int __b) {
6791 return ~(__a | __b);
6792}
6793
6794static __inline__ vector unsigned int __ATTRS_o_ai
6795vec_nor(vector unsigned int __a, vector unsigned int __b) {
6796 return ~(__a | __b);
6797}
6798
6799static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6800 vector bool int __b) {
6801 return ~(__a | __b);
6802}
6803
6804static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6805 vector float __b) {
6806 vector unsigned int __res =
6807 ~((vector unsigned int)__a | (vector unsigned int)__b);
6808 return (vector float)__res;
6809}
6810
6811#ifdef __VSX__
6812static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6813 vector double __b) {
6814 vector unsigned long long __res =
6815 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6816 return (vector double)__res;
6817}
6818#endif
6819
6820/* vec_vnor */
6821
6822static __inline__ vector signed char __ATTRS_o_ai
6823vec_vnor(vector signed char __a, vector signed char __b) {
6824 return ~(__a | __b);
6825}
6826
6827static __inline__ vector unsigned char __ATTRS_o_ai
6828vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6829 return ~(__a | __b);
6830}
6831
6832static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6833 vector bool char __b) {
6834 return ~(__a | __b);
6835}
6836
6837static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6838 vector short __b) {
6839 return ~(__a | __b);
6840}
6841
6842static __inline__ vector unsigned short __ATTRS_o_ai
6843vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6844 return ~(__a | __b);
6845}
6846
6847static __inline__ vector bool short __ATTRS_o_ai
6848vec_vnor(vector bool short __a, vector bool short __b) {
6849 return ~(__a | __b);
6850}
6851
6852static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6853 vector int __b) {
6854 return ~(__a | __b);
6855}
6856
6857static __inline__ vector unsigned int __ATTRS_o_ai
6858vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6859 return ~(__a | __b);
6860}
6861
6862static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6863 vector bool int __b) {
6864 return ~(__a | __b);
6865}
6866
6867static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6868 vector float __b) {
6869 vector unsigned int __res =
6870 ~((vector unsigned int)__a | (vector unsigned int)__b);
6871 return (vector float)__res;
6872}
6873
6874#ifdef __VSX__
6875static __inline__ vector signed long long __ATTRS_o_ai
6876vec_nor(vector signed long long __a, vector signed long long __b) {
6877 return ~(__a | __b);
6878}
6879
6880static __inline__ vector unsigned long long __ATTRS_o_ai
6881vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6882 return ~(__a | __b);
6883}
6884
6885static __inline__ vector bool long long __ATTRS_o_ai
6886vec_nor(vector bool long long __a, vector bool long long __b) {
6887 return ~(__a | __b);
6888}
6889#endif
6890
6891/* vec_or */
6892
6893#define __builtin_altivec_vor vec_or
6894
6895static __inline__ vector signed char __ATTRS_o_ai
6896vec_or(vector signed char __a, vector signed char __b) {
6897 return __a | __b;
6898}
6899
6900static __inline__ vector signed char __ATTRS_o_ai
6901vec_or(vector bool char __a, vector signed char __b) {
6902 return (vector signed char)__a | __b;
6903}
6904
6905static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6906 vector bool char __b) {
6907 return __a | (vector signed char)__b;
6908}
6909
6910static __inline__ vector unsigned char __ATTRS_o_ai
6911vec_or(vector unsigned char __a, vector unsigned char __b) {
6912 return __a | __b;
6913}
6914
6915static __inline__ vector unsigned char __ATTRS_o_ai
6916vec_or(vector bool char __a, vector unsigned char __b) {
6917 return (vector unsigned char)__a | __b;
6918}
6919
6920static __inline__ vector unsigned char __ATTRS_o_ai
6921vec_or(vector unsigned char __a, vector bool char __b) {
6922 return __a | (vector unsigned char)__b;
6923}
6924
6925static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6926 vector bool char __b) {
6927 return __a | __b;
6928}
6929
6930static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6931 vector short __b) {
6932 return __a | __b;
6933}
6934
6935static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6936 vector short __b) {
6937 return (vector short)__a | __b;
6938}
6939
6940static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6941 vector bool short __b) {
6942 return __a | (vector short)__b;
6943}
6944
6945static __inline__ vector unsigned short __ATTRS_o_ai
6946vec_or(vector unsigned short __a, vector unsigned short __b) {
6947 return __a | __b;
6948}
6949
6950static __inline__ vector unsigned short __ATTRS_o_ai
6951vec_or(vector bool short __a, vector unsigned short __b) {
6952 return (vector unsigned short)__a | __b;
6953}
6954
6955static __inline__ vector unsigned short __ATTRS_o_ai
6956vec_or(vector unsigned short __a, vector bool short __b) {
6957 return __a | (vector unsigned short)__b;
6958}
6959
6960static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6961 vector bool short __b) {
6962 return __a | __b;
6963}
6964
6965static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6966 vector int __b) {
6967 return __a | __b;
6968}
6969
6970static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6971 vector int __b) {
6972 return (vector int)__a | __b;
6973}
6974
6975static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6976 vector bool int __b) {
6977 return __a | (vector int)__b;
6978}
6979
6980static __inline__ vector unsigned int __ATTRS_o_ai
6981vec_or(vector unsigned int __a, vector unsigned int __b) {
6982 return __a | __b;
6983}
6984
6985static __inline__ vector unsigned int __ATTRS_o_ai
6986vec_or(vector bool int __a, vector unsigned int __b) {
6987 return (vector unsigned int)__a | __b;
6988}
6989
6990static __inline__ vector unsigned int __ATTRS_o_ai
6991vec_or(vector unsigned int __a, vector bool int __b) {
6992 return __a | (vector unsigned int)__b;
6993}
6994
6995static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6996 vector bool int __b) {
6997 return __a | __b;
6998}
6999
7000static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
7001 vector float __b) {
7002 vector unsigned int __res =
7003 (vector unsigned int)__a | (vector unsigned int)__b;
7004 return (vector float)__res;
7005}
7006
7007static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
7008 vector float __b) {
7009 vector unsigned int __res =
7010 (vector unsigned int)__a | (vector unsigned int)__b;
7011 return (vector float)__res;
7012}
7013
7014static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
7015 vector bool int __b) {
7016 vector unsigned int __res =
7017 (vector unsigned int)__a | (vector unsigned int)__b;
7018 return (vector float)__res;
7019}
7020
7021#ifdef __VSX__
7022static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
7023 vector double __b) {
7024 return (vector double)((vector unsigned long long)__a |
7025 (vector unsigned long long)__b);
7026}
7027
7028static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
7029 vector bool long long __b) {
7030 return (vector double)((vector unsigned long long)__a |
7031 (vector unsigned long long)__b);
7032}
7033
7034static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
7035 vector double __b) {
7036 return (vector double)((vector unsigned long long)__a |
7037 (vector unsigned long long)__b);
7038}
7039
7040static __inline__ vector signed long long __ATTRS_o_ai
7041vec_or(vector signed long long __a, vector signed long long __b) {
7042 return __a | __b;
7043}
7044
7045static __inline__ vector signed long long __ATTRS_o_ai
7046vec_or(vector bool long long __a, vector signed long long __b) {
7047 return (vector signed long long)__a | __b;
7048}
7049
7050static __inline__ vector signed long long __ATTRS_o_ai
7051vec_or(vector signed long long __a, vector bool long long __b) {
7052 return __a | (vector signed long long)__b;
7053}
7054
7055static __inline__ vector unsigned long long __ATTRS_o_ai
7056vec_or(vector unsigned long long __a, vector unsigned long long __b) {
7057 return __a | __b;
7058}
7059
7060static __inline__ vector unsigned long long __ATTRS_o_ai
7061vec_or(vector bool long long __a, vector unsigned long long __b) {
7062 return (vector unsigned long long)__a | __b;
7063}
7064
7065static __inline__ vector unsigned long long __ATTRS_o_ai
7066vec_or(vector unsigned long long __a, vector bool long long __b) {
7067 return __a | (vector unsigned long long)__b;
7068}
7069
7070static __inline__ vector bool long long __ATTRS_o_ai
7071vec_or(vector bool long long __a, vector bool long long __b) {
7072 return __a | __b;
7073}
7074#endif
7075
7076#ifdef __POWER8_VECTOR__
7077static __inline__ vector signed char __ATTRS_o_ai
7078vec_orc(vector signed char __a, vector signed char __b) {
7079 return __a | ~__b;
7080}
7081
7082static __inline__ vector signed char __ATTRS_o_ai
7083vec_orc(vector signed char __a, vector bool char __b) {
7084 return __a | (vector signed char)~__b;
7085}
7086
7087static __inline__ vector signed char __ATTRS_o_ai
7088vec_orc(vector bool char __a, vector signed char __b) {
7089 return (vector signed char)(__a | (vector bool char)~__b);
7090}
7091
7092static __inline__ vector unsigned char __ATTRS_o_ai
7093vec_orc(vector unsigned char __a, vector unsigned char __b) {
7094 return __a | ~__b;
7095}
7096
7097static __inline__ vector unsigned char __ATTRS_o_ai
7098vec_orc(vector unsigned char __a, vector bool char __b) {
7099 return __a | (vector unsigned char)~__b;
7100}
7101
7102static __inline__ vector unsigned char __ATTRS_o_ai
7103vec_orc(vector bool char __a, vector unsigned char __b) {
7104 return (vector unsigned char)(__a | (vector bool char)~__b);
7105}
7106
7107static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
7108 vector bool char __b) {
7109 return __a | ~__b;
7110}
7111
7112static __inline__ vector signed short __ATTRS_o_ai
7113vec_orc(vector signed short __a, vector signed short __b) {
7114 return __a | ~__b;
7115}
7116
7117static __inline__ vector signed short __ATTRS_o_ai
7118vec_orc(vector signed short __a, vector bool short __b) {
7119 return __a | (vector signed short)~__b;
7120}
7121
7122static __inline__ vector signed short __ATTRS_o_ai
7123vec_orc(vector bool short __a, vector signed short __b) {
7124 return (vector signed short)(__a | (vector bool short)~__b);
7125}
7126
7127static __inline__ vector unsigned short __ATTRS_o_ai
7128vec_orc(vector unsigned short __a, vector unsigned short __b) {
7129 return __a | ~__b;
7130}
7131
7132static __inline__ vector unsigned short __ATTRS_o_ai
7133vec_orc(vector unsigned short __a, vector bool short __b) {
7134 return __a | (vector unsigned short)~__b;
7135}
7136
7137static __inline__ vector unsigned short __ATTRS_o_ai
7138vec_orc(vector bool short __a, vector unsigned short __b) {
7139 return (vector unsigned short)(__a | (vector bool short)~__b);
7140}
7141
7142static __inline__ vector bool short __ATTRS_o_ai
7143vec_orc(vector bool short __a, vector bool short __b) {
7144 return __a | ~__b;
7145}
7146
7147static __inline__ vector signed int __ATTRS_o_ai
7148vec_orc(vector signed int __a, vector signed int __b) {
7149 return __a | ~__b;
7150}
7151
7152static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
7153 vector bool int __b) {
7154 return __a | (vector signed int)~__b;
7155}
7156
7157static __inline__ vector signed int __ATTRS_o_ai
7158vec_orc(vector bool int __a, vector signed int __b) {
7159 return (vector signed int)(__a | (vector bool int)~__b);
7160}
7161
7162static __inline__ vector unsigned int __ATTRS_o_ai
7163vec_orc(vector unsigned int __a, vector unsigned int __b) {
7164 return __a | ~__b;
7165}
7166
7167static __inline__ vector unsigned int __ATTRS_o_ai
7168vec_orc(vector unsigned int __a, vector bool int __b) {
7169 return __a | (vector unsigned int)~__b;
7170}
7171
7172static __inline__ vector unsigned int __ATTRS_o_ai
7173vec_orc(vector bool int __a, vector unsigned int __b) {
7174 return (vector unsigned int)(__a | (vector bool int)~__b);
7175}
7176
7177static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
7178 vector bool int __b) {
7179 return __a | ~__b;
7180}
7181
7182static __inline__ vector float __ATTRS_o_ai
7183vec_orc(vector bool int __a, vector float __b) {
7184 return (vector float)(__a | ~(vector bool int)__b);
7185}
7186
7187static __inline__ vector float __ATTRS_o_ai
7188vec_orc(vector float __a, vector bool int __b) {
7189 return (vector float)((vector bool int)__a | ~__b);
7190}
7191
7192static __inline__ vector float __ATTRS_o_ai vec_orc(vector float __a,
7193 vector float __b) {
7194 return (vector float)((vector unsigned int)__a | ~(vector unsigned int)__b);
7195}
7196
7197static __inline__ vector signed long long __ATTRS_o_ai
7198vec_orc(vector signed long long __a, vector signed long long __b) {
7199 return __a | ~__b;
7200}
7201
7202static __inline__ vector signed long long __ATTRS_o_ai
7203vec_orc(vector signed long long __a, vector bool long long __b) {
7204 return __a | (vector signed long long)~__b;
7205}
7206
7207static __inline__ vector signed long long __ATTRS_o_ai
7208vec_orc(vector bool long long __a, vector signed long long __b) {
7209 return (vector signed long long)(__a | (vector bool long long)~__b);
7210}
7211
7212static __inline__ vector unsigned long long __ATTRS_o_ai
7213vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
7214 return __a | ~__b;
7215}
7216
7217static __inline__ vector unsigned long long __ATTRS_o_ai
7218vec_orc(vector unsigned long long __a, vector bool long long __b) {
7219 return __a | (vector unsigned long long)~__b;
7220}
7221
7222static __inline__ vector unsigned long long __ATTRS_o_ai
7223vec_orc(vector bool long long __a, vector unsigned long long __b) {
7224 return (vector unsigned long long)(__a | (vector bool long long)~__b);
7225}
7226
7227static __inline__ vector bool long long __ATTRS_o_ai
7228vec_orc(vector bool long long __a, vector bool long long __b) {
7229 return __a | ~__b;
7230}
7231
7232static __inline__ vector double __ATTRS_o_ai
7233vec_orc(vector double __a, vector bool long long __b) {
7234 return (vector double)((vector bool long long)__a | ~__b);
7235}
7236
7237static __inline__ vector double __ATTRS_o_ai
7238vec_orc(vector bool long long __a, vector double __b) {
7239 return (vector double)(__a | ~(vector bool long long)__b);
7240}
7241
7242static __inline__ vector double __ATTRS_o_ai vec_orc(vector double __a,
7243 vector double __b) {
7244 return (vector double)((vector unsigned long long)__a |
7245 ~(vector unsigned long long)__b);
7246}
7247#endif
7248
7249/* vec_vor */
7250
7251static __inline__ vector signed char __ATTRS_o_ai
7252vec_vor(vector signed char __a, vector signed char __b) {
7253 return __a | __b;
7254}
7255
7256static __inline__ vector signed char __ATTRS_o_ai
7257vec_vor(vector bool char __a, vector signed char __b) {
7258 return (vector signed char)__a | __b;
7259}
7260
7261static __inline__ vector signed char __ATTRS_o_ai
7262vec_vor(vector signed char __a, vector bool char __b) {
7263 return __a | (vector signed char)__b;
7264}
7265
7266static __inline__ vector unsigned char __ATTRS_o_ai
7267vec_vor(vector unsigned char __a, vector unsigned char __b) {
7268 return __a | __b;
7269}
7270
7271static __inline__ vector unsigned char __ATTRS_o_ai
7272vec_vor(vector bool char __a, vector unsigned char __b) {
7273 return (vector unsigned char)__a | __b;
7274}
7275
7276static __inline__ vector unsigned char __ATTRS_o_ai
7277vec_vor(vector unsigned char __a, vector bool char __b) {
7278 return __a | (vector unsigned char)__b;
7279}
7280
7281static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
7282 vector bool char __b) {
7283 return __a | __b;
7284}
7285
7286static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
7287 vector short __b) {
7288 return __a | __b;
7289}
7290
7291static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
7292 vector short __b) {
7293 return (vector short)__a | __b;
7294}
7295
7296static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
7297 vector bool short __b) {
7298 return __a | (vector short)__b;
7299}
7300
7301static __inline__ vector unsigned short __ATTRS_o_ai
7302vec_vor(vector unsigned short __a, vector unsigned short __b) {
7303 return __a | __b;
7304}
7305
7306static __inline__ vector unsigned short __ATTRS_o_ai
7307vec_vor(vector bool short __a, vector unsigned short __b) {
7308 return (vector unsigned short)__a | __b;
7309}
7310
7311static __inline__ vector unsigned short __ATTRS_o_ai
7312vec_vor(vector unsigned short __a, vector bool short __b) {
7313 return __a | (vector unsigned short)__b;
7314}
7315
7316static __inline__ vector bool short __ATTRS_o_ai
7317vec_vor(vector bool short __a, vector bool short __b) {
7318 return __a | __b;
7319}
7320
7321static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
7322 vector int __b) {
7323 return __a | __b;
7324}
7325
7326static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
7327 vector int __b) {
7328 return (vector int)__a | __b;
7329}
7330
7331static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
7332 vector bool int __b) {
7333 return __a | (vector int)__b;
7334}
7335
7336static __inline__ vector unsigned int __ATTRS_o_ai
7337vec_vor(vector unsigned int __a, vector unsigned int __b) {
7338 return __a | __b;
7339}
7340
7341static __inline__ vector unsigned int __ATTRS_o_ai
7342vec_vor(vector bool int __a, vector unsigned int __b) {
7343 return (vector unsigned int)__a | __b;
7344}
7345
7346static __inline__ vector unsigned int __ATTRS_o_ai
7347vec_vor(vector unsigned int __a, vector bool int __b) {
7348 return __a | (vector unsigned int)__b;
7349}
7350
7351static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
7352 vector bool int __b) {
7353 return __a | __b;
7354}
7355
7356static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
7357 vector float __b) {
7358 vector unsigned int __res =
7359 (vector unsigned int)__a | (vector unsigned int)__b;
7360 return (vector float)__res;
7361}
7362
7363static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
7364 vector float __b) {
7365 vector unsigned int __res =
7366 (vector unsigned int)__a | (vector unsigned int)__b;
7367 return (vector float)__res;
7368}
7369
7370static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
7371 vector bool int __b) {
7372 vector unsigned int __res =
7373 (vector unsigned int)__a | (vector unsigned int)__b;
7374 return (vector float)__res;
7375}
7376
7377#ifdef __VSX__
7378static __inline__ vector signed long long __ATTRS_o_ai
7379vec_vor(vector signed long long __a, vector signed long long __b) {
7380 return __a | __b;
7381}
7382
7383static __inline__ vector signed long long __ATTRS_o_ai
7384vec_vor(vector bool long long __a, vector signed long long __b) {
7385 return (vector signed long long)__a | __b;
7386}
7387
7388static __inline__ vector signed long long __ATTRS_o_ai
7389vec_vor(vector signed long long __a, vector bool long long __b) {
7390 return __a | (vector signed long long)__b;
7391}
7392
7393static __inline__ vector unsigned long long __ATTRS_o_ai
7394vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
7395 return __a | __b;
7396}
7397
7398static __inline__ vector unsigned long long __ATTRS_o_ai
7399vec_vor(vector bool long long __a, vector unsigned long long __b) {
7400 return (vector unsigned long long)__a | __b;
7401}
7402
7403static __inline__ vector unsigned long long __ATTRS_o_ai
7404vec_vor(vector unsigned long long __a, vector bool long long __b) {
7405 return __a | (vector unsigned long long)__b;
7406}
7407
7408static __inline__ vector bool long long __ATTRS_o_ai
7409vec_vor(vector bool long long __a, vector bool long long __b) {
7410 return __a | __b;
7411}
7412#endif
7413
7414/* vec_pack */
7415
7416/* The various vector pack instructions have a big-endian bias, so for
7417 little endian we must handle reversed element numbering. */
7418
7419static __inline__ vector signed char __ATTRS_o_ai
7420vec_pack(vector signed short __a, vector signed short __b) {
7421#ifdef __LITTLE_ENDIAN__
7422 return (vector signed char)vec_perm(
7423 __a, __b,
7424 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7425 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7426#else
7427 return (vector signed char)vec_perm(
7428 __a, __b,
7429 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7430 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7431#endif
7432}
7433
7434static __inline__ vector unsigned char __ATTRS_o_ai
7435vec_pack(vector unsigned short __a, vector unsigned short __b) {
7436#ifdef __LITTLE_ENDIAN__
7437 return (vector unsigned char)vec_perm(
7438 __a, __b,
7439 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7440 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7441#else
7442 return (vector unsigned char)vec_perm(
7443 __a, __b,
7444 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7445 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7446#endif
7447}
7448
7449static __inline__ vector bool char __ATTRS_o_ai
7450vec_pack(vector bool short __a, vector bool short __b) {
7451#ifdef __LITTLE_ENDIAN__
7452 return (vector bool char)vec_perm(
7453 __a, __b,
7454 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7455 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7456#else
7457 return (vector bool char)vec_perm(
7458 __a, __b,
7459 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7460 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7461#endif
7462}
7463
7464static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
7465 vector int __b) {
7466#ifdef __LITTLE_ENDIAN__
7467 return (vector short)vec_perm(
7468 __a, __b,
7469 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7470 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7471#else
7472 return (vector short)vec_perm(
7473 __a, __b,
7474 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7475 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7476#endif
7477}
7478
7479static __inline__ vector unsigned short __ATTRS_o_ai
7480vec_pack(vector unsigned int __a, vector unsigned int __b) {
7481#ifdef __LITTLE_ENDIAN__
7482 return (vector unsigned short)vec_perm(
7483 __a, __b,
7484 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7485 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7486#else
7487 return (vector unsigned short)vec_perm(
7488 __a, __b,
7489 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7490 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7491#endif
7492}
7493
7494static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
7495 vector bool int __b) {
7496#ifdef __LITTLE_ENDIAN__
7497 return (vector bool short)vec_perm(
7498 __a, __b,
7499 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7500 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7501#else
7502 return (vector bool short)vec_perm(
7503 __a, __b,
7504 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7505 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7506#endif
7507}
7508
7509#ifdef __VSX__
7510static __inline__ vector signed int __ATTRS_o_ai
7511vec_pack(vector signed long long __a, vector signed long long __b) {
7512#ifdef __LITTLE_ENDIAN__
7513 return (vector signed int)vec_perm(
7514 __a, __b,
7515 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7516 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7517#else
7518 return (vector signed int)vec_perm(
7519 __a, __b,
7520 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7521 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7522#endif
7523}
7524static __inline__ vector unsigned int __ATTRS_o_ai
7525vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
7526#ifdef __LITTLE_ENDIAN__
7527 return (vector unsigned int)vec_perm(
7528 __a, __b,
7529 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7530 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7531#else
7532 return (vector unsigned int)vec_perm(
7533 __a, __b,
7534 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7535 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7536#endif
7537}
7538
7539static __inline__ vector bool int __ATTRS_o_ai
7540vec_pack(vector bool long long __a, vector bool long long __b) {
7541#ifdef __LITTLE_ENDIAN__
7542 return (vector bool int)vec_perm(
7543 __a, __b,
7544 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7545 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7546#else
7547 return (vector bool int)vec_perm(
7548 __a, __b,
7549 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7550 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7551#endif
7552}
7553
7554static __inline__ vector float __ATTRS_o_ai
7555vec_pack(vector double __a, vector double __b) {
7556 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
7557}
7558#endif
7559
7560#ifdef __POWER9_VECTOR__
7561static __inline__ vector unsigned short __ATTRS_o_ai
7562vec_pack_to_short_fp32(vector float __a, vector float __b) {
7563 vector float __resa = __builtin_vsx_xvcvsphp(__a);
7564 vector float __resb = __builtin_vsx_xvcvsphp(__b);
7565#ifdef __LITTLE_ENDIAN__
7566 return (vector unsigned short)vec_mergee(__resa, __resb);
7567#else
7568 return (vector unsigned short)vec_mergeo(__resa, __resb);
7569#endif
7570}
7571
7572#endif
7573/* vec_vpkuhum */
7574
7575#define __builtin_altivec_vpkuhum vec_vpkuhum
7576
7577static __inline__ vector signed char __ATTRS_o_ai
7578vec_vpkuhum(vector signed short __a, vector signed short __b) {
7579#ifdef __LITTLE_ENDIAN__
7580 return (vector signed char)vec_perm(
7581 __a, __b,
7582 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7583 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7584#else
7585 return (vector signed char)vec_perm(
7586 __a, __b,
7587 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7588 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7589#endif
7590}
7591
7592static __inline__ vector unsigned char __ATTRS_o_ai
7593vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
7594#ifdef __LITTLE_ENDIAN__
7595 return (vector unsigned char)vec_perm(
7596 __a, __b,
7597 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7598 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7599#else
7600 return (vector unsigned char)vec_perm(
7601 __a, __b,
7602 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7603 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7604#endif
7605}
7606
7607static __inline__ vector bool char __ATTRS_o_ai
7608vec_vpkuhum(vector bool short __a, vector bool short __b) {
7609#ifdef __LITTLE_ENDIAN__
7610 return (vector bool char)vec_perm(
7611 __a, __b,
7612 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
7613 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
7614#else
7615 return (vector bool char)vec_perm(
7616 __a, __b,
7617 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
7618 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
7619#endif
7620}
7621
7622/* vec_vpkuwum */
7623
7624#define __builtin_altivec_vpkuwum vec_vpkuwum
7625
7626static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
7627 vector int __b) {
7628#ifdef __LITTLE_ENDIAN__
7629 return (vector short)vec_perm(
7630 __a, __b,
7631 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7632 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7633#else
7634 return (vector short)vec_perm(
7635 __a, __b,
7636 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7637 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7638#endif
7639}
7640
7641static __inline__ vector unsigned short __ATTRS_o_ai
7642vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
7643#ifdef __LITTLE_ENDIAN__
7644 return (vector unsigned short)vec_perm(
7645 __a, __b,
7646 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7647 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7648#else
7649 return (vector unsigned short)vec_perm(
7650 __a, __b,
7651 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7652 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7653#endif
7654}
7655
7656static __inline__ vector bool short __ATTRS_o_ai
7657vec_vpkuwum(vector bool int __a, vector bool int __b) {
7658#ifdef __LITTLE_ENDIAN__
7659 return (vector bool short)vec_perm(
7660 __a, __b,
7661 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
7662 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
7663#else
7664 return (vector bool short)vec_perm(
7665 __a, __b,
7666 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
7667 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
7668#endif
7669}
7670
7671/* vec_vpkudum */
7672
7673#ifdef __POWER8_VECTOR__
7674#define __builtin_altivec_vpkudum vec_vpkudum
7675
7676static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
7677 vector long long __b) {
7678#ifdef __LITTLE_ENDIAN__
7679 return (vector int)vec_perm(
7680 __a, __b,
7681 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7682 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7683#else
7684 return (vector int)vec_perm(
7685 __a, __b,
7686 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7687 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7688#endif
7689}
7690
7691static __inline__ vector unsigned int __ATTRS_o_ai
7692vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
7693#ifdef __LITTLE_ENDIAN__
7694 return (vector unsigned int)vec_perm(
7695 __a, __b,
7696 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7697 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7698#else
7699 return (vector unsigned int)vec_perm(
7700 __a, __b,
7701 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7702 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7703#endif
7704}
7705
7706static __inline__ vector bool int __ATTRS_o_ai
7707vec_vpkudum(vector bool long long __a, vector bool long long __b) {
7708#ifdef __LITTLE_ENDIAN__
7709 return (vector bool int)vec_perm(
7710 (vector long long)__a, (vector long long)__b,
7711 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7712 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7713#else
7714 return (vector bool int)vec_perm(
7715 (vector long long)__a, (vector long long)__b,
7716 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7717 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7718#endif
7719}
7720#endif
7721
7722/* vec_packpx */
7723
7724static __inline__ vector pixel __attribute__((__always_inline__))
7725vec_packpx(vector unsigned int __a, vector unsigned int __b) {
7726#ifdef __LITTLE_ENDIAN__
7727 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7728#else
7729 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7730#endif
7731}
7732
7733/* vec_vpkpx */
7734
7735static __inline__ vector pixel __attribute__((__always_inline__))
7736vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7737#ifdef __LITTLE_ENDIAN__
7738 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7739#else
7740 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7741#endif
7742}
7743
7744/* vec_packs */
7745
7746static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7747 vector short __b) {
7748#ifdef __LITTLE_ENDIAN__
7749 return __builtin_altivec_vpkshss(__b, __a);
7750#else
7751 return __builtin_altivec_vpkshss(__a, __b);
7752#endif
7753}
7754
7755static __inline__ vector unsigned char __ATTRS_o_ai
7756vec_packs(vector unsigned short __a, vector unsigned short __b) {
7757#ifdef __LITTLE_ENDIAN__
7758 return __builtin_altivec_vpkuhus(__b, __a);
7759#else
7760 return __builtin_altivec_vpkuhus(__a, __b);
7761#endif
7762}
7763
7764static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7765 vector int __b) {
7766#ifdef __LITTLE_ENDIAN__
7767 return __builtin_altivec_vpkswss(__b, __a);
7768#else
7769 return __builtin_altivec_vpkswss(__a, __b);
7770#endif
7771}
7772
7773static __inline__ vector unsigned short __ATTRS_o_ai
7774vec_packs(vector unsigned int __a, vector unsigned int __b) {
7775#ifdef __LITTLE_ENDIAN__
7776 return __builtin_altivec_vpkuwus(__b, __a);
7777#else
7778 return __builtin_altivec_vpkuwus(__a, __b);
7779#endif
7780}
7781
7782#ifdef __POWER8_VECTOR__
7783static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7784 vector long long __b) {
7785#ifdef __LITTLE_ENDIAN__
7786 return __builtin_altivec_vpksdss(__b, __a);
7787#else
7788 return __builtin_altivec_vpksdss(__a, __b);
7789#endif
7790}
7791
7792static __inline__ vector unsigned int __ATTRS_o_ai
7793vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7794#ifdef __LITTLE_ENDIAN__
7795 return __builtin_altivec_vpkudus(__b, __a);
7796#else
7797 return __builtin_altivec_vpkudus(__a, __b);
7798#endif
7799}
7800#endif
7801
7802/* vec_vpkshss */
7803
7804static __inline__ vector signed char __attribute__((__always_inline__))
7805vec_vpkshss(vector short __a, vector short __b) {
7806#ifdef __LITTLE_ENDIAN__
7807 return __builtin_altivec_vpkshss(__b, __a);
7808#else
7809 return __builtin_altivec_vpkshss(__a, __b);
7810#endif
7811}
7812
7813/* vec_vpksdss */
7814
7815#ifdef __POWER8_VECTOR__
7816static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7817 vector long long __b) {
7818#ifdef __LITTLE_ENDIAN__
7819 return __builtin_altivec_vpksdss(__b, __a);
7820#else
7821 return __builtin_altivec_vpksdss(__a, __b);
7822#endif
7823}
7824#endif
7825
7826/* vec_vpkuhus */
7827
7828static __inline__ vector unsigned char __attribute__((__always_inline__))
7829vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7830#ifdef __LITTLE_ENDIAN__
7831 return __builtin_altivec_vpkuhus(__b, __a);
7832#else
7833 return __builtin_altivec_vpkuhus(__a, __b);
7834#endif
7835}
7836
7837/* vec_vpkudus */
7838
7839#ifdef __POWER8_VECTOR__
7840static __inline__ vector unsigned int __attribute__((__always_inline__))
7841vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7842#ifdef __LITTLE_ENDIAN__
7843 return __builtin_altivec_vpkudus(__b, __a);
7844#else
7845 return __builtin_altivec_vpkudus(__a, __b);
7846#endif
7847}
7848#endif
7849
7850/* vec_vpkswss */
7851
7852static __inline__ vector signed short __attribute__((__always_inline__))
7853vec_vpkswss(vector int __a, vector int __b) {
7854#ifdef __LITTLE_ENDIAN__
7855 return __builtin_altivec_vpkswss(__b, __a);
7856#else
7857 return __builtin_altivec_vpkswss(__a, __b);
7858#endif
7859}
7860
7861/* vec_vpkuwus */
7862
7863static __inline__ vector unsigned short __attribute__((__always_inline__))
7864vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7865#ifdef __LITTLE_ENDIAN__
7866 return __builtin_altivec_vpkuwus(__b, __a);
7867#else
7868 return __builtin_altivec_vpkuwus(__a, __b);
7869#endif
7870}
7871
7872/* vec_packsu */
7873
7874static __inline__ vector unsigned char __ATTRS_o_ai
7875vec_packsu(vector short __a, vector short __b) {
7876#ifdef __LITTLE_ENDIAN__
7877 return __builtin_altivec_vpkshus(__b, __a);
7878#else
7879 return __builtin_altivec_vpkshus(__a, __b);
7880#endif
7881}
7882
7883static __inline__ vector unsigned char __ATTRS_o_ai
7884vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7885#ifdef __LITTLE_ENDIAN__
7886 return __builtin_altivec_vpkuhus(__b, __a);
7887#else
7888 return __builtin_altivec_vpkuhus(__a, __b);
7889#endif
7890}
7891
7892static __inline__ vector unsigned short __ATTRS_o_ai
7893vec_packsu(vector int __a, vector int __b) {
7894#ifdef __LITTLE_ENDIAN__
7895 return __builtin_altivec_vpkswus(__b, __a);
7896#else
7897 return __builtin_altivec_vpkswus(__a, __b);
7898#endif
7899}
7900
7901static __inline__ vector unsigned short __ATTRS_o_ai
7902vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7903#ifdef __LITTLE_ENDIAN__
7904 return __builtin_altivec_vpkuwus(__b, __a);
7905#else
7906 return __builtin_altivec_vpkuwus(__a, __b);
7907#endif
7908}
7909
7910#ifdef __POWER8_VECTOR__
7911static __inline__ vector unsigned int __ATTRS_o_ai
7912vec_packsu(vector long long __a, vector long long __b) {
7913#ifdef __LITTLE_ENDIAN__
7914 return __builtin_altivec_vpksdus(__b, __a);
7915#else
7916 return __builtin_altivec_vpksdus(__a, __b);
7917#endif
7918}
7919
7920static __inline__ vector unsigned int __ATTRS_o_ai
7921vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7922#ifdef __LITTLE_ENDIAN__
7923 return __builtin_altivec_vpkudus(__b, __a);
7924#else
7925 return __builtin_altivec_vpkudus(__a, __b);
7926#endif
7927}
7928#endif
7929
7930/* vec_vpkshus */
7931
7932static __inline__ vector unsigned char __ATTRS_o_ai
7933vec_vpkshus(vector short __a, vector short __b) {
7934#ifdef __LITTLE_ENDIAN__
7935 return __builtin_altivec_vpkshus(__b, __a);
7936#else
7937 return __builtin_altivec_vpkshus(__a, __b);
7938#endif
7939}
7940
7941static __inline__ vector unsigned char __ATTRS_o_ai
7942vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7943#ifdef __LITTLE_ENDIAN__
7944 return __builtin_altivec_vpkuhus(__b, __a);
7945#else
7946 return __builtin_altivec_vpkuhus(__a, __b);
7947#endif
7948}
7949
7950/* vec_vpkswus */
7951
7952static __inline__ vector unsigned short __ATTRS_o_ai
7953vec_vpkswus(vector int __a, vector int __b) {
7954#ifdef __LITTLE_ENDIAN__
7955 return __builtin_altivec_vpkswus(__b, __a);
7956#else
7957 return __builtin_altivec_vpkswus(__a, __b);
7958#endif
7959}
7960
7961static __inline__ vector unsigned short __ATTRS_o_ai
7962vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7963#ifdef __LITTLE_ENDIAN__
7964 return __builtin_altivec_vpkuwus(__b, __a);
7965#else
7966 return __builtin_altivec_vpkuwus(__a, __b);
7967#endif
7968}
7969
7970/* vec_vpksdus */
7971
7972#ifdef __POWER8_VECTOR__
7973static __inline__ vector unsigned int __ATTRS_o_ai
7974vec_vpksdus(vector long long __a, vector long long __b) {
7975#ifdef __LITTLE_ENDIAN__
7976 return __builtin_altivec_vpksdus(__b, __a);
7977#else
7978 return __builtin_altivec_vpksdus(__a, __b);
7979#endif
7980}
7981#endif
7982
7983/* vec_perm */
7984
7985// The vperm instruction is defined architecturally with a big-endian bias.
7986// For little endian, we swap the input operands and invert the permute
7987// control vector. Only the rightmost 5 bits matter, so we could use
7988// a vector of all 31s instead of all 255s to perform the inversion.
7989// However, when the PCV is not a constant, using 255 has an advantage
7990// in that the vec_xor can be recognized as a vec_nor (and for P8 and
7991// later, possibly a vec_nand).
7992
7993static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7994 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7995#ifdef __LITTLE_ENDIAN__
7996 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7997 255, 255, 255, 255, 255, 255, 255, 255};
7998 __d = vec_xor(__c, __d);
7999 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
8000 (vector int)__a, __d);
8001#else
8002 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
8003 (vector int)__b, __c);
8004#endif
8005}
8006
8007static __inline__ vector unsigned char __ATTRS_o_ai
8008vec_perm(vector unsigned char __a, vector unsigned char __b,
8009 vector unsigned char __c) {
8010#ifdef __LITTLE_ENDIAN__
8011 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8012 255, 255, 255, 255, 255, 255, 255, 255};
8013 __d = vec_xor(__c, __d);
8014 return (vector unsigned char)__builtin_altivec_vperm_4si(
8015 (vector int)__b, (vector int)__a, __d);
8016#else
8017 return (vector unsigned char)__builtin_altivec_vperm_4si(
8018 (vector int)__a, (vector int)__b, __c);
8019#endif
8020}
8021
8022static __inline__ vector bool char __ATTRS_o_ai
8023vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
8024#ifdef __LITTLE_ENDIAN__
8025 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8026 255, 255, 255, 255, 255, 255, 255, 255};
8027 __d = vec_xor(__c, __d);
8028 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
8029 (vector int)__a, __d);
8030#else
8031 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
8032 (vector int)__b, __c);
8033#endif
8034}
8035
8036static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
8037 vector signed short __b,
8038 vector unsigned char __c) {
8039#ifdef __LITTLE_ENDIAN__
8040 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8041 255, 255, 255, 255, 255, 255, 255, 255};
8042 __d = vec_xor(__c, __d);
8043 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
8044 (vector int)__a, __d);
8045#else
8046 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
8047 (vector int)__b, __c);
8048#endif
8049}
8050
8051static __inline__ vector unsigned short __ATTRS_o_ai
8052vec_perm(vector unsigned short __a, vector unsigned short __b,
8053 vector unsigned char __c) {
8054#ifdef __LITTLE_ENDIAN__
8055 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8056 255, 255, 255, 255, 255, 255, 255, 255};
8057 __d = vec_xor(__c, __d);
8058 return (vector unsigned short)__builtin_altivec_vperm_4si(
8059 (vector int)__b, (vector int)__a, __d);
8060#else
8061 return (vector unsigned short)__builtin_altivec_vperm_4si(
8062 (vector int)__a, (vector int)__b, __c);
8063#endif
8064}
8065
8066static __inline__ vector bool short __ATTRS_o_ai vec_perm(
8067 vector bool short __a, vector bool short __b, 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 bool short)__builtin_altivec_vperm_4si((vector int)__b,
8073 (vector int)__a, __d);
8074#else
8075 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
8076 (vector int)__b, __c);
8077#endif
8078}
8079
8080static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
8081 vector pixel __b,
8082 vector unsigned char __c) {
8083#ifdef __LITTLE_ENDIAN__
8084 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8085 255, 255, 255, 255, 255, 255, 255, 255};
8086 __d = vec_xor(__c, __d);
8087 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
8088 (vector int)__a, __d);
8089#else
8090 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
8091 (vector int)__b, __c);
8092#endif
8093}
8094
8095static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
8096 vector signed int __b,
8097 vector unsigned char __c) {
8098#ifdef __LITTLE_ENDIAN__
8099 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8100 255, 255, 255, 255, 255, 255, 255, 255};
8101 __d = vec_xor(__c, __d);
8102 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
8103#else
8104 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
8105#endif
8106}
8107
8108static __inline__ vector unsigned int __ATTRS_o_ai
8109vec_perm(vector unsigned int __a, vector unsigned int __b,
8110 vector unsigned char __c) {
8111#ifdef __LITTLE_ENDIAN__
8112 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8113 255, 255, 255, 255, 255, 255, 255, 255};
8114 __d = vec_xor(__c, __d);
8115 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
8116 (vector int)__a, __d);
8117#else
8118 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
8119 (vector int)__b, __c);
8120#endif
8121}
8122
8123static __inline__ vector bool int __ATTRS_o_ai
8124vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
8125#ifdef __LITTLE_ENDIAN__
8126 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8127 255, 255, 255, 255, 255, 255, 255, 255};
8128 __d = vec_xor(__c, __d);
8129 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
8130 (vector int)__a, __d);
8131#else
8132 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
8133 (vector int)__b, __c);
8134#endif
8135}
8136
8137static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
8138 vector float __b,
8139 vector unsigned char __c) {
8140#ifdef __LITTLE_ENDIAN__
8141 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8142 255, 255, 255, 255, 255, 255, 255, 255};
8143 __d = vec_xor(__c, __d);
8144 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
8145 (vector int)__a, __d);
8146#else
8147 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
8148 (vector int)__b, __c);
8149#endif
8150}
8151
8152#ifdef __VSX__
8153static __inline__ vector long long __ATTRS_o_ai
8154vec_perm(vector signed long long __a, vector signed long long __b,
8155 vector unsigned char __c) {
8156#ifdef __LITTLE_ENDIAN__
8157 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8158 255, 255, 255, 255, 255, 255, 255, 255};
8159 __d = vec_xor(__c, __d);
8160 return (vector signed long long)__builtin_altivec_vperm_4si(
8161 (vector int)__b, (vector int)__a, __d);
8162#else
8163 return (vector signed long long)__builtin_altivec_vperm_4si(
8164 (vector int)__a, (vector int)__b, __c);
8165#endif
8166}
8167
8168static __inline__ vector unsigned long long __ATTRS_o_ai
8169vec_perm(vector unsigned long long __a, vector unsigned long long __b,
8170 vector unsigned char __c) {
8171#ifdef __LITTLE_ENDIAN__
8172 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8173 255, 255, 255, 255, 255, 255, 255, 255};
8174 __d = vec_xor(__c, __d);
8175 return (vector unsigned long long)__builtin_altivec_vperm_4si(
8176 (vector int)__b, (vector int)__a, __d);
8177#else
8178 return (vector unsigned long long)__builtin_altivec_vperm_4si(
8179 (vector int)__a, (vector int)__b, __c);
8180#endif
8181}
8182
8183static __inline__ vector bool long long __ATTRS_o_ai
8184vec_perm(vector bool long long __a, vector bool long long __b,
8185 vector unsigned char __c) {
8186#ifdef __LITTLE_ENDIAN__
8187 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8188 255, 255, 255, 255, 255, 255, 255, 255};
8189 __d = vec_xor(__c, __d);
8190 return (vector bool long long)__builtin_altivec_vperm_4si(
8191 (vector int)__b, (vector int)__a, __d);
8192#else
8193 return (vector bool long long)__builtin_altivec_vperm_4si(
8194 (vector int)__a, (vector int)__b, __c);
8195#endif
8196}
8197
8198static __inline__ vector double __ATTRS_o_ai
8199vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
8200#ifdef __LITTLE_ENDIAN__
8201 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
8202 255, 255, 255, 255, 255, 255, 255, 255};
8203 __d = vec_xor(__c, __d);
8204 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
8205 (vector int)__a, __d);
8206#else
8207 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
8208 (vector int)__b, __c);
8209#endif
8210}
8211#endif
8212
8213/* vec_vperm */
8214
8215static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
8216 vector signed char __a, vector signed char __b, vector unsigned char __c) {
8217 return vec_perm(__a, __b, __c);
8218}
8219
8220static __inline__ vector unsigned char __ATTRS_o_ai
8221vec_vperm(vector unsigned char __a, vector unsigned char __b,
8222 vector unsigned char __c) {
8223 return vec_perm(__a, __b, __c);
8224}
8225
8226static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
8227 vector bool char __a, vector bool char __b, vector unsigned char __c) {
8228 return vec_perm(__a, __b, __c);
8229}
8230
8231static __inline__ vector short __ATTRS_o_ai
8232vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
8233 return vec_perm(__a, __b, __c);
8234}
8235
8236static __inline__ vector unsigned short __ATTRS_o_ai
8237vec_vperm(vector unsigned short __a, vector unsigned short __b,
8238 vector unsigned char __c) {
8239 return vec_perm(__a, __b, __c);
8240}
8241
8242static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
8243 vector bool short __a, vector bool short __b, vector unsigned char __c) {
8244 return vec_perm(__a, __b, __c);
8245}
8246
8247static __inline__ vector pixel __ATTRS_o_ai
8248vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
8249 return vec_perm(__a, __b, __c);
8250}
8251
8252static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
8253 vector int __b,
8254 vector unsigned char __c) {
8255 return vec_perm(__a, __b, __c);
8256}
8257
8258static __inline__ vector unsigned int __ATTRS_o_ai
8259vec_vperm(vector unsigned int __a, vector unsigned int __b,
8260 vector unsigned char __c) {
8261 return vec_perm(__a, __b, __c);
8262}
8263
8264static __inline__ vector bool int __ATTRS_o_ai
8265vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
8266 return vec_perm(__a, __b, __c);
8267}
8268
8269static __inline__ vector float __ATTRS_o_ai
8270vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
8271 return vec_perm(__a, __b, __c);
8272}
8273
8274#ifdef __VSX__
8275static __inline__ vector long long __ATTRS_o_ai vec_vperm(
8276 vector long long __a, vector long long __b, vector unsigned char __c) {
8277 return vec_perm(__a, __b, __c);
8278}
8279
8280static __inline__ vector unsigned long long __ATTRS_o_ai
8281vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
8282 vector unsigned char __c) {
8283 return vec_perm(__a, __b, __c);
8284}
8285
8286static __inline__ vector double __ATTRS_o_ai
8287vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
8288 return vec_perm(__a, __b, __c);
8289}
8290#endif
8291
8292/* vec_re */
8293
8294static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
8295#ifdef __VSX__
8296 return __builtin_vsx_xvresp(__a);
8297#else
8298 return __builtin_altivec_vrefp(__a);
8299#endif
8300}
8301
8302#ifdef __VSX__
8303static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
8304 return __builtin_vsx_xvredp(__a);
8305}
8306#endif
8307
8308/* vec_vrefp */
8309
8310static __inline__ vector float __attribute__((__always_inline__))
8311vec_vrefp(vector float __a) {
8312 return __builtin_altivec_vrefp(__a);
8313}
8314
8315/* vec_rl */
8316
8317static __inline__ vector signed char __ATTRS_o_ai
8318vec_rl(vector signed char __a, vector unsigned char __b) {
8319 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
8320}
8321
8322static __inline__ vector unsigned char __ATTRS_o_ai
8323vec_rl(vector unsigned char __a, vector unsigned char __b) {
8324 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
8325}
8326
8327static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
8328 vector unsigned short __b) {
8329 return __builtin_altivec_vrlh(__a, __b);
8330}
8331
8332static __inline__ vector unsigned short __ATTRS_o_ai
8333vec_rl(vector unsigned short __a, vector unsigned short __b) {
8334 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
8335}
8336
8337static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
8338 vector unsigned int __b) {
8339 return __builtin_altivec_vrlw(__a, __b);
8340}
8341
8342static __inline__ vector unsigned int __ATTRS_o_ai
8343vec_rl(vector unsigned int __a, vector unsigned int __b) {
8344 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
8345}
8346
8347#ifdef __POWER8_VECTOR__
8348static __inline__ vector signed long long __ATTRS_o_ai
8349vec_rl(vector signed long long __a, vector unsigned long long __b) {
8350 return __builtin_altivec_vrld(__a, __b);
8351}
8352
8353static __inline__ vector unsigned long long __ATTRS_o_ai
8354vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
8355 return (vector unsigned long long)__builtin_altivec_vrld(
8356 (vector long long)__a, __b);
8357}
8358#endif
8359
8360#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8361static __inline__ vector signed __int128 __ATTRS_o_ai
8362vec_rl(vector signed __int128 __a, vector unsigned __int128 __b) {
8363 return (vector signed __int128)(((vector unsigned __int128)__b
8364 << (vector unsigned __int128)__a) |
8365 ((vector unsigned __int128)__b >>
8366 ((__CHAR_BIT__ *
8367 sizeof(vector unsigned __int128)) -
8368 (vector unsigned __int128)__a)));
8369}
8370
8371static __inline__ vector unsigned __int128 __ATTRS_o_ai
8372vec_rl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
8373 return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector unsigned __int128)) - __a));
8374}
8375#endif
8376
8377/* vec_rlmi */
8378#ifdef __POWER9_VECTOR__
8379static __inline__ vector unsigned int __ATTRS_o_ai
8380vec_rlmi(vector unsigned int __a, vector unsigned int __b,
8381 vector unsigned int __c) {
8382 return __builtin_altivec_vrlwmi(__a, __c, __b);
8383}
8384
8385static __inline__ vector unsigned long long __ATTRS_o_ai
8386vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
8387 vector unsigned long long __c) {
8388 return __builtin_altivec_vrldmi(__a, __c, __b);
8389}
8390#endif
8391
8392#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8393static __inline__ vector unsigned __int128 __ATTRS_o_ai
8394vec_rlmi(vector unsigned __int128 __a, vector unsigned __int128 __b,
8395 vector unsigned __int128 __c) {
8396 return __builtin_altivec_vrlqmi(__a, __c, __b);
8397}
8398
8399static __inline__ vector signed __int128 __ATTRS_o_ai
8400vec_rlmi(vector signed __int128 __a, vector signed __int128 __b,
8401 vector signed __int128 __c) {
8402 return (vector signed __int128)__builtin_altivec_vrlqmi(
8403 (vector unsigned __int128)__a, (vector unsigned __int128)__c,
8404 (vector unsigned __int128)__b);
8405}
8406#endif
8407
8408/* vec_rlnm */
8409#ifdef __POWER9_VECTOR__
8410static __inline__ vector unsigned int __ATTRS_o_ai
8411vec_rlnm(vector unsigned int __a, vector unsigned int __b,
8412 vector unsigned int __c) {
8413 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
8414 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
8415}
8416
8417static __inline__ vector unsigned long long __ATTRS_o_ai
8418vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
8419 vector unsigned long long __c) {
8420 vector unsigned long long OneByte = { 0x8, 0x8 };
8421 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
8422}
8423#endif
8424
8425#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
8426static __inline__ vector unsigned __int128 __ATTRS_o_ai
8427vec_rlnm(vector unsigned __int128 __a, vector unsigned __int128 __b,
8428 vector unsigned __int128 __c) {
8429 // Merge __b and __c using an appropriate shuffle.
8430 vector unsigned char TmpB = (vector unsigned char)__b;
8431 vector unsigned char TmpC = (vector unsigned char)__c;
8432 vector unsigned char MaskAndShift =
8433#ifdef __LITTLE_ENDIAN__
8434 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8435 1, -1, -1, -1, -1, -1);
8436#else
8437 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8438 -1, -1, -1, -1, -1, -1, -1);
8439#endif
8440 return __builtin_altivec_vrlqnm(__a, (vector unsigned __int128) MaskAndShift);
8441}
8442
8443static __inline__ vector signed __int128 __ATTRS_o_ai
8444vec_rlnm(vector signed __int128 __a, vector signed __int128 __b,
8445 vector signed __int128 __c) {
8446 // Merge __b and __c using an appropriate shuffle.
8447 vector unsigned char TmpB = (vector unsigned char)__b;
8448 vector unsigned char TmpC = (vector unsigned char)__c;
8449 vector unsigned char MaskAndShift =
8450#ifdef __LITTLE_ENDIAN__
8451 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,
8452 1, -1, -1, -1, -1, -1);
8453#else
8454 __builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,
8455 -1, -1, -1, -1, -1, -1, -1);
8456#endif
8457 return (vector signed __int128)__builtin_altivec_vrlqnm(
8458 (vector unsigned __int128)__a, (vector unsigned __int128)MaskAndShift);
8459}
8460#endif
8461
8462/* vec_vrlb */
8463
8464static __inline__ vector signed char __ATTRS_o_ai
8465vec_vrlb(vector signed char __a, vector unsigned char __b) {
8466 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
8467}
8468
8469static __inline__ vector unsigned char __ATTRS_o_ai
8470vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
8471 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
8472}
8473
8474/* vec_vrlh */
8475
8476static __inline__ vector short __ATTRS_o_ai
8477vec_vrlh(vector short __a, vector unsigned short __b) {
8478 return __builtin_altivec_vrlh(__a, __b);
8479}
8480
8481static __inline__ vector unsigned short __ATTRS_o_ai
8482vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
8483 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
8484}
8485
8486/* vec_vrlw */
8487
8488static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
8489 vector unsigned int __b) {
8490 return __builtin_altivec_vrlw(__a, __b);
8491}
8492
8493static __inline__ vector unsigned int __ATTRS_o_ai
8494vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
8495 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
8496}
8497
8498/* vec_round */
8499
8500static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
8501 return __builtin_altivec_vrfin(__a);
8502}
8503
8504#ifdef __VSX__
8505#ifdef __XL_COMPAT_ALTIVEC__
8506static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a);
8507static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
8508 double __fpscr = __builtin_readflm();
8509 __builtin_setrnd(0);
8510 vector double __rounded = vec_rint(__a);
8511 __builtin_setflm(__fpscr);
8512 return __rounded;
8513}
8514#else
8515static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
8516 return __builtin_vsx_xvrdpi(__a);
8517}
8518#endif
8519
8520/* vec_rint */
8521
8522static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
8523 return __builtin_vsx_xvrspic(__a);
8524}
8525
8526static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
8527 return __builtin_vsx_xvrdpic(__a);
8528}
8529
8530/* vec_roundc */
8531
8532static __inline__ vector float __ATTRS_o_ai vec_roundc(vector float __a) {
8533 return __builtin_vsx_xvrspic(__a);
8534}
8535
8536static __inline__ vector double __ATTRS_o_ai vec_roundc(vector double __a) {
8537 return __builtin_vsx_xvrdpic(__a);
8538}
8539
8540/* vec_nearbyint */
8541
8542static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
8543 return __builtin_vsx_xvrspi(__a);
8544}
8545
8546static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
8547 return __builtin_vsx_xvrdpi(__a);
8548}
8549#endif
8550
8551/* vec_vrfin */
8552
8553static __inline__ vector float __attribute__((__always_inline__))
8554vec_vrfin(vector float __a) {
8555 return __builtin_altivec_vrfin(__a);
8556}
8557
8558/* vec_sqrt */
8559
8560#ifdef __VSX__
8561static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
8562 return __builtin_vsx_xvsqrtsp(__a);
8563}
8564
8565static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
8566 return __builtin_vsx_xvsqrtdp(__a);
8567}
8568#endif
8569
8570/* vec_rsqrte */
8571
8572static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
8573#ifdef __VSX__
8574 return __builtin_vsx_xvrsqrtesp(__a);
8575#else
8576 return __builtin_altivec_vrsqrtefp(__a);
8577#endif
8578}
8579
8580#ifdef __VSX__
8581static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
8582 return __builtin_vsx_xvrsqrtedp(__a);
8583}
8584#endif
8585
8586static vector float __ATTRS_o_ai vec_rsqrt(vector float __a) {
8587 return __builtin_ppc_rsqrtf(__a);
8588}
8589
8590#ifdef __VSX__
8591static vector double __ATTRS_o_ai vec_rsqrt(vector double __a) {
8592 return __builtin_ppc_rsqrtd(__a);
8593}
8594#endif
8595
8596/* vec_vrsqrtefp */
8597
8598static __inline__ __vector float __attribute__((__always_inline__))
8599vec_vrsqrtefp(vector float __a) {
8600 return __builtin_altivec_vrsqrtefp(__a);
8601}
8602
8603/* vec_xvtsqrt */
8604
8605#ifdef __VSX__
8606static __inline__ int __ATTRS_o_ai vec_test_swsqrt(vector double __a) {
8607 return __builtin_vsx_xvtsqrtdp(__a);
8608}
8609
8610static __inline__ int __ATTRS_o_ai vec_test_swsqrts(vector float __a) {
8611 return __builtin_vsx_xvtsqrtsp(__a);
8612}
8613#endif
8614
8615/* vec_sel */
8616
8617#define __builtin_altivec_vsel_4si vec_sel
8618
8619static __inline__ vector signed char __ATTRS_o_ai vec_sel(
8620 vector signed char __a, vector signed char __b, vector unsigned char __c) {
8621 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8622}
8623
8624static __inline__ vector signed char __ATTRS_o_ai
8625vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
8626 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8627}
8628
8629static __inline__ vector unsigned char __ATTRS_o_ai
8630vec_sel(vector unsigned char __a, vector unsigned char __b,
8631 vector unsigned char __c) {
8632 return (__a & ~__c) | (__b & __c);
8633}
8634
8635static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
8636 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
8637 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
8638}
8639
8640static __inline__ vector bool char __ATTRS_o_ai
8641vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
8642 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
8643}
8644
8645static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
8646 vector bool char __b,
8647 vector bool char __c) {
8648 return (__a & ~__c) | (__b & __c);
8649}
8650
8651static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
8652 vector short __b,
8653 vector unsigned short __c) {
8654 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8655}
8656
8657static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
8658 vector short __b,
8659 vector bool short __c) {
8660 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8661}
8662
8663static __inline__ vector unsigned short __ATTRS_o_ai
8664vec_sel(vector unsigned short __a, vector unsigned short __b,
8665 vector unsigned short __c) {
8666 return (__a & ~__c) | (__b & __c);
8667}
8668
8669static __inline__ vector unsigned short __ATTRS_o_ai
8670vec_sel(vector unsigned short __a, vector unsigned short __b,
8671 vector bool short __c) {
8672 return (__a & ~(vector unsigned short)__c) |
8673 (__b & (vector unsigned short)__c);
8674}
8675
8676static __inline__ vector bool short __ATTRS_o_ai vec_sel(
8677 vector bool short __a, vector bool short __b, vector unsigned short __c) {
8678 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
8679}
8680
8681static __inline__ vector bool short __ATTRS_o_ai
8682vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
8683 return (__a & ~__c) | (__b & __c);
8684}
8685
8686static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
8687 vector int __b,
8688 vector unsigned int __c) {
8689 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8690}
8691
8692static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
8693 vector int __b,
8694 vector bool int __c) {
8695 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8696}
8697
8698static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
8699 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8700 return (__a & ~__c) | (__b & __c);
8701}
8702
8703static __inline__ vector unsigned int __ATTRS_o_ai
8704vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8705 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8706}
8707
8708static __inline__ vector bool int __ATTRS_o_ai
8709vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8710 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8711}
8712
8713static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
8714 vector bool int __b,
8715 vector bool int __c) {
8716 return (__a & ~__c) | (__b & __c);
8717}
8718
8719static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
8720 vector float __b,
8721 vector unsigned int __c) {
8722 vector int __res = ((vector int)__a & ~(vector int)__c) |
8723 ((vector int)__b & (vector int)__c);
8724 return (vector float)__res;
8725}
8726
8727static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
8728 vector float __b,
8729 vector bool int __c) {
8730 vector int __res = ((vector int)__a & ~(vector int)__c) |
8731 ((vector int)__b & (vector int)__c);
8732 return (vector float)__res;
8733}
8734
8735#ifdef __VSX__
8736static __inline__ vector double __ATTRS_o_ai
8737vec_sel(vector double __a, vector double __b, vector bool long long __c) {
8738 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
8739 ((vector long long)__b & (vector long long)__c);
8740 return (vector double)__res;
8741}
8742
8743static __inline__ vector double __ATTRS_o_ai
8744vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
8745 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
8746 ((vector long long)__b & (vector long long)__c);
8747 return (vector double)__res;
8748}
8749
8750static __inline__ vector bool long long __ATTRS_o_ai
8751vec_sel(vector bool long long __a, vector bool long long __b,
8752 vector bool long long __c) {
8753 return (__a & ~__c) | (__b & __c);
8754}
8755
8756static __inline__ vector bool long long __ATTRS_o_ai
8757vec_sel(vector bool long long __a, vector bool long long __b,
8758 vector unsigned long long __c) {
8759 return (__a & ~(vector bool long long)__c) |
8760 (__b & (vector bool long long)__c);
8761}
8762
8763static __inline__ vector signed long long __ATTRS_o_ai
8764vec_sel(vector signed long long __a, vector signed long long __b,
8765 vector bool long long __c) {
8766 return (__a & ~(vector signed long long)__c) |
8767 (__b & (vector signed long long)__c);
8768}
8769
8770static __inline__ vector signed long long __ATTRS_o_ai
8771vec_sel(vector signed long long __a, vector signed long long __b,
8772 vector unsigned long long __c) {
8773 return (__a & ~(vector signed long long)__c) |
8774 (__b & (vector signed long long)__c);
8775}
8776
8777static __inline__ vector unsigned long long __ATTRS_o_ai
8778vec_sel(vector unsigned long long __a, vector unsigned long long __b,
8779 vector bool long long __c) {
8780 return (__a & ~(vector unsigned long long)__c) |
8781 (__b & (vector unsigned long long)__c);
8782}
8783
8784static __inline__ vector unsigned long long __ATTRS_o_ai
8785vec_sel(vector unsigned long long __a, vector unsigned long long __b,
8786 vector unsigned long long __c) {
8787 return (__a & ~__c) | (__b & __c);
8788}
8789#endif
8790
8791/* vec_vsel */
8792
8793static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
8794 vector signed char __a, vector signed char __b, vector unsigned char __c) {
8795 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8796}
8797
8798static __inline__ vector signed char __ATTRS_o_ai
8799vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
8800 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
8801}
8802
8803static __inline__ vector unsigned char __ATTRS_o_ai
8804vec_vsel(vector unsigned char __a, vector unsigned char __b,
8805 vector unsigned char __c) {
8806 return (__a & ~__c) | (__b & __c);
8807}
8808
8809static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
8810 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
8811 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
8812}
8813
8814static __inline__ vector bool char __ATTRS_o_ai
8815vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
8816 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
8817}
8818
8819static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
8820 vector bool char __b,
8821 vector bool char __c) {
8822 return (__a & ~__c) | (__b & __c);
8823}
8824
8825static __inline__ vector short __ATTRS_o_ai
8826vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
8827 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8828}
8829
8830static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
8831 vector short __b,
8832 vector bool short __c) {
8833 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8834}
8835
8836static __inline__ vector unsigned short __ATTRS_o_ai
8837vec_vsel(vector unsigned short __a, vector unsigned short __b,
8838 vector unsigned short __c) {
8839 return (__a & ~__c) | (__b & __c);
8840}
8841
8842static __inline__ vector unsigned short __ATTRS_o_ai
8843vec_vsel(vector unsigned short __a, vector unsigned short __b,
8844 vector bool short __c) {
8845 return (__a & ~(vector unsigned short)__c) |
8846 (__b & (vector unsigned short)__c);
8847}
8848
8849static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
8850 vector bool short __a, vector bool short __b, vector unsigned short __c) {
8851 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
8852}
8853
8854static __inline__ vector bool short __ATTRS_o_ai
8855vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
8856 return (__a & ~__c) | (__b & __c);
8857}
8858
8859static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8860 vector int __b,
8861 vector unsigned int __c) {
8862 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8863}
8864
8865static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8866 vector int __b,
8867 vector bool int __c) {
8868 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8869}
8870
8871static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8872 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8873 return (__a & ~__c) | (__b & __c);
8874}
8875
8876static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8877 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8878 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8879}
8880
8881static __inline__ vector bool int __ATTRS_o_ai
8882vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8883 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8884}
8885
8886static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8887 vector bool int __b,
8888 vector bool int __c) {
8889 return (__a & ~__c) | (__b & __c);
8890}
8891
8892static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8893 vector float __b,
8894 vector unsigned int __c) {
8895 vector int __res = ((vector int)__a & ~(vector int)__c) |
8896 ((vector int)__b & (vector int)__c);
8897 return (vector float)__res;
8898}
8899
8900static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8901 vector float __b,
8902 vector bool int __c) {
8903 vector int __res = ((vector int)__a & ~(vector int)__c) |
8904 ((vector int)__b & (vector int)__c);
8905 return (vector float)__res;
8906}
8907
8908/* vec_sl */
8909
8910// vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8911// than the length of __a.
8912static __inline__ vector unsigned char __ATTRS_o_ai
8913vec_sl(vector unsigned char __a, vector unsigned char __b) {
8914 return __a << (__b %
8915 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8916}
8917
8918static __inline__ vector signed char __ATTRS_o_ai
8919vec_sl(vector signed char __a, vector unsigned char __b) {
8920 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8921}
8922
8923static __inline__ vector unsigned short __ATTRS_o_ai
8924vec_sl(vector unsigned short __a, vector unsigned short __b) {
8925 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8926 __CHAR_BIT__));
8927}
8928
8929static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8930 vector unsigned short __b) {
8931 return (vector short)vec_sl((vector unsigned short)__a, __b);
8932}
8933
8934static __inline__ vector unsigned int __ATTRS_o_ai
8935vec_sl(vector unsigned int __a, vector unsigned int __b) {
8936 return __a << (__b %
8937 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8938}
8939
8940static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8941 vector unsigned int __b) {
8942 return (vector int)vec_sl((vector unsigned int)__a, __b);
8943}
8944
8945#ifdef __POWER8_VECTOR__
8946static __inline__ vector unsigned long long __ATTRS_o_ai
8947vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8948 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8949 __CHAR_BIT__));
8950}
8951
8952static __inline__ vector long long __ATTRS_o_ai
8953vec_sl(vector long long __a, vector unsigned long long __b) {
8954 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8955}
8956#elif defined(__VSX__)
8957static __inline__ vector unsigned char __ATTRS_o_ai
8958vec_vspltb(vector unsigned char __a, unsigned char __b);
8959static __inline__ vector unsigned long long __ATTRS_o_ai
8960vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8961 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
8962
8963 // Big endian element one (the right doubleword) can be left shifted as-is.
8964 // The other element needs to be swapped into the right doubleword and
8965 // shifted. Then the right doublewords of the two result vectors are merged.
8966 vector signed long long __rightelt =
8967 (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8968 (vector signed int)__b);
8969#ifdef __LITTLE_ENDIAN__
8970 __rightelt = (vector signed long long)__builtin_altivec_vsl(
8971 (vector signed int)__rightelt,
8972 (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8973#else
8974 __rightelt = (vector signed long long)__builtin_altivec_vsl(
8975 (vector signed int)__rightelt,
8976 (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8977#endif
8978 __a = __builtin_shufflevector(__a, __a, 1, 0);
8979 __b = __builtin_shufflevector(__b, __b, 1, 0);
8980 vector signed long long __leftelt =
8981 (vector signed long long)__builtin_altivec_vslo((vector signed int)__a,
8982 (vector signed int)__b);
8983#ifdef __LITTLE_ENDIAN__
8984 __leftelt = (vector signed long long)__builtin_altivec_vsl(
8985 (vector signed int)__leftelt,
8986 (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
8987 return (vector unsigned long long)__builtin_shufflevector(__rightelt,
8988 __leftelt, 0, 2);
8989#else
8990 __leftelt = (vector signed long long)__builtin_altivec_vsl(
8991 (vector signed int)__leftelt,
8992 (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
8993 return (vector unsigned long long)__builtin_shufflevector(__leftelt,
8994 __rightelt, 1, 3);
8995#endif
8996}
8997
8998static __inline__ vector long long __ATTRS_o_ai
8999vec_sl(vector long long __a, vector unsigned long long __b) {
9000 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
9001}
9002#endif /* __VSX__ */
9003
9004/* vec_vslb */
9005
9006#define __builtin_altivec_vslb vec_vslb
9007
9008static __inline__ vector signed char __ATTRS_o_ai
9009vec_vslb(vector signed char __a, vector unsigned char __b) {
9010 return vec_sl(__a, __b);
9011}
9012
9013static __inline__ vector unsigned char __ATTRS_o_ai
9014vec_vslb(vector unsigned char __a, vector unsigned char __b) {
9015 return vec_sl(__a, __b);
9016}
9017
9018/* vec_vslh */
9019
9020#define __builtin_altivec_vslh vec_vslh
9021
9022static __inline__ vector short __ATTRS_o_ai
9023vec_vslh(vector short __a, vector unsigned short __b) {
9024 return vec_sl(__a, __b);
9025}
9026
9027static __inline__ vector unsigned short __ATTRS_o_ai
9028vec_vslh(vector unsigned short __a, vector unsigned short __b) {
9029 return vec_sl(__a, __b);
9030}
9031
9032/* vec_vslw */
9033
9034#define __builtin_altivec_vslw vec_vslw
9035
9036static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
9037 vector unsigned int __b) {
9038 return vec_sl(__a, __b);
9039}
9040
9041static __inline__ vector unsigned int __ATTRS_o_ai
9042vec_vslw(vector unsigned int __a, vector unsigned int __b) {
9043 return vec_sl(__a, __b);
9044}
9045
9046/* vec_sld */
9047
9048#define __builtin_altivec_vsldoi_4si vec_sld
9049
9050static __inline__ vector signed char __ATTRS_o_ai vec_sld(
9051 vector signed char __a, vector signed char __b, unsigned const int __c) {
9052 unsigned char __d = __c & 0x0F;
9053#ifdef __LITTLE_ENDIAN__
9054 return vec_perm(
9055 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9056 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9057 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9058 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9059#else
9060 return vec_perm(
9061 __a, __b,
9062 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9063 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9064 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9065#endif
9066}
9067
9068static __inline__ vector unsigned char __ATTRS_o_ai
9069vec_sld(vector unsigned char __a, vector unsigned char __b,
9070 unsigned const int __c) {
9071 unsigned char __d = __c & 0x0F;
9072#ifdef __LITTLE_ENDIAN__
9073 return vec_perm(
9074 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9075 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9076 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9077 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9078#else
9079 return vec_perm(
9080 __a, __b,
9081 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9082 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9083 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9084#endif
9085}
9086
9087static __inline__ vector bool char __ATTRS_o_ai
9088vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
9089 unsigned char __d = __c & 0x0F;
9090#ifdef __LITTLE_ENDIAN__
9091 return vec_perm(
9092 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9093 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9094 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9095 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9096#else
9097 return vec_perm(
9098 __a, __b,
9099 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9100 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9101 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9102#endif
9103}
9104
9105static __inline__ vector signed short __ATTRS_o_ai vec_sld(
9106 vector signed short __a, vector signed short __b, unsigned const int __c) {
9107 unsigned char __d = __c & 0x0F;
9108#ifdef __LITTLE_ENDIAN__
9109 return vec_perm(
9110 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9111 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9112 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9113 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9114#else
9115 return vec_perm(
9116 __a, __b,
9117 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9118 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9119 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9120#endif
9121}
9122
9123static __inline__ vector unsigned short __ATTRS_o_ai
9124vec_sld(vector unsigned short __a, vector unsigned short __b,
9125 unsigned const int __c) {
9126 unsigned char __d = __c & 0x0F;
9127#ifdef __LITTLE_ENDIAN__
9128 return vec_perm(
9129 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9130 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9131 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9132 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9133#else
9134 return vec_perm(
9135 __a, __b,
9136 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9137 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9138 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9139#endif
9140}
9141
9142static __inline__ vector bool short __ATTRS_o_ai
9143vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
9144 unsigned char __d = __c & 0x0F;
9145#ifdef __LITTLE_ENDIAN__
9146 return vec_perm(
9147 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9148 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9149 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9150 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9151#else
9152 return vec_perm(
9153 __a, __b,
9154 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9155 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9156 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9157#endif
9158}
9159
9160static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
9161 vector pixel __b,
9162 unsigned const int __c) {
9163 unsigned char __d = __c & 0x0F;
9164#ifdef __LITTLE_ENDIAN__
9165 return vec_perm(
9166 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9167 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9168 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9169 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9170#else
9171 return vec_perm(
9172 __a, __b,
9173 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9174 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9175 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9176#endif
9177}
9178
9179static __inline__ vector signed int __ATTRS_o_ai
9180vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
9181 unsigned char __d = __c & 0x0F;
9182#ifdef __LITTLE_ENDIAN__
9183 return vec_perm(
9184 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9185 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9186 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9187 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9188#else
9189 return vec_perm(
9190 __a, __b,
9191 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9192 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9193 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9194#endif
9195}
9196
9197static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
9198 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
9199 unsigned char __d = __c & 0x0F;
9200#ifdef __LITTLE_ENDIAN__
9201 return vec_perm(
9202 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9203 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9204 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9205 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9206#else
9207 return vec_perm(
9208 __a, __b,
9209 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9210 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9211 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9212#endif
9213}
9214
9215static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
9216 vector bool int __b,
9217 unsigned const int __c) {
9218 unsigned char __d = __c & 0x0F;
9219#ifdef __LITTLE_ENDIAN__
9220 return vec_perm(
9221 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9222 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9223 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9224 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9225#else
9226 return vec_perm(
9227 __a, __b,
9228 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9229 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9230 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9231#endif
9232}
9233
9234static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
9235 vector float __b,
9236 unsigned const int __c) {
9237 unsigned char __d = __c & 0x0F;
9238#ifdef __LITTLE_ENDIAN__
9239 return vec_perm(
9240 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9241 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9242 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9243 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9244#else
9245 return vec_perm(
9246 __a, __b,
9247 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9248 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9249 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9250#endif
9251}
9252
9253#ifdef __VSX__
9254static __inline__ vector bool long long __ATTRS_o_ai
9255vec_sld(vector bool long long __a, vector bool long long __b,
9256 unsigned const int __c) {
9257 unsigned char __d = __c & 0x0F;
9258#ifdef __LITTLE_ENDIAN__
9259 return vec_perm(
9260 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9261 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9262 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9263 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9264#else
9265 return vec_perm(
9266 __a, __b,
9267 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9268 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9269 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9270#endif
9271}
9272
9273static __inline__ vector signed long long __ATTRS_o_ai
9274vec_sld(vector signed long long __a, vector signed long long __b,
9275 unsigned const int __c) {
9276 unsigned char __d = __c & 0x0F;
9277#ifdef __LITTLE_ENDIAN__
9278 return vec_perm(
9279 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9280 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9281 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9282 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9283#else
9284 return vec_perm(
9285 __a, __b,
9286 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9287 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9288 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9289#endif
9290}
9291
9292static __inline__ vector unsigned long long __ATTRS_o_ai
9293vec_sld(vector unsigned long long __a, vector unsigned long long __b,
9294 unsigned const int __c) {
9295 unsigned char __d = __c & 0x0F;
9296#ifdef __LITTLE_ENDIAN__
9297 return vec_perm(
9298 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9299 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9300 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9301 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9302#else
9303 return vec_perm(
9304 __a, __b,
9305 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9306 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9307 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9308#endif
9309}
9310
9311static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
9312 vector double __b,
9313 unsigned const int __c) {
9314 unsigned char __d = __c & 0x0F;
9315#ifdef __LITTLE_ENDIAN__
9316 return vec_perm(
9317 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9318 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9319 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9320 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9321#else
9322 return vec_perm(
9323 __a, __b,
9324 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9325 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9326 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9327#endif
9328}
9329#endif
9330
9331/* vec_sldw */
9332static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
9333 vector signed char __a, vector signed char __b, unsigned const int __c) {
9334 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9335}
9336
9337static __inline__ vector unsigned char __ATTRS_o_ai
9338vec_sldw(vector unsigned char __a, vector unsigned char __b,
9339 unsigned const int __c) {
9340 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9341}
9342
9343static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
9344 vector signed short __a, vector signed short __b, unsigned const int __c) {
9345 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9346}
9347
9348static __inline__ vector unsigned short __ATTRS_o_ai
9349vec_sldw(vector unsigned short __a, vector unsigned short __b,
9350 unsigned const int __c) {
9351 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9352}
9353
9354static __inline__ vector signed int __ATTRS_o_ai
9355vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
9356 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9357}
9358
9359static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
9360 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
9361 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9362}
9363
9364static __inline__ vector float __ATTRS_o_ai vec_sldw(
9365 vector float __a, vector float __b, unsigned const int __c) {
9366 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9367}
9368
9369#ifdef __VSX__
9370static __inline__ vector signed long long __ATTRS_o_ai
9371vec_sldw(vector signed long long __a, vector signed long long __b,
9372 unsigned const int __c) {
9373 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9374}
9375
9376static __inline__ vector unsigned long long __ATTRS_o_ai
9377vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
9378 unsigned const int __c) {
9379 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9380}
9381
9382static __inline__ vector double __ATTRS_o_ai vec_sldw(
9383 vector double __a, vector double __b, unsigned const int __c) {
9384 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
9385}
9386#endif
9387
9388#ifdef __POWER9_VECTOR__
9389/* vec_slv */
9390static __inline__ vector unsigned char __ATTRS_o_ai
9391vec_slv(vector unsigned char __a, vector unsigned char __b) {
9392 return __builtin_altivec_vslv(__a, __b);
9393}
9394
9395/* vec_srv */
9396static __inline__ vector unsigned char __ATTRS_o_ai
9397vec_srv(vector unsigned char __a, vector unsigned char __b) {
9398 return __builtin_altivec_vsrv(__a, __b);
9399}
9400#endif
9401
9402/* vec_vsldoi */
9403
9404static __inline__ vector signed char __ATTRS_o_ai
9405vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
9406 unsigned char __d = __c & 0x0F;
9407#ifdef __LITTLE_ENDIAN__
9408 return vec_perm(
9409 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9410 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9411 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9412 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9413#else
9414 return vec_perm(
9415 __a, __b,
9416 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9417 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9418 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9419#endif
9420}
9421
9422static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
9423 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
9424 unsigned char __d = __c & 0x0F;
9425#ifdef __LITTLE_ENDIAN__
9426 return vec_perm(
9427 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9428 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9429 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9430 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9431#else
9432 return vec_perm(
9433 __a, __b,
9434 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9435 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9436 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9437#endif
9438}
9439
9440static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
9441 vector short __b,
9442 unsigned char __c) {
9443 unsigned char __d = __c & 0x0F;
9444#ifdef __LITTLE_ENDIAN__
9445 return vec_perm(
9446 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9447 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9448 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9449 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9450#else
9451 return vec_perm(
9452 __a, __b,
9453 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9454 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9455 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9456#endif
9457}
9458
9459static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
9460 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
9461 unsigned char __d = __c & 0x0F;
9462#ifdef __LITTLE_ENDIAN__
9463 return vec_perm(
9464 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9465 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9466 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9467 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9468#else
9469 return vec_perm(
9470 __a, __b,
9471 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9472 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9473 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9474#endif
9475}
9476
9477static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
9478 vector pixel __b,
9479 unsigned char __c) {
9480 unsigned char __d = __c & 0x0F;
9481#ifdef __LITTLE_ENDIAN__
9482 return vec_perm(
9483 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9484 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9485 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9486 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9487#else
9488 return vec_perm(
9489 __a, __b,
9490 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9491 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9492 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9493#endif
9494}
9495
9496static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
9497 vector int __b,
9498 unsigned char __c) {
9499 unsigned char __d = __c & 0x0F;
9500#ifdef __LITTLE_ENDIAN__
9501 return vec_perm(
9502 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9503 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9504 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9505 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9506#else
9507 return vec_perm(
9508 __a, __b,
9509 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9510 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9511 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9512#endif
9513}
9514
9515static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
9516 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
9517 unsigned char __d = __c & 0x0F;
9518#ifdef __LITTLE_ENDIAN__
9519 return vec_perm(
9520 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9521 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9522 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9523 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9524#else
9525 return vec_perm(
9526 __a, __b,
9527 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9528 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9529 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9530#endif
9531}
9532
9533static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
9534 vector float __b,
9535 unsigned char __c) {
9536 unsigned char __d = __c & 0x0F;
9537#ifdef __LITTLE_ENDIAN__
9538 return vec_perm(
9539 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
9540 20 - __d, 21 - __d, 22 - __d, 23 - __d,
9541 24 - __d, 25 - __d, 26 - __d, 27 - __d,
9542 28 - __d, 29 - __d, 30 - __d, 31 - __d));
9543#else
9544 return vec_perm(
9545 __a, __b,
9546 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
9547 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
9548 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
9549#endif
9550}
9551
9552/* vec_sll */
9553
9554static __inline__ vector signed char __ATTRS_o_ai
9555vec_sll(vector signed char __a, vector unsigned char __b) {
9556 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9557 (vector int)__b);
9558}
9559
9560static __inline__ vector signed char __ATTRS_o_ai
9561vec_sll(vector signed char __a, vector unsigned short __b) {
9562 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9563 (vector int)__b);
9564}
9565
9566static __inline__ vector signed char __ATTRS_o_ai
9567vec_sll(vector signed char __a, vector unsigned int __b) {
9568 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9569 (vector int)__b);
9570}
9571
9572static __inline__ vector unsigned char __ATTRS_o_ai
9573vec_sll(vector unsigned char __a, vector unsigned char __b) {
9574 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9575 (vector int)__b);
9576}
9577
9578static __inline__ vector unsigned char __ATTRS_o_ai
9579vec_sll(vector unsigned char __a, vector unsigned short __b) {
9580 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9581 (vector int)__b);
9582}
9583
9584static __inline__ vector unsigned char __ATTRS_o_ai
9585vec_sll(vector unsigned char __a, vector unsigned int __b) {
9586 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9587 (vector int)__b);
9588}
9589
9590static __inline__ vector bool char __ATTRS_o_ai
9591vec_sll(vector bool char __a, vector unsigned char __b) {
9592 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9593 (vector int)__b);
9594}
9595
9596static __inline__ vector bool char __ATTRS_o_ai
9597vec_sll(vector bool char __a, vector unsigned short __b) {
9598 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9599 (vector int)__b);
9600}
9601
9602static __inline__ vector bool char __ATTRS_o_ai
9603vec_sll(vector bool char __a, vector unsigned int __b) {
9604 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9605 (vector int)__b);
9606}
9607
9608static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
9609 vector unsigned char __b) {
9610 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9611}
9612
9613static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
9614 vector unsigned short __b) {
9615 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9616}
9617
9618static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
9619 vector unsigned int __b) {
9620 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9621}
9622
9623static __inline__ vector unsigned short __ATTRS_o_ai
9624vec_sll(vector unsigned short __a, vector unsigned char __b) {
9625 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9626 (vector int)__b);
9627}
9628
9629static __inline__ vector unsigned short __ATTRS_o_ai
9630vec_sll(vector unsigned short __a, vector unsigned short __b) {
9631 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9632 (vector int)__b);
9633}
9634
9635static __inline__ vector unsigned short __ATTRS_o_ai
9636vec_sll(vector unsigned short __a, vector unsigned int __b) {
9637 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9638 (vector int)__b);
9639}
9640
9641static __inline__ vector bool short __ATTRS_o_ai
9642vec_sll(vector bool short __a, vector unsigned char __b) {
9643 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9644 (vector int)__b);
9645}
9646
9647static __inline__ vector bool short __ATTRS_o_ai
9648vec_sll(vector bool short __a, vector unsigned short __b) {
9649 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9650 (vector int)__b);
9651}
9652
9653static __inline__ vector bool short __ATTRS_o_ai
9654vec_sll(vector bool short __a, vector unsigned int __b) {
9655 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9656 (vector int)__b);
9657}
9658
9659static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
9660 vector unsigned char __b) {
9661 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9662}
9663
9664static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
9665 vector unsigned short __b) {
9666 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9667}
9668
9669static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
9670 vector unsigned int __b) {
9671 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9672}
9673
9674static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
9675 vector unsigned char __b) {
9676 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9677}
9678
9679static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
9680 vector unsigned short __b) {
9681 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9682}
9683
9684static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
9685 vector unsigned int __b) {
9686 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9687}
9688
9689static __inline__ vector unsigned int __ATTRS_o_ai
9690vec_sll(vector unsigned int __a, vector unsigned char __b) {
9691 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9692 (vector int)__b);
9693}
9694
9695static __inline__ vector unsigned int __ATTRS_o_ai
9696vec_sll(vector unsigned int __a, vector unsigned short __b) {
9697 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9698 (vector int)__b);
9699}
9700
9701static __inline__ vector unsigned int __ATTRS_o_ai
9702vec_sll(vector unsigned int __a, vector unsigned int __b) {
9703 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9704 (vector int)__b);
9705}
9706
9707static __inline__ vector bool int __ATTRS_o_ai
9708vec_sll(vector bool int __a, vector unsigned char __b) {
9709 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9710 (vector int)__b);
9711}
9712
9713static __inline__ vector bool int __ATTRS_o_ai
9714vec_sll(vector bool int __a, vector unsigned short __b) {
9715 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9716 (vector int)__b);
9717}
9718
9719static __inline__ vector bool int __ATTRS_o_ai
9720vec_sll(vector bool int __a, vector unsigned int __b) {
9721 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9722 (vector int)__b);
9723}
9724
9725#ifdef __VSX__
9726static __inline__ vector signed long long __ATTRS_o_ai
9727vec_sll(vector signed long long __a, vector unsigned char __b) {
9728 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
9729 (vector int)__b);
9730}
9731
9732static __inline__ vector unsigned long long __ATTRS_o_ai
9733vec_sll(vector unsigned long long __a, vector unsigned char __b) {
9734 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
9735 (vector int)__b);
9736}
9737#endif
9738
9739/* vec_vsl */
9740
9741static __inline__ vector signed char __ATTRS_o_ai
9742vec_vsl(vector signed char __a, vector unsigned char __b) {
9743 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9744 (vector int)__b);
9745}
9746
9747static __inline__ vector signed char __ATTRS_o_ai
9748vec_vsl(vector signed char __a, vector unsigned short __b) {
9749 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9750 (vector int)__b);
9751}
9752
9753static __inline__ vector signed char __ATTRS_o_ai
9754vec_vsl(vector signed char __a, vector unsigned int __b) {
9755 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
9756 (vector int)__b);
9757}
9758
9759static __inline__ vector unsigned char __ATTRS_o_ai
9760vec_vsl(vector unsigned char __a, vector unsigned char __b) {
9761 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9762 (vector int)__b);
9763}
9764
9765static __inline__ vector unsigned char __ATTRS_o_ai
9766vec_vsl(vector unsigned char __a, vector unsigned short __b) {
9767 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9768 (vector int)__b);
9769}
9770
9771static __inline__ vector unsigned char __ATTRS_o_ai
9772vec_vsl(vector unsigned char __a, vector unsigned int __b) {
9773 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
9774 (vector int)__b);
9775}
9776
9777static __inline__ vector bool char __ATTRS_o_ai
9778vec_vsl(vector bool char __a, vector unsigned char __b) {
9779 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9780 (vector int)__b);
9781}
9782
9783static __inline__ vector bool char __ATTRS_o_ai
9784vec_vsl(vector bool char __a, vector unsigned short __b) {
9785 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9786 (vector int)__b);
9787}
9788
9789static __inline__ vector bool char __ATTRS_o_ai
9790vec_vsl(vector bool char __a, vector unsigned int __b) {
9791 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
9792 (vector int)__b);
9793}
9794
9795static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
9796 vector unsigned char __b) {
9797 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9798}
9799
9800static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
9801 vector unsigned short __b) {
9802 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9803}
9804
9805static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
9806 vector unsigned int __b) {
9807 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9808}
9809
9810static __inline__ vector unsigned short __ATTRS_o_ai
9811vec_vsl(vector unsigned short __a, vector unsigned char __b) {
9812 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9813 (vector int)__b);
9814}
9815
9816static __inline__ vector unsigned short __ATTRS_o_ai
9817vec_vsl(vector unsigned short __a, vector unsigned short __b) {
9818 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9819 (vector int)__b);
9820}
9821
9822static __inline__ vector unsigned short __ATTRS_o_ai
9823vec_vsl(vector unsigned short __a, vector unsigned int __b) {
9824 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
9825 (vector int)__b);
9826}
9827
9828static __inline__ vector bool short __ATTRS_o_ai
9829vec_vsl(vector bool short __a, vector unsigned char __b) {
9830 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9831 (vector int)__b);
9832}
9833
9834static __inline__ vector bool short __ATTRS_o_ai
9835vec_vsl(vector bool short __a, vector unsigned short __b) {
9836 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9837 (vector int)__b);
9838}
9839
9840static __inline__ vector bool short __ATTRS_o_ai
9841vec_vsl(vector bool short __a, vector unsigned int __b) {
9842 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
9843 (vector int)__b);
9844}
9845
9846static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
9847 vector unsigned char __b) {
9848 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9849}
9850
9851static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
9852 vector unsigned short __b) {
9853 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9854}
9855
9856static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
9857 vector unsigned int __b) {
9858 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
9859}
9860
9861static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
9862 vector unsigned char __b) {
9863 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9864}
9865
9866static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
9867 vector unsigned short __b) {
9868 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9869}
9870
9871static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
9872 vector unsigned int __b) {
9873 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
9874}
9875
9876static __inline__ vector unsigned int __ATTRS_o_ai
9877vec_vsl(vector unsigned int __a, vector unsigned char __b) {
9878 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9879 (vector int)__b);
9880}
9881
9882static __inline__ vector unsigned int __ATTRS_o_ai
9883vec_vsl(vector unsigned int __a, vector unsigned short __b) {
9884 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9885 (vector int)__b);
9886}
9887
9888static __inline__ vector unsigned int __ATTRS_o_ai
9889vec_vsl(vector unsigned int __a, vector unsigned int __b) {
9890 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9891 (vector int)__b);
9892}
9893
9894static __inline__ vector bool int __ATTRS_o_ai
9895vec_vsl(vector bool int __a, vector unsigned char __b) {
9896 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9897 (vector int)__b);
9898}
9899
9900static __inline__ vector bool int __ATTRS_o_ai
9901vec_vsl(vector bool int __a, vector unsigned short __b) {
9902 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9903 (vector int)__b);
9904}
9905
9906static __inline__ vector bool int __ATTRS_o_ai
9907vec_vsl(vector bool int __a, vector unsigned int __b) {
9908 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9909 (vector int)__b);
9910}
9911
9912/* vec_slo */
9913
9914static __inline__ vector signed char __ATTRS_o_ai
9915vec_slo(vector signed char __a, vector signed char __b) {
9916 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9917 (vector int)__b);
9918}
9919
9920static __inline__ vector signed char __ATTRS_o_ai
9921vec_slo(vector signed char __a, vector unsigned char __b) {
9922 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9923 (vector int)__b);
9924}
9925
9926static __inline__ vector unsigned char __ATTRS_o_ai
9927vec_slo(vector unsigned char __a, vector signed char __b) {
9928 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9929 (vector int)__b);
9930}
9931
9932static __inline__ vector unsigned char __ATTRS_o_ai
9933vec_slo(vector unsigned char __a, vector unsigned char __b) {
9934 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9935 (vector int)__b);
9936}
9937
9938static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9939 vector signed char __b) {
9940 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9941}
9942
9943static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9944 vector unsigned char __b) {
9945 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9946}
9947
9948static __inline__ vector unsigned short __ATTRS_o_ai
9949vec_slo(vector unsigned short __a, vector signed char __b) {
9950 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9951 (vector int)__b);
9952}
9953
9954static __inline__ vector unsigned short __ATTRS_o_ai
9955vec_slo(vector unsigned short __a, vector unsigned char __b) {
9956 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9957 (vector int)__b);
9958}
9959
9960static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9961 vector signed char __b) {
9962 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9963}
9964
9965static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9966 vector unsigned char __b) {
9967 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9968}
9969
9970static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9971 vector signed char __b) {
9972 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9973}
9974
9975static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9976 vector unsigned char __b) {
9977 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9978}
9979
9980static __inline__ vector unsigned int __ATTRS_o_ai
9981vec_slo(vector unsigned int __a, vector signed char __b) {
9982 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9983 (vector int)__b);
9984}
9985
9986static __inline__ vector unsigned int __ATTRS_o_ai
9987vec_slo(vector unsigned int __a, vector unsigned char __b) {
9988 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9989 (vector int)__b);
9990}
9991
9992static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9993 vector signed char __b) {
9994 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9995}
9996
9997static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9998 vector unsigned char __b) {
9999 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10000}
10001
10002#ifdef __VSX__
10003static __inline__ vector signed long long __ATTRS_o_ai
10004vec_slo(vector signed long long __a, vector signed char __b) {
10005 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
10006 (vector int)__b);
10007}
10008
10009static __inline__ vector signed long long __ATTRS_o_ai
10010vec_slo(vector signed long long __a, vector unsigned char __b) {
10011 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
10012 (vector int)__b);
10013}
10014
10015static __inline__ vector unsigned long long __ATTRS_o_ai
10016vec_slo(vector unsigned long long __a, vector signed char __b) {
10017 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
10018 (vector int)__b);
10019}
10020
10021static __inline__ vector unsigned long long __ATTRS_o_ai
10022vec_slo(vector unsigned long long __a, vector unsigned char __b) {
10023 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
10024 (vector int)__b);
10025}
10026#endif
10027
10028/* vec_vslo */
10029
10030static __inline__ vector signed char __ATTRS_o_ai
10031vec_vslo(vector signed char __a, vector signed char __b) {
10032 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
10033 (vector int)__b);
10034}
10035
10036static __inline__ vector signed char __ATTRS_o_ai
10037vec_vslo(vector signed char __a, vector unsigned char __b) {
10038 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
10039 (vector int)__b);
10040}
10041
10042static __inline__ vector unsigned char __ATTRS_o_ai
10043vec_vslo(vector unsigned char __a, vector signed char __b) {
10044 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
10045 (vector int)__b);
10046}
10047
10048static __inline__ vector unsigned char __ATTRS_o_ai
10049vec_vslo(vector unsigned char __a, vector unsigned char __b) {
10050 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
10051 (vector int)__b);
10052}
10053
10054static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
10055 vector signed char __b) {
10056 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10057}
10058
10059static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
10060 vector unsigned char __b) {
10061 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10062}
10063
10064static __inline__ vector unsigned short __ATTRS_o_ai
10065vec_vslo(vector unsigned short __a, vector signed char __b) {
10066 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
10067 (vector int)__b);
10068}
10069
10070static __inline__ vector unsigned short __ATTRS_o_ai
10071vec_vslo(vector unsigned short __a, vector unsigned char __b) {
10072 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
10073 (vector int)__b);
10074}
10075
10076static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
10077 vector signed char __b) {
10078 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10079}
10080
10081static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
10082 vector unsigned char __b) {
10083 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10084}
10085
10086static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
10087 vector signed char __b) {
10088 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
10089}
10090
10091static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
10092 vector unsigned char __b) {
10093 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
10094}
10095
10096static __inline__ vector unsigned int __ATTRS_o_ai
10097vec_vslo(vector unsigned int __a, vector signed char __b) {
10098 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
10099 (vector int)__b);
10100}
10101
10102static __inline__ vector unsigned int __ATTRS_o_ai
10103vec_vslo(vector unsigned int __a, vector unsigned char __b) {
10104 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
10105 (vector int)__b);
10106}
10107
10108static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
10109 vector signed char __b) {
10110 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10111}
10112
10113static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
10114 vector unsigned char __b) {
10115 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
10116}
10117
10118/* vec_splat */
10119
10120static __inline__ vector signed char __ATTRS_o_ai
10121vec_splat(vector signed char __a, unsigned const int __b) {
10122 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
10123}
10124
10125static __inline__ vector unsigned char __ATTRS_o_ai
10126vec_splat(vector unsigned char __a, unsigned const int __b) {
10127 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
10128}
10129
10130static __inline__ vector bool char __ATTRS_o_ai
10131vec_splat(vector bool char __a, unsigned const int __b) {
10132 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
10133}
10134
10135static __inline__ vector signed short __ATTRS_o_ai
10136vec_splat(vector signed short __a, unsigned const int __b) {
10137 unsigned char b0 = (__b & 0x07) * 2;
10138 unsigned char b1 = b0 + 1;
10139 return vec_perm(__a, __a,
10140 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10141 b0, b1, b0, b1, b0, b1));
10142}
10143
10144static __inline__ vector unsigned short __ATTRS_o_ai
10145vec_splat(vector unsigned short __a, unsigned const int __b) {
10146 unsigned char b0 = (__b & 0x07) * 2;
10147 unsigned char b1 = b0 + 1;
10148 return vec_perm(__a, __a,
10149 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10150 b0, b1, b0, b1, b0, b1));
10151}
10152
10153static __inline__ vector bool short __ATTRS_o_ai
10154vec_splat(vector bool short __a, unsigned const int __b) {
10155 unsigned char b0 = (__b & 0x07) * 2;
10156 unsigned char b1 = b0 + 1;
10157 return vec_perm(__a, __a,
10158 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10159 b0, b1, b0, b1, b0, b1));
10160}
10161
10162static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
10163 unsigned const int __b) {
10164 unsigned char b0 = (__b & 0x07) * 2;
10165 unsigned char b1 = b0 + 1;
10166 return vec_perm(__a, __a,
10167 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
10168 b0, b1, b0, b1, b0, b1));
10169}
10170
10171static __inline__ vector signed int __ATTRS_o_ai
10172vec_splat(vector signed int __a, unsigned const int __b) {
10173 unsigned char b0 = (__b & 0x03) * 4;
10174 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10175 return vec_perm(__a, __a,
10176 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10177 b2, b3, b0, b1, b2, b3));
10178}
10179
10180static __inline__ vector unsigned int __ATTRS_o_ai
10181vec_splat(vector unsigned int __a, unsigned const int __b) {
10182 unsigned char b0 = (__b & 0x03) * 4;
10183 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10184 return vec_perm(__a, __a,
10185 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10186 b2, b3, b0, b1, b2, b3));
10187}
10188
10189static __inline__ vector bool int __ATTRS_o_ai
10190vec_splat(vector bool int __a, unsigned const int __b) {
10191 unsigned char b0 = (__b & 0x03) * 4;
10192 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10193 return vec_perm(__a, __a,
10194 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10195 b2, b3, b0, b1, b2, b3));
10196}
10197
10198static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
10199 unsigned const int __b) {
10200 unsigned char b0 = (__b & 0x03) * 4;
10201 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
10202 return vec_perm(__a, __a,
10203 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
10204 b2, b3, b0, b1, b2, b3));
10205}
10206
10207#ifdef __VSX__
10208static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
10209 unsigned const int __b) {
10210 unsigned char b0 = (__b & 0x01) * 8;
10211 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10212 b6 = b0 + 6, b7 = b0 + 7;
10213 return vec_perm(__a, __a,
10214 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10215 b2, b3, b4, b5, b6, b7));
10216}
10217static __inline__ vector bool long long __ATTRS_o_ai
10218vec_splat(vector bool long long __a, unsigned const int __b) {
10219 unsigned char b0 = (__b & 0x01) * 8;
10220 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10221 b6 = b0 + 6, b7 = b0 + 7;
10222 return vec_perm(__a, __a,
10223 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10224 b2, b3, b4, b5, b6, b7));
10225}
10226static __inline__ vector signed long long __ATTRS_o_ai
10227vec_splat(vector signed long long __a, unsigned const int __b) {
10228 unsigned char b0 = (__b & 0x01) * 8;
10229 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10230 b6 = b0 + 6, b7 = b0 + 7;
10231 return vec_perm(__a, __a,
10232 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10233 b2, b3, b4, b5, b6, b7));
10234}
10235static __inline__ vector unsigned long long __ATTRS_o_ai
10236vec_splat(vector unsigned long long __a, unsigned const int __b) {
10237 unsigned char b0 = (__b & 0x01) * 8;
10238 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
10239 b6 = b0 + 6, b7 = b0 + 7;
10240 return vec_perm(__a, __a,
10241 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
10242 b2, b3, b4, b5, b6, b7));
10243}
10244#endif
10245
10246/* vec_vspltb */
10247
10248#define __builtin_altivec_vspltb vec_vspltb
10249
10250static __inline__ vector signed char __ATTRS_o_ai
10251vec_vspltb(vector signed char __a, unsigned char __b) {
10252 return vec_perm(__a, __a, (vector unsigned char)(__b));
10253}
10254
10255static __inline__ vector unsigned char __ATTRS_o_ai
10256vec_vspltb(vector unsigned char __a, unsigned char __b) {
10257 return vec_perm(__a, __a, (vector unsigned char)(__b));
10258}
10259
10260static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
10261 unsigned char __b) {
10262 return vec_perm(__a, __a, (vector unsigned char)(__b));
10263}
10264
10265/* vec_vsplth */
10266
10267#define __builtin_altivec_vsplth vec_vsplth
10268
10269static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
10270 unsigned char __b) {
10271 __b *= 2;
10272 unsigned char b1 = __b + 1;
10273 return vec_perm(__a, __a,
10274 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10275 __b, b1, __b, b1, __b, b1, __b, b1));
10276}
10277
10278static __inline__ vector unsigned short __ATTRS_o_ai
10279vec_vsplth(vector unsigned short __a, unsigned char __b) {
10280 __b *= 2;
10281 unsigned char b1 = __b + 1;
10282 return vec_perm(__a, __a,
10283 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10284 __b, b1, __b, b1, __b, b1, __b, b1));
10285}
10286
10287static __inline__ vector bool short __ATTRS_o_ai
10288vec_vsplth(vector bool short __a, unsigned char __b) {
10289 __b *= 2;
10290 unsigned char b1 = __b + 1;
10291 return vec_perm(__a, __a,
10292 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10293 __b, b1, __b, b1, __b, b1, __b, b1));
10294}
10295
10296static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
10297 unsigned char __b) {
10298 __b *= 2;
10299 unsigned char b1 = __b + 1;
10300 return vec_perm(__a, __a,
10301 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
10302 __b, b1, __b, b1, __b, b1, __b, b1));
10303}
10304
10305/* vec_vspltw */
10306
10307#define __builtin_altivec_vspltw vec_vspltw
10308
10309static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
10310 unsigned char __b) {
10311 __b *= 4;
10312 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10313 return vec_perm(__a, __a,
10314 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10315 b1, b2, b3, __b, b1, b2, b3));
10316}
10317
10318static __inline__ vector unsigned int __ATTRS_o_ai
10319vec_vspltw(vector unsigned int __a, unsigned char __b) {
10320 __b *= 4;
10321 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10322 return vec_perm(__a, __a,
10323 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10324 b1, b2, b3, __b, b1, b2, b3));
10325}
10326
10327static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
10328 unsigned char __b) {
10329 __b *= 4;
10330 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10331 return vec_perm(__a, __a,
10332 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10333 b1, b2, b3, __b, b1, b2, b3));
10334}
10335
10336static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
10337 unsigned char __b) {
10338 __b *= 4;
10339 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
10340 return vec_perm(__a, __a,
10341 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
10342 b1, b2, b3, __b, b1, b2, b3));
10343}
10344
10345/* vec_splat_s8 */
10346
10347#define __builtin_altivec_vspltisb vec_splat_s8
10348
10349// FIXME: parameter should be treated as 5-bit signed literal
10350static __inline__ vector signed char __ATTRS_o_ai
10351vec_splat_s8(signed char __a) {
10352 return (vector signed char)(__a);
10353}
10354
10355/* vec_vspltisb */
10356
10357// FIXME: parameter should be treated as 5-bit signed literal
10358static __inline__ vector signed char __ATTRS_o_ai
10359vec_vspltisb(signed char __a) {
10360 return (vector signed char)(__a);
10361}
10362
10363/* vec_splat_s16 */
10364
10365#define __builtin_altivec_vspltish vec_splat_s16
10366
10367// FIXME: parameter should be treated as 5-bit signed literal
10368static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
10369 return (vector short)(__a);
10370}
10371
10372/* vec_vspltish */
10373
10374// FIXME: parameter should be treated as 5-bit signed literal
10375static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
10376 return (vector short)(__a);
10377}
10378
10379/* vec_splat_s32 */
10380
10381#define __builtin_altivec_vspltisw vec_splat_s32
10382
10383// FIXME: parameter should be treated as 5-bit signed literal
10384static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
10385 return (vector int)(__a);
10386}
10387
10388/* vec_vspltisw */
10389
10390// FIXME: parameter should be treated as 5-bit signed literal
10391static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
10392 return (vector int)(__a);
10393}
10394
10395/* vec_splat_u8 */
10396
10397// FIXME: parameter should be treated as 5-bit signed literal
10398static __inline__ vector unsigned char __ATTRS_o_ai
10399vec_splat_u8(unsigned char __a) {
10400 return (vector unsigned char)(__a);
10401}
10402
10403/* vec_splat_u16 */
10404
10405// FIXME: parameter should be treated as 5-bit signed literal
10406static __inline__ vector unsigned short __ATTRS_o_ai
10407vec_splat_u16(signed char __a) {
10408 return (vector unsigned short)(__a);
10409}
10410
10411/* vec_splat_u32 */
10412
10413// FIXME: parameter should be treated as 5-bit signed literal
10414static __inline__ vector unsigned int __ATTRS_o_ai
10415vec_splat_u32(signed char __a) {
10416 return (vector unsigned int)(__a);
10417}
10418
10419/* vec_sr */
10420
10421// vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
10422// than the length of __a.
10423static __inline__ vector unsigned char __ATTRS_o_ai
10424vec_sr(vector unsigned char __a, vector unsigned char __b) {
10425 return __a >>
10426 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
10427}
10428
10429static __inline__ vector signed char __ATTRS_o_ai
10430vec_sr(vector signed char __a, vector unsigned char __b) {
10431 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
10432}
10433
10434static __inline__ vector unsigned short __ATTRS_o_ai
10435vec_sr(vector unsigned short __a, vector unsigned short __b) {
10436 return __a >>
10437 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
10438}
10439
10440static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
10441 vector unsigned short __b) {
10442 return (vector short)vec_sr((vector unsigned short)__a, __b);
10443}
10444
10445static __inline__ vector unsigned int __ATTRS_o_ai
10446vec_sr(vector unsigned int __a, vector unsigned int __b) {
10447 return __a >>
10448 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
10449}
10450
10451static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
10452 vector unsigned int __b) {
10453 return (vector int)vec_sr((vector unsigned int)__a, __b);
10454}
10455
10456#ifdef __POWER8_VECTOR__
10457static __inline__ vector unsigned long long __ATTRS_o_ai
10458vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
10459 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
10460 __CHAR_BIT__));
10461}
10462
10463static __inline__ vector long long __ATTRS_o_ai
10464vec_sr(vector long long __a, vector unsigned long long __b) {
10465 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
10466}
10467#elif defined(__VSX__)
10468static __inline__ vector unsigned long long __ATTRS_o_ai
10469vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
10470 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10471
10472 // Big endian element zero (the left doubleword) can be right shifted as-is.
10473 // However the shift amount must be in the right doubleword.
10474 // The other element needs to be swapped into the left doubleword and
10475 // shifted. Then the left doublewords of the two result vectors are merged.
10476 vector unsigned long long __swapshift =
10477 __builtin_shufflevector(__b, __b, 1, 0);
10478 vector unsigned long long __leftelt =
10479 (vector unsigned long long)__builtin_altivec_vsro(
10480 (vector signed int)__a, (vector signed int)__swapshift);
10481#ifdef __LITTLE_ENDIAN__
10482 __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10483 (vector signed int)__leftelt,
10484 (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 0));
10485#else
10486 __leftelt = (vector unsigned long long)__builtin_altivec_vsr(
10487 (vector signed int)__leftelt,
10488 (vector signed int)vec_vspltb((vector unsigned char)__swapshift, 15));
10489#endif
10490 __a = __builtin_shufflevector(__a, __a, 1, 0);
10491 vector unsigned long long __rightelt =
10492 (vector unsigned long long)__builtin_altivec_vsro((vector signed int)__a,
10493 (vector signed int)__b);
10494#ifdef __LITTLE_ENDIAN__
10495 __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10496 (vector signed int)__rightelt,
10497 (vector signed int)vec_vspltb((vector unsigned char)__b, 0));
10498 return __builtin_shufflevector(__rightelt, __leftelt, 1, 3);
10499#else
10500 __rightelt = (vector unsigned long long)__builtin_altivec_vsr(
10501 (vector signed int)__rightelt,
10502 (vector signed int)vec_vspltb((vector unsigned char)__b, 15));
10503 return __builtin_shufflevector(__leftelt, __rightelt, 0, 2);
10504#endif
10505}
10506
10507static __inline__ vector long long __ATTRS_o_ai
10508vec_sr(vector long long __a, vector unsigned long long __b) {
10509 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
10510}
10511#endif /* __VSX__ */
10512
10513/* vec_vsrb */
10514
10515#define __builtin_altivec_vsrb vec_vsrb
10516
10517static __inline__ vector signed char __ATTRS_o_ai
10518vec_vsrb(vector signed char __a, vector unsigned char __b) {
10519 return vec_sr(__a, __b);
10520}
10521
10522static __inline__ vector unsigned char __ATTRS_o_ai
10523vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
10524 return vec_sr(__a, __b);
10525}
10526
10527/* vec_vsrh */
10528
10529#define __builtin_altivec_vsrh vec_vsrh
10530
10531static __inline__ vector short __ATTRS_o_ai
10532vec_vsrh(vector short __a, vector unsigned short __b) {
10533 return vec_sr(__a, __b);
10534}
10535
10536static __inline__ vector unsigned short __ATTRS_o_ai
10537vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
10538 return vec_sr(__a, __b);
10539}
10540
10541/* vec_vsrw */
10542
10543#define __builtin_altivec_vsrw vec_vsrw
10544
10545static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
10546 vector unsigned int __b) {
10547 return vec_sr(__a, __b);
10548}
10549
10550static __inline__ vector unsigned int __ATTRS_o_ai
10551vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
10552 return vec_sr(__a, __b);
10553}
10554
10555/* vec_sra */
10556
10557static __inline__ vector signed char __ATTRS_o_ai
10558vec_sra(vector signed char __a, vector unsigned char __b) {
10559 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
10560}
10561
10562static __inline__ vector unsigned char __ATTRS_o_ai
10563vec_sra(vector unsigned char __a, vector unsigned char __b) {
10564 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
10565}
10566
10567static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
10568 vector unsigned short __b) {
10569 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
10570}
10571
10572static __inline__ vector unsigned short __ATTRS_o_ai
10573vec_sra(vector unsigned short __a, vector unsigned short __b) {
10574 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
10575}
10576
10577static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
10578 vector unsigned int __b) {
10579 return __builtin_altivec_vsraw(__a, __b);
10580}
10581
10582static __inline__ vector unsigned int __ATTRS_o_ai
10583vec_sra(vector unsigned int __a, vector unsigned int __b) {
10584 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
10585}
10586
10587#ifdef __POWER8_VECTOR__
10588static __inline__ vector signed long long __ATTRS_o_ai
10589vec_sra(vector signed long long __a, vector unsigned long long __b) {
10590 return __a >> __b;
10591}
10592
10593static __inline__ vector unsigned long long __ATTRS_o_ai
10594vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10595 return (vector unsigned long long)((vector signed long long)__a >> __b);
10596}
10597#elif defined(__VSX__)
10598static __inline__ vector signed long long __ATTRS_o_ai
10599vec_sra(vector signed long long __a, vector unsigned long long __b) {
10600 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10601 return __a >> __b;
10602}
10603
10604static __inline__ vector unsigned long long __ATTRS_o_ai
10605vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
10606 __b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);
10607 return (vector unsigned long long)((vector signed long long)__a >> __b);
10608}
10609#endif /* __VSX__ */
10610
10611/* vec_vsrab */
10612
10613static __inline__ vector signed char __ATTRS_o_ai
10614vec_vsrab(vector signed char __a, vector unsigned char __b) {
10615 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
10616}
10617
10618static __inline__ vector unsigned char __ATTRS_o_ai
10619vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
10620 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
10621}
10622
10623/* vec_vsrah */
10624
10625static __inline__ vector short __ATTRS_o_ai
10626vec_vsrah(vector short __a, vector unsigned short __b) {
10627 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
10628}
10629
10630static __inline__ vector unsigned short __ATTRS_o_ai
10631vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
10632 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
10633}
10634
10635/* vec_vsraw */
10636
10637static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
10638 vector unsigned int __b) {
10639 return __builtin_altivec_vsraw(__a, __b);
10640}
10641
10642static __inline__ vector unsigned int __ATTRS_o_ai
10643vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
10644 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
10645}
10646
10647/* vec_srl */
10648
10649static __inline__ vector signed char __ATTRS_o_ai
10650vec_srl(vector signed char __a, vector unsigned char __b) {
10651 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10652 (vector int)__b);
10653}
10654
10655static __inline__ vector signed char __ATTRS_o_ai
10656vec_srl(vector signed char __a, vector unsigned short __b) {
10657 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10658 (vector int)__b);
10659}
10660
10661static __inline__ vector signed char __ATTRS_o_ai
10662vec_srl(vector signed char __a, vector unsigned int __b) {
10663 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10664 (vector int)__b);
10665}
10666
10667static __inline__ vector unsigned char __ATTRS_o_ai
10668vec_srl(vector unsigned char __a, vector unsigned char __b) {
10669 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10670 (vector int)__b);
10671}
10672
10673static __inline__ vector unsigned char __ATTRS_o_ai
10674vec_srl(vector unsigned char __a, vector unsigned short __b) {
10675 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10676 (vector int)__b);
10677}
10678
10679static __inline__ vector unsigned char __ATTRS_o_ai
10680vec_srl(vector unsigned char __a, vector unsigned int __b) {
10681 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10682 (vector int)__b);
10683}
10684
10685static __inline__ vector bool char __ATTRS_o_ai
10686vec_srl(vector bool char __a, vector unsigned char __b) {
10687 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10688 (vector int)__b);
10689}
10690
10691static __inline__ vector bool char __ATTRS_o_ai
10692vec_srl(vector bool char __a, vector unsigned short __b) {
10693 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10694 (vector int)__b);
10695}
10696
10697static __inline__ vector bool char __ATTRS_o_ai
10698vec_srl(vector bool char __a, vector unsigned int __b) {
10699 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10700 (vector int)__b);
10701}
10702
10703static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
10704 vector unsigned char __b) {
10705 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10706}
10707
10708static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
10709 vector unsigned short __b) {
10710 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10711}
10712
10713static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
10714 vector unsigned int __b) {
10715 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10716}
10717
10718static __inline__ vector unsigned short __ATTRS_o_ai
10719vec_srl(vector unsigned short __a, vector unsigned char __b) {
10720 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10721 (vector int)__b);
10722}
10723
10724static __inline__ vector unsigned short __ATTRS_o_ai
10725vec_srl(vector unsigned short __a, vector unsigned short __b) {
10726 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10727 (vector int)__b);
10728}
10729
10730static __inline__ vector unsigned short __ATTRS_o_ai
10731vec_srl(vector unsigned short __a, vector unsigned int __b) {
10732 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10733 (vector int)__b);
10734}
10735
10736static __inline__ vector bool short __ATTRS_o_ai
10737vec_srl(vector bool short __a, vector unsigned char __b) {
10738 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10739 (vector int)__b);
10740}
10741
10742static __inline__ vector bool short __ATTRS_o_ai
10743vec_srl(vector bool short __a, vector unsigned short __b) {
10744 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10745 (vector int)__b);
10746}
10747
10748static __inline__ vector bool short __ATTRS_o_ai
10749vec_srl(vector bool short __a, vector unsigned int __b) {
10750 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10751 (vector int)__b);
10752}
10753
10754static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
10755 vector unsigned char __b) {
10756 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10757}
10758
10759static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
10760 vector unsigned short __b) {
10761 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10762}
10763
10764static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
10765 vector unsigned int __b) {
10766 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10767}
10768
10769static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
10770 vector unsigned char __b) {
10771 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10772}
10773
10774static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
10775 vector unsigned short __b) {
10776 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10777}
10778
10779static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
10780 vector unsigned int __b) {
10781 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10782}
10783
10784static __inline__ vector unsigned int __ATTRS_o_ai
10785vec_srl(vector unsigned int __a, vector unsigned char __b) {
10786 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10787 (vector int)__b);
10788}
10789
10790static __inline__ vector unsigned int __ATTRS_o_ai
10791vec_srl(vector unsigned int __a, vector unsigned short __b) {
10792 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10793 (vector int)__b);
10794}
10795
10796static __inline__ vector unsigned int __ATTRS_o_ai
10797vec_srl(vector unsigned int __a, vector unsigned int __b) {
10798 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10799 (vector int)__b);
10800}
10801
10802static __inline__ vector bool int __ATTRS_o_ai
10803vec_srl(vector bool int __a, vector unsigned char __b) {
10804 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10805 (vector int)__b);
10806}
10807
10808static __inline__ vector bool int __ATTRS_o_ai
10809vec_srl(vector bool int __a, vector unsigned short __b) {
10810 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10811 (vector int)__b);
10812}
10813
10814static __inline__ vector bool int __ATTRS_o_ai
10815vec_srl(vector bool int __a, vector unsigned int __b) {
10816 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10817 (vector int)__b);
10818}
10819
10820#ifdef __VSX__
10821static __inline__ vector signed long long __ATTRS_o_ai
10822vec_srl(vector signed long long __a, vector unsigned char __b) {
10823 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
10824 (vector int)__b);
10825}
10826
10827static __inline__ vector unsigned long long __ATTRS_o_ai
10828vec_srl(vector unsigned long long __a, vector unsigned char __b) {
10829 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
10830 (vector int)__b);
10831}
10832#endif
10833
10834/* vec_vsr */
10835
10836static __inline__ vector signed char __ATTRS_o_ai
10837vec_vsr(vector signed char __a, vector unsigned char __b) {
10838 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10839 (vector int)__b);
10840}
10841
10842static __inline__ vector signed char __ATTRS_o_ai
10843vec_vsr(vector signed char __a, vector unsigned short __b) {
10844 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10845 (vector int)__b);
10846}
10847
10848static __inline__ vector signed char __ATTRS_o_ai
10849vec_vsr(vector signed char __a, vector unsigned int __b) {
10850 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
10851 (vector int)__b);
10852}
10853
10854static __inline__ vector unsigned char __ATTRS_o_ai
10855vec_vsr(vector unsigned char __a, vector unsigned char __b) {
10856 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10857 (vector int)__b);
10858}
10859
10860static __inline__ vector unsigned char __ATTRS_o_ai
10861vec_vsr(vector unsigned char __a, vector unsigned short __b) {
10862 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10863 (vector int)__b);
10864}
10865
10866static __inline__ vector unsigned char __ATTRS_o_ai
10867vec_vsr(vector unsigned char __a, vector unsigned int __b) {
10868 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
10869 (vector int)__b);
10870}
10871
10872static __inline__ vector bool char __ATTRS_o_ai
10873vec_vsr(vector bool char __a, vector unsigned char __b) {
10874 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10875 (vector int)__b);
10876}
10877
10878static __inline__ vector bool char __ATTRS_o_ai
10879vec_vsr(vector bool char __a, vector unsigned short __b) {
10880 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10881 (vector int)__b);
10882}
10883
10884static __inline__ vector bool char __ATTRS_o_ai
10885vec_vsr(vector bool char __a, vector unsigned int __b) {
10886 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
10887 (vector int)__b);
10888}
10889
10890static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
10891 vector unsigned char __b) {
10892 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10893}
10894
10895static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
10896 vector unsigned short __b) {
10897 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10898}
10899
10900static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
10901 vector unsigned int __b) {
10902 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10903}
10904
10905static __inline__ vector unsigned short __ATTRS_o_ai
10906vec_vsr(vector unsigned short __a, vector unsigned char __b) {
10907 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10908 (vector int)__b);
10909}
10910
10911static __inline__ vector unsigned short __ATTRS_o_ai
10912vec_vsr(vector unsigned short __a, vector unsigned short __b) {
10913 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10914 (vector int)__b);
10915}
10916
10917static __inline__ vector unsigned short __ATTRS_o_ai
10918vec_vsr(vector unsigned short __a, vector unsigned int __b) {
10919 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
10920 (vector int)__b);
10921}
10922
10923static __inline__ vector bool short __ATTRS_o_ai
10924vec_vsr(vector bool short __a, vector unsigned char __b) {
10925 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10926 (vector int)__b);
10927}
10928
10929static __inline__ vector bool short __ATTRS_o_ai
10930vec_vsr(vector bool short __a, vector unsigned short __b) {
10931 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10932 (vector int)__b);
10933}
10934
10935static __inline__ vector bool short __ATTRS_o_ai
10936vec_vsr(vector bool short __a, vector unsigned int __b) {
10937 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10938 (vector int)__b);
10939}
10940
10941static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10942 vector unsigned char __b) {
10943 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10944}
10945
10946static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10947 vector unsigned short __b) {
10948 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10949}
10950
10951static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10952 vector unsigned int __b) {
10953 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10954}
10955
10956static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10957 vector unsigned char __b) {
10958 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10959}
10960
10961static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10962 vector unsigned short __b) {
10963 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10964}
10965
10966static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10967 vector unsigned int __b) {
10968 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10969}
10970
10971static __inline__ vector unsigned int __ATTRS_o_ai
10972vec_vsr(vector unsigned int __a, vector unsigned char __b) {
10973 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10974 (vector int)__b);
10975}
10976
10977static __inline__ vector unsigned int __ATTRS_o_ai
10978vec_vsr(vector unsigned int __a, vector unsigned short __b) {
10979 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10980 (vector int)__b);
10981}
10982
10983static __inline__ vector unsigned int __ATTRS_o_ai
10984vec_vsr(vector unsigned int __a, vector unsigned int __b) {
10985 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10986 (vector int)__b);
10987}
10988
10989static __inline__ vector bool int __ATTRS_o_ai
10990vec_vsr(vector bool int __a, vector unsigned char __b) {
10991 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10992 (vector int)__b);
10993}
10994
10995static __inline__ vector bool int __ATTRS_o_ai
10996vec_vsr(vector bool int __a, vector unsigned short __b) {
10997 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10998 (vector int)__b);
10999}
11000
11001static __inline__ vector bool int __ATTRS_o_ai
11002vec_vsr(vector bool int __a, vector unsigned int __b) {
11003 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
11004 (vector int)__b);
11005}
11006
11007/* vec_sro */
11008
11009static __inline__ vector signed char __ATTRS_o_ai
11010vec_sro(vector signed char __a, vector signed char __b) {
11011 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
11012 (vector int)__b);
11013}
11014
11015static __inline__ vector signed char __ATTRS_o_ai
11016vec_sro(vector signed char __a, vector unsigned char __b) {
11017 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
11018 (vector int)__b);
11019}
11020
11021static __inline__ vector unsigned char __ATTRS_o_ai
11022vec_sro(vector unsigned char __a, vector signed char __b) {
11023 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
11024 (vector int)__b);
11025}
11026
11027static __inline__ vector unsigned char __ATTRS_o_ai
11028vec_sro(vector unsigned char __a, vector unsigned char __b) {
11029 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
11030 (vector int)__b);
11031}
11032
11033static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
11034 vector signed char __b) {
11035 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11036}
11037
11038static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
11039 vector unsigned char __b) {
11040 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11041}
11042
11043static __inline__ vector unsigned short __ATTRS_o_ai
11044vec_sro(vector unsigned short __a, vector signed char __b) {
11045 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
11046 (vector int)__b);
11047}
11048
11049static __inline__ vector unsigned short __ATTRS_o_ai
11050vec_sro(vector unsigned short __a, vector unsigned char __b) {
11051 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
11052 (vector int)__b);
11053}
11054
11055static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
11056 vector signed char __b) {
11057 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11058}
11059
11060static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
11061 vector unsigned char __b) {
11062 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11063}
11064
11065static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
11066 vector signed char __b) {
11067 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
11068}
11069
11070static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
11071 vector unsigned char __b) {
11072 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
11073}
11074
11075static __inline__ vector unsigned int __ATTRS_o_ai
11076vec_sro(vector unsigned int __a, vector signed char __b) {
11077 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
11078 (vector int)__b);
11079}
11080
11081static __inline__ vector unsigned int __ATTRS_o_ai
11082vec_sro(vector unsigned int __a, vector unsigned char __b) {
11083 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
11084 (vector int)__b);
11085}
11086
11087static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
11088 vector signed char __b) {
11089 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11090}
11091
11092static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
11093 vector unsigned char __b) {
11094 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11095}
11096
11097#ifdef __VSX__
11098static __inline__ vector signed long long __ATTRS_o_ai
11099vec_sro(vector signed long long __a, vector signed char __b) {
11100 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
11101 (vector int)__b);
11102}
11103
11104static __inline__ vector signed long long __ATTRS_o_ai
11105vec_sro(vector signed long long __a, vector unsigned char __b) {
11106 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
11107 (vector int)__b);
11108}
11109
11110static __inline__ vector unsigned long long __ATTRS_o_ai
11111vec_sro(vector unsigned long long __a, vector signed char __b) {
11112 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
11113 (vector int)__b);
11114}
11115
11116static __inline__ vector unsigned long long __ATTRS_o_ai
11117vec_sro(vector unsigned long long __a, vector unsigned char __b) {
11118 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
11119 (vector int)__b);
11120}
11121#endif
11122
11123/* vec_vsro */
11124
11125static __inline__ vector signed char __ATTRS_o_ai
11126vec_vsro(vector signed char __a, vector signed char __b) {
11127 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
11128 (vector int)__b);
11129}
11130
11131static __inline__ vector signed char __ATTRS_o_ai
11132vec_vsro(vector signed char __a, vector unsigned char __b) {
11133 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
11134 (vector int)__b);
11135}
11136
11137static __inline__ vector unsigned char __ATTRS_o_ai
11138vec_vsro(vector unsigned char __a, vector signed char __b) {
11139 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
11140 (vector int)__b);
11141}
11142
11143static __inline__ vector unsigned char __ATTRS_o_ai
11144vec_vsro(vector unsigned char __a, vector unsigned char __b) {
11145 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
11146 (vector int)__b);
11147}
11148
11149static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
11150 vector signed char __b) {
11151 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11152}
11153
11154static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
11155 vector unsigned char __b) {
11156 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11157}
11158
11159static __inline__ vector unsigned short __ATTRS_o_ai
11160vec_vsro(vector unsigned short __a, vector signed char __b) {
11161 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
11162 (vector int)__b);
11163}
11164
11165static __inline__ vector unsigned short __ATTRS_o_ai
11166vec_vsro(vector unsigned short __a, vector unsigned char __b) {
11167 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
11168 (vector int)__b);
11169}
11170
11171static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
11172 vector signed char __b) {
11173 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11174}
11175
11176static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
11177 vector unsigned char __b) {
11178 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11179}
11180
11181static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
11182 vector signed char __b) {
11183 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
11184}
11185
11186static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
11187 vector unsigned char __b) {
11188 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
11189}
11190
11191static __inline__ vector unsigned int __ATTRS_o_ai
11192vec_vsro(vector unsigned int __a, vector signed char __b) {
11193 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
11194 (vector int)__b);
11195}
11196
11197static __inline__ vector unsigned int __ATTRS_o_ai
11198vec_vsro(vector unsigned int __a, vector unsigned char __b) {
11199 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
11200 (vector int)__b);
11201}
11202
11203static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
11204 vector signed char __b) {
11205 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11206}
11207
11208static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
11209 vector unsigned char __b) {
11210 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
11211}
11212
11213/* vec_st */
11214
11215static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
11216 vector signed char *__c) {
11217 __builtin_altivec_stvx((vector int)__a, __b, __c);
11218}
11219
11220static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,
11221 signed char *__c) {
11222 __builtin_altivec_stvx((vector int)__a, __b, __c);
11223}
11224
11225static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
11226 vector unsigned char *__c) {
11227 __builtin_altivec_stvx((vector int)__a, __b, __c);
11228}
11229
11230static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,
11231 unsigned char *__c) {
11232 __builtin_altivec_stvx((vector int)__a, __b, __c);
11233}
11234
11235static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
11236 signed char *__c) {
11237 __builtin_altivec_stvx((vector int)__a, __b, __c);
11238}
11239
11240static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
11241 unsigned char *__c) {
11242 __builtin_altivec_stvx((vector int)__a, __b, __c);
11243}
11244
11245static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,
11246 vector bool char *__c) {
11247 __builtin_altivec_stvx((vector int)__a, __b, __c);
11248}
11249
11250static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
11251 vector short *__c) {
11252 __builtin_altivec_stvx((vector int)__a, __b, __c);
11253}
11254
11255static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,
11256 short *__c) {
11257 __builtin_altivec_stvx((vector int)__a, __b, __c);
11258}
11259
11260static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
11261 vector unsigned short *__c) {
11262 __builtin_altivec_stvx((vector int)__a, __b, __c);
11263}
11264
11265static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,
11266 unsigned short *__c) {
11267 __builtin_altivec_stvx((vector int)__a, __b, __c);
11268}
11269
11270static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
11271 short *__c) {
11272 __builtin_altivec_stvx((vector int)__a, __b, __c);
11273}
11274
11275static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
11276 unsigned short *__c) {
11277 __builtin_altivec_stvx((vector int)__a, __b, __c);
11278}
11279
11280static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,
11281 vector bool short *__c) {
11282 __builtin_altivec_stvx((vector int)__a, __b, __c);
11283}
11284
11285static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
11286 short *__c) {
11287 __builtin_altivec_stvx((vector int)__a, __b, __c);
11288}
11289
11290static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
11291 unsigned short *__c) {
11292 __builtin_altivec_stvx((vector int)__a, __b, __c);
11293}
11294
11295static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,
11296 vector pixel *__c) {
11297 __builtin_altivec_stvx((vector int)__a, __b, __c);
11298}
11299
11300static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b,
11301 vector int *__c) {
11302 __builtin_altivec_stvx(__a, __b, __c);
11303}
11304
11305static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b, int *__c) {
11306 __builtin_altivec_stvx(__a, __b, __c);
11307}
11308
11309static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
11310 vector unsigned int *__c) {
11311 __builtin_altivec_stvx((vector int)__a, __b, __c);
11312}
11313
11314static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,
11315 unsigned int *__c) {
11316 __builtin_altivec_stvx((vector int)__a, __b, __c);
11317}
11318
11319static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
11320 int *__c) {
11321 __builtin_altivec_stvx((vector int)__a, __b, __c);
11322}
11323
11324static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
11325 unsigned int *__c) {
11326 __builtin_altivec_stvx((vector int)__a, __b, __c);
11327}
11328
11329static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,
11330 vector bool int *__c) {
11331 __builtin_altivec_stvx((vector int)__a, __b, __c);
11332}
11333
11334static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
11335 vector float *__c) {
11336 __builtin_altivec_stvx((vector int)__a, __b, __c);
11337}
11338
11339static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,
11340 float *__c) {
11341 __builtin_altivec_stvx((vector int)__a, __b, __c);
11342}
11343
11344/* vec_stvx */
11345
11346static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
11347 vector signed char *__c) {
11348 __builtin_altivec_stvx((vector int)__a, __b, __c);
11349}
11350
11351static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,
11352 signed char *__c) {
11353 __builtin_altivec_stvx((vector int)__a, __b, __c);
11354}
11355
11356static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
11357 vector unsigned char *__c) {
11358 __builtin_altivec_stvx((vector int)__a, __b, __c);
11359}
11360
11361static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,
11362 unsigned char *__c) {
11363 __builtin_altivec_stvx((vector int)__a, __b, __c);
11364}
11365
11366static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
11367 signed char *__c) {
11368 __builtin_altivec_stvx((vector int)__a, __b, __c);
11369}
11370
11371static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
11372 unsigned char *__c) {
11373 __builtin_altivec_stvx((vector int)__a, __b, __c);
11374}
11375
11376static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,
11377 vector bool char *__c) {
11378 __builtin_altivec_stvx((vector int)__a, __b, __c);
11379}
11380
11381static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
11382 vector short *__c) {
11383 __builtin_altivec_stvx((vector int)__a, __b, __c);
11384}
11385
11386static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,
11387 short *__c) {
11388 __builtin_altivec_stvx((vector int)__a, __b, __c);
11389}
11390
11391static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
11392 vector unsigned short *__c) {
11393 __builtin_altivec_stvx((vector int)__a, __b, __c);
11394}
11395
11396static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,
11397 unsigned short *__c) {
11398 __builtin_altivec_stvx((vector int)__a, __b, __c);
11399}
11400
11401static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
11402 short *__c) {
11403 __builtin_altivec_stvx((vector int)__a, __b, __c);
11404}
11405
11406static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
11407 unsigned short *__c) {
11408 __builtin_altivec_stvx((vector int)__a, __b, __c);
11409}
11410
11411static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,
11412 vector bool short *__c) {
11413 __builtin_altivec_stvx((vector int)__a, __b, __c);
11414}
11415
11416static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
11417 short *__c) {
11418 __builtin_altivec_stvx((vector int)__a, __b, __c);
11419}
11420
11421static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
11422 unsigned short *__c) {
11423 __builtin_altivec_stvx((vector int)__a, __b, __c);
11424}
11425
11426static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,
11427 vector pixel *__c) {
11428 __builtin_altivec_stvx((vector int)__a, __b, __c);
11429}
11430
11431static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
11432 vector int *__c) {
11433 __builtin_altivec_stvx(__a, __b, __c);
11434}
11435
11436static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,
11437 int *__c) {
11438 __builtin_altivec_stvx(__a, __b, __c);
11439}
11440
11441static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
11442 vector unsigned int *__c) {
11443 __builtin_altivec_stvx((vector int)__a, __b, __c);
11444}
11445
11446static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,
11447 unsigned int *__c) {
11448 __builtin_altivec_stvx((vector int)__a, __b, __c);
11449}
11450
11451static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
11452 int *__c) {
11453 __builtin_altivec_stvx((vector int)__a, __b, __c);
11454}
11455
11456static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
11457 unsigned int *__c) {
11458 __builtin_altivec_stvx((vector int)__a, __b, __c);
11459}
11460
11461static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,
11462 vector bool int *__c) {
11463 __builtin_altivec_stvx((vector int)__a, __b, __c);
11464}
11465
11466static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
11467 vector float *__c) {
11468 __builtin_altivec_stvx((vector int)__a, __b, __c);
11469}
11470
11471static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,
11472 float *__c) {
11473 __builtin_altivec_stvx((vector int)__a, __b, __c);
11474}
11475
11476/* vec_ste */
11477
11478static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, long __b,
11479 signed char *__c) {
11480 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11481}
11482
11483static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, long __b,
11484 unsigned char *__c) {
11485 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11486}
11487
11488static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
11489 signed char *__c) {
11490 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11491}
11492
11493static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,
11494 unsigned char *__c) {
11495 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11496}
11497
11498static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, long __b,
11499 short *__c) {
11500 __builtin_altivec_stvehx(__a, __b, __c);
11501}
11502
11503static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, long __b,
11504 unsigned short *__c) {
11505 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11506}
11507
11508static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
11509 short *__c) {
11510 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11511}
11512
11513static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,
11514 unsigned short *__c) {
11515 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11516}
11517
11518static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
11519 short *__c) {
11520 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11521}
11522
11523static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,
11524 unsigned short *__c) {
11525 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11526}
11527
11528static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, long __b, int *__c) {
11529 __builtin_altivec_stvewx(__a, __b, __c);
11530}
11531
11532static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, long __b,
11533 unsigned int *__c) {
11534 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11535}
11536
11537static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
11538 int *__c) {
11539 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11540}
11541
11542static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,
11543 unsigned int *__c) {
11544 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11545}
11546
11547static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, long __b,
11548 float *__c) {
11549 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11550}
11551
11552/* vec_stvebx */
11553
11554static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, long __b,
11555 signed char *__c) {
11556 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11557}
11558
11559static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
11560 long __b, unsigned char *__c) {
11561 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11562}
11563
11564static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
11565 signed char *__c) {
11566 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11567}
11568
11569static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,
11570 unsigned char *__c) {
11571 __builtin_altivec_stvebx((vector char)__a, __b, __c);
11572}
11573
11574/* vec_stvehx */
11575
11576static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, long __b,
11577 short *__c) {
11578 __builtin_altivec_stvehx(__a, __b, __c);
11579}
11580
11581static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
11582 long __b, unsigned short *__c) {
11583 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11584}
11585
11586static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11587 short *__c) {
11588 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11589}
11590
11591static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,
11592 unsigned short *__c) {
11593 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11594}
11595
11596static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11597 short *__c) {
11598 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11599}
11600
11601static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,
11602 unsigned short *__c) {
11603 __builtin_altivec_stvehx((vector short)__a, __b, __c);
11604}
11605
11606/* vec_stvewx */
11607
11608static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, long __b,
11609 int *__c) {
11610 __builtin_altivec_stvewx(__a, __b, __c);
11611}
11612
11613static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, long __b,
11614 unsigned int *__c) {
11615 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11616}
11617
11618static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11619 int *__c) {
11620 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11621}
11622
11623static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,
11624 unsigned int *__c) {
11625 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11626}
11627
11628static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, long __b,
11629 float *__c) {
11630 __builtin_altivec_stvewx((vector int)__a, __b, __c);
11631}
11632
11633/* vec_stl */
11634
11635static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
11636 vector signed char *__c) {
11637 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11638}
11639
11640static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
11641 signed char *__c) {
11642 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11643}
11644
11645static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
11646 vector unsigned char *__c) {
11647 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11648}
11649
11650static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
11651 unsigned char *__c) {
11652 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11653}
11654
11655static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
11656 signed char *__c) {
11657 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11658}
11659
11660static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
11661 unsigned char *__c) {
11662 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11663}
11664
11665static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
11666 vector bool char *__c) {
11667 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11668}
11669
11670static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
11671 vector short *__c) {
11672 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11673}
11674
11675static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
11676 short *__c) {
11677 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11678}
11679
11680static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
11681 vector unsigned short *__c) {
11682 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11683}
11684
11685static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
11686 unsigned short *__c) {
11687 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11688}
11689
11690static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
11691 short *__c) {
11692 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11693}
11694
11695static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
11696 unsigned short *__c) {
11697 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11698}
11699
11700static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
11701 vector bool short *__c) {
11702 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11703}
11704
11705static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
11706 short *__c) {
11707 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11708}
11709
11710static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
11711 unsigned short *__c) {
11712 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11713}
11714
11715static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
11716 vector pixel *__c) {
11717 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11718}
11719
11720static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
11721 vector int *__c) {
11722 __builtin_altivec_stvxl(__a, __b, __c);
11723}
11724
11725static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
11726 __builtin_altivec_stvxl(__a, __b, __c);
11727}
11728
11729static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
11730 vector unsigned int *__c) {
11731 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11732}
11733
11734static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
11735 unsigned int *__c) {
11736 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11737}
11738
11739static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
11740 int *__c) {
11741 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11742}
11743
11744static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
11745 unsigned int *__c) {
11746 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11747}
11748
11749static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
11750 vector bool int *__c) {
11751 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11752}
11753
11754static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
11755 vector float *__c) {
11756 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11757}
11758
11759static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
11760 float *__c) {
11761 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11762}
11763
11764/* vec_stvxl */
11765
11766static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
11767 vector signed char *__c) {
11768 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11769}
11770
11771static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
11772 signed char *__c) {
11773 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11774}
11775
11776static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
11777 vector unsigned char *__c) {
11778 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11779}
11780
11781static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
11782 unsigned char *__c) {
11783 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11784}
11785
11786static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
11787 signed char *__c) {
11788 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11789}
11790
11791static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
11792 unsigned char *__c) {
11793 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11794}
11795
11796static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
11797 vector bool char *__c) {
11798 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11799}
11800
11801static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
11802 vector short *__c) {
11803 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11804}
11805
11806static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
11807 short *__c) {
11808 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11809}
11810
11811static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
11812 int __b,
11813 vector unsigned short *__c) {
11814 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11815}
11816
11817static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
11818 int __b, unsigned short *__c) {
11819 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11820}
11821
11822static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
11823 short *__c) {
11824 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11825}
11826
11827static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
11828 unsigned short *__c) {
11829 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11830}
11831
11832static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
11833 vector bool short *__c) {
11834 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11835}
11836
11837static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
11838 short *__c) {
11839 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11840}
11841
11842static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
11843 unsigned short *__c) {
11844 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11845}
11846
11847static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
11848 vector pixel *__c) {
11849 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11850}
11851
11852static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
11853 vector int *__c) {
11854 __builtin_altivec_stvxl(__a, __b, __c);
11855}
11856
11857static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
11858 int *__c) {
11859 __builtin_altivec_stvxl(__a, __b, __c);
11860}
11861
11862static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
11863 vector unsigned int *__c) {
11864 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11865}
11866
11867static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
11868 unsigned int *__c) {
11869 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11870}
11871
11872static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
11873 int *__c) {
11874 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11875}
11876
11877static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
11878 unsigned int *__c) {
11879 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11880}
11881
11882static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
11883 vector bool int *__c) {
11884 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11885}
11886
11887static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
11888 vector float *__c) {
11889 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11890}
11891
11892static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
11893 float *__c) {
11894 __builtin_altivec_stvxl((vector int)__a, __b, __c);
11895}
11896
11897/* vec_sub */
11898
11899static __inline__ vector signed char __ATTRS_o_ai
11900vec_sub(vector signed char __a, vector signed char __b) {
11901 return __a - __b;
11902}
11903
11904static __inline__ vector signed char __ATTRS_o_ai
11905vec_sub(vector bool char __a, vector signed char __b) {
11906 return (vector signed char)__a - __b;
11907}
11908
11909static __inline__ vector signed char __ATTRS_o_ai
11910vec_sub(vector signed char __a, vector bool char __b) {
11911 return __a - (vector signed char)__b;
11912}
11913
11914static __inline__ vector unsigned char __ATTRS_o_ai
11915vec_sub(vector unsigned char __a, vector unsigned char __b) {
11916 return __a - __b;
11917}
11918
11919static __inline__ vector unsigned char __ATTRS_o_ai
11920vec_sub(vector bool char __a, vector unsigned char __b) {
11921 return (vector unsigned char)__a - __b;
11922}
11923
11924static __inline__ vector unsigned char __ATTRS_o_ai
11925vec_sub(vector unsigned char __a, vector bool char __b) {
11926 return __a - (vector unsigned char)__b;
11927}
11928
11929static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
11930 vector short __b) {
11931 return __a - __b;
11932}
11933
11934static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
11935 vector short __b) {
11936 return (vector short)__a - __b;
11937}
11938
11939static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
11940 vector bool short __b) {
11941 return __a - (vector short)__b;
11942}
11943
11944static __inline__ vector unsigned short __ATTRS_o_ai
11945vec_sub(vector unsigned short __a, vector unsigned short __b) {
11946 return __a - __b;
11947}
11948
11949static __inline__ vector unsigned short __ATTRS_o_ai
11950vec_sub(vector bool short __a, vector unsigned short __b) {
11951 return (vector unsigned short)__a - __b;
11952}
11953
11954static __inline__ vector unsigned short __ATTRS_o_ai
11955vec_sub(vector unsigned short __a, vector bool short __b) {
11956 return __a - (vector unsigned short)__b;
11957}
11958
11959static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11960 vector int __b) {
11961 return __a - __b;
11962}
11963
11964static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
11965 vector int __b) {
11966 return (vector int)__a - __b;
11967}
11968
11969static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11970 vector bool int __b) {
11971 return __a - (vector int)__b;
11972}
11973
11974static __inline__ vector unsigned int __ATTRS_o_ai
11975vec_sub(vector unsigned int __a, vector unsigned int __b) {
11976 return __a - __b;
11977}
11978
11979static __inline__ vector unsigned int __ATTRS_o_ai
11980vec_sub(vector bool int __a, vector unsigned int __b) {
11981 return (vector unsigned int)__a - __b;
11982}
11983
11984static __inline__ vector unsigned int __ATTRS_o_ai
11985vec_sub(vector unsigned int __a, vector bool int __b) {
11986 return __a - (vector unsigned int)__b;
11987}
11988
11989#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
11990 defined(__SIZEOF_INT128__)
11991static __inline__ vector signed __int128 __ATTRS_o_ai
11992vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11993 return __a - __b;
11994}
11995
11996static __inline__ vector unsigned __int128 __ATTRS_o_ai
11997vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11998 return __a - __b;
11999}
12000#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&
12001 // defined(__SIZEOF_INT128__)
12002
12003#ifdef __VSX__
12004static __inline__ vector signed long long __ATTRS_o_ai
12005vec_sub(vector signed long long __a, vector signed long long __b) {
12006 return __a - __b;
12007}
12008
12009static __inline__ vector unsigned long long __ATTRS_o_ai
12010vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
12011 return __a - __b;
12012}
12013
12014static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
12015 vector double __b) {
12016 return __a - __b;
12017}
12018#endif
12019
12020static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
12021 vector float __b) {
12022 return __a - __b;
12023}
12024
12025/* vec_vsububm */
12026
12027#define __builtin_altivec_vsububm vec_vsububm
12028
12029static __inline__ vector signed char __ATTRS_o_ai
12030vec_vsububm(vector signed char __a, vector signed char __b) {
12031 return __a - __b;
12032}
12033
12034static __inline__ vector signed char __ATTRS_o_ai
12035vec_vsububm(vector bool char __a, vector signed char __b) {
12036 return (vector signed char)__a - __b;
12037}
12038
12039static __inline__ vector signed char __ATTRS_o_ai
12040vec_vsububm(vector signed char __a, vector bool char __b) {
12041 return __a - (vector signed char)__b;
12042}
12043
12044static __inline__ vector unsigned char __ATTRS_o_ai
12045vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
12046 return __a - __b;
12047}
12048
12049static __inline__ vector unsigned char __ATTRS_o_ai
12050vec_vsububm(vector bool char __a, vector unsigned char __b) {
12051 return (vector unsigned char)__a - __b;
12052}
12053
12054static __inline__ vector unsigned char __ATTRS_o_ai
12055vec_vsububm(vector unsigned char __a, vector bool char __b) {
12056 return __a - (vector unsigned char)__b;
12057}
12058
12059/* vec_vsubuhm */
12060
12061#define __builtin_altivec_vsubuhm vec_vsubuhm
12062
12063static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
12064 vector short __b) {
12065 return __a - __b;
12066}
12067
12068static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
12069 vector short __b) {
12070 return (vector short)__a - __b;
12071}
12072
12073static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
12074 vector bool short __b) {
12075 return __a - (vector short)__b;
12076}
12077
12078static __inline__ vector unsigned short __ATTRS_o_ai
12079vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
12080 return __a - __b;
12081}
12082
12083static __inline__ vector unsigned short __ATTRS_o_ai
12084vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
12085 return (vector unsigned short)__a - __b;
12086}
12087
12088static __inline__ vector unsigned short __ATTRS_o_ai
12089vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
12090 return __a - (vector unsigned short)__b;
12091}
12092
12093/* vec_vsubuwm */
12094
12095#define __builtin_altivec_vsubuwm vec_vsubuwm
12096
12097static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
12098 vector int __b) {
12099 return __a - __b;
12100}
12101
12102static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
12103 vector int __b) {
12104 return (vector int)__a - __b;
12105}
12106
12107static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
12108 vector bool int __b) {
12109 return __a - (vector int)__b;
12110}
12111
12112static __inline__ vector unsigned int __ATTRS_o_ai
12113vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
12114 return __a - __b;
12115}
12116
12117static __inline__ vector unsigned int __ATTRS_o_ai
12118vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
12119 return (vector unsigned int)__a - __b;
12120}
12121
12122static __inline__ vector unsigned int __ATTRS_o_ai
12123vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
12124 return __a - (vector unsigned int)__b;
12125}
12126
12127/* vec_vsubfp */
12128
12129#define __builtin_altivec_vsubfp vec_vsubfp
12130
12131static __inline__ vector float __attribute__((__always_inline__))
12132vec_vsubfp(vector float __a, vector float __b) {
12133 return __a - __b;
12134}
12135
12136/* vec_subc */
12137
12138static __inline__ vector signed int __ATTRS_o_ai
12139vec_subc(vector signed int __a, vector signed int __b) {
12140 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
12141 (vector unsigned int) __b);
12142}
12143
12144static __inline__ vector unsigned int __ATTRS_o_ai
12145vec_subc(vector unsigned int __a, vector unsigned int __b) {
12146 return __builtin_altivec_vsubcuw(__a, __b);
12147}
12148
12149#ifdef __POWER8_VECTOR__
12150#ifdef __SIZEOF_INT128__
12151static __inline__ vector unsigned __int128 __ATTRS_o_ai
12152vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
12153 return __builtin_altivec_vsubcuq(__a, __b);
12154}
12155
12156static __inline__ vector signed __int128 __ATTRS_o_ai
12157vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
12158 return (vector signed __int128)__builtin_altivec_vsubcuq(
12159 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
12160}
12161#endif
12162
12163static __inline__ vector unsigned char __attribute__((__always_inline__))
12164vec_subc_u128(vector unsigned char __a, vector unsigned char __b) {
12165 return (vector unsigned char)__builtin_altivec_vsubcuq_c(
12166 (vector unsigned char)__a, (vector unsigned char)__b);
12167}
12168#endif // __POWER8_VECTOR__
12169
12170/* vec_vsubcuw */
12171
12172static __inline__ vector unsigned int __attribute__((__always_inline__))
12173vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
12174 return __builtin_altivec_vsubcuw(__a, __b);
12175}
12176
12177/* vec_subs */
12178
12179static __inline__ vector signed char __ATTRS_o_ai
12180vec_subs(vector signed char __a, vector signed char __b) {
12181 return __builtin_altivec_vsubsbs(__a, __b);
12182}
12183
12184static __inline__ vector signed char __ATTRS_o_ai
12185vec_subs(vector bool char __a, vector signed char __b) {
12186 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
12187}
12188
12189static __inline__ vector signed char __ATTRS_o_ai
12190vec_subs(vector signed char __a, vector bool char __b) {
12191 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
12192}
12193
12194static __inline__ vector unsigned char __ATTRS_o_ai
12195vec_subs(vector unsigned char __a, vector unsigned char __b) {
12196 return __builtin_altivec_vsububs(__a, __b);
12197}
12198
12199static __inline__ vector unsigned char __ATTRS_o_ai
12200vec_subs(vector bool char __a, vector unsigned char __b) {
12201 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
12202}
12203
12204static __inline__ vector unsigned char __ATTRS_o_ai
12205vec_subs(vector unsigned char __a, vector bool char __b) {
12206 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
12207}
12208
12209static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
12210 vector short __b) {
12211 return __builtin_altivec_vsubshs(__a, __b);
12212}
12213
12214static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
12215 vector short __b) {
12216 return __builtin_altivec_vsubshs((vector short)__a, __b);
12217}
12218
12219static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
12220 vector bool short __b) {
12221 return __builtin_altivec_vsubshs(__a, (vector short)__b);
12222}
12223
12224static __inline__ vector unsigned short __ATTRS_o_ai
12225vec_subs(vector unsigned short __a, vector unsigned short __b) {
12226 return __builtin_altivec_vsubuhs(__a, __b);
12227}
12228
12229static __inline__ vector unsigned short __ATTRS_o_ai
12230vec_subs(vector bool short __a, vector unsigned short __b) {
12231 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
12232}
12233
12234static __inline__ vector unsigned short __ATTRS_o_ai
12235vec_subs(vector unsigned short __a, vector bool short __b) {
12236 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
12237}
12238
12239static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
12240 vector int __b) {
12241 return __builtin_altivec_vsubsws(__a, __b);
12242}
12243
12244static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
12245 vector int __b) {
12246 return __builtin_altivec_vsubsws((vector int)__a, __b);
12247}
12248
12249static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
12250 vector bool int __b) {
12251 return __builtin_altivec_vsubsws(__a, (vector int)__b);
12252}
12253
12254static __inline__ vector unsigned int __ATTRS_o_ai
12255vec_subs(vector unsigned int __a, vector unsigned int __b) {
12256 return __builtin_altivec_vsubuws(__a, __b);
12257}
12258
12259static __inline__ vector unsigned int __ATTRS_o_ai
12260vec_subs(vector bool int __a, vector unsigned int __b) {
12261 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
12262}
12263
12264static __inline__ vector unsigned int __ATTRS_o_ai
12265vec_subs(vector unsigned int __a, vector bool int __b) {
12266 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
12267}
12268
12269/* vec_vsubsbs */
12270
12271static __inline__ vector signed char __ATTRS_o_ai
12272vec_vsubsbs(vector signed char __a, vector signed char __b) {
12273 return __builtin_altivec_vsubsbs(__a, __b);
12274}
12275
12276static __inline__ vector signed char __ATTRS_o_ai
12277vec_vsubsbs(vector bool char __a, vector signed char __b) {
12278 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
12279}
12280
12281static __inline__ vector signed char __ATTRS_o_ai
12282vec_vsubsbs(vector signed char __a, vector bool char __b) {
12283 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
12284}
12285
12286/* vec_vsububs */
12287
12288static __inline__ vector unsigned char __ATTRS_o_ai
12289vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
12290 return __builtin_altivec_vsububs(__a, __b);
12291}
12292
12293static __inline__ vector unsigned char __ATTRS_o_ai
12294vec_vsububs(vector bool char __a, vector unsigned char __b) {
12295 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
12296}
12297
12298static __inline__ vector unsigned char __ATTRS_o_ai
12299vec_vsububs(vector unsigned char __a, vector bool char __b) {
12300 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
12301}
12302
12303/* vec_vsubshs */
12304
12305static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
12306 vector short __b) {
12307 return __builtin_altivec_vsubshs(__a, __b);
12308}
12309
12310static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
12311 vector short __b) {
12312 return __builtin_altivec_vsubshs((vector short)__a, __b);
12313}
12314
12315static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
12316 vector bool short __b) {
12317 return __builtin_altivec_vsubshs(__a, (vector short)__b);
12318}
12319
12320/* vec_vsubuhs */
12321
12322static __inline__ vector unsigned short __ATTRS_o_ai
12323vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
12324 return __builtin_altivec_vsubuhs(__a, __b);
12325}
12326
12327static __inline__ vector unsigned short __ATTRS_o_ai
12328vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
12329 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
12330}
12331
12332static __inline__ vector unsigned short __ATTRS_o_ai
12333vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
12334 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
12335}
12336
12337/* vec_vsubsws */
12338
12339static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
12340 vector int __b) {
12341 return __builtin_altivec_vsubsws(__a, __b);
12342}
12343
12344static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
12345 vector int __b) {
12346 return __builtin_altivec_vsubsws((vector int)__a, __b);
12347}
12348
12349static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
12350 vector bool int __b) {
12351 return __builtin_altivec_vsubsws(__a, (vector int)__b);
12352}
12353
12354/* vec_vsubuws */
12355
12356static __inline__ vector unsigned int __ATTRS_o_ai
12357vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
12358 return __builtin_altivec_vsubuws(__a, __b);
12359}
12360
12361static __inline__ vector unsigned int __ATTRS_o_ai
12362vec_vsubuws(vector bool int __a, vector unsigned int __b) {
12363 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
12364}
12365
12366static __inline__ vector unsigned int __ATTRS_o_ai
12367vec_vsubuws(vector unsigned int __a, vector bool int __b) {
12368 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
12369}
12370
12371#ifdef __POWER8_VECTOR__
12372/* vec_vsubuqm */
12373
12374#ifdef __SIZEOF_INT128__
12375static __inline__ vector signed __int128 __ATTRS_o_ai
12376vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
12377 return __a - __b;
12378}
12379
12380static __inline__ vector unsigned __int128 __ATTRS_o_ai
12381vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
12382 return __a - __b;
12383}
12384#endif
12385
12386static __inline__ vector unsigned char __attribute__((__always_inline__))
12387vec_sub_u128(vector unsigned char __a, vector unsigned char __b) {
12388 return (vector unsigned char)__builtin_altivec_vsubuqm(__a, __b);
12389}
12390
12391/* vec_vsubeuqm */
12392
12393#ifdef __SIZEOF_INT128__
12394static __inline__ vector signed __int128 __ATTRS_o_ai
12395vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
12396 vector signed __int128 __c) {
12397 return (vector signed __int128)__builtin_altivec_vsubeuqm(
12398 (vector unsigned __int128)__a, (vector unsigned __int128)__b,
12399 (vector unsigned __int128)__c);
12400}
12401
12402static __inline__ vector unsigned __int128 __ATTRS_o_ai
12403vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
12404 vector unsigned __int128 __c) {
12405 return __builtin_altivec_vsubeuqm(__a, __b, __c);
12406}
12407
12408static __inline__ vector signed __int128 __ATTRS_o_ai
12409vec_sube(vector signed __int128 __a, vector signed __int128 __b,
12410 vector signed __int128 __c) {
12411 return (vector signed __int128)__builtin_altivec_vsubeuqm(
12412 (vector unsigned __int128)__a, (vector unsigned __int128)__b,
12413 (vector unsigned __int128)__c);
12414}
12415
12416static __inline__ vector unsigned __int128 __ATTRS_o_ai
12417vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
12418 vector unsigned __int128 __c) {
12419 return __builtin_altivec_vsubeuqm(__a, __b, __c);
12420}
12421#endif
12422
12423static __inline__ vector unsigned char __attribute__((__always_inline__))
12424vec_sube_u128(vector unsigned char __a, vector unsigned char __b,
12425 vector unsigned char __c) {
12426 return (vector unsigned char)__builtin_altivec_vsubeuqm_c(
12427 (vector unsigned char)__a, (vector unsigned char)__b,
12428 (vector unsigned char)__c);
12429}
12430
12431/* vec_vsubcuq */
12432
12433#ifdef __SIZEOF_INT128__
12434static __inline__ vector signed __int128 __ATTRS_o_ai
12435vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
12436 return (vector signed __int128)__builtin_altivec_vsubcuq(
12437 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
12438}
12439
12440static __inline__ vector unsigned __int128 __ATTRS_o_ai
12441vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
12442 return __builtin_altivec_vsubcuq(__a, __b);
12443}
12444
12445/* vec_vsubecuq */
12446
12447static __inline__ vector signed __int128 __ATTRS_o_ai
12448vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
12449 vector signed __int128 __c) {
12450 return (vector signed __int128)__builtin_altivec_vsubecuq(
12451 (vector unsigned __int128)__a, (vector unsigned __int128)__b,
12452 (vector unsigned __int128)__c);
12453}
12454
12455static __inline__ vector unsigned __int128 __ATTRS_o_ai
12456vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
12457 vector unsigned __int128 __c) {
12458 return __builtin_altivec_vsubecuq(__a, __b, __c);
12459}
12460#endif
12461
12462#ifdef __powerpc64__
12463static __inline__ vector signed int __ATTRS_o_ai
12464vec_subec(vector signed int __a, vector signed int __b,
12465 vector signed int __c) {
12466 return vec_addec(__a, ~__b, __c);
12467}
12468
12469static __inline__ vector unsigned int __ATTRS_o_ai
12470vec_subec(vector unsigned int __a, vector unsigned int __b,
12471 vector unsigned int __c) {
12472 return vec_addec(__a, ~__b, __c);
12473}
12474#endif
12475
12476#ifdef __SIZEOF_INT128__
12477static __inline__ vector signed __int128 __ATTRS_o_ai
12478vec_subec(vector signed __int128 __a, vector signed __int128 __b,
12479 vector signed __int128 __c) {
12480 return (vector signed __int128)__builtin_altivec_vsubecuq(
12481 (vector unsigned __int128)__a, (vector unsigned __int128)__b,
12482 (vector unsigned __int128)__c);
12483}
12484
12485static __inline__ vector unsigned __int128 __ATTRS_o_ai
12486vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
12487 vector unsigned __int128 __c) {
12488 return __builtin_altivec_vsubecuq(__a, __b, __c);
12489}
12490#endif
12491
12492static __inline__ vector unsigned char __attribute__((__always_inline__))
12493vec_subec_u128(vector unsigned char __a, vector unsigned char __b,
12494 vector unsigned char __c) {
12495 return (vector unsigned char)__builtin_altivec_vsubecuq_c(
12496 (vector unsigned char)__a, (vector unsigned char)__b,
12497 (vector unsigned char)__c);
12498}
12499#endif // __POWER8_VECTOR__
12500
12501static __inline__ vector signed int __ATTRS_o_ai
12502vec_sube(vector signed int __a, vector signed int __b,
12503 vector signed int __c) {
12504 vector signed int __mask = {1, 1, 1, 1};
12505 vector signed int __carry = __c & __mask;
12506 return vec_adde(__a, ~__b, __carry);
12507}
12508
12509static __inline__ vector unsigned int __ATTRS_o_ai
12510vec_sube(vector unsigned int __a, vector unsigned int __b,
12511 vector unsigned int __c) {
12512 vector unsigned int __mask = {1, 1, 1, 1};
12513 vector unsigned int __carry = __c & __mask;
12514 return vec_adde(__a, ~__b, __carry);
12515}
12516/* vec_sum4s */
12517
12518static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
12519 vector int __b) {
12520 return __builtin_altivec_vsum4sbs(__a, __b);
12521}
12522
12523static __inline__ vector unsigned int __ATTRS_o_ai
12524vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
12525 return __builtin_altivec_vsum4ubs(__a, __b);
12526}
12527
12528static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
12529 vector int __b) {
12530 return __builtin_altivec_vsum4shs(__a, __b);
12531}
12532
12533/* vec_vsum4sbs */
12534
12535static __inline__ vector int __attribute__((__always_inline__))
12536vec_vsum4sbs(vector signed char __a, vector int __b) {
12537 return __builtin_altivec_vsum4sbs(__a, __b);
12538}
12539
12540/* vec_vsum4ubs */
12541
12542static __inline__ vector unsigned int __attribute__((__always_inline__))
12543vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
12544 return __builtin_altivec_vsum4ubs(__a, __b);
12545}
12546
12547/* vec_vsum4shs */
12548
12549static __inline__ vector int __attribute__((__always_inline__))
12550vec_vsum4shs(vector signed short __a, vector int __b) {
12551 return __builtin_altivec_vsum4shs(__a, __b);
12552}
12553
12554/* vec_sum2s */
12555
12556/* The vsum2sws instruction has a big-endian bias, so that the second
12557 input vector and the result always reference big-endian elements
12558 1 and 3 (little-endian element 0 and 2). For ease of porting the
12559 programmer wants elements 1 and 3 in both cases, so for little
12560 endian we must perform some permutes. */
12561
12562static __inline__ vector signed int __attribute__((__always_inline__))
12563vec_sum2s(vector int __a, vector int __b) {
12564#ifdef __LITTLE_ENDIAN__
12565 vector int __c = (vector signed int)vec_perm(
12566 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12567 8, 9, 10, 11));
12568 __c = __builtin_altivec_vsum2sws(__a, __c);
12569 return (vector signed int)vec_perm(
12570 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12571 8, 9, 10, 11));
12572#else
12573 return __builtin_altivec_vsum2sws(__a, __b);
12574#endif
12575}
12576
12577/* vec_vsum2sws */
12578
12579static __inline__ vector signed int __attribute__((__always_inline__))
12580vec_vsum2sws(vector int __a, vector int __b) {
12581#ifdef __LITTLE_ENDIAN__
12582 vector int __c = (vector signed int)vec_perm(
12583 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12584 8, 9, 10, 11));
12585 __c = __builtin_altivec_vsum2sws(__a, __c);
12586 return (vector signed int)vec_perm(
12587 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
12588 8, 9, 10, 11));
12589#else
12590 return __builtin_altivec_vsum2sws(__a, __b);
12591#endif
12592}
12593
12594/* vec_sums */
12595
12596/* The vsumsws instruction has a big-endian bias, so that the second
12597 input vector and the result always reference big-endian element 3
12598 (little-endian element 0). For ease of porting the programmer
12599 wants element 3 in both cases, so for little endian we must perform
12600 some permutes. */
12601
12602static __inline__ vector signed int __attribute__((__always_inline__))
12603vec_sums(vector signed int __a, vector signed int __b) {
12604#ifdef __LITTLE_ENDIAN__
12605 __b = (vector signed int)vec_splat(__b, 3);
12606 __b = __builtin_altivec_vsumsws(__a, __b);
12607 return (vector signed int)(0, 0, 0, __b[0]);
12608#else
12609 return __builtin_altivec_vsumsws(__a, __b);
12610#endif
12611}
12612
12613/* vec_vsumsws */
12614
12615static __inline__ vector signed int __attribute__((__always_inline__))
12616vec_vsumsws(vector signed int __a, vector signed int __b) {
12617#ifdef __LITTLE_ENDIAN__
12618 __b = (vector signed int)vec_splat(__b, 3);
12619 __b = __builtin_altivec_vsumsws(__a, __b);
12620 return (vector signed int)(0, 0, 0, __b[0]);
12621#else
12622 return __builtin_altivec_vsumsws(__a, __b);
12623#endif
12624}
12625
12626/* vec_trunc */
12627
12628static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
12629#ifdef __VSX__
12630 return __builtin_vsx_xvrspiz(__a);
12631#else
12632 return __builtin_altivec_vrfiz(__a);
12633#endif
12634}
12635
12636#ifdef __VSX__
12637static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
12638 return __builtin_vsx_xvrdpiz(__a);
12639}
12640#endif
12641
12642/* vec_roundz */
12643static __inline__ vector float __ATTRS_o_ai vec_roundz(vector float __a) {
12644 return vec_trunc(__a);
12645}
12646
12647#ifdef __VSX__
12648static __inline__ vector double __ATTRS_o_ai vec_roundz(vector double __a) {
12649 return vec_trunc(__a);
12650}
12651#endif
12652
12653/* vec_vrfiz */
12654
12655static __inline__ vector float __attribute__((__always_inline__))
12656vec_vrfiz(vector float __a) {
12657 return __builtin_altivec_vrfiz(__a);
12658}
12659
12660/* vec_unpackh */
12661
12662/* The vector unpack instructions all have a big-endian bias, so for
12663 little endian we must reverse the meanings of "high" and "low." */
12664#ifdef __LITTLE_ENDIAN__
12665#define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12666#define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12667#else
12668#define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))
12669#define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))
12670#endif
12671
12672static __inline__ vector short __ATTRS_o_ai
12673vec_unpackh(vector signed char __a) {
12674#ifdef __LITTLE_ENDIAN__
12675 return __builtin_altivec_vupklsb((vector char)__a);
12676#else
12677 return __builtin_altivec_vupkhsb((vector char)__a);
12678#endif
12679}
12680
12681static __inline__ vector bool short __ATTRS_o_ai
12682vec_unpackh(vector bool char __a) {
12683#ifdef __LITTLE_ENDIAN__
12684 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12685#else
12686 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12687#endif
12688}
12689
12690static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
12691#ifdef __LITTLE_ENDIAN__
12692 return __builtin_altivec_vupklsh(__a);
12693#else
12694 return __builtin_altivec_vupkhsh(__a);
12695#endif
12696}
12697
12698static __inline__ vector bool int __ATTRS_o_ai
12699vec_unpackh(vector bool short __a) {
12700#ifdef __LITTLE_ENDIAN__
12701 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12702#else
12703 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12704#endif
12705}
12706
12707static __inline__ vector unsigned int __ATTRS_o_ai
12708vec_unpackh(vector pixel __a) {
12709#ifdef __LITTLE_ENDIAN__
12710 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12711#else
12712 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12713#endif
12714}
12715
12716#ifdef __POWER8_VECTOR__
12717static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
12718#ifdef __LITTLE_ENDIAN__
12719 return __builtin_altivec_vupklsw(__a);
12720#else
12721 return __builtin_altivec_vupkhsw(__a);
12722#endif
12723}
12724
12725static __inline__ vector bool long long __ATTRS_o_ai
12726vec_unpackh(vector bool int __a) {
12727#ifdef __LITTLE_ENDIAN__
12728 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12729#else
12730 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12731#endif
12732}
12733
12734static __inline__ vector double __ATTRS_o_ai
12735vec_unpackh(vector float __a) {
12736 return (vector double)(__a[0], __a[1]);
12737}
12738#endif
12739
12740/* vec_vupkhsb */
12741
12742static __inline__ vector short __ATTRS_o_ai
12743vec_vupkhsb(vector signed char __a) {
12744#ifdef __LITTLE_ENDIAN__
12745 return __builtin_altivec_vupklsb((vector char)__a);
12746#else
12747 return __builtin_altivec_vupkhsb((vector char)__a);
12748#endif
12749}
12750
12751static __inline__ vector bool short __ATTRS_o_ai
12752vec_vupkhsb(vector bool char __a) {
12753#ifdef __LITTLE_ENDIAN__
12754 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12755#else
12756 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12757#endif
12758}
12759
12760/* vec_vupkhsh */
12761
12762static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
12763#ifdef __LITTLE_ENDIAN__
12764 return __builtin_altivec_vupklsh(__a);
12765#else
12766 return __builtin_altivec_vupkhsh(__a);
12767#endif
12768}
12769
12770static __inline__ vector bool int __ATTRS_o_ai
12771vec_vupkhsh(vector bool short __a) {
12772#ifdef __LITTLE_ENDIAN__
12773 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12774#else
12775 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12776#endif
12777}
12778
12779static __inline__ vector unsigned int __ATTRS_o_ai
12780vec_vupkhsh(vector pixel __a) {
12781#ifdef __LITTLE_ENDIAN__
12782 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12783#else
12784 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12785#endif
12786}
12787
12788/* vec_vupkhsw */
12789
12790#ifdef __POWER8_VECTOR__
12791static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
12792#ifdef __LITTLE_ENDIAN__
12793 return __builtin_altivec_vupklsw(__a);
12794#else
12795 return __builtin_altivec_vupkhsw(__a);
12796#endif
12797}
12798
12799static __inline__ vector bool long long __ATTRS_o_ai
12800vec_vupkhsw(vector bool int __a) {
12801#ifdef __LITTLE_ENDIAN__
12802 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12803#else
12804 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12805#endif
12806}
12807#endif
12808
12809/* vec_unpackl */
12810
12811static __inline__ vector short __ATTRS_o_ai
12812vec_unpackl(vector signed char __a) {
12813#ifdef __LITTLE_ENDIAN__
12814 return __builtin_altivec_vupkhsb((vector char)__a);
12815#else
12816 return __builtin_altivec_vupklsb((vector char)__a);
12817#endif
12818}
12819
12820static __inline__ vector bool short __ATTRS_o_ai
12821vec_unpackl(vector bool char __a) {
12822#ifdef __LITTLE_ENDIAN__
12823 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12824#else
12825 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12826#endif
12827}
12828
12829static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
12830#ifdef __LITTLE_ENDIAN__
12831 return __builtin_altivec_vupkhsh(__a);
12832#else
12833 return __builtin_altivec_vupklsh(__a);
12834#endif
12835}
12836
12837static __inline__ vector bool int __ATTRS_o_ai
12838vec_unpackl(vector bool short __a) {
12839#ifdef __LITTLE_ENDIAN__
12840 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12841#else
12842 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12843#endif
12844}
12845
12846static __inline__ vector unsigned int __ATTRS_o_ai
12847vec_unpackl(vector pixel __a) {
12848#ifdef __LITTLE_ENDIAN__
12849 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12850#else
12851 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12852#endif
12853}
12854
12855#ifdef __POWER8_VECTOR__
12856static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
12857#ifdef __LITTLE_ENDIAN__
12858 return __builtin_altivec_vupkhsw(__a);
12859#else
12860 return __builtin_altivec_vupklsw(__a);
12861#endif
12862}
12863
12864static __inline__ vector bool long long __ATTRS_o_ai
12865vec_unpackl(vector bool int __a) {
12866#ifdef __LITTLE_ENDIAN__
12867 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12868#else
12869 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12870#endif
12871}
12872
12873static __inline__ vector double __ATTRS_o_ai
12874vec_unpackl(vector float __a) {
12875 return (vector double)(__a[2], __a[3]);
12876}
12877#endif
12878
12879/* vec_vupklsb */
12880
12881static __inline__ vector short __ATTRS_o_ai
12882vec_vupklsb(vector signed char __a) {
12883#ifdef __LITTLE_ENDIAN__
12884 return __builtin_altivec_vupkhsb((vector char)__a);
12885#else
12886 return __builtin_altivec_vupklsb((vector char)__a);
12887#endif
12888}
12889
12890static __inline__ vector bool short __ATTRS_o_ai
12891vec_vupklsb(vector bool char __a) {
12892#ifdef __LITTLE_ENDIAN__
12893 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
12894#else
12895 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
12896#endif
12897}
12898
12899/* vec_vupklsh */
12900
12901static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
12902#ifdef __LITTLE_ENDIAN__
12903 return __builtin_altivec_vupkhsh(__a);
12904#else
12905 return __builtin_altivec_vupklsh(__a);
12906#endif
12907}
12908
12909static __inline__ vector bool int __ATTRS_o_ai
12910vec_vupklsh(vector bool short __a) {
12911#ifdef __LITTLE_ENDIAN__
12912 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
12913#else
12914 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
12915#endif
12916}
12917
12918static __inline__ vector unsigned int __ATTRS_o_ai
12919vec_vupklsh(vector pixel __a) {
12920#ifdef __LITTLE_ENDIAN__
12921 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
12922#else
12923 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
12924#endif
12925}
12926
12927/* vec_vupklsw */
12928
12929#ifdef __POWER8_VECTOR__
12930static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
12931#ifdef __LITTLE_ENDIAN__
12932 return __builtin_altivec_vupkhsw(__a);
12933#else
12934 return __builtin_altivec_vupklsw(__a);
12935#endif
12936}
12937
12938static __inline__ vector bool long long __ATTRS_o_ai
12939vec_vupklsw(vector bool int __a) {
12940#ifdef __LITTLE_ENDIAN__
12941 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
12942#else
12943 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
12944#endif
12945}
12946#endif
12947
12948/* vec_vsx_ld */
12949
12950#ifdef __VSX__
12951
12952static __inline__ vector bool int __ATTRS_o_ai
12953vec_vsx_ld(int __a, const vector bool int *__b) {
12954 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
12955}
12956
12957static __inline__ vector signed int __ATTRS_o_ai
12958vec_vsx_ld(int __a, const vector signed int *__b) {
12959 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
12960}
12961
12962static __inline__ vector signed int __ATTRS_o_ai
12963vec_vsx_ld(int __a, const signed int *__b) {
12964 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
12965}
12966
12967static __inline__ vector unsigned int __ATTRS_o_ai
12968vec_vsx_ld(int __a, const vector unsigned int *__b) {
12969 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
12970}
12971
12972static __inline__ vector unsigned int __ATTRS_o_ai
12973vec_vsx_ld(int __a, const unsigned int *__b) {
12974 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
12975}
12976
12977static __inline__ vector float __ATTRS_o_ai
12978vec_vsx_ld(int __a, const vector float *__b) {
12979 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
12980}
12981
12982static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
12983 const float *__b) {
12984 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
12985}
12986
12987static __inline__ vector signed long long __ATTRS_o_ai
12988vec_vsx_ld(int __a, const vector signed long long *__b) {
12989 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
12990}
12991
12992static __inline__ vector unsigned long long __ATTRS_o_ai
12993vec_vsx_ld(int __a, const vector unsigned long long *__b) {
12994 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
12995}
12996
12997static __inline__ vector double __ATTRS_o_ai
12998vec_vsx_ld(int __a, const vector double *__b) {
12999 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
13000}
13001
13002static __inline__ vector double __ATTRS_o_ai
13003vec_vsx_ld(int __a, const double *__b) {
13004 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
13005}
13006
13007static __inline__ vector bool short __ATTRS_o_ai
13008vec_vsx_ld(int __a, const vector bool short *__b) {
13009 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
13010}
13011
13012static __inline__ vector signed short __ATTRS_o_ai
13013vec_vsx_ld(int __a, const vector signed short *__b) {
13014 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
13015}
13016
13017static __inline__ vector signed short __ATTRS_o_ai
13018vec_vsx_ld(int __a, const signed short *__b) {
13019 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
13020}
13021
13022static __inline__ vector unsigned short __ATTRS_o_ai
13023vec_vsx_ld(int __a, const vector unsigned short *__b) {
13024 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
13025}
13026
13027static __inline__ vector unsigned short __ATTRS_o_ai
13028vec_vsx_ld(int __a, const unsigned short *__b) {
13029 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
13030}
13031
13032static __inline__ vector bool char __ATTRS_o_ai
13033vec_vsx_ld(int __a, const vector bool char *__b) {
13034 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
13035}
13036
13037static __inline__ vector signed char __ATTRS_o_ai
13038vec_vsx_ld(int __a, const vector signed char *__b) {
13039 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
13040}
13041
13042static __inline__ vector signed char __ATTRS_o_ai
13043vec_vsx_ld(int __a, const signed char *__b) {
13044 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
13045}
13046
13047static __inline__ vector unsigned char __ATTRS_o_ai
13048vec_vsx_ld(int __a, const vector unsigned char *__b) {
13049 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
13050}
13051
13052static __inline__ vector unsigned char __ATTRS_o_ai
13053vec_vsx_ld(int __a, const unsigned char *__b) {
13054 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
13055}
13056
13057#endif
13058
13059/* vec_vsx_st */
13060
13061#ifdef __VSX__
13062
13063static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
13064 vector bool int *__c) {
13065 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13066}
13067
13068static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
13069 signed int *__c) {
13070 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13071}
13072
13073static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
13074 unsigned int *__c) {
13075 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13076}
13077
13078static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
13079 vector signed int *__c) {
13080 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13081}
13082
13083static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
13084 signed int *__c) {
13085 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13086}
13087
13088static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
13089 vector unsigned int *__c) {
13090 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13091}
13092
13093static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
13094 unsigned int *__c) {
13095 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13096}
13097
13098static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
13099 vector float *__c) {
13100 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13101}
13102
13103static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
13104 float *__c) {
13105 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13106}
13107
13108static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
13109 int __b,
13110 vector signed long long *__c) {
13111 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
13112}
13113
13114static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
13115 int __b,
13116 vector unsigned long long *__c) {
13117 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
13118}
13119
13120static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
13121 vector double *__c) {
13122 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
13123}
13124
13125static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
13126 double *__c) {
13127 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
13128}
13129
13130static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
13131 vector bool short *__c) {
13132 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13133}
13134
13135static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
13136 signed short *__c) {
13137 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13138}
13139
13140static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
13141 unsigned short *__c) {
13142 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13143}
13144static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
13145 vector signed short *__c) {
13146 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13147}
13148
13149static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
13150 signed short *__c) {
13151 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13152}
13153
13154static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
13155 int __b,
13156 vector unsigned short *__c) {
13157 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13158}
13159
13160static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
13161 int __b, unsigned short *__c) {
13162 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13163}
13164
13165static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
13166 vector bool char *__c) {
13167 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13168}
13169
13170static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
13171 signed char *__c) {
13172 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13173}
13174
13175static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
13176 unsigned char *__c) {
13177 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13178}
13179
13180static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
13181 vector signed char *__c) {
13182 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13183}
13184
13185static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
13186 signed char *__c) {
13187 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13188}
13189
13190static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
13191 int __b,
13192 vector unsigned char *__c) {
13193 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13194}
13195
13196static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
13197 int __b, unsigned char *__c) {
13198 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
13199}
13200
13201#endif
13202
13203#ifdef __VSX__
13204#define vec_xxpermdi __builtin_vsx_xxpermdi
13205#define vec_xxsldwi __builtin_vsx_xxsldwi
13206#define vec_permi(__a, __b, __c) \
13207 _Generic((__a), vector signed long long \
13208 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13209 (((__c)&0x1) + 2)), \
13210 vector unsigned long long \
13211 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13212 (((__c)&0x1) + 2)), \
13213 vector double \
13214 : __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \
13215 (((__c)&0x1) + 2)))
13216#endif
13217
13218/* vec_xor */
13219
13220#define __builtin_altivec_vxor vec_xor
13221
13222static __inline__ vector signed char __ATTRS_o_ai
13223vec_xor(vector signed char __a, vector signed char __b) {
13224 return __a ^ __b;
13225}
13226
13227static __inline__ vector signed char __ATTRS_o_ai
13228vec_xor(vector bool char __a, vector signed char __b) {
13229 return (vector signed char)__a ^ __b;
13230}
13231
13232static __inline__ vector signed char __ATTRS_o_ai
13233vec_xor(vector signed char __a, vector bool char __b) {
13234 return __a ^ (vector signed char)__b;
13235}
13236
13237static __inline__ vector unsigned char __ATTRS_o_ai
13238vec_xor(vector unsigned char __a, vector unsigned char __b) {
13239 return __a ^ __b;
13240}
13241
13242static __inline__ vector unsigned char __ATTRS_o_ai
13243vec_xor(vector bool char __a, vector unsigned char __b) {
13244 return (vector unsigned char)__a ^ __b;
13245}
13246
13247static __inline__ vector unsigned char __ATTRS_o_ai
13248vec_xor(vector unsigned char __a, vector bool char __b) {
13249 return __a ^ (vector unsigned char)__b;
13250}
13251
13252static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
13253 vector bool char __b) {
13254 return __a ^ __b;
13255}
13256
13257static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
13258 vector short __b) {
13259 return __a ^ __b;
13260}
13261
13262static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
13263 vector short __b) {
13264 return (vector short)__a ^ __b;
13265}
13266
13267static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
13268 vector bool short __b) {
13269 return __a ^ (vector short)__b;
13270}
13271
13272static __inline__ vector unsigned short __ATTRS_o_ai
13273vec_xor(vector unsigned short __a, vector unsigned short __b) {
13274 return __a ^ __b;
13275}
13276
13277static __inline__ vector unsigned short __ATTRS_o_ai
13278vec_xor(vector bool short __a, vector unsigned short __b) {
13279 return (vector unsigned short)__a ^ __b;
13280}
13281
13282static __inline__ vector unsigned short __ATTRS_o_ai
13283vec_xor(vector unsigned short __a, vector bool short __b) {
13284 return __a ^ (vector unsigned short)__b;
13285}
13286
13287static __inline__ vector bool short __ATTRS_o_ai
13288vec_xor(vector bool short __a, vector bool short __b) {
13289 return __a ^ __b;
13290}
13291
13292static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
13293 vector int __b) {
13294 return __a ^ __b;
13295}
13296
13297static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
13298 vector int __b) {
13299 return (vector int)__a ^ __b;
13300}
13301
13302static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
13303 vector bool int __b) {
13304 return __a ^ (vector int)__b;
13305}
13306
13307static __inline__ vector unsigned int __ATTRS_o_ai
13308vec_xor(vector unsigned int __a, vector unsigned int __b) {
13309 return __a ^ __b;
13310}
13311
13312static __inline__ vector unsigned int __ATTRS_o_ai
13313vec_xor(vector bool int __a, vector unsigned int __b) {
13314 return (vector unsigned int)__a ^ __b;
13315}
13316
13317static __inline__ vector unsigned int __ATTRS_o_ai
13318vec_xor(vector unsigned int __a, vector bool int __b) {
13319 return __a ^ (vector unsigned int)__b;
13320}
13321
13322static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
13323 vector bool int __b) {
13324 return __a ^ __b;
13325}
13326
13327static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
13328 vector float __b) {
13329 vector unsigned int __res =
13330 (vector unsigned int)__a ^ (vector unsigned int)__b;
13331 return (vector float)__res;
13332}
13333
13334static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
13335 vector float __b) {
13336 vector unsigned int __res =
13337 (vector unsigned int)__a ^ (vector unsigned int)__b;
13338 return (vector float)__res;
13339}
13340
13341static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
13342 vector bool int __b) {
13343 vector unsigned int __res =
13344 (vector unsigned int)__a ^ (vector unsigned int)__b;
13345 return (vector float)__res;
13346}
13347
13348#ifdef __VSX__
13349static __inline__ vector signed long long __ATTRS_o_ai
13350vec_xor(vector signed long long __a, vector signed long long __b) {
13351 return __a ^ __b;
13352}
13353
13354static __inline__ vector signed long long __ATTRS_o_ai
13355vec_xor(vector bool long long __a, vector signed long long __b) {
13356 return (vector signed long long)__a ^ __b;
13357}
13358
13359static __inline__ vector signed long long __ATTRS_o_ai
13360vec_xor(vector signed long long __a, vector bool long long __b) {
13361 return __a ^ (vector signed long long)__b;
13362}
13363
13364static __inline__ vector unsigned long long __ATTRS_o_ai
13365vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
13366 return __a ^ __b;
13367}
13368
13369static __inline__ vector unsigned long long __ATTRS_o_ai
13370vec_xor(vector bool long long __a, vector unsigned long long __b) {
13371 return (vector unsigned long long)__a ^ __b;
13372}
13373
13374static __inline__ vector unsigned long long __ATTRS_o_ai
13375vec_xor(vector unsigned long long __a, vector bool long long __b) {
13376 return __a ^ (vector unsigned long long)__b;
13377}
13378
13379static __inline__ vector bool long long __ATTRS_o_ai
13380vec_xor(vector bool long long __a, vector bool long long __b) {
13381 return __a ^ __b;
13382}
13383
13384static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
13385 vector double __b) {
13386 return (vector double)((vector unsigned long long)__a ^
13387 (vector unsigned long long)__b);
13388}
13389
13390static __inline__ vector double __ATTRS_o_ai
13391vec_xor(vector double __a, vector bool long long __b) {
13392 return (vector double)((vector unsigned long long)__a ^
13393 (vector unsigned long long)__b);
13394}
13395
13396static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
13397 vector double __b) {
13398 return (vector double)((vector unsigned long long)__a ^
13399 (vector unsigned long long)__b);
13400}
13401#endif
13402
13403/* vec_vxor */
13404
13405static __inline__ vector signed char __ATTRS_o_ai
13406vec_vxor(vector signed char __a, vector signed char __b) {
13407 return __a ^ __b;
13408}
13409
13410static __inline__ vector signed char __ATTRS_o_ai
13411vec_vxor(vector bool char __a, vector signed char __b) {
13412 return (vector signed char)__a ^ __b;
13413}
13414
13415static __inline__ vector signed char __ATTRS_o_ai
13416vec_vxor(vector signed char __a, vector bool char __b) {
13417 return __a ^ (vector signed char)__b;
13418}
13419
13420static __inline__ vector unsigned char __ATTRS_o_ai
13421vec_vxor(vector unsigned char __a, vector unsigned char __b) {
13422 return __a ^ __b;
13423}
13424
13425static __inline__ vector unsigned char __ATTRS_o_ai
13426vec_vxor(vector bool char __a, vector unsigned char __b) {
13427 return (vector unsigned char)__a ^ __b;
13428}
13429
13430static __inline__ vector unsigned char __ATTRS_o_ai
13431vec_vxor(vector unsigned char __a, vector bool char __b) {
13432 return __a ^ (vector unsigned char)__b;
13433}
13434
13435static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
13436 vector bool char __b) {
13437 return __a ^ __b;
13438}
13439
13440static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
13441 vector short __b) {
13442 return __a ^ __b;
13443}
13444
13445static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
13446 vector short __b) {
13447 return (vector short)__a ^ __b;
13448}
13449
13450static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
13451 vector bool short __b) {
13452 return __a ^ (vector short)__b;
13453}
13454
13455static __inline__ vector unsigned short __ATTRS_o_ai
13456vec_vxor(vector unsigned short __a, vector unsigned short __b) {
13457 return __a ^ __b;
13458}
13459
13460static __inline__ vector unsigned short __ATTRS_o_ai
13461vec_vxor(vector bool short __a, vector unsigned short __b) {
13462 return (vector unsigned short)__a ^ __b;
13463}
13464
13465static __inline__ vector unsigned short __ATTRS_o_ai
13466vec_vxor(vector unsigned short __a, vector bool short __b) {
13467 return __a ^ (vector unsigned short)__b;
13468}
13469
13470static __inline__ vector bool short __ATTRS_o_ai
13471vec_vxor(vector bool short __a, vector bool short __b) {
13472 return __a ^ __b;
13473}
13474
13475static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
13476 vector int __b) {
13477 return __a ^ __b;
13478}
13479
13480static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
13481 vector int __b) {
13482 return (vector int)__a ^ __b;
13483}
13484
13485static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
13486 vector bool int __b) {
13487 return __a ^ (vector int)__b;
13488}
13489
13490static __inline__ vector unsigned int __ATTRS_o_ai
13491vec_vxor(vector unsigned int __a, vector unsigned int __b) {
13492 return __a ^ __b;
13493}
13494
13495static __inline__ vector unsigned int __ATTRS_o_ai
13496vec_vxor(vector bool int __a, vector unsigned int __b) {
13497 return (vector unsigned int)__a ^ __b;
13498}
13499
13500static __inline__ vector unsigned int __ATTRS_o_ai
13501vec_vxor(vector unsigned int __a, vector bool int __b) {
13502 return __a ^ (vector unsigned int)__b;
13503}
13504
13505static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
13506 vector bool int __b) {
13507 return __a ^ __b;
13508}
13509
13510static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
13511 vector float __b) {
13512 vector unsigned int __res =
13513 (vector unsigned int)__a ^ (vector unsigned int)__b;
13514 return (vector float)__res;
13515}
13516
13517static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
13518 vector float __b) {
13519 vector unsigned int __res =
13520 (vector unsigned int)__a ^ (vector unsigned int)__b;
13521 return (vector float)__res;
13522}
13523
13524static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
13525 vector bool int __b) {
13526 vector unsigned int __res =
13527 (vector unsigned int)__a ^ (vector unsigned int)__b;
13528 return (vector float)__res;
13529}
13530
13531#ifdef __VSX__
13532static __inline__ vector signed long long __ATTRS_o_ai
13533vec_vxor(vector signed long long __a, vector signed long long __b) {
13534 return __a ^ __b;
13535}
13536
13537static __inline__ vector signed long long __ATTRS_o_ai
13538vec_vxor(vector bool long long __a, vector signed long long __b) {
13539 return (vector signed long long)__a ^ __b;
13540}
13541
13542static __inline__ vector signed long long __ATTRS_o_ai
13543vec_vxor(vector signed long long __a, vector bool long long __b) {
13544 return __a ^ (vector signed long long)__b;
13545}
13546
13547static __inline__ vector unsigned long long __ATTRS_o_ai
13548vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
13549 return __a ^ __b;
13550}
13551
13552static __inline__ vector unsigned long long __ATTRS_o_ai
13553vec_vxor(vector bool long long __a, vector unsigned long long __b) {
13554 return (vector unsigned long long)__a ^ __b;
13555}
13556
13557static __inline__ vector unsigned long long __ATTRS_o_ai
13558vec_vxor(vector unsigned long long __a, vector bool long long __b) {
13559 return __a ^ (vector unsigned long long)__b;
13560}
13561
13562static __inline__ vector bool long long __ATTRS_o_ai
13563vec_vxor(vector bool long long __a, vector bool long long __b) {
13564 return __a ^ __b;
13565}
13566#endif
13567
13568/* ------------------------ extensions for CBEA ----------------------------- */
13569
13570/* vec_extract */
13571
13572static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
13573 signed int __b) {
13574 return __a[__b & 0xf];
13575}
13576
13577static __inline__ unsigned char __ATTRS_o_ai
13578vec_extract(vector unsigned char __a, signed int __b) {
13579 return __a[__b & 0xf];
13580}
13581
13582static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
13583 signed int __b) {
13584 return __a[__b & 0xf];
13585}
13586
13587static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
13588 signed int __b) {
13589 return __a[__b & 0x7];
13590}
13591
13592static __inline__ unsigned short __ATTRS_o_ai
13593vec_extract(vector unsigned short __a, signed int __b) {
13594 return __a[__b & 0x7];
13595}
13596
13597static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
13598 signed int __b) {
13599 return __a[__b & 0x7];
13600}
13601
13602static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
13603 signed int __b) {
13604 return __a[__b & 0x3];
13605}
13606
13607static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
13608 signed int __b) {
13609 return __a[__b & 0x3];
13610}
13611
13612static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
13613 signed int __b) {
13614 return __a[__b & 0x3];
13615}
13616
13617#ifdef __VSX__
13618static __inline__ signed long long __ATTRS_o_ai
13619vec_extract(vector signed long long __a, signed int __b) {
13620 return __a[__b & 0x1];
13621}
13622
13623static __inline__ unsigned long long __ATTRS_o_ai
13624vec_extract(vector unsigned long long __a, signed int __b) {
13625 return __a[__b & 0x1];
13626}
13627
13628static __inline__ unsigned long long __ATTRS_o_ai
13629vec_extract(vector bool long long __a, signed int __b) {
13630 return __a[__b & 0x1];
13631}
13632
13633static __inline__ double __ATTRS_o_ai vec_extract(vector double __a,
13634 signed int __b) {
13635 return __a[__b & 0x1];
13636}
13637#endif
13638
13639static __inline__ float __ATTRS_o_ai vec_extract(vector float __a,
13640 signed int __b) {
13641 return __a[__b & 0x3];
13642}
13643
13644#ifdef __POWER9_VECTOR__
13645
13646#define vec_insert4b __builtin_vsx_insertword
13647#define vec_extract4b __builtin_vsx_extractuword
13648
13649/* vec_extract_exp */
13650
13651static __inline__ vector unsigned int __ATTRS_o_ai
13652vec_extract_exp(vector float __a) {
13653 return __builtin_vsx_xvxexpsp(__a);
13654}
13655
13656static __inline__ vector unsigned long long __ATTRS_o_ai
13657vec_extract_exp(vector double __a) {
13658 return __builtin_vsx_xvxexpdp(__a);
13659}
13660
13661/* vec_extract_sig */
13662
13663static __inline__ vector unsigned int __ATTRS_o_ai
13664vec_extract_sig(vector float __a) {
13665 return __builtin_vsx_xvxsigsp(__a);
13666}
13667
13668static __inline__ vector unsigned long long __ATTRS_o_ai
13669vec_extract_sig (vector double __a) {
13670 return __builtin_vsx_xvxsigdp(__a);
13671}
13672
13673static __inline__ vector float __ATTRS_o_ai
13674vec_extract_fp32_from_shorth(vector unsigned short __a) {
13675 vector unsigned short __b =
13676#ifdef __LITTLE_ENDIAN__
13677 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
13678#else
13679 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
13680#endif
13681 return __builtin_vsx_xvcvhpsp(__b);
13682}
13683
13684static __inline__ vector float __ATTRS_o_ai
13685vec_extract_fp32_from_shortl(vector unsigned short __a) {
13686 vector unsigned short __b =
13687#ifdef __LITTLE_ENDIAN__
13688 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
13689#else
13690 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
13691#endif
13692 return __builtin_vsx_xvcvhpsp(__b);
13693}
13694#endif /* __POWER9_VECTOR__ */
13695
13696/* vec_insert */
13697
13698static __inline__ vector signed char __ATTRS_o_ai
13699vec_insert(signed char __a, vector signed char __b, int __c) {
13700 __b[__c & 0xF] = __a;
13701 return __b;
13702}
13703
13704static __inline__ vector unsigned char __ATTRS_o_ai
13705vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
13706 __b[__c & 0xF] = __a;
13707 return __b;
13708}
13709
13710static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
13711 vector bool char __b,
13712 int __c) {
13713 __b[__c & 0xF] = __a;
13714 return __b;
13715}
13716
13717static __inline__ vector signed short __ATTRS_o_ai
13718vec_insert(signed short __a, vector signed short __b, int __c) {
13719 __b[__c & 0x7] = __a;
13720 return __b;
13721}
13722
13723static __inline__ vector unsigned short __ATTRS_o_ai
13724vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
13725 __b[__c & 0x7] = __a;
13726 return __b;
13727}
13728
13729static __inline__ vector bool short __ATTRS_o_ai
13730vec_insert(unsigned short __a, vector bool short __b, int __c) {
13731 __b[__c & 0x7] = __a;
13732 return __b;
13733}
13734
13735static __inline__ vector signed int __ATTRS_o_ai
13736vec_insert(signed int __a, vector signed int __b, int __c) {
13737 __b[__c & 0x3] = __a;
13738 return __b;
13739}
13740
13741static __inline__ vector unsigned int __ATTRS_o_ai
13742vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
13743 __b[__c & 0x3] = __a;
13744 return __b;
13745}
13746
13747static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
13748 vector bool int __b,
13749 int __c) {
13750 __b[__c & 0x3] = __a;
13751 return __b;
13752}
13753
13754#ifdef __VSX__
13755static __inline__ vector signed long long __ATTRS_o_ai
13756vec_insert(signed long long __a, vector signed long long __b, int __c) {
13757 __b[__c & 0x1] = __a;
13758 return __b;
13759}
13760
13761static __inline__ vector unsigned long long __ATTRS_o_ai
13762vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
13763 __b[__c & 0x1] = __a;
13764 return __b;
13765}
13766
13767static __inline__ vector bool long long __ATTRS_o_ai
13768vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
13769 __b[__c & 0x1] = __a;
13770 return __b;
13771}
13772static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
13773 vector double __b,
13774 int __c) {
13775 __b[__c & 0x1] = __a;
13776 return __b;
13777}
13778#endif
13779
13780static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
13781 vector float __b,
13782 int __c) {
13783 __b[__c & 0x3] = __a;
13784 return __b;
13785}
13786
13787/* vec_lvlx */
13788
13789static __inline__ vector signed char __ATTRS_o_ai
13790vec_lvlx(int __a, const signed char *__b) {
13791 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
13792 vec_lvsl(__a, __b));
13793}
13794
13795static __inline__ vector signed char __ATTRS_o_ai
13796vec_lvlx(int __a, const vector signed char *__b) {
13797 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
13798 vec_lvsl(__a, (unsigned char *)__b));
13799}
13800
13801static __inline__ vector unsigned char __ATTRS_o_ai
13802vec_lvlx(int __a, const unsigned char *__b) {
13803 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
13804 vec_lvsl(__a, __b));
13805}
13806
13807static __inline__ vector unsigned char __ATTRS_o_ai
13808vec_lvlx(int __a, const vector unsigned char *__b) {
13809 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
13810 vec_lvsl(__a, (unsigned char *)__b));
13811}
13812
13813static __inline__ vector bool char __ATTRS_o_ai
13814vec_lvlx(int __a, const vector bool char *__b) {
13815 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
13816 vec_lvsl(__a, (unsigned char *)__b));
13817}
13818
13819static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
13820 const short *__b) {
13821 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
13822}
13823
13824static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
13825 const vector short *__b) {
13826 return vec_perm(vec_ld(__a, __b), (vector short)(0),
13827 vec_lvsl(__a, (unsigned char *)__b));
13828}
13829
13830static __inline__ vector unsigned short __ATTRS_o_ai
13831vec_lvlx(int __a, const unsigned short *__b) {
13832 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
13833 vec_lvsl(__a, __b));
13834}
13835
13836static __inline__ vector unsigned short __ATTRS_o_ai
13837vec_lvlx(int __a, const vector unsigned short *__b) {
13838 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
13839 vec_lvsl(__a, (unsigned char *)__b));
13840}
13841
13842static __inline__ vector bool short __ATTRS_o_ai
13843vec_lvlx(int __a, const vector bool short *__b) {
13844 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
13845 vec_lvsl(__a, (unsigned char *)__b));
13846}
13847
13848static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
13849 const vector pixel *__b) {
13850 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
13851 vec_lvsl(__a, (unsigned char *)__b));
13852}
13853
13854static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
13855 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
13856}
13857
13858static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
13859 const vector int *__b) {
13860 return vec_perm(vec_ld(__a, __b), (vector int)(0),
13861 vec_lvsl(__a, (unsigned char *)__b));
13862}
13863
13864static __inline__ vector unsigned int __ATTRS_o_ai
13865vec_lvlx(int __a, const unsigned int *__b) {
13866 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
13867 vec_lvsl(__a, __b));
13868}
13869
13870static __inline__ vector unsigned int __ATTRS_o_ai
13871vec_lvlx(int __a, const vector unsigned int *__b) {
13872 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
13873 vec_lvsl(__a, (unsigned char *)__b));
13874}
13875
13876static __inline__ vector bool int __ATTRS_o_ai
13877vec_lvlx(int __a, const vector bool int *__b) {
13878 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
13879 vec_lvsl(__a, (unsigned char *)__b));
13880}
13881
13882static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
13883 const float *__b) {
13884 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
13885}
13886
13887static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
13888 const vector float *__b) {
13889 return vec_perm(vec_ld(__a, __b), (vector float)(0),
13890 vec_lvsl(__a, (unsigned char *)__b));
13891}
13892
13893/* vec_lvlxl */
13894
13895static __inline__ vector signed char __ATTRS_o_ai
13896vec_lvlxl(int __a, const signed char *__b) {
13897 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
13898 vec_lvsl(__a, __b));
13899}
13900
13901static __inline__ vector signed char __ATTRS_o_ai
13902vec_lvlxl(int __a, const vector signed char *__b) {
13903 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
13904 vec_lvsl(__a, (unsigned char *)__b));
13905}
13906
13907static __inline__ vector unsigned char __ATTRS_o_ai
13908vec_lvlxl(int __a, const unsigned char *__b) {
13909 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
13910 vec_lvsl(__a, __b));
13911}
13912
13913static __inline__ vector unsigned char __ATTRS_o_ai
13914vec_lvlxl(int __a, const vector unsigned char *__b) {
13915 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
13916 vec_lvsl(__a, (unsigned char *)__b));
13917}
13918
13919static __inline__ vector bool char __ATTRS_o_ai
13920vec_lvlxl(int __a, const vector bool char *__b) {
13921 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
13922 vec_lvsl(__a, (unsigned char *)__b));
13923}
13924
13925static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
13926 const short *__b) {
13927 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
13928}
13929
13930static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
13931 const vector short *__b) {
13932 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
13933 vec_lvsl(__a, (unsigned char *)__b));
13934}
13935
13936static __inline__ vector unsigned short __ATTRS_o_ai
13937vec_lvlxl(int __a, const unsigned short *__b) {
13938 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
13939 vec_lvsl(__a, __b));
13940}
13941
13942static __inline__ vector unsigned short __ATTRS_o_ai
13943vec_lvlxl(int __a, const vector unsigned short *__b) {
13944 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
13945 vec_lvsl(__a, (unsigned char *)__b));
13946}
13947
13948static __inline__ vector bool short __ATTRS_o_ai
13949vec_lvlxl(int __a, const vector bool short *__b) {
13950 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
13951 vec_lvsl(__a, (unsigned char *)__b));
13952}
13953
13954static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
13955 const vector pixel *__b) {
13956 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
13957 vec_lvsl(__a, (unsigned char *)__b));
13958}
13959
13960static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
13961 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
13962}
13963
13964static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
13965 const vector int *__b) {
13966 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
13967 vec_lvsl(__a, (unsigned char *)__b));
13968}
13969
13970static __inline__ vector unsigned int __ATTRS_o_ai
13971vec_lvlxl(int __a, const unsigned int *__b) {
13972 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
13973 vec_lvsl(__a, __b));
13974}
13975
13976static __inline__ vector unsigned int __ATTRS_o_ai
13977vec_lvlxl(int __a, const vector unsigned int *__b) {
13978 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
13979 vec_lvsl(__a, (unsigned char *)__b));
13980}
13981
13982static __inline__ vector bool int __ATTRS_o_ai
13983vec_lvlxl(int __a, const vector bool int *__b) {
13984 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
13985 vec_lvsl(__a, (unsigned char *)__b));
13986}
13987
13988static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
13989 const float *__b) {
13990 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
13991}
13992
13993static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
13994 vector float *__b) {
13995 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
13996 vec_lvsl(__a, (unsigned char *)__b));
13997}
13998
13999/* vec_lvrx */
14000
14001static __inline__ vector signed char __ATTRS_o_ai
14002vec_lvrx(int __a, const signed char *__b) {
14003 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
14004 vec_lvsl(__a, __b));
14005}
14006
14007static __inline__ vector signed char __ATTRS_o_ai
14008vec_lvrx(int __a, const vector signed char *__b) {
14009 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
14010 vec_lvsl(__a, (unsigned char *)__b));
14011}
14012
14013static __inline__ vector unsigned char __ATTRS_o_ai
14014vec_lvrx(int __a, const unsigned char *__b) {
14015 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
14016 vec_lvsl(__a, __b));
14017}
14018
14019static __inline__ vector unsigned char __ATTRS_o_ai
14020vec_lvrx(int __a, const vector unsigned char *__b) {
14021 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
14022 vec_lvsl(__a, (unsigned char *)__b));
14023}
14024
14025static __inline__ vector bool char __ATTRS_o_ai
14026vec_lvrx(int __a, const vector bool char *__b) {
14027 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
14028 vec_lvsl(__a, (unsigned char *)__b));
14029}
14030
14031static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
14032 const short *__b) {
14033 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
14034}
14035
14036static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
14037 const vector short *__b) {
14038 return vec_perm((vector short)(0), vec_ld(__a, __b),
14039 vec_lvsl(__a, (unsigned char *)__b));
14040}
14041
14042static __inline__ vector unsigned short __ATTRS_o_ai
14043vec_lvrx(int __a, const unsigned short *__b) {
14044 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
14045 vec_lvsl(__a, __b));
14046}
14047
14048static __inline__ vector unsigned short __ATTRS_o_ai
14049vec_lvrx(int __a, const vector unsigned short *__b) {
14050 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
14051 vec_lvsl(__a, (unsigned char *)__b));
14052}
14053
14054static __inline__ vector bool short __ATTRS_o_ai
14055vec_lvrx(int __a, const vector bool short *__b) {
14056 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
14057 vec_lvsl(__a, (unsigned char *)__b));
14058}
14059
14060static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
14061 const vector pixel *__b) {
14062 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
14063 vec_lvsl(__a, (unsigned char *)__b));
14064}
14065
14066static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
14067 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
14068}
14069
14070static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
14071 const vector int *__b) {
14072 return vec_perm((vector int)(0), vec_ld(__a, __b),
14073 vec_lvsl(__a, (unsigned char *)__b));
14074}
14075
14076static __inline__ vector unsigned int __ATTRS_o_ai
14077vec_lvrx(int __a, const unsigned int *__b) {
14078 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
14079 vec_lvsl(__a, __b));
14080}
14081
14082static __inline__ vector unsigned int __ATTRS_o_ai
14083vec_lvrx(int __a, const vector unsigned int *__b) {
14084 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
14085 vec_lvsl(__a, (unsigned char *)__b));
14086}
14087
14088static __inline__ vector bool int __ATTRS_o_ai
14089vec_lvrx(int __a, const vector bool int *__b) {
14090 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
14091 vec_lvsl(__a, (unsigned char *)__b));
14092}
14093
14094static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
14095 const float *__b) {
14096 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
14097}
14098
14099static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
14100 const vector float *__b) {
14101 return vec_perm((vector float)(0), vec_ld(__a, __b),
14102 vec_lvsl(__a, (unsigned char *)__b));
14103}
14104
14105/* vec_lvrxl */
14106
14107static __inline__ vector signed char __ATTRS_o_ai
14108vec_lvrxl(int __a, const signed char *__b) {
14109 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
14110 vec_lvsl(__a, __b));
14111}
14112
14113static __inline__ vector signed char __ATTRS_o_ai
14114vec_lvrxl(int __a, const vector signed char *__b) {
14115 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
14116 vec_lvsl(__a, (unsigned char *)__b));
14117}
14118
14119static __inline__ vector unsigned char __ATTRS_o_ai
14120vec_lvrxl(int __a, const unsigned char *__b) {
14121 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
14122 vec_lvsl(__a, __b));
14123}
14124
14125static __inline__ vector unsigned char __ATTRS_o_ai
14126vec_lvrxl(int __a, const vector unsigned char *__b) {
14127 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
14128 vec_lvsl(__a, (unsigned char *)__b));
14129}
14130
14131static __inline__ vector bool char __ATTRS_o_ai
14132vec_lvrxl(int __a, const vector bool char *__b) {
14133 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
14134 vec_lvsl(__a, (unsigned char *)__b));
14135}
14136
14137static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
14138 const short *__b) {
14139 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
14140}
14141
14142static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
14143 const vector short *__b) {
14144 return vec_perm((vector short)(0), vec_ldl(__a, __b),
14145 vec_lvsl(__a, (unsigned char *)__b));
14146}
14147
14148static __inline__ vector unsigned short __ATTRS_o_ai
14149vec_lvrxl(int __a, const unsigned short *__b) {
14150 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
14151 vec_lvsl(__a, __b));
14152}
14153
14154static __inline__ vector unsigned short __ATTRS_o_ai
14155vec_lvrxl(int __a, const vector unsigned short *__b) {
14156 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
14157 vec_lvsl(__a, (unsigned char *)__b));
14158}
14159
14160static __inline__ vector bool short __ATTRS_o_ai
14161vec_lvrxl(int __a, const vector bool short *__b) {
14162 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
14163 vec_lvsl(__a, (unsigned char *)__b));
14164}
14165
14166static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
14167 const vector pixel *__b) {
14168 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
14169 vec_lvsl(__a, (unsigned char *)__b));
14170}
14171
14172static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
14173 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
14174}
14175
14176static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
14177 const vector int *__b) {
14178 return vec_perm((vector int)(0), vec_ldl(__a, __b),
14179 vec_lvsl(__a, (unsigned char *)__b));
14180}
14181
14182static __inline__ vector unsigned int __ATTRS_o_ai
14183vec_lvrxl(int __a, const unsigned int *__b) {
14184 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
14185 vec_lvsl(__a, __b));
14186}
14187
14188static __inline__ vector unsigned int __ATTRS_o_ai
14189vec_lvrxl(int __a, const vector unsigned int *__b) {
14190 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
14191 vec_lvsl(__a, (unsigned char *)__b));
14192}
14193
14194static __inline__ vector bool int __ATTRS_o_ai
14195vec_lvrxl(int __a, const vector bool int *__b) {
14196 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
14197 vec_lvsl(__a, (unsigned char *)__b));
14198}
14199
14200static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
14201 const float *__b) {
14202 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
14203}
14204
14205static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
14206 const vector float *__b) {
14207 return vec_perm((vector float)(0), vec_ldl(__a, __b),
14208 vec_lvsl(__a, (unsigned char *)__b));
14209}
14210
14211/* vec_stvlx */
14212
14213static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
14214 signed char *__c) {
14216 __c);
14217}
14218
14219static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
14220 vector signed char *__c) {
14221 return vec_st(
14222 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14223 __b, __c);
14224}
14225
14226static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
14227 unsigned char *__c) {
14229 __c);
14230}
14231
14232static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
14233 vector unsigned char *__c) {
14234 return vec_st(
14235 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14236 __b, __c);
14237}
14238
14239static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
14240 vector bool char *__c) {
14241 return vec_st(
14242 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14243 __b, __c);
14244}
14245
14246static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
14247 short *__c) {
14249 __c);
14250}
14251
14252static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
14253 vector short *__c) {
14254 return vec_st(
14255 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14256 __b, __c);
14257}
14258
14259static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
14260 int __b, unsigned short *__c) {
14262 __c);
14263}
14264
14265static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
14266 int __b,
14267 vector unsigned short *__c) {
14268 return vec_st(
14269 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14270 __b, __c);
14271}
14272
14273static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
14274 vector bool short *__c) {
14275 return vec_st(
14276 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14277 __b, __c);
14278}
14279
14280static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
14281 vector pixel *__c) {
14282 return vec_st(
14283 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14284 __b, __c);
14285}
14286
14287static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
14288 int *__c) {
14290 __c);
14291}
14292
14293static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
14294 vector int *__c) {
14295 return vec_st(
14296 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14297 __b, __c);
14298}
14299
14300static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
14301 unsigned int *__c) {
14303 __c);
14304}
14305
14306static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
14307 vector unsigned int *__c) {
14308 return vec_st(
14309 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14310 __b, __c);
14311}
14312
14313static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
14314 vector bool int *__c) {
14315 return vec_st(
14316 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14317 __b, __c);
14318}
14319
14320static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
14321 vector float *__c) {
14322 return vec_st(
14323 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14324 __b, __c);
14325}
14326
14327/* vec_stvlxl */
14328
14329static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
14330 signed char *__c) {
14332 __c);
14333}
14334
14335static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
14336 vector signed char *__c) {
14337 return vec_stl(
14338 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14339 __b, __c);
14340}
14341
14342static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
14343 int __b, unsigned char *__c) {
14345 __c);
14346}
14347
14348static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
14349 int __b,
14350 vector unsigned char *__c) {
14351 return vec_stl(
14352 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14353 __b, __c);
14354}
14355
14356static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
14357 vector bool char *__c) {
14358 return vec_stl(
14359 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14360 __b, __c);
14361}
14362
14363static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
14364 short *__c) {
14366 __c);
14367}
14368
14369static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
14370 vector short *__c) {
14371 return vec_stl(
14372 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14373 __b, __c);
14374}
14375
14376static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
14377 int __b, unsigned short *__c) {
14379 __c);
14380}
14381
14382static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
14383 int __b,
14384 vector unsigned short *__c) {
14385 return vec_stl(
14386 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14387 __b, __c);
14388}
14389
14390static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
14391 vector bool short *__c) {
14392 return vec_stl(
14393 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14394 __b, __c);
14395}
14396
14397static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
14398 vector pixel *__c) {
14399 return vec_stl(
14400 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14401 __b, __c);
14402}
14403
14404static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
14405 int *__c) {
14407 __c);
14408}
14409
14410static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
14411 vector int *__c) {
14412 return vec_stl(
14413 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14414 __b, __c);
14415}
14416
14417static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
14418 unsigned int *__c) {
14420 __c);
14421}
14422
14423static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
14424 vector unsigned int *__c) {
14425 return vec_stl(
14426 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14427 __b, __c);
14428}
14429
14430static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
14431 vector bool int *__c) {
14432 return vec_stl(
14433 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14434 __b, __c);
14435}
14436
14437static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
14438 vector float *__c) {
14439 return vec_stl(
14440 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
14441 __b, __c);
14442}
14443
14444/* vec_stvrx */
14445
14446static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
14447 signed char *__c) {
14449 __c);
14450}
14451
14452static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
14453 vector signed char *__c) {
14454 return vec_st(
14455 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14456 __b, __c);
14457}
14458
14459static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
14460 unsigned char *__c) {
14462 __c);
14463}
14464
14465static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
14466 vector unsigned char *__c) {
14467 return vec_st(
14468 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14469 __b, __c);
14470}
14471
14472static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
14473 vector bool char *__c) {
14474 return vec_st(
14475 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14476 __b, __c);
14477}
14478
14479static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
14480 short *__c) {
14482 __c);
14483}
14484
14485static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
14486 vector short *__c) {
14487 return vec_st(
14488 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14489 __b, __c);
14490}
14491
14492static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
14493 int __b, unsigned short *__c) {
14495 __c);
14496}
14497
14498static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
14499 int __b,
14500 vector unsigned short *__c) {
14501 return vec_st(
14502 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14503 __b, __c);
14504}
14505
14506static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
14507 vector bool short *__c) {
14508 return vec_st(
14509 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14510 __b, __c);
14511}
14512
14513static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
14514 vector pixel *__c) {
14515 return vec_st(
14516 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14517 __b, __c);
14518}
14519
14520static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
14521 int *__c) {
14523 __c);
14524}
14525
14526static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
14527 vector int *__c) {
14528 return vec_st(
14529 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14530 __b, __c);
14531}
14532
14533static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
14534 unsigned int *__c) {
14536 __c);
14537}
14538
14539static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
14540 vector unsigned int *__c) {
14541 return vec_st(
14542 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14543 __b, __c);
14544}
14545
14546static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
14547 vector bool int *__c) {
14548 return vec_st(
14549 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14550 __b, __c);
14551}
14552
14553static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
14554 vector float *__c) {
14555 return vec_st(
14556 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14557 __b, __c);
14558}
14559
14560/* vec_stvrxl */
14561
14562static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
14563 signed char *__c) {
14565 __c);
14566}
14567
14568static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
14569 vector signed char *__c) {
14570 return vec_stl(
14571 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14572 __b, __c);
14573}
14574
14575static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
14576 int __b, unsigned char *__c) {
14578 __c);
14579}
14580
14581static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
14582 int __b,
14583 vector unsigned char *__c) {
14584 return vec_stl(
14585 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14586 __b, __c);
14587}
14588
14589static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
14590 vector bool char *__c) {
14591 return vec_stl(
14592 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14593 __b, __c);
14594}
14595
14596static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
14597 short *__c) {
14599 __c);
14600}
14601
14602static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
14603 vector short *__c) {
14604 return vec_stl(
14605 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14606 __b, __c);
14607}
14608
14609static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
14610 int __b, unsigned short *__c) {
14612 __c);
14613}
14614
14615static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
14616 int __b,
14617 vector unsigned short *__c) {
14618 return vec_stl(
14619 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14620 __b, __c);
14621}
14622
14623static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
14624 vector bool short *__c) {
14625 return vec_stl(
14626 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14627 __b, __c);
14628}
14629
14630static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
14631 vector pixel *__c) {
14632 return vec_stl(
14633 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14634 __b, __c);
14635}
14636
14637static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
14638 int *__c) {
14640 __c);
14641}
14642
14643static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
14644 vector int *__c) {
14645 return vec_stl(
14646 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14647 __b, __c);
14648}
14649
14650static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
14651 unsigned int *__c) {
14653 __c);
14654}
14655
14656static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
14657 vector unsigned int *__c) {
14658 return vec_stl(
14659 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14660 __b, __c);
14661}
14662
14663static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
14664 vector bool int *__c) {
14665 return vec_stl(
14666 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14667 __b, __c);
14668}
14669
14670static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
14671 vector float *__c) {
14672 return vec_stl(
14673 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
14674 __b, __c);
14675}
14676
14677/* vec_promote */
14678
14679static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
14680 int __b) {
14681 const vector signed char __zero = (vector signed char)0;
14682 vector signed char __res =
14683 __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1,
14684 -1, -1, -1, -1, -1, -1, -1, -1);
14685 __res[__b & 0xf] = __a;
14686 return __res;
14687}
14688
14689static __inline__ vector unsigned char __ATTRS_o_ai
14690vec_promote(unsigned char __a, int __b) {
14691 const vector unsigned char __zero = (vector unsigned char)(0);
14692 vector unsigned char __res =
14693 __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1,
14694 -1, -1, -1, -1, -1, -1, -1, -1);
14695 __res[__b & 0xf] = __a;
14696 return __res;
14697}
14698
14699static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
14700 const vector short __zero = (vector short)(0);
14701 vector short __res =
14702 __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1);
14703 __res[__b & 0x7] = __a;
14704 return __res;
14705}
14706
14707static __inline__ vector unsigned short __ATTRS_o_ai
14708vec_promote(unsigned short __a, int __b) {
14709 const vector unsigned short __zero = (vector unsigned short)(0);
14710 vector unsigned short __res =
14711 __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1);
14712 __res[__b & 0x7] = __a;
14713 return __res;
14714}
14715
14716static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
14717 const vector int __zero = (vector int)(0);
14718 vector int __res = __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);
14719 __res[__b & 0x3] = __a;
14720 return __res;
14721}
14722
14723static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
14724 int __b) {
14725 const vector unsigned int __zero = (vector unsigned int)(0);
14726 vector unsigned int __res =
14727 __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);
14728 __res[__b & 0x3] = __a;
14729 return __res;
14730}
14731
14732static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
14733 const vector float __zero = (vector float)(0);
14734 vector float __res = __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);
14735 __res[__b & 0x3] = __a;
14736 return __res;
14737}
14738
14739#ifdef __VSX__
14740static __inline__ vector double __ATTRS_o_ai vec_promote(double __a, int __b) {
14741 const vector double __zero = (vector double)(0);
14742 vector double __res = __builtin_shufflevector(__zero, __zero, -1, -1);
14743 __res[__b & 0x1] = __a;
14744 return __res;
14745}
14746
14747static __inline__ vector signed long long __ATTRS_o_ai
14748vec_promote(signed long long __a, int __b) {
14749 const vector signed long long __zero = (vector signed long long)(0);
14750 vector signed long long __res =
14751 __builtin_shufflevector(__zero, __zero, -1, -1);
14752 __res[__b & 0x1] = __a;
14753 return __res;
14754}
14755
14756static __inline__ vector unsigned long long __ATTRS_o_ai
14757vec_promote(unsigned long long __a, int __b) {
14758 const vector unsigned long long __zero = (vector unsigned long long)(0);
14759 vector unsigned long long __res =
14760 __builtin_shufflevector(__zero, __zero, -1, -1);
14761 __res[__b & 0x1] = __a;
14762 return __res;
14763}
14764#endif
14765
14766/* vec_splats */
14767
14768static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
14769 return (vector signed char)(__a);
14770}
14771
14772static __inline__ vector unsigned char __ATTRS_o_ai
14773vec_splats(unsigned char __a) {
14774 return (vector unsigned char)(__a);
14775}
14776
14777static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
14778 return (vector short)(__a);
14779}
14780
14781static __inline__ vector unsigned short __ATTRS_o_ai
14782vec_splats(unsigned short __a) {
14783 return (vector unsigned short)(__a);
14784}
14785
14786static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
14787 return (vector int)(__a);
14788}
14789
14790static __inline__ vector unsigned int __ATTRS_o_ai
14791vec_splats(unsigned int __a) {
14792 return (vector unsigned int)(__a);
14793}
14794
14795#ifdef __VSX__
14796static __inline__ vector signed long long __ATTRS_o_ai
14797vec_splats(signed long long __a) {
14798 return (vector signed long long)(__a);
14799}
14800
14801static __inline__ vector unsigned long long __ATTRS_o_ai
14802vec_splats(unsigned long long __a) {
14803 return (vector unsigned long long)(__a);
14804}
14805
14806#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
14807 defined(__SIZEOF_INT128__)
14808static __inline__ vector signed __int128 __ATTRS_o_ai
14809vec_splats(signed __int128 __a) {
14810 return (vector signed __int128)(__a);
14811}
14812
14813static __inline__ vector unsigned __int128 __ATTRS_o_ai
14814vec_splats(unsigned __int128 __a) {
14815 return (vector unsigned __int128)(__a);
14816}
14817
14818#endif
14819
14820static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
14821 return (vector double)(__a);
14822}
14823#endif
14824
14825static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
14826 return (vector float)(__a);
14827}
14828
14829/* ----------------------------- predicates --------------------------------- */
14830
14831/* vec_all_eq */
14832
14833static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
14834 vector signed char __b) {
14835 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14836 (vector char)__b);
14837}
14838
14839static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
14840 vector bool char __b) {
14841 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14842 (vector char)__b);
14843}
14844
14845static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
14846 vector unsigned char __b) {
14847 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14848 (vector char)__b);
14849}
14850
14851static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
14852 vector bool char __b) {
14853 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14854 (vector char)__b);
14855}
14856
14857static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
14858 vector signed char __b) {
14859 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14860 (vector char)__b);
14861}
14862
14863static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
14864 vector unsigned char __b) {
14865 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14866 (vector char)__b);
14867}
14868
14869static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
14870 vector bool char __b) {
14871 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
14872 (vector char)__b);
14873}
14874
14875static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
14876 vector short __b) {
14877 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
14878}
14879
14880static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
14881 vector bool short __b) {
14882 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
14883}
14884
14885static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
14886 vector unsigned short __b) {
14887 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14888 (vector short)__b);
14889}
14890
14891static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
14892 vector bool short __b) {
14893 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14894 (vector short)__b);
14895}
14896
14897static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
14898 vector short __b) {
14899 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14900 (vector short)__b);
14901}
14902
14903static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
14904 vector unsigned short __b) {
14905 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14906 (vector short)__b);
14907}
14908
14909static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
14910 vector bool short __b) {
14911 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14912 (vector short)__b);
14913}
14914
14915static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
14916 vector pixel __b) {
14917 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
14918 (vector short)__b);
14919}
14920
14921static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
14922 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
14923}
14924
14925static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
14926 vector bool int __b) {
14927 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
14928}
14929
14930static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
14931 vector unsigned int __b) {
14932 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14933 (vector int)__b);
14934}
14935
14936static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
14937 vector bool int __b) {
14938 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14939 (vector int)__b);
14940}
14941
14942static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14943 vector int __b) {
14944 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14945 (vector int)__b);
14946}
14947
14948static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14949 vector unsigned int __b) {
14950 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14951 (vector int)__b);
14952}
14953
14954static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
14955 vector bool int __b) {
14956 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
14957 (vector int)__b);
14958}
14959
14960#ifdef __VSX__
14961static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
14962 vector signed long long __b) {
14963#ifdef __POWER8_VECTOR__
14964 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
14965#else
14966 // No vcmpequd on Power7 so we xor the two vectors and compare against zero as
14967 // 32-bit elements.
14968 return vec_all_eq((vector signed int)vec_xor(__a, __b), (vector signed int)0);
14969#endif
14970}
14971
14972static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
14973 vector bool long long __b) {
14974 return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14975}
14976
14977static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
14978 vector unsigned long long __b) {
14979 return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14980}
14981
14982static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
14983 vector bool long long __b) {
14984 return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14985}
14986
14987static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14988 vector long long __b) {
14989 return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14990}
14991
14992static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14993 vector unsigned long long __b) {
14994 return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
14995}
14996
14997static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
14998 vector bool long long __b) {
14999 return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);
15000}
15001#endif
15002
15003static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
15004 vector float __b) {
15005#ifdef __VSX__
15006 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
15007#else
15008 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
15009#endif
15010}
15011
15012#ifdef __VSX__
15013static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
15014 vector double __b) {
15015 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
15016}
15017#endif
15018
15019#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15020static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed __int128 __a,
15021 vector signed __int128 __b) {
15022 return __builtin_altivec_vcmpequq_p(__CR6_LT, (vector unsigned __int128)__a,
15023 (vector signed __int128)__b);
15024}
15025
15026static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned __int128 __a,
15027 vector unsigned __int128 __b) {
15028 return __builtin_altivec_vcmpequq_p(__CR6_LT, __a,
15029 (vector signed __int128)__b);
15030}
15031
15032static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool __int128 __a,
15033 vector bool __int128 __b) {
15034 return __builtin_altivec_vcmpequq_p(__CR6_LT, (vector unsigned __int128)__a,
15035 (vector signed __int128)__b);
15036}
15037#endif
15038
15039/* vec_all_ge */
15040
15041static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
15042 vector signed char __b) {
15043 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
15044}
15045
15046static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
15047 vector bool char __b) {
15048 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
15049}
15050
15051static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
15052 vector unsigned char __b) {
15053 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
15054}
15055
15056static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
15057 vector bool char __b) {
15058 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
15059}
15060
15061static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
15062 vector signed char __b) {
15063 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, (vector signed char)__a);
15064}
15065
15066static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
15067 vector unsigned char __b) {
15068 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
15069}
15070
15071static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
15072 vector bool char __b) {
15073 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
15074 (vector unsigned char)__a);
15075}
15076
15077static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
15078 vector short __b) {
15079 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
15080}
15081
15082static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
15083 vector bool short __b) {
15084 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
15085}
15086
15087static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
15088 vector unsigned short __b) {
15089 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
15090}
15091
15092static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
15093 vector bool short __b) {
15094 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
15095 __a);
15096}
15097
15098static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
15099 vector short __b) {
15100 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, (vector signed short)__a);
15101}
15102
15103static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
15104 vector unsigned short __b) {
15105 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
15106 (vector unsigned short)__a);
15107}
15108
15109static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
15110 vector bool short __b) {
15111 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
15112 (vector unsigned short)__a);
15113}
15114
15115static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
15116 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
15117}
15118
15119static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
15120 vector bool int __b) {
15121 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
15122}
15123
15124static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
15125 vector unsigned int __b) {
15126 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
15127}
15128
15129static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
15130 vector bool int __b) {
15131 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
15132}
15133
15134static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
15135 vector int __b) {
15136 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, (vector signed int)__a);
15137}
15138
15139static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
15140 vector unsigned int __b) {
15141 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
15142}
15143
15144static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
15145 vector bool int __b) {
15146 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
15147 (vector unsigned int)__a);
15148}
15149
15150#ifdef __VSX__
15151static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
15152 vector signed long long __b) {
15153 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
15154}
15155static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
15156 vector bool long long __b) {
15157 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
15158 __a);
15159}
15160
15161static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
15162 vector unsigned long long __b) {
15163 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
15164}
15165
15166static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
15167 vector bool long long __b) {
15168 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
15169 __a);
15170}
15171
15172static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
15173 vector signed long long __b) {
15174 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b,
15175 (vector signed long long)__a);
15176}
15177
15178static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
15179 vector unsigned long long __b) {
15180 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
15181 (vector unsigned long long)__a);
15182}
15183
15184static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
15185 vector bool long long __b) {
15186 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
15187 (vector unsigned long long)__a);
15188}
15189#endif
15190
15191static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
15192 vector float __b) {
15193#ifdef __VSX__
15194 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
15195#else
15196 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
15197#endif
15198}
15199
15200#ifdef __VSX__
15201static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
15202 vector double __b) {
15203 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
15204}
15205#endif
15206
15207#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15208static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed __int128 __a,
15209 vector signed __int128 __b) {
15210 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __b, __a);
15211}
15212
15213static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned __int128 __a,
15214 vector unsigned __int128 __b) {
15215 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __b, __a);
15216}
15217#endif
15218
15219/* vec_all_gt */
15220
15221static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
15222 vector signed char __b) {
15223 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
15224}
15225
15226static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
15227 vector bool char __b) {
15228 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
15229}
15230
15231static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
15232 vector unsigned char __b) {
15233 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
15234}
15235
15236static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
15237 vector bool char __b) {
15238 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
15239}
15240
15241static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
15242 vector signed char __b) {
15243 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__a, __b);
15244}
15245
15246static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
15247 vector unsigned char __b) {
15248 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
15249}
15250
15251static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
15252 vector bool char __b) {
15253 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
15254 (vector unsigned char)__b);
15255}
15256
15257static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
15258 vector short __b) {
15259 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
15260}
15261
15262static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
15263 vector bool short __b) {
15264 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
15265}
15266
15267static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
15268 vector unsigned short __b) {
15269 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
15270}
15271
15272static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
15273 vector bool short __b) {
15274 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
15275 (vector unsigned short)__b);
15276}
15277
15278static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
15279 vector short __b) {
15280 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector signed short)__a, __b);
15281}
15282
15283static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
15284 vector unsigned short __b) {
15285 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
15286 __b);
15287}
15288
15289static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
15290 vector bool short __b) {
15291 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
15292 (vector unsigned short)__b);
15293}
15294
15295static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
15296 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
15297}
15298
15299static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
15300 vector bool int __b) {
15301 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
15302}
15303
15304static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
15305 vector unsigned int __b) {
15306 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
15307}
15308
15309static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
15310 vector bool int __b) {
15311 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
15312}
15313
15314static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
15315 vector int __b) {
15316 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector signed int)__a, __b);
15317}
15318
15319static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
15320 vector unsigned int __b) {
15321 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
15322}
15323
15324static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
15325 vector bool int __b) {
15326 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
15327 (vector unsigned int)__b);
15328}
15329
15330#ifdef __VSX__
15331static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
15332 vector signed long long __b) {
15333 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
15334}
15335static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
15336 vector bool long long __b) {
15337 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
15338 (vector signed long long)__b);
15339}
15340
15341static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
15342 vector unsigned long long __b) {
15343 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
15344}
15345
15346static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
15347 vector bool long long __b) {
15348 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
15349 (vector unsigned long long)__b);
15350}
15351
15352static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
15353 vector signed long long __b) {
15354 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__a,
15355 __b);
15356}
15357
15358static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
15359 vector unsigned long long __b) {
15360 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
15361 __b);
15362}
15363
15364static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
15365 vector bool long long __b) {
15366 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
15367 (vector unsigned long long)__b);
15368}
15369#endif
15370
15371static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
15372 vector float __b) {
15373#ifdef __VSX__
15374 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
15375#else
15376 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
15377#endif
15378}
15379
15380#ifdef __VSX__
15381static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
15382 vector double __b) {
15383 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
15384}
15385#endif
15386
15387#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15388static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed __int128 __a,
15389 vector signed __int128 __b) {
15390 return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __a, __b);
15391}
15392
15393static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned __int128 __a,
15394 vector unsigned __int128 __b) {
15395 return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __a, __b);
15396}
15397#endif
15398
15399/* vec_all_in */
15400
15401static __inline__ int __attribute__((__always_inline__))
15402vec_all_in(vector float __a, vector float __b) {
15403 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
15404}
15405
15406/* vec_all_le */
15407
15408static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
15409 vector signed char __b) {
15410 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
15411}
15412
15413static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
15414 vector bool char __b) {
15415 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
15416}
15417
15418static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
15419 vector unsigned char __b) {
15420 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
15421}
15422
15423static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
15424 vector bool char __b) {
15425 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
15426}
15427
15428static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
15429 vector signed char __b) {
15430 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__a, __b);
15431}
15432
15433static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
15434 vector unsigned char __b) {
15435 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
15436}
15437
15438static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
15439 vector bool char __b) {
15440 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
15441 (vector unsigned char)__b);
15442}
15443
15444static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
15445 vector short __b) {
15446 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
15447}
15448
15449static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
15450 vector bool short __b) {
15451 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
15452}
15453
15454static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
15455 vector unsigned short __b) {
15456 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
15457}
15458
15459static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
15460 vector bool short __b) {
15461 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
15462 (vector unsigned short)__b);
15463}
15464
15465static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
15466 vector short __b) {
15467 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector signed short)__a, __b);
15468}
15469
15470static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
15471 vector unsigned short __b) {
15472 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
15473 __b);
15474}
15475
15476static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
15477 vector bool short __b) {
15478 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
15479 (vector unsigned short)__b);
15480}
15481
15482static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
15483 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
15484}
15485
15486static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
15487 vector bool int __b) {
15488 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
15489}
15490
15491static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
15492 vector unsigned int __b) {
15493 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
15494}
15495
15496static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
15497 vector bool int __b) {
15498 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
15499}
15500
15501static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
15502 vector int __b) {
15503 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector signed int)__a, __b);
15504}
15505
15506static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
15507 vector unsigned int __b) {
15508 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
15509}
15510
15511static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
15512 vector bool int __b) {
15513 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
15514 (vector unsigned int)__b);
15515}
15516
15517#ifdef __VSX__
15518static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
15519 vector signed long long __b) {
15520 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
15521}
15522
15523static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
15524 vector unsigned long long __b) {
15525 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
15526}
15527
15528static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
15529 vector bool long long __b) {
15530 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
15531 (vector signed long long)__b);
15532}
15533
15534static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
15535 vector bool long long __b) {
15536 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
15537 (vector unsigned long long)__b);
15538}
15539
15540static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
15541 vector signed long long __b) {
15542 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__a,
15543 __b);
15544}
15545
15546static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
15547 vector unsigned long long __b) {
15548 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
15549 __b);
15550}
15551
15552static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
15553 vector bool long long __b) {
15554 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
15555 (vector unsigned long long)__b);
15556}
15557#endif
15558
15559static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
15560 vector float __b) {
15561#ifdef __VSX__
15562 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
15563#else
15564 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
15565#endif
15566}
15567
15568#ifdef __VSX__
15569static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
15570 vector double __b) {
15571 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
15572}
15573#endif
15574
15575#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15576static __inline__ int __ATTRS_o_ai vec_all_le(vector signed __int128 __a,
15577 vector signed __int128 __b) {
15578 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __a, __b);
15579}
15580
15581static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned __int128 __a,
15582 vector unsigned __int128 __b) {
15583 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __a, __b);
15584}
15585#endif
15586
15587/* vec_all_lt */
15588
15589static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
15590 vector signed char __b) {
15591 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
15592}
15593
15594static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
15595 vector bool char __b) {
15596 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
15597}
15598
15599static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
15600 vector unsigned char __b) {
15601 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
15602}
15603
15604static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
15605 vector bool char __b) {
15606 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
15607}
15608
15609static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
15610 vector signed char __b) {
15611 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, (vector signed char)__a);
15612}
15613
15614static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
15615 vector unsigned char __b) {
15616 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
15617}
15618
15619static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
15620 vector bool char __b) {
15621 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
15622 (vector unsigned char)__a);
15623}
15624
15625static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
15626 vector short __b) {
15627 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
15628}
15629
15630static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
15631 vector bool short __b) {
15632 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
15633}
15634
15635static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
15636 vector unsigned short __b) {
15637 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
15638}
15639
15640static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
15641 vector bool short __b) {
15642 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
15643 __a);
15644}
15645
15646static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
15647 vector short __b) {
15648 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, (vector signed short)__a);
15649}
15650
15651static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
15652 vector unsigned short __b) {
15653 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
15654 (vector unsigned short)__a);
15655}
15656
15657static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
15658 vector bool short __b) {
15659 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
15660 (vector unsigned short)__a);
15661}
15662
15663static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
15664 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
15665}
15666
15667static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
15668 vector bool int __b) {
15669 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
15670}
15671
15672static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
15673 vector unsigned int __b) {
15674 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
15675}
15676
15677static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
15678 vector bool int __b) {
15679 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
15680}
15681
15682static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
15683 vector int __b) {
15684 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, (vector signed int)__a);
15685}
15686
15687static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
15688 vector unsigned int __b) {
15689 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
15690}
15691
15692static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
15693 vector bool int __b) {
15694 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
15695 (vector unsigned int)__a);
15696}
15697
15698#ifdef __VSX__
15699static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
15700 vector signed long long __b) {
15701 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
15702}
15703
15704static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
15705 vector unsigned long long __b) {
15706 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
15707}
15708
15709static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
15710 vector bool long long __b) {
15711 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
15712 __a);
15713}
15714
15715static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
15716 vector bool long long __b) {
15717 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
15718 __a);
15719}
15720
15721static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15722 vector signed long long __b) {
15723 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b,
15724 (vector signed long long)__a);
15725}
15726
15727static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15728 vector unsigned long long __b) {
15729 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
15730 (vector unsigned long long)__a);
15731}
15732
15733static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
15734 vector bool long long __b) {
15735 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
15736 (vector unsigned long long)__a);
15737}
15738#endif
15739
15740static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
15741 vector float __b) {
15742#ifdef __VSX__
15743 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
15744#else
15745 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
15746#endif
15747}
15748
15749#ifdef __VSX__
15750static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
15751 vector double __b) {
15752 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
15753}
15754#endif
15755
15756#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15757static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed __int128 __a,
15758 vector signed __int128 __b) {
15759 return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __b, __a);
15760}
15761
15762static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned __int128 __a,
15763 vector unsigned __int128 __b) {
15764 return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __b, __a);
15765}
15766#endif
15767
15768/* vec_all_nan */
15769
15770static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
15771#ifdef __VSX__
15772 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
15773#else
15774 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
15775#endif
15776}
15777
15778#ifdef __VSX__
15779static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
15780 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
15781}
15782#endif
15783
15784/* vec_all_ne */
15785
15786static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
15787 vector signed char __b) {
15788 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15789 (vector char)__b);
15790}
15791
15792static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
15793 vector bool char __b) {
15794 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15795 (vector char)__b);
15796}
15797
15798static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
15799 vector unsigned char __b) {
15800 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15801 (vector char)__b);
15802}
15803
15804static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
15805 vector bool char __b) {
15806 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15807 (vector char)__b);
15808}
15809
15810static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
15811 vector signed char __b) {
15812 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15813 (vector char)__b);
15814}
15815
15816static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
15817 vector unsigned char __b) {
15818 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15819 (vector char)__b);
15820}
15821
15822static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
15823 vector bool char __b) {
15824 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
15825 (vector char)__b);
15826}
15827
15828static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
15829 vector short __b) {
15830 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
15831}
15832
15833static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
15834 vector bool short __b) {
15835 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
15836}
15837
15838static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
15839 vector unsigned short __b) {
15840 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15841 (vector short)__b);
15842}
15843
15844static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
15845 vector bool short __b) {
15846 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15847 (vector short)__b);
15848}
15849
15850static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
15851 vector short __b) {
15852 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15853 (vector short)__b);
15854}
15855
15856static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
15857 vector unsigned short __b) {
15858 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15859 (vector short)__b);
15860}
15861
15862static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
15863 vector bool short __b) {
15864 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15865 (vector short)__b);
15866}
15867
15868static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
15869 vector pixel __b) {
15870 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
15871 (vector short)__b);
15872}
15873
15874static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
15875 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
15876}
15877
15878static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
15879 vector bool int __b) {
15880 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
15881}
15882
15883static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
15884 vector unsigned int __b) {
15885 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15886 (vector int)__b);
15887}
15888
15889static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
15890 vector bool int __b) {
15891 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15892 (vector int)__b);
15893}
15894
15895static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15896 vector int __b) {
15897 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15898 (vector int)__b);
15899}
15900
15901static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15902 vector unsigned int __b) {
15903 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15904 (vector int)__b);
15905}
15906
15907static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
15908 vector bool int __b) {
15909 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
15910 (vector int)__b);
15911}
15912
15913#ifdef __VSX__
15914static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
15915 vector signed long long __b) {
15916 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
15917}
15918
15919static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
15920 vector unsigned long long __b) {
15921 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
15922 (vector long long)__b);
15923}
15924
15925static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
15926 vector bool long long __b) {
15927 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
15928 (vector signed long long)__b);
15929}
15930
15931static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
15932 vector bool long long __b) {
15933 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15934 (vector signed long long)__b);
15935}
15936
15937static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
15938 vector signed long long __b) {
15939 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15940 (vector signed long long)__b);
15941}
15942
15943static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
15944 vector unsigned long long __b) {
15945 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15946 (vector signed long long)__b);
15947}
15948
15949static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
15950 vector bool long long __b) {
15951 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
15952 (vector signed long long)__b);
15953}
15954#endif
15955
15956static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
15957 vector float __b) {
15958#ifdef __VSX__
15959 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __b);
15960#else
15961 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
15962#endif
15963}
15964
15965#ifdef __VSX__
15966static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
15967 vector double __b) {
15968 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
15969}
15970#endif
15971
15972#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
15973static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed __int128 __a,
15974 vector signed __int128 __b) {
15975 return __builtin_altivec_vcmpequq_p(__CR6_EQ, (vector unsigned __int128)__a,
15976 __b);
15977}
15978
15979static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned __int128 __a,
15980 vector unsigned __int128 __b) {
15981 return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a,
15982 (vector signed __int128)__b);
15983}
15984
15985static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool __int128 __a,
15986 vector bool __int128 __b) {
15987 return __builtin_altivec_vcmpequq_p(__CR6_EQ, (vector unsigned __int128)__a,
15988 (vector signed __int128)__b);
15989}
15990#endif
15991
15992/* vec_all_nge */
15993
15994static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
15995 vector float __b) {
15996#ifdef __VSX__
15997 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
15998#else
15999 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
16000#endif
16001}
16002
16003#ifdef __VSX__
16004static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
16005 vector double __b) {
16006 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
16007}
16008#endif
16009
16010/* vec_all_ngt */
16011
16012static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
16013 vector float __b) {
16014#ifdef __VSX__
16015 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
16016#else
16017 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
16018#endif
16019}
16020
16021#ifdef __VSX__
16022static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
16023 vector double __b) {
16024 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
16025}
16026#endif
16027
16028/* vec_all_nle */
16029
16030static __inline__ int __ATTRS_o_ai
16031vec_all_nle(vector float __a, vector float __b) {
16032#ifdef __VSX__
16033 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __b, __a);
16034#else
16035 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
16036#endif
16037}
16038
16039#ifdef __VSX__
16040static __inline__ int __ATTRS_o_ai vec_all_nle(vector double __a,
16041 vector double __b) {
16042 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __b, __a);
16043}
16044#endif
16045
16046/* vec_all_nlt */
16047
16048static __inline__ int __ATTRS_o_ai
16049vec_all_nlt(vector float __a, vector float __b) {
16050#ifdef __VSX__
16051 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __b, __a);
16052#else
16053 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
16054#endif
16055}
16056
16057#ifdef __VSX__
16058static __inline__ int __ATTRS_o_ai vec_all_nlt(vector double __a,
16059 vector double __b) {
16060 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __b, __a);
16061}
16062#endif
16063
16064/* vec_all_numeric */
16065
16066static __inline__ int __ATTRS_o_ai
16067vec_all_numeric(vector float __a) {
16068#ifdef __VSX__
16069 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __a);
16070#else
16071 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
16072#endif
16073}
16074
16075#ifdef __VSX__
16076static __inline__ int __ATTRS_o_ai vec_all_numeric(vector double __a) {
16077 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __a);
16078}
16079#endif
16080
16081/* vec_any_eq */
16082
16083static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
16084 vector signed char __b) {
16085 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16086 (vector char)__b);
16087}
16088
16089static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
16090 vector bool char __b) {
16091 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16092 (vector char)__b);
16093}
16094
16095static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
16096 vector unsigned char __b) {
16097 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16098 (vector char)__b);
16099}
16100
16101static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
16102 vector bool char __b) {
16103 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16104 (vector char)__b);
16105}
16106
16107static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
16108 vector signed char __b) {
16109 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16110 (vector char)__b);
16111}
16112
16113static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
16114 vector unsigned char __b) {
16115 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16116 (vector char)__b);
16117}
16118
16119static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
16120 vector bool char __b) {
16121 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
16122 (vector char)__b);
16123}
16124
16125static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
16126 vector short __b) {
16127 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
16128}
16129
16130static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
16131 vector bool short __b) {
16132 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
16133}
16134
16135static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
16136 vector unsigned short __b) {
16137 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16138 (vector short)__b);
16139}
16140
16141static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
16142 vector bool short __b) {
16143 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16144 (vector short)__b);
16145}
16146
16147static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
16148 vector short __b) {
16149 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16150 (vector short)__b);
16151}
16152
16153static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
16154 vector unsigned short __b) {
16155 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16156 (vector short)__b);
16157}
16158
16159static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
16160 vector bool short __b) {
16161 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16162 (vector short)__b);
16163}
16164
16165static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
16166 vector pixel __b) {
16167 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
16168 (vector short)__b);
16169}
16170
16171static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
16172 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
16173}
16174
16175static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
16176 vector bool int __b) {
16177 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
16178}
16179
16180static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
16181 vector unsigned int __b) {
16182 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16183 (vector int)__b);
16184}
16185
16186static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
16187 vector bool int __b) {
16188 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16189 (vector int)__b);
16190}
16191
16192static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
16193 vector int __b) {
16194 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16195 (vector int)__b);
16196}
16197
16198static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
16199 vector unsigned int __b) {
16200 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16201 (vector int)__b);
16202}
16203
16204static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
16205 vector bool int __b) {
16206 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
16207 (vector int)__b);
16208}
16209
16210#ifdef __VSX__
16211static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
16212 vector signed long long __b) {
16213 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
16214}
16215
16216static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
16217 vector unsigned long long __b) {
16218 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
16219 (vector long long)__b);
16220}
16221
16222static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
16223 vector bool long long __b) {
16224 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
16225 (vector signed long long)__b);
16226}
16227
16228static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
16229 vector bool long long __b) {
16230 return __builtin_altivec_vcmpequd_p(
16231 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16232}
16233
16234static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
16235 vector signed long long __b) {
16236 return __builtin_altivec_vcmpequd_p(
16237 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16238}
16239
16240static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
16241 vector unsigned long long __b) {
16242 return __builtin_altivec_vcmpequd_p(
16243 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16244}
16245
16246static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
16247 vector bool long long __b) {
16248 return __builtin_altivec_vcmpequd_p(
16249 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
16250}
16251#endif
16252
16253static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
16254 vector float __b) {
16255#ifdef __VSX__
16256 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
16257#else
16258 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
16259#endif
16260}
16261
16262#ifdef __VSX__
16263static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
16264 vector double __b) {
16265 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
16266}
16267#endif
16268
16269#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16270static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed __int128 __a,
16271 vector signed __int128 __b) {
16272 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV,
16273 (vector unsigned __int128)__a, __b);
16274}
16275
16276static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned __int128 __a,
16277 vector unsigned __int128 __b) {
16278 return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a,
16279 (vector signed __int128)__b);
16280}
16281
16282static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool __int128 __a,
16283 vector bool __int128 __b) {
16284 return __builtin_altivec_vcmpequq_p(
16285 __CR6_EQ_REV, (vector unsigned __int128)__a, (vector signed __int128)__b);
16286}
16287#endif
16288
16289/* vec_any_ge */
16290
16291static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
16292 vector signed char __b) {
16293 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
16294}
16295
16296static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
16297 vector bool char __b) {
16298 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
16299 __a);
16300}
16301
16302static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
16303 vector unsigned char __b) {
16304 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
16305}
16306
16307static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
16308 vector bool char __b) {
16309 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
16310 __a);
16311}
16312
16313static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
16314 vector signed char __b) {
16315 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b,
16316 (vector signed char)__a);
16317}
16318
16319static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
16320 vector unsigned char __b) {
16321 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
16322 (vector unsigned char)__a);
16323}
16324
16325static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
16326 vector bool char __b) {
16327 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
16328 (vector unsigned char)__a);
16329}
16330
16331static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
16332 vector short __b) {
16333 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
16334}
16335
16336static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
16337 vector bool short __b) {
16338 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
16339}
16340
16341static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
16342 vector unsigned short __b) {
16343 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
16344}
16345
16346static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
16347 vector bool short __b) {
16348 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
16349 __a);
16350}
16351
16352static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
16353 vector short __b) {
16354 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b,
16355 (vector signed short)__a);
16356}
16357
16358static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
16359 vector unsigned short __b) {
16360 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
16361 (vector unsigned short)__a);
16362}
16363
16364static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
16365 vector bool short __b) {
16366 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
16367 (vector unsigned short)__a);
16368}
16369
16370static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
16371 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
16372}
16373
16374static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
16375 vector bool int __b) {
16376 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
16377}
16378
16379static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
16380 vector unsigned int __b) {
16381 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
16382}
16383
16384static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
16385 vector bool int __b) {
16386 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
16387 __a);
16388}
16389
16390static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
16391 vector int __b) {
16392 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b,
16393 (vector signed int)__a);
16394}
16395
16396static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
16397 vector unsigned int __b) {
16398 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
16399 (vector unsigned int)__a);
16400}
16401
16402static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
16403 vector bool int __b) {
16404 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
16405 (vector unsigned int)__a);
16406}
16407
16408#ifdef __VSX__
16409static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
16410 vector signed long long __b) {
16411 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
16412}
16413
16414static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
16415 vector unsigned long long __b) {
16416 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
16417}
16418
16419static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
16420 vector bool long long __b) {
16421 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
16422 (vector signed long long)__b, __a);
16423}
16424
16425static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
16426 vector bool long long __b) {
16427 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16428 (vector unsigned long long)__b, __a);
16429}
16430
16431static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
16432 vector signed long long __b) {
16433 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b,
16434 (vector signed long long)__a);
16435}
16436
16437static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
16438 vector unsigned long long __b) {
16439 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
16440 (vector unsigned long long)__a);
16441}
16442
16443static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
16444 vector bool long long __b) {
16445 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16446 (vector unsigned long long)__b,
16447 (vector unsigned long long)__a);
16448}
16449#endif
16450
16451static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
16452 vector float __b) {
16453#ifdef __VSX__
16454 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
16455#else
16456 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
16457#endif
16458}
16459
16460#ifdef __VSX__
16461static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
16462 vector double __b) {
16463 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
16464}
16465#endif
16466
16467#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16468static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed __int128 __a,
16469 vector signed __int128 __b) {
16470 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __b, __a);
16471}
16472
16473static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned __int128 __a,
16474 vector unsigned __int128 __b) {
16475 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __b, __a);
16476}
16477#endif
16478
16479/* vec_any_gt */
16480
16481static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
16482 vector signed char __b) {
16483 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
16484}
16485
16486static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
16487 vector bool char __b) {
16488 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
16489 (vector signed char)__b);
16490}
16491
16492static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
16493 vector unsigned char __b) {
16494 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
16495}
16496
16497static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
16498 vector bool char __b) {
16499 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
16500 (vector unsigned char)__b);
16501}
16502
16503static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
16504 vector signed char __b) {
16505 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__a,
16506 __b);
16507}
16508
16509static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
16510 vector unsigned char __b) {
16511 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
16512 __b);
16513}
16514
16515static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
16516 vector bool char __b) {
16517 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
16518 (vector unsigned char)__b);
16519}
16520
16521static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
16522 vector short __b) {
16523 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
16524}
16525
16526static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
16527 vector bool short __b) {
16528 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
16529}
16530
16531static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
16532 vector unsigned short __b) {
16533 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
16534}
16535
16536static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
16537 vector bool short __b) {
16538 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
16539 (vector unsigned short)__b);
16540}
16541
16542static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
16543 vector short __b) {
16544 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector signed short)__a,
16545 __b);
16546}
16547
16548static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
16549 vector unsigned short __b) {
16550 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
16551 __b);
16552}
16553
16554static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
16555 vector bool short __b) {
16556 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
16557 (vector unsigned short)__b);
16558}
16559
16560static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
16561 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
16562}
16563
16564static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
16565 vector bool int __b) {
16566 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
16567}
16568
16569static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
16570 vector unsigned int __b) {
16571 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
16572}
16573
16574static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
16575 vector bool int __b) {
16576 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
16577 (vector unsigned int)__b);
16578}
16579
16580static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
16581 vector int __b) {
16582 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector signed int)__a,
16583 __b);
16584}
16585
16586static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
16587 vector unsigned int __b) {
16588 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
16589 __b);
16590}
16591
16592static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
16593 vector bool int __b) {
16594 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
16595 (vector unsigned int)__b);
16596}
16597
16598#ifdef __VSX__
16599static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
16600 vector signed long long __b) {
16601 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
16602}
16603
16604static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
16605 vector unsigned long long __b) {
16606 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
16607}
16608
16609static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
16610 vector bool long long __b) {
16611 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
16612 (vector signed long long)__b);
16613}
16614
16615static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
16616 vector bool long long __b) {
16617 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
16618 (vector unsigned long long)__b);
16619}
16620
16621static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
16622 vector signed long long __b) {
16623 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
16624 (vector signed long long)__a, __b);
16625}
16626
16627static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
16628 vector unsigned long long __b) {
16629 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16630 (vector unsigned long long)__a, __b);
16631}
16632
16633static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
16634 vector bool long long __b) {
16635 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16636 (vector unsigned long long)__a,
16637 (vector unsigned long long)__b);
16638}
16639#endif
16640
16641static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
16642 vector float __b) {
16643#ifdef __VSX__
16644 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
16645#else
16646 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
16647#endif
16648}
16649
16650#ifdef __VSX__
16651static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
16652 vector double __b) {
16653 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
16654}
16655#endif
16656
16657#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16658static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed __int128 __a,
16659 vector signed __int128 __b) {
16660 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __a, __b);
16661}
16662
16663static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned __int128 __a,
16664 vector unsigned __int128 __b) {
16665 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __a, __b);
16666}
16667#endif
16668
16669/* vec_any_le */
16670
16671static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
16672 vector signed char __b) {
16673 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
16674}
16675
16676static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
16677 vector bool char __b) {
16678 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
16679 (vector signed char)__b);
16680}
16681
16682static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
16683 vector unsigned char __b) {
16684 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
16685}
16686
16687static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
16688 vector bool char __b) {
16689 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
16690 (vector unsigned char)__b);
16691}
16692
16693static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
16694 vector signed char __b) {
16695 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__a,
16696 __b);
16697}
16698
16699static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
16700 vector unsigned char __b) {
16701 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
16702 __b);
16703}
16704
16705static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
16706 vector bool char __b) {
16707 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
16708 (vector unsigned char)__b);
16709}
16710
16711static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
16712 vector short __b) {
16713 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
16714}
16715
16716static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
16717 vector bool short __b) {
16718 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
16719}
16720
16721static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
16722 vector unsigned short __b) {
16723 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
16724}
16725
16726static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
16727 vector bool short __b) {
16728 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
16729 (vector unsigned short)__b);
16730}
16731
16732static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
16733 vector short __b) {
16734 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector signed short)__a,
16735 __b);
16736}
16737
16738static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
16739 vector unsigned short __b) {
16740 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
16741 __b);
16742}
16743
16744static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
16745 vector bool short __b) {
16746 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
16747 (vector unsigned short)__b);
16748}
16749
16750static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
16751 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
16752}
16753
16754static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
16755 vector bool int __b) {
16756 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
16757}
16758
16759static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
16760 vector unsigned int __b) {
16761 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
16762}
16763
16764static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
16765 vector bool int __b) {
16766 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
16767 (vector unsigned int)__b);
16768}
16769
16770static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16771 vector int __b) {
16772 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector signed int)__a,
16773 __b);
16774}
16775
16776static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16777 vector unsigned int __b) {
16778 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
16779 __b);
16780}
16781
16782static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
16783 vector bool int __b) {
16784 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
16785 (vector unsigned int)__b);
16786}
16787
16788#ifdef __VSX__
16789static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
16790 vector signed long long __b) {
16791 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
16792}
16793
16794static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
16795 vector unsigned long long __b) {
16796 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
16797}
16798
16799static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
16800 vector bool long long __b) {
16801 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
16802 (vector signed long long)__b);
16803}
16804
16805static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
16806 vector bool long long __b) {
16807 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
16808 (vector unsigned long long)__b);
16809}
16810
16811static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16812 vector signed long long __b) {
16813 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
16814 (vector signed long long)__a, __b);
16815}
16816
16817static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16818 vector unsigned long long __b) {
16819 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16820 (vector unsigned long long)__a, __b);
16821}
16822
16823static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
16824 vector bool long long __b) {
16825 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
16826 (vector unsigned long long)__a,
16827 (vector unsigned long long)__b);
16828}
16829#endif
16830
16831static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
16832 vector float __b) {
16833#ifdef __VSX__
16834 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
16835#else
16836 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
16837#endif
16838}
16839
16840#ifdef __VSX__
16841static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
16842 vector double __b) {
16843 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
16844}
16845#endif
16846
16847#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
16848static __inline__ int __ATTRS_o_ai vec_any_le(vector signed __int128 __a,
16849 vector signed __int128 __b) {
16850 return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __a, __b);
16851}
16852
16853static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned __int128 __a,
16854 vector unsigned __int128 __b) {
16855 return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __a, __b);
16856}
16857#endif
16858
16859/* vec_any_lt */
16860
16861static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
16862 vector signed char __b) {
16863 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
16864}
16865
16866static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
16867 vector bool char __b) {
16868 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
16869 __a);
16870}
16871
16872static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
16873 vector unsigned char __b) {
16874 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
16875}
16876
16877static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
16878 vector bool char __b) {
16879 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
16880 __a);
16881}
16882
16883static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16884 vector signed char __b) {
16885 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b,
16886 (vector signed char)__a);
16887}
16888
16889static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16890 vector unsigned char __b) {
16891 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
16892 (vector unsigned char)__a);
16893}
16894
16895static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
16896 vector bool char __b) {
16897 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
16898 (vector unsigned char)__a);
16899}
16900
16901static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
16902 vector short __b) {
16903 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
16904}
16905
16906static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
16907 vector bool short __b) {
16908 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
16909}
16910
16911static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
16912 vector unsigned short __b) {
16913 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
16914}
16915
16916static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
16917 vector bool short __b) {
16918 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
16919 __a);
16920}
16921
16922static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16923 vector short __b) {
16924 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b,
16925 (vector signed short)__a);
16926}
16927
16928static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16929 vector unsigned short __b) {
16930 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
16931 (vector unsigned short)__a);
16932}
16933
16934static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
16935 vector bool short __b) {
16936 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
16937 (vector unsigned short)__a);
16938}
16939
16940static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
16941 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
16942}
16943
16944static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
16945 vector bool int __b) {
16946 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
16947}
16948
16949static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
16950 vector unsigned int __b) {
16951 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
16952}
16953
16954static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
16955 vector bool int __b) {
16956 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
16957 __a);
16958}
16959
16960static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16961 vector int __b) {
16962 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b,
16963 (vector signed int)__a);
16964}
16965
16966static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16967 vector unsigned int __b) {
16968 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
16969 (vector unsigned int)__a);
16970}
16971
16972static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
16973 vector bool int __b) {
16974 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
16975 (vector unsigned int)__a);
16976}
16977
16978#ifdef __VSX__
16979static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
16980 vector signed long long __b) {
16981 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
16982}
16983
16984static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
16985 vector unsigned long long __b) {
16986 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
16987}
16988
16989static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
16990 vector bool long long __b) {
16991 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
16992 (vector signed long long)__b, __a);
16993}
16994
16995static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
16996 vector bool long long __b) {
16997 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
16998 (vector unsigned long long)__b, __a);
16999}
17000
17001static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
17002 vector signed long long __b) {
17003 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b,
17004 (vector signed long long)__a);
17005}
17006
17007static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
17008 vector unsigned long long __b) {
17009 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
17010 (vector unsigned long long)__a);
17011}
17012
17013static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
17014 vector bool long long __b) {
17015 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
17016 (vector unsigned long long)__b,
17017 (vector unsigned long long)__a);
17018}
17019#endif
17020
17021static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
17022 vector float __b) {
17023#ifdef __VSX__
17024 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
17025#else
17026 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
17027#endif
17028}
17029
17030#ifdef __VSX__
17031static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
17032 vector double __b) {
17033 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
17034}
17035#endif
17036
17037#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
17038static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed __int128 __a,
17039 vector signed __int128 __b) {
17040 return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __b, __a);
17041}
17042
17043static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned __int128 __a,
17044 vector unsigned __int128 __b) {
17045 return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __b, __a);
17046}
17047#endif
17048
17049/* vec_any_nan */
17050
17051static __inline__ int __ATTRS_o_ai vec_any_nan(vector float __a) {
17052#ifdef __VSX__
17053 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __a);
17054#else
17055 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
17056#endif
17057}
17058#ifdef __VSX__
17059static __inline__ int __ATTRS_o_ai vec_any_nan(vector double __a) {
17060 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __a);
17061}
17062#endif
17063
17064/* vec_any_ne */
17065
17066static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
17067 vector signed char __b) {
17068 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17069 (vector char)__b);
17070}
17071
17072static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
17073 vector bool char __b) {
17074 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17075 (vector char)__b);
17076}
17077
17078static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
17079 vector unsigned char __b) {
17080 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17081 (vector char)__b);
17082}
17083
17084static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
17085 vector bool char __b) {
17086 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17087 (vector char)__b);
17088}
17089
17090static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
17091 vector signed char __b) {
17092 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17093 (vector char)__b);
17094}
17095
17096static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
17097 vector unsigned char __b) {
17098 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17099 (vector char)__b);
17100}
17101
17102static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
17103 vector bool char __b) {
17104 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
17105 (vector char)__b);
17106}
17107
17108static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
17109 vector short __b) {
17110 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
17111}
17112
17113static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
17114 vector bool short __b) {
17115 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
17116}
17117
17118static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
17119 vector unsigned short __b) {
17120 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
17121 (vector short)__b);
17122}
17123
17124static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
17125 vector bool short __b) {
17126 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
17127 (vector short)__b);
17128}
17129
17130static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
17131 vector short __b) {
17132 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
17133 (vector short)__b);
17134}
17135
17136static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
17137 vector unsigned short __b) {
17138 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
17139 (vector short)__b);
17140}
17141
17142static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
17143 vector bool short __b) {
17144 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
17145 (vector short)__b);
17146}
17147
17148static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
17149 vector pixel __b) {
17150 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
17151 (vector short)__b);
17152}
17153
17154static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
17155 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
17156}
17157
17158static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
17159 vector bool int __b) {
17160 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
17161}
17162
17163static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
17164 vector unsigned int __b) {
17165 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17166 (vector int)__b);
17167}
17168
17169static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
17170 vector bool int __b) {
17171 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17172 (vector int)__b);
17173}
17174
17175static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
17176 vector int __b) {
17177 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17178 (vector int)__b);
17179}
17180
17181static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
17182 vector unsigned int __b) {
17183 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17184 (vector int)__b);
17185}
17186
17187static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
17188 vector bool int __b) {
17189 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
17190 (vector int)__b);
17191}
17192
17193#ifdef __VSX__
17194static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
17195 vector signed long long __b) {
17196#ifdef __POWER8_VECTOR__
17197 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
17198#else
17199 // Take advantage of the optimized sequence for vec_all_eq when vcmpequd is
17200 // not available.
17201 return !vec_all_eq(__a, __b);
17202#endif
17203}
17204
17205static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
17206 vector unsigned long long __b) {
17207 return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
17208}
17209
17210static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
17211 vector bool long long __b) {
17212 return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
17213}
17214
17215static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
17216 vector bool long long __b) {
17217 return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
17218}
17219
17220static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
17221 vector signed long long __b) {
17222 return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
17223}
17224
17225static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
17226 vector unsigned long long __b) {
17227 return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
17228}
17229
17230static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
17231 vector bool long long __b) {
17232 return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);
17233}
17234#endif
17235
17236static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
17237 vector float __b) {
17238#ifdef __VSX__
17239 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
17240#else
17241 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
17242#endif
17243}
17244
17245#ifdef __VSX__
17246static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
17247 vector double __b) {
17248 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
17249}
17250#endif
17251
17252#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)
17253static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed __int128 __a,
17254 vector signed __int128 __b) {
17255 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV,
17256 (vector unsigned __int128)__a, __b);
17257}
17258
17259static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned __int128 __a,
17260 vector unsigned __int128 __b) {
17261 return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a,
17262 (vector signed __int128)__b);
17263}
17264
17265static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool __int128 __a,
17266 vector bool __int128 __b) {
17267 return __builtin_altivec_vcmpequq_p(
17268 __CR6_LT_REV, (vector unsigned __int128)__a, (vector signed __int128)__b);
17269}
17270#endif
17271
17272/* vec_any_nge */
17273
17274static __inline__ int __ATTRS_o_ai vec_any_nge(vector float __a,
17275 vector float __b) {
17276#ifdef __VSX__
17277 return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __a, __b);
17278#else
17279 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
17280#endif
17281}
17282
17283#ifdef __VSX__
17284static __inline__ int __ATTRS_o_ai vec_any_nge(vector double __a,
17285 vector double __b) {
17286 return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __a, __b);
17287}
17288#endif
17289
17290/* vec_any_ngt */
17291
17292static __inline__ int __ATTRS_o_ai vec_any_ngt(vector float __a,
17293 vector float __b) {
17294#ifdef __VSX__
17295 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __a, __b);
17296#else
17297 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
17298#endif
17299}
17300
17301#ifdef __VSX__
17302static __inline__ int __ATTRS_o_ai vec_any_ngt(vector double __a,
17303 vector double __b) {
17304 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __a, __b);
17305}
17306#endif
17307
17308/* vec_any_nle */
17309
17310static __inline__ int __ATTRS_o_ai vec_any_nle(vector float __a,
17311 vector float __b) {
17312#ifdef __VSX__
17313 return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __b, __a);
17314#else
17315 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
17316#endif
17317}
17318
17319#ifdef __VSX__
17320static __inline__ int __ATTRS_o_ai vec_any_nle(vector double __a,
17321 vector double __b) {
17322 return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __b, __a);
17323}
17324#endif
17325
17326/* vec_any_nlt */
17327
17328static __inline__ int __ATTRS_o_ai vec_any_nlt(vector float __a,
17329 vector float __b) {
17330#ifdef __VSX__
17331 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __b, __a);
17332#else
17333 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
17334#endif
17335}
17336
17337#ifdef __VSX__
17338static __inline__ int __ATTRS_o_ai vec_any_nlt(vector double __a,
17339 vector double __b) {
17340 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __b, __a);
17341}
17342#endif
17343
17344/* vec_any_numeric */
17345
17346static __inline__ int __ATTRS_o_ai vec_any_numeric(vector float __a) {
17347#ifdef __VSX__
17348 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __a);
17349#else
17350 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
17351#endif
17352}
17353
17354#ifdef __VSX__
17355static __inline__ int __ATTRS_o_ai vec_any_numeric(vector double __a) {
17356 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __a);
17357}
17358#endif
17359
17360/* vec_any_out */
17361
17362static __inline__ int __attribute__((__always_inline__))
17363vec_any_out(vector float __a, vector float __b) {
17364 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
17365}
17366
17367/* Power 8 Crypto functions
17368Note: We diverge from the current GCC implementation with regard
17369to cryptography and related functions as follows:
17370- Only the SHA and AES instructions and builtins are disabled by -mno-crypto
17371- The remaining ones are only available on Power8 and up so
17372 require -mpower8-vector
17373The justification for this is that export requirements require that
17374Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
17375support). As a result, we need to be able to turn off support for those.
17376The remaining ones (currently controlled by -mcrypto for GCC) still
17377need to be provided on compliant hardware even if Vector.Crypto is not
17378provided.
17379*/
17380#ifdef __CRYPTO__
17381#define vec_sbox_be __builtin_altivec_crypto_vsbox
17382#define vec_cipher_be __builtin_altivec_crypto_vcipher
17383#define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
17384#define vec_ncipher_be __builtin_altivec_crypto_vncipher
17385#define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
17386
17387#ifdef __VSX__
17388static __inline__ vector unsigned char __attribute__((__always_inline__))
17389__builtin_crypto_vsbox(vector unsigned char __a) {
17390 return __builtin_altivec_crypto_vsbox(__a);
17391}
17392
17393static __inline__ vector unsigned char __attribute__((__always_inline__))
17394__builtin_crypto_vcipher(vector unsigned char __a,
17395 vector unsigned char __b) {
17396 return __builtin_altivec_crypto_vcipher(__a, __b);
17397}
17398
17399static __inline__ vector unsigned char __attribute__((__always_inline__))
17400__builtin_crypto_vcipherlast(vector unsigned char __a,
17401 vector unsigned char __b) {
17402 return __builtin_altivec_crypto_vcipherlast(__a, __b);
17403}
17404
17405static __inline__ vector unsigned char __attribute__((__always_inline__))
17406__builtin_crypto_vncipher(vector unsigned char __a,
17407 vector unsigned char __b) {
17408 return __builtin_altivec_crypto_vncipher(__a, __b);
17409}
17410
17411static __inline__ vector unsigned char __attribute__((__always_inline__))
17412__builtin_crypto_vncipherlast(vector unsigned char __a,
17413 vector unsigned char __b) {
17414 return __builtin_altivec_crypto_vncipherlast(__a, __b);
17415}
17416#endif /* __VSX__ */
17417
17418#define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
17419#define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
17420
17421#define vec_shasigma_be(X, Y, Z) \
17422 _Generic((X), vector unsigned int \
17423 : __builtin_crypto_vshasigmaw, vector unsigned long long \
17424 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
17425#endif
17426
17427#ifdef __POWER8_VECTOR__
17428static __inline__ vector bool char __ATTRS_o_ai
17429vec_permxor(vector bool char __a, vector bool char __b,
17430 vector bool char __c) {
17431 return (vector bool char)__builtin_altivec_crypto_vpermxor(
17432 (vector unsigned char)__a, (vector unsigned char)__b,
17433 (vector unsigned char)__c);
17434}
17435
17436static __inline__ vector signed char __ATTRS_o_ai
17437vec_permxor(vector signed char __a, vector signed char __b,
17438 vector signed char __c) {
17439 return (vector signed char)__builtin_altivec_crypto_vpermxor(
17440 (vector unsigned char)__a, (vector unsigned char)__b,
17441 (vector unsigned char)__c);
17442}
17443
17444static __inline__ vector unsigned char __ATTRS_o_ai
17445vec_permxor(vector unsigned char __a, vector unsigned char __b,
17446 vector unsigned char __c) {
17447 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
17448}
17449
17450static __inline__ vector unsigned char __ATTRS_o_ai
17451__builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
17452 vector unsigned char __c) {
17453 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
17454}
17455
17456static __inline__ vector unsigned short __ATTRS_o_ai
17457__builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
17458 vector unsigned short __c) {
17459 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
17460 (vector unsigned char)__a, (vector unsigned char)__b,
17461 (vector unsigned char)__c);
17462}
17463
17464static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
17465 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
17466 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
17467 (vector unsigned char)__a, (vector unsigned char)__b,
17468 (vector unsigned char)__c);
17469}
17470
17471static __inline__ vector unsigned long long __ATTRS_o_ai
17472__builtin_crypto_vpermxor(vector unsigned long long __a,
17473 vector unsigned long long __b,
17474 vector unsigned long long __c) {
17475 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
17476 (vector unsigned char)__a, (vector unsigned char)__b,
17477 (vector unsigned char)__c);
17478}
17479
17480static __inline__ vector unsigned char __ATTRS_o_ai
17481__builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
17482 return __builtin_altivec_crypto_vpmsumb(__a, __b);
17483}
17484
17485static __inline__ vector unsigned short __ATTRS_o_ai
17486__builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
17487 return __builtin_altivec_crypto_vpmsumh(__a, __b);
17488}
17489
17490static __inline__ vector unsigned int __ATTRS_o_ai
17491__builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
17492 return __builtin_altivec_crypto_vpmsumw(__a, __b);
17493}
17494
17495static __inline__ vector unsigned long long __ATTRS_o_ai
17496__builtin_crypto_vpmsumb(vector unsigned long long __a,
17497 vector unsigned long long __b) {
17498 return __builtin_altivec_crypto_vpmsumd(__a, __b);
17499}
17500
17501static __inline__ vector signed char __ATTRS_o_ai
17502vec_vgbbd(vector signed char __a) {
17503 return (vector signed char)__builtin_altivec_vgbbd((vector unsigned char)__a);
17504}
17505
17506#define vec_pmsum_be __builtin_crypto_vpmsumb
17507#define vec_gb __builtin_altivec_vgbbd
17508
17509static __inline__ vector unsigned char __ATTRS_o_ai
17510vec_vgbbd(vector unsigned char __a) {
17511 return __builtin_altivec_vgbbd(__a);
17512}
17513
17514static __inline__ vector signed long long __ATTRS_o_ai
17515vec_gbb(vector signed long long __a) {
17516 return (vector signed long long)__builtin_altivec_vgbbd(
17517 (vector unsigned char)__a);
17518}
17519
17520static __inline__ vector unsigned long long __ATTRS_o_ai
17521vec_gbb(vector unsigned long long __a) {
17522 return (vector unsigned long long)__builtin_altivec_vgbbd(
17523 (vector unsigned char)__a);
17524}
17525
17526static __inline__ vector long long __ATTRS_o_ai
17527vec_vbpermq(vector signed char __a, vector signed char __b) {
17528 return (vector long long)__builtin_altivec_vbpermq((vector unsigned char)__a,
17529 (vector unsigned char)__b);
17530}
17531
17532static __inline__ vector long long __ATTRS_o_ai
17533vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
17534 return (vector long long)__builtin_altivec_vbpermq(__a, __b);
17535}
17536
17537#if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
17538static __inline__ vector unsigned long long __ATTRS_o_ai
17539vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
17540 return __builtin_altivec_vbpermq((vector unsigned char)__a,
17541 (vector unsigned char)__b);
17542}
17543#endif
17544static __inline__ vector unsigned char __ATTRS_o_ai
17545vec_bperm(vector unsigned char __a, vector unsigned char __b) {
17546 return (vector unsigned char)__builtin_altivec_vbpermq(__a, __b);
17547}
17548#endif // __POWER8_VECTOR__
17549#ifdef __POWER9_VECTOR__
17550static __inline__ vector unsigned long long __ATTRS_o_ai
17551vec_bperm(vector unsigned long long __a, vector unsigned char __b) {
17552 return __builtin_altivec_vbpermd(__a, __b);
17553}
17554#endif
17555
17556
17557/* vec_reve */
17558
17559static __inline__ __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
17560 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17561 5, 4, 3, 2, 1, 0);
17562}
17563
17564static __inline__ __ATTRS_o_ai vector signed char
17565vec_reve(vector signed char __a) {
17566 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17567 5, 4, 3, 2, 1, 0);
17568}
17569
17570static __inline__ __ATTRS_o_ai vector unsigned char
17571vec_reve(vector unsigned char __a) {
17572 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
17573 5, 4, 3, 2, 1, 0);
17574}
17575
17576static __inline__ __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
17577 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17578}
17579
17580static __inline__ __ATTRS_o_ai vector signed int
17581vec_reve(vector signed int __a) {
17582 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17583}
17584
17585static __inline__ __ATTRS_o_ai vector unsigned int
17586vec_reve(vector unsigned int __a) {
17587 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17588}
17589
17590static __inline__ __ATTRS_o_ai vector bool short
17591vec_reve(vector bool short __a) {
17592 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
17593}
17594
17595static __inline__ __ATTRS_o_ai vector signed short
17596vec_reve(vector signed short __a) {
17597 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
17598}
17599
17600static __inline__ __ATTRS_o_ai vector unsigned short
17601vec_reve(vector unsigned short __a) {
17602 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
17603}
17604
17605static __inline__ __ATTRS_o_ai vector float vec_reve(vector float __a) {
17606 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
17607}
17608
17609#ifdef __VSX__
17610static __inline__ __ATTRS_o_ai vector bool long long
17611vec_reve(vector bool long long __a) {
17612 return __builtin_shufflevector(__a, __a, 1, 0);
17613}
17614
17615static __inline__ __ATTRS_o_ai vector signed long long
17616vec_reve(vector signed long long __a) {
17617 return __builtin_shufflevector(__a, __a, 1, 0);
17618}
17619
17620static __inline__ __ATTRS_o_ai vector unsigned long long
17621vec_reve(vector unsigned long long __a) {
17622 return __builtin_shufflevector(__a, __a, 1, 0);
17623}
17624
17625static __inline__ __ATTRS_o_ai vector double vec_reve(vector double __a) {
17626 return __builtin_shufflevector(__a, __a, 1, 0);
17627}
17628#endif
17629
17630/* vec_revb */
17631static __inline__ vector bool char __ATTRS_o_ai
17632vec_revb(vector bool char __a) {
17633 return __a;
17634}
17635
17636static __inline__ vector signed char __ATTRS_o_ai
17637vec_revb(vector signed char __a) {
17638 return __a;
17639}
17640
17641static __inline__ vector unsigned char __ATTRS_o_ai
17642vec_revb(vector unsigned char __a) {
17643 return __a;
17644}
17645
17646static __inline__ vector bool short __ATTRS_o_ai
17647vec_revb(vector bool short __a) {
17648 vector unsigned char __indices =
17649 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17650 return vec_perm(__a, __a, __indices);
17651}
17652
17653static __inline__ vector signed short __ATTRS_o_ai
17654vec_revb(vector signed short __a) {
17655 vector unsigned char __indices =
17656 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17657 return vec_perm(__a, __a, __indices);
17658}
17659
17660static __inline__ vector unsigned short __ATTRS_o_ai
17661vec_revb(vector unsigned short __a) {
17662 vector unsigned char __indices =
17663 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
17664 return vec_perm(__a, __a, __indices);
17665}
17666
17667static __inline__ vector bool int __ATTRS_o_ai
17668vec_revb(vector bool int __a) {
17669 vector unsigned char __indices =
17670 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17671 return vec_perm(__a, __a, __indices);
17672}
17673
17674static __inline__ vector signed int __ATTRS_o_ai
17675vec_revb(vector signed int __a) {
17676 vector unsigned char __indices =
17677 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17678 return vec_perm(__a, __a, __indices);
17679}
17680
17681static __inline__ vector unsigned int __ATTRS_o_ai
17682vec_revb(vector unsigned int __a) {
17683 vector unsigned char __indices =
17684 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17685 return vec_perm(__a, __a, __indices);
17686}
17687
17688static __inline__ vector float __ATTRS_o_ai
17689vec_revb(vector float __a) {
17690 vector unsigned char __indices =
17691 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
17692 return vec_perm(__a, __a, __indices);
17693}
17694
17695#ifdef __VSX__
17696static __inline__ vector bool long long __ATTRS_o_ai
17697vec_revb(vector bool long long __a) {
17698 vector unsigned char __indices =
17699 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17700 return vec_perm(__a, __a, __indices);
17701}
17702
17703static __inline__ vector signed long long __ATTRS_o_ai
17704vec_revb(vector signed long long __a) {
17705 vector unsigned char __indices =
17706 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17707 return vec_perm(__a, __a, __indices);
17708}
17709
17710static __inline__ vector unsigned long long __ATTRS_o_ai
17711vec_revb(vector unsigned long long __a) {
17712 vector unsigned char __indices =
17713 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17714 return vec_perm(__a, __a, __indices);
17715}
17716
17717static __inline__ vector double __ATTRS_o_ai
17718vec_revb(vector double __a) {
17719 vector unsigned char __indices =
17720 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
17721 return vec_perm(__a, __a, __indices);
17722}
17723#endif /* End __VSX__ */
17724
17725#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17726 defined(__SIZEOF_INT128__)
17727static __inline__ vector signed __int128 __ATTRS_o_ai
17728vec_revb(vector signed __int128 __a) {
17729 vector unsigned char __indices =
17730 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17731 return (vector signed __int128)vec_perm((vector signed int)__a,
17732 (vector signed int)__a,
17733 __indices);
17734}
17735
17736static __inline__ vector unsigned __int128 __ATTRS_o_ai
17737vec_revb(vector unsigned __int128 __a) {
17738 vector unsigned char __indices =
17739 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
17740 return (vector unsigned __int128)vec_perm((vector signed int)__a,
17741 (vector signed int)__a,
17742 __indices);
17743}
17744#endif /* END __POWER8_VECTOR__ && __powerpc64__ */
17745
17746/* vec_xl */
17747
17748#define vec_xld2 vec_xl
17749#define vec_xlw4 vec_xl
17750typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
17751typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
17752typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
17753typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
17754typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
17755typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
17756typedef vector float unaligned_vec_float __attribute__((aligned(1)));
17757
17758static __inline__ __ATTRS_o_ai vector signed char
17759vec_xl(ptrdiff_t __offset, const signed char *__ptr) {
17760 return *(unaligned_vec_schar *)(__ptr + __offset);
17761}
17762
17763static __inline__ __ATTRS_o_ai vector unsigned char
17764vec_xl(ptrdiff_t __offset, const unsigned char *__ptr) {
17765 return *(unaligned_vec_uchar*)(__ptr + __offset);
17766}
17767
17768static __inline__ __ATTRS_o_ai vector signed short
17769vec_xl(ptrdiff_t __offset, const signed short *__ptr) {
17770 signed char *__addr = (signed char *)__ptr + __offset;
17771 return *(unaligned_vec_sshort *)__addr;
17772}
17773
17774static __inline__ __ATTRS_o_ai vector unsigned short
17775vec_xl(ptrdiff_t __offset, const unsigned short *__ptr) {
17776 signed char *__addr = (signed char *)__ptr + __offset;
17777 return *(unaligned_vec_ushort *)__addr;
17778}
17779
17780static __inline__ __ATTRS_o_ai vector signed int
17781vec_xl(ptrdiff_t __offset, const signed int *__ptr) {
17782 signed char *__addr = (signed char *)__ptr + __offset;
17783 return *(unaligned_vec_sint *)__addr;
17784}
17785
17786static __inline__ __ATTRS_o_ai vector unsigned int
17787vec_xl(ptrdiff_t __offset, const unsigned int *__ptr) {
17788 signed char *__addr = (signed char *)__ptr + __offset;
17789 return *(unaligned_vec_uint *)__addr;
17790}
17791
17792static __inline__ __ATTRS_o_ai vector float vec_xl(ptrdiff_t __offset,
17793 const float *__ptr) {
17794 signed char *__addr = (signed char *)__ptr + __offset;
17795 return *(unaligned_vec_float *)__addr;
17796}
17797
17798#ifdef __VSX__
17799typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
17800typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
17801typedef vector double unaligned_vec_double __attribute__((aligned(1)));
17802
17803static __inline__ __ATTRS_o_ai vector signed long long
17804vec_xl(ptrdiff_t __offset, const signed long long *__ptr) {
17805 signed char *__addr = (signed char *)__ptr + __offset;
17806 return *(unaligned_vec_sll *)__addr;
17807}
17808
17809static __inline__ __ATTRS_o_ai vector unsigned long long
17810vec_xl(ptrdiff_t __offset, const unsigned long long *__ptr) {
17811 signed char *__addr = (signed char *)__ptr + __offset;
17812 return *(unaligned_vec_ull *)__addr;
17813}
17814
17815static __inline__ __ATTRS_o_ai vector double vec_xl(ptrdiff_t __offset,
17816 const double *__ptr) {
17817 signed char *__addr = (signed char *)__ptr + __offset;
17818 return *(unaligned_vec_double *)__addr;
17819}
17820#endif
17821
17822#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17823 defined(__SIZEOF_INT128__)
17824typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
17825typedef vector unsigned __int128 unaligned_vec_ui128
17826 __attribute__((aligned(1)));
17827static __inline__ __ATTRS_o_ai vector signed __int128
17828vec_xl(ptrdiff_t __offset, const signed __int128 *__ptr) {
17829 signed char *__addr = (signed char *)__ptr + __offset;
17830 return *(unaligned_vec_si128 *)__addr;
17831}
17832
17833static __inline__ __ATTRS_o_ai vector unsigned __int128
17834vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {
17835 signed char *__addr = (signed char *)__ptr + __offset;
17836 return *(unaligned_vec_ui128 *)__addr;
17837}
17838#endif
17839
17840/* vec_xl_be */
17841
17842#ifdef __LITTLE_ENDIAN__
17843#ifdef __VSX__
17844static __inline__ vector signed char __ATTRS_o_ai
17845vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {
17846 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17847 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17848 13, 12, 11, 10, 9, 8);
17849}
17850
17851static __inline__ vector unsigned char __ATTRS_o_ai
17852vec_xl_be(ptrdiff_t __offset, const unsigned char *__ptr) {
17853 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17854 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
17855 13, 12, 11, 10, 9, 8);
17856}
17857
17858static __inline__ vector signed short __ATTRS_o_ai
17859vec_xl_be(ptrdiff_t __offset, const signed short *__ptr) {
17860 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17861 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17862}
17863
17864static __inline__ vector unsigned short __ATTRS_o_ai
17865vec_xl_be(ptrdiff_t __offset, const unsigned short *__ptr) {
17866 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17867 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
17868}
17869
17870static __inline__ vector signed int __ATTRS_o_ai
17871vec_xl_be(signed long long __offset, const signed int *__ptr) {
17872 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17873}
17874
17875static __inline__ vector unsigned int __ATTRS_o_ai
17876vec_xl_be(signed long long __offset, const unsigned int *__ptr) {
17877 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17878}
17879
17880static __inline__ vector float __ATTRS_o_ai
17881vec_xl_be(signed long long __offset, const float *__ptr) {
17882 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
17883}
17884
17885static __inline__ vector signed long long __ATTRS_o_ai
17886vec_xl_be(signed long long __offset, const signed long long *__ptr) {
17887 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17888}
17889
17890static __inline__ vector unsigned long long __ATTRS_o_ai
17891vec_xl_be(signed long long __offset, const unsigned long long *__ptr) {
17892 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17893}
17894
17895static __inline__ vector double __ATTRS_o_ai
17896vec_xl_be(signed long long __offset, const double *__ptr) {
17897 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
17898}
17899
17900#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
17901 defined(__SIZEOF_INT128__)
17902static __inline__ vector signed __int128 __ATTRS_o_ai
17903vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
17904 return vec_xl(__offset, __ptr);
17905}
17906
17907static __inline__ vector unsigned __int128 __ATTRS_o_ai
17908vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
17909 return vec_xl(__offset, __ptr);
17910}
17911#endif
17912#endif // __VSX__
17913#else // ! __LITTLE_ENDIAN__
17914#define vec_xl_be vec_xl
17915#endif
17916
17917#if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
17918 defined(__SIZEOF_INT128__)
17919
17920/* vec_xl_sext */
17921
17922static __inline__ vector signed __int128 __ATTRS_o_ai
17923vec_xl_sext(ptrdiff_t __offset, const signed char *__pointer) {
17924 return (vector signed __int128)*(__pointer + __offset);
17925}
17926
17927static __inline__ vector signed __int128 __ATTRS_o_ai
17928vec_xl_sext(ptrdiff_t __offset, const signed short *__pointer) {
17929 return (vector signed __int128)*(__pointer + __offset);
17930}
17931
17932static __inline__ vector signed __int128 __ATTRS_o_ai
17933vec_xl_sext(ptrdiff_t __offset, const signed int *__pointer) {
17934 return (vector signed __int128)*(__pointer + __offset);
17935}
17936
17937static __inline__ vector signed __int128 __ATTRS_o_ai
17938vec_xl_sext(ptrdiff_t __offset, const signed long long *__pointer) {
17939 return (vector signed __int128)*(__pointer + __offset);
17940}
17941
17942/* vec_xl_zext */
17943
17944static __inline__ vector unsigned __int128 __ATTRS_o_ai
17945vec_xl_zext(ptrdiff_t __offset, const unsigned char *__pointer) {
17946 return (vector unsigned __int128)*(__pointer + __offset);
17947}
17948
17949static __inline__ vector unsigned __int128 __ATTRS_o_ai
17950vec_xl_zext(ptrdiff_t __offset, const unsigned short *__pointer) {
17951 return (vector unsigned __int128)*(__pointer + __offset);
17952}
17953
17954static __inline__ vector unsigned __int128 __ATTRS_o_ai
17955vec_xl_zext(ptrdiff_t __offset, const unsigned int *__pointer) {
17956 return (vector unsigned __int128)*(__pointer + __offset);
17957}
17958
17959static __inline__ vector unsigned __int128 __ATTRS_o_ai
17960vec_xl_zext(ptrdiff_t __offset, const unsigned long long *__pointer) {
17961 return (vector unsigned __int128)*(__pointer + __offset);
17962}
17963
17964#endif
17965
17966/* vec_xlds */
17967#ifdef __VSX__
17968static __inline__ vector signed long long __ATTRS_o_ai
17969vec_xlds(ptrdiff_t __offset, const signed long long *__ptr) {
17970 signed long long *__addr = (signed long long*)((signed char *)__ptr + __offset);
17971 return (vector signed long long) *__addr;
17972}
17973
17974static __inline__ vector unsigned long long __ATTRS_o_ai
17975vec_xlds(ptrdiff_t __offset, const unsigned long long *__ptr) {
17976 unsigned long long *__addr = (unsigned long long *)((signed char *)__ptr + __offset);
17977 return (unaligned_vec_ull) *__addr;
17978}
17979
17980static __inline__ vector double __ATTRS_o_ai vec_xlds(ptrdiff_t __offset,
17981 const double *__ptr) {
17982 double *__addr = (double*)((signed char *)__ptr + __offset);
17983 return (unaligned_vec_double) *__addr;
17984}
17985
17986/* vec_load_splats */
17987static __inline__ vector signed int __ATTRS_o_ai
17988vec_load_splats(signed long long __offset, const signed int *__ptr) {
17989 signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17990 return (vector signed int)*__addr;
17991}
17992
17993static __inline__ vector signed int __ATTRS_o_ai
17994vec_load_splats(unsigned long long __offset, const signed int *__ptr) {
17995 signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
17996 return (vector signed int)*__addr;
17997}
17998
17999static __inline__ vector unsigned int __ATTRS_o_ai
18000vec_load_splats(signed long long __offset, const unsigned int *__ptr) {
18001 unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
18002 return (vector unsigned int)*__addr;
18003}
18004
18005static __inline__ vector unsigned int __ATTRS_o_ai
18006vec_load_splats(unsigned long long __offset, const unsigned int *__ptr) {
18007 unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
18008 return (vector unsigned int)*__addr;
18009}
18010
18011static __inline__ vector float __ATTRS_o_ai
18012vec_load_splats(signed long long __offset, const float *__ptr) {
18013 float *__addr = (float*)((signed char *)__ptr + __offset);
18014 return (vector float)*__addr;
18015}
18016
18017static __inline__ vector float __ATTRS_o_ai
18018vec_load_splats(unsigned long long __offset, const float *__ptr) {
18019 float *__addr = (float*)((signed char *)__ptr + __offset);
18020 return (vector float)*__addr;
18021}
18022#endif
18023
18024/* vec_xst */
18025
18026#define vec_xstd2 vec_xst
18027#define vec_xstw4 vec_xst
18028static __inline__ __ATTRS_o_ai void
18029vec_xst(vector signed char __vec, ptrdiff_t __offset, signed char *__ptr) {
18030 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
18031}
18032
18033static __inline__ __ATTRS_o_ai void
18034vec_xst(vector unsigned char __vec, ptrdiff_t __offset, unsigned char *__ptr) {
18035 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
18036}
18037
18038static __inline__ __ATTRS_o_ai void
18039vec_xst(vector signed short __vec, ptrdiff_t __offset, signed short *__ptr) {
18040 signed char *__addr = (signed char *)__ptr + __offset;
18041 *(unaligned_vec_sshort *)__addr = __vec;
18042}
18043
18044static __inline__ __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
18045 ptrdiff_t __offset,
18046 unsigned short *__ptr) {
18047 signed char *__addr = (signed char *)__ptr + __offset;
18048 *(unaligned_vec_ushort *)__addr = __vec;
18049}
18050
18051static __inline__ __ATTRS_o_ai void
18052vec_xst(vector signed int __vec, ptrdiff_t __offset, signed int *__ptr) {
18053 signed char *__addr = (signed char *)__ptr + __offset;
18054 *(unaligned_vec_sint *)__addr = __vec;
18055}
18056
18057static __inline__ __ATTRS_o_ai void
18058vec_xst(vector unsigned int __vec, ptrdiff_t __offset, unsigned int *__ptr) {
18059 signed char *__addr = (signed char *)__ptr + __offset;
18060 *(unaligned_vec_uint *)__addr = __vec;
18061}
18062
18063static __inline__ __ATTRS_o_ai void vec_xst(vector float __vec,
18064 ptrdiff_t __offset, float *__ptr) {
18065 signed char *__addr = (signed char *)__ptr + __offset;
18066 *(unaligned_vec_float *)__addr = __vec;
18067}
18068
18069#ifdef __VSX__
18070static __inline__ __ATTRS_o_ai void vec_xst(vector signed long long __vec,
18071 ptrdiff_t __offset,
18072 signed long long *__ptr) {
18073 signed char *__addr = (signed char *)__ptr + __offset;
18074 *(unaligned_vec_sll *)__addr = __vec;
18075}
18076
18077static __inline__ __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
18078 ptrdiff_t __offset,
18079 unsigned long long *__ptr) {
18080 signed char *__addr = (signed char *)__ptr + __offset;
18081 *(unaligned_vec_ull *)__addr = __vec;
18082}
18083
18084static __inline__ __ATTRS_o_ai void vec_xst(vector double __vec,
18085 ptrdiff_t __offset, double *__ptr) {
18086 signed char *__addr = (signed char *)__ptr + __offset;
18087 *(unaligned_vec_double *)__addr = __vec;
18088}
18089#endif
18090
18091#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18092 defined(__SIZEOF_INT128__)
18093static __inline__ __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
18094 ptrdiff_t __offset,
18095 signed __int128 *__ptr) {
18096 signed char *__addr = (signed char *)__ptr + __offset;
18097 *(unaligned_vec_si128 *)__addr = __vec;
18098}
18099
18100static __inline__ __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
18101 ptrdiff_t __offset,
18102 unsigned __int128 *__ptr) {
18103 signed char *__addr = (signed char *)__ptr + __offset;
18104 *(unaligned_vec_ui128 *)__addr = __vec;
18105}
18106#endif
18107
18108/* vec_xst_trunc */
18109
18110#if defined(__POWER10_VECTOR__) && defined(__VSX__) && \
18111 defined(__SIZEOF_INT128__)
18112static __inline__ __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
18113 ptrdiff_t __offset,
18114 signed char *__ptr) {
18115 *(__ptr + __offset) = (signed char)__vec[0];
18116}
18117
18118static __inline__ __ATTRS_o_ai void
18119vec_xst_trunc(vector unsigned __int128 __vec, ptrdiff_t __offset,
18120 unsigned char *__ptr) {
18121 *(__ptr + __offset) = (unsigned char)__vec[0];
18122}
18123
18124static __inline__ __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
18125 ptrdiff_t __offset,
18126 signed short *__ptr) {
18127 *(__ptr + __offset) = (signed short)__vec[0];
18128}
18129
18130static __inline__ __ATTRS_o_ai void
18131vec_xst_trunc(vector unsigned __int128 __vec, ptrdiff_t __offset,
18132 unsigned short *__ptr) {
18133 *(__ptr + __offset) = (unsigned short)__vec[0];
18134}
18135
18136static __inline__ __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
18137 ptrdiff_t __offset,
18138 signed int *__ptr) {
18139 *(__ptr + __offset) = (signed int)__vec[0];
18140}
18141
18142static __inline__ __ATTRS_o_ai void
18143vec_xst_trunc(vector unsigned __int128 __vec, ptrdiff_t __offset,
18144 unsigned int *__ptr) {
18145 *(__ptr + __offset) = (unsigned int)__vec[0];
18146}
18147
18148static __inline__ __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,
18149 ptrdiff_t __offset,
18150 signed long long *__ptr) {
18151 *(__ptr + __offset) = (signed long long)__vec[0];
18152}
18153
18154static __inline__ __ATTRS_o_ai void
18155vec_xst_trunc(vector unsigned __int128 __vec, ptrdiff_t __offset,
18156 unsigned long long *__ptr) {
18157 *(__ptr + __offset) = (unsigned long long)__vec[0];
18158}
18159#endif
18160
18161/* vec_xst_be */
18162
18163#ifdef __LITTLE_ENDIAN__
18164#ifdef __VSX__
18165static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
18166 signed long long __offset,
18167 signed char *__ptr) {
18168 vector signed char __tmp =
18169 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
18170 13, 12, 11, 10, 9, 8);
18171 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
18172 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18173}
18174
18175static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
18176 signed long long __offset,
18177 unsigned char *__ptr) {
18178 vector unsigned char __tmp =
18179 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
18180 13, 12, 11, 10, 9, 8);
18181 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
18182 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18183}
18184
18185static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
18186 signed long long __offset,
18187 signed short *__ptr) {
18188 vector signed short __tmp =
18189 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
18190 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
18191 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18192}
18193
18194static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
18195 signed long long __offset,
18196 unsigned short *__ptr) {
18197 vector unsigned short __tmp =
18198 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
18199 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
18200 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
18201}
18202
18203static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
18204 signed long long __offset,
18205 signed int *__ptr) {
18206 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
18207}
18208
18209static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
18210 signed long long __offset,
18211 unsigned int *__ptr) {
18212 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
18213}
18214
18215static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
18216 signed long long __offset,
18217 float *__ptr) {
18218 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
18219}
18220
18221static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
18222 signed long long __offset,
18223 signed long long *__ptr) {
18224 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18225}
18226
18227static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
18228 signed long long __offset,
18229 unsigned long long *__ptr) {
18230 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18231}
18232
18233static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
18234 signed long long __offset,
18235 double *__ptr) {
18236 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
18237}
18238
18239#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \
18240 defined(__SIZEOF_INT128__)
18241static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
18242 signed long long __offset,
18243 signed __int128 *__ptr) {
18244 vec_xst(__vec, __offset, __ptr);
18245}
18246
18247static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
18248 signed long long __offset,
18249 unsigned __int128 *__ptr) {
18250 vec_xst(__vec, __offset, __ptr);
18251}
18252#endif
18253#endif // VSX
18254#else // ! __LITTLE_ENDIAN__
18255#define vec_xst_be vec_xst
18256#endif
18257
18258#ifdef __POWER9_VECTOR__
18259#define vec_test_data_class(__a, __b) \
18260 _Generic( \
18261 (__a), vector float \
18262 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
18263 vector double \
18264 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
18265 (__b)))
18266
18267#endif /* #ifdef __POWER9_VECTOR__ */
18268
18269static vector float __ATTRS_o_ai vec_neg(vector float __a) {
18270 return -__a;
18271}
18272
18273#ifdef __VSX__
18274static vector double __ATTRS_o_ai vec_neg(vector double __a) {
18275 return -__a;
18276}
18277
18278#endif
18279
18280#ifdef __VSX__
18281static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
18282 return -__a;
18283}
18284#endif
18285
18286static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
18287 return -__a;
18288}
18289
18290static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
18291 return -__a;
18292}
18293
18294static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
18295 return -__a;
18296}
18297
18298static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
18299 return - vec_abs(__a);
18300}
18301
18302#ifdef __VSX__
18303static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
18304 return - vec_abs(__a);
18305}
18306
18307#endif
18308
18309#ifdef __POWER8_VECTOR__
18310static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
18311 return __builtin_altivec_vminsd(__a, -__a);
18312}
18313#endif
18314
18315static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
18316 return __builtin_altivec_vminsw(__a, -__a);
18317}
18318
18319static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
18320 return __builtin_altivec_vminsh(__a, -__a);
18321}
18322
18323static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
18324 return __builtin_altivec_vminsb(__a, -__a);
18325}
18326
18327static vector float __ATTRS_o_ai vec_recipdiv(vector float __a,
18328 vector float __b) {
18329 return __builtin_ppc_recipdivf(__a, __b);
18330}
18331
18332#ifdef __VSX__
18333static vector double __ATTRS_o_ai vec_recipdiv(vector double __a,
18334 vector double __b) {
18335 return __builtin_ppc_recipdivd(__a, __b);
18336}
18337#endif
18338
18339#ifdef __POWER10_VECTOR__
18340
18341/* vec_extractm */
18342
18343static __inline__ unsigned int __ATTRS_o_ai
18344vec_extractm(vector unsigned char __a) {
18345 return __builtin_altivec_vextractbm(__a);
18346}
18347
18348static __inline__ unsigned int __ATTRS_o_ai
18349vec_extractm(vector unsigned short __a) {
18350 return __builtin_altivec_vextracthm(__a);
18351}
18352
18353static __inline__ unsigned int __ATTRS_o_ai
18354vec_extractm(vector unsigned int __a) {
18355 return __builtin_altivec_vextractwm(__a);
18356}
18357
18358static __inline__ unsigned int __ATTRS_o_ai
18359vec_extractm(vector unsigned long long __a) {
18360 return __builtin_altivec_vextractdm(__a);
18361}
18362
18363#ifdef __SIZEOF_INT128__
18364static __inline__ unsigned int __ATTRS_o_ai
18365vec_extractm(vector unsigned __int128 __a) {
18366 return __builtin_altivec_vextractqm(__a);
18367}
18368#endif
18369
18370/* vec_expandm */
18371
18372static __inline__ vector unsigned char __ATTRS_o_ai
18373vec_expandm(vector unsigned char __a) {
18374 return __builtin_altivec_vexpandbm(__a);
18375}
18376
18377static __inline__ vector unsigned short __ATTRS_o_ai
18378vec_expandm(vector unsigned short __a) {
18379 return __builtin_altivec_vexpandhm(__a);
18380}
18381
18382static __inline__ vector unsigned int __ATTRS_o_ai
18383vec_expandm(vector unsigned int __a) {
18384 return __builtin_altivec_vexpandwm(__a);
18385}
18386
18387static __inline__ vector unsigned long long __ATTRS_o_ai
18388vec_expandm(vector unsigned long long __a) {
18389 return __builtin_altivec_vexpanddm(__a);
18390}
18391
18392#ifdef __SIZEOF_INT128__
18393static __inline__ vector unsigned __int128 __ATTRS_o_ai
18394vec_expandm(vector unsigned __int128 __a) {
18395 return __builtin_altivec_vexpandqm(__a);
18396}
18397#endif
18398
18399/* vec_cntm */
18400
18401#define vec_cntm(__a, __mp) \
18402 _Generic((__a), vector unsigned char \
18403 : __builtin_altivec_vcntmbb((vector unsigned char)(__a), \
18404 (unsigned char)(__mp)), \
18405 vector unsigned short \
18406 : __builtin_altivec_vcntmbh((vector unsigned short)(__a), \
18407 (unsigned char)(__mp)), \
18408 vector unsigned int \
18409 : __builtin_altivec_vcntmbw((vector unsigned int)(__a), \
18410 (unsigned char)(__mp)), \
18411 vector unsigned long long \
18412 : __builtin_altivec_vcntmbd((vector unsigned long long)(__a), \
18413 (unsigned char)(__mp)))
18414
18415/* vec_gen[b|h|w|d|q]m */
18416
18417static __inline__ vector unsigned char __ATTRS_o_ai
18418vec_genbm(unsigned long long __bm) {
18419 return __builtin_altivec_mtvsrbm(__bm);
18420}
18421
18422static __inline__ vector unsigned short __ATTRS_o_ai
18423vec_genhm(unsigned long long __bm) {
18424 return __builtin_altivec_mtvsrhm(__bm);
18425}
18426
18427static __inline__ vector unsigned int __ATTRS_o_ai
18428vec_genwm(unsigned long long __bm) {
18429 return __builtin_altivec_mtvsrwm(__bm);
18430}
18431
18432static __inline__ vector unsigned long long __ATTRS_o_ai
18433vec_gendm(unsigned long long __bm) {
18434 return __builtin_altivec_mtvsrdm(__bm);
18435}
18436
18437#ifdef __SIZEOF_INT128__
18438static __inline__ vector unsigned __int128 __ATTRS_o_ai
18439vec_genqm(unsigned long long __bm) {
18440 return __builtin_altivec_mtvsrqm(__bm);
18441}
18442#endif
18443
18444/* vec_pdep */
18445
18446static __inline__ vector unsigned long long __ATTRS_o_ai
18447vec_pdep(vector unsigned long long __a, vector unsigned long long __b) {
18448 return __builtin_altivec_vpdepd(__a, __b);
18449}
18450
18451/* vec_pext */
18452
18453static __inline__ vector unsigned long long __ATTRS_o_ai
18454vec_pext(vector unsigned long long __a, vector unsigned long long __b) {
18455 return __builtin_altivec_vpextd(__a, __b);
18456}
18457
18458/* vec_cfuge */
18459
18460static __inline__ vector unsigned long long __ATTRS_o_ai
18461vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
18462 return __builtin_altivec_vcfuged(__a, __b);
18463}
18464
18465/* vec_gnb */
18466
18467#define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)
18468
18469/* vec_ternarylogic */
18470#ifdef __VSX__
18471#ifdef __SIZEOF_INT128__
18472#define vec_ternarylogic(__a, __b, __c, __imm) \
18473 _Generic((__a), vector unsigned char \
18474 : (vector unsigned char)__builtin_vsx_xxeval( \
18475 (vector unsigned long long)(__a), \
18476 (vector unsigned long long)(__b), \
18477 (vector unsigned long long)(__c), (__imm)), \
18478 vector unsigned short \
18479 : (vector unsigned short)__builtin_vsx_xxeval( \
18480 (vector unsigned long long)(__a), \
18481 (vector unsigned long long)(__b), \
18482 (vector unsigned long long)(__c), (__imm)), \
18483 vector unsigned int \
18484 : (vector unsigned int)__builtin_vsx_xxeval( \
18485 (vector unsigned long long)(__a), \
18486 (vector unsigned long long)(__b), \
18487 (vector unsigned long long)(__c), (__imm)), \
18488 vector unsigned long long \
18489 : (vector unsigned long long)__builtin_vsx_xxeval( \
18490 (vector unsigned long long)(__a), \
18491 (vector unsigned long long)(__b), \
18492 (vector unsigned long long)(__c), (__imm)), \
18493 vector unsigned __int128 \
18494 : (vector unsigned __int128)__builtin_vsx_xxeval( \
18495 (vector unsigned long long)(__a), \
18496 (vector unsigned long long)(__b), \
18497 (vector unsigned long long)(__c), (__imm)))
18498#else
18499#define vec_ternarylogic(__a, __b, __c, __imm) \
18500 _Generic((__a), vector unsigned char \
18501 : (vector unsigned char)__builtin_vsx_xxeval( \
18502 (vector unsigned long long)(__a), \
18503 (vector unsigned long long)(__b), \
18504 (vector unsigned long long)(__c), (__imm)), \
18505 vector unsigned short \
18506 : (vector unsigned short)__builtin_vsx_xxeval( \
18507 (vector unsigned long long)(__a), \
18508 (vector unsigned long long)(__b), \
18509 (vector unsigned long long)(__c), (__imm)), \
18510 vector unsigned int \
18511 : (vector unsigned int)__builtin_vsx_xxeval( \
18512 (vector unsigned long long)(__a), \
18513 (vector unsigned long long)(__b), \
18514 (vector unsigned long long)(__c), (__imm)), \
18515 vector unsigned long long \
18516 : (vector unsigned long long)__builtin_vsx_xxeval( \
18517 (vector unsigned long long)(__a), \
18518 (vector unsigned long long)(__b), \
18519 (vector unsigned long long)(__c), (__imm)))
18520#endif /* __SIZEOF_INT128__ */
18521#endif /* __VSX__ */
18522
18523/* vec_genpcvm */
18524
18525#ifdef __VSX__
18526#define vec_genpcvm(__a, __imm) \
18527 _Generic( \
18528 (__a), vector unsigned char \
18529 : __builtin_vsx_xxgenpcvbm((vector unsigned char)(__a), (int)(__imm)), \
18530 vector unsigned short \
18531 : __builtin_vsx_xxgenpcvhm((vector unsigned short)(__a), (int)(__imm)), \
18532 vector unsigned int \
18533 : __builtin_vsx_xxgenpcvwm((vector unsigned int)(__a), (int)(__imm)), \
18534 vector unsigned long long \
18535 : __builtin_vsx_xxgenpcvdm((vector unsigned long long)(__a), \
18536 (int)(__imm)))
18537#endif /* __VSX__ */
18538
18539/* vec_clr_first */
18540
18541static __inline__ vector signed char __ATTRS_o_ai
18542vec_clr_first(vector signed char __a, unsigned int __n) {
18543#ifdef __LITTLE_ENDIAN__
18544 return (vector signed char)__builtin_altivec_vclrrb((vector unsigned char)__a,
18545 __n);
18546#else
18547 return (vector signed char)__builtin_altivec_vclrlb((vector unsigned char)__a,
18548 __n);
18549#endif
18550}
18551
18552static __inline__ vector unsigned char __ATTRS_o_ai
18553vec_clr_first(vector unsigned char __a, unsigned int __n) {
18554#ifdef __LITTLE_ENDIAN__
18555 return (vector unsigned char)__builtin_altivec_vclrrb(
18556 (vector unsigned char)__a, __n);
18557#else
18558 return (vector unsigned char)__builtin_altivec_vclrlb(
18559 (vector unsigned char)__a, __n);
18560#endif
18561}
18562
18563/* vec_clr_last */
18564
18565static __inline__ vector signed char __ATTRS_o_ai
18566vec_clr_last(vector signed char __a, unsigned int __n) {
18567#ifdef __LITTLE_ENDIAN__
18568 return (vector signed char)__builtin_altivec_vclrlb((vector unsigned char)__a,
18569 __n);
18570#else
18571 return (vector signed char)__builtin_altivec_vclrrb((vector unsigned char)__a,
18572 __n);
18573#endif
18574}
18575
18576static __inline__ vector unsigned char __ATTRS_o_ai
18577vec_clr_last(vector unsigned char __a, unsigned int __n) {
18578#ifdef __LITTLE_ENDIAN__
18579 return (vector unsigned char)__builtin_altivec_vclrlb(
18580 (vector unsigned char)__a, __n);
18581#else
18582 return (vector unsigned char)__builtin_altivec_vclrrb(
18583 (vector unsigned char)__a, __n);
18584#endif
18585}
18586
18587/* vec_cntlzm */
18588
18589static __inline__ vector unsigned long long __ATTRS_o_ai
18590vec_cntlzm(vector unsigned long long __a, vector unsigned long long __b) {
18591 return __builtin_altivec_vclzdm(__a, __b);
18592}
18593
18594/* vec_cnttzm */
18595
18596static __inline__ vector unsigned long long __ATTRS_o_ai
18597vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {
18598 return __builtin_altivec_vctzdm(__a, __b);
18599}
18600
18601/* vec_mod */
18602
18603static __inline__ vector signed int __ATTRS_o_ai
18604vec_mod(vector signed int __a, vector signed int __b) {
18605 return __a % __b;
18606}
18607
18608static __inline__ vector unsigned int __ATTRS_o_ai
18609vec_mod(vector unsigned int __a, vector unsigned int __b) {
18610 return __a % __b;
18611}
18612
18613static __inline__ vector signed long long __ATTRS_o_ai
18614vec_mod(vector signed long long __a, vector signed long long __b) {
18615 return __a % __b;
18616}
18617
18618static __inline__ vector unsigned long long __ATTRS_o_ai
18619vec_mod(vector unsigned long long __a, vector unsigned long long __b) {
18620 return __a % __b;
18621}
18622
18623#ifdef __SIZEOF_INT128__
18624static __inline__ vector signed __int128 __ATTRS_o_ai
18625vec_mod(vector signed __int128 __a, vector signed __int128 __b) {
18626 return __a % __b;
18627}
18628
18629static __inline__ vector unsigned __int128 __ATTRS_o_ai
18630vec_mod(vector unsigned __int128 __a, vector unsigned __int128 __b) {
18631 return __a % __b;
18632}
18633#endif
18634
18635/* vec_sldb */
18636#define vec_sldb(__a, __b, __c) \
18637 _Generic( \
18638 (__a), vector unsigned char \
18639 : (vector unsigned char)__builtin_altivec_vsldbi( \
18640 (vector unsigned char)__a, (vector unsigned char)__b, \
18641 (__c & 0x7)), \
18642 vector signed char \
18643 : (vector signed char)__builtin_altivec_vsldbi( \
18644 (vector unsigned char)__a, (vector unsigned char)__b, \
18645 (__c & 0x7)), \
18646 vector unsigned short \
18647 : (vector unsigned short)__builtin_altivec_vsldbi( \
18648 (vector unsigned char)__a, (vector unsigned char)__b, \
18649 (__c & 0x7)), \
18650 vector signed short \
18651 : (vector signed short)__builtin_altivec_vsldbi( \
18652 (vector unsigned char)__a, (vector unsigned char)__b, \
18653 (__c & 0x7)), \
18654 vector unsigned int \
18655 : (vector unsigned int)__builtin_altivec_vsldbi( \
18656 (vector unsigned char)__a, (vector unsigned char)__b, \
18657 (__c & 0x7)), \
18658 vector signed int \
18659 : (vector signed int)__builtin_altivec_vsldbi((vector unsigned char)__a, \
18660 (vector unsigned char)__b, \
18661 (__c & 0x7)), \
18662 vector unsigned long long \
18663 : (vector unsigned long long)__builtin_altivec_vsldbi( \
18664 (vector unsigned char)__a, (vector unsigned char)__b, \
18665 (__c & 0x7)), \
18666 vector signed long long \
18667 : (vector signed long long)__builtin_altivec_vsldbi( \
18668 (vector unsigned char)__a, (vector unsigned char)__b, (__c & 0x7)))
18669
18670/* vec_srdb */
18671#define vec_srdb(__a, __b, __c) \
18672 _Generic( \
18673 (__a), vector unsigned char \
18674 : (vector unsigned char)__builtin_altivec_vsrdbi( \
18675 (vector unsigned char)__a, (vector unsigned char)__b, \
18676 (__c & 0x7)), \
18677 vector signed char \
18678 : (vector signed char)__builtin_altivec_vsrdbi( \
18679 (vector unsigned char)__a, (vector unsigned char)__b, \
18680 (__c & 0x7)), \
18681 vector unsigned short \
18682 : (vector unsigned short)__builtin_altivec_vsrdbi( \
18683 (vector unsigned char)__a, (vector unsigned char)__b, \
18684 (__c & 0x7)), \
18685 vector signed short \
18686 : (vector signed short)__builtin_altivec_vsrdbi( \
18687 (vector unsigned char)__a, (vector unsigned char)__b, \
18688 (__c & 0x7)), \
18689 vector unsigned int \
18690 : (vector unsigned int)__builtin_altivec_vsrdbi( \
18691 (vector unsigned char)__a, (vector unsigned char)__b, \
18692 (__c & 0x7)), \
18693 vector signed int \
18694 : (vector signed int)__builtin_altivec_vsrdbi((vector unsigned char)__a, \
18695 (vector unsigned char)__b, \
18696 (__c & 0x7)), \
18697 vector unsigned long long \
18698 : (vector unsigned long long)__builtin_altivec_vsrdbi( \
18699 (vector unsigned char)__a, (vector unsigned char)__b, \
18700 (__c & 0x7)), \
18701 vector signed long long \
18702 : (vector signed long long)__builtin_altivec_vsrdbi( \
18703 (vector unsigned char)__a, (vector unsigned char)__b, (__c & 0x7)))
18704
18705/* vec_insertl */
18706
18707static __inline__ vector unsigned char __ATTRS_o_ai
18708vec_insertl(unsigned char __a, vector unsigned char __b, unsigned int __c) {
18709#ifdef __LITTLE_ENDIAN__
18710 return __builtin_altivec_vinsbrx(__b, __c, __a);
18711#else
18712 return __builtin_altivec_vinsblx(__b, __c, __a);
18713#endif
18714}
18715
18716static __inline__ vector unsigned short __ATTRS_o_ai
18717vec_insertl(unsigned short __a, vector unsigned short __b, unsigned int __c) {
18718#ifdef __LITTLE_ENDIAN__
18719 return __builtin_altivec_vinshrx(__b, __c, __a);
18720#else
18721 return __builtin_altivec_vinshlx(__b, __c, __a);
18722#endif
18723}
18724
18725static __inline__ vector unsigned int __ATTRS_o_ai
18726vec_insertl(unsigned int __a, vector unsigned int __b, unsigned int __c) {
18727#ifdef __LITTLE_ENDIAN__
18728 return __builtin_altivec_vinswrx(__b, __c, __a);
18729#else
18730 return __builtin_altivec_vinswlx(__b, __c, __a);
18731#endif
18732}
18733
18734static __inline__ vector unsigned long long __ATTRS_o_ai
18735vec_insertl(unsigned long long __a, vector unsigned long long __b,
18736 unsigned int __c) {
18737#ifdef __LITTLE_ENDIAN__
18738 return __builtin_altivec_vinsdrx(__b, __c, __a);
18739#else
18740 return __builtin_altivec_vinsdlx(__b, __c, __a);
18741#endif
18742}
18743
18744static __inline__ vector unsigned char __ATTRS_o_ai
18745vec_insertl(vector unsigned char __a, vector unsigned char __b,
18746 unsigned int __c) {
18747#ifdef __LITTLE_ENDIAN__
18748 return __builtin_altivec_vinsbvrx(__b, __c, __a);
18749#else
18750 return __builtin_altivec_vinsbvlx(__b, __c, __a);
18751#endif
18752}
18753
18754static __inline__ vector unsigned short __ATTRS_o_ai
18755vec_insertl(vector unsigned short __a, vector unsigned short __b,
18756 unsigned int __c) {
18757#ifdef __LITTLE_ENDIAN__
18758 return __builtin_altivec_vinshvrx(__b, __c, __a);
18759#else
18760 return __builtin_altivec_vinshvlx(__b, __c, __a);
18761#endif
18762}
18763
18764static __inline__ vector unsigned int __ATTRS_o_ai
18765vec_insertl(vector unsigned int __a, vector unsigned int __b,
18766 unsigned int __c) {
18767#ifdef __LITTLE_ENDIAN__
18768 return __builtin_altivec_vinswvrx(__b, __c, __a);
18769#else
18770 return __builtin_altivec_vinswvlx(__b, __c, __a);
18771#endif
18772}
18773
18774/* vec_inserth */
18775
18776static __inline__ vector unsigned char __ATTRS_o_ai
18777vec_inserth(unsigned char __a, vector unsigned char __b, unsigned int __c) {
18778#ifdef __LITTLE_ENDIAN__
18779 return __builtin_altivec_vinsblx(__b, __c, __a);
18780#else
18781 return __builtin_altivec_vinsbrx(__b, __c, __a);
18782#endif
18783}
18784
18785static __inline__ vector unsigned short __ATTRS_o_ai
18786vec_inserth(unsigned short __a, vector unsigned short __b, unsigned int __c) {
18787#ifdef __LITTLE_ENDIAN__
18788 return __builtin_altivec_vinshlx(__b, __c, __a);
18789#else
18790 return __builtin_altivec_vinshrx(__b, __c, __a);
18791#endif
18792}
18793
18794static __inline__ vector unsigned int __ATTRS_o_ai
18795vec_inserth(unsigned int __a, vector unsigned int __b, unsigned int __c) {
18796#ifdef __LITTLE_ENDIAN__
18797 return __builtin_altivec_vinswlx(__b, __c, __a);
18798#else
18799 return __builtin_altivec_vinswrx(__b, __c, __a);
18800#endif
18801}
18802
18803static __inline__ vector unsigned long long __ATTRS_o_ai
18804vec_inserth(unsigned long long __a, vector unsigned long long __b,
18805 unsigned int __c) {
18806#ifdef __LITTLE_ENDIAN__
18807 return __builtin_altivec_vinsdlx(__b, __c, __a);
18808#else
18809 return __builtin_altivec_vinsdrx(__b, __c, __a);
18810#endif
18811}
18812
18813static __inline__ vector unsigned char __ATTRS_o_ai
18814vec_inserth(vector unsigned char __a, vector unsigned char __b,
18815 unsigned int __c) {
18816#ifdef __LITTLE_ENDIAN__
18817 return __builtin_altivec_vinsbvlx(__b, __c, __a);
18818#else
18819 return __builtin_altivec_vinsbvrx(__b, __c, __a);
18820#endif
18821}
18822
18823static __inline__ vector unsigned short __ATTRS_o_ai
18824vec_inserth(vector unsigned short __a, vector unsigned short __b,
18825 unsigned int __c) {
18826#ifdef __LITTLE_ENDIAN__
18827 return __builtin_altivec_vinshvlx(__b, __c, __a);
18828#else
18829 return __builtin_altivec_vinshvrx(__b, __c, __a);
18830#endif
18831}
18832
18833static __inline__ vector unsigned int __ATTRS_o_ai
18834vec_inserth(vector unsigned int __a, vector unsigned int __b,
18835 unsigned int __c) {
18836#ifdef __LITTLE_ENDIAN__
18837 return __builtin_altivec_vinswvlx(__b, __c, __a);
18838#else
18839 return __builtin_altivec_vinswvrx(__b, __c, __a);
18840#endif
18841}
18842
18843/* vec_extractl */
18844
18845static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
18846 vector unsigned char __a, vector unsigned char __b, unsigned int __c) {
18847#ifdef __LITTLE_ENDIAN__
18848 return __builtin_altivec_vextdubvrx(__a, __b, __c);
18849#else
18850 vector unsigned long long __ret = __builtin_altivec_vextdubvlx(__a, __b, __c);
18851 return vec_sld(__ret, __ret, 8);
18852#endif
18853}
18854
18855static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
18856 vector unsigned short __a, vector unsigned short __b, unsigned int __c) {
18857#ifdef __LITTLE_ENDIAN__
18858 return __builtin_altivec_vextduhvrx(__a, __b, __c);
18859#else
18860 vector unsigned long long __ret = __builtin_altivec_vextduhvlx(__a, __b, __c);
18861 return vec_sld(__ret, __ret, 8);
18862#endif
18863}
18864
18865static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(
18866 vector unsigned int __a, vector unsigned int __b, unsigned int __c) {
18867#ifdef __LITTLE_ENDIAN__
18868 return __builtin_altivec_vextduwvrx(__a, __b, __c);
18869#else
18870 vector unsigned long long __ret = __builtin_altivec_vextduwvlx(__a, __b, __c);
18871 return vec_sld(__ret, __ret, 8);
18872#endif
18873}
18874
18875static __inline__ vector unsigned long long __ATTRS_o_ai
18876vec_extractl(vector unsigned long long __a, vector unsigned long long __b,
18877 unsigned int __c) {
18878#ifdef __LITTLE_ENDIAN__
18879 return __builtin_altivec_vextddvrx(__a, __b, __c);
18880#else
18881 vector unsigned long long __ret = __builtin_altivec_vextddvlx(__a, __b, __c);
18882 return vec_sld(__ret, __ret, 8);
18883#endif
18884}
18885
18886/* vec_extracth */
18887
18888static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
18889 vector unsigned char __a, vector unsigned char __b, unsigned int __c) {
18890#ifdef __LITTLE_ENDIAN__
18891 return __builtin_altivec_vextdubvlx(__a, __b, __c);
18892#else
18893 vector unsigned long long __ret = __builtin_altivec_vextdubvrx(__a, __b, __c);
18894 return vec_sld(__ret, __ret, 8);
18895#endif
18896}
18897
18898static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
18899 vector unsigned short __a, vector unsigned short __b, unsigned int __c) {
18900#ifdef __LITTLE_ENDIAN__
18901 return __builtin_altivec_vextduhvlx(__a, __b, __c);
18902#else
18903 vector unsigned long long __ret = __builtin_altivec_vextduhvrx(__a, __b, __c);
18904 return vec_sld(__ret, __ret, 8);
18905#endif
18906}
18907
18908static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(
18909 vector unsigned int __a, vector unsigned int __b, unsigned int __c) {
18910#ifdef __LITTLE_ENDIAN__
18911 return __builtin_altivec_vextduwvlx(__a, __b, __c);
18912#else
18913 vector unsigned long long __ret = __builtin_altivec_vextduwvrx(__a, __b, __c);
18914 return vec_sld(__ret, __ret, 8);
18915#endif
18916}
18917
18918static __inline__ vector unsigned long long __ATTRS_o_ai
18919vec_extracth(vector unsigned long long __a, vector unsigned long long __b,
18920 unsigned int __c) {
18921#ifdef __LITTLE_ENDIAN__
18922 return __builtin_altivec_vextddvlx(__a, __b, __c);
18923#else
18924 vector unsigned long long __ret = __builtin_altivec_vextddvrx(__a, __b, __c);
18925 return vec_sld(__ret, __ret, 8);
18926#endif
18927}
18928
18929#ifdef __VSX__
18930
18931/* vec_permx */
18932#define vec_permx(__a, __b, __c, __d) \
18933 _Generic( \
18934 (__a), vector unsigned char \
18935 : (vector unsigned char)__builtin_vsx_xxpermx( \
18936 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18937 vector signed char \
18938 : (vector signed char)__builtin_vsx_xxpermx( \
18939 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18940 vector unsigned short \
18941 : (vector unsigned short)__builtin_vsx_xxpermx( \
18942 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18943 vector signed short \
18944 : (vector signed short)__builtin_vsx_xxpermx( \
18945 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18946 vector unsigned int \
18947 : (vector unsigned int)__builtin_vsx_xxpermx( \
18948 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18949 vector signed int \
18950 : (vector signed int)__builtin_vsx_xxpermx( \
18951 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18952 vector unsigned long long \
18953 : (vector unsigned long long)__builtin_vsx_xxpermx( \
18954 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18955 vector signed long long \
18956 : (vector signed long long)__builtin_vsx_xxpermx( \
18957 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18958 vector float \
18959 : (vector float)__builtin_vsx_xxpermx( \
18960 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \
18961 vector double \
18962 : (vector double)__builtin_vsx_xxpermx( \
18963 (vector unsigned char)__a, (vector unsigned char)__b, __c, __d))
18964
18965/* vec_blendv */
18966
18967static __inline__ vector signed char __ATTRS_o_ai
18968vec_blendv(vector signed char __a, vector signed char __b,
18969 vector unsigned char __c) {
18970 return (vector signed char)__builtin_vsx_xxblendvb(
18971 (vector unsigned char)__a, (vector unsigned char)__b, __c);
18972}
18973
18974static __inline__ vector unsigned char __ATTRS_o_ai
18975vec_blendv(vector unsigned char __a, vector unsigned char __b,
18976 vector unsigned char __c) {
18977 return __builtin_vsx_xxblendvb(__a, __b, __c);
18978}
18979
18980static __inline__ vector signed short __ATTRS_o_ai
18981vec_blendv(vector signed short __a, vector signed short __b,
18982 vector unsigned short __c) {
18983 return (vector signed short)__builtin_vsx_xxblendvh(
18984 (vector unsigned short)__a, (vector unsigned short)__b, __c);
18985}
18986
18987static __inline__ vector unsigned short __ATTRS_o_ai
18988vec_blendv(vector unsigned short __a, vector unsigned short __b,
18989 vector unsigned short __c) {
18990 return __builtin_vsx_xxblendvh(__a, __b, __c);
18991}
18992
18993static __inline__ vector signed int __ATTRS_o_ai
18994vec_blendv(vector signed int __a, vector signed int __b,
18995 vector unsigned int __c) {
18996 return (vector signed int)__builtin_vsx_xxblendvw(
18997 (vector unsigned int)__a, (vector unsigned int)__b, __c);
18998}
18999
19000static __inline__ vector unsigned int __ATTRS_o_ai
19001vec_blendv(vector unsigned int __a, vector unsigned int __b,
19002 vector unsigned int __c) {
19003 return __builtin_vsx_xxblendvw(__a, __b, __c);
19004}
19005
19006static __inline__ vector signed long long __ATTRS_o_ai
19007vec_blendv(vector signed long long __a, vector signed long long __b,
19008 vector unsigned long long __c) {
19009 return (vector signed long long)__builtin_vsx_xxblendvd(
19010 (vector unsigned long long)__a, (vector unsigned long long)__b, __c);
19011}
19012
19013static __inline__ vector unsigned long long __ATTRS_o_ai
19014vec_blendv(vector unsigned long long __a, vector unsigned long long __b,
19015 vector unsigned long long __c) {
19016 return (vector unsigned long long)__builtin_vsx_xxblendvd(__a, __b, __c);
19017}
19018
19019static __inline__ vector float __ATTRS_o_ai
19020vec_blendv(vector float __a, vector float __b, vector unsigned int __c) {
19021 return (vector float)__builtin_vsx_xxblendvw((vector unsigned int)__a,
19022 (vector unsigned int)__b, __c);
19023}
19024
19025static __inline__ vector double __ATTRS_o_ai
19026vec_blendv(vector double __a, vector double __b,
19027 vector unsigned long long __c) {
19028 return (vector double)__builtin_vsx_xxblendvd(
19029 (vector unsigned long long)__a, (vector unsigned long long)__b, __c);
19030}
19031
19032#define vec_replace_unaligned(__a, __b, __c) \
19033 _Generic((__a), vector signed int \
19034 : __builtin_altivec_vinsw((vector unsigned char)__a, \
19035 (unsigned int)__b, __c), \
19036 vector unsigned int \
19037 : __builtin_altivec_vinsw((vector unsigned char)__a, \
19038 (unsigned int)__b, __c), \
19039 vector unsigned long long \
19040 : __builtin_altivec_vinsd((vector unsigned char)__a, \
19041 (unsigned long long)__b, __c), \
19042 vector signed long long \
19043 : __builtin_altivec_vinsd((vector unsigned char)__a, \
19044 (unsigned long long)__b, __c), \
19045 vector float \
19046 : __builtin_altivec_vinsw((vector unsigned char)__a, \
19047 (unsigned int)__b, __c), \
19048 vector double \
19049 : __builtin_altivec_vinsd((vector unsigned char)__a, \
19050 (unsigned long long)__b, __c))
19051
19052#define vec_replace_elt(__a, __b, __c) \
19053 _Generic((__a), vector signed int \
19054 : (vector signed int)__builtin_altivec_vinsw_elt( \
19055 (vector unsigned char)__a, (unsigned int)__b, __c), \
19056 vector unsigned int \
19057 : (vector unsigned int)__builtin_altivec_vinsw_elt( \
19058 (vector unsigned char)__a, (unsigned int)__b, __c), \
19059 vector unsigned long long \
19060 : (vector unsigned long long)__builtin_altivec_vinsd_elt( \
19061 (vector unsigned char)__a, (unsigned long long)__b, __c), \
19062 vector signed long long \
19063 : (vector signed long long)__builtin_altivec_vinsd_elt( \
19064 (vector unsigned char)__a, (unsigned long long)__b, __c), \
19065 vector float \
19066 : (vector float)__builtin_altivec_vinsw_elt( \
19067 (vector unsigned char)__a, (unsigned int)__b, __c), \
19068 vector double \
19069 : (vector double)__builtin_altivec_vinsd_elt( \
19070 (vector unsigned char)__a, (unsigned long long)__b, __c))
19071
19072/* vec_splati */
19073
19074#define vec_splati(__a) \
19075 _Generic((__a), signed int \
19076 : ((vector signed int)__a), unsigned int \
19077 : ((vector unsigned int)__a), float \
19078 : ((vector float)__a))
19079
19080/* vec_spatid */
19081
19082static __inline__ vector double __ATTRS_o_ai vec_splatid(const float __a) {
19083 return ((vector double)((double)__a));
19084}
19085
19086/* vec_splati_ins */
19087
19088static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins(
19089 vector signed int __a, const unsigned int __b, const signed int __c) {
19090 const unsigned int __d = __b & 0x01;
19091#ifdef __LITTLE_ENDIAN__
19092 __a[1 - __d] = __c;
19093 __a[3 - __d] = __c;
19094#else
19095 __a[__d] = __c;
19096 __a[2 + __d] = __c;
19097#endif
19098 return __a;
19099}
19100
19101static __inline__ vector unsigned int __ATTRS_o_ai vec_splati_ins(
19102 vector unsigned int __a, const unsigned int __b, const unsigned int __c) {
19103 const unsigned int __d = __b & 0x01;
19104#ifdef __LITTLE_ENDIAN__
19105 __a[1 - __d] = __c;
19106 __a[3 - __d] = __c;
19107#else
19108 __a[__d] = __c;
19109 __a[2 + __d] = __c;
19110#endif
19111 return __a;
19112}
19113
19114static __inline__ vector float __ATTRS_o_ai
19115vec_splati_ins(vector float __a, const unsigned int __b, const float __c) {
19116 const unsigned int __d = __b & 0x01;
19117#ifdef __LITTLE_ENDIAN__
19118 __a[1 - __d] = __c;
19119 __a[3 - __d] = __c;
19120#else
19121 __a[__d] = __c;
19122 __a[2 + __d] = __c;
19123#endif
19124 return __a;
19125}
19126
19127/* vec_test_lsbb_all_ones */
19128
19129static __inline__ int __ATTRS_o_ai
19130vec_test_lsbb_all_ones(vector unsigned char __a) {
19131 return __builtin_vsx_xvtlsbb(__a, 1);
19132}
19133
19134/* vec_test_lsbb_all_zeros */
19135
19136static __inline__ int __ATTRS_o_ai
19137vec_test_lsbb_all_zeros(vector unsigned char __a) {
19138 return __builtin_vsx_xvtlsbb(__a, 0);
19139}
19140#endif /* __VSX__ */
19141
19142/* vec_stril */
19143
19144static __inline__ vector unsigned char __ATTRS_o_ai
19145vec_stril(vector unsigned char __a) {
19146#ifdef __LITTLE_ENDIAN__
19147 return (vector unsigned char)__builtin_altivec_vstribr(
19148 (vector unsigned char)__a);
19149#else
19150 return (vector unsigned char)__builtin_altivec_vstribl(
19151 (vector unsigned char)__a);
19152#endif
19153}
19154
19155static __inline__ vector signed char __ATTRS_o_ai
19156vec_stril(vector signed char __a) {
19157#ifdef __LITTLE_ENDIAN__
19158 return (vector signed char)__builtin_altivec_vstribr(
19159 (vector unsigned char)__a);
19160#else
19161 return (vector signed char)__builtin_altivec_vstribl(
19162 (vector unsigned char)__a);
19163#endif
19164}
19165
19166static __inline__ vector unsigned short __ATTRS_o_ai
19167vec_stril(vector unsigned short __a) {
19168#ifdef __LITTLE_ENDIAN__
19169 return (vector unsigned short)__builtin_altivec_vstrihr(
19170 (vector signed short)__a);
19171#else
19172 return (vector unsigned short)__builtin_altivec_vstrihl(
19173 (vector signed short)__a);
19174#endif
19175}
19176
19177static __inline__ vector signed short __ATTRS_o_ai
19178vec_stril(vector signed short __a) {
19179#ifdef __LITTLE_ENDIAN__
19180 return __builtin_altivec_vstrihr(__a);
19181#else
19182 return __builtin_altivec_vstrihl(__a);
19183#endif
19184}
19185
19186/* vec_stril_p */
19187
19188static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned char __a) {
19189#ifdef __LITTLE_ENDIAN__
19190 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);
19191#else
19192 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);
19193#endif
19194}
19195
19196static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed char __a) {
19197#ifdef __LITTLE_ENDIAN__
19198 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);
19199#else
19200 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);
19201#endif
19202}
19203
19204static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned short __a) {
19205#ifdef __LITTLE_ENDIAN__
19206 return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);
19207#else
19208 return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);
19209#endif
19210}
19211
19212static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed short __a) {
19213#ifdef __LITTLE_ENDIAN__
19214 return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);
19215#else
19216 return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);
19217#endif
19218}
19219
19220/* vec_strir */
19221
19222static __inline__ vector unsigned char __ATTRS_o_ai
19223vec_strir(vector unsigned char __a) {
19224#ifdef __LITTLE_ENDIAN__
19225 return (vector unsigned char)__builtin_altivec_vstribl(
19226 (vector unsigned char)__a);
19227#else
19228 return (vector unsigned char)__builtin_altivec_vstribr(
19229 (vector unsigned char)__a);
19230#endif
19231}
19232
19233static __inline__ vector signed char __ATTRS_o_ai
19234vec_strir(vector signed char __a) {
19235#ifdef __LITTLE_ENDIAN__
19236 return (vector signed char)__builtin_altivec_vstribl(
19237 (vector unsigned char)__a);
19238#else
19239 return (vector signed char)__builtin_altivec_vstribr(
19240 (vector unsigned char)__a);
19241#endif
19242}
19243
19244static __inline__ vector unsigned short __ATTRS_o_ai
19245vec_strir(vector unsigned short __a) {
19246#ifdef __LITTLE_ENDIAN__
19247 return (vector unsigned short)__builtin_altivec_vstrihl(
19248 (vector signed short)__a);
19249#else
19250 return (vector unsigned short)__builtin_altivec_vstrihr(
19251 (vector signed short)__a);
19252#endif
19253}
19254
19255static __inline__ vector signed short __ATTRS_o_ai
19256vec_strir(vector signed short __a) {
19257#ifdef __LITTLE_ENDIAN__
19258 return __builtin_altivec_vstrihl(__a);
19259#else
19260 return __builtin_altivec_vstrihr(__a);
19261#endif
19262}
19263
19264/* vec_strir_p */
19265
19266static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned char __a) {
19267#ifdef __LITTLE_ENDIAN__
19268 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);
19269#else
19270 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);
19271#endif
19272}
19273
19274static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed char __a) {
19275#ifdef __LITTLE_ENDIAN__
19276 return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);
19277#else
19278 return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);
19279#endif
19280}
19281
19282static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned short __a) {
19283#ifdef __LITTLE_ENDIAN__
19284 return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);
19285#else
19286 return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);
19287#endif
19288}
19289
19290static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed short __a) {
19291#ifdef __LITTLE_ENDIAN__
19292 return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);
19293#else
19294 return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);
19295#endif
19296}
19297
19298/* vs[l | r | ra] */
19299
19300#ifdef __SIZEOF_INT128__
19301static __inline__ vector unsigned __int128 __ATTRS_o_ai
19302vec_sl(vector unsigned __int128 __a, vector unsigned __int128 __b) {
19303 return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
19304 __CHAR_BIT__));
19305}
19306
19307static __inline__ vector signed __int128 __ATTRS_o_ai
19308vec_sl(vector signed __int128 __a, vector unsigned __int128 __b) {
19309 return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
19310 __CHAR_BIT__));
19311}
19312
19313static __inline__ vector unsigned __int128 __ATTRS_o_ai
19314vec_sr(vector unsigned __int128 __a, vector unsigned __int128 __b) {
19315 return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
19316 __CHAR_BIT__));
19317}
19318
19319static __inline__ vector signed __int128 __ATTRS_o_ai
19320vec_sr(vector signed __int128 __a, vector unsigned __int128 __b) {
19321 return (
19322 vector signed __int128)(((vector unsigned __int128)__a) >>
19323 (__b %
19324 (vector unsigned __int128)(sizeof(
19325 unsigned __int128) *
19326 __CHAR_BIT__)));
19327}
19328
19329static __inline__ vector unsigned __int128 __ATTRS_o_ai
19330vec_sra(vector unsigned __int128 __a, vector unsigned __int128 __b) {
19331 return (
19332 vector unsigned __int128)(((vector signed __int128)__a) >>
19333 (__b %
19334 (vector unsigned __int128)(sizeof(
19335 unsigned __int128) *
19336 __CHAR_BIT__)));
19337}
19338
19339static __inline__ vector signed __int128 __ATTRS_o_ai
19340vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {
19341 return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *
19342 __CHAR_BIT__));
19343}
19344
19345#endif /* __SIZEOF_INT128__ */
19346#endif /* __POWER10_VECTOR__ */
19347
19348#ifdef __FUTURE_VECTOR__
19349
19350/* vec_uncompress* - Deeply Compressed Weights builtins */
19351
19352static __inline__ vector unsigned char __ATTRS_o_ai
19353vec_uncompresshn(vector unsigned char __a, vector unsigned char __b) {
19354 return __builtin_altivec_vucmprhn(__a, __b);
19355}
19356
19357static __inline__ vector unsigned char __ATTRS_o_ai
19358vec_uncompressln(vector unsigned char __a, vector unsigned char __b) {
19359 return __builtin_altivec_vucmprln(__a, __b);
19360}
19361
19362static __inline__ vector unsigned char __ATTRS_o_ai
19363vec_uncompresshb(vector unsigned char __a, vector unsigned char __b) {
19364 return __builtin_altivec_vucmprhb(__a, __b);
19365}
19366
19367static __inline__ vector unsigned char __ATTRS_o_ai
19368vec_uncompresslb(vector unsigned char __a, vector unsigned char __b) {
19369 return __builtin_altivec_vucmprlb(__a, __b);
19370}
19371
19372static __inline__ vector unsigned char __ATTRS_o_ai
19373vec_uncompresshh(vector unsigned char __a, vector unsigned char __b) {
19374 return __builtin_altivec_vucmprhh(__a, __b);
19375}
19376
19377static __inline__ vector unsigned char __ATTRS_o_ai
19378vec_uncompresslh(vector unsigned char __a, vector unsigned char __b) {
19379 return __builtin_altivec_vucmprlh(__a, __b);
19380}
19381
19382static __inline__ vector unsigned char __ATTRS_o_ai
19383vec_unpack_hsn_to_byte(vector unsigned char __a) {
19384 return __builtin_altivec_vupkhsntob(__a);
19385}
19386
19387static __inline__ vector unsigned char __ATTRS_o_ai
19388vec_unpack_lsn_to_byte(vector unsigned char __a) {
19389 return __builtin_altivec_vupklsntob(__a);
19390}
19391
19392#define vec_unpack_int4_to_bf16(__a, __imm) \
19393 __builtin_altivec_vupkint4tobf16((__a), (__imm))
19394
19395#define vec_unpack_int8_to_bf16(__a, __imm) \
19396 __builtin_altivec_vupkint8tobf16((__a), (__imm))
19397
19398#define vec_unpack_int4_to_fp32(__a, __imm) \
19399 __builtin_altivec_vupkint4tofp32((__a), (__imm))
19400
19401#define vec_unpack_int8_to_fp32(__a, __imm) \
19402 __builtin_altivec_vupkint8tofp32((__a), (__imm))
19403
19404#endif /* __FUTURE_VECTOR__ */
19405
19406#ifdef __POWER8_VECTOR__
19407#define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))
19408#define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))
19409
19410static __inline__ long __bcdadd_ofl(vector unsigned char __a,
19411 vector unsigned char __b) {
19412 return __builtin_ppc_bcdadd_p(__CR6_SO, __a, __b);
19413}
19414
19415static __inline__ long __bcdsub_ofl(vector unsigned char __a,
19416 vector unsigned char __b) {
19417 return __builtin_ppc_bcdsub_p(__CR6_SO, __a, __b);
19418}
19419
19420static __inline__ long __bcd_invalid(vector unsigned char __a) {
19421 return __builtin_ppc_bcdsub_p(__CR6_SO, __a, __a);
19422}
19423
19424static __inline__ long __bcdcmpeq(vector unsigned char __a,
19425 vector unsigned char __b) {
19426 return __builtin_ppc_bcdsub_p(__CR6_EQ, __a, __b);
19427}
19428
19429static __inline__ long __bcdcmplt(vector unsigned char __a,
19430 vector unsigned char __b) {
19431 return __builtin_ppc_bcdsub_p(__CR6_LT, __a, __b);
19432}
19433
19434static __inline__ long __bcdcmpgt(vector unsigned char __a,
19435 vector unsigned char __b) {
19436 return __builtin_ppc_bcdsub_p(__CR6_GT, __a, __b);
19437}
19438
19439static __inline__ long __bcdcmple(vector unsigned char __a,
19440 vector unsigned char __b) {
19441 return __builtin_ppc_bcdsub_p(__CR6_GT_REV, __a, __b);
19442}
19443
19444static __inline__ long __bcdcmpge(vector unsigned char __a,
19445 vector unsigned char __b) {
19446 return __builtin_ppc_bcdsub_p(__CR6_LT_REV, __a, __b);
19447}
19448
19449#endif // __POWER8_VECTOR__
19450
19451#undef __ATTRS_o_ai
19452
19453#endif /* __ALTIVEC_H */
__device__ double
__device__ float
#define NULL
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a, vector int __b)
Definition altivec.h:12339
static __inline__ vector int __ATTRS_o_ai vec_lvewx(long __a, const int *__b)
Definition altivec.h:4296
static __inline__ vector signed int __ATTRS_o_ai vec_sube(vector signed int __a, vector signed int __b, vector signed int __c)
Definition altivec.h:12502
static __inline__ vector unsigned char __ATTRS_o_ai vec_sr(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:10424
static __inline__ vector unsigned short __ATTRS_o_ai vec_vadduhs(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:769
static __inline__ vector bool char __ATTRS_o_ai vec_cmpeq(vector signed char __a, vector signed char __b)
Definition altivec.h:1708
#define __CR6_GT_REV
Definition altivec.h:23
static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b, vector signed char *__c)
Definition altivec.h:11346
static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a, vector short __b)
Definition altivec.h:5011
static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a, signed int __b)
Definition altivec.h:13572
static __inline__ vector signed char __ATTRS_o_ai vec_sra(vector signed char __a, vector unsigned char __b)
Definition altivec.h:10558
static __inline__ vector signed char __ATTRS_o_ai vec_lvx(long __a, const vector signed char *__b)
Definition altivec.h:4150
static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a, vector int __b)
Definition altivec.h:5326
static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a, vector short __b)
Definition altivec.h:12305
static __inline__ vector signed char __ATTRS_o_ai vec_sro(vector signed char __a, vector signed char __b)
Definition altivec.h:11010
static __inline__ vector signed char __ATTRS_o_ai vec_lvrx(int __a, const signed char *__b)
Definition altivec.h:14002
static __inline__ __ATTRS_o_ai vector signed char vec_xl(ptrdiff_t __offset, const signed char *__ptr)
Definition altivec.h:17759
static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, long __b, short *__c)
Definition altivec.h:11576
#define __CR6_GT
Definition altivec.h:22
static __inline__ __ATTRS_o_ai void vec_xst(vector signed char __vec, ptrdiff_t __offset, signed char *__ptr)
Definition altivec.h:18029
static __inline__ vector signed char __ATTRS_o_ai vec_abss(vector signed char __a)
Definition altivec.h:160
static __inline__ vector signed char __ATTRS_o_ai vec_vsubsbs(vector signed char __a, vector signed char __b)
Definition altivec.h:12272
static __inline__ vector unsigned int __ATTRS_o_ai vec_vmaxuw(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:5063
static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a)
Definition altivec.h:1659
static __inline__ vector signed char __ATTRS_o_ai vec_vslb(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9009
static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a, unsigned char __b)
Definition altivec.h:10269
static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a, vector short __b, vector short __c)
Definition altivec.h:6021
static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a)
Definition altivec.h:12762
static __inline__ int __ATTRS_o_ai vec_any_ngt(vector float __a, vector float __b)
Definition altivec.h:17292
static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a, vector signed char __b)
Definition altivec.h:17066
static __inline__ vector signed char __ATTRS_o_ai vec_lde(long __a, const signed char *__b)
Definition altivec.h:4239
static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:14329
#define vec_xst_be
Definition altivec.h:18255
static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a, vector unsigned int __b)
Definition altivec.h:10637
static __inline__ vector bool char __ATTRS_o_ai vec_cmpne(vector bool char __a, vector bool char __b)
Definition altivec.h:2032
static __inline__ int __ATTRS_o_ai vec_any_nge(vector float __a, vector float __b)
Definition altivec.h:17274
static __inline__ vector signed char __ATTRS_o_ai vec_sldw(vector signed char __a, vector signed char __b, unsigned const int __c)
Definition altivec.h:9332
vector signed char unaligned_vec_schar __attribute__((aligned(1)))
Definition altivec.h:17750
static __inline__ vector short __ATTRS_o_ai vec_vslh(vector short __a, vector unsigned short __b)
Definition altivec.h:9023
static __inline__ __ATTRS_o_ai vector bool char vec_reve(vector bool char __a)
Definition altivec.h:17559
static __inline__ vector float vector float vector float __c
Definition altivec.h:4800
static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a, vector short __b)
Definition altivec.h:751
static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a, vector unsigned char __b, vector int __c)
Definition altivec.h:6059
static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a, vector signed char __b)
Definition altivec.h:6282
static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a, vector signed char __b)
Definition altivec.h:16671
static __inline__ vector signed char __ATTRS_o_ai vec_vaddubm(vector signed char __a, vector signed char __b)
Definition altivec.h:476
static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a)
Definition altivec.h:10375
static __inline__ vector float vector float __b
Definition altivec.h:578
static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a, const signed char *__b)
Definition altivec.h:4639
static vector float __ATTRS_o_ai vec_recipdiv(vector float __a, vector float __b)
Definition altivec.h:18327
static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a, vector short __b)
Definition altivec.h:12063
static __inline__ vector signed char __ATTRS_o_ai vec_ld(long __a, const vector signed char *__b)
Definition altivec.h:4061
static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a)
Definition altivec.h:8500
static __inline__ vector signed char __ATTRS_o_ai vec_vrlb(vector signed char __a, vector unsigned char __b)
Definition altivec.h:8465
static __inline__ vector signed int __ATTRS_o_ai vec_subc(vector signed int __a, vector signed int __b)
Definition altivec.h:12139
static __inline__ vector unsigned char __ATTRS_o_ai vec_vaddubs(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:735
static __inline__ vector signed char __ATTRS_o_ai vec_vpkuhum(vector signed short __a, vector signed short __b)
Definition altivec.h:7578
static __inline__ vector signed int __ATTRS_o_ai vec_addc(vector signed int __a, vector signed int __b)
Definition altivec.h:585
static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a, vector signed char __b)
Definition altivec.h:15408
static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a, vector short __b)
Definition altivec.h:5915
static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a)
Definition altivec.h:14768
static __inline__ vector short __ATTRS_o_ai vec_vupkhsb(vector signed char __a)
Definition altivec.h:12743
#define __CR6_LT
Definition altivec.h:20
static __inline__ vector bool char __ATTRS_o_ai vec_revb(vector bool char __a)
Definition altivec.h:17632
static __inline__ int __ATTRS_o_ai vec_any_nan(vector float __a)
Definition altivec.h:17051
static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a, vector signed char __b)
Definition altivec.h:14833
static __inline__ vector signed char __ATTRS_o_ai vec_andc(vector signed char __a, vector signed char __b)
Definition altivec.h:1235
static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a, const signed char *__b)
Definition altivec.h:4518
static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b, vector signed char *__c)
Definition altivec.h:11215
static __inline__ vector signed int __ATTRS_o_ai vec_sld(vector signed int, vector signed int, unsigned const int __c)
Definition altivec.h:9180
static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a, vector unsigned int __b)
Definition altivec.h:10545
static __inline__ vector short __ATTRS_o_ai vec_unpackl(vector signed char __a)
Definition altivec.h:12812
static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a, vector signed char __b)
Definition altivec.h:15786
static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a, vector int __b)
Definition altivec.h:12518
static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a)
Definition altivec.h:6173
static __inline__ vector signed char __ATTRS_o_ai vec_vandc(vector signed char __a, vector signed char __b)
Definition altivec.h:1421
static __inline__ vector signed char __ATTRS_o_ai vec_mul(vector signed char __a, vector signed char __b)
Definition altivec.h:6224
static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b, vector signed char *__c)
Definition altivec.h:11766
static __inline__ vector signed int __ATTRS_o_ai vec_signed(vector float __a)
Definition altivec.h:3495
static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b, vector signed char *__c)
Definition altivec.h:11635
static __inline__ vector signed char __ATTRS_o_ai vec_and(vector signed char __a, vector signed char __b)
Definition altivec.h:882
static __inline__ vector signed char __ATTRS_o_ai vec_avg(vector signed char __a, vector signed char __b)
Definition altivec.h:1586
static __inline__ vector signed char __ATTRS_o_ai vec_splat_s8(signed char __a)
Definition altivec.h:10351
static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a)
Definition altivec.h:15770
static __inline__ vector signed char __ATTRS_o_ai vec_mergel(vector signed char __a, vector signed char __b)
Definition altivec.h:5361
#define __CR6_SO
Definition altivec.h:24
static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a)
Definition altivec.h:10391
static __inline__ vector signed char __ATTRS_o_ai vec_subs(vector signed char __a, vector signed char __b)
Definition altivec.h:12180
static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a, vector int __b)
Definition altivec.h:5589
static __inline__ vector signed char __ATTRS_o_ai vec_vxor(vector signed char __a, vector signed char __b)
Definition altivec.h:13406
static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a, vector short __b)
Definition altivec.h:5553
static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a, vector float __b)
Definition altivec.h:16012
static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a)
Definition altivec.h:4026
static __inline__ vector signed char __ATTRS_o_ai vec_lvlx(int __a, const signed char *__b)
Definition altivec.h:13790
static __inline__ vector short __ATTRS_o_ai vec_vrlh(vector short __a, vector unsigned short __b)
Definition altivec.h:8477
static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a, vector unsigned int __b)
Definition altivec.h:8488
#define __CR6_LT_REV
Definition altivec.h:21
static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a, vector signed char __b)
Definition altivec.h:15221
static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a)
Definition altivec.h:10384
static __inline__ vector signed char __ATTRS_o_ai vec_vmrglb(vector signed char __a, vector signed char __b)
Definition altivec.h:5526
static __inline__ vector signed char __ATTRS_o_ai vec_adds(vector signed char __a, vector signed char __b)
Definition altivec.h:626
#define __ATTRS_o_ai
Definition altivec.h:46
static __inline__ vector unsigned short __ATTRS_o_ai vec_vsubuhs(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:12323
static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a, int __b)
Definition altivec.h:14679
static __inline__ vector unsigned short __ATTRS_o_ai vec_vmaxuh(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:5029
static __inline__ vector signed char __ATTRS_o_ai vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c)
Definition altivec.h:7993
static __inline__ vector unsigned char __ATTRS_o_ai vec_vminub(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:5899
static __inline__ vector signed char __ATTRS_o_ai vec_vsrab(vector signed char __a, vector unsigned char __b)
Definition altivec.h:10614
static __inline__ vector signed char __ATTRS_o_ai vec_vsububm(vector signed char __a, vector signed char __b)
Definition altivec.h:12030
static __inline__ vector signed short __ATTRS_o_ai vec_mladd(vector signed short, vector signed short, vector signed short)
static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:14213
static __inline__ vector signed char __ATTRS_o_ai vec_sel(vector signed char __a, vector signed char __b, vector unsigned char __c)
Definition altivec.h:8619
static __inline__ vector signed char __ATTRS_o_ai vec_lvxl(long __a, const vector signed char *__b)
Definition altivec.h:4402
static __inline__ vector signed char __ATTRS_o_ai vec_vmaxsb(vector signed char __a, vector signed char __b)
Definition altivec.h:4978
static __inline__ int __ATTRS_o_ai vec_any_numeric(vector float __a)
Definition altivec.h:17346
static __inline__ vector float __ATTRS_o_ai vec_float(vector signed int __a)
Definition altivec.h:3579
static __inline__ vector unsigned int __ATTRS_o_ai vec_splat_u32(signed char __a)
Definition altivec.h:10415
static __inline__ vector signed char __ATTRS_o_ai vec_mergeh(vector signed char __a, vector signed char __b)
Definition altivec.h:5091
static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a)
Definition altivec.h:12901
#define __CR6_EQ_REV
Definition altivec.h:19
static __inline__ vector signed char __ATTRS_o_ai vec_lvebx(long __a, const signed char *__b)
Definition altivec.h:4273
static __inline__ vector signed char __ATTRS_o_ai vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c)
Definition altivec.h:9405
static __inline__ vector signed char __ATTRS_o_ai vec_rl(vector signed char __a, vector unsigned char __b)
Definition altivec.h:8318
static __inline__ vector bool char __ATTRS_o_ai vec_cmplt(vector signed char __a, vector signed char __b)
Definition altivec.h:2435
static __inline__ vector unsigned int __ATTRS_o_ai vec_unsigned(vector float __a)
Definition altivec.h:3537
static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a, vector unsigned int __b)
Definition altivec.h:9036
static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, long __b, signed char *__c)
Definition altivec.h:11478
static __inline__ vector unsigned char __ATTRS_o_ai vec_vmaxub(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:4995
static __inline__ vector unsigned short __ATTRS_o_ai vec_vpkswus(vector int __a, vector int __b)
Definition altivec.h:7953
static __inline__ vector short __ATTRS_o_ai vec_vsrh(vector short __a, vector unsigned short __b)
Definition altivec.h:10532
static __inline__ vector signed char __ATTRS_o_ai vec_vmrghb(vector signed char __a, vector signed char __b)
Definition altivec.h:5263
static __inline__ vector float __ATTRS_o_ai vec_roundp(vector float __a)
Definition altivec.h:1674
static __inline__ vector signed char __ATTRS_o_ai vec_vnor(vector signed char __a, vector signed char __b)
Definition altivec.h:6823
static __inline__ vector signed char __ATTRS_o_ai vec_max(vector signed char __a, vector signed char __b)
Definition altivec.h:4838
static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a, vector signed char __b)
Definition altivec.h:15589
static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a, vector signed char __b)
Definition altivec.h:16291
static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, long __b, int *__c)
Definition altivec.h:11608
static __inline__ vector signed int __ATTRS_o_ai vec_adde(vector signed int __a, vector signed int __b, vector signed int __c)
Definition altivec.h:383
static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a, unsigned char __b)
Definition altivec.h:10309
static __inline__ vector signed char __ATTRS_o_ai vec_slo(vector signed char __a, vector signed char __b)
Definition altivec.h:9915
static __inline__ int __ATTRS_o_ai vec_all_numeric(vector float __a)
Definition altivec.h:16067
static __inline__ vector signed char __ATTRS_o_ai vec_nor(vector signed char __a, vector signed char __b)
Definition altivec.h:6760
#define vec_xl_be
Definition altivec.h:17914
static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a, vector int __b)
Definition altivec.h:7626
static __inline__ vector bool char __ATTRS_o_ai vec_cmpge(vector signed char __a, vector signed char __b)
Definition altivec.h:2243
static __inline__ vector signed char __ATTRS_o_ai vec_lvlxl(int __a, const signed char *__b)
Definition altivec.h:13896
static __inline__ vector signed char __ATTRS_o_ai vec_pack(vector signed short __a, vector signed short __b)
Definition altivec.h:7420
static __inline__ vector signed char __ATTRS_o_ai vec_ldl(long __a, const vector signed char *__b)
Definition altivec.h:4313
static __inline__ vector unsigned char __ATTRS_o_ai vec_packsu(vector short __a, vector short __b)
Definition altivec.h:7875
static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a, vector signed char __b)
Definition altivec.h:6440
static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a, vector float __b)
Definition altivec.h:15994
static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a, vector int __b)
Definition altivec.h:12097
static __inline__ vector signed char __ATTRS_o_ai vec_srl(vector signed char __a, vector unsigned char __b)
Definition altivec.h:10650
static vector float __ATTRS_o_ai vec_rsqrt(vector float __a)
Definition altivec.h:8586
static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a)
Definition altivec.h:8294
static __inline__ vector signed char __ATTRS_o_ai vec_min(vector signed char __a, vector signed char __b)
Definition altivec.h:5742
static __inline__ vector signed char __ATTRS_o_ai vec_vand(vector signed char __a, vector signed char __b)
Definition altivec.h:1068
static __inline__ vector signed char __ATTRS_o_ai vec_splat(vector signed char __a, unsigned const int __b)
Definition altivec.h:10121
static __inline__ vector unsigned char __ATTRS_o_ai vec_vpkshus(vector short __a, vector short __b)
Definition altivec.h:7933
static __inline__ vector unsigned int __ATTRS_o_ai vec_vminuw(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:5967
static __inline__ vector signed char __ATTRS_o_ai vec_lvrxl(int __a, const signed char *__b)
Definition altivec.h:14108
static vector float __ATTRS_o_ai vec_neg(vector float __a)
Definition altivec.h:18269
static vector float __ATTRS_o_ai vec_nabs(vector float __a)
Definition altivec.h:18298
static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a, vector signed char __b)
Definition altivec.h:6896
static __inline__ vector short __ATTRS_o_ai vec_unpackh(vector signed char __a)
Definition altivec.h:12673
static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a, vector short __b)
Definition altivec.h:5290
static __inline__ vector signed char __ATTRS_o_ai vec_vsr(vector signed char __a, vector unsigned char __b)
Definition altivec.h:10837
static __inline__ vector unsigned char __ATTRS_o_ai vec_sl(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:8913
static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a, vector short __b)
Definition altivec.h:509
static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a)
Definition altivec.h:10368
static __inline__ vector signed char __ATTRS_o_ai vec_vminsb(vector signed char __a, vector signed char __b)
Definition altivec.h:5882
static __inline__ vector signed char __ATTRS_o_ai vec_add(vector signed char __a, vector signed char __b)
Definition altivec.h:200
static __inline__ vector signed char __ATTRS_o_ai vec_vperm(vector signed char __a, vector signed char __b, vector unsigned char __c)
Definition altivec.h:8215
static __inline__ vector short __ATTRS_o_ai vec_lvehx(long __a, const short *__b)
Definition altivec.h:4284
static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, long __b, signed char *__c)
Definition altivec.h:11554
static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a, vector int __b)
Definition altivec.h:785
static __inline__ int __ATTRS_o_ai vec_any_nlt(vector float __a, vector float __b)
Definition altivec.h:17328
static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:14562
static __inline__ vector signed char __ATTRS_o_ai vec_abs(vector signed char __a)
Definition altivec.h:117
static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:14446
static __inline__ vector signed short __ATTRS_o_ai vec_madd(vector signed short __a, vector signed short __b, vector signed short __c)
Definition altivec.h:4756
static __inline__ vector signed char __ATTRS_o_ai vec_vsel(vector signed char __a, vector signed char __b, vector unsigned char __c)
Definition altivec.h:8793
static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a, vector signed char __b)
Definition altivec.h:16861
static __inline__ vector unsigned char __ATTRS_o_ai vec_xor(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:13238
static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a, vector int __b)
Definition altivec.h:5949
static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a, vector signed char __b)
Definition altivec.h:15041
static __inline__ vector float __ATTRS_o_ai vec_roundm(vector float __a)
Definition altivec.h:4041
static __inline__ vector unsigned int __ATTRS_o_ai vec_vadduws(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:803
static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a, vector int __b)
Definition altivec.h:5045
static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a)
Definition altivec.h:8572
static __inline__ int __ATTRS_o_ai vec_all_nle(vector float __a, vector float __b)
Definition altivec.h:16031
static __inline__ vector unsigned char __ATTRS_o_ai vec_vsububs(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:12289
static __inline__ vector unsigned short __ATTRS_o_ai vec_vminuh(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:5933
static __inline__ vector signed char __ATTRS_o_ai vec_vspltb(vector signed char __a, unsigned char __b)
Definition altivec.h:10251
static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a)
Definition altivec.h:12628
static __inline__ vector short __ATTRS_o_ai vec_vupklsb(vector signed char __a)
Definition altivec.h:12882
static __inline__ vector bool char __ATTRS_o_ai vec_cmpgt(vector signed char __a, vector signed char __b)
Definition altivec.h:2131
static __inline__ vector signed char __ATTRS_o_ai vec_insert(signed char __a, vector signed char __b, int __c)
Definition altivec.h:13699
static __inline__ vector signed char __ATTRS_o_ai vec_sll(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9555
static __inline__ vector signed char __ATTRS_o_ai vec_vsrb(vector signed char __a, vector unsigned char __b)
Definition altivec.h:10518
static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a, vector signed char __b)
Definition altivec.h:16481
static __inline__ vector signed char __ATTRS_o_ai vec_vsro(vector signed char __a, vector signed char __b)
Definition altivec.h:11126
static __inline__ vector bool char __ATTRS_o_ai vec_cmple(vector signed char __a, vector signed char __b)
Definition altivec.h:2369
static __inline__ vector signed char __ATTRS_o_ai vec_vsl(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9742
static __inline__ vector unsigned short __ATTRS_o_ai vec_splat_u16(signed char __a)
Definition altivec.h:10407
static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a, vector int __b)
Definition altivec.h:543
#define __CR6_EQ
Definition altivec.h:18
static __inline__ int __ATTRS_o_ai vec_all_nlt(vector float __a, vector float __b)
Definition altivec.h:16049
static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a, vector short __b)
Definition altivec.h:7746
static __inline__ vector signed char __ATTRS_o_ai vec_vspltisb(signed char __a)
Definition altivec.h:10359
static __inline__ vector signed char __ATTRS_o_ai vec_vslo(vector signed char __a, vector signed char __b)
Definition altivec.h:10031
static __inline__ vector signed char __ATTRS_o_ai vec_vaddsbs(vector signed char __a, vector signed char __b)
Definition altivec.h:718
static __inline__ vector signed char __ATTRS_o_ai vec_div(vector signed char __a, vector signed char __b)
Definition altivec.h:3784
static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a, vector short __b, vector int __c)
Definition altivec.h:6134
static __inline__ vector signed char __ATTRS_o_ai vec_vor(vector signed char __a, vector signed char __b)
Definition altivec.h:7252
static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a, vector signed char __b)
Definition altivec.h:16083
static __inline__ vector float __ATTRS_o_ai vec_roundz(vector float __a)
Definition altivec.h:12643
static __inline__ int __ATTRS_o_ai vec_any_nle(vector float __a, vector float __b)
Definition altivec.h:17310
static __inline__ vector signed char __ATTRS_o_ai vec_sub(vector signed char __a, vector signed char __b)
Definition altivec.h:11900
static __inline__ vector short __ATTRS_o_ai vec_vsrah(vector short __a, vector unsigned short __b)
Definition altivec.h:10626
static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a, vector float __b, vector float __c)
Definition altivec.h:6730
static __inline__ vector unsigned char __ATTRS_o_ai vec_splat_u8(unsigned char __a)
Definition altivec.h:10399
static __inline__ vector unsigned int __ATTRS_o_ai vec_vsubuws(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:12357
static __inline__ void int __a
Definition emmintrin.h:4086
constexpr bool aligned(uintptr_t Value)
Definition PrimType.h:217