ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
23/* Constants for vec_test_data_class */
24#define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
25#define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
26#define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
27 __VEC_CLASS_FP_SUBNORMAL_N)
28#define __VEC_CLASS_FP_ZERO_N (1<<2)
29#define __VEC_CLASS_FP_ZERO_P (1<<3)
30#define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
31 __VEC_CLASS_FP_ZERO_N)
32#define __VEC_CLASS_FP_INFINITY_N (1<<4)
33#define __VEC_CLASS_FP_INFINITY_P (1<<5)
34#define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
35 __VEC_CLASS_FP_INFINITY_N)
36#define __VEC_CLASS_FP_NAN (1<<6)
37#define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
38 __VEC_CLASS_FP_SUBNORMAL | \
39 __VEC_CLASS_FP_ZERO | \
40 __VEC_CLASS_FP_INFINITY)
41
42#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
43
44#ifdef __POWER9_VECTOR__
45#include <stddef.h>
46#endif
47
48static __inline__ vector signed char __ATTRS_o_ai vec_perm(
49 vector signed char __a, vector signed char __b, vector unsigned char __c);
50
51static __inline__ vector unsigned char __ATTRS_o_ai
52vec_perm(vector unsigned char __a, vector unsigned char __b,
53 vector unsigned char __c);
54
55static __inline__ vector bool char __ATTRS_o_ai
56vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
57
58static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
59 vector signed short __b,
60 vector unsigned char __c);
61
62static __inline__ vector unsigned short __ATTRS_o_ai
63vec_perm(vector unsigned short __a, vector unsigned short __b,
64 vector unsigned char __c);
65
66static __inline__ vector bool short __ATTRS_o_ai vec_perm(
67 vector bool short __a, vector bool short __b, vector unsigned char __c);
68
69static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
70 vector pixel __b,
71 vector unsigned char __c);
72
73static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
74 vector signed int __b,
75 vector unsigned char __c);
76
77static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
78 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
79
80static __inline__ vector bool int __ATTRS_o_ai
81vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
82
83static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
84 vector float __b,
85 vector unsigned char __c);
86
87#ifdef __VSX__
88static __inline__ vector long long __ATTRS_o_ai
89vec_perm(vector signed long long __a, vector signed long long __b,
90 vector unsigned char __c);
91
92static __inline__ vector unsigned long long __ATTRS_o_ai
93vec_perm(vector unsigned long long __a, vector unsigned long long __b,
94 vector unsigned char __c);
95
96static __inline__ vector bool long long __ATTRS_o_ai
97vec_perm(vector bool long long __a, vector bool long long __b,
98 vector unsigned char __c);
99
100static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
101 vector double __b,
102 vector unsigned char __c);
103#endif
104
105static __inline__ vector unsigned char __ATTRS_o_ai
106vec_xor(vector unsigned char __a, vector unsigned char __b);
107
108/* vec_abs */
109
110#define __builtin_altivec_abs_v16qi vec_abs
111#define __builtin_altivec_abs_v8hi vec_abs
112#define __builtin_altivec_abs_v4si vec_abs
113
114static __inline__ vector signed char __ATTRS_o_ai
115vec_abs(vector signed char __a) {
116 return __builtin_altivec_vmaxsb(__a, -__a);
117}
118
119static __inline__ vector signed short __ATTRS_o_ai
120vec_abs(vector signed short __a) {
121 return __builtin_altivec_vmaxsh(__a, -__a);
122}
123
124static __inline__ vector signed int __ATTRS_o_ai
125vec_abs(vector signed int __a) {
126 return __builtin_altivec_vmaxsw(__a, -__a);
127}
128
129#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
130static __inline__ vector signed long long __ATTRS_o_ai
131vec_abs(vector signed long long __a) {
132 return __builtin_altivec_vmaxsd(__a, -__a);
133}
134#endif
135
136static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
137#ifdef __VSX__
138 return __builtin_vsx_xvabssp(__a);
139#else
140 vector unsigned int __res =
141 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
142 return (vector float)__res;
143#endif
144}
145
146#ifdef __VSX__
147static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
148 return __builtin_vsx_xvabsdp(__a);
149}
150#endif
151
152/* vec_abss */
153#define __builtin_altivec_abss_v16qi vec_abss
154#define __builtin_altivec_abss_v8hi vec_abss
155#define __builtin_altivec_abss_v4si vec_abss
156
157static __inline__ vector signed char __ATTRS_o_ai
158vec_abss(vector signed char __a) {
159 return __builtin_altivec_vmaxsb(
160 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
161}
162
163static __inline__ vector signed short __ATTRS_o_ai
164vec_abss(vector signed short __a) {
165 return __builtin_altivec_vmaxsh(
166 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
167}
168
169static __inline__ vector signed int __ATTRS_o_ai
170vec_abss(vector signed int __a) {
171 return __builtin_altivec_vmaxsw(
172 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
173}
174
175/* vec_absd */
176#if defined(__POWER9_VECTOR__)
177
178static __inline__ vector unsigned char __ATTRS_o_ai
179vec_absd(vector unsigned char __a, vector unsigned char __b) {
180 return __builtin_altivec_vabsdub(__a, __b);
181}
182
183static __inline__ vector unsigned short __ATTRS_o_ai
184vec_absd(vector unsigned short __a, vector unsigned short __b) {
185 return __builtin_altivec_vabsduh(__a, __b);
186}
187
188static __inline__ vector unsigned int __ATTRS_o_ai
189vec_absd(vector unsigned int __a, vector unsigned int __b) {
190 return __builtin_altivec_vabsduw(__a, __b);
191}
192
193#endif /* End __POWER9_VECTOR__ */
194
195/* vec_add */
196
197static __inline__ vector signed char __ATTRS_o_ai
198vec_add(vector signed char __a, vector signed char __b) {
199 return __a + __b;
200}
201
202static __inline__ vector signed char __ATTRS_o_ai
203vec_add(vector bool char __a, vector signed char __b) {
204 return (vector signed char)__a + __b;
205}
206
207static __inline__ vector signed char __ATTRS_o_ai
208vec_add(vector signed char __a, vector bool char __b) {
209 return __a + (vector signed char)__b;
210}
211
212static __inline__ vector unsigned char __ATTRS_o_ai
213vec_add(vector unsigned char __a, vector unsigned char __b) {
214 return __a + __b;
215}
216
217static __inline__ vector unsigned char __ATTRS_o_ai
218vec_add(vector bool char __a, vector unsigned char __b) {
219 return (vector unsigned char)__a + __b;
220}
221
222static __inline__ vector unsigned char __ATTRS_o_ai
223vec_add(vector unsigned char __a, vector bool char __b) {
224 return __a + (vector unsigned char)__b;
225}
226
227static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
228 vector short __b) {
229 return __a + __b;
230}
231
232static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
233 vector short __b) {
234 return (vector short)__a + __b;
235}
236
237static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
238 vector bool short __b) {
239 return __a + (vector short)__b;
240}
241
242static __inline__ vector unsigned short __ATTRS_o_ai
243vec_add(vector unsigned short __a, vector unsigned short __b) {
244 return __a + __b;
245}
246
247static __inline__ vector unsigned short __ATTRS_o_ai
248vec_add(vector bool short __a, vector unsigned short __b) {
249 return (vector unsigned short)__a + __b;
250}
251
252static __inline__ vector unsigned short __ATTRS_o_ai
253vec_add(vector unsigned short __a, vector bool short __b) {
254 return __a + (vector unsigned short)__b;
255}
256
257static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
258 vector int __b) {
259 return __a + __b;
260}
261
262static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
263 vector int __b) {
264 return (vector int)__a + __b;
265}
266
267static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
268 vector bool int __b) {
269 return __a + (vector int)__b;
270}
271
272static __inline__ vector unsigned int __ATTRS_o_ai
273vec_add(vector unsigned int __a, vector unsigned int __b) {
274 return __a + __b;
275}
276
277static __inline__ vector unsigned int __ATTRS_o_ai
278vec_add(vector bool int __a, vector unsigned int __b) {
279 return (vector unsigned int)__a + __b;
280}
281
282static __inline__ vector unsigned int __ATTRS_o_ai
283vec_add(vector unsigned int __a, vector bool int __b) {
284 return __a + (vector unsigned int)__b;
285}
286
287#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
288static __inline__ vector signed long long __ATTRS_o_ai
289vec_add(vector signed long long __a, vector signed long long __b) {
290 return __a + __b;
291}
292
293static __inline__ vector unsigned long long __ATTRS_o_ai
294vec_add(vector unsigned long long __a, vector unsigned long long __b) {
295 return __a + __b;
296}
297
298static __inline__ vector signed __int128 __ATTRS_o_ai
299vec_add(vector signed __int128 __a, vector signed __int128 __b) {
300 return __a + __b;
301}
302
303static __inline__ vector unsigned __int128 __ATTRS_o_ai
304vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
305 return __a + __b;
306}
307#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
308
309static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
310 vector float __b) {
311 return __a + __b;
312}
313
314#ifdef __VSX__
315static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
316 vector double __b) {
317 return __a + __b;
318}
319#endif // __VSX__
320
321/* vec_adde */
322
323#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
324static __inline__ vector signed __int128 __ATTRS_o_ai
325vec_adde(vector signed __int128 __a, vector signed __int128 __b,
326 vector signed __int128 __c) {
327 return __builtin_altivec_vaddeuqm(__a, __b, __c);
328}
329
330static __inline__ vector unsigned __int128 __ATTRS_o_ai
331vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
332 vector unsigned __int128 __c) {
333 return __builtin_altivec_vaddeuqm(__a, __b, __c);
334}
335#endif
336
337static __inline__ vector signed int __ATTRS_o_ai
338vec_adde(vector signed int __a, vector signed int __b,
339 vector signed int __c) {
340 vector signed int __mask = {1, 1, 1, 1};
341 vector signed int __carry = __c & __mask;
342 return vec_add(vec_add(__a, __b), __carry);
343}
344
345static __inline__ vector unsigned int __ATTRS_o_ai
346vec_adde(vector unsigned int __a, vector unsigned int __b,
347 vector unsigned int __c) {
348 vector unsigned int __mask = {1, 1, 1, 1};
349 vector unsigned int __carry = __c & __mask;
350 return vec_add(vec_add(__a, __b), __carry);
351}
352
353/* vec_addec */
354
355#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
356static __inline__ vector signed __int128 __ATTRS_o_ai
357vec_addec(vector signed __int128 __a, vector signed __int128 __b,
358 vector signed __int128 __c) {
359 return __builtin_altivec_vaddecuq(__a, __b, __c);
360}
361
362static __inline__ vector unsigned __int128 __ATTRS_o_ai
363vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
364 vector unsigned __int128 __c) {
365 return __builtin_altivec_vaddecuq(__a, __b, __c);
366}
367
368static __inline__ vector signed int __ATTRS_o_ai
369vec_addec(vector signed int __a, vector signed int __b,
370 vector signed int __c) {
371
372 signed int __result[4];
373 for (int i = 0; i < 4; i++) {
374 unsigned int __tempa = (unsigned int) __a[i];
375 unsigned int __tempb = (unsigned int) __b[i];
376 unsigned int __tempc = (unsigned int) __c[i];
377 __tempc = __tempc & 0x00000001;
378 unsigned long long __longa = (unsigned long long) __tempa;
379 unsigned long long __longb = (unsigned long long) __tempb;
380 unsigned long long __longc = (unsigned long long) __tempc;
381 unsigned long long __sum = __longa + __longb + __longc;
382 unsigned long long __res = (__sum >> 32) & 0x01;
383 unsigned long long __tempres = (unsigned int) __res;
384 __result[i] = (signed int) __tempres;
385 }
386
387 vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
388 return ret;
389}
390
391static __inline__ vector unsigned int __ATTRS_o_ai
392vec_addec(vector unsigned int __a, vector unsigned int __b,
393 vector unsigned int __c) {
394
395 unsigned int __result[4];
396 for (int i = 0; i < 4; i++) {
397 unsigned int __tempc = __c[i] & 1;
398 unsigned long long __longa = (unsigned long long) __a[i];
399 unsigned long long __longb = (unsigned long long) __b[i];
400 unsigned long long __longc = (unsigned long long) __tempc;
401 unsigned long long __sum = __longa + __longb + __longc;
402 unsigned long long __res = (__sum >> 32) & 0x01;
403 unsigned long long __tempres = (unsigned int) __res;
404 __result[i] = (signed int) __tempres;
405 }
406
407 vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
408 return ret;
409}
410
411#endif
412
413/* vec_vaddubm */
414
415#define __builtin_altivec_vaddubm vec_vaddubm
416
417static __inline__ vector signed char __ATTRS_o_ai
418vec_vaddubm(vector signed char __a, vector signed char __b) {
419 return __a + __b;
420}
421
422static __inline__ vector signed char __ATTRS_o_ai
423vec_vaddubm(vector bool char __a, vector signed char __b) {
424 return (vector signed char)__a + __b;
425}
426
427static __inline__ vector signed char __ATTRS_o_ai
428vec_vaddubm(vector signed char __a, vector bool char __b) {
429 return __a + (vector signed char)__b;
430}
431
432static __inline__ vector unsigned char __ATTRS_o_ai
433vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
434 return __a + __b;
435}
436
437static __inline__ vector unsigned char __ATTRS_o_ai
438vec_vaddubm(vector bool char __a, vector unsigned char __b) {
439 return (vector unsigned char)__a + __b;
440}
441
442static __inline__ vector unsigned char __ATTRS_o_ai
443vec_vaddubm(vector unsigned char __a, vector bool char __b) {
444 return __a + (vector unsigned char)__b;
445}
446
447/* vec_vadduhm */
448
449#define __builtin_altivec_vadduhm vec_vadduhm
450
451static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
452 vector short __b) {
453 return __a + __b;
454}
455
456static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
457 vector short __b) {
458 return (vector short)__a + __b;
459}
460
461static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
462 vector bool short __b) {
463 return __a + (vector short)__b;
464}
465
466static __inline__ vector unsigned short __ATTRS_o_ai
467vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
468 return __a + __b;
469}
470
471static __inline__ vector unsigned short __ATTRS_o_ai
472vec_vadduhm(vector bool short __a, vector unsigned short __b) {
473 return (vector unsigned short)__a + __b;
474}
475
476static __inline__ vector unsigned short __ATTRS_o_ai
477vec_vadduhm(vector unsigned short __a, vector bool short __b) {
478 return __a + (vector unsigned short)__b;
479}
480
481/* vec_vadduwm */
482
483#define __builtin_altivec_vadduwm vec_vadduwm
484
485static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
486 vector int __b) {
487 return __a + __b;
488}
489
490static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
491 vector int __b) {
492 return (vector int)__a + __b;
493}
494
495static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
496 vector bool int __b) {
497 return __a + (vector int)__b;
498}
499
500static __inline__ vector unsigned int __ATTRS_o_ai
501vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
502 return __a + __b;
503}
504
505static __inline__ vector unsigned int __ATTRS_o_ai
506vec_vadduwm(vector bool int __a, vector unsigned int __b) {
507 return (vector unsigned int)__a + __b;
508}
509
510static __inline__ vector unsigned int __ATTRS_o_ai
511vec_vadduwm(vector unsigned int __a, vector bool int __b) {
512 return __a + (vector unsigned int)__b;
513}
514
515/* vec_vaddfp */
516
517#define __builtin_altivec_vaddfp vec_vaddfp
518
519static __inline__ vector float __attribute__((__always_inline__))
520vec_vaddfp(vector float __a, vector float __b) {
521 return __a + __b;
522}
523
524/* vec_addc */
525
526static __inline__ vector signed int __ATTRS_o_ai
527vec_addc(vector signed int __a, vector signed int __b) {
528 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
529 (vector unsigned int)__b);
530}
531
532static __inline__ vector unsigned int __ATTRS_o_ai
533vec_addc(vector unsigned int __a, vector unsigned int __b) {
534 return __builtin_altivec_vaddcuw(__a, __b);
535}
536
537#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
538static __inline__ vector signed __int128 __ATTRS_o_ai
539vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
540 return (vector signed __int128)__builtin_altivec_vaddcuq(
541 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
542}
543
544static __inline__ vector unsigned __int128 __ATTRS_o_ai
545vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
546 return __builtin_altivec_vaddcuq(__a, __b);
547}
548#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
549
550/* vec_vaddcuw */
551
552static __inline__ vector unsigned int __attribute__((__always_inline__))
553vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
554 return __builtin_altivec_vaddcuw(__a, __b);
555}
556
557/* vec_adds */
558
559static __inline__ vector signed char __ATTRS_o_ai
560vec_adds(vector signed char __a, vector signed char __b) {
561 return __builtin_altivec_vaddsbs(__a, __b);
562}
563
564static __inline__ vector signed char __ATTRS_o_ai
565vec_adds(vector bool char __a, vector signed char __b) {
566 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
567}
568
569static __inline__ vector signed char __ATTRS_o_ai
570vec_adds(vector signed char __a, vector bool char __b) {
571 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
572}
573
574static __inline__ vector unsigned char __ATTRS_o_ai
575vec_adds(vector unsigned char __a, vector unsigned char __b) {
576 return __builtin_altivec_vaddubs(__a, __b);
577}
578
579static __inline__ vector unsigned char __ATTRS_o_ai
580vec_adds(vector bool char __a, vector unsigned char __b) {
581 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
582}
583
584static __inline__ vector unsigned char __ATTRS_o_ai
585vec_adds(vector unsigned char __a, vector bool char __b) {
586 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
587}
588
589static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
590 vector short __b) {
591 return __builtin_altivec_vaddshs(__a, __b);
592}
593
594static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
595 vector short __b) {
596 return __builtin_altivec_vaddshs((vector short)__a, __b);
597}
598
599static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
600 vector bool short __b) {
601 return __builtin_altivec_vaddshs(__a, (vector short)__b);
602}
603
604static __inline__ vector unsigned short __ATTRS_o_ai
605vec_adds(vector unsigned short __a, vector unsigned short __b) {
606 return __builtin_altivec_vadduhs(__a, __b);
607}
608
609static __inline__ vector unsigned short __ATTRS_o_ai
610vec_adds(vector bool short __a, vector unsigned short __b) {
611 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
612}
613
614static __inline__ vector unsigned short __ATTRS_o_ai
615vec_adds(vector unsigned short __a, vector bool short __b) {
616 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
617}
618
619static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
620 vector int __b) {
621 return __builtin_altivec_vaddsws(__a, __b);
622}
623
624static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
625 vector int __b) {
626 return __builtin_altivec_vaddsws((vector int)__a, __b);
627}
628
629static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
630 vector bool int __b) {
631 return __builtin_altivec_vaddsws(__a, (vector int)__b);
632}
633
634static __inline__ vector unsigned int __ATTRS_o_ai
635vec_adds(vector unsigned int __a, vector unsigned int __b) {
636 return __builtin_altivec_vadduws(__a, __b);
637}
638
639static __inline__ vector unsigned int __ATTRS_o_ai
640vec_adds(vector bool int __a, vector unsigned int __b) {
641 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
642}
643
644static __inline__ vector unsigned int __ATTRS_o_ai
645vec_adds(vector unsigned int __a, vector bool int __b) {
646 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
647}
648
649/* vec_vaddsbs */
650
651static __inline__ vector signed char __ATTRS_o_ai
652vec_vaddsbs(vector signed char __a, vector signed char __b) {
653 return __builtin_altivec_vaddsbs(__a, __b);
654}
655
656static __inline__ vector signed char __ATTRS_o_ai
657vec_vaddsbs(vector bool char __a, vector signed char __b) {
658 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
659}
660
661static __inline__ vector signed char __ATTRS_o_ai
662vec_vaddsbs(vector signed char __a, vector bool char __b) {
663 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
664}
665
666/* vec_vaddubs */
667
668static __inline__ vector unsigned char __ATTRS_o_ai
669vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
670 return __builtin_altivec_vaddubs(__a, __b);
671}
672
673static __inline__ vector unsigned char __ATTRS_o_ai
674vec_vaddubs(vector bool char __a, vector unsigned char __b) {
675 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
676}
677
678static __inline__ vector unsigned char __ATTRS_o_ai
679vec_vaddubs(vector unsigned char __a, vector bool char __b) {
680 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
681}
682
683/* vec_vaddshs */
684
685static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
686 vector short __b) {
687 return __builtin_altivec_vaddshs(__a, __b);
688}
689
690static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
691 vector short __b) {
692 return __builtin_altivec_vaddshs((vector short)__a, __b);
693}
694
695static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
696 vector bool short __b) {
697 return __builtin_altivec_vaddshs(__a, (vector short)__b);
698}
699
700/* vec_vadduhs */
701
702static __inline__ vector unsigned short __ATTRS_o_ai
703vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
704 return __builtin_altivec_vadduhs(__a, __b);
705}
706
707static __inline__ vector unsigned short __ATTRS_o_ai
708vec_vadduhs(vector bool short __a, vector unsigned short __b) {
709 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
710}
711
712static __inline__ vector unsigned short __ATTRS_o_ai
713vec_vadduhs(vector unsigned short __a, vector bool short __b) {
714 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
715}
716
717/* vec_vaddsws */
718
719static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
720 vector int __b) {
721 return __builtin_altivec_vaddsws(__a, __b);
722}
723
724static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
725 vector int __b) {
726 return __builtin_altivec_vaddsws((vector int)__a, __b);
727}
728
729static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
730 vector bool int __b) {
731 return __builtin_altivec_vaddsws(__a, (vector int)__b);
732}
733
734/* vec_vadduws */
735
736static __inline__ vector unsigned int __ATTRS_o_ai
737vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
738 return __builtin_altivec_vadduws(__a, __b);
739}
740
741static __inline__ vector unsigned int __ATTRS_o_ai
742vec_vadduws(vector bool int __a, vector unsigned int __b) {
743 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
744}
745
746static __inline__ vector unsigned int __ATTRS_o_ai
747vec_vadduws(vector unsigned int __a, vector bool int __b) {
748 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
749}
750
751#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
752/* vec_vadduqm */
753
754static __inline__ vector signed __int128 __ATTRS_o_ai
755vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
756 return __a + __b;
757}
758
759static __inline__ vector unsigned __int128 __ATTRS_o_ai
760vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
761 return __a + __b;
762}
763
764/* vec_vaddeuqm */
765
766static __inline__ vector signed __int128 __ATTRS_o_ai
767vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
768 vector signed __int128 __c) {
769 return __builtin_altivec_vaddeuqm(__a, __b, __c);
770}
771
772static __inline__ vector unsigned __int128 __ATTRS_o_ai
773vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
774 vector unsigned __int128 __c) {
775 return __builtin_altivec_vaddeuqm(__a, __b, __c);
776}
777
778/* vec_vaddcuq */
779
780static __inline__ vector signed __int128 __ATTRS_o_ai
781vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
782 return __builtin_altivec_vaddcuq(__a, __b);
783}
784
785static __inline__ vector unsigned __int128 __ATTRS_o_ai
786vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
787 return __builtin_altivec_vaddcuq(__a, __b);
788}
789
790/* vec_vaddecuq */
791
792static __inline__ vector signed __int128 __ATTRS_o_ai
793vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
794 vector signed __int128 __c) {
795 return __builtin_altivec_vaddecuq(__a, __b, __c);
796}
797
798static __inline__ vector unsigned __int128 __ATTRS_o_ai
799vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
800 vector unsigned __int128 __c) {
801 return __builtin_altivec_vaddecuq(__a, __b, __c);
802}
803#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
804
805/* vec_and */
806
807#define __builtin_altivec_vand vec_and
808
809static __inline__ vector signed char __ATTRS_o_ai
810vec_and(vector signed char __a, vector signed char __b) {
811 return __a & __b;
812}
813
814static __inline__ vector signed char __ATTRS_o_ai
815vec_and(vector bool char __a, vector signed char __b) {
816 return (vector signed char)__a & __b;
817}
818
819static __inline__ vector signed char __ATTRS_o_ai
820vec_and(vector signed char __a, vector bool char __b) {
821 return __a & (vector signed char)__b;
822}
823
824static __inline__ vector unsigned char __ATTRS_o_ai
825vec_and(vector unsigned char __a, vector unsigned char __b) {
826 return __a & __b;
827}
828
829static __inline__ vector unsigned char __ATTRS_o_ai
830vec_and(vector bool char __a, vector unsigned char __b) {
831 return (vector unsigned char)__a & __b;
832}
833
834static __inline__ vector unsigned char __ATTRS_o_ai
835vec_and(vector unsigned char __a, vector bool char __b) {
836 return __a & (vector unsigned char)__b;
837}
838
839static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
840 vector bool char __b) {
841 return __a & __b;
842}
843
844static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
845 vector short __b) {
846 return __a & __b;
847}
848
849static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
850 vector short __b) {
851 return (vector short)__a & __b;
852}
853
854static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
855 vector bool short __b) {
856 return __a & (vector short)__b;
857}
858
859static __inline__ vector unsigned short __ATTRS_o_ai
860vec_and(vector unsigned short __a, vector unsigned short __b) {
861 return __a & __b;
862}
863
864static __inline__ vector unsigned short __ATTRS_o_ai
865vec_and(vector bool short __a, vector unsigned short __b) {
866 return (vector unsigned short)__a & __b;
867}
868
869static __inline__ vector unsigned short __ATTRS_o_ai
870vec_and(vector unsigned short __a, vector bool short __b) {
871 return __a & (vector unsigned short)__b;
872}
873
874static __inline__ vector bool short __ATTRS_o_ai
875vec_and(vector bool short __a, vector bool short __b) {
876 return __a & __b;
877}
878
879static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
880 vector int __b) {
881 return __a & __b;
882}
883
884static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
885 vector int __b) {
886 return (vector int)__a & __b;
887}
888
889static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
890 vector bool int __b) {
891 return __a & (vector int)__b;
892}
893
894static __inline__ vector unsigned int __ATTRS_o_ai
895vec_and(vector unsigned int __a, vector unsigned int __b) {
896 return __a & __b;
897}
898
899static __inline__ vector unsigned int __ATTRS_o_ai
900vec_and(vector bool int __a, vector unsigned int __b) {
901 return (vector unsigned int)__a & __b;
902}
903
904static __inline__ vector unsigned int __ATTRS_o_ai
905vec_and(vector unsigned int __a, vector bool int __b) {
906 return __a & (vector unsigned int)__b;
907}
908
909static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
910 vector bool int __b) {
911 return __a & __b;
912}
913
914static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
915 vector float __b) {
916 vector unsigned int __res =
917 (vector unsigned int)__a & (vector unsigned int)__b;
918 return (vector float)__res;
919}
920
921static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
922 vector float __b) {
923 vector unsigned int __res =
924 (vector unsigned int)__a & (vector unsigned int)__b;
925 return (vector float)__res;
926}
927
928static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
929 vector bool int __b) {
930 vector unsigned int __res =
931 (vector unsigned int)__a & (vector unsigned int)__b;
932 return (vector float)__res;
933}
934
935#ifdef __VSX__
936static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
937 vector double __b) {
938 vector unsigned long long __res =
939 (vector unsigned long long)__a & (vector unsigned long long)__b;
940 return (vector double)__res;
941}
942
943static __inline__ vector double __ATTRS_o_ai
944vec_and(vector double __a, vector bool long long __b) {
945 vector unsigned long long __res =
946 (vector unsigned long long)__a & (vector unsigned long long)__b;
947 return (vector double)__res;
948}
949
950static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
951 vector double __b) {
952 vector unsigned long long __res =
953 (vector unsigned long long)__a & (vector unsigned long long)__b;
954 return (vector double)__res;
955}
956
957static __inline__ vector signed long long __ATTRS_o_ai
958vec_and(vector signed long long __a, vector signed long long __b) {
959 return __a & __b;
960}
961
962static __inline__ vector signed long long __ATTRS_o_ai
963vec_and(vector bool long long __a, vector signed long long __b) {
964 return (vector signed long long)__a & __b;
965}
966
967static __inline__ vector signed long long __ATTRS_o_ai
968vec_and(vector signed long long __a, vector bool long long __b) {
969 return __a & (vector signed long long)__b;
970}
971
972static __inline__ vector unsigned long long __ATTRS_o_ai
973vec_and(vector unsigned long long __a, vector unsigned long long __b) {
974 return __a & __b;
975}
976
977static __inline__ vector unsigned long long __ATTRS_o_ai
978vec_and(vector bool long long __a, vector unsigned long long __b) {
979 return (vector unsigned long long)__a & __b;
980}
981
982static __inline__ vector unsigned long long __ATTRS_o_ai
983vec_and(vector unsigned long long __a, vector bool long long __b) {
984 return __a & (vector unsigned long long)__b;
985}
986
987static __inline__ vector bool long long __ATTRS_o_ai
988vec_and(vector bool long long __a, vector bool long long __b) {
989 return __a & __b;
990}
991#endif
992
993/* vec_vand */
994
995static __inline__ vector signed char __ATTRS_o_ai
996vec_vand(vector signed char __a, vector signed char __b) {
997 return __a & __b;
998}
999
1000static __inline__ vector signed char __ATTRS_o_ai
1001vec_vand(vector bool char __a, vector signed char __b) {
1002 return (vector signed char)__a & __b;
1003}
1004
1005static __inline__ vector signed char __ATTRS_o_ai
1006vec_vand(vector signed char __a, vector bool char __b) {
1007 return __a & (vector signed char)__b;
1008}
1009
1010static __inline__ vector unsigned char __ATTRS_o_ai
1011vec_vand(vector unsigned char __a, vector unsigned char __b) {
1012 return __a & __b;
1013}
1014
1015static __inline__ vector unsigned char __ATTRS_o_ai
1016vec_vand(vector bool char __a, vector unsigned char __b) {
1017 return (vector unsigned char)__a & __b;
1018}
1019
1020static __inline__ vector unsigned char __ATTRS_o_ai
1021vec_vand(vector unsigned char __a, vector bool char __b) {
1022 return __a & (vector unsigned char)__b;
1023}
1024
1025static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1026 vector bool char __b) {
1027 return __a & __b;
1028}
1029
1030static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1031 vector short __b) {
1032 return __a & __b;
1033}
1034
1035static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1036 vector short __b) {
1037 return (vector short)__a & __b;
1038}
1039
1040static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1041 vector bool short __b) {
1042 return __a & (vector short)__b;
1043}
1044
1045static __inline__ vector unsigned short __ATTRS_o_ai
1046vec_vand(vector unsigned short __a, vector unsigned short __b) {
1047 return __a & __b;
1048}
1049
1050static __inline__ vector unsigned short __ATTRS_o_ai
1051vec_vand(vector bool short __a, vector unsigned short __b) {
1052 return (vector unsigned short)__a & __b;
1053}
1054
1055static __inline__ vector unsigned short __ATTRS_o_ai
1056vec_vand(vector unsigned short __a, vector bool short __b) {
1057 return __a & (vector unsigned short)__b;
1058}
1059
1060static __inline__ vector bool short __ATTRS_o_ai
1061vec_vand(vector bool short __a, vector bool short __b) {
1062 return __a & __b;
1063}
1064
1065static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1066 vector int __b) {
1067 return __a & __b;
1068}
1069
1070static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1071 vector int __b) {
1072 return (vector int)__a & __b;
1073}
1074
1075static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1076 vector bool int __b) {
1077 return __a & (vector int)__b;
1078}
1079
1080static __inline__ vector unsigned int __ATTRS_o_ai
1081vec_vand(vector unsigned int __a, vector unsigned int __b) {
1082 return __a & __b;
1083}
1084
1085static __inline__ vector unsigned int __ATTRS_o_ai
1086vec_vand(vector bool int __a, vector unsigned int __b) {
1087 return (vector unsigned int)__a & __b;
1088}
1089
1090static __inline__ vector unsigned int __ATTRS_o_ai
1091vec_vand(vector unsigned int __a, vector bool int __b) {
1092 return __a & (vector unsigned int)__b;
1093}
1094
1095static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1096 vector bool int __b) {
1097 return __a & __b;
1098}
1099
1100static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1101 vector float __b) {
1102 vector unsigned int __res =
1103 (vector unsigned int)__a & (vector unsigned int)__b;
1104 return (vector float)__res;
1105}
1106
1107static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1108 vector float __b) {
1109 vector unsigned int __res =
1110 (vector unsigned int)__a & (vector unsigned int)__b;
1111 return (vector float)__res;
1112}
1113
1114static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1115 vector bool int __b) {
1116 vector unsigned int __res =
1117 (vector unsigned int)__a & (vector unsigned int)__b;
1118 return (vector float)__res;
1119}
1120
1121#ifdef __VSX__
1122static __inline__ vector signed long long __ATTRS_o_ai
1123vec_vand(vector signed long long __a, vector signed long long __b) {
1124 return __a & __b;
1125}
1126
1127static __inline__ vector signed long long __ATTRS_o_ai
1128vec_vand(vector bool long long __a, vector signed long long __b) {
1129 return (vector signed long long)__a & __b;
1130}
1131
1132static __inline__ vector signed long long __ATTRS_o_ai
1133vec_vand(vector signed long long __a, vector bool long long __b) {
1134 return __a & (vector signed long long)__b;
1135}
1136
1137static __inline__ vector unsigned long long __ATTRS_o_ai
1138vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1139 return __a & __b;
1140}
1141
1142static __inline__ vector unsigned long long __ATTRS_o_ai
1143vec_vand(vector bool long long __a, vector unsigned long long __b) {
1144 return (vector unsigned long long)__a & __b;
1145}
1146
1147static __inline__ vector unsigned long long __ATTRS_o_ai
1148vec_vand(vector unsigned long long __a, vector bool long long __b) {
1149 return __a & (vector unsigned long long)__b;
1150}
1151
1152static __inline__ vector bool long long __ATTRS_o_ai
1153vec_vand(vector bool long long __a, vector bool long long __b) {
1154 return __a & __b;
1155}
1156#endif
1157
1158/* vec_andc */
1159
1160#define __builtin_altivec_vandc vec_andc
1161
1162static __inline__ vector signed char __ATTRS_o_ai
1163vec_andc(vector signed char __a, vector signed char __b) {
1164 return __a & ~__b;
1165}
1166
1167static __inline__ vector signed char __ATTRS_o_ai
1168vec_andc(vector bool char __a, vector signed char __b) {
1169 return (vector signed char)__a & ~__b;
1170}
1171
1172static __inline__ vector signed char __ATTRS_o_ai
1173vec_andc(vector signed char __a, vector bool char __b) {
1174 return __a & ~(vector signed char)__b;
1175}
1176
1177static __inline__ vector unsigned char __ATTRS_o_ai
1178vec_andc(vector unsigned char __a, vector unsigned char __b) {
1179 return __a & ~__b;
1180}
1181
1182static __inline__ vector unsigned char __ATTRS_o_ai
1183vec_andc(vector bool char __a, vector unsigned char __b) {
1184 return (vector unsigned char)__a & ~__b;
1185}
1186
1187static __inline__ vector unsigned char __ATTRS_o_ai
1188vec_andc(vector unsigned char __a, vector bool char __b) {
1189 return __a & ~(vector unsigned char)__b;
1190}
1191
1192static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1193 vector bool char __b) {
1194 return __a & ~__b;
1195}
1196
1197static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1198 vector short __b) {
1199 return __a & ~__b;
1200}
1201
1202static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1203 vector short __b) {
1204 return (vector short)__a & ~__b;
1205}
1206
1207static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1208 vector bool short __b) {
1209 return __a & ~(vector short)__b;
1210}
1211
1212static __inline__ vector unsigned short __ATTRS_o_ai
1213vec_andc(vector unsigned short __a, vector unsigned short __b) {
1214 return __a & ~__b;
1215}
1216
1217static __inline__ vector unsigned short __ATTRS_o_ai
1218vec_andc(vector bool short __a, vector unsigned short __b) {
1219 return (vector unsigned short)__a & ~__b;
1220}
1221
1222static __inline__ vector unsigned short __ATTRS_o_ai
1223vec_andc(vector unsigned short __a, vector bool short __b) {
1224 return __a & ~(vector unsigned short)__b;
1225}
1226
1227static __inline__ vector bool short __ATTRS_o_ai
1228vec_andc(vector bool short __a, vector bool short __b) {
1229 return __a & ~__b;
1230}
1231
1232static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1233 vector int __b) {
1234 return __a & ~__b;
1235}
1236
1237static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1238 vector int __b) {
1239 return (vector int)__a & ~__b;
1240}
1241
1242static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1243 vector bool int __b) {
1244 return __a & ~(vector int)__b;
1245}
1246
1247static __inline__ vector unsigned int __ATTRS_o_ai
1248vec_andc(vector unsigned int __a, vector unsigned int __b) {
1249 return __a & ~__b;
1250}
1251
1252static __inline__ vector unsigned int __ATTRS_o_ai
1253vec_andc(vector bool int __a, vector unsigned int __b) {
1254 return (vector unsigned int)__a & ~__b;
1255}
1256
1257static __inline__ vector unsigned int __ATTRS_o_ai
1258vec_andc(vector unsigned int __a, vector bool int __b) {
1259 return __a & ~(vector unsigned int)__b;
1260}
1261
1262static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1263 vector bool int __b) {
1264 return __a & ~__b;
1265}
1266
1267static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1268 vector float __b) {
1269 vector unsigned int __res =
1270 (vector unsigned int)__a & ~(vector unsigned int)__b;
1271 return (vector float)__res;
1272}
1273
1274static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1275 vector float __b) {
1276 vector unsigned int __res =
1277 (vector unsigned int)__a & ~(vector unsigned int)__b;
1278 return (vector float)__res;
1279}
1280
1281static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1282 vector bool int __b) {
1283 vector unsigned int __res =
1284 (vector unsigned int)__a & ~(vector unsigned int)__b;
1285 return (vector float)__res;
1286}
1287
1288#ifdef __VSX__
1289static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1290 vector double __b) {
1291 vector unsigned long long __res =
1292 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1293 return (vector double)__res;
1294}
1295
1296static __inline__ vector double __ATTRS_o_ai
1297vec_andc(vector double __a, vector bool long long __b) {
1298 vector unsigned long long __res =
1299 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1300 return (vector double)__res;
1301}
1302
1303static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1304 vector double __b) {
1305 vector unsigned long long __res =
1306 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1307 return (vector double)__res;
1308}
1309
1310static __inline__ vector signed long long __ATTRS_o_ai
1311vec_andc(vector signed long long __a, vector signed long long __b) {
1312 return __a & ~__b;
1313}
1314
1315static __inline__ vector signed long long __ATTRS_o_ai
1316vec_andc(vector bool long long __a, vector signed long long __b) {
1317 return (vector signed long long)__a & ~__b;
1318}
1319
1320static __inline__ vector signed long long __ATTRS_o_ai
1321vec_andc(vector signed long long __a, vector bool long long __b) {
1322 return __a & ~(vector signed long long)__b;
1323}
1324
1325static __inline__ vector unsigned long long __ATTRS_o_ai
1326vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1327 return __a & ~__b;
1328}
1329
1330static __inline__ vector unsigned long long __ATTRS_o_ai
1331vec_andc(vector bool long long __a, vector unsigned long long __b) {
1332 return (vector unsigned long long)__a & ~__b;
1333}
1334
1335static __inline__ vector unsigned long long __ATTRS_o_ai
1336vec_andc(vector unsigned long long __a, vector bool long long __b) {
1337 return __a & ~(vector unsigned long long)__b;
1338}
1339
1340static __inline__ vector bool long long __ATTRS_o_ai
1341vec_andc(vector bool long long __a, vector bool long long __b) {
1342 return __a & ~__b;
1343}
1344#endif
1345
1346/* vec_vandc */
1347
1348static __inline__ vector signed char __ATTRS_o_ai
1349vec_vandc(vector signed char __a, vector signed char __b) {
1350 return __a & ~__b;
1351}
1352
1353static __inline__ vector signed char __ATTRS_o_ai
1354vec_vandc(vector bool char __a, vector signed char __b) {
1355 return (vector signed char)__a & ~__b;
1356}
1357
1358static __inline__ vector signed char __ATTRS_o_ai
1359vec_vandc(vector signed char __a, vector bool char __b) {
1360 return __a & ~(vector signed char)__b;
1361}
1362
1363static __inline__ vector unsigned char __ATTRS_o_ai
1364vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1365 return __a & ~__b;
1366}
1367
1368static __inline__ vector unsigned char __ATTRS_o_ai
1369vec_vandc(vector bool char __a, vector unsigned char __b) {
1370 return (vector unsigned char)__a & ~__b;
1371}
1372
1373static __inline__ vector unsigned char __ATTRS_o_ai
1374vec_vandc(vector unsigned char __a, vector bool char __b) {
1375 return __a & ~(vector unsigned char)__b;
1376}
1377
1378static __inline__ vector bool char __ATTRS_o_ai
1379vec_vandc(vector bool char __a, vector bool char __b) {
1380 return __a & ~__b;
1381}
1382
1383static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1384 vector short __b) {
1385 return __a & ~__b;
1386}
1387
1388static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1389 vector short __b) {
1390 return (vector short)__a & ~__b;
1391}
1392
1393static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1394 vector bool short __b) {
1395 return __a & ~(vector short)__b;
1396}
1397
1398static __inline__ vector unsigned short __ATTRS_o_ai
1399vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1400 return __a & ~__b;
1401}
1402
1403static __inline__ vector unsigned short __ATTRS_o_ai
1404vec_vandc(vector bool short __a, vector unsigned short __b) {
1405 return (vector unsigned short)__a & ~__b;
1406}
1407
1408static __inline__ vector unsigned short __ATTRS_o_ai
1409vec_vandc(vector unsigned short __a, vector bool short __b) {
1410 return __a & ~(vector unsigned short)__b;
1411}
1412
1413static __inline__ vector bool short __ATTRS_o_ai
1414vec_vandc(vector bool short __a, vector bool short __b) {
1415 return __a & ~__b;
1416}
1417
1418static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1419 vector int __b) {
1420 return __a & ~__b;
1421}
1422
1423static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1424 vector int __b) {
1425 return (vector int)__a & ~__b;
1426}
1427
1428static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1429 vector bool int __b) {
1430 return __a & ~(vector int)__b;
1431}
1432
1433static __inline__ vector unsigned int __ATTRS_o_ai
1434vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1435 return __a & ~__b;
1436}
1437
1438static __inline__ vector unsigned int __ATTRS_o_ai
1439vec_vandc(vector bool int __a, vector unsigned int __b) {
1440 return (vector unsigned int)__a & ~__b;
1441}
1442
1443static __inline__ vector unsigned int __ATTRS_o_ai
1444vec_vandc(vector unsigned int __a, vector bool int __b) {
1445 return __a & ~(vector unsigned int)__b;
1446}
1447
1448static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1449 vector bool int __b) {
1450 return __a & ~__b;
1451}
1452
1453static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1454 vector float __b) {
1455 vector unsigned int __res =
1456 (vector unsigned int)__a & ~(vector unsigned int)__b;
1457 return (vector float)__res;
1458}
1459
1460static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1461 vector float __b) {
1462 vector unsigned int __res =
1463 (vector unsigned int)__a & ~(vector unsigned int)__b;
1464 return (vector float)__res;
1465}
1466
1467static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1468 vector bool int __b) {
1469 vector unsigned int __res =
1470 (vector unsigned int)__a & ~(vector unsigned int)__b;
1471 return (vector float)__res;
1472}
1473
1474#ifdef __VSX__
1475static __inline__ vector signed long long __ATTRS_o_ai
1476vec_vandc(vector signed long long __a, vector signed long long __b) {
1477 return __a & ~__b;
1478}
1479
1480static __inline__ vector signed long long __ATTRS_o_ai
1481vec_vandc(vector bool long long __a, vector signed long long __b) {
1482 return (vector signed long long)__a & ~__b;
1483}
1484
1485static __inline__ vector signed long long __ATTRS_o_ai
1486vec_vandc(vector signed long long __a, vector bool long long __b) {
1487 return __a & ~(vector signed long long)__b;
1488}
1489
1490static __inline__ vector unsigned long long __ATTRS_o_ai
1491vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1492 return __a & ~__b;
1493}
1494
1495static __inline__ vector unsigned long long __ATTRS_o_ai
1496vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1497 return (vector unsigned long long)__a & ~__b;
1498}
1499
1500static __inline__ vector unsigned long long __ATTRS_o_ai
1501vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1502 return __a & ~(vector unsigned long long)__b;
1503}
1504
1505static __inline__ vector bool long long __ATTRS_o_ai
1506vec_vandc(vector bool long long __a, vector bool long long __b) {
1507 return __a & ~__b;
1508}
1509#endif
1510
1511/* vec_avg */
1512
1513static __inline__ vector signed char __ATTRS_o_ai
1514vec_avg(vector signed char __a, vector signed char __b) {
1515 return __builtin_altivec_vavgsb(__a, __b);
1516}
1517
1518static __inline__ vector unsigned char __ATTRS_o_ai
1519vec_avg(vector unsigned char __a, vector unsigned char __b) {
1520 return __builtin_altivec_vavgub(__a, __b);
1521}
1522
1523static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1524 vector short __b) {
1525 return __builtin_altivec_vavgsh(__a, __b);
1526}
1527
1528static __inline__ vector unsigned short __ATTRS_o_ai
1529vec_avg(vector unsigned short __a, vector unsigned short __b) {
1530 return __builtin_altivec_vavguh(__a, __b);
1531}
1532
1533static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1534 vector int __b) {
1535 return __builtin_altivec_vavgsw(__a, __b);
1536}
1537
1538static __inline__ vector unsigned int __ATTRS_o_ai
1539vec_avg(vector unsigned int __a, vector unsigned int __b) {
1540 return __builtin_altivec_vavguw(__a, __b);
1541}
1542
1543/* vec_vavgsb */
1544
1545static __inline__ vector signed char __attribute__((__always_inline__))
1546vec_vavgsb(vector signed char __a, vector signed char __b) {
1547 return __builtin_altivec_vavgsb(__a, __b);
1548}
1549
1550/* vec_vavgub */
1551
1552static __inline__ vector unsigned char __attribute__((__always_inline__))
1553vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1554 return __builtin_altivec_vavgub(__a, __b);
1555}
1556
1557/* vec_vavgsh */
1558
1559static __inline__ vector short __attribute__((__always_inline__))
1560vec_vavgsh(vector short __a, vector short __b) {
1561 return __builtin_altivec_vavgsh(__a, __b);
1562}
1563
1564/* vec_vavguh */
1565
1566static __inline__ vector unsigned short __attribute__((__always_inline__))
1567vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1568 return __builtin_altivec_vavguh(__a, __b);
1569}
1570
1571/* vec_vavgsw */
1572
1573static __inline__ vector int __attribute__((__always_inline__))
1574vec_vavgsw(vector int __a, vector int __b) {
1575 return __builtin_altivec_vavgsw(__a, __b);
1576}
1577
1578/* vec_vavguw */
1579
1580static __inline__ vector unsigned int __attribute__((__always_inline__))
1581vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1582 return __builtin_altivec_vavguw(__a, __b);
1583}
1584
1585/* vec_ceil */
1586
1587static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1588#ifdef __VSX__
1589 return __builtin_vsx_xvrspip(__a);
1590#else
1591 return __builtin_altivec_vrfip(__a);
1592#endif
1593}
1594
1595#ifdef __VSX__
1596static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1597 return __builtin_vsx_xvrdpip(__a);
1598}
1599#endif
1600
1601/* vec_vrfip */
1602
1603static __inline__ vector float __attribute__((__always_inline__))
1604vec_vrfip(vector float __a) {
1605 return __builtin_altivec_vrfip(__a);
1606}
1607
1608/* vec_cmpb */
1609
1610static __inline__ vector int __attribute__((__always_inline__))
1611vec_cmpb(vector float __a, vector float __b) {
1612 return __builtin_altivec_vcmpbfp(__a, __b);
1613}
1614
1615/* vec_vcmpbfp */
1616
1617static __inline__ vector int __attribute__((__always_inline__))
1618vec_vcmpbfp(vector float __a, vector float __b) {
1619 return __builtin_altivec_vcmpbfp(__a, __b);
1620}
1621
1622/* vec_cmpeq */
1623
1624static __inline__ vector bool char __ATTRS_o_ai
1625vec_cmpeq(vector signed char __a, vector signed char __b) {
1626 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1627 (vector char)__b);
1628}
1629
1630static __inline__ vector bool char __ATTRS_o_ai
1631vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1632 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1633 (vector char)__b);
1634}
1635
1636static __inline__ vector bool char __ATTRS_o_ai
1637vec_cmpeq(vector bool char __a, vector bool char __b) {
1638 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1639 (vector char)__b);
1640}
1641
1642static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1643 vector short __b) {
1644 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1645}
1646
1647static __inline__ vector bool short __ATTRS_o_ai
1648vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1649 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1650 (vector short)__b);
1651}
1652
1653static __inline__ vector bool short __ATTRS_o_ai
1654vec_cmpeq(vector bool short __a, vector bool short __b) {
1655 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1656 (vector short)__b);
1657}
1658
1659static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1660 vector int __b) {
1661 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1662}
1663
1664static __inline__ vector bool int __ATTRS_o_ai
1665vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1666 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1667 (vector int)__b);
1668}
1669
1670static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
1671 vector bool int __b) {
1672 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1673 (vector int)__b);
1674}
1675
1676#ifdef __POWER8_VECTOR__
1677static __inline__ vector bool long long __ATTRS_o_ai
1678vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1679 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1680}
1681
1682static __inline__ vector bool long long __ATTRS_o_ai
1683vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1684 return (vector bool long long)__builtin_altivec_vcmpequd(
1685 (vector long long)__a, (vector long long)__b);
1686}
1687
1688static __inline__ vector bool long long __ATTRS_o_ai
1689vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1690 return (vector bool long long)__builtin_altivec_vcmpequd(
1691 (vector long long)__a, (vector long long)__b);
1692}
1693
1694#endif
1695
1696static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1697 vector float __b) {
1698#ifdef __VSX__
1699 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1700#else
1701 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1702#endif
1703}
1704
1705#ifdef __VSX__
1706static __inline__ vector bool long long __ATTRS_o_ai
1707vec_cmpeq(vector double __a, vector double __b) {
1708 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1709}
1710#endif
1711
1712#ifdef __POWER9_VECTOR__
1713/* vec_cmpne */
1714
1715static __inline__ vector bool char __ATTRS_o_ai
1716vec_cmpne(vector bool char __a, vector bool char __b) {
1717 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1718 (vector char)__b);
1719}
1720
1721static __inline__ vector bool char __ATTRS_o_ai
1722vec_cmpne(vector signed char __a, vector signed char __b) {
1723 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1724 (vector char)__b);
1725}
1726
1727static __inline__ vector bool char __ATTRS_o_ai
1728vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1729 return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1730 (vector char)__b);
1731}
1732
1733static __inline__ vector bool short __ATTRS_o_ai
1734vec_cmpne(vector bool short __a, vector bool short __b) {
1735 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1736 (vector short)__b);
1737}
1738
1739static __inline__ vector bool short __ATTRS_o_ai
1740vec_cmpne(vector signed short __a, vector signed short __b) {
1741 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1742 (vector short)__b);
1743}
1744
1745static __inline__ vector bool short __ATTRS_o_ai
1746vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1747 return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1748 (vector short)__b);
1749}
1750
1751static __inline__ vector bool int __ATTRS_o_ai
1752vec_cmpne(vector bool int __a, vector bool int __b) {
1753 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1754 (vector int)__b);
1755}
1756
1757static __inline__ vector bool int __ATTRS_o_ai
1758vec_cmpne(vector signed int __a, vector signed int __b) {
1759 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1760 (vector int)__b);
1761}
1762
1763static __inline__ vector bool int __ATTRS_o_ai
1764vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1765 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1766 (vector int)__b);
1767}
1768
1769static __inline__ vector bool int __ATTRS_o_ai
1770vec_cmpne(vector float __a, vector float __b) {
1771 return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1772 (vector int)__b);
1773}
1774
1775/* vec_cmpnez */
1776
1777static __inline__ vector bool char __ATTRS_o_ai
1778vec_cmpnez(vector signed char __a, vector signed char __b) {
1779 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1780 (vector char)__b);
1781}
1782
1783static __inline__ vector bool char __ATTRS_o_ai
1784vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1785 return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1786 (vector char)__b);
1787}
1788
1789static __inline__ vector bool short __ATTRS_o_ai
1790vec_cmpnez(vector signed short __a, vector signed short __b) {
1791 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1792 (vector short)__b);
1793}
1794
1795static __inline__ vector bool short __ATTRS_o_ai
1796vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1797 return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1798 (vector short)__b);
1799}
1800
1801static __inline__ vector bool int __ATTRS_o_ai
1802vec_cmpnez(vector signed int __a, vector signed int __b) {
1803 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1804 (vector int)__b);
1805}
1806
1807static __inline__ vector bool int __ATTRS_o_ai
1808vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1809 return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1810 (vector int)__b);
1811}
1812
1813static __inline__ signed int __ATTRS_o_ai
1814vec_cntlz_lsbb(vector signed char __a) {
1815#ifdef __LITTLE_ENDIAN__
1816 return __builtin_altivec_vctzlsbb(__a);
1817#else
1818 return __builtin_altivec_vclzlsbb(__a);
1819#endif
1820}
1821
1822static __inline__ signed int __ATTRS_o_ai
1823vec_cntlz_lsbb(vector unsigned char __a) {
1824#ifdef __LITTLE_ENDIAN__
1825 return __builtin_altivec_vctzlsbb(__a);
1826#else
1827 return __builtin_altivec_vclzlsbb(__a);
1828#endif
1829}
1830
1831static __inline__ signed int __ATTRS_o_ai
1832vec_cnttz_lsbb(vector signed char __a) {
1833#ifdef __LITTLE_ENDIAN__
1834 return __builtin_altivec_vclzlsbb(__a);
1835#else
1836 return __builtin_altivec_vctzlsbb(__a);
1837#endif
1838}
1839
1840static __inline__ signed int __ATTRS_o_ai
1841vec_cnttz_lsbb(vector unsigned char __a) {
1842#ifdef __LITTLE_ENDIAN__
1843 return __builtin_altivec_vclzlsbb(__a);
1844#else
1845 return __builtin_altivec_vctzlsbb(__a);
1846#endif
1847}
1848
1849static __inline__ vector unsigned int __ATTRS_o_ai
1850vec_parity_lsbb(vector unsigned int __a) {
1851 return __builtin_altivec_vprtybw(__a);
1852}
1853
1854static __inline__ vector unsigned int __ATTRS_o_ai
1855vec_parity_lsbb(vector signed int __a) {
1856 return __builtin_altivec_vprtybw(__a);
1857}
1858
1859static __inline__ vector unsigned __int128 __ATTRS_o_ai
1860vec_parity_lsbb(vector unsigned __int128 __a) {
1861 return __builtin_altivec_vprtybq(__a);
1862}
1863
1864static __inline__ vector unsigned __int128 __ATTRS_o_ai
1865vec_parity_lsbb(vector signed __int128 __a) {
1866 return __builtin_altivec_vprtybq(__a);
1867}
1868
1869static __inline__ vector unsigned long long __ATTRS_o_ai
1870vec_parity_lsbb(vector unsigned long long __a) {
1871 return __builtin_altivec_vprtybd(__a);
1872}
1873
1874static __inline__ vector unsigned long long __ATTRS_o_ai
1875vec_parity_lsbb(vector signed long long __a) {
1876 return __builtin_altivec_vprtybd(__a);
1877}
1878
1879#else
1880/* vec_cmpne */
1881
1882static __inline__ vector bool char __ATTRS_o_ai
1883vec_cmpne(vector bool char __a, vector bool char __b) {
1884 return ~(vec_cmpeq(__a, __b));
1885}
1886
1887static __inline__ vector bool char __ATTRS_o_ai
1888vec_cmpne(vector signed char __a, vector signed char __b) {
1889 return ~(vec_cmpeq(__a, __b));
1890}
1891
1892static __inline__ vector bool char __ATTRS_o_ai
1893vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1894 return ~(vec_cmpeq(__a, __b));
1895}
1896
1897static __inline__ vector bool short __ATTRS_o_ai
1898vec_cmpne(vector bool short __a, vector bool short __b) {
1899 return ~(vec_cmpeq(__a, __b));
1900}
1901
1902static __inline__ vector bool short __ATTRS_o_ai
1903vec_cmpne(vector signed short __a, vector signed short __b) {
1904 return ~(vec_cmpeq(__a, __b));
1905}
1906
1907static __inline__ vector bool short __ATTRS_o_ai
1908vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1909 return ~(vec_cmpeq(__a, __b));
1910}
1911
1912static __inline__ vector bool int __ATTRS_o_ai
1913vec_cmpne(vector bool int __a, vector bool int __b) {
1914 return ~(vec_cmpeq(__a, __b));
1915}
1916
1917static __inline__ vector bool int __ATTRS_o_ai
1918vec_cmpne(vector signed int __a, vector signed int __b) {
1919 return ~(vec_cmpeq(__a, __b));
1920}
1921
1922static __inline__ vector bool int __ATTRS_o_ai
1923vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1924 return ~(vec_cmpeq(__a, __b));
1925}
1926
1927static __inline__ vector bool int __ATTRS_o_ai
1928vec_cmpne(vector float __a, vector float __b) {
1929 return ~(vec_cmpeq(__a, __b));
1930}
1931#endif
1932
1933#ifdef __POWER8_VECTOR__
1934static __inline__ vector bool long long __ATTRS_o_ai
1935vec_cmpne(vector bool long long __a, vector bool long long __b) {
1936 return (vector bool long long)
1937 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1938}
1939
1940static __inline__ vector bool long long __ATTRS_o_ai
1941vec_cmpne(vector signed long long __a, vector signed long long __b) {
1942 return (vector bool long long)
1943 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1944}
1945
1946static __inline__ vector bool long long __ATTRS_o_ai
1947vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1948 return (vector bool long long)
1949 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1950}
1951#endif
1952
1953#ifdef __VSX__
1954static __inline__ vector bool long long __ATTRS_o_ai
1955vec_cmpne(vector double __a, vector double __b) {
1956 return (vector bool long long)
1957 ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1958}
1959#endif
1960
1961/* vec_cmpgt */
1962
1963static __inline__ vector bool char __ATTRS_o_ai
1964vec_cmpgt(vector signed char __a, vector signed char __b) {
1965 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1966}
1967
1968static __inline__ vector bool char __ATTRS_o_ai
1969vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1970 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1971}
1972
1973static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1974 vector short __b) {
1975 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1976}
1977
1978static __inline__ vector bool short __ATTRS_o_ai
1979vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1980 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1981}
1982
1983static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1984 vector int __b) {
1985 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1986}
1987
1988static __inline__ vector bool int __ATTRS_o_ai
1989vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1990 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1991}
1992
1993#ifdef __POWER8_VECTOR__
1994static __inline__ vector bool long long __ATTRS_o_ai
1995vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1996 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1997}
1998
1999static __inline__ vector bool long long __ATTRS_o_ai
2000vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
2001 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
2002}
2003#endif
2004
2005static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
2006 vector float __b) {
2007#ifdef __VSX__
2008 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
2009#else
2010 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2011#endif
2012}
2013
2014#ifdef __VSX__
2015static __inline__ vector bool long long __ATTRS_o_ai
2016vec_cmpgt(vector double __a, vector double __b) {
2017 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
2018}
2019#endif
2020
2021/* vec_cmpge */
2022
2023static __inline__ vector bool char __ATTRS_o_ai
2024vec_cmpge(vector signed char __a, vector signed char __b) {
2025 return ~(vec_cmpgt(__b, __a));
2026}
2027
2028static __inline__ vector bool char __ATTRS_o_ai
2029vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
2030 return ~(vec_cmpgt(__b, __a));
2031}
2032
2033static __inline__ vector bool short __ATTRS_o_ai
2034vec_cmpge(vector signed short __a, vector signed short __b) {
2035 return ~(vec_cmpgt(__b, __a));
2036}
2037
2038static __inline__ vector bool short __ATTRS_o_ai
2039vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
2040 return ~(vec_cmpgt(__b, __a));
2041}
2042
2043static __inline__ vector bool int __ATTRS_o_ai
2044vec_cmpge(vector signed int __a, vector signed int __b) {
2045 return ~(vec_cmpgt(__b, __a));
2046}
2047
2048static __inline__ vector bool int __ATTRS_o_ai
2049vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
2050 return ~(vec_cmpgt(__b, __a));
2051}
2052
2053static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
2054 vector float __b) {
2055#ifdef __VSX__
2056 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2057#else
2058 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2059#endif
2060}
2061
2062#ifdef __VSX__
2063static __inline__ vector bool long long __ATTRS_o_ai
2064vec_cmpge(vector double __a, vector double __b) {
2065 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2066}
2067#endif
2068
2069#ifdef __POWER8_VECTOR__
2070static __inline__ vector bool long long __ATTRS_o_ai
2071vec_cmpge(vector signed long long __a, vector signed long long __b) {
2072 return ~(vec_cmpgt(__b, __a));
2073}
2074
2075static __inline__ vector bool long long __ATTRS_o_ai
2076vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2077 return ~(vec_cmpgt(__b, __a));
2078}
2079#endif
2080
2081/* vec_vcmpgefp */
2082
2083static __inline__ vector bool int __attribute__((__always_inline__))
2084vec_vcmpgefp(vector float __a, vector float __b) {
2085 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2086}
2087
2088/* vec_vcmpgtsb */
2089
2090static __inline__ vector bool char __attribute__((__always_inline__))
2091vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2092 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2093}
2094
2095/* vec_vcmpgtub */
2096
2097static __inline__ vector bool char __attribute__((__always_inline__))
2098vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2099 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2100}
2101
2102/* vec_vcmpgtsh */
2103
2104static __inline__ vector bool short __attribute__((__always_inline__))
2105vec_vcmpgtsh(vector short __a, vector short __b) {
2106 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2107}
2108
2109/* vec_vcmpgtuh */
2110
2111static __inline__ vector bool short __attribute__((__always_inline__))
2112vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2113 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2114}
2115
2116/* vec_vcmpgtsw */
2117
2118static __inline__ vector bool int __attribute__((__always_inline__))
2119vec_vcmpgtsw(vector int __a, vector int __b) {
2120 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2121}
2122
2123/* vec_vcmpgtuw */
2124
2125static __inline__ vector bool int __attribute__((__always_inline__))
2126vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2127 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2128}
2129
2130/* vec_vcmpgtfp */
2131
2132static __inline__ vector bool int __attribute__((__always_inline__))
2133vec_vcmpgtfp(vector float __a, vector float __b) {
2134 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2135}
2136
2137/* vec_cmple */
2138
2139static __inline__ vector bool char __ATTRS_o_ai
2140vec_cmple(vector signed char __a, vector signed char __b) {
2141 return vec_cmpge(__b, __a);
2142}
2143
2144static __inline__ vector bool char __ATTRS_o_ai
2145vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2146 return vec_cmpge(__b, __a);
2147}
2148
2149static __inline__ vector bool short __ATTRS_o_ai
2150vec_cmple(vector signed short __a, vector signed short __b) {
2151 return vec_cmpge(__b, __a);
2152}
2153
2154static __inline__ vector bool short __ATTRS_o_ai
2155vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2156 return vec_cmpge(__b, __a);
2157}
2158
2159static __inline__ vector bool int __ATTRS_o_ai
2160vec_cmple(vector signed int __a, vector signed int __b) {
2161 return vec_cmpge(__b, __a);
2162}
2163
2164static __inline__ vector bool int __ATTRS_o_ai
2165vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2166 return vec_cmpge(__b, __a);
2167}
2168
2169static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2170 vector float __b) {
2171 return vec_cmpge(__b, __a);
2172}
2173
2174#ifdef __VSX__
2175static __inline__ vector bool long long __ATTRS_o_ai
2176vec_cmple(vector double __a, vector double __b) {
2177 return vec_cmpge(__b, __a);
2178}
2179#endif
2180
2181#ifdef __POWER8_VECTOR__
2182static __inline__ vector bool long long __ATTRS_o_ai
2183vec_cmple(vector signed long long __a, vector signed long long __b) {
2184 return vec_cmpge(__b, __a);
2185}
2186
2187static __inline__ vector bool long long __ATTRS_o_ai
2188vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2189 return vec_cmpge(__b, __a);
2190}
2191#endif
2192
2193/* vec_cmplt */
2194
2195static __inline__ vector bool char __ATTRS_o_ai
2196vec_cmplt(vector signed char __a, vector signed char __b) {
2197 return vec_cmpgt(__b, __a);
2198}
2199
2200static __inline__ vector bool char __ATTRS_o_ai
2201vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2202 return vec_cmpgt(__b, __a);
2203}
2204
2205static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2206 vector short __b) {
2207 return vec_cmpgt(__b, __a);
2208}
2209
2210static __inline__ vector bool short __ATTRS_o_ai
2211vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2212 return vec_cmpgt(__b, __a);
2213}
2214
2215static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2216 vector int __b) {
2217 return vec_cmpgt(__b, __a);
2218}
2219
2220static __inline__ vector bool int __ATTRS_o_ai
2221vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2222 return vec_cmpgt(__b, __a);
2223}
2224
2225static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2226 vector float __b) {
2227 return vec_cmpgt(__b, __a);
2228}
2229
2230#ifdef __VSX__
2231static __inline__ vector bool long long __ATTRS_o_ai
2232vec_cmplt(vector double __a, vector double __b) {
2233 return vec_cmpgt(__b, __a);
2234}
2235#endif
2236
2237#ifdef __POWER8_VECTOR__
2238static __inline__ vector bool long long __ATTRS_o_ai
2239vec_cmplt(vector signed long long __a, vector signed long long __b) {
2240 return vec_cmpgt(__b, __a);
2241}
2242
2243static __inline__ vector bool long long __ATTRS_o_ai
2244vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2245 return vec_cmpgt(__b, __a);
2246}
2247
2248/* vec_popcnt */
2249
2250static __inline__ vector signed char __ATTRS_o_ai
2251vec_popcnt(vector signed char __a) {
2252 return __builtin_altivec_vpopcntb(__a);
2253}
2254static __inline__ vector unsigned char __ATTRS_o_ai
2255vec_popcnt(vector unsigned char __a) {
2256 return __builtin_altivec_vpopcntb(__a);
2257}
2258static __inline__ vector signed short __ATTRS_o_ai
2259vec_popcnt(vector signed short __a) {
2260 return __builtin_altivec_vpopcnth(__a);
2261}
2262static __inline__ vector unsigned short __ATTRS_o_ai
2263vec_popcnt(vector unsigned short __a) {
2264 return __builtin_altivec_vpopcnth(__a);
2265}
2266static __inline__ vector signed int __ATTRS_o_ai
2267vec_popcnt(vector signed int __a) {
2268 return __builtin_altivec_vpopcntw(__a);
2269}
2270static __inline__ vector unsigned int __ATTRS_o_ai
2271vec_popcnt(vector unsigned int __a) {
2272 return __builtin_altivec_vpopcntw(__a);
2273}
2274static __inline__ vector signed long long __ATTRS_o_ai
2275vec_popcnt(vector signed long long __a) {
2276 return __builtin_altivec_vpopcntd(__a);
2277}
2278static __inline__ vector unsigned long long __ATTRS_o_ai
2279vec_popcnt(vector unsigned long long __a) {
2280 return __builtin_altivec_vpopcntd(__a);
2281}
2282
2283/* vec_cntlz */
2284
2285static __inline__ vector signed char __ATTRS_o_ai
2286vec_cntlz(vector signed char __a) {
2287 return __builtin_altivec_vclzb(__a);
2288}
2289static __inline__ vector unsigned char __ATTRS_o_ai
2290vec_cntlz(vector unsigned char __a) {
2291 return __builtin_altivec_vclzb(__a);
2292}
2293static __inline__ vector signed short __ATTRS_o_ai
2294vec_cntlz(vector signed short __a) {
2295 return __builtin_altivec_vclzh(__a);
2296}
2297static __inline__ vector unsigned short __ATTRS_o_ai
2298vec_cntlz(vector unsigned short __a) {
2299 return __builtin_altivec_vclzh(__a);
2300}
2301static __inline__ vector signed int __ATTRS_o_ai
2302vec_cntlz(vector signed int __a) {
2303 return __builtin_altivec_vclzw(__a);
2304}
2305static __inline__ vector unsigned int __ATTRS_o_ai
2306vec_cntlz(vector unsigned int __a) {
2307 return __builtin_altivec_vclzw(__a);
2308}
2309static __inline__ vector signed long long __ATTRS_o_ai
2310vec_cntlz(vector signed long long __a) {
2311 return __builtin_altivec_vclzd(__a);
2312}
2313static __inline__ vector unsigned long long __ATTRS_o_ai
2314vec_cntlz(vector unsigned long long __a) {
2315 return __builtin_altivec_vclzd(__a);
2316}
2317#endif
2318
2319#ifdef __POWER9_VECTOR__
2320
2321/* vec_cnttz */
2322
2323static __inline__ vector signed char __ATTRS_o_ai
2324vec_cnttz(vector signed char __a) {
2325 return __builtin_altivec_vctzb(__a);
2326}
2327static __inline__ vector unsigned char __ATTRS_o_ai
2328vec_cnttz(vector unsigned char __a) {
2329 return __builtin_altivec_vctzb(__a);
2330}
2331static __inline__ vector signed short __ATTRS_o_ai
2332vec_cnttz(vector signed short __a) {
2333 return __builtin_altivec_vctzh(__a);
2334}
2335static __inline__ vector unsigned short __ATTRS_o_ai
2336vec_cnttz(vector unsigned short __a) {
2337 return __builtin_altivec_vctzh(__a);
2338}
2339static __inline__ vector signed int __ATTRS_o_ai
2340vec_cnttz(vector signed int __a) {
2341 return __builtin_altivec_vctzw(__a);
2342}
2343static __inline__ vector unsigned int __ATTRS_o_ai
2344vec_cnttz(vector unsigned int __a) {
2345 return __builtin_altivec_vctzw(__a);
2346}
2347static __inline__ vector signed long long __ATTRS_o_ai
2348vec_cnttz(vector signed long long __a) {
2349 return __builtin_altivec_vctzd(__a);
2350}
2351static __inline__ vector unsigned long long __ATTRS_o_ai
2352vec_cnttz(vector unsigned long long __a) {
2353 return __builtin_altivec_vctzd(__a);
2354}
2355
2356/* vec_first_match_index */
2357
2358static __inline__ unsigned __ATTRS_o_ai
2359vec_first_match_index(vector signed char __a, vector signed char __b) {
2360 vector unsigned long long __res =
2361#ifdef __LITTLE_ENDIAN__
2362 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2363#else
2364 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2365#endif
2366 if (__res[0] == 64) {
2367 return (__res[1] + 64) >> 3;
2368 }
2369 return __res[0] >> 3;
2370}
2371
2372static __inline__ unsigned __ATTRS_o_ai
2373vec_first_match_index(vector unsigned char __a, vector unsigned char __b) {
2374 vector unsigned long long __res =
2375#ifdef __LITTLE_ENDIAN__
2376 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2377#else
2378 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2379#endif
2380 if (__res[0] == 64) {
2381 return (__res[1] + 64) >> 3;
2382 }
2383 return __res[0] >> 3;
2384}
2385
2386static __inline__ unsigned __ATTRS_o_ai
2387vec_first_match_index(vector signed short __a, vector signed short __b) {
2388 vector unsigned long long __res =
2389#ifdef __LITTLE_ENDIAN__
2390 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2391#else
2392 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2393#endif
2394 if (__res[0] == 64) {
2395 return (__res[1] + 64) >> 4;
2396 }
2397 return __res[0] >> 4;
2398}
2399
2400static __inline__ unsigned __ATTRS_o_ai
2401vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {
2402 vector unsigned long long __res =
2403#ifdef __LITTLE_ENDIAN__
2404 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2405#else
2406 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2407#endif
2408 if (__res[0] == 64) {
2409 return (__res[1] + 64) >> 4;
2410 }
2411 return __res[0] >> 4;
2412}
2413
2414static __inline__ unsigned __ATTRS_o_ai
2415vec_first_match_index(vector signed int __a, vector signed int __b) {
2416 vector unsigned long long __res =
2417#ifdef __LITTLE_ENDIAN__
2418 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2419#else
2420 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2421#endif
2422 if (__res[0] == 64) {
2423 return (__res[1] + 64) >> 5;
2424 }
2425 return __res[0] >> 5;
2426}
2427
2428static __inline__ unsigned __ATTRS_o_ai
2429vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {
2430 vector unsigned long long __res =
2431#ifdef __LITTLE_ENDIAN__
2432 vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2433#else
2434 vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2435#endif
2436 if (__res[0] == 64) {
2437 return (__res[1] + 64) >> 5;
2438 }
2439 return __res[0] >> 5;
2440}
2441
2442/* vec_first_match_or_eos_index */
2443
2444static __inline__ unsigned __ATTRS_o_ai
2445vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2446 /* Compare the result of the comparison of two vectors with either and OR the
2447 result. Either the elements are equal or one will equal the comparison
2448 result if either is zero.
2449 */
2450 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2451 vector bool char __tmp2 = __tmp1 |
2452 vec_cmpeq((vector signed char)__tmp1, __a) |
2453 vec_cmpeq((vector signed char)__tmp1, __b);
2454
2455 vector unsigned long long __res =
2456#ifdef __LITTLE_ENDIAN__
2457 vec_cnttz((vector unsigned long long)__tmp2);
2458#else
2459 vec_cntlz((vector unsigned long long)__tmp2);
2460#endif
2461 if (__res[0] == 64) {
2462 return (__res[1] + 64) >> 3;
2463 }
2464 return __res[0] >> 3;
2465}
2466
2467static __inline__ unsigned __ATTRS_o_ai
2468vec_first_match_or_eos_index(vector unsigned char __a,
2469 vector unsigned char __b) {
2470 vector bool char __tmp1 = vec_cmpeq(__a, __b);
2471 vector bool char __tmp2 = __tmp1 |
2472 vec_cmpeq((vector unsigned char)__tmp1, __a) |
2473 vec_cmpeq((vector unsigned char)__tmp1, __b);
2474
2475 vector unsigned long long __res =
2476#ifdef __LITTLE_ENDIAN__
2477 vec_cnttz((vector unsigned long long)__tmp2);
2478#else
2479 vec_cntlz((vector unsigned long long)__tmp2);
2480#endif
2481 if (__res[0] == 64) {
2482 return (__res[1] + 64) >> 3;
2483 }
2484 return __res[0] >> 3;
2485}
2486
2487static __inline__ unsigned __ATTRS_o_ai
2488vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2489 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2490 vector bool short __tmp2 = __tmp1 |
2491 vec_cmpeq((vector signed short)__tmp1, __a) |
2492 vec_cmpeq((vector signed short)__tmp1, __b);
2493
2494 vector unsigned long long __res =
2495#ifdef __LITTLE_ENDIAN__
2496 vec_cnttz((vector unsigned long long)__tmp2);
2497#else
2498 vec_cntlz((vector unsigned long long)__tmp2);
2499#endif
2500 if (__res[0] == 64) {
2501 return (__res[1] + 64) >> 4;
2502 }
2503 return __res[0] >> 4;
2504}
2505
2506static __inline__ unsigned __ATTRS_o_ai
2507vec_first_match_or_eos_index(vector unsigned short __a,
2508 vector unsigned short __b) {
2509 vector bool short __tmp1 = vec_cmpeq(__a, __b);
2510 vector bool short __tmp2 = __tmp1 |
2511 vec_cmpeq((vector unsigned short)__tmp1, __a) |
2512 vec_cmpeq((vector unsigned short)__tmp1, __b);
2513
2514 vector unsigned long long __res =
2515#ifdef __LITTLE_ENDIAN__
2516 vec_cnttz((vector unsigned long long)__tmp2);
2517#else
2518 vec_cntlz((vector unsigned long long)__tmp2);
2519#endif
2520 if (__res[0] == 64) {
2521 return (__res[1] + 64) >> 4;
2522 }
2523 return __res[0] >> 4;
2524}
2525
2526static __inline__ unsigned __ATTRS_o_ai
2527vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2528 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2529 vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2530 vec_cmpeq((vector signed int)__tmp1, __b);
2531
2532 vector unsigned long long __res =
2533#ifdef __LITTLE_ENDIAN__
2534 vec_cnttz((vector unsigned long long)__tmp2);
2535#else
2536 vec_cntlz((vector unsigned long long)__tmp2);
2537#endif
2538 if (__res[0] == 64) {
2539 return (__res[1] + 64) >> 5;
2540 }
2541 return __res[0] >> 5;
2542}
2543
2544static __inline__ unsigned __ATTRS_o_ai
2545vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2546 vector bool int __tmp1 = vec_cmpeq(__a, __b);
2547 vector bool int __tmp2 = __tmp1 |
2548 vec_cmpeq((vector unsigned int)__tmp1, __a) |
2549 vec_cmpeq((vector unsigned int)__tmp1, __b);
2550
2551 vector unsigned long long __res =
2552#ifdef __LITTLE_ENDIAN__
2553 vec_cnttz((vector unsigned long long)__tmp2);
2554#else
2555 vec_cntlz((vector unsigned long long)__tmp2);
2556#endif
2557 if (__res[0] == 64) {
2558 return (__res[1] + 64) >> 5;
2559 }
2560 return __res[0] >> 5;
2561}
2562
2563/* vec_first_mismatch_index */
2564
2565static __inline__ unsigned __ATTRS_o_ai
2566vec_first_mismatch_index(vector signed char __a, vector signed char __b) {
2567 vector unsigned long long __res =
2568#ifdef __LITTLE_ENDIAN__
2569 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2570#else
2571 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2572#endif
2573 if (__res[0] == 64) {
2574 return (__res[1] + 64) >> 3;
2575 }
2576 return __res[0] >> 3;
2577}
2578
2579static __inline__ unsigned __ATTRS_o_ai
2580vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __b) {
2581 vector unsigned long long __res =
2582#ifdef __LITTLE_ENDIAN__
2583 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2584#else
2585 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2586#endif
2587 if (__res[0] == 64) {
2588 return (__res[1] + 64) >> 3;
2589 }
2590 return __res[0] >> 3;
2591}
2592
2593static __inline__ unsigned __ATTRS_o_ai
2594vec_first_mismatch_index(vector signed short __a, vector signed short __b) {
2595 vector unsigned long long __res =
2596#ifdef __LITTLE_ENDIAN__
2597 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2598#else
2599 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2600#endif
2601 if (__res[0] == 64) {
2602 return (__res[1] + 64) >> 4;
2603 }
2604 return __res[0] >> 4;
2605}
2606
2607static __inline__ unsigned __ATTRS_o_ai
2608vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {
2609 vector unsigned long long __res =
2610#ifdef __LITTLE_ENDIAN__
2611 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2612#else
2613 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2614#endif
2615 if (__res[0] == 64) {
2616 return (__res[1] + 64) >> 4;
2617 }
2618 return __res[0] >> 4;
2619}
2620
2621static __inline__ unsigned __ATTRS_o_ai
2622vec_first_mismatch_index(vector signed int __a, vector signed int __b) {
2623 vector unsigned long long __res =
2624#ifdef __LITTLE_ENDIAN__
2625 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2626#else
2627 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2628#endif
2629 if (__res[0] == 64) {
2630 return (__res[1] + 64) >> 5;
2631 }
2632 return __res[0] >> 5;
2633}
2634
2635static __inline__ unsigned __ATTRS_o_ai
2636vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {
2637 vector unsigned long long __res =
2638#ifdef __LITTLE_ENDIAN__
2639 vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2640#else
2641 vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2642#endif
2643 if (__res[0] == 64) {
2644 return (__res[1] + 64) >> 5;
2645 }
2646 return __res[0] >> 5;
2647}
2648
2649/* vec_first_mismatch_or_eos_index */
2650
2651static __inline__ unsigned __ATTRS_o_ai
2652vec_first_mismatch_or_eos_index(vector signed char __a,
2653 vector signed char __b) {
2654 vector unsigned long long __res =
2655#ifdef __LITTLE_ENDIAN__
2656 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2657#else
2658 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2659#endif
2660 if (__res[0] == 64) {
2661 return (__res[1] + 64) >> 3;
2662 }
2663 return __res[0] >> 3;
2664}
2665
2666static __inline__ unsigned __ATTRS_o_ai
2667vec_first_mismatch_or_eos_index(vector unsigned char __a,
2668 vector unsigned char __b) {
2669 vector unsigned long long __res =
2670#ifdef __LITTLE_ENDIAN__
2671 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2672#else
2673 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2674#endif
2675 if (__res[0] == 64) {
2676 return (__res[1] + 64) >> 3;
2677 }
2678 return __res[0] >> 3;
2679}
2680
2681static __inline__ unsigned __ATTRS_o_ai
2682vec_first_mismatch_or_eos_index(vector signed short __a,
2683 vector signed short __b) {
2684 vector unsigned long long __res =
2685#ifdef __LITTLE_ENDIAN__
2686 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2687#else
2688 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2689#endif
2690 if (__res[0] == 64) {
2691 return (__res[1] + 64) >> 4;
2692 }
2693 return __res[0] >> 4;
2694}
2695
2696static __inline__ unsigned __ATTRS_o_ai
2697vec_first_mismatch_or_eos_index(vector unsigned short __a,
2698 vector unsigned short __b) {
2699 vector unsigned long long __res =
2700#ifdef __LITTLE_ENDIAN__
2701 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2702#else
2703 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2704#endif
2705 if (__res[0] == 64) {
2706 return (__res[1] + 64) >> 4;
2707 }
2708 return __res[0] >> 4;
2709}
2710
2711static __inline__ unsigned __ATTRS_o_ai
2712vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {
2713 vector unsigned long long __res =
2714#ifdef __LITTLE_ENDIAN__
2715 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2716#else
2717 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2718#endif
2719 if (__res[0] == 64) {
2720 return (__res[1] + 64) >> 5;
2721 }
2722 return __res[0] >> 5;
2723}
2724
2725static __inline__ unsigned __ATTRS_o_ai
2726vec_first_mismatch_or_eos_index(vector unsigned int __a,
2727 vector unsigned int __b) {
2728 vector unsigned long long __res =
2729#ifdef __LITTLE_ENDIAN__
2730 vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2731#else
2732 vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2733#endif
2734 if (__res[0] == 64) {
2735 return (__res[1] + 64) >> 5;
2736 }
2737 return __res[0] >> 5;
2738}
2739
2740static __inline__ vector double __ATTRS_o_ai
2741vec_insert_exp(vector double __a, vector unsigned long long __b) {
2742 return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2743}
2744
2745static __inline__ vector double __ATTRS_o_ai
2746vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2747 return __builtin_vsx_xviexpdp(__a,__b);
2748}
2749
2750static __inline__ vector float __ATTRS_o_ai
2751vec_insert_exp(vector float __a, vector unsigned int __b) {
2752 return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2753}
2754
2755static __inline__ vector float __ATTRS_o_ai
2756vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2757 return __builtin_vsx_xviexpsp(__a,__b);
2758}
2759
2760#if defined(__powerpc64__)
2761static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(const signed char *__a,
2762 size_t __b) {
2763 return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2764}
2765
2766static __inline__ vector unsigned char __ATTRS_o_ai
2767vec_xl_len(const unsigned char *__a, size_t __b) {
2768 return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2769}
2770
2771static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(const signed short *__a,
2772 size_t __b) {
2773 return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2774}
2775
2776static __inline__ vector unsigned short __ATTRS_o_ai
2777vec_xl_len(const unsigned short *__a, size_t __b) {
2778 return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2779}
2780
2781static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(const signed int *__a,
2782 size_t __b) {
2783 return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2784}
2785
2786static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(const unsigned int *__a,
2787 size_t __b) {
2788 return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2789}
2790
2791static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t __b) {
2792 return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2793}
2794
2795static __inline__ vector signed __int128 __ATTRS_o_ai
2796vec_xl_len(const signed __int128 *__a, size_t __b) {
2797 return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2798}
2799
2800static __inline__ vector unsigned __int128 __ATTRS_o_ai
2801vec_xl_len(const unsigned __int128 *__a, size_t __b) {
2802 return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2803}
2804
2805static __inline__ vector signed long long __ATTRS_o_ai
2806vec_xl_len(const signed long long *__a, size_t __b) {
2807 return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2808}
2809
2810static __inline__ vector unsigned long long __ATTRS_o_ai
2811vec_xl_len(const unsigned long long *__a, size_t __b) {
2812 return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2813}
2814
2815static __inline__ vector double __ATTRS_o_ai vec_xl_len(const double *__a,
2816 size_t __b) {
2817 return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2818}
2819
2820static __inline__ vector unsigned char __ATTRS_o_ai
2821vec_xl_len_r(const unsigned char *__a, size_t __b) {
2822 vector unsigned char __res =
2823 (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2824#ifdef __LITTLE_ENDIAN__
2825 vector unsigned char __mask =
2826 (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2827 __res = (vector unsigned char)__builtin_altivec_vperm_4si(
2828 (vector int)__res, (vector int)__res, __mask);
2829#endif
2830 return __res;
2831}
2832
2833// vec_xst_len
2834static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
2835 unsigned char *__b,
2836 size_t __c) {
2837 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2838}
2839
2840static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
2841 signed char *__b, size_t __c) {
2842 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2843}
2844
2845static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
2846 signed short *__b, size_t __c) {
2847 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2848}
2849
2850static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
2851 unsigned short *__b,
2852 size_t __c) {
2853 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2854}
2855
2856static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
2857 signed int *__b, size_t __c) {
2858 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2859}
2860
2861static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
2862 unsigned int *__b, size_t __c) {
2863 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2864}
2865
2866static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2867 size_t __c) {
2868 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2869}
2870
2871static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2872 signed __int128 *__b,
2873 size_t __c) {
2874 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2875}
2876
2877static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2878 unsigned __int128 *__b,
2879 size_t __c) {
2880 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2881}
2882
2883static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2884 signed long long *__b,
2885 size_t __c) {
2886 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2887}
2888
2889static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
2890 unsigned long long *__b,
2891 size_t __c) {
2892 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2893}
2894
2895static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2896 size_t __c) {
2897 return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2898}
2899
2900static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2901 unsigned char *__b,
2902 size_t __c) {
2903#ifdef __LITTLE_ENDIAN__
2904 vector unsigned char __mask =
2905 (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2906 vector unsigned char __res =
2907 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2908 return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2909#else
2910 return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2911#endif
2912}
2913#endif
2914#endif
2915
2916/* vec_cpsgn */
2917
2918#ifdef __VSX__
2919static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2920 vector float __b) {
2921 return __builtin_vsx_xvcpsgnsp(__a, __b);
2922}
2923
2924static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2925 vector double __b) {
2926 return __builtin_vsx_xvcpsgndp(__a, __b);
2927}
2928#endif
2929
2930/* vec_ctf */
2931
2932#ifdef __VSX__
2933#define vec_ctf(__a, __b) \
2934 _Generic((__a), vector int \
2935 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
2936 vector unsigned int \
2937 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2938 (__b)), \
2939 vector unsigned long long \
2940 : (__builtin_convertvector((vector unsigned long long)(__a), \
2941 vector double) * \
2942 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2943 << 52)), \
2944 vector signed long long \
2945 : (__builtin_convertvector((vector signed long long)(__a), \
2946 vector double) * \
2947 (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2948 << 52)))
2949#else
2950#define vec_ctf(__a, __b) \
2951 _Generic((__a), vector int \
2952 : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
2953 vector unsigned int \
2954 : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2955 (__b)))
2956#endif
2957
2958/* vec_vcfsx */
2959
2960#define vec_vcfux __builtin_altivec_vcfux
2961
2962/* vec_vcfux */
2963
2964#define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2965
2966/* vec_cts */
2967
2968#ifdef __VSX__
2969#define vec_cts(__a, __b) \
2970 _Generic((__a), vector float \
2971 : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
2972 vector double \
2973 : __extension__({ \
2974 vector double __ret = \
2975 (vector double)(__a) * \
2976 (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2977 << 52); \
2978 __builtin_convertvector(__ret, vector signed long long); \
2979 }))
2980#else
2981#define vec_cts __builtin_altivec_vctsxs
2982#endif
2983
2984/* vec_vctsxs */
2985
2986#define vec_vctsxs __builtin_altivec_vctsxs
2987
2988/* vec_ctu */
2989
2990#ifdef __VSX__
2991#define vec_ctu(__a, __b) \
2992 _Generic((__a), vector float \
2993 : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
2994 vector double \
2995 : __extension__({ \
2996 vector double __ret = \
2997 (vector double)(__a) * \
2998 (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2999 << 52); \
3000 __builtin_convertvector(__ret, vector unsigned long long); \
3001 }))
3002#else
3003#define vec_ctu __builtin_altivec_vctuxs
3004#endif
3005
3006/* vec_vctuxs */
3007
3008#define vec_vctuxs __builtin_altivec_vctuxs
3009
3010/* vec_signed */
3011
3012static __inline__ vector signed int __ATTRS_o_ai
3013vec_sld(vector signed int, vector signed int, unsigned const int __c);
3014
3015static __inline__ vector signed int __ATTRS_o_ai
3016vec_signed(vector float __a) {
3017 return __builtin_convertvector(__a, vector signed int);
3018}
3019
3020#ifdef __VSX__
3021static __inline__ vector signed long long __ATTRS_o_ai
3022vec_signed(vector double __a) {
3023 return __builtin_convertvector(__a, vector signed long long);
3024}
3025
3026static __inline__ vector signed int __attribute__((__always_inline__))
3027vec_signed2(vector double __a, vector double __b) {
3028 return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
3029}
3030
3031static __inline__ vector signed int __ATTRS_o_ai
3032vec_signede(vector double __a) {
3033#ifdef __LITTLE_ENDIAN__
3034 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3035 return vec_sld(__ret, __ret, 12);
3036#else
3037 return __builtin_vsx_xvcvdpsxws(__a);
3038#endif
3039}
3040
3041static __inline__ vector signed int __ATTRS_o_ai
3042vec_signedo(vector double __a) {
3043#ifdef __LITTLE_ENDIAN__
3044 return __builtin_vsx_xvcvdpsxws(__a);
3045#else
3046 vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
3047 return vec_sld(__ret, __ret, 12);
3048#endif
3049}
3050#endif
3051
3052/* vec_unsigned */
3053
3054static __inline__ vector unsigned int __ATTRS_o_ai
3055vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3056
3057static __inline__ vector unsigned int __ATTRS_o_ai
3058vec_unsigned(vector float __a) {
3059 return __builtin_convertvector(__a, vector unsigned int);
3060}
3061
3062#ifdef __VSX__
3063static __inline__ vector unsigned long long __ATTRS_o_ai
3064vec_unsigned(vector double __a) {
3065 return __builtin_convertvector(__a, vector unsigned long long);
3066}
3067
3068static __inline__ vector unsigned int __attribute__((__always_inline__))
3069vec_unsigned2(vector double __a, vector double __b) {
3070 return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3071}
3072
3073static __inline__ vector unsigned int __ATTRS_o_ai
3074vec_unsignede(vector double __a) {
3075#ifdef __LITTLE_ENDIAN__
3076 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3077 return vec_sld(__ret, __ret, 12);
3078#else
3079 return __builtin_vsx_xvcvdpuxws(__a);
3080#endif
3081}
3082
3083static __inline__ vector unsigned int __ATTRS_o_ai
3084vec_unsignedo(vector double __a) {
3085#ifdef __LITTLE_ENDIAN__
3086 return __builtin_vsx_xvcvdpuxws(__a);
3087#else
3088 vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3089 return vec_sld(__ret, __ret, 12);
3090#endif
3091}
3092#endif
3093
3094/* vec_float */
3095
3096static __inline__ vector float __ATTRS_o_ai
3097vec_sld(vector float, vector float, unsigned const int __c);
3098
3099static __inline__ vector float __ATTRS_o_ai
3100vec_float(vector signed int __a) {
3101 return __builtin_convertvector(__a, vector float);
3102}
3103
3104static __inline__ vector float __ATTRS_o_ai
3105vec_float(vector unsigned int __a) {
3106 return __builtin_convertvector(__a, vector float);
3107}
3108
3109#ifdef __VSX__
3110static __inline__ vector float __ATTRS_o_ai
3111vec_float2(vector signed long long __a, vector signed long long __b) {
3112 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3113}
3114
3115static __inline__ vector float __ATTRS_o_ai
3116vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3117 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3118}
3119
3120static __inline__ vector float __ATTRS_o_ai
3121vec_float2(vector double __a, vector double __b) {
3122 return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3123}
3124
3125static __inline__ vector float __ATTRS_o_ai
3126vec_floate(vector signed long long __a) {
3127#ifdef __LITTLE_ENDIAN__
3128 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3129 return vec_sld(__ret, __ret, 12);
3130#else
3131 return __builtin_vsx_xvcvsxdsp(__a);
3132#endif
3133}
3134
3135static __inline__ vector float __ATTRS_o_ai
3136vec_floate(vector unsigned long long __a) {
3137#ifdef __LITTLE_ENDIAN__
3138 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3139 return vec_sld(__ret, __ret, 12);
3140#else
3141 return __builtin_vsx_xvcvuxdsp(__a);
3142#endif
3143}
3144
3145static __inline__ vector float __ATTRS_o_ai
3146vec_floate(vector double __a) {
3147#ifdef __LITTLE_ENDIAN__
3148 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3149 return vec_sld(__ret, __ret, 12);
3150#else
3151 return __builtin_vsx_xvcvdpsp(__a);
3152#endif
3153}
3154
3155static __inline__ vector float __ATTRS_o_ai
3156vec_floato(vector signed long long __a) {
3157#ifdef __LITTLE_ENDIAN__
3158 return __builtin_vsx_xvcvsxdsp(__a);
3159#else
3160 vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3161 return vec_sld(__ret, __ret, 12);
3162#endif
3163}
3164
3165static __inline__ vector float __ATTRS_o_ai
3166vec_floato(vector unsigned long long __a) {
3167#ifdef __LITTLE_ENDIAN__
3168 return __builtin_vsx_xvcvuxdsp(__a);
3169#else
3170 vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3171 return vec_sld(__ret, __ret, 12);
3172#endif
3173}
3174
3175static __inline__ vector float __ATTRS_o_ai
3176vec_floato(vector double __a) {
3177#ifdef __LITTLE_ENDIAN__
3178 return __builtin_vsx_xvcvdpsp(__a);
3179#else
3180 vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3181 return vec_sld(__ret, __ret, 12);
3182#endif
3183}
3184#endif
3185
3186/* vec_double */
3187
3188#ifdef __VSX__
3189static __inline__ vector double __ATTRS_o_ai
3190vec_double(vector signed long long __a) {
3191 return __builtin_convertvector(__a, vector double);
3192}
3193
3194static __inline__ vector double __ATTRS_o_ai
3195vec_double(vector unsigned long long __a) {
3196 return __builtin_convertvector(__a, vector double);
3197}
3198
3199static __inline__ vector double __ATTRS_o_ai
3200vec_doublee(vector signed int __a) {
3201#ifdef __LITTLE_ENDIAN__
3202 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3203#else
3204 return __builtin_vsx_xvcvsxwdp(__a);
3205#endif
3206}
3207
3208static __inline__ vector double __ATTRS_o_ai
3209vec_doublee(vector unsigned int __a) {
3210#ifdef __LITTLE_ENDIAN__
3211 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3212#else
3213 return __builtin_vsx_xvcvuxwdp(__a);
3214#endif
3215}
3216
3217static __inline__ vector double __ATTRS_o_ai
3218vec_doublee(vector float __a) {
3219#ifdef __LITTLE_ENDIAN__
3220 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3221#else
3222 return __builtin_vsx_xvcvspdp(__a);
3223#endif
3224}
3225
3226static __inline__ vector double __ATTRS_o_ai
3227vec_doubleh(vector signed int __a) {
3228 vector double __ret = {__a[0], __a[1]};
3229 return __ret;
3230}
3231
3232static __inline__ vector double __ATTRS_o_ai
3233vec_doubleh(vector unsigned int __a) {
3234 vector double __ret = {__a[0], __a[1]};
3235 return __ret;
3236}
3237
3238static __inline__ vector double __ATTRS_o_ai
3239vec_doubleh(vector float __a) {
3240 vector double __ret = {__a[0], __a[1]};
3241 return __ret;
3242}
3243
3244static __inline__ vector double __ATTRS_o_ai
3245vec_doublel(vector signed int __a) {
3246 vector double __ret = {__a[2], __a[3]};
3247 return __ret;
3248}
3249
3250static __inline__ vector double __ATTRS_o_ai
3251vec_doublel(vector unsigned int __a) {
3252 vector double __ret = {__a[2], __a[3]};
3253 return __ret;
3254}
3255
3256static __inline__ vector double __ATTRS_o_ai
3257vec_doublel(vector float __a) {
3258 vector double __ret = {__a[2], __a[3]};
3259 return __ret;
3260}
3261
3262static __inline__ vector double __ATTRS_o_ai
3263vec_doubleo(vector signed int __a) {
3264#ifdef __LITTLE_ENDIAN__
3265 return __builtin_vsx_xvcvsxwdp(__a);
3266#else
3267 return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3268#endif
3269}
3270
3271static __inline__ vector double __ATTRS_o_ai
3272vec_doubleo(vector unsigned int __a) {
3273#ifdef __LITTLE_ENDIAN__
3274 return __builtin_vsx_xvcvuxwdp(__a);
3275#else
3276 return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3277#endif
3278}
3279
3280static __inline__ vector double __ATTRS_o_ai
3281vec_doubleo(vector float __a) {
3282#ifdef __LITTLE_ENDIAN__
3283 return __builtin_vsx_xvcvspdp(__a);
3284#else
3285 return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3286#endif
3287}
3288#endif
3289
3290/* vec_div */
3291
3292/* Integer vector divides (vectors are scalarized, elements divided
3293 and the vectors reassembled).
3294*/
3295static __inline__ vector signed char __ATTRS_o_ai
3296vec_div(vector signed char __a, vector signed char __b) {
3297 return __a / __b;
3298}
3299
3300static __inline__ vector unsigned char __ATTRS_o_ai
3301vec_div(vector unsigned char __a, vector unsigned char __b) {
3302 return __a / __b;
3303}
3304
3305static __inline__ vector signed short __ATTRS_o_ai
3306vec_div(vector signed short __a, vector signed short __b) {
3307 return __a / __b;
3308}
3309
3310static __inline__ vector unsigned short __ATTRS_o_ai
3311vec_div(vector unsigned short __a, vector unsigned short __b) {
3312 return __a / __b;
3313}
3314
3315static __inline__ vector signed int __ATTRS_o_ai
3316vec_div(vector signed int __a, vector signed int __b) {
3317 return __a / __b;
3318}
3319
3320static __inline__ vector unsigned int __ATTRS_o_ai
3321vec_div(vector unsigned int __a, vector unsigned int __b) {
3322 return __a / __b;
3323}
3324
3325#ifdef __VSX__
3326static __inline__ vector signed long long __ATTRS_o_ai
3327vec_div(vector signed long long __a, vector signed long long __b) {
3328 return __a / __b;
3329}
3330
3331static __inline__ vector unsigned long long __ATTRS_o_ai
3332vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3333 return __a / __b;
3334}
3335
3336static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3337 vector float __b) {
3338 return __a / __b;
3339}
3340
3341static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3342 vector double __b) {
3343 return __a / __b;
3344}
3345#endif
3346
3347/* vec_dss */
3348
3349#define vec_dss __builtin_altivec_dss
3350
3351/* vec_dssall */
3352
3353static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3354 __builtin_altivec_dssall();
3355}
3356
3357/* vec_dst */
3358#define vec_dst(__PTR, __CW, __STR) \
3359 __extension__( \
3360 { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3361
3362/* vec_dstst */
3363#define vec_dstst(__PTR, __CW, __STR) \
3364 __extension__( \
3365 { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3366
3367/* vec_dststt */
3368#define vec_dststt(__PTR, __CW, __STR) \
3369 __extension__( \
3370 { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3371
3372/* vec_dstt */
3373#define vec_dstt(__PTR, __CW, __STR) \
3374 __extension__( \
3375 { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3376
3377/* vec_eqv */
3378
3379#ifdef __POWER8_VECTOR__
3380static __inline__ vector signed char __ATTRS_o_ai
3381vec_eqv(vector signed char __a, vector signed char __b) {
3382 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3383 (vector unsigned int)__b);
3384}
3385
3386static __inline__ vector unsigned char __ATTRS_o_ai
3387vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3388 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3389 (vector unsigned int)__b);
3390}
3391
3392static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3393 vector bool char __b) {
3394 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3395 (vector unsigned int)__b);
3396}
3397
3398static __inline__ vector signed short __ATTRS_o_ai
3399vec_eqv(vector signed short __a, vector signed short __b) {
3400 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3401 (vector unsigned int)__b);
3402}
3403
3404static __inline__ vector unsigned short __ATTRS_o_ai
3405vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3406 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3407 (vector unsigned int)__b);
3408}
3409
3410static __inline__ vector bool short __ATTRS_o_ai
3411vec_eqv(vector bool short __a, vector bool short __b) {
3412 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3413 (vector unsigned int)__b);
3414}
3415
3416static __inline__ vector signed int __ATTRS_o_ai
3417vec_eqv(vector signed int __a, vector signed int __b) {
3418 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3419 (vector unsigned int)__b);
3420}
3421
3422static __inline__ vector unsigned int __ATTRS_o_ai
3423vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3424 return __builtin_vsx_xxleqv(__a, __b);
3425}
3426
3427static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3428 vector bool int __b) {
3429 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3430 (vector unsigned int)__b);
3431}
3432
3433static __inline__ vector signed long long __ATTRS_o_ai
3434vec_eqv(vector signed long long __a, vector signed long long __b) {
3435 return (vector signed long long)__builtin_vsx_xxleqv(
3436 (vector unsigned int)__a, (vector unsigned int)__b);
3437}
3438
3439static __inline__ vector unsigned long long __ATTRS_o_ai
3440vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3441 return (vector unsigned long long)__builtin_vsx_xxleqv(
3442 (vector unsigned int)__a, (vector unsigned int)__b);
3443}
3444
3445static __inline__ vector bool long long __ATTRS_o_ai
3446vec_eqv(vector bool long long __a, vector bool long long __b) {
3447 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3448 (vector unsigned int)__b);
3449}
3450
3451static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3452 vector float __b) {
3453 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3454 (vector unsigned int)__b);
3455}
3456
3457static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3458 vector double __b) {
3459 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3460 (vector unsigned int)__b);
3461}
3462#endif
3463
3464/* vec_expte */
3465
3466static __inline__ vector float __attribute__((__always_inline__))
3467vec_expte(vector float __a) {
3468 return __builtin_altivec_vexptefp(__a);
3469}
3470
3471/* vec_vexptefp */
3472
3473static __inline__ vector float __attribute__((__always_inline__))
3474vec_vexptefp(vector float __a) {
3475 return __builtin_altivec_vexptefp(__a);
3476}
3477
3478/* vec_floor */
3479
3480static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3481#ifdef __VSX__
3482 return __builtin_vsx_xvrspim(__a);
3483#else
3484 return __builtin_altivec_vrfim(__a);
3485#endif
3486}
3487
3488#ifdef __VSX__
3489static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3490 return __builtin_vsx_xvrdpim(__a);
3491}
3492#endif
3493
3494/* vec_vrfim */
3495
3496static __inline__ vector float __attribute__((__always_inline__))
3497vec_vrfim(vector float __a) {
3498 return __builtin_altivec_vrfim(__a);
3499}
3500
3501/* vec_ld */
3502
3503static __inline__ vector signed char __ATTRS_o_ai
3504vec_ld(int __a, const vector signed char *__b) {
3505 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3506}
3507
3508static __inline__ vector signed char __ATTRS_o_ai
3509vec_ld(int __a, const signed char *__b) {
3510 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3511}
3512
3513static __inline__ vector unsigned char __ATTRS_o_ai
3514vec_ld(int __a, const vector unsigned char *__b) {
3515 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3516}
3517
3518static __inline__ vector unsigned char __ATTRS_o_ai
3519vec_ld(int __a, const unsigned char *__b) {
3520 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3521}
3522
3523static __inline__ vector bool char __ATTRS_o_ai
3524vec_ld(int __a, const vector bool char *__b) {
3525 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3526}
3527
3528static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3529 const vector short *__b) {
3530 return (vector short)__builtin_altivec_lvx(__a, __b);
3531}
3532
3533static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3534 return (vector short)__builtin_altivec_lvx(__a, __b);
3535}
3536
3537static __inline__ vector unsigned short __ATTRS_o_ai
3538vec_ld(int __a, const vector unsigned short *__b) {
3539 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3540}
3541
3542static __inline__ vector unsigned short __ATTRS_o_ai
3543vec_ld(int __a, const unsigned short *__b) {
3544 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3545}
3546
3547static __inline__ vector bool short __ATTRS_o_ai
3548vec_ld(int __a, const vector bool short *__b) {
3549 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3550}
3551
3552static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3553 const vector pixel *__b) {
3554 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3555}
3556
3557static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3558 const vector int *__b) {
3559 return (vector int)__builtin_altivec_lvx(__a, __b);
3560}
3561
3562static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3563 return (vector int)__builtin_altivec_lvx(__a, __b);
3564}
3565
3566static __inline__ vector unsigned int __ATTRS_o_ai
3567vec_ld(int __a, const vector unsigned int *__b) {
3568 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3569}
3570
3571static __inline__ vector unsigned int __ATTRS_o_ai
3572vec_ld(int __a, const unsigned int *__b) {
3573 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3574}
3575
3576static __inline__ vector bool int __ATTRS_o_ai
3577vec_ld(int __a, const vector bool int *__b) {
3578 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3579}
3580
3581static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3582 const vector float *__b) {
3583 return (vector float)__builtin_altivec_lvx(__a, __b);
3584}
3585
3586static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3587 return (vector float)__builtin_altivec_lvx(__a, __b);
3588}
3589
3590/* vec_lvx */
3591
3592static __inline__ vector signed char __ATTRS_o_ai
3593vec_lvx(int __a, const vector signed char *__b) {
3594 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3595}
3596
3597static __inline__ vector signed char __ATTRS_o_ai
3598vec_lvx(int __a, const signed char *__b) {
3599 return (vector signed char)__builtin_altivec_lvx(__a, __b);
3600}
3601
3602static __inline__ vector unsigned char __ATTRS_o_ai
3603vec_lvx(int __a, const vector unsigned char *__b) {
3604 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3605}
3606
3607static __inline__ vector unsigned char __ATTRS_o_ai
3608vec_lvx(int __a, const unsigned char *__b) {
3609 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3610}
3611
3612static __inline__ vector bool char __ATTRS_o_ai
3613vec_lvx(int __a, const vector bool char *__b) {
3614 return (vector bool char)__builtin_altivec_lvx(__a, __b);
3615}
3616
3617static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3618 const vector short *__b) {
3619 return (vector short)__builtin_altivec_lvx(__a, __b);
3620}
3621
3622static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3623 return (vector short)__builtin_altivec_lvx(__a, __b);
3624}
3625
3626static __inline__ vector unsigned short __ATTRS_o_ai
3627vec_lvx(int __a, const vector unsigned short *__b) {
3628 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3629}
3630
3631static __inline__ vector unsigned short __ATTRS_o_ai
3632vec_lvx(int __a, const unsigned short *__b) {
3633 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3634}
3635
3636static __inline__ vector bool short __ATTRS_o_ai
3637vec_lvx(int __a, const vector bool short *__b) {
3638 return (vector bool short)__builtin_altivec_lvx(__a, __b);
3639}
3640
3641static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3642 const vector pixel *__b) {
3643 return (vector pixel)__builtin_altivec_lvx(__a, __b);
3644}
3645
3646static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3647 const vector int *__b) {
3648 return (vector int)__builtin_altivec_lvx(__a, __b);
3649}
3650
3651static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3652 return (vector int)__builtin_altivec_lvx(__a, __b);
3653}
3654
3655static __inline__ vector unsigned int __ATTRS_o_ai
3656vec_lvx(int __a, const vector unsigned int *__b) {
3657 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3658}
3659
3660static __inline__ vector unsigned int __ATTRS_o_ai
3661vec_lvx(int __a, const unsigned int *__b) {
3662 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3663}
3664
3665static __inline__ vector bool int __ATTRS_o_ai
3666vec_lvx(int __a, const vector bool int *__b) {
3667 return (vector bool int)__builtin_altivec_lvx(__a, __b);
3668}
3669
3670static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3671 const vector float *__b) {
3672 return (vector float)__builtin_altivec_lvx(__a, __b);
3673}
3674
3675static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3676 return (vector float)__builtin_altivec_lvx(__a, __b);
3677}
3678
3679/* vec_lde */
3680
3681static __inline__ vector signed char __ATTRS_o_ai
3682vec_lde(int __a, const signed char *__b) {
3683 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3684}
3685
3686static __inline__ vector unsigned char __ATTRS_o_ai
3687vec_lde(int __a, const unsigned char *__b) {
3688 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3689}
3690
3691static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3692 return (vector short)__builtin_altivec_lvehx(__a, __b);
3693}
3694
3695static __inline__ vector unsigned short __ATTRS_o_ai
3696vec_lde(int __a, const unsigned short *__b) {
3697 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3698}
3699
3700static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3701 return (vector int)__builtin_altivec_lvewx(__a, __b);
3702}
3703
3704static __inline__ vector unsigned int __ATTRS_o_ai
3705vec_lde(int __a, const unsigned int *__b) {
3706 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3707}
3708
3709static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3710 return (vector float)__builtin_altivec_lvewx(__a, __b);
3711}
3712
3713/* vec_lvebx */
3714
3715static __inline__ vector signed char __ATTRS_o_ai
3716vec_lvebx(int __a, const signed char *__b) {
3717 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3718}
3719
3720static __inline__ vector unsigned char __ATTRS_o_ai
3721vec_lvebx(int __a, const unsigned char *__b) {
3722 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3723}
3724
3725/* vec_lvehx */
3726
3727static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3728 const short *__b) {
3729 return (vector short)__builtin_altivec_lvehx(__a, __b);
3730}
3731
3732static __inline__ vector unsigned short __ATTRS_o_ai
3733vec_lvehx(int __a, const unsigned short *__b) {
3734 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3735}
3736
3737/* vec_lvewx */
3738
3739static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3740 return (vector int)__builtin_altivec_lvewx(__a, __b);
3741}
3742
3743static __inline__ vector unsigned int __ATTRS_o_ai
3744vec_lvewx(int __a, const unsigned int *__b) {
3745 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3746}
3747
3748static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3749 const float *__b) {
3750 return (vector float)__builtin_altivec_lvewx(__a, __b);
3751}
3752
3753/* vec_ldl */
3754
3755static __inline__ vector signed char __ATTRS_o_ai
3756vec_ldl(int __a, const vector signed char *__b) {
3757 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3758}
3759
3760static __inline__ vector signed char __ATTRS_o_ai
3761vec_ldl(int __a, const signed char *__b) {
3762 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3763}
3764
3765static __inline__ vector unsigned char __ATTRS_o_ai
3766vec_ldl(int __a, const vector unsigned char *__b) {
3767 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3768}
3769
3770static __inline__ vector unsigned char __ATTRS_o_ai
3771vec_ldl(int __a, const unsigned char *__b) {
3772 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3773}
3774
3775static __inline__ vector bool char __ATTRS_o_ai
3776vec_ldl(int __a, const vector bool char *__b) {
3777 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3778}
3779
3780static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3781 const vector short *__b) {
3782 return (vector short)__builtin_altivec_lvxl(__a, __b);
3783}
3784
3785static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3786 return (vector short)__builtin_altivec_lvxl(__a, __b);
3787}
3788
3789static __inline__ vector unsigned short __ATTRS_o_ai
3790vec_ldl(int __a, const vector unsigned short *__b) {
3791 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3792}
3793
3794static __inline__ vector unsigned short __ATTRS_o_ai
3795vec_ldl(int __a, const unsigned short *__b) {
3796 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3797}
3798
3799static __inline__ vector bool short __ATTRS_o_ai
3800vec_ldl(int __a, const vector bool short *__b) {
3801 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3802}
3803
3804static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3805 const vector pixel *__b) {
3806 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3807}
3808
3809static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3810 const vector int *__b) {
3811 return (vector int)__builtin_altivec_lvxl(__a, __b);
3812}
3813
3814static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3815 return (vector int)__builtin_altivec_lvxl(__a, __b);
3816}
3817
3818static __inline__ vector unsigned int __ATTRS_o_ai
3819vec_ldl(int __a, const vector unsigned int *__b) {
3820 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3821}
3822
3823static __inline__ vector unsigned int __ATTRS_o_ai
3824vec_ldl(int __a, const unsigned int *__b) {
3825 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3826}
3827
3828static __inline__ vector bool int __ATTRS_o_ai
3829vec_ldl(int __a, const vector bool int *__b) {
3830 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3831}
3832
3833static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3834 const vector float *__b) {
3835 return (vector float)__builtin_altivec_lvxl(__a, __b);
3836}
3837
3838static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3839 return (vector float)__builtin_altivec_lvxl(__a, __b);
3840}
3841
3842/* vec_lvxl */
3843
3844static __inline__ vector signed char __ATTRS_o_ai
3845vec_lvxl(int __a, const vector signed char *__b) {
3846 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3847}
3848
3849static __inline__ vector signed char __ATTRS_o_ai
3850vec_lvxl(int __a, const signed char *__b) {
3851 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3852}
3853
3854static __inline__ vector unsigned char __ATTRS_o_ai
3855vec_lvxl(int __a, const vector unsigned char *__b) {
3856 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3857}
3858
3859static __inline__ vector unsigned char __ATTRS_o_ai
3860vec_lvxl(int __a, const unsigned char *__b) {
3861 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3862}
3863
3864static __inline__ vector bool char __ATTRS_o_ai
3865vec_lvxl(int __a, const vector bool char *__b) {
3866 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3867}
3868
3869static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3870 const vector short *__b) {
3871 return (vector short)__builtin_altivec_lvxl(__a, __b);
3872}
3873
3874static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3875 const short *__b) {
3876 return (vector short)__builtin_altivec_lvxl(__a, __b);
3877}
3878
3879static __inline__ vector unsigned short __ATTRS_o_ai
3880vec_lvxl(int __a, const vector unsigned short *__b) {
3881 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3882}
3883
3884static __inline__ vector unsigned short __ATTRS_o_ai
3885vec_lvxl(int __a, const unsigned short *__b) {
3886 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3887}
3888
3889static __inline__ vector bool short __ATTRS_o_ai
3890vec_lvxl(int __a, const vector bool short *__b) {
3891 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3892}
3893
3894static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3895 const vector pixel *__b) {
3896 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3897}
3898
3899static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3900 const vector int *__b) {
3901 return (vector int)__builtin_altivec_lvxl(__a, __b);
3902}
3903
3904static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3905 return (vector int)__builtin_altivec_lvxl(__a, __b);
3906}
3907
3908static __inline__ vector unsigned int __ATTRS_o_ai
3909vec_lvxl(int __a, const vector unsigned int *__b) {
3910 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3911}
3912
3913static __inline__ vector unsigned int __ATTRS_o_ai
3914vec_lvxl(int __a, const unsigned int *__b) {
3915 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3916}
3917
3918static __inline__ vector bool int __ATTRS_o_ai
3919vec_lvxl(int __a, const vector bool int *__b) {
3920 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3921}
3922
3923static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3924 const vector float *__b) {
3925 return (vector float)__builtin_altivec_lvxl(__a, __b);
3926}
3927
3928static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3929 const float *__b) {
3930 return (vector float)__builtin_altivec_lvxl(__a, __b);
3931}
3932
3933/* vec_loge */
3934
3935static __inline__ vector float __attribute__((__always_inline__))
3936vec_loge(vector float __a) {
3937 return __builtin_altivec_vlogefp(__a);
3938}
3939
3940/* vec_vlogefp */
3941
3942static __inline__ vector float __attribute__((__always_inline__))
3943vec_vlogefp(vector float __a) {
3944 return __builtin_altivec_vlogefp(__a);
3945}
3946
3947/* vec_lvsl */
3948
3949#ifdef __LITTLE_ENDIAN__
3950static __inline__ vector unsigned char __ATTRS_o_ai
3951 __attribute__((__deprecated__("use assignment for unaligned little endian \
3952loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3953 vector unsigned char mask =
3954 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3955 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3956 7, 6, 5, 4, 3, 2, 1, 0};
3957 return vec_perm(mask, mask, reverse);
3958}
3959#else
3960static __inline__ vector unsigned char __ATTRS_o_ai
3961vec_lvsl(int __a, const signed char *__b) {
3962 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3963}
3964#endif
3965
3966#ifdef __LITTLE_ENDIAN__
3967static __inline__ vector unsigned char __ATTRS_o_ai
3968 __attribute__((__deprecated__("use assignment for unaligned little endian \
3969loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3970 vector unsigned char mask =
3971 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3972 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3973 7, 6, 5, 4, 3, 2, 1, 0};
3974 return vec_perm(mask, mask, reverse);
3975}
3976#else
3977static __inline__ vector unsigned char __ATTRS_o_ai
3978vec_lvsl(int __a, const unsigned char *__b) {
3979 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3980}
3981#endif
3982
3983#ifdef __LITTLE_ENDIAN__
3984static __inline__ vector unsigned char __ATTRS_o_ai
3985 __attribute__((__deprecated__("use assignment for unaligned little endian \
3986loads/stores"))) vec_lvsl(int __a, const short *__b) {
3987 vector unsigned char mask =
3988 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3989 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3990 7, 6, 5, 4, 3, 2, 1, 0};
3991 return vec_perm(mask, mask, reverse);
3992}
3993#else
3994static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3995 const short *__b) {
3996 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3997}
3998#endif
3999
4000#ifdef __LITTLE_ENDIAN__
4001static __inline__ vector unsigned char __ATTRS_o_ai
4002 __attribute__((__deprecated__("use assignment for unaligned little endian \
4003loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
4004 vector unsigned char mask =
4005 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4006 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4007 7, 6, 5, 4, 3, 2, 1, 0};
4008 return vec_perm(mask, mask, reverse);
4009}
4010#else
4011static __inline__ vector unsigned char __ATTRS_o_ai
4012vec_lvsl(int __a, const unsigned short *__b) {
4013 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4014}
4015#endif
4016
4017#ifdef __LITTLE_ENDIAN__
4018static __inline__ vector unsigned char __ATTRS_o_ai
4019 __attribute__((__deprecated__("use assignment for unaligned little endian \
4020loads/stores"))) vec_lvsl(int __a, const int *__b) {
4021 vector unsigned char mask =
4022 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4023 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4024 7, 6, 5, 4, 3, 2, 1, 0};
4025 return vec_perm(mask, mask, reverse);
4026}
4027#else
4028static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4029 const int *__b) {
4030 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4031}
4032#endif
4033
4034#ifdef __LITTLE_ENDIAN__
4035static __inline__ vector unsigned char __ATTRS_o_ai
4036 __attribute__((__deprecated__("use assignment for unaligned little endian \
4037loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
4038 vector unsigned char mask =
4039 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4040 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4041 7, 6, 5, 4, 3, 2, 1, 0};
4042 return vec_perm(mask, mask, reverse);
4043}
4044#else
4045static __inline__ vector unsigned char __ATTRS_o_ai
4046vec_lvsl(int __a, const unsigned int *__b) {
4047 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4048}
4049#endif
4050
4051#ifdef __LITTLE_ENDIAN__
4052static __inline__ vector unsigned char __ATTRS_o_ai
4053 __attribute__((__deprecated__("use assignment for unaligned little endian \
4054loads/stores"))) vec_lvsl(int __a, const float *__b) {
4055 vector unsigned char mask =
4056 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4057 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4058 7, 6, 5, 4, 3, 2, 1, 0};
4059 return vec_perm(mask, mask, reverse);
4060}
4061#else
4062static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4063 const float *__b) {
4064 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4065}
4066#endif
4067
4068/* vec_lvsr */
4069
4070#ifdef __LITTLE_ENDIAN__
4071static __inline__ vector unsigned char __ATTRS_o_ai
4072 __attribute__((__deprecated__("use assignment for unaligned little endian \
4073loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4074 vector unsigned char mask =
4075 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4076 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4077 7, 6, 5, 4, 3, 2, 1, 0};
4078 return vec_perm(mask, mask, reverse);
4079}
4080#else
4081static __inline__ vector unsigned char __ATTRS_o_ai
4082vec_lvsr(int __a, const signed char *__b) {
4083 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4084}
4085#endif
4086
4087#ifdef __LITTLE_ENDIAN__
4088static __inline__ vector unsigned char __ATTRS_o_ai
4089 __attribute__((__deprecated__("use assignment for unaligned little endian \
4090loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4091 vector unsigned char mask =
4092 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4093 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4094 7, 6, 5, 4, 3, 2, 1, 0};
4095 return vec_perm(mask, mask, reverse);
4096}
4097#else
4098static __inline__ vector unsigned char __ATTRS_o_ai
4099vec_lvsr(int __a, const unsigned char *__b) {
4100 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4101}
4102#endif
4103
4104#ifdef __LITTLE_ENDIAN__
4105static __inline__ vector unsigned char __ATTRS_o_ai
4106 __attribute__((__deprecated__("use assignment for unaligned little endian \
4107loads/stores"))) vec_lvsr(int __a, const short *__b) {
4108 vector unsigned char mask =
4109 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4110 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4111 7, 6, 5, 4, 3, 2, 1, 0};
4112 return vec_perm(mask, mask, reverse);
4113}
4114#else
4115static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4116 const short *__b) {
4117 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4118}
4119#endif
4120
4121#ifdef __LITTLE_ENDIAN__
4122static __inline__ vector unsigned char __ATTRS_o_ai
4123 __attribute__((__deprecated__("use assignment for unaligned little endian \
4124loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4125 vector unsigned char mask =
4126 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4127 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4128 7, 6, 5, 4, 3, 2, 1, 0};
4129 return vec_perm(mask, mask, reverse);
4130}
4131#else
4132static __inline__ vector unsigned char __ATTRS_o_ai
4133vec_lvsr(int __a, const unsigned short *__b) {
4134 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4135}
4136#endif
4137
4138#ifdef __LITTLE_ENDIAN__
4139static __inline__ vector unsigned char __ATTRS_o_ai
4140 __attribute__((__deprecated__("use assignment for unaligned little endian \
4141loads/stores"))) vec_lvsr(int __a, const int *__b) {
4142 vector unsigned char mask =
4143 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4144 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4145 7, 6, 5, 4, 3, 2, 1, 0};
4146 return vec_perm(mask, mask, reverse);
4147}
4148#else
4149static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4150 const int *__b) {
4151 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4152}
4153#endif
4154
4155#ifdef __LITTLE_ENDIAN__
4156static __inline__ vector unsigned char __ATTRS_o_ai
4157 __attribute__((__deprecated__("use assignment for unaligned little endian \
4158loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4159 vector unsigned char mask =
4160 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4161 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4162 7, 6, 5, 4, 3, 2, 1, 0};
4163 return vec_perm(mask, mask, reverse);
4164}
4165#else
4166static __inline__ vector unsigned char __ATTRS_o_ai
4167vec_lvsr(int __a, const unsigned int *__b) {
4168 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4169}
4170#endif
4171
4172#ifdef __LITTLE_ENDIAN__
4173static __inline__ vector unsigned char __ATTRS_o_ai
4174 __attribute__((__deprecated__("use assignment for unaligned little endian \
4175loads/stores"))) vec_lvsr(int __a, const float *__b) {
4176 vector unsigned char mask =
4177 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4178 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4179 7, 6, 5, 4, 3, 2, 1, 0};
4180 return vec_perm(mask, mask, reverse);
4181}
4182#else
4183static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4184 const float *__b) {
4185 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4186}
4187#endif
4188
4189/* vec_madd */
4190static __inline__ vector signed short __ATTRS_o_ai
4191vec_mladd(vector signed short, vector signed short, vector signed short);
4192static __inline__ vector signed short __ATTRS_o_ai
4193vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4194static __inline__ vector signed short __ATTRS_o_ai
4195vec_mladd(vector unsigned short, vector signed short, vector signed short);
4196static __inline__ vector unsigned short __ATTRS_o_ai
4197vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4198
4199static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4200 vector signed short __a, vector signed short __b, vector signed short __c) {
4201 return vec_mladd(__a, __b, __c);
4202}
4203
4204static __inline__ vector signed short __ATTRS_o_ai
4205vec_madd(vector signed short __a, vector unsigned short __b,
4206 vector unsigned short __c) {
4207 return vec_mladd(__a, __b, __c);
4208}
4209
4210static __inline__ vector signed short __ATTRS_o_ai
4211vec_madd(vector unsigned short __a, vector signed short __b,
4212 vector signed short __c) {
4213 return vec_mladd(__a, __b, __c);
4214}
4215
4216static __inline__ vector unsigned short __ATTRS_o_ai
4217vec_madd(vector unsigned short __a, vector unsigned short __b,
4218 vector unsigned short __c) {
4219 return vec_mladd(__a, __b, __c);
4220}
4221
4222static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4223 vector float __b,
4224 vector float __c) {
4225#ifdef __VSX__
4226 return __builtin_vsx_xvmaddasp(__a, __b, __c);
4227#else
4228 return __builtin_altivec_vmaddfp(__a, __b, __c);
4229#endif
4230}
4231
4232#ifdef __VSX__
4233static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4234 vector double __b,
4235 vector double __c) {
4236 return __builtin_vsx_xvmaddadp(__a, __b, __c);
4237}
4238#endif
4239
4240/* vec_vmaddfp */
4241
4242static __inline__ vector float __attribute__((__always_inline__))
4243vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4244 return __builtin_altivec_vmaddfp(__a, __b, __c);
4245}
4246
4247/* vec_madds */
4248
4249static __inline__ vector signed short __attribute__((__always_inline__))
4250vec_madds(vector signed short __a, vector signed short __b,
4251 vector signed short __c) {
4252 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4253}
4254
4255/* vec_vmhaddshs */
4256static __inline__ vector signed short __attribute__((__always_inline__))
4257vec_vmhaddshs(vector signed short __a, vector signed short __b,
4258 vector signed short __c) {
4259 return __builtin_altivec_vmhaddshs(__a, __b, __c);
4260}
4261
4262/* vec_msub */
4263
4264#ifdef __VSX__
4265static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4266 vector float __b,
4267 vector float __c) {
4268 return __builtin_vsx_xvmsubasp(__a, __b, __c);
4269}
4270
4271static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4272 vector double __b,
4273 vector double __c) {
4274 return __builtin_vsx_xvmsubadp(__a, __b, __c);
4275}
4276#endif
4277
4278/* vec_max */
4279
4280static __inline__ vector signed char __ATTRS_o_ai
4281vec_max(vector signed char __a, vector signed char __b) {
4282 return __builtin_altivec_vmaxsb(__a, __b);
4283}
4284
4285static __inline__ vector signed char __ATTRS_o_ai
4286vec_max(vector bool char __a, vector signed char __b) {
4287 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4288}
4289
4290static __inline__ vector signed char __ATTRS_o_ai
4291vec_max(vector signed char __a, vector bool char __b) {
4292 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4293}
4294
4295static __inline__ vector unsigned char __ATTRS_o_ai
4296vec_max(vector unsigned char __a, vector unsigned char __b) {
4297 return __builtin_altivec_vmaxub(__a, __b);
4298}
4299
4300static __inline__ vector unsigned char __ATTRS_o_ai
4301vec_max(vector bool char __a, vector unsigned char __b) {
4302 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4303}
4304
4305static __inline__ vector unsigned char __ATTRS_o_ai
4306vec_max(vector unsigned char __a, vector bool char __b) {
4307 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4308}
4309
4310static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4311 vector short __b) {
4312 return __builtin_altivec_vmaxsh(__a, __b);
4313}
4314
4315static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4316 vector short __b) {
4317 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4318}
4319
4320static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4321 vector bool short __b) {
4322 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4323}
4324
4325static __inline__ vector unsigned short __ATTRS_o_ai
4326vec_max(vector unsigned short __a, vector unsigned short __b) {
4327 return __builtin_altivec_vmaxuh(__a, __b);
4328}
4329
4330static __inline__ vector unsigned short __ATTRS_o_ai
4331vec_max(vector bool short __a, vector unsigned short __b) {
4332 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4333}
4334
4335static __inline__ vector unsigned short __ATTRS_o_ai
4336vec_max(vector unsigned short __a, vector bool short __b) {
4337 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4338}
4339
4340static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4341 vector int __b) {
4342 return __builtin_altivec_vmaxsw(__a, __b);
4343}
4344
4345static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4346 vector int __b) {
4347 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4348}
4349
4350static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4351 vector bool int __b) {
4352 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4353}
4354
4355static __inline__ vector unsigned int __ATTRS_o_ai
4356vec_max(vector unsigned int __a, vector unsigned int __b) {
4357 return __builtin_altivec_vmaxuw(__a, __b);
4358}
4359
4360static __inline__ vector unsigned int __ATTRS_o_ai
4361vec_max(vector bool int __a, vector unsigned int __b) {
4362 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4363}
4364
4365static __inline__ vector unsigned int __ATTRS_o_ai
4366vec_max(vector unsigned int __a, vector bool int __b) {
4367 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4368}
4369
4370#ifdef __POWER8_VECTOR__
4371static __inline__ vector signed long long __ATTRS_o_ai
4372vec_max(vector signed long long __a, vector signed long long __b) {
4373 return __builtin_altivec_vmaxsd(__a, __b);
4374}
4375
4376static __inline__ vector signed long long __ATTRS_o_ai
4377vec_max(vector bool long long __a, vector signed long long __b) {
4378 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4379}
4380
4381static __inline__ vector signed long long __ATTRS_o_ai
4382vec_max(vector signed long long __a, vector bool long long __b) {
4383 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4384}
4385
4386static __inline__ vector unsigned long long __ATTRS_o_ai
4387vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4388 return __builtin_altivec_vmaxud(__a, __b);
4389}
4390
4391static __inline__ vector unsigned long long __ATTRS_o_ai
4392vec_max(vector bool long long __a, vector unsigned long long __b) {
4393 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4394}
4395
4396static __inline__ vector unsigned long long __ATTRS_o_ai
4397vec_max(vector unsigned long long __a, vector bool long long __b) {
4398 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4399}
4400#endif
4401
4402static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4403 vector float __b) {
4404#ifdef __VSX__
4405 return __builtin_vsx_xvmaxsp(__a, __b);
4406#else
4407 return __builtin_altivec_vmaxfp(__a, __b);
4408#endif
4409}
4410
4411#ifdef __VSX__
4412static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4413 vector double __b) {
4414 return __builtin_vsx_xvmaxdp(__a, __b);
4415}
4416#endif
4417
4418/* vec_vmaxsb */
4419
4420static __inline__ vector signed char __ATTRS_o_ai
4421vec_vmaxsb(vector signed char __a, vector signed char __b) {
4422 return __builtin_altivec_vmaxsb(__a, __b);
4423}
4424
4425static __inline__ vector signed char __ATTRS_o_ai
4426vec_vmaxsb(vector bool char __a, vector signed char __b) {
4427 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4428}
4429
4430static __inline__ vector signed char __ATTRS_o_ai
4431vec_vmaxsb(vector signed char __a, vector bool char __b) {
4432 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4433}
4434
4435/* vec_vmaxub */
4436
4437static __inline__ vector unsigned char __ATTRS_o_ai
4438vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4439 return __builtin_altivec_vmaxub(__a, __b);
4440}
4441
4442static __inline__ vector unsigned char __ATTRS_o_ai
4443vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4444 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4445}
4446
4447static __inline__ vector unsigned char __ATTRS_o_ai
4448vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4449 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4450}
4451
4452/* vec_vmaxsh */
4453
4454static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4455 vector short __b) {
4456 return __builtin_altivec_vmaxsh(__a, __b);
4457}
4458
4459static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4460 vector short __b) {
4461 return __builtin_altivec_vmaxsh((vector short)__a, __b);
4462}
4463
4464static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4465 vector bool short __b) {
4466 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4467}
4468
4469/* vec_vmaxuh */
4470
4471static __inline__ vector unsigned short __ATTRS_o_ai
4472vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4473 return __builtin_altivec_vmaxuh(__a, __b);
4474}
4475
4476static __inline__ vector unsigned short __ATTRS_o_ai
4477vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4478 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4479}
4480
4481static __inline__ vector unsigned short __ATTRS_o_ai
4482vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4483 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4484}
4485
4486/* vec_vmaxsw */
4487
4488static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4489 vector int __b) {
4490 return __builtin_altivec_vmaxsw(__a, __b);
4491}
4492
4493static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4494 vector int __b) {
4495 return __builtin_altivec_vmaxsw((vector int)__a, __b);
4496}
4497
4498static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4499 vector bool int __b) {
4500 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4501}
4502
4503/* vec_vmaxuw */
4504
4505static __inline__ vector unsigned int __ATTRS_o_ai
4506vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4507 return __builtin_altivec_vmaxuw(__a, __b);
4508}
4509
4510static __inline__ vector unsigned int __ATTRS_o_ai
4511vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4512 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4513}
4514
4515static __inline__ vector unsigned int __ATTRS_o_ai
4516vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4517 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4518}
4519
4520/* vec_vmaxfp */
4521
4522static __inline__ vector float __attribute__((__always_inline__))
4523vec_vmaxfp(vector float __a, vector float __b) {
4524#ifdef __VSX__
4525 return __builtin_vsx_xvmaxsp(__a, __b);
4526#else
4527 return __builtin_altivec_vmaxfp(__a, __b);
4528#endif
4529}
4530
4531/* vec_mergeh */
4532
4533static __inline__ vector signed char __ATTRS_o_ai
4534vec_mergeh(vector signed char __a, vector signed char __b) {
4535 return vec_perm(__a, __b,
4536 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4537 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4538 0x06, 0x16, 0x07, 0x17));
4539}
4540
4541static __inline__ vector unsigned char __ATTRS_o_ai
4542vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4543 return vec_perm(__a, __b,
4544 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4545 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4546 0x06, 0x16, 0x07, 0x17));
4547}
4548
4549static __inline__ vector bool char __ATTRS_o_ai
4550vec_mergeh(vector bool char __a, vector bool char __b) {
4551 return vec_perm(__a, __b,
4552 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4553 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4554 0x06, 0x16, 0x07, 0x17));
4555}
4556
4557static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4558 vector short __b) {
4559 return vec_perm(__a, __b,
4560 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4561 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4562 0x06, 0x07, 0x16, 0x17));
4563}
4564
4565static __inline__ vector unsigned short __ATTRS_o_ai
4566vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4567 return vec_perm(__a, __b,
4568 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4569 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4570 0x06, 0x07, 0x16, 0x17));
4571}
4572
4573static __inline__ vector bool short __ATTRS_o_ai
4574vec_mergeh(vector bool short __a, vector bool short __b) {
4575 return vec_perm(__a, __b,
4576 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4577 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4578 0x06, 0x07, 0x16, 0x17));
4579}
4580
4581static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4582 vector pixel __b) {
4583 return vec_perm(__a, __b,
4584 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4585 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4586 0x06, 0x07, 0x16, 0x17));
4587}
4588
4589static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4590 vector int __b) {
4591 return vec_perm(__a, __b,
4592 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4593 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4594 0x14, 0x15, 0x16, 0x17));
4595}
4596
4597static __inline__ vector unsigned int __ATTRS_o_ai
4598vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4599 return vec_perm(__a, __b,
4600 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4601 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4602 0x14, 0x15, 0x16, 0x17));
4603}
4604
4605static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4606 vector bool int __b) {
4607 return vec_perm(__a, __b,
4608 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4609 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4610 0x14, 0x15, 0x16, 0x17));
4611}
4612
4613static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4614 vector float __b) {
4615 return vec_perm(__a, __b,
4616 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4617 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4618 0x14, 0x15, 0x16, 0x17));
4619}
4620
4621#ifdef __VSX__
4622static __inline__ vector signed long long __ATTRS_o_ai
4623vec_mergeh(vector signed long long __a, vector signed long long __b) {
4624 return vec_perm(__a, __b,
4625 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4626 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4627 0x14, 0x15, 0x16, 0x17));
4628}
4629
4630static __inline__ vector signed long long __ATTRS_o_ai
4631vec_mergeh(vector signed long long __a, vector bool long long __b) {
4632 return vec_perm(__a, (vector signed long long)__b,
4633 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4634 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4635 0x14, 0x15, 0x16, 0x17));
4636}
4637
4638static __inline__ vector signed long long __ATTRS_o_ai
4639vec_mergeh(vector bool long long __a, vector signed long long __b) {
4640 return vec_perm((vector signed long long)__a, __b,
4641 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4642 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4643 0x14, 0x15, 0x16, 0x17));
4644}
4645
4646static __inline__ vector unsigned long long __ATTRS_o_ai
4647vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4648 return vec_perm(__a, __b,
4649 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4650 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4651 0x14, 0x15, 0x16, 0x17));
4652}
4653
4654static __inline__ vector unsigned long long __ATTRS_o_ai
4655vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4656 return vec_perm(__a, (vector unsigned long long)__b,
4657 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4658 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4659 0x14, 0x15, 0x16, 0x17));
4660}
4661
4662static __inline__ vector unsigned long long __ATTRS_o_ai
4663vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4664 return vec_perm((vector unsigned long long)__a, __b,
4665 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4666 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4667 0x14, 0x15, 0x16, 0x17));
4668}
4669
4670static __inline__ vector bool long long __ATTRS_o_ai
4671vec_mergeh(vector bool long long __a, vector bool long long __b) {
4672 return vec_perm(__a, __b,
4673 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4674 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4675 0x14, 0x15, 0x16, 0x17));
4676}
4677
4678static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4679 vector double __b) {
4680 return vec_perm(__a, __b,
4681 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4682 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4683 0x14, 0x15, 0x16, 0x17));
4684}
4685static __inline__ vector double __ATTRS_o_ai
4686vec_mergeh(vector double __a, vector bool long long __b) {
4687 return vec_perm(__a, (vector double)__b,
4688 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4689 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4690 0x14, 0x15, 0x16, 0x17));
4691}
4692static __inline__ vector double __ATTRS_o_ai
4693vec_mergeh(vector bool long long __a, vector double __b) {
4694 return vec_perm((vector double)__a, __b,
4695 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4696 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4697 0x14, 0x15, 0x16, 0x17));
4698}
4699#endif
4700
4701/* vec_vmrghb */
4702
4703#define __builtin_altivec_vmrghb vec_vmrghb
4704
4705static __inline__ vector signed char __ATTRS_o_ai
4706vec_vmrghb(vector signed char __a, vector signed char __b) {
4707 return vec_perm(__a, __b,
4708 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4709 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4710 0x06, 0x16, 0x07, 0x17));
4711}
4712
4713static __inline__ vector unsigned char __ATTRS_o_ai
4714vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4715 return vec_perm(__a, __b,
4716 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4717 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4718 0x06, 0x16, 0x07, 0x17));
4719}
4720
4721static __inline__ vector bool char __ATTRS_o_ai
4722vec_vmrghb(vector bool char __a, vector bool char __b) {
4723 return vec_perm(__a, __b,
4724 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4725 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4726 0x06, 0x16, 0x07, 0x17));
4727}
4728
4729/* vec_vmrghh */
4730
4731#define __builtin_altivec_vmrghh vec_vmrghh
4732
4733static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4734 vector short __b) {
4735 return vec_perm(__a, __b,
4736 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4737 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4738 0x06, 0x07, 0x16, 0x17));
4739}
4740
4741static __inline__ vector unsigned short __ATTRS_o_ai
4742vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4743 return vec_perm(__a, __b,
4744 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4745 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4746 0x06, 0x07, 0x16, 0x17));
4747}
4748
4749static __inline__ vector bool short __ATTRS_o_ai
4750vec_vmrghh(vector bool short __a, vector bool short __b) {
4751 return vec_perm(__a, __b,
4752 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4753 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4754 0x06, 0x07, 0x16, 0x17));
4755}
4756
4757static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4758 vector pixel __b) {
4759 return vec_perm(__a, __b,
4760 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4761 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4762 0x06, 0x07, 0x16, 0x17));
4763}
4764
4765/* vec_vmrghw */
4766
4767#define __builtin_altivec_vmrghw vec_vmrghw
4768
4769static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4770 vector int __b) {
4771 return vec_perm(__a, __b,
4772 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4773 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4774 0x14, 0x15, 0x16, 0x17));
4775}
4776
4777static __inline__ vector unsigned int __ATTRS_o_ai
4778vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4779 return vec_perm(__a, __b,
4780 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4781 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4782 0x14, 0x15, 0x16, 0x17));
4783}
4784
4785static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4786 vector bool int __b) {
4787 return vec_perm(__a, __b,
4788 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4789 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4790 0x14, 0x15, 0x16, 0x17));
4791}
4792
4793static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4794 vector float __b) {
4795 return vec_perm(__a, __b,
4796 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4797 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4798 0x14, 0x15, 0x16, 0x17));
4799}
4800
4801/* vec_mergel */
4802
4803static __inline__ vector signed char __ATTRS_o_ai
4804vec_mergel(vector signed char __a, vector signed char __b) {
4805 return vec_perm(__a, __b,
4806 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4807 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4808 0x0E, 0x1E, 0x0F, 0x1F));
4809}
4810
4811static __inline__ vector unsigned char __ATTRS_o_ai
4812vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4813 return vec_perm(__a, __b,
4814 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4815 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4816 0x0E, 0x1E, 0x0F, 0x1F));
4817}
4818
4819static __inline__ vector bool char __ATTRS_o_ai
4820vec_mergel(vector bool char __a, vector bool char __b) {
4821 return vec_perm(__a, __b,
4822 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4823 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4824 0x0E, 0x1E, 0x0F, 0x1F));
4825}
4826
4827static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4828 vector short __b) {
4829 return vec_perm(__a, __b,
4830 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4831 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4832 0x0E, 0x0F, 0x1E, 0x1F));
4833}
4834
4835static __inline__ vector unsigned short __ATTRS_o_ai
4836vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4837 return vec_perm(__a, __b,
4838 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4839 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4840 0x0E, 0x0F, 0x1E, 0x1F));
4841}
4842
4843static __inline__ vector bool short __ATTRS_o_ai
4844vec_mergel(vector bool short __a, vector bool short __b) {
4845 return vec_perm(__a, __b,
4846 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4847 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4848 0x0E, 0x0F, 0x1E, 0x1F));
4849}
4850
4851static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4852 vector pixel __b) {
4853 return vec_perm(__a, __b,
4854 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4855 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4856 0x0E, 0x0F, 0x1E, 0x1F));
4857}
4858
4859static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4860 vector int __b) {
4861 return vec_perm(__a, __b,
4862 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4863 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4864 0x1C, 0x1D, 0x1E, 0x1F));
4865}
4866
4867static __inline__ vector unsigned int __ATTRS_o_ai
4868vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4869 return vec_perm(__a, __b,
4870 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4871 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4872 0x1C, 0x1D, 0x1E, 0x1F));
4873}
4874
4875static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4876 vector bool int __b) {
4877 return vec_perm(__a, __b,
4878 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4879 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4880 0x1C, 0x1D, 0x1E, 0x1F));
4881}
4882
4883static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4884 vector float __b) {
4885 return vec_perm(__a, __b,
4886 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4887 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4888 0x1C, 0x1D, 0x1E, 0x1F));
4889}
4890
4891#ifdef __VSX__
4892static __inline__ vector signed long long __ATTRS_o_ai
4893vec_mergel(vector signed long long __a, vector signed long long __b) {
4894 return vec_perm(__a, __b,
4895 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4896 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4897 0x1C, 0x1D, 0x1E, 0x1F));
4898}
4899static __inline__ vector signed long long __ATTRS_o_ai
4900vec_mergel(vector signed long long __a, vector bool long long __b) {
4901 return vec_perm(__a, (vector signed long long)__b,
4902 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4903 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4904 0x1C, 0x1D, 0x1E, 0x1F));
4905}
4906static __inline__ vector signed long long __ATTRS_o_ai
4907vec_mergel(vector bool long long __a, vector signed long long __b) {
4908 return vec_perm((vector signed long long)__a, __b,
4909 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4910 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4911 0x1C, 0x1D, 0x1E, 0x1F));
4912}
4913static __inline__ vector unsigned long long __ATTRS_o_ai
4914vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4915 return vec_perm(__a, __b,
4916 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4917 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4918 0x1C, 0x1D, 0x1E, 0x1F));
4919}
4920static __inline__ vector unsigned long long __ATTRS_o_ai
4921vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4922 return vec_perm(__a, (vector unsigned long long)__b,
4923 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4924 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4925 0x1C, 0x1D, 0x1E, 0x1F));
4926}
4927static __inline__ vector unsigned long long __ATTRS_o_ai
4928vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4929 return vec_perm((vector unsigned long long)__a, __b,
4930 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4931 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4932 0x1C, 0x1D, 0x1E, 0x1F));
4933}
4934static __inline__ vector bool long long __ATTRS_o_ai
4935vec_mergel(vector bool long long __a, vector bool long long __b) {
4936 return vec_perm(__a, __b,
4937 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4938 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4939 0x1C, 0x1D, 0x1E, 0x1F));
4940}
4941static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4942 vector double __b) {
4943 return vec_perm(__a, __b,
4944 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4945 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4946 0x1C, 0x1D, 0x1E, 0x1F));
4947}
4948static __inline__ vector double __ATTRS_o_ai
4949vec_mergel(vector double __a, vector bool long long __b) {
4950 return vec_perm(__a, (vector double)__b,
4951 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4952 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4953 0x1C, 0x1D, 0x1E, 0x1F));
4954}
4955static __inline__ vector double __ATTRS_o_ai
4956vec_mergel(vector bool long long __a, vector double __b) {
4957 return vec_perm((vector double)__a, __b,
4958 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4959 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4960 0x1C, 0x1D, 0x1E, 0x1F));
4961}
4962#endif
4963
4964/* vec_vmrglb */
4965
4966#define __builtin_altivec_vmrglb vec_vmrglb
4967
4968static __inline__ vector signed char __ATTRS_o_ai
4969vec_vmrglb(vector signed char __a, vector signed char __b) {
4970 return vec_perm(__a, __b,
4971 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4972 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4973 0x0E, 0x1E, 0x0F, 0x1F));
4974}
4975
4976static __inline__ vector unsigned char __ATTRS_o_ai
4977vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4978 return vec_perm(__a, __b,
4979 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4980 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4981 0x0E, 0x1E, 0x0F, 0x1F));
4982}
4983
4984static __inline__ vector bool char __ATTRS_o_ai
4985vec_vmrglb(vector bool char __a, vector bool char __b) {
4986 return vec_perm(__a, __b,
4987 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4988 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4989 0x0E, 0x1E, 0x0F, 0x1F));
4990}
4991
4992/* vec_vmrglh */
4993
4994#define __builtin_altivec_vmrglh vec_vmrglh
4995
4996static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4997 vector short __b) {
4998 return vec_perm(__a, __b,
4999 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5000 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5001 0x0E, 0x0F, 0x1E, 0x1F));
5002}
5003
5004static __inline__ vector unsigned short __ATTRS_o_ai
5005vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
5006 return vec_perm(__a, __b,
5007 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5008 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5009 0x0E, 0x0F, 0x1E, 0x1F));
5010}
5011
5012static __inline__ vector bool short __ATTRS_o_ai
5013vec_vmrglh(vector bool short __a, vector bool short __b) {
5014 return vec_perm(__a, __b,
5015 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5016 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5017 0x0E, 0x0F, 0x1E, 0x1F));
5018}
5019
5020static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
5021 vector pixel __b) {
5022 return vec_perm(__a, __b,
5023 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
5024 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
5025 0x0E, 0x0F, 0x1E, 0x1F));
5026}
5027
5028/* vec_vmrglw */
5029
5030#define __builtin_altivec_vmrglw vec_vmrglw
5031
5032static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
5033 vector int __b) {
5034 return vec_perm(__a, __b,
5035 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5036 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5037 0x1C, 0x1D, 0x1E, 0x1F));
5038}
5039
5040static __inline__ vector unsigned int __ATTRS_o_ai
5041vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
5042 return vec_perm(__a, __b,
5043 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5044 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5045 0x1C, 0x1D, 0x1E, 0x1F));
5046}
5047
5048static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
5049 vector bool int __b) {
5050 return vec_perm(__a, __b,
5051 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5052 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5053 0x1C, 0x1D, 0x1E, 0x1F));
5054}
5055
5056static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5057 vector float __b) {
5058 return vec_perm(__a, __b,
5059 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5060 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5061 0x1C, 0x1D, 0x1E, 0x1F));
5062}
5063
5064#ifdef __POWER8_VECTOR__
5065/* vec_mergee */
5066
5067static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5068 vector bool int __b) {
5069 return vec_perm(__a, __b,
5070 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5071 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5072 0x18, 0x19, 0x1A, 0x1B));
5073}
5074
5075static __inline__ vector signed int __ATTRS_o_ai
5076vec_mergee(vector signed int __a, vector signed int __b) {
5077 return vec_perm(__a, __b,
5078 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5079 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5080 0x18, 0x19, 0x1A, 0x1B));
5081}
5082
5083static __inline__ vector unsigned int __ATTRS_o_ai
5084vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5085 return vec_perm(__a, __b,
5086 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5087 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5088 0x18, 0x19, 0x1A, 0x1B));
5089}
5090
5091static __inline__ vector bool long long __ATTRS_o_ai
5092vec_mergee(vector bool long long __a, vector bool long long __b) {
5093 return vec_mergeh(__a, __b);
5094}
5095
5096static __inline__ vector signed long long __ATTRS_o_ai
5097vec_mergee(vector signed long long __a, vector signed long long __b) {
5098 return vec_mergeh(__a, __b);
5099}
5100
5101static __inline__ vector unsigned long long __ATTRS_o_ai
5102vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5103 return vec_mergeh(__a, __b);
5104}
5105
5106static __inline__ vector float __ATTRS_o_ai
5107vec_mergee(vector float __a, vector float __b) {
5108 return vec_perm(__a, __b,
5109 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5110 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5111 0x18, 0x19, 0x1A, 0x1B));
5112}
5113
5114static __inline__ vector double __ATTRS_o_ai
5115vec_mergee(vector double __a, vector double __b) {
5116 return vec_mergeh(__a, __b);
5117}
5118
5119/* vec_mergeo */
5120
5121static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5122 vector bool int __b) {
5123 return vec_perm(__a, __b,
5124 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5125 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5126 0x1C, 0x1D, 0x1E, 0x1F));
5127}
5128
5129static __inline__ vector signed int __ATTRS_o_ai
5130vec_mergeo(vector signed int __a, vector signed int __b) {
5131 return vec_perm(__a, __b,
5132 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5133 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5134 0x1C, 0x1D, 0x1E, 0x1F));
5135}
5136
5137static __inline__ vector unsigned int __ATTRS_o_ai
5138vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5139 return vec_perm(__a, __b,
5140 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5141 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5142 0x1C, 0x1D, 0x1E, 0x1F));
5143}
5144
5145static __inline__ vector bool long long __ATTRS_o_ai
5146vec_mergeo(vector bool long long __a, vector bool long long __b) {
5147 return vec_mergel(__a, __b);
5148}
5149
5150static __inline__ vector signed long long __ATTRS_o_ai
5151vec_mergeo(vector signed long long __a, vector signed long long __b) {
5152 return vec_mergel(__a, __b);
5153}
5154
5155static __inline__ vector unsigned long long __ATTRS_o_ai
5156vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5157 return vec_mergel(__a, __b);
5158}
5159
5160static __inline__ vector float __ATTRS_o_ai
5161vec_mergeo(vector float __a, vector float __b) {
5162 return vec_perm(__a, __b,
5163 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5164 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5165 0x1C, 0x1D, 0x1E, 0x1F));
5166}
5167
5168static __inline__ vector double __ATTRS_o_ai
5169vec_mergeo(vector double __a, vector double __b) {
5170 return vec_mergel(__a, __b);
5171}
5172
5173#endif
5174
5175/* vec_mfvscr */
5176
5177static __inline__ vector unsigned short __attribute__((__always_inline__))
5178vec_mfvscr(void) {
5179 return __builtin_altivec_mfvscr();
5180}
5181
5182/* vec_min */
5183
5184static __inline__ vector signed char __ATTRS_o_ai
5185vec_min(vector signed char __a, vector signed char __b) {
5186 return __builtin_altivec_vminsb(__a, __b);
5187}
5188
5189static __inline__ vector signed char __ATTRS_o_ai
5190vec_min(vector bool char __a, vector signed char __b) {
5191 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5192}
5193
5194static __inline__ vector signed char __ATTRS_o_ai
5195vec_min(vector signed char __a, vector bool char __b) {
5196 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5197}
5198
5199static __inline__ vector unsigned char __ATTRS_o_ai
5200vec_min(vector unsigned char __a, vector unsigned char __b) {
5201 return __builtin_altivec_vminub(__a, __b);
5202}
5203
5204static __inline__ vector unsigned char __ATTRS_o_ai
5205vec_min(vector bool char __a, vector unsigned char __b) {
5206 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5207}
5208
5209static __inline__ vector unsigned char __ATTRS_o_ai
5210vec_min(vector unsigned char __a, vector bool char __b) {
5211 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5212}
5213
5214static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5215 vector short __b) {
5216 return __builtin_altivec_vminsh(__a, __b);
5217}
5218
5219static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5220 vector short __b) {
5221 return __builtin_altivec_vminsh((vector short)__a, __b);
5222}
5223
5224static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5225 vector bool short __b) {
5226 return __builtin_altivec_vminsh(__a, (vector short)__b);
5227}
5228
5229static __inline__ vector unsigned short __ATTRS_o_ai
5230vec_min(vector unsigned short __a, vector unsigned short __b) {
5231 return __builtin_altivec_vminuh(__a, __b);
5232}
5233
5234static __inline__ vector unsigned short __ATTRS_o_ai
5235vec_min(vector bool short __a, vector unsigned short __b) {
5236 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5237}
5238
5239static __inline__ vector unsigned short __ATTRS_o_ai
5240vec_min(vector unsigned short __a, vector bool short __b) {
5241 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5242}
5243
5244static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5245 vector int __b) {
5246 return __builtin_altivec_vminsw(__a, __b);
5247}
5248
5249static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
5250 vector int __b) {
5251 return __builtin_altivec_vminsw((vector int)__a, __b);
5252}
5253
5254static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
5255 vector bool int __b) {
5256 return __builtin_altivec_vminsw(__a, (vector int)__b);
5257}
5258
5259static __inline__ vector unsigned int __ATTRS_o_ai
5260vec_min(vector unsigned int __a, vector unsigned int __b) {
5261 return __builtin_altivec_vminuw(__a, __b);
5262}
5263
5264static __inline__ vector unsigned int __ATTRS_o_ai
5265vec_min(vector bool int __a, vector unsigned int __b) {
5266 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5267}
5268
5269static __inline__ vector unsigned int __ATTRS_o_ai
5270vec_min(vector unsigned int __a, vector bool int __b) {
5271 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5272}
5273
5274#ifdef __POWER8_VECTOR__
5275static __inline__ vector signed long long __ATTRS_o_ai
5276vec_min(vector signed long long __a, vector signed long long __b) {
5277 return __builtin_altivec_vminsd(__a, __b);
5278}
5279
5280static __inline__ vector signed long long __ATTRS_o_ai
5281vec_min(vector bool long long __a, vector signed long long __b) {
5282 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
5283}
5284
5285static __inline__ vector signed long long __ATTRS_o_ai
5286vec_min(vector signed long long __a, vector bool long long __b) {
5287 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
5288}
5289
5290static __inline__ vector unsigned long long __ATTRS_o_ai
5291vec_min(vector unsigned long long __a, vector unsigned long long __b) {
5292 return __builtin_altivec_vminud(__a, __b);
5293}
5294
5295static __inline__ vector unsigned long long __ATTRS_o_ai
5296vec_min(vector bool long long __a, vector unsigned long long __b) {
5297 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
5298}
5299
5300static __inline__ vector unsigned long long __ATTRS_o_ai
5301vec_min(vector unsigned long long __a, vector bool long long __b) {
5302 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
5303}
5304#endif
5305
5306static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
5307 vector float __b) {
5308#ifdef __VSX__
5309 return __builtin_vsx_xvminsp(__a, __b);
5310#else
5311 return __builtin_altivec_vminfp(__a, __b);
5312#endif
5313}
5314
5315#ifdef __VSX__
5316static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
5317 vector double __b) {
5318 return __builtin_vsx_xvmindp(__a, __b);
5319}
5320#endif
5321
5322/* vec_vminsb */
5323
5324static __inline__ vector signed char __ATTRS_o_ai
5325vec_vminsb(vector signed char __a, vector signed char __b) {
5326 return __builtin_altivec_vminsb(__a, __b);
5327}
5328
5329static __inline__ vector signed char __ATTRS_o_ai
5330vec_vminsb(vector bool char __a, vector signed char __b) {
5331 return __builtin_altivec_vminsb((vector signed char)__a, __b);
5332}
5333
5334static __inline__ vector signed char __ATTRS_o_ai
5335vec_vminsb(vector signed char __a, vector bool char __b) {
5336 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5337}
5338
5339/* vec_vminub */
5340
5341static __inline__ vector unsigned char __ATTRS_o_ai
5342vec_vminub(vector unsigned char __a, vector unsigned char __b) {
5343 return __builtin_altivec_vminub(__a, __b);
5344}
5345
5346static __inline__ vector unsigned char __ATTRS_o_ai
5347vec_vminub(vector bool char __a, vector unsigned char __b) {
5348 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5349}
5350
5351static __inline__ vector unsigned char __ATTRS_o_ai
5352vec_vminub(vector unsigned char __a, vector bool char __b) {
5353 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5354}
5355
5356/* vec_vminsh */
5357
5358static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5359 vector short __b) {
5360 return __builtin_altivec_vminsh(__a, __b);
5361}
5362
5363static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
5364 vector short __b) {
5365 return __builtin_altivec_vminsh((vector short)__a, __b);
5366}
5367
5368static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
5369 vector bool short __b) {
5370 return __builtin_altivec_vminsh(__a, (vector short)__b);
5371}
5372
5373/* vec_vminuh */
5374
5375static __inline__ vector unsigned short __ATTRS_o_ai
5376vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
5377 return __builtin_altivec_vminuh(__a, __b);
5378}
5379
5380static __inline__ vector unsigned short __ATTRS_o_ai
5381vec_vminuh(vector bool short __a, vector unsigned short __b) {
5382 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
5383}
5384
5385static __inline__ vector unsigned short __ATTRS_o_ai
5386vec_vminuh(vector unsigned short __a, vector bool short __b) {
5387 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
5388}
5389
5390/* vec_vminsw */
5391
5392static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5393 vector int __b) {
5394 return __builtin_altivec_vminsw(__a, __b);
5395}
5396
5397static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
5398 vector int __b) {
5399 return __builtin_altivec_vminsw((vector int)__a, __b);
5400}
5401
5402static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
5403 vector bool int __b) {
5404 return __builtin_altivec_vminsw(__a, (vector int)__b);
5405}
5406
5407/* vec_vminuw */
5408
5409static __inline__ vector unsigned int __ATTRS_o_ai
5410vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
5411 return __builtin_altivec_vminuw(__a, __b);
5412}
5413
5414static __inline__ vector unsigned int __ATTRS_o_ai
5415vec_vminuw(vector bool int __a, vector unsigned int __b) {
5416 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
5417}
5418
5419static __inline__ vector unsigned int __ATTRS_o_ai
5420vec_vminuw(vector unsigned int __a, vector bool int __b) {
5421 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
5422}
5423
5424/* vec_vminfp */
5425
5426static __inline__ vector float __attribute__((__always_inline__))
5427vec_vminfp(vector float __a, vector float __b) {
5428#ifdef __VSX__
5429 return __builtin_vsx_xvminsp(__a, __b);
5430#else
5431 return __builtin_altivec_vminfp(__a, __b);
5432#endif
5433}
5434
5435/* vec_mladd */
5436
5437#define __builtin_altivec_vmladduhm vec_mladd
5438
5439static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
5440 vector short __b,
5441 vector short __c) {
5442 return __a * __b + __c;
5443}
5444
5445static __inline__ vector short __ATTRS_o_ai vec_mladd(
5446 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5447 return __a * (vector short)__b + (vector short)__c;
5448}
5449
5450static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
5451 vector short __b,
5452 vector short __c) {
5453 return (vector short)__a * __b + __c;
5454}
5455
5456static __inline__ vector unsigned short __ATTRS_o_ai
5457vec_mladd(vector unsigned short __a, vector unsigned short __b,
5458 vector unsigned short __c) {
5459 return __a * __b + __c;
5460}
5461
5462/* vec_vmladduhm */
5463
5464static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
5465 vector short __b,
5466 vector short __c) {
5467 return __a * __b + __c;
5468}
5469
5470static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
5471 vector short __a, vector unsigned short __b, vector unsigned short __c) {
5472 return __a * (vector short)__b + (vector short)__c;
5473}
5474
5475static __inline__ vector short __ATTRS_o_ai
5476vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
5477 return (vector short)__a * __b + __c;
5478}
5479
5480static __inline__ vector unsigned short __ATTRS_o_ai
5481vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
5482 vector unsigned short __c) {
5483 return __a * __b + __c;
5484}
5485
5486/* vec_mradds */
5487
5488static __inline__ vector short __attribute__((__always_inline__))
5489vec_mradds(vector short __a, vector short __b, vector short __c) {
5490 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5491}
5492
5493/* vec_vmhraddshs */
5494
5495static __inline__ vector short __attribute__((__always_inline__))
5496vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
5497 return __builtin_altivec_vmhraddshs(__a, __b, __c);
5498}
5499
5500/* vec_msum */
5501
5502static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
5503 vector unsigned char __b,
5504 vector int __c) {
5505 return __builtin_altivec_vmsummbm(__a, __b, __c);
5506}
5507
5508static __inline__ vector unsigned int __ATTRS_o_ai
5509vec_msum(vector unsigned char __a, vector unsigned char __b,
5510 vector unsigned int __c) {
5511 return __builtin_altivec_vmsumubm(__a, __b, __c);
5512}
5513
5514static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
5515 vector short __b,
5516 vector int __c) {
5517 return __builtin_altivec_vmsumshm(__a, __b, __c);
5518}
5519
5520static __inline__ vector unsigned int __ATTRS_o_ai
5521vec_msum(vector unsigned short __a, vector unsigned short __b,
5522 vector unsigned int __c) {
5523 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5524}
5525
5526/* vec_vmsummbm */
5527
5528static __inline__ vector int __attribute__((__always_inline__))
5529vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
5530 return __builtin_altivec_vmsummbm(__a, __b, __c);
5531}
5532
5533/* vec_vmsumubm */
5534
5535static __inline__ vector unsigned int __attribute__((__always_inline__))
5536vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
5537 vector unsigned int __c) {
5538 return __builtin_altivec_vmsumubm(__a, __b, __c);
5539}
5540
5541/* vec_vmsumshm */
5542
5543static __inline__ vector int __attribute__((__always_inline__))
5544vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
5545 return __builtin_altivec_vmsumshm(__a, __b, __c);
5546}
5547
5548/* vec_vmsumuhm */
5549
5550static __inline__ vector unsigned int __attribute__((__always_inline__))
5551vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
5552 vector unsigned int __c) {
5553 return __builtin_altivec_vmsumuhm(__a, __b, __c);
5554}
5555
5556/* vec_msums */
5557
5558static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
5559 vector short __b,
5560 vector int __c) {
5561 return __builtin_altivec_vmsumshs(__a, __b, __c);
5562}
5563
5564static __inline__ vector unsigned int __ATTRS_o_ai
5565vec_msums(vector unsigned short __a, vector unsigned short __b,
5566 vector unsigned int __c) {
5567 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5568}
5569
5570/* vec_vmsumshs */
5571
5572static __inline__ vector int __attribute__((__always_inline__))
5573vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
5574 return __builtin_altivec_vmsumshs(__a, __b, __c);
5575}
5576
5577/* vec_vmsumuhs */
5578
5579static __inline__ vector unsigned int __attribute__((__always_inline__))
5580vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
5581 vector unsigned int __c) {
5582 return __builtin_altivec_vmsumuhs(__a, __b, __c);
5583}
5584
5585/* vec_mtvscr */
5586
5587static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
5588 __builtin_altivec_mtvscr((vector int)__a);
5589}
5590
5591static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
5592 __builtin_altivec_mtvscr((vector int)__a);
5593}
5594
5595static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
5596 __builtin_altivec_mtvscr((vector int)__a);
5597}
5598
5599static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
5600 __builtin_altivec_mtvscr((vector int)__a);
5601}
5602
5603static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
5604 __builtin_altivec_mtvscr((vector int)__a);
5605}
5606
5607static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
5608 __builtin_altivec_mtvscr((vector int)__a);
5609}
5610
5611static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
5612 __builtin_altivec_mtvscr((vector int)__a);
5613}
5614
5615static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
5616 __builtin_altivec_mtvscr((vector int)__a);
5617}
5618
5619static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
5620 __builtin_altivec_mtvscr((vector int)__a);
5621}
5622
5623static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
5624 __builtin_altivec_mtvscr((vector int)__a);
5625}
5626
5627static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
5628 __builtin_altivec_mtvscr((vector int)__a);
5629}
5630
5631/* vec_mul */
5632
5633/* Integer vector multiplication will involve multiplication of the odd/even
5634 elements separately, then truncating the results and moving to the
5635 result vector.
5636*/
5637static __inline__ vector signed char __ATTRS_o_ai
5638vec_mul(vector signed char __a, vector signed char __b) {
5639 return __a * __b;
5640}
5641
5642static __inline__ vector unsigned char __ATTRS_o_ai
5643vec_mul(vector unsigned char __a, vector unsigned char __b) {
5644 return __a * __b;
5645}
5646
5647static __inline__ vector signed short __ATTRS_o_ai
5648vec_mul(vector signed short __a, vector signed short __b) {
5649 return __a * __b;
5650}
5651
5652static __inline__ vector unsigned short __ATTRS_o_ai
5653vec_mul(vector unsigned short __a, vector unsigned short __b) {
5654 return __a * __b;
5655}
5656
5657static __inline__ vector signed int __ATTRS_o_ai
5658vec_mul(vector signed int __a, vector signed int __b) {
5659 return __a * __b;
5660}
5661
5662static __inline__ vector unsigned int __ATTRS_o_ai
5663vec_mul(vector unsigned int __a, vector unsigned int __b) {
5664 return __a * __b;
5665}
5666
5667#ifdef __VSX__
5668static __inline__ vector signed long long __ATTRS_o_ai
5669vec_mul(vector signed long long __a, vector signed long long __b) {
5670 return __a * __b;
5671}
5672
5673static __inline__ vector unsigned long long __ATTRS_o_ai
5674vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
5675 return __a * __b;
5676}
5677#endif
5678
5679static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
5680 vector float __b) {
5681 return __a * __b;
5682}
5683
5684#ifdef __VSX__
5685static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
5686 vector double __b) {
5687 return __a * __b;
5688}
5689#endif
5690
5691/* The vmulos* and vmules* instructions have a big endian bias, so
5692 we must reverse the meaning of "even" and "odd" for little endian. */
5693
5694/* vec_mule */
5695
5696static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
5697 vector signed char __b) {
5698#ifdef __LITTLE_ENDIAN__
5699 return __builtin_altivec_vmulosb(__a, __b);
5700#else
5701 return __builtin_altivec_vmulesb(__a, __b);
5702#endif
5703}
5704
5705static __inline__ vector unsigned short __ATTRS_o_ai
5706vec_mule(vector unsigned char __a, vector unsigned char __b) {
5707#ifdef __LITTLE_ENDIAN__
5708 return __builtin_altivec_vmuloub(__a, __b);
5709#else
5710 return __builtin_altivec_vmuleub(__a, __b);
5711#endif
5712}
5713
5714static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
5715 vector short __b) {
5716#ifdef __LITTLE_ENDIAN__
5717 return __builtin_altivec_vmulosh(__a, __b);
5718#else
5719 return __builtin_altivec_vmulesh(__a, __b);
5720#endif
5721}
5722
5723static __inline__ vector unsigned int __ATTRS_o_ai
5724vec_mule(vector unsigned short __a, vector unsigned short __b) {
5725#ifdef __LITTLE_ENDIAN__
5726 return __builtin_altivec_vmulouh(__a, __b);
5727#else
5728 return __builtin_altivec_vmuleuh(__a, __b);
5729#endif
5730}
5731
5732#ifdef __POWER8_VECTOR__
5733static __inline__ vector signed long long __ATTRS_o_ai
5734vec_mule(vector signed int __a, vector signed int __b) {
5735#ifdef __LITTLE_ENDIAN__
5736 return __builtin_altivec_vmulosw(__a, __b);
5737#else
5738 return __builtin_altivec_vmulesw(__a, __b);
5739#endif
5740}
5741
5742static __inline__ vector unsigned long long __ATTRS_o_ai
5743vec_mule(vector unsigned int __a, vector unsigned int __b) {
5744#ifdef __LITTLE_ENDIAN__
5745 return __builtin_altivec_vmulouw(__a, __b);
5746#else
5747 return __builtin_altivec_vmuleuw(__a, __b);
5748#endif
5749}
5750#endif
5751
5752/* vec_vmulesb */
5753
5754static __inline__ vector short __attribute__((__always_inline__))
5755vec_vmulesb(vector signed char __a, vector signed char __b) {
5756#ifdef __LITTLE_ENDIAN__
5757 return __builtin_altivec_vmulosb(__a, __b);
5758#else
5759 return __builtin_altivec_vmulesb(__a, __b);
5760#endif
5761}
5762
5763/* vec_vmuleub */
5764
5765static __inline__ vector unsigned short __attribute__((__always_inline__))
5766vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
5767#ifdef __LITTLE_ENDIAN__
5768 return __builtin_altivec_vmuloub(__a, __b);
5769#else
5770 return __builtin_altivec_vmuleub(__a, __b);
5771#endif
5772}
5773
5774/* vec_vmulesh */
5775
5776static __inline__ vector int __attribute__((__always_inline__))
5777vec_vmulesh(vector short __a, vector short __b) {
5778#ifdef __LITTLE_ENDIAN__
5779 return __builtin_altivec_vmulosh(__a, __b);
5780#else
5781 return __builtin_altivec_vmulesh(__a, __b);
5782#endif
5783}
5784
5785/* vec_vmuleuh */
5786
5787static __inline__ vector unsigned int __attribute__((__always_inline__))
5788vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
5789#ifdef __LITTLE_ENDIAN__
5790 return __builtin_altivec_vmulouh(__a, __b);
5791#else
5792 return __builtin_altivec_vmuleuh(__a, __b);
5793#endif
5794}
5795
5796/* vec_mulo */
5797
5798static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
5799 vector signed char __b) {
5800#ifdef __LITTLE_ENDIAN__
5801 return __builtin_altivec_vmulesb(__a, __b);
5802#else
5803 return __builtin_altivec_vmulosb(__a, __b);
5804#endif
5805}
5806
5807static __inline__ vector unsigned short __ATTRS_o_ai
5808vec_mulo(vector unsigned char __a, vector unsigned char __b) {
5809#ifdef __LITTLE_ENDIAN__
5810 return __builtin_altivec_vmuleub(__a, __b);
5811#else
5812 return __builtin_altivec_vmuloub(__a, __b);
5813#endif
5814}
5815
5816static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
5817 vector short __b) {
5818#ifdef __LITTLE_ENDIAN__
5819 return __builtin_altivec_vmulesh(__a, __b);
5820#else
5821 return __builtin_altivec_vmulosh(__a, __b);
5822#endif
5823}
5824
5825static __inline__ vector unsigned int __ATTRS_o_ai
5826vec_mulo(vector unsigned short __a, vector unsigned short __b) {
5827#ifdef __LITTLE_ENDIAN__
5828 return __builtin_altivec_vmuleuh(__a, __b);
5829#else
5830 return __builtin_altivec_vmulouh(__a, __b);
5831#endif
5832}
5833
5834#ifdef __POWER8_VECTOR__
5835static __inline__ vector signed long long __ATTRS_o_ai
5836vec_mulo(vector signed int __a, vector signed int __b) {
5837#ifdef __LITTLE_ENDIAN__
5838 return __builtin_altivec_vmulesw(__a, __b);
5839#else
5840 return __builtin_altivec_vmulosw(__a, __b);
5841#endif
5842}
5843
5844static __inline__ vector unsigned long long __ATTRS_o_ai
5845vec_mulo(vector unsigned int __a, vector unsigned int __b) {
5846#ifdef __LITTLE_ENDIAN__
5847 return __builtin_altivec_vmuleuw(__a, __b);
5848#else
5849 return __builtin_altivec_vmulouw(__a, __b);
5850#endif
5851}
5852#endif
5853
5854/* vec_vmulosb */
5855
5856static __inline__ vector short __attribute__((__always_inline__))
5857vec_vmulosb(vector signed char __a, vector signed char __b) {
5858#ifdef __LITTLE_ENDIAN__
5859 return __builtin_altivec_vmulesb(__a, __b);
5860#else
5861 return __builtin_altivec_vmulosb(__a, __b);
5862#endif
5863}
5864
5865/* vec_vmuloub */
5866
5867static __inline__ vector unsigned short __attribute__((__always_inline__))
5868vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
5869#ifdef __LITTLE_ENDIAN__
5870 return __builtin_altivec_vmuleub(__a, __b);
5871#else
5872 return __builtin_altivec_vmuloub(__a, __b);
5873#endif
5874}
5875
5876/* vec_vmulosh */
5877
5878static __inline__ vector int __attribute__((__always_inline__))
5879vec_vmulosh(vector short __a, vector short __b) {
5880#ifdef __LITTLE_ENDIAN__
5881 return __builtin_altivec_vmulesh(__a, __b);
5882#else
5883 return __builtin_altivec_vmulosh(__a, __b);
5884#endif
5885}
5886
5887/* vec_vmulouh */
5888
5889static __inline__ vector unsigned int __attribute__((__always_inline__))
5890vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
5891#ifdef __LITTLE_ENDIAN__
5892 return __builtin_altivec_vmuleuh(__a, __b);
5893#else
5894 return __builtin_altivec_vmulouh(__a, __b);
5895#endif
5896}
5897
5898/* vec_nand */
5899
5900#ifdef __POWER8_VECTOR__
5901static __inline__ vector signed char __ATTRS_o_ai
5902vec_nand(vector signed char __a, vector signed char __b) {
5903 return ~(__a & __b);
5904}
5905
5906static __inline__ vector signed char __ATTRS_o_ai
5907vec_nand(vector signed char __a, vector bool char __b) {
5908 return ~(__a & __b);
5909}
5910
5911static __inline__ vector signed char __ATTRS_o_ai
5912vec_nand(vector bool char __a, vector signed char __b) {
5913 return ~(__a & __b);
5914}
5915
5916static __inline__ vector unsigned char __ATTRS_o_ai
5917vec_nand(vector unsigned char __a, vector unsigned char __b) {
5918 return ~(__a & __b);
5919}
5920
5921static __inline__ vector unsigned char __ATTRS_o_ai
5922vec_nand(vector unsigned char __a, vector bool char __b) {
5923 return ~(__a & __b);
5924}
5925
5926static __inline__ vector unsigned char __ATTRS_o_ai
5927vec_nand(vector bool char __a, vector unsigned char __b) {
5928 return ~(__a & __b);
5929}
5930
5931static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
5932 vector bool char __b) {
5933 return ~(__a & __b);
5934}
5935
5936static __inline__ vector signed short __ATTRS_o_ai
5937vec_nand(vector signed short __a, vector signed short __b) {
5938 return ~(__a & __b);
5939}
5940
5941static __inline__ vector signed short __ATTRS_o_ai
5942vec_nand(vector signed short __a, vector bool short __b) {
5943 return ~(__a & __b);
5944}
5945
5946static __inline__ vector signed short __ATTRS_o_ai
5947vec_nand(vector bool short __a, vector signed short __b) {
5948 return ~(__a & __b);
5949}
5950
5951static __inline__ vector unsigned short __ATTRS_o_ai
5952vec_nand(vector unsigned short __a, vector unsigned short __b) {
5953 return ~(__a & __b);
5954}
5955
5956static __inline__ vector unsigned short __ATTRS_o_ai
5957vec_nand(vector unsigned short __a, vector bool short __b) {
5958 return ~(__a & __b);
5959}
5960
5961static __inline__ vector bool short __ATTRS_o_ai
5962vec_nand(vector bool short __a, vector bool short __b) {
5963 return ~(__a & __b);
5964}
5965
5966static __inline__ vector signed int __ATTRS_o_ai
5967vec_nand(vector signed int __a, vector signed int __b) {
5968 return ~(__a & __b);
5969}
5970
5971static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
5972 vector bool int __b) {
5973 return ~(__a & __b);
5974}
5975
5976static __inline__ vector signed int __ATTRS_o_ai
5977vec_nand(vector bool int __a, vector signed int __b) {
5978 return ~(__a & __b);
5979}
5980
5981static __inline__ vector unsigned int __ATTRS_o_ai
5982vec_nand(vector unsigned int __a, vector unsigned int __b) {
5983 return ~(__a & __b);
5984}
5985
5986static __inline__ vector unsigned int __ATTRS_o_ai
5987vec_nand(vector unsigned int __a, vector bool int __b) {
5988 return ~(__a & __b);
5989}
5990
5991static __inline__ vector unsigned int __ATTRS_o_ai
5992vec_nand(vector bool int __a, vector unsigned int __b) {
5993 return ~(__a & __b);
5994}
5995
5996static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
5997 vector bool int __b) {
5998 return ~(__a & __b);
5999}
6000
6001static __inline__ vector float __ATTRS_o_ai
6002vec_nand(vector float __a, vector float __b) {
6003 return (vector float)(~((vector unsigned int)__a &
6004 (vector unsigned int)__b));
6005}
6006
6007static __inline__ vector signed long long __ATTRS_o_ai
6008vec_nand(vector signed long long __a, vector signed long long __b) {
6009 return ~(__a & __b);
6010}
6011
6012static __inline__ vector signed long long __ATTRS_o_ai
6013vec_nand(vector signed long long __a, vector bool long long __b) {
6014 return ~(__a & __b);
6015}
6016
6017static __inline__ vector signed long long __ATTRS_o_ai
6018vec_nand(vector bool long long __a, vector signed long long __b) {
6019 return ~(__a & __b);
6020}
6021
6022static __inline__ vector unsigned long long __ATTRS_o_ai
6023vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
6024 return ~(__a & __b);
6025}
6026
6027static __inline__ vector unsigned long long __ATTRS_o_ai
6028vec_nand(vector unsigned long long __a, vector bool long long __b) {
6029 return ~(__a & __b);
6030}
6031
6032static __inline__ vector unsigned long long __ATTRS_o_ai
6033vec_nand(vector bool long long __a, vector unsigned long long __b) {
6034 return ~(__a & __b);
6035}
6036
6037static __inline__ vector bool long long __ATTRS_o_ai
6038vec_nand(vector bool long long __a, vector bool long long __b) {
6039 return ~(__a & __b);
6040}
6041
6042static __inline__ vector double __ATTRS_o_ai
6043vec_nand(vector double __a, vector double __b) {
6044 return (vector double)(~((vector unsigned long long)__a &
6045 (vector unsigned long long)__b));
6046}
6047
6048#endif
6049
6050/* vec_nmadd */
6051
6052#ifdef __VSX__
6053static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
6054 vector float __b,
6055 vector float __c) {
6056 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
6057}
6058
6059static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
6060 vector double __b,
6061 vector double __c) {
6062 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
6063}
6064#endif
6065
6066/* vec_nmsub */
6067
6068static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
6069 vector float __b,
6070 vector float __c) {
6071#ifdef __VSX__
6072 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
6073#else
6074 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6075#endif
6076}
6077
6078#ifdef __VSX__
6079static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
6080 vector double __b,
6081 vector double __c) {
6082 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
6083}
6084#endif
6085
6086/* vec_vnmsubfp */
6087
6088static __inline__ vector float __attribute__((__always_inline__))
6089vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
6090 return __builtin_altivec_vnmsubfp(__a, __b, __c);
6091}
6092
6093/* vec_nor */
6094
6095#define __builtin_altivec_vnor vec_nor
6096
6097static __inline__ vector signed char __ATTRS_o_ai
6098vec_nor(vector signed char __a, vector signed char __b) {
6099 return ~(__a | __b);
6100}
6101
6102static __inline__ vector unsigned char __ATTRS_o_ai
6103vec_nor(vector unsigned char __a, vector unsigned char __b) {
6104 return ~(__a | __b);
6105}
6106
6107static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
6108 vector bool char __b) {
6109 return ~(__a | __b);
6110}
6111
6112static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
6113 vector short __b) {
6114 return ~(__a | __b);
6115}
6116
6117static __inline__ vector unsigned short __ATTRS_o_ai
6118vec_nor(vector unsigned short __a, vector unsigned short __b) {
6119 return ~(__a | __b);
6120}
6121
6122static __inline__ vector bool short __ATTRS_o_ai
6123vec_nor(vector bool short __a, vector bool short __b) {
6124 return ~(__a | __b);
6125}
6126
6127static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
6128 vector int __b) {
6129 return ~(__a | __b);
6130}
6131
6132static __inline__ vector unsigned int __ATTRS_o_ai
6133vec_nor(vector unsigned int __a, vector unsigned int __b) {
6134 return ~(__a | __b);
6135}
6136
6137static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
6138 vector bool int __b) {
6139 return ~(__a | __b);
6140}
6141
6142static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
6143 vector float __b) {
6144 vector unsigned int __res =
6145 ~((vector unsigned int)__a | (vector unsigned int)__b);
6146 return (vector float)__res;
6147}
6148
6149#ifdef __VSX__
6150static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
6151 vector double __b) {
6152 vector unsigned long long __res =
6153 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
6154 return (vector double)__res;
6155}
6156#endif
6157
6158/* vec_vnor */
6159
6160static __inline__ vector signed char __ATTRS_o_ai
6161vec_vnor(vector signed char __a, vector signed char __b) {
6162 return ~(__a | __b);
6163}
6164
6165static __inline__ vector unsigned char __ATTRS_o_ai
6166vec_vnor(vector unsigned char __a, vector unsigned char __b) {
6167 return ~(__a | __b);
6168}
6169
6170static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
6171 vector bool char __b) {
6172 return ~(__a | __b);
6173}
6174
6175static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
6176 vector short __b) {
6177 return ~(__a | __b);
6178}
6179
6180static __inline__ vector unsigned short __ATTRS_o_ai
6181vec_vnor(vector unsigned short __a, vector unsigned short __b) {
6182 return ~(__a | __b);
6183}
6184
6185static __inline__ vector bool short __ATTRS_o_ai
6186vec_vnor(vector bool short __a, vector bool short __b) {
6187 return ~(__a | __b);
6188}
6189
6190static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
6191 vector int __b) {
6192 return ~(__a | __b);
6193}
6194
6195static __inline__ vector unsigned int __ATTRS_o_ai
6196vec_vnor(vector unsigned int __a, vector unsigned int __b) {
6197 return ~(__a | __b);
6198}
6199
6200static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
6201 vector bool int __b) {
6202 return ~(__a | __b);
6203}
6204
6205static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
6206 vector float __b) {
6207 vector unsigned int __res =
6208 ~((vector unsigned int)__a | (vector unsigned int)__b);
6209 return (vector float)__res;
6210}
6211
6212#ifdef __VSX__
6213static __inline__ vector signed long long __ATTRS_o_ai
6214vec_nor(vector signed long long __a, vector signed long long __b) {
6215 return ~(__a | __b);
6216}
6217
6218static __inline__ vector unsigned long long __ATTRS_o_ai
6219vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
6220 return ~(__a | __b);
6221}
6222
6223static __inline__ vector bool long long __ATTRS_o_ai
6224vec_nor(vector bool long long __a, vector bool long long __b) {
6225 return ~(__a | __b);
6226}
6227#endif
6228
6229/* vec_or */
6230
6231#define __builtin_altivec_vor vec_or
6232
6233static __inline__ vector signed char __ATTRS_o_ai
6234vec_or(vector signed char __a, vector signed char __b) {
6235 return __a | __b;
6236}
6237
6238static __inline__ vector signed char __ATTRS_o_ai
6239vec_or(vector bool char __a, vector signed char __b) {
6240 return (vector signed char)__a | __b;
6241}
6242
6243static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
6244 vector bool char __b) {
6245 return __a | (vector signed char)__b;
6246}
6247
6248static __inline__ vector unsigned char __ATTRS_o_ai
6249vec_or(vector unsigned char __a, vector unsigned char __b) {
6250 return __a | __b;
6251}
6252
6253static __inline__ vector unsigned char __ATTRS_o_ai
6254vec_or(vector bool char __a, vector unsigned char __b) {
6255 return (vector unsigned char)__a | __b;
6256}
6257
6258static __inline__ vector unsigned char __ATTRS_o_ai
6259vec_or(vector unsigned char __a, vector bool char __b) {
6260 return __a | (vector unsigned char)__b;
6261}
6262
6263static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
6264 vector bool char __b) {
6265 return __a | __b;
6266}
6267
6268static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6269 vector short __b) {
6270 return __a | __b;
6271}
6272
6273static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
6274 vector short __b) {
6275 return (vector short)__a | __b;
6276}
6277
6278static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
6279 vector bool short __b) {
6280 return __a | (vector short)__b;
6281}
6282
6283static __inline__ vector unsigned short __ATTRS_o_ai
6284vec_or(vector unsigned short __a, vector unsigned short __b) {
6285 return __a | __b;
6286}
6287
6288static __inline__ vector unsigned short __ATTRS_o_ai
6289vec_or(vector bool short __a, vector unsigned short __b) {
6290 return (vector unsigned short)__a | __b;
6291}
6292
6293static __inline__ vector unsigned short __ATTRS_o_ai
6294vec_or(vector unsigned short __a, vector bool short __b) {
6295 return __a | (vector unsigned short)__b;
6296}
6297
6298static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
6299 vector bool short __b) {
6300 return __a | __b;
6301}
6302
6303static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6304 vector int __b) {
6305 return __a | __b;
6306}
6307
6308static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
6309 vector int __b) {
6310 return (vector int)__a | __b;
6311}
6312
6313static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
6314 vector bool int __b) {
6315 return __a | (vector int)__b;
6316}
6317
6318static __inline__ vector unsigned int __ATTRS_o_ai
6319vec_or(vector unsigned int __a, vector unsigned int __b) {
6320 return __a | __b;
6321}
6322
6323static __inline__ vector unsigned int __ATTRS_o_ai
6324vec_or(vector bool int __a, vector unsigned int __b) {
6325 return (vector unsigned int)__a | __b;
6326}
6327
6328static __inline__ vector unsigned int __ATTRS_o_ai
6329vec_or(vector unsigned int __a, vector bool int __b) {
6330 return __a | (vector unsigned int)__b;
6331}
6332
6333static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
6334 vector bool int __b) {
6335 return __a | __b;
6336}
6337
6338static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6339 vector float __b) {
6340 vector unsigned int __res =
6341 (vector unsigned int)__a | (vector unsigned int)__b;
6342 return (vector float)__res;
6343}
6344
6345static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
6346 vector float __b) {
6347 vector unsigned int __res =
6348 (vector unsigned int)__a | (vector unsigned int)__b;
6349 return (vector float)__res;
6350}
6351
6352static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
6353 vector bool int __b) {
6354 vector unsigned int __res =
6355 (vector unsigned int)__a | (vector unsigned int)__b;
6356 return (vector float)__res;
6357}
6358
6359#ifdef __VSX__
6360static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
6361 vector double __b) {
6362 return (vector double)((vector unsigned long long)__a |
6363 (vector unsigned long long)__b);
6364}
6365
6366static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6367 vector bool long long __b) {
6368 return (vector double)((vector unsigned long long)__a |
6369 (vector unsigned long long)__b);
6370}
6371
6372static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
6373 vector double __b) {
6374 return (vector double)((vector unsigned long long)__a |
6375 (vector unsigned long long)__b);
6376}
6377
6378static __inline__ vector signed long long __ATTRS_o_ai
6379vec_or(vector signed long long __a, vector signed long long __b) {
6380 return __a | __b;
6381}
6382
6383static __inline__ vector signed long long __ATTRS_o_ai
6384vec_or(vector bool long long __a, vector signed long long __b) {
6385 return (vector signed long long)__a | __b;
6386}
6387
6388static __inline__ vector signed long long __ATTRS_o_ai
6389vec_or(vector signed long long __a, vector bool long long __b) {
6390 return __a | (vector signed long long)__b;
6391}
6392
6393static __inline__ vector unsigned long long __ATTRS_o_ai
6394vec_or(vector unsigned long long __a, vector unsigned long long __b) {
6395 return __a | __b;
6396}
6397
6398static __inline__ vector unsigned long long __ATTRS_o_ai
6399vec_or(vector bool long long __a, vector unsigned long long __b) {
6400 return (vector unsigned long long)__a | __b;
6401}
6402
6403static __inline__ vector unsigned long long __ATTRS_o_ai
6404vec_or(vector unsigned long long __a, vector bool long long __b) {
6405 return __a | (vector unsigned long long)__b;
6406}
6407
6408static __inline__ vector bool long long __ATTRS_o_ai
6409vec_or(vector bool long long __a, vector bool long long __b) {
6410 return __a | __b;
6411}
6412#endif
6413
6414#ifdef __POWER8_VECTOR__
6415static __inline__ vector signed char __ATTRS_o_ai
6416vec_orc(vector signed char __a, vector signed char __b) {
6417 return __a | ~__b;
6418}
6419
6420static __inline__ vector signed char __ATTRS_o_ai
6421vec_orc(vector signed char __a, vector bool char __b) {
6422 return __a | ~__b;
6423}
6424
6425static __inline__ vector signed char __ATTRS_o_ai
6426vec_orc(vector bool char __a, vector signed char __b) {
6427 return __a | ~__b;
6428}
6429
6430static __inline__ vector unsigned char __ATTRS_o_ai
6431vec_orc(vector unsigned char __a, vector unsigned char __b) {
6432 return __a | ~__b;
6433}
6434
6435static __inline__ vector unsigned char __ATTRS_o_ai
6436vec_orc(vector unsigned char __a, vector bool char __b) {
6437 return __a | ~__b;
6438}
6439
6440static __inline__ vector unsigned char __ATTRS_o_ai
6441vec_orc(vector bool char __a, vector unsigned char __b) {
6442 return __a | ~__b;
6443}
6444
6445static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
6446 vector bool char __b) {
6447 return __a | ~__b;
6448}
6449
6450static __inline__ vector signed short __ATTRS_o_ai
6451vec_orc(vector signed short __a, vector signed short __b) {
6452 return __a | ~__b;
6453}
6454
6455static __inline__ vector signed short __ATTRS_o_ai
6456vec_orc(vector signed short __a, vector bool short __b) {
6457 return __a | ~__b;
6458}
6459
6460static __inline__ vector signed short __ATTRS_o_ai
6461vec_orc(vector bool short __a, vector signed short __b) {
6462 return __a | ~__b;
6463}
6464
6465static __inline__ vector unsigned short __ATTRS_o_ai
6466vec_orc(vector unsigned short __a, vector unsigned short __b) {
6467 return __a | ~__b;
6468}
6469
6470static __inline__ vector unsigned short __ATTRS_o_ai
6471vec_orc(vector unsigned short __a, vector bool short __b) {
6472 return __a | ~__b;
6473}
6474
6475static __inline__ vector unsigned short __ATTRS_o_ai
6476vec_orc(vector bool short __a, vector unsigned short __b) {
6477 return __a | ~__b;
6478}
6479
6480static __inline__ vector bool short __ATTRS_o_ai
6481vec_orc(vector bool short __a, vector bool short __b) {
6482 return __a | ~__b;
6483}
6484
6485static __inline__ vector signed int __ATTRS_o_ai
6486vec_orc(vector signed int __a, vector signed int __b) {
6487 return __a | ~__b;
6488}
6489
6490static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
6491 vector bool int __b) {
6492 return __a | ~__b;
6493}
6494
6495static __inline__ vector signed int __ATTRS_o_ai
6496vec_orc(vector bool int __a, vector signed int __b) {
6497 return __a | ~__b;
6498}
6499
6500static __inline__ vector unsigned int __ATTRS_o_ai
6501vec_orc(vector unsigned int __a, vector unsigned int __b) {
6502 return __a | ~__b;
6503}
6504
6505static __inline__ vector unsigned int __ATTRS_o_ai
6506vec_orc(vector unsigned int __a, vector bool int __b) {
6507 return __a | ~__b;
6508}
6509
6510static __inline__ vector unsigned int __ATTRS_o_ai
6511vec_orc(vector bool int __a, vector unsigned int __b) {
6512 return __a | ~__b;
6513}
6514
6515static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
6516 vector bool int __b) {
6517 return __a | ~__b;
6518}
6519
6520static __inline__ vector float __ATTRS_o_ai
6521vec_orc(vector bool int __a, vector float __b) {
6522 return (vector float)(__a | ~(vector unsigned int)__b);
6523}
6524
6525static __inline__ vector float __ATTRS_o_ai
6526vec_orc(vector float __a, vector bool int __b) {
6527 return (vector float)((vector unsigned int)__a | ~__b);
6528}
6529
6530static __inline__ vector signed long long __ATTRS_o_ai
6531vec_orc(vector signed long long __a, vector signed long long __b) {
6532 return __a | ~__b;
6533}
6534
6535static __inline__ vector signed long long __ATTRS_o_ai
6536vec_orc(vector signed long long __a, vector bool long long __b) {
6537 return __a | ~__b;
6538}
6539
6540static __inline__ vector signed long long __ATTRS_o_ai
6541vec_orc(vector bool long long __a, vector signed long long __b) {
6542 return __a | ~__b;
6543}
6544
6545static __inline__ vector unsigned long long __ATTRS_o_ai
6546vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
6547 return __a | ~__b;
6548}
6549
6550static __inline__ vector unsigned long long __ATTRS_o_ai
6551vec_orc(vector unsigned long long __a, vector bool long long __b) {
6552 return __a | ~__b;
6553}
6554
6555static __inline__ vector unsigned long long __ATTRS_o_ai
6556vec_orc(vector bool long long __a, vector unsigned long long __b) {
6557 return __a | ~__b;
6558}
6559
6560static __inline__ vector bool long long __ATTRS_o_ai
6561vec_orc(vector bool long long __a, vector bool long long __b) {
6562 return __a | ~__b;
6563}
6564
6565static __inline__ vector double __ATTRS_o_ai
6566vec_orc(vector double __a, vector bool long long __b) {
6567 return (vector double)((vector unsigned long long)__a | ~__b);
6568}
6569
6570static __inline__ vector double __ATTRS_o_ai
6571vec_orc(vector bool long long __a, vector double __b) {
6572 return (vector double)(__a | ~(vector unsigned long long)__b);
6573}
6574#endif
6575
6576/* vec_vor */
6577
6578static __inline__ vector signed char __ATTRS_o_ai
6579vec_vor(vector signed char __a, vector signed char __b) {
6580 return __a | __b;
6581}
6582
6583static __inline__ vector signed char __ATTRS_o_ai
6584vec_vor(vector bool char __a, vector signed char __b) {
6585 return (vector signed char)__a | __b;
6586}
6587
6588static __inline__ vector signed char __ATTRS_o_ai
6589vec_vor(vector signed char __a, vector bool char __b) {
6590 return __a | (vector signed char)__b;
6591}
6592
6593static __inline__ vector unsigned char __ATTRS_o_ai
6594vec_vor(vector unsigned char __a, vector unsigned char __b) {
6595 return __a | __b;
6596}
6597
6598static __inline__ vector unsigned char __ATTRS_o_ai
6599vec_vor(vector bool char __a, vector unsigned char __b) {
6600 return (vector unsigned char)__a | __b;
6601}
6602
6603static __inline__ vector unsigned char __ATTRS_o_ai
6604vec_vor(vector unsigned char __a, vector bool char __b) {
6605 return __a | (vector unsigned char)__b;
6606}
6607
6608static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
6609 vector bool char __b) {
6610 return __a | __b;
6611}
6612
6613static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6614 vector short __b) {
6615 return __a | __b;
6616}
6617
6618static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
6619 vector short __b) {
6620 return (vector short)__a | __b;
6621}
6622
6623static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
6624 vector bool short __b) {
6625 return __a | (vector short)__b;
6626}
6627
6628static __inline__ vector unsigned short __ATTRS_o_ai
6629vec_vor(vector unsigned short __a, vector unsigned short __b) {
6630 return __a | __b;
6631}
6632
6633static __inline__ vector unsigned short __ATTRS_o_ai
6634vec_vor(vector bool short __a, vector unsigned short __b) {
6635 return (vector unsigned short)__a | __b;
6636}
6637
6638static __inline__ vector unsigned short __ATTRS_o_ai
6639vec_vor(vector unsigned short __a, vector bool short __b) {
6640 return __a | (vector unsigned short)__b;
6641}
6642
6643static __inline__ vector bool short __ATTRS_o_ai
6644vec_vor(vector bool short __a, vector bool short __b) {
6645 return __a | __b;
6646}
6647
6648static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6649 vector int __b) {
6650 return __a | __b;
6651}
6652
6653static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
6654 vector int __b) {
6655 return (vector int)__a | __b;
6656}
6657
6658static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
6659 vector bool int __b) {
6660 return __a | (vector int)__b;
6661}
6662
6663static __inline__ vector unsigned int __ATTRS_o_ai
6664vec_vor(vector unsigned int __a, vector unsigned int __b) {
6665 return __a | __b;
6666}
6667
6668static __inline__ vector unsigned int __ATTRS_o_ai
6669vec_vor(vector bool int __a, vector unsigned int __b) {
6670 return (vector unsigned int)__a | __b;
6671}
6672
6673static __inline__ vector unsigned int __ATTRS_o_ai
6674vec_vor(vector unsigned int __a, vector bool int __b) {
6675 return __a | (vector unsigned int)__b;
6676}
6677
6678static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
6679 vector bool int __b) {
6680 return __a | __b;
6681}
6682
6683static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6684 vector float __b) {
6685 vector unsigned int __res =
6686 (vector unsigned int)__a | (vector unsigned int)__b;
6687 return (vector float)__res;
6688}
6689
6690static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
6691 vector float __b) {
6692 vector unsigned int __res =
6693 (vector unsigned int)__a | (vector unsigned int)__b;
6694 return (vector float)__res;
6695}
6696
6697static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
6698 vector bool int __b) {
6699 vector unsigned int __res =
6700 (vector unsigned int)__a | (vector unsigned int)__b;
6701 return (vector float)__res;
6702}
6703
6704#ifdef __VSX__
6705static __inline__ vector signed long long __ATTRS_o_ai
6706vec_vor(vector signed long long __a, vector signed long long __b) {
6707 return __a | __b;
6708}
6709
6710static __inline__ vector signed long long __ATTRS_o_ai
6711vec_vor(vector bool long long __a, vector signed long long __b) {
6712 return (vector signed long long)__a | __b;
6713}
6714
6715static __inline__ vector signed long long __ATTRS_o_ai
6716vec_vor(vector signed long long __a, vector bool long long __b) {
6717 return __a | (vector signed long long)__b;
6718}
6719
6720static __inline__ vector unsigned long long __ATTRS_o_ai
6721vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
6722 return __a | __b;
6723}
6724
6725static __inline__ vector unsigned long long __ATTRS_o_ai
6726vec_vor(vector bool long long __a, vector unsigned long long __b) {
6727 return (vector unsigned long long)__a | __b;
6728}
6729
6730static __inline__ vector unsigned long long __ATTRS_o_ai
6731vec_vor(vector unsigned long long __a, vector bool long long __b) {
6732 return __a | (vector unsigned long long)__b;
6733}
6734
6735static __inline__ vector bool long long __ATTRS_o_ai
6736vec_vor(vector bool long long __a, vector bool long long __b) {
6737 return __a | __b;
6738}
6739#endif
6740
6741/* vec_pack */
6742
6743/* The various vector pack instructions have a big-endian bias, so for
6744 little endian we must handle reversed element numbering. */
6745
6746static __inline__ vector signed char __ATTRS_o_ai
6747vec_pack(vector signed short __a, vector signed short __b) {
6748#ifdef __LITTLE_ENDIAN__
6749 return (vector signed char)vec_perm(
6750 __a, __b,
6751 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6752 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6753#else
6754 return (vector signed char)vec_perm(
6755 __a, __b,
6756 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6757 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6758#endif
6759}
6760
6761static __inline__ vector unsigned char __ATTRS_o_ai
6762vec_pack(vector unsigned short __a, vector unsigned short __b) {
6763#ifdef __LITTLE_ENDIAN__
6764 return (vector unsigned char)vec_perm(
6765 __a, __b,
6766 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6767 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6768#else
6769 return (vector unsigned char)vec_perm(
6770 __a, __b,
6771 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6772 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6773#endif
6774}
6775
6776static __inline__ vector bool char __ATTRS_o_ai
6777vec_pack(vector bool short __a, vector bool short __b) {
6778#ifdef __LITTLE_ENDIAN__
6779 return (vector bool char)vec_perm(
6780 __a, __b,
6781 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6782 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6783#else
6784 return (vector bool char)vec_perm(
6785 __a, __b,
6786 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6787 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6788#endif
6789}
6790
6791static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
6792 vector int __b) {
6793#ifdef __LITTLE_ENDIAN__
6794 return (vector short)vec_perm(
6795 __a, __b,
6796 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6797 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6798#else
6799 return (vector short)vec_perm(
6800 __a, __b,
6801 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6802 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6803#endif
6804}
6805
6806static __inline__ vector unsigned short __ATTRS_o_ai
6807vec_pack(vector unsigned int __a, vector unsigned int __b) {
6808#ifdef __LITTLE_ENDIAN__
6809 return (vector unsigned short)vec_perm(
6810 __a, __b,
6811 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6812 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6813#else
6814 return (vector unsigned short)vec_perm(
6815 __a, __b,
6816 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6817 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6818#endif
6819}
6820
6821static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
6822 vector bool int __b) {
6823#ifdef __LITTLE_ENDIAN__
6824 return (vector bool short)vec_perm(
6825 __a, __b,
6826 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6827 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6828#else
6829 return (vector bool short)vec_perm(
6830 __a, __b,
6831 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6832 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6833#endif
6834}
6835
6836#ifdef __VSX__
6837static __inline__ vector signed int __ATTRS_o_ai
6838vec_pack(vector signed long long __a, vector signed long long __b) {
6839#ifdef __LITTLE_ENDIAN__
6840 return (vector signed int)vec_perm(
6841 __a, __b,
6842 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6843 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6844#else
6845 return (vector signed int)vec_perm(
6846 __a, __b,
6847 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6848 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6849#endif
6850}
6851static __inline__ vector unsigned int __ATTRS_o_ai
6852vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
6853#ifdef __LITTLE_ENDIAN__
6854 return (vector unsigned int)vec_perm(
6855 __a, __b,
6856 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6857 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6858#else
6859 return (vector unsigned int)vec_perm(
6860 __a, __b,
6861 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6862 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6863#endif
6864}
6865
6866static __inline__ vector bool int __ATTRS_o_ai
6867vec_pack(vector bool long long __a, vector bool long long __b) {
6868#ifdef __LITTLE_ENDIAN__
6869 return (vector bool int)vec_perm(
6870 __a, __b,
6871 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
6872 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
6873#else
6874 return (vector bool int)vec_perm(
6875 __a, __b,
6876 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
6877 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
6878#endif
6879}
6880
6881static __inline__ vector float __ATTRS_o_ai
6882vec_pack(vector double __a, vector double __b) {
6883 return (vector float) (__a[0], __a[1], __b[0], __b[1]);
6884}
6885#endif
6886
6887#ifdef __POWER9_VECTOR__
6888static __inline__ vector unsigned short __ATTRS_o_ai
6889vec_pack_to_short_fp32(vector float __a, vector float __b) {
6890 vector float __resa = __builtin_vsx_xvcvsphp(__a);
6891 vector float __resb = __builtin_vsx_xvcvsphp(__b);
6892#ifdef __LITTLE_ENDIAN__
6893 return (vector unsigned short)vec_mergee(__resa, __resb);
6894#else
6895 return (vector unsigned short)vec_mergeo(__resa, __resb);
6896#endif
6897}
6898
6899#endif
6900/* vec_vpkuhum */
6901
6902#define __builtin_altivec_vpkuhum vec_vpkuhum
6903
6904static __inline__ vector signed char __ATTRS_o_ai
6905vec_vpkuhum(vector signed short __a, vector signed short __b) {
6906#ifdef __LITTLE_ENDIAN__
6907 return (vector signed char)vec_perm(
6908 __a, __b,
6909 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6910 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6911#else
6912 return (vector signed char)vec_perm(
6913 __a, __b,
6914 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6915 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6916#endif
6917}
6918
6919static __inline__ vector unsigned char __ATTRS_o_ai
6920vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
6921#ifdef __LITTLE_ENDIAN__
6922 return (vector unsigned char)vec_perm(
6923 __a, __b,
6924 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6925 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6926#else
6927 return (vector unsigned char)vec_perm(
6928 __a, __b,
6929 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6930 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6931#endif
6932}
6933
6934static __inline__ vector bool char __ATTRS_o_ai
6935vec_vpkuhum(vector bool short __a, vector bool short __b) {
6936#ifdef __LITTLE_ENDIAN__
6937 return (vector bool char)vec_perm(
6938 __a, __b,
6939 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
6940 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
6941#else
6942 return (vector bool char)vec_perm(
6943 __a, __b,
6944 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
6945 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
6946#endif
6947}
6948
6949/* vec_vpkuwum */
6950
6951#define __builtin_altivec_vpkuwum vec_vpkuwum
6952
6953static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
6954 vector int __b) {
6955#ifdef __LITTLE_ENDIAN__
6956 return (vector short)vec_perm(
6957 __a, __b,
6958 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6959 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6960#else
6961 return (vector short)vec_perm(
6962 __a, __b,
6963 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6964 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6965#endif
6966}
6967
6968static __inline__ vector unsigned short __ATTRS_o_ai
6969vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
6970#ifdef __LITTLE_ENDIAN__
6971 return (vector unsigned short)vec_perm(
6972 __a, __b,
6973 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6974 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6975#else
6976 return (vector unsigned short)vec_perm(
6977 __a, __b,
6978 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6979 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6980#endif
6981}
6982
6983static __inline__ vector bool short __ATTRS_o_ai
6984vec_vpkuwum(vector bool int __a, vector bool int __b) {
6985#ifdef __LITTLE_ENDIAN__
6986 return (vector bool short)vec_perm(
6987 __a, __b,
6988 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
6989 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
6990#else
6991 return (vector bool short)vec_perm(
6992 __a, __b,
6993 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
6994 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
6995#endif
6996}
6997
6998/* vec_vpkudum */
6999
7000#ifdef __POWER8_VECTOR__
7001#define __builtin_altivec_vpkudum vec_vpkudum
7002
7003static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
7004 vector long long __b) {
7005#ifdef __LITTLE_ENDIAN__
7006 return (vector int)vec_perm(
7007 __a, __b,
7008 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7009 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7010#else
7011 return (vector int)vec_perm(
7012 __a, __b,
7013 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7014 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7015#endif
7016}
7017
7018static __inline__ vector unsigned int __ATTRS_o_ai
7019vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
7020#ifdef __LITTLE_ENDIAN__
7021 return (vector unsigned int)vec_perm(
7022 __a, __b,
7023 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7024 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7025#else
7026 return (vector unsigned int)vec_perm(
7027 __a, __b,
7028 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7029 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7030#endif
7031}
7032
7033static __inline__ vector bool int __ATTRS_o_ai
7034vec_vpkudum(vector bool long long __a, vector bool long long __b) {
7035#ifdef __LITTLE_ENDIAN__
7036 return (vector bool int)vec_perm(
7037 (vector long long)__a, (vector long long)__b,
7038 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
7039 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
7040#else
7041 return (vector bool int)vec_perm(
7042 (vector long long)__a, (vector long long)__b,
7043 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
7044 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
7045#endif
7046}
7047#endif
7048
7049/* vec_packpx */
7050
7051static __inline__ vector pixel __attribute__((__always_inline__))
7052vec_packpx(vector unsigned int __a, vector unsigned int __b) {
7053#ifdef __LITTLE_ENDIAN__
7054 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7055#else
7056 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7057#endif
7058}
7059
7060/* vec_vpkpx */
7061
7062static __inline__ vector pixel __attribute__((__always_inline__))
7063vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
7064#ifdef __LITTLE_ENDIAN__
7065 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
7066#else
7067 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
7068#endif
7069}
7070
7071/* vec_packs */
7072
7073static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
7074 vector short __b) {
7075#ifdef __LITTLE_ENDIAN__
7076 return __builtin_altivec_vpkshss(__b, __a);
7077#else
7078 return __builtin_altivec_vpkshss(__a, __b);
7079#endif
7080}
7081
7082static __inline__ vector unsigned char __ATTRS_o_ai
7083vec_packs(vector unsigned short __a, vector unsigned short __b) {
7084#ifdef __LITTLE_ENDIAN__
7085 return __builtin_altivec_vpkuhus(__b, __a);
7086#else
7087 return __builtin_altivec_vpkuhus(__a, __b);
7088#endif
7089}
7090
7091static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
7092 vector int __b) {
7093#ifdef __LITTLE_ENDIAN__
7094 return __builtin_altivec_vpkswss(__b, __a);
7095#else
7096 return __builtin_altivec_vpkswss(__a, __b);
7097#endif
7098}
7099
7100static __inline__ vector unsigned short __ATTRS_o_ai
7101vec_packs(vector unsigned int __a, vector unsigned int __b) {
7102#ifdef __LITTLE_ENDIAN__
7103 return __builtin_altivec_vpkuwus(__b, __a);
7104#else
7105 return __builtin_altivec_vpkuwus(__a, __b);
7106#endif
7107}
7108
7109#ifdef __POWER8_VECTOR__
7110static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
7111 vector long long __b) {
7112#ifdef __LITTLE_ENDIAN__
7113 return __builtin_altivec_vpksdss(__b, __a);
7114#else
7115 return __builtin_altivec_vpksdss(__a, __b);
7116#endif
7117}
7118
7119static __inline__ vector unsigned int __ATTRS_o_ai
7120vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
7121#ifdef __LITTLE_ENDIAN__
7122 return __builtin_altivec_vpkudus(__b, __a);
7123#else
7124 return __builtin_altivec_vpkudus(__a, __b);
7125#endif
7126}
7127#endif
7128
7129/* vec_vpkshss */
7130
7131static __inline__ vector signed char __attribute__((__always_inline__))
7132vec_vpkshss(vector short __a, vector short __b) {
7133#ifdef __LITTLE_ENDIAN__
7134 return __builtin_altivec_vpkshss(__b, __a);
7135#else
7136 return __builtin_altivec_vpkshss(__a, __b);
7137#endif
7138}
7139
7140/* vec_vpksdss */
7141
7142#ifdef __POWER8_VECTOR__
7143static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
7144 vector long long __b) {
7145#ifdef __LITTLE_ENDIAN__
7146 return __builtin_altivec_vpksdss(__b, __a);
7147#else
7148 return __builtin_altivec_vpksdss(__a, __b);
7149#endif
7150}
7151#endif
7152
7153/* vec_vpkuhus */
7154
7155static __inline__ vector unsigned char __attribute__((__always_inline__))
7156vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
7157#ifdef __LITTLE_ENDIAN__
7158 return __builtin_altivec_vpkuhus(__b, __a);
7159#else
7160 return __builtin_altivec_vpkuhus(__a, __b);
7161#endif
7162}
7163
7164/* vec_vpkudus */
7165
7166#ifdef __POWER8_VECTOR__
7167static __inline__ vector unsigned int __attribute__((__always_inline__))
7168vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
7169#ifdef __LITTLE_ENDIAN__
7170 return __builtin_altivec_vpkudus(__b, __a);
7171#else
7172 return __builtin_altivec_vpkudus(__a, __b);
7173#endif
7174}
7175#endif
7176
7177/* vec_vpkswss */
7178
7179static __inline__ vector signed short __attribute__((__always_inline__))
7180vec_vpkswss(vector int __a, vector int __b) {
7181#ifdef __LITTLE_ENDIAN__
7182 return __builtin_altivec_vpkswss(__b, __a);
7183#else
7184 return __builtin_altivec_vpkswss(__a, __b);
7185#endif
7186}
7187
7188/* vec_vpkuwus */
7189
7190static __inline__ vector unsigned short __attribute__((__always_inline__))
7191vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
7192#ifdef __LITTLE_ENDIAN__
7193 return __builtin_altivec_vpkuwus(__b, __a);
7194#else
7195 return __builtin_altivec_vpkuwus(__a, __b);
7196#endif
7197}
7198
7199/* vec_packsu */
7200
7201static __inline__ vector unsigned char __ATTRS_o_ai
7202vec_packsu(vector short __a, vector short __b) {
7203#ifdef __LITTLE_ENDIAN__
7204 return __builtin_altivec_vpkshus(__b, __a);
7205#else
7206 return __builtin_altivec_vpkshus(__a, __b);
7207#endif
7208}
7209
7210static __inline__ vector unsigned char __ATTRS_o_ai
7211vec_packsu(vector unsigned short __a, vector unsigned short __b) {
7212#ifdef __LITTLE_ENDIAN__
7213 return __builtin_altivec_vpkuhus(__b, __a);
7214#else
7215 return __builtin_altivec_vpkuhus(__a, __b);
7216#endif
7217}
7218
7219static __inline__ vector unsigned short __ATTRS_o_ai
7220vec_packsu(vector int __a, vector int __b) {
7221#ifdef __LITTLE_ENDIAN__
7222 return __builtin_altivec_vpkswus(__b, __a);
7223#else
7224 return __builtin_altivec_vpkswus(__a, __b);
7225#endif
7226}
7227
7228static __inline__ vector unsigned short __ATTRS_o_ai
7229vec_packsu(vector unsigned int __a, vector unsigned int __b) {
7230#ifdef __LITTLE_ENDIAN__
7231 return __builtin_altivec_vpkuwus(__b, __a);
7232#else
7233 return __builtin_altivec_vpkuwus(__a, __b);
7234#endif
7235}
7236
7237#ifdef __POWER8_VECTOR__
7238static __inline__ vector unsigned int __ATTRS_o_ai
7239vec_packsu(vector long long __a, vector long long __b) {
7240#ifdef __LITTLE_ENDIAN__
7241 return __builtin_altivec_vpksdus(__b, __a);
7242#else
7243 return __builtin_altivec_vpksdus(__a, __b);
7244#endif
7245}
7246
7247static __inline__ vector unsigned int __ATTRS_o_ai
7248vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
7249#ifdef __LITTLE_ENDIAN__
7250 return __builtin_altivec_vpkudus(__b, __a);
7251#else
7252 return __builtin_altivec_vpkudus(__a, __b);
7253#endif
7254}
7255#endif
7256
7257/* vec_vpkshus */
7258
7259static __inline__ vector unsigned char __ATTRS_o_ai
7260vec_vpkshus(vector short __a, vector short __b) {
7261#ifdef __LITTLE_ENDIAN__
7262 return __builtin_altivec_vpkshus(__b, __a);
7263#else
7264 return __builtin_altivec_vpkshus(__a, __b);
7265#endif
7266}
7267
7268static __inline__ vector unsigned char __ATTRS_o_ai
7269vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
7270#ifdef __LITTLE_ENDIAN__
7271 return __builtin_altivec_vpkuhus(__b, __a);
7272#else
7273 return __builtin_altivec_vpkuhus(__a, __b);
7274#endif
7275}
7276
7277/* vec_vpkswus */
7278
7279static __inline__ vector unsigned short __ATTRS_o_ai
7280vec_vpkswus(vector int __a, vector int __b) {
7281#ifdef __LITTLE_ENDIAN__
7282 return __builtin_altivec_vpkswus(__b, __a);
7283#else
7284 return __builtin_altivec_vpkswus(__a, __b);
7285#endif
7286}
7287
7288static __inline__ vector unsigned short __ATTRS_o_ai
7289vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
7290#ifdef __LITTLE_ENDIAN__
7291 return __builtin_altivec_vpkuwus(__b, __a);
7292#else
7293 return __builtin_altivec_vpkuwus(__a, __b);
7294#endif
7295}
7296
7297/* vec_vpksdus */
7298
7299#ifdef __POWER8_VECTOR__
7300static __inline__ vector unsigned int __ATTRS_o_ai
7301vec_vpksdus(vector long long __a, vector long long __b) {
7302#ifdef __LITTLE_ENDIAN__
7303 return __builtin_altivec_vpksdus(__b, __a);
7304#else
7305 return __builtin_altivec_vpksdus(__a, __b);
7306#endif
7307}
7308#endif
7309
7310/* vec_perm */
7311
7312// The vperm instruction is defined architecturally with a big-endian bias.
7313// For little endian, we swap the input operands and invert the permute
7314// control vector. Only the rightmost 5 bits matter, so we could use
7315// a vector of all 31s instead of all 255s to perform the inversion.
7316// However, when the PCV is not a constant, using 255 has an advantage
7317// in that the vec_xor can be recognized as a vec_nor (and for P8 and
7318// later, possibly a vec_nand).
7319
7320static __inline__ vector signed char __ATTRS_o_ai vec_perm(
7321 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7322#ifdef __LITTLE_ENDIAN__
7323 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7324 255, 255, 255, 255, 255, 255, 255, 255};
7325 __d = vec_xor(__c, __d);
7326 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
7327 (vector int)__a, __d);
7328#else
7329 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
7330 (vector int)__b, __c);
7331#endif
7332}
7333
7334static __inline__ vector unsigned char __ATTRS_o_ai
7335vec_perm(vector unsigned char __a, vector unsigned char __b,
7336 vector unsigned char __c) {
7337#ifdef __LITTLE_ENDIAN__
7338 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7339 255, 255, 255, 255, 255, 255, 255, 255};
7340 __d = vec_xor(__c, __d);
7341 return (vector unsigned char)__builtin_altivec_vperm_4si(
7342 (vector int)__b, (vector int)__a, __d);
7343#else
7344 return (vector unsigned char)__builtin_altivec_vperm_4si(
7345 (vector int)__a, (vector int)__b, __c);
7346#endif
7347}
7348
7349static __inline__ vector bool char __ATTRS_o_ai
7350vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7351#ifdef __LITTLE_ENDIAN__
7352 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7353 255, 255, 255, 255, 255, 255, 255, 255};
7354 __d = vec_xor(__c, __d);
7355 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
7356 (vector int)__a, __d);
7357#else
7358 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
7359 (vector int)__b, __c);
7360#endif
7361}
7362
7363static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
7364 vector signed short __b,
7365 vector unsigned char __c) {
7366#ifdef __LITTLE_ENDIAN__
7367 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7368 255, 255, 255, 255, 255, 255, 255, 255};
7369 __d = vec_xor(__c, __d);
7370 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
7371 (vector int)__a, __d);
7372#else
7373 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
7374 (vector int)__b, __c);
7375#endif
7376}
7377
7378static __inline__ vector unsigned short __ATTRS_o_ai
7379vec_perm(vector unsigned short __a, vector unsigned short __b,
7380 vector unsigned char __c) {
7381#ifdef __LITTLE_ENDIAN__
7382 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7383 255, 255, 255, 255, 255, 255, 255, 255};
7384 __d = vec_xor(__c, __d);
7385 return (vector unsigned short)__builtin_altivec_vperm_4si(
7386 (vector int)__b, (vector int)__a, __d);
7387#else
7388 return (vector unsigned short)__builtin_altivec_vperm_4si(
7389 (vector int)__a, (vector int)__b, __c);
7390#endif
7391}
7392
7393static __inline__ vector bool short __ATTRS_o_ai vec_perm(
7394 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7395#ifdef __LITTLE_ENDIAN__
7396 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7397 255, 255, 255, 255, 255, 255, 255, 255};
7398 __d = vec_xor(__c, __d);
7399 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
7400 (vector int)__a, __d);
7401#else
7402 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
7403 (vector int)__b, __c);
7404#endif
7405}
7406
7407static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
7408 vector pixel __b,
7409 vector unsigned char __c) {
7410#ifdef __LITTLE_ENDIAN__
7411 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7412 255, 255, 255, 255, 255, 255, 255, 255};
7413 __d = vec_xor(__c, __d);
7414 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
7415 (vector int)__a, __d);
7416#else
7417 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
7418 (vector int)__b, __c);
7419#endif
7420}
7421
7422static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
7423 vector signed int __b,
7424 vector unsigned char __c) {
7425#ifdef __LITTLE_ENDIAN__
7426 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7427 255, 255, 255, 255, 255, 255, 255, 255};
7428 __d = vec_xor(__c, __d);
7429 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
7430#else
7431 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
7432#endif
7433}
7434
7435static __inline__ vector unsigned int __ATTRS_o_ai
7436vec_perm(vector unsigned int __a, vector unsigned int __b,
7437 vector unsigned char __c) {
7438#ifdef __LITTLE_ENDIAN__
7439 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7440 255, 255, 255, 255, 255, 255, 255, 255};
7441 __d = vec_xor(__c, __d);
7442 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
7443 (vector int)__a, __d);
7444#else
7445 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
7446 (vector int)__b, __c);
7447#endif
7448}
7449
7450static __inline__ vector bool int __ATTRS_o_ai
7451vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7452#ifdef __LITTLE_ENDIAN__
7453 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7454 255, 255, 255, 255, 255, 255, 255, 255};
7455 __d = vec_xor(__c, __d);
7456 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
7457 (vector int)__a, __d);
7458#else
7459 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
7460 (vector int)__b, __c);
7461#endif
7462}
7463
7464static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
7465 vector float __b,
7466 vector unsigned char __c) {
7467#ifdef __LITTLE_ENDIAN__
7468 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7469 255, 255, 255, 255, 255, 255, 255, 255};
7470 __d = vec_xor(__c, __d);
7471 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
7472 (vector int)__a, __d);
7473#else
7474 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
7475 (vector int)__b, __c);
7476#endif
7477}
7478
7479#ifdef __VSX__
7480static __inline__ vector long long __ATTRS_o_ai
7481vec_perm(vector signed long long __a, vector signed long long __b,
7482 vector unsigned char __c) {
7483#ifdef __LITTLE_ENDIAN__
7484 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7485 255, 255, 255, 255, 255, 255, 255, 255};
7486 __d = vec_xor(__c, __d);
7487 return (vector signed long long)__builtin_altivec_vperm_4si(
7488 (vector int)__b, (vector int)__a, __d);
7489#else
7490 return (vector signed long long)__builtin_altivec_vperm_4si(
7491 (vector int)__a, (vector int)__b, __c);
7492#endif
7493}
7494
7495static __inline__ vector unsigned long long __ATTRS_o_ai
7496vec_perm(vector unsigned long long __a, vector unsigned long long __b,
7497 vector unsigned char __c) {
7498#ifdef __LITTLE_ENDIAN__
7499 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7500 255, 255, 255, 255, 255, 255, 255, 255};
7501 __d = vec_xor(__c, __d);
7502 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7503 (vector int)__b, (vector int)__a, __d);
7504#else
7505 return (vector unsigned long long)__builtin_altivec_vperm_4si(
7506 (vector int)__a, (vector int)__b, __c);
7507#endif
7508}
7509
7510static __inline__ vector bool long long __ATTRS_o_ai
7511vec_perm(vector bool long long __a, vector bool long long __b,
7512 vector unsigned char __c) {
7513#ifdef __LITTLE_ENDIAN__
7514 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7515 255, 255, 255, 255, 255, 255, 255, 255};
7516 __d = vec_xor(__c, __d);
7517 return (vector bool long long)__builtin_altivec_vperm_4si(
7518 (vector int)__b, (vector int)__a, __d);
7519#else
7520 return (vector bool long long)__builtin_altivec_vperm_4si(
7521 (vector int)__a, (vector int)__b, __c);
7522#endif
7523}
7524
7525static __inline__ vector double __ATTRS_o_ai
7526vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
7527#ifdef __LITTLE_ENDIAN__
7528 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
7529 255, 255, 255, 255, 255, 255, 255, 255};
7530 __d = vec_xor(__c, __d);
7531 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
7532 (vector int)__a, __d);
7533#else
7534 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
7535 (vector int)__b, __c);
7536#endif
7537}
7538#endif
7539
7540/* vec_vperm */
7541
7542static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
7543 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7544 return vec_perm(__a, __b, __c);
7545}
7546
7547static __inline__ vector unsigned char __ATTRS_o_ai
7548vec_vperm(vector unsigned char __a, vector unsigned char __b,
7549 vector unsigned char __c) {
7550 return vec_perm(__a, __b, __c);
7551}
7552
7553static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
7554 vector bool char __a, vector bool char __b, vector unsigned char __c) {
7555 return vec_perm(__a, __b, __c);
7556}
7557
7558static __inline__ vector short __ATTRS_o_ai
7559vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
7560 return vec_perm(__a, __b, __c);
7561}
7562
7563static __inline__ vector unsigned short __ATTRS_o_ai
7564vec_vperm(vector unsigned short __a, vector unsigned short __b,
7565 vector unsigned char __c) {
7566 return vec_perm(__a, __b, __c);
7567}
7568
7569static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
7570 vector bool short __a, vector bool short __b, vector unsigned char __c) {
7571 return vec_perm(__a, __b, __c);
7572}
7573
7574static __inline__ vector pixel __ATTRS_o_ai
7575vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
7576 return vec_perm(__a, __b, __c);
7577}
7578
7579static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
7580 vector int __b,
7581 vector unsigned char __c) {
7582 return vec_perm(__a, __b, __c);
7583}
7584
7585static __inline__ vector unsigned int __ATTRS_o_ai
7586vec_vperm(vector unsigned int __a, vector unsigned int __b,
7587 vector unsigned char __c) {
7588 return vec_perm(__a, __b, __c);
7589}
7590
7591static __inline__ vector bool int __ATTRS_o_ai
7592vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
7593 return vec_perm(__a, __b, __c);
7594}
7595
7596static __inline__ vector float __ATTRS_o_ai
7597vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
7598 return vec_perm(__a, __b, __c);
7599}
7600
7601#ifdef __VSX__
7602static __inline__ vector long long __ATTRS_o_ai vec_vperm(
7603 vector long long __a, vector long long __b, vector unsigned char __c) {
7604 return vec_perm(__a, __b, __c);
7605}
7606
7607static __inline__ vector unsigned long long __ATTRS_o_ai
7608vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
7609 vector unsigned char __c) {
7610 return vec_perm(__a, __b, __c);
7611}
7612
7613static __inline__ vector double __ATTRS_o_ai
7614vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
7615 return vec_perm(__a, __b, __c);
7616}
7617#endif
7618
7619/* vec_re */
7620
7621static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
7622#ifdef __VSX__
7623 return __builtin_vsx_xvresp(__a);
7624#else
7625 return __builtin_altivec_vrefp(__a);
7626#endif
7627}
7628
7629#ifdef __VSX__
7630static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
7631 return __builtin_vsx_xvredp(__a);
7632}
7633#endif
7634
7635/* vec_vrefp */
7636
7637static __inline__ vector float __attribute__((__always_inline__))
7638vec_vrefp(vector float __a) {
7639 return __builtin_altivec_vrefp(__a);
7640}
7641
7642/* vec_rl */
7643
7644static __inline__ vector signed char __ATTRS_o_ai
7645vec_rl(vector signed char __a, vector unsigned char __b) {
7646 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7647}
7648
7649static __inline__ vector unsigned char __ATTRS_o_ai
7650vec_rl(vector unsigned char __a, vector unsigned char __b) {
7651 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7652}
7653
7654static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
7655 vector unsigned short __b) {
7656 return __builtin_altivec_vrlh(__a, __b);
7657}
7658
7659static __inline__ vector unsigned short __ATTRS_o_ai
7660vec_rl(vector unsigned short __a, vector unsigned short __b) {
7661 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7662}
7663
7664static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
7665 vector unsigned int __b) {
7666 return __builtin_altivec_vrlw(__a, __b);
7667}
7668
7669static __inline__ vector unsigned int __ATTRS_o_ai
7670vec_rl(vector unsigned int __a, vector unsigned int __b) {
7671 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7672}
7673
7674#ifdef __POWER8_VECTOR__
7675static __inline__ vector signed long long __ATTRS_o_ai
7676vec_rl(vector signed long long __a, vector unsigned long long __b) {
7677 return __builtin_altivec_vrld(__a, __b);
7678}
7679
7680static __inline__ vector unsigned long long __ATTRS_o_ai
7681vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
7682 return __builtin_altivec_vrld(__a, __b);
7683}
7684#endif
7685
7686/* vec_rlmi */
7687#ifdef __POWER9_VECTOR__
7688static __inline__ vector unsigned int __ATTRS_o_ai
7689vec_rlmi(vector unsigned int __a, vector unsigned int __b,
7690 vector unsigned int __c) {
7691 return __builtin_altivec_vrlwmi(__a, __c, __b);
7692}
7693
7694static __inline__ vector unsigned long long __ATTRS_o_ai
7695vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,
7696 vector unsigned long long __c) {
7697 return __builtin_altivec_vrldmi(__a, __c, __b);
7698}
7699
7700/* vec_rlnm */
7701static __inline__ vector unsigned int __ATTRS_o_ai
7702vec_rlnm(vector unsigned int __a, vector unsigned int __b,
7703 vector unsigned int __c) {
7704 vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };
7705 return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));
7706}
7707
7708static __inline__ vector unsigned long long __ATTRS_o_ai
7709vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,
7710 vector unsigned long long __c) {
7711 vector unsigned long long OneByte = { 0x8, 0x8 };
7712 return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));
7713}
7714#endif
7715
7716/* vec_vrlb */
7717
7718static __inline__ vector signed char __ATTRS_o_ai
7719vec_vrlb(vector signed char __a, vector unsigned char __b) {
7720 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
7721}
7722
7723static __inline__ vector unsigned char __ATTRS_o_ai
7724vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
7725 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
7726}
7727
7728/* vec_vrlh */
7729
7730static __inline__ vector short __ATTRS_o_ai
7731vec_vrlh(vector short __a, vector unsigned short __b) {
7732 return __builtin_altivec_vrlh(__a, __b);
7733}
7734
7735static __inline__ vector unsigned short __ATTRS_o_ai
7736vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
7737 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
7738}
7739
7740/* vec_vrlw */
7741
7742static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
7743 vector unsigned int __b) {
7744 return __builtin_altivec_vrlw(__a, __b);
7745}
7746
7747static __inline__ vector unsigned int __ATTRS_o_ai
7748vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
7749 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
7750}
7751
7752/* vec_round */
7753
7754static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
7755#ifdef __VSX__
7756 return __builtin_vsx_xvrspi(__a);
7757#else
7758 return __builtin_altivec_vrfin(__a);
7759#endif
7760}
7761
7762#ifdef __VSX__
7763static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
7764 return __builtin_vsx_xvrdpi(__a);
7765}
7766
7767/* vec_rint */
7768
7769static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
7770 return __builtin_vsx_xvrspic(__a);
7771}
7772
7773static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
7774 return __builtin_vsx_xvrdpic(__a);
7775}
7776
7777/* vec_nearbyint */
7778
7779static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
7780 return __builtin_vsx_xvrspi(__a);
7781}
7782
7783static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
7784 return __builtin_vsx_xvrdpi(__a);
7785}
7786#endif
7787
7788/* vec_vrfin */
7789
7790static __inline__ vector float __attribute__((__always_inline__))
7791vec_vrfin(vector float __a) {
7792 return __builtin_altivec_vrfin(__a);
7793}
7794
7795/* vec_sqrt */
7796
7797#ifdef __VSX__
7798static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
7799 return __builtin_vsx_xvsqrtsp(__a);
7800}
7801
7802static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
7803 return __builtin_vsx_xvsqrtdp(__a);
7804}
7805#endif
7806
7807/* vec_rsqrte */
7808
7809static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
7810#ifdef __VSX__
7811 return __builtin_vsx_xvrsqrtesp(__a);
7812#else
7813 return __builtin_altivec_vrsqrtefp(__a);
7814#endif
7815}
7816
7817#ifdef __VSX__
7818static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
7819 return __builtin_vsx_xvrsqrtedp(__a);
7820}
7821#endif
7822
7823/* vec_vrsqrtefp */
7824
7825static __inline__ __vector float __attribute__((__always_inline__))
7826vec_vrsqrtefp(vector float __a) {
7827 return __builtin_altivec_vrsqrtefp(__a);
7828}
7829
7830/* vec_sel */
7831
7832#define __builtin_altivec_vsel_4si vec_sel
7833
7834static __inline__ vector signed char __ATTRS_o_ai vec_sel(
7835 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7836 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7837}
7838
7839static __inline__ vector signed char __ATTRS_o_ai
7840vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
7841 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7842}
7843
7844static __inline__ vector unsigned char __ATTRS_o_ai
7845vec_sel(vector unsigned char __a, vector unsigned char __b,
7846 vector unsigned char __c) {
7847 return (__a & ~__c) | (__b & __c);
7848}
7849
7850static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
7851 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7852 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7853}
7854
7855static __inline__ vector bool char __ATTRS_o_ai
7856vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7857 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7858}
7859
7860static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
7861 vector bool char __b,
7862 vector bool char __c) {
7863 return (__a & ~__c) | (__b & __c);
7864}
7865
7866static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7867 vector short __b,
7868 vector unsigned short __c) {
7869 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7870}
7871
7872static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
7873 vector short __b,
7874 vector bool short __c) {
7875 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
7876}
7877
7878static __inline__ vector unsigned short __ATTRS_o_ai
7879vec_sel(vector unsigned short __a, vector unsigned short __b,
7880 vector unsigned short __c) {
7881 return (__a & ~__c) | (__b & __c);
7882}
7883
7884static __inline__ vector unsigned short __ATTRS_o_ai
7885vec_sel(vector unsigned short __a, vector unsigned short __b,
7886 vector bool short __c) {
7887 return (__a & ~(vector unsigned short)__c) |
7888 (__b & (vector unsigned short)__c);
7889}
7890
7891static __inline__ vector bool short __ATTRS_o_ai vec_sel(
7892 vector bool short __a, vector bool short __b, vector unsigned short __c) {
7893 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
7894}
7895
7896static __inline__ vector bool short __ATTRS_o_ai
7897vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
7898 return (__a & ~__c) | (__b & __c);
7899}
7900
7901static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7902 vector int __b,
7903 vector unsigned int __c) {
7904 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7905}
7906
7907static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
7908 vector int __b,
7909 vector bool int __c) {
7910 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
7911}
7912
7913static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
7914 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
7915 return (__a & ~__c) | (__b & __c);
7916}
7917
7918static __inline__ vector unsigned int __ATTRS_o_ai
7919vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
7920 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
7921}
7922
7923static __inline__ vector bool int __ATTRS_o_ai
7924vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
7925 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
7926}
7927
7928static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
7929 vector bool int __b,
7930 vector bool int __c) {
7931 return (__a & ~__c) | (__b & __c);
7932}
7933
7934static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7935 vector float __b,
7936 vector unsigned int __c) {
7937 vector int __res = ((vector int)__a & ~(vector int)__c) |
7938 ((vector int)__b & (vector int)__c);
7939 return (vector float)__res;
7940}
7941
7942static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
7943 vector float __b,
7944 vector bool int __c) {
7945 vector int __res = ((vector int)__a & ~(vector int)__c) |
7946 ((vector int)__b & (vector int)__c);
7947 return (vector float)__res;
7948}
7949
7950#ifdef __VSX__
7951static __inline__ vector double __ATTRS_o_ai
7952vec_sel(vector double __a, vector double __b, vector bool long long __c) {
7953 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7954 ((vector long long)__b & (vector long long)__c);
7955 return (vector double)__res;
7956}
7957
7958static __inline__ vector double __ATTRS_o_ai
7959vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
7960 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
7961 ((vector long long)__b & (vector long long)__c);
7962 return (vector double)__res;
7963}
7964#endif
7965
7966/* vec_vsel */
7967
7968static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
7969 vector signed char __a, vector signed char __b, vector unsigned char __c) {
7970 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7971}
7972
7973static __inline__ vector signed char __ATTRS_o_ai
7974vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
7975 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
7976}
7977
7978static __inline__ vector unsigned char __ATTRS_o_ai
7979vec_vsel(vector unsigned char __a, vector unsigned char __b,
7980 vector unsigned char __c) {
7981 return (__a & ~__c) | (__b & __c);
7982}
7983
7984static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
7985 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
7986 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
7987}
7988
7989static __inline__ vector bool char __ATTRS_o_ai
7990vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
7991 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
7992}
7993
7994static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
7995 vector bool char __b,
7996 vector bool char __c) {
7997 return (__a & ~__c) | (__b & __c);
7998}
7999
8000static __inline__ vector short __ATTRS_o_ai
8001vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
8002 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8003}
8004
8005static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
8006 vector short __b,
8007 vector bool short __c) {
8008 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
8009}
8010
8011static __inline__ vector unsigned short __ATTRS_o_ai
8012vec_vsel(vector unsigned short __a, vector unsigned short __b,
8013 vector unsigned short __c) {
8014 return (__a & ~__c) | (__b & __c);
8015}
8016
8017static __inline__ vector unsigned short __ATTRS_o_ai
8018vec_vsel(vector unsigned short __a, vector unsigned short __b,
8019 vector bool short __c) {
8020 return (__a & ~(vector unsigned short)__c) |
8021 (__b & (vector unsigned short)__c);
8022}
8023
8024static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
8025 vector bool short __a, vector bool short __b, vector unsigned short __c) {
8026 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
8027}
8028
8029static __inline__ vector bool short __ATTRS_o_ai
8030vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
8031 return (__a & ~__c) | (__b & __c);
8032}
8033
8034static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8035 vector int __b,
8036 vector unsigned int __c) {
8037 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8038}
8039
8040static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
8041 vector int __b,
8042 vector bool int __c) {
8043 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
8044}
8045
8046static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8047 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
8048 return (__a & ~__c) | (__b & __c);
8049}
8050
8051static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
8052 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
8053 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
8054}
8055
8056static __inline__ vector bool int __ATTRS_o_ai
8057vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
8058 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
8059}
8060
8061static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
8062 vector bool int __b,
8063 vector bool int __c) {
8064 return (__a & ~__c) | (__b & __c);
8065}
8066
8067static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8068 vector float __b,
8069 vector unsigned int __c) {
8070 vector int __res = ((vector int)__a & ~(vector int)__c) |
8071 ((vector int)__b & (vector int)__c);
8072 return (vector float)__res;
8073}
8074
8075static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
8076 vector float __b,
8077 vector bool int __c) {
8078 vector int __res = ((vector int)__a & ~(vector int)__c) |
8079 ((vector int)__b & (vector int)__c);
8080 return (vector float)__res;
8081}
8082
8083/* vec_sl */
8084
8085// vec_sl does modulo arithmetic on __b first, so __b is allowed to be more
8086// than the length of __a.
8087static __inline__ vector unsigned char __ATTRS_o_ai
8088vec_sl(vector unsigned char __a, vector unsigned char __b) {
8089 return __a << (__b %
8090 (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
8091}
8092
8093static __inline__ vector signed char __ATTRS_o_ai
8094vec_sl(vector signed char __a, vector unsigned char __b) {
8095 return (vector signed char)vec_sl((vector unsigned char)__a, __b);
8096}
8097
8098static __inline__ vector unsigned short __ATTRS_o_ai
8099vec_sl(vector unsigned short __a, vector unsigned short __b) {
8100 return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *
8101 __CHAR_BIT__));
8102}
8103
8104static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
8105 vector unsigned short __b) {
8106 return (vector short)vec_sl((vector unsigned short)__a, __b);
8107}
8108
8109static __inline__ vector unsigned int __ATTRS_o_ai
8110vec_sl(vector unsigned int __a, vector unsigned int __b) {
8111 return __a << (__b %
8112 (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
8113}
8114
8115static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
8116 vector unsigned int __b) {
8117 return (vector int)vec_sl((vector unsigned int)__a, __b);
8118}
8119
8120#ifdef __POWER8_VECTOR__
8121static __inline__ vector unsigned long long __ATTRS_o_ai
8122vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
8123 return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *
8124 __CHAR_BIT__));
8125}
8126
8127static __inline__ vector long long __ATTRS_o_ai
8128vec_sl(vector long long __a, vector unsigned long long __b) {
8129 return (vector long long)vec_sl((vector unsigned long long)__a, __b);
8130}
8131#endif
8132
8133/* vec_vslb */
8134
8135#define __builtin_altivec_vslb vec_vslb
8136
8137static __inline__ vector signed char __ATTRS_o_ai
8138vec_vslb(vector signed char __a, vector unsigned char __b) {
8139 return vec_sl(__a, __b);
8140}
8141
8142static __inline__ vector unsigned char __ATTRS_o_ai
8143vec_vslb(vector unsigned char __a, vector unsigned char __b) {
8144 return vec_sl(__a, __b);
8145}
8146
8147/* vec_vslh */
8148
8149#define __builtin_altivec_vslh vec_vslh
8150
8151static __inline__ vector short __ATTRS_o_ai
8152vec_vslh(vector short __a, vector unsigned short __b) {
8153 return vec_sl(__a, __b);
8154}
8155
8156static __inline__ vector unsigned short __ATTRS_o_ai
8157vec_vslh(vector unsigned short __a, vector unsigned short __b) {
8158 return vec_sl(__a, __b);
8159}
8160
8161/* vec_vslw */
8162
8163#define __builtin_altivec_vslw vec_vslw
8164
8165static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
8166 vector unsigned int __b) {
8167 return vec_sl(__a, __b);
8168}
8169
8170static __inline__ vector unsigned int __ATTRS_o_ai
8171vec_vslw(vector unsigned int __a, vector unsigned int __b) {
8172 return vec_sl(__a, __b);
8173}
8174
8175/* vec_sld */
8176
8177#define __builtin_altivec_vsldoi_4si vec_sld
8178
8179static __inline__ vector signed char __ATTRS_o_ai vec_sld(
8180 vector signed char __a, vector signed char __b, unsigned const int __c) {
8181 unsigned char __d = __c & 0x0F;
8182#ifdef __LITTLE_ENDIAN__
8183 return vec_perm(
8184 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8185 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8186 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8187 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8188#else
8189 return vec_perm(
8190 __a, __b,
8191 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8192 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8193 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8194#endif
8195}
8196
8197static __inline__ vector unsigned char __ATTRS_o_ai
8198vec_sld(vector unsigned char __a, vector unsigned char __b,
8199 unsigned const int __c) {
8200 unsigned char __d = __c & 0x0F;
8201#ifdef __LITTLE_ENDIAN__
8202 return vec_perm(
8203 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8204 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8205 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8206 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8207#else
8208 return vec_perm(
8209 __a, __b,
8210 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8211 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8212 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8213#endif
8214}
8215
8216static __inline__ vector bool char __ATTRS_o_ai
8217vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
8218 unsigned char __d = __c & 0x0F;
8219#ifdef __LITTLE_ENDIAN__
8220 return vec_perm(
8221 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8222 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8223 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8224 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8225#else
8226 return vec_perm(
8227 __a, __b,
8228 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8229 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8230 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8231#endif
8232}
8233
8234static __inline__ vector signed short __ATTRS_o_ai vec_sld(
8235 vector signed short __a, vector signed short __b, unsigned const int __c) {
8236 unsigned char __d = __c & 0x0F;
8237#ifdef __LITTLE_ENDIAN__
8238 return vec_perm(
8239 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8240 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8241 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8242 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8243#else
8244 return vec_perm(
8245 __a, __b,
8246 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8247 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8248 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8249#endif
8250}
8251
8252static __inline__ vector unsigned short __ATTRS_o_ai
8253vec_sld(vector unsigned short __a, vector unsigned short __b,
8254 unsigned const int __c) {
8255 unsigned char __d = __c & 0x0F;
8256#ifdef __LITTLE_ENDIAN__
8257 return vec_perm(
8258 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8259 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8260 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8261 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8262#else
8263 return vec_perm(
8264 __a, __b,
8265 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8266 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8267 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8268#endif
8269}
8270
8271static __inline__ vector bool short __ATTRS_o_ai
8272vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
8273 unsigned char __d = __c & 0x0F;
8274#ifdef __LITTLE_ENDIAN__
8275 return vec_perm(
8276 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8277 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8278 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8279 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8280#else
8281 return vec_perm(
8282 __a, __b,
8283 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8284 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8285 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8286#endif
8287}
8288
8289static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
8290 vector pixel __b,
8291 unsigned const int __c) {
8292 unsigned char __d = __c & 0x0F;
8293#ifdef __LITTLE_ENDIAN__
8294 return vec_perm(
8295 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8296 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8297 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8298 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8299#else
8300 return vec_perm(
8301 __a, __b,
8302 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8303 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8304 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8305#endif
8306}
8307
8308static __inline__ vector signed int __ATTRS_o_ai
8309vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
8310 unsigned char __d = __c & 0x0F;
8311#ifdef __LITTLE_ENDIAN__
8312 return vec_perm(
8313 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8314 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8315 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8316 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8317#else
8318 return vec_perm(
8319 __a, __b,
8320 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8321 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8322 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8323#endif
8324}
8325
8326static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
8327 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8328 unsigned char __d = __c & 0x0F;
8329#ifdef __LITTLE_ENDIAN__
8330 return vec_perm(
8331 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8332 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8333 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8334 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8335#else
8336 return vec_perm(
8337 __a, __b,
8338 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8339 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8340 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8341#endif
8342}
8343
8344static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
8345 vector bool int __b,
8346 unsigned const int __c) {
8347 unsigned char __d = __c & 0x0F;
8348#ifdef __LITTLE_ENDIAN__
8349 return vec_perm(
8350 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8351 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8352 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8353 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8354#else
8355 return vec_perm(
8356 __a, __b,
8357 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8358 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8359 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8360#endif
8361}
8362
8363static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
8364 vector float __b,
8365 unsigned const int __c) {
8366 unsigned char __d = __c & 0x0F;
8367#ifdef __LITTLE_ENDIAN__
8368 return vec_perm(
8369 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8370 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8371 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8372 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8373#else
8374 return vec_perm(
8375 __a, __b,
8376 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8377 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8378 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8379#endif
8380}
8381
8382#ifdef __VSX__
8383static __inline__ vector bool long long __ATTRS_o_ai
8384vec_sld(vector bool long long __a, vector bool long long __b,
8385 unsigned const int __c) {
8386 unsigned char __d = __c & 0x0F;
8387#ifdef __LITTLE_ENDIAN__
8388 return vec_perm(
8389 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8390 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8391 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8392 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8393#else
8394 return vec_perm(
8395 __a, __b,
8396 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8397 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8398 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8399#endif
8400}
8401
8402static __inline__ vector signed long long __ATTRS_o_ai
8403vec_sld(vector signed long long __a, vector signed long long __b,
8404 unsigned const int __c) {
8405 unsigned char __d = __c & 0x0F;
8406#ifdef __LITTLE_ENDIAN__
8407 return vec_perm(
8408 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8409 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8410 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8411 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8412#else
8413 return vec_perm(
8414 __a, __b,
8415 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8416 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8417 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8418#endif
8419}
8420
8421static __inline__ vector unsigned long long __ATTRS_o_ai
8422vec_sld(vector unsigned long long __a, vector unsigned long long __b,
8423 unsigned const int __c) {
8424 unsigned char __d = __c & 0x0F;
8425#ifdef __LITTLE_ENDIAN__
8426 return vec_perm(
8427 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8428 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8429 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8430 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8431#else
8432 return vec_perm(
8433 __a, __b,
8434 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8435 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8436 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8437#endif
8438}
8439
8440static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,
8441 vector double __b,
8442 unsigned const int __c) {
8443 unsigned char __d = __c & 0x0F;
8444#ifdef __LITTLE_ENDIAN__
8445 return vec_perm(
8446 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8447 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8448 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8449 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8450#else
8451 return vec_perm(
8452 __a, __b,
8453 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8454 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8455 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8456#endif
8457}
8458#endif
8459
8460/* vec_sldw */
8461static __inline__ vector signed char __ATTRS_o_ai vec_sldw(
8462 vector signed char __a, vector signed char __b, unsigned const int __c) {
8463 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8464}
8465
8466static __inline__ vector unsigned char __ATTRS_o_ai
8467vec_sldw(vector unsigned char __a, vector unsigned char __b,
8468 unsigned const int __c) {
8469 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8470}
8471
8472static __inline__ vector signed short __ATTRS_o_ai vec_sldw(
8473 vector signed short __a, vector signed short __b, unsigned const int __c) {
8474 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8475}
8476
8477static __inline__ vector unsigned short __ATTRS_o_ai
8478vec_sldw(vector unsigned short __a, vector unsigned short __b,
8479 unsigned const int __c) {
8480 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8481}
8482
8483static __inline__ vector signed int __ATTRS_o_ai
8484vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {
8485 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8486}
8487
8488static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(
8489 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
8490 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8491}
8492
8493#ifdef __VSX__
8494static __inline__ vector signed long long __ATTRS_o_ai
8495vec_sldw(vector signed long long __a, vector signed long long __b,
8496 unsigned const int __c) {
8497 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8498}
8499
8500static __inline__ vector unsigned long long __ATTRS_o_ai
8501vec_sldw(vector unsigned long long __a, vector unsigned long long __b,
8502 unsigned const int __c) {
8503 return vec_sld(__a, __b, ((__c << 2) & 0x0F));
8504}
8505#endif
8506
8507#ifdef __POWER9_VECTOR__
8508/* vec_slv */
8509static __inline__ vector unsigned char __ATTRS_o_ai
8510vec_slv(vector unsigned char __a, vector unsigned char __b) {
8511 return __builtin_altivec_vslv(__a, __b);
8512}
8513
8514/* vec_srv */
8515static __inline__ vector unsigned char __ATTRS_o_ai
8516vec_srv(vector unsigned char __a, vector unsigned char __b) {
8517 return __builtin_altivec_vsrv(__a, __b);
8518}
8519#endif
8520
8521/* vec_vsldoi */
8522
8523static __inline__ vector signed char __ATTRS_o_ai
8524vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
8525 unsigned char __d = __c & 0x0F;
8526#ifdef __LITTLE_ENDIAN__
8527 return vec_perm(
8528 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8529 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8530 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8531 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8532#else
8533 return vec_perm(
8534 __a, __b,
8535 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8536 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8537 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8538#endif
8539}
8540
8541static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
8542 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
8543 unsigned char __d = __c & 0x0F;
8544#ifdef __LITTLE_ENDIAN__
8545 return vec_perm(
8546 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8547 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8548 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8549 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8550#else
8551 return vec_perm(
8552 __a, __b,
8553 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8554 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8555 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8556#endif
8557}
8558
8559static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
8560 vector short __b,
8561 unsigned char __c) {
8562 unsigned char __d = __c & 0x0F;
8563#ifdef __LITTLE_ENDIAN__
8564 return vec_perm(
8565 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8566 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8567 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8568 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8569#else
8570 return vec_perm(
8571 __a, __b,
8572 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8573 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8574 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8575#endif
8576}
8577
8578static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
8579 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
8580 unsigned char __d = __c & 0x0F;
8581#ifdef __LITTLE_ENDIAN__
8582 return vec_perm(
8583 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8584 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8585 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8586 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8587#else
8588 return vec_perm(
8589 __a, __b,
8590 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8591 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8592 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8593#endif
8594}
8595
8596static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
8597 vector pixel __b,
8598 unsigned char __c) {
8599 unsigned char __d = __c & 0x0F;
8600#ifdef __LITTLE_ENDIAN__
8601 return vec_perm(
8602 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8603 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8604 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8605 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8606#else
8607 return vec_perm(
8608 __a, __b,
8609 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8610 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8611 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8612#endif
8613}
8614
8615static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
8616 vector int __b,
8617 unsigned char __c) {
8618 unsigned char __d = __c & 0x0F;
8619#ifdef __LITTLE_ENDIAN__
8620 return vec_perm(
8621 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8622 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8623 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8624 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8625#else
8626 return vec_perm(
8627 __a, __b,
8628 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8629 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8630 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8631#endif
8632}
8633
8634static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
8635 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
8636 unsigned char __d = __c & 0x0F;
8637#ifdef __LITTLE_ENDIAN__
8638 return vec_perm(
8639 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8640 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8641 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8642 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8643#else
8644 return vec_perm(
8645 __a, __b,
8646 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8647 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8648 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8649#endif
8650}
8651
8652static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
8653 vector float __b,
8654 unsigned char __c) {
8655 unsigned char __d = __c & 0x0F;
8656#ifdef __LITTLE_ENDIAN__
8657 return vec_perm(
8658 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
8659 20 - __d, 21 - __d, 22 - __d, 23 - __d,
8660 24 - __d, 25 - __d, 26 - __d, 27 - __d,
8661 28 - __d, 29 - __d, 30 - __d, 31 - __d));
8662#else
8663 return vec_perm(
8664 __a, __b,
8665 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
8666 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
8667 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
8668#endif
8669}
8670
8671/* vec_sll */
8672
8673static __inline__ vector signed char __ATTRS_o_ai
8674vec_sll(vector signed char __a, vector unsigned char __b) {
8675 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8676 (vector int)__b);
8677}
8678
8679static __inline__ vector signed char __ATTRS_o_ai
8680vec_sll(vector signed char __a, vector unsigned short __b) {
8681 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8682 (vector int)__b);
8683}
8684
8685static __inline__ vector signed char __ATTRS_o_ai
8686vec_sll(vector signed char __a, vector unsigned int __b) {
8687 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8688 (vector int)__b);
8689}
8690
8691static __inline__ vector unsigned char __ATTRS_o_ai
8692vec_sll(vector unsigned char __a, vector unsigned char __b) {
8693 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8694 (vector int)__b);
8695}
8696
8697static __inline__ vector unsigned char __ATTRS_o_ai
8698vec_sll(vector unsigned char __a, vector unsigned short __b) {
8699 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8700 (vector int)__b);
8701}
8702
8703static __inline__ vector unsigned char __ATTRS_o_ai
8704vec_sll(vector unsigned char __a, vector unsigned int __b) {
8705 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8706 (vector int)__b);
8707}
8708
8709static __inline__ vector bool char __ATTRS_o_ai
8710vec_sll(vector bool char __a, vector unsigned char __b) {
8711 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8712 (vector int)__b);
8713}
8714
8715static __inline__ vector bool char __ATTRS_o_ai
8716vec_sll(vector bool char __a, vector unsigned short __b) {
8717 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8718 (vector int)__b);
8719}
8720
8721static __inline__ vector bool char __ATTRS_o_ai
8722vec_sll(vector bool char __a, vector unsigned int __b) {
8723 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8724 (vector int)__b);
8725}
8726
8727static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8728 vector unsigned char __b) {
8729 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8730}
8731
8732static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8733 vector unsigned short __b) {
8734 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8735}
8736
8737static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
8738 vector unsigned int __b) {
8739 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8740}
8741
8742static __inline__ vector unsigned short __ATTRS_o_ai
8743vec_sll(vector unsigned short __a, vector unsigned char __b) {
8744 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8745 (vector int)__b);
8746}
8747
8748static __inline__ vector unsigned short __ATTRS_o_ai
8749vec_sll(vector unsigned short __a, vector unsigned short __b) {
8750 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8751 (vector int)__b);
8752}
8753
8754static __inline__ vector unsigned short __ATTRS_o_ai
8755vec_sll(vector unsigned short __a, vector unsigned int __b) {
8756 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8757 (vector int)__b);
8758}
8759
8760static __inline__ vector bool short __ATTRS_o_ai
8761vec_sll(vector bool short __a, vector unsigned char __b) {
8762 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8763 (vector int)__b);
8764}
8765
8766static __inline__ vector bool short __ATTRS_o_ai
8767vec_sll(vector bool short __a, vector unsigned short __b) {
8768 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8769 (vector int)__b);
8770}
8771
8772static __inline__ vector bool short __ATTRS_o_ai
8773vec_sll(vector bool short __a, vector unsigned int __b) {
8774 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8775 (vector int)__b);
8776}
8777
8778static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8779 vector unsigned char __b) {
8780 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8781}
8782
8783static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8784 vector unsigned short __b) {
8785 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8786}
8787
8788static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
8789 vector unsigned int __b) {
8790 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8791}
8792
8793static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8794 vector unsigned char __b) {
8795 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8796}
8797
8798static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8799 vector unsigned short __b) {
8800 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8801}
8802
8803static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
8804 vector unsigned int __b) {
8805 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8806}
8807
8808static __inline__ vector unsigned int __ATTRS_o_ai
8809vec_sll(vector unsigned int __a, vector unsigned char __b) {
8810 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8811 (vector int)__b);
8812}
8813
8814static __inline__ vector unsigned int __ATTRS_o_ai
8815vec_sll(vector unsigned int __a, vector unsigned short __b) {
8816 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8817 (vector int)__b);
8818}
8819
8820static __inline__ vector unsigned int __ATTRS_o_ai
8821vec_sll(vector unsigned int __a, vector unsigned int __b) {
8822 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8823 (vector int)__b);
8824}
8825
8826static __inline__ vector bool int __ATTRS_o_ai
8827vec_sll(vector bool int __a, vector unsigned char __b) {
8828 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8829 (vector int)__b);
8830}
8831
8832static __inline__ vector bool int __ATTRS_o_ai
8833vec_sll(vector bool int __a, vector unsigned short __b) {
8834 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8835 (vector int)__b);
8836}
8837
8838static __inline__ vector bool int __ATTRS_o_ai
8839vec_sll(vector bool int __a, vector unsigned int __b) {
8840 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
8841 (vector int)__b);
8842}
8843
8844#ifdef __VSX__
8845static __inline__ vector signed long long __ATTRS_o_ai
8846vec_sll(vector signed long long __a, vector unsigned char __b) {
8847 return (vector signed long long)__builtin_altivec_vsl((vector int)__a,
8848 (vector int)__b);
8849}
8850
8851static __inline__ vector unsigned long long __ATTRS_o_ai
8852vec_sll(vector unsigned long long __a, vector unsigned char __b) {
8853 return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,
8854 (vector int)__b);
8855}
8856#endif
8857
8858/* vec_vsl */
8859
8860static __inline__ vector signed char __ATTRS_o_ai
8861vec_vsl(vector signed char __a, vector unsigned char __b) {
8862 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8863 (vector int)__b);
8864}
8865
8866static __inline__ vector signed char __ATTRS_o_ai
8867vec_vsl(vector signed char __a, vector unsigned short __b) {
8868 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8869 (vector int)__b);
8870}
8871
8872static __inline__ vector signed char __ATTRS_o_ai
8873vec_vsl(vector signed char __a, vector unsigned int __b) {
8874 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
8875 (vector int)__b);
8876}
8877
8878static __inline__ vector unsigned char __ATTRS_o_ai
8879vec_vsl(vector unsigned char __a, vector unsigned char __b) {
8880 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8881 (vector int)__b);
8882}
8883
8884static __inline__ vector unsigned char __ATTRS_o_ai
8885vec_vsl(vector unsigned char __a, vector unsigned short __b) {
8886 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8887 (vector int)__b);
8888}
8889
8890static __inline__ vector unsigned char __ATTRS_o_ai
8891vec_vsl(vector unsigned char __a, vector unsigned int __b) {
8892 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
8893 (vector int)__b);
8894}
8895
8896static __inline__ vector bool char __ATTRS_o_ai
8897vec_vsl(vector bool char __a, vector unsigned char __b) {
8898 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8899 (vector int)__b);
8900}
8901
8902static __inline__ vector bool char __ATTRS_o_ai
8903vec_vsl(vector bool char __a, vector unsigned short __b) {
8904 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8905 (vector int)__b);
8906}
8907
8908static __inline__ vector bool char __ATTRS_o_ai
8909vec_vsl(vector bool char __a, vector unsigned int __b) {
8910 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
8911 (vector int)__b);
8912}
8913
8914static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8915 vector unsigned char __b) {
8916 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8917}
8918
8919static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8920 vector unsigned short __b) {
8921 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8922}
8923
8924static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
8925 vector unsigned int __b) {
8926 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8927}
8928
8929static __inline__ vector unsigned short __ATTRS_o_ai
8930vec_vsl(vector unsigned short __a, vector unsigned char __b) {
8931 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8932 (vector int)__b);
8933}
8934
8935static __inline__ vector unsigned short __ATTRS_o_ai
8936vec_vsl(vector unsigned short __a, vector unsigned short __b) {
8937 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8938 (vector int)__b);
8939}
8940
8941static __inline__ vector unsigned short __ATTRS_o_ai
8942vec_vsl(vector unsigned short __a, vector unsigned int __b) {
8943 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
8944 (vector int)__b);
8945}
8946
8947static __inline__ vector bool short __ATTRS_o_ai
8948vec_vsl(vector bool short __a, vector unsigned char __b) {
8949 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8950 (vector int)__b);
8951}
8952
8953static __inline__ vector bool short __ATTRS_o_ai
8954vec_vsl(vector bool short __a, vector unsigned short __b) {
8955 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8956 (vector int)__b);
8957}
8958
8959static __inline__ vector bool short __ATTRS_o_ai
8960vec_vsl(vector bool short __a, vector unsigned int __b) {
8961 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
8962 (vector int)__b);
8963}
8964
8965static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8966 vector unsigned char __b) {
8967 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8968}
8969
8970static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8971 vector unsigned short __b) {
8972 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8973}
8974
8975static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
8976 vector unsigned int __b) {
8977 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
8978}
8979
8980static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8981 vector unsigned char __b) {
8982 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8983}
8984
8985static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8986 vector unsigned short __b) {
8987 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8988}
8989
8990static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
8991 vector unsigned int __b) {
8992 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
8993}
8994
8995static __inline__ vector unsigned int __ATTRS_o_ai
8996vec_vsl(vector unsigned int __a, vector unsigned char __b) {
8997 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
8998 (vector int)__b);
8999}
9000
9001static __inline__ vector unsigned int __ATTRS_o_ai
9002vec_vsl(vector unsigned int __a, vector unsigned short __b) {
9003 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9004 (vector int)__b);
9005}
9006
9007static __inline__ vector unsigned int __ATTRS_o_ai
9008vec_vsl(vector unsigned int __a, vector unsigned int __b) {
9009 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
9010 (vector int)__b);
9011}
9012
9013static __inline__ vector bool int __ATTRS_o_ai
9014vec_vsl(vector bool int __a, vector unsigned char __b) {
9015 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9016 (vector int)__b);
9017}
9018
9019static __inline__ vector bool int __ATTRS_o_ai
9020vec_vsl(vector bool int __a, vector unsigned short __b) {
9021 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9022 (vector int)__b);
9023}
9024
9025static __inline__ vector bool int __ATTRS_o_ai
9026vec_vsl(vector bool int __a, vector unsigned int __b) {
9027 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
9028 (vector int)__b);
9029}
9030
9031/* vec_slo */
9032
9033static __inline__ vector signed char __ATTRS_o_ai
9034vec_slo(vector signed char __a, vector signed char __b) {
9035 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9036 (vector int)__b);
9037}
9038
9039static __inline__ vector signed char __ATTRS_o_ai
9040vec_slo(vector signed char __a, vector unsigned char __b) {
9041 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9042 (vector int)__b);
9043}
9044
9045static __inline__ vector unsigned char __ATTRS_o_ai
9046vec_slo(vector unsigned char __a, vector signed char __b) {
9047 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9048 (vector int)__b);
9049}
9050
9051static __inline__ vector unsigned char __ATTRS_o_ai
9052vec_slo(vector unsigned char __a, vector unsigned char __b) {
9053 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9054 (vector int)__b);
9055}
9056
9057static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9058 vector signed char __b) {
9059 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9060}
9061
9062static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
9063 vector unsigned char __b) {
9064 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9065}
9066
9067static __inline__ vector unsigned short __ATTRS_o_ai
9068vec_slo(vector unsigned short __a, vector signed char __b) {
9069 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9070 (vector int)__b);
9071}
9072
9073static __inline__ vector unsigned short __ATTRS_o_ai
9074vec_slo(vector unsigned short __a, vector unsigned char __b) {
9075 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9076 (vector int)__b);
9077}
9078
9079static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9080 vector signed char __b) {
9081 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9082}
9083
9084static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
9085 vector unsigned char __b) {
9086 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9087}
9088
9089static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9090 vector signed char __b) {
9091 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9092}
9093
9094static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
9095 vector unsigned char __b) {
9096 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9097}
9098
9099static __inline__ vector unsigned int __ATTRS_o_ai
9100vec_slo(vector unsigned int __a, vector signed char __b) {
9101 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9102 (vector int)__b);
9103}
9104
9105static __inline__ vector unsigned int __ATTRS_o_ai
9106vec_slo(vector unsigned int __a, vector unsigned char __b) {
9107 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9108 (vector int)__b);
9109}
9110
9111static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9112 vector signed char __b) {
9113 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9114}
9115
9116static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
9117 vector unsigned char __b) {
9118 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9119}
9120
9121#ifdef __VSX__
9122static __inline__ vector signed long long __ATTRS_o_ai
9123vec_slo(vector signed long long __a, vector signed char __b) {
9124 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9125 (vector int)__b);
9126}
9127
9128static __inline__ vector signed long long __ATTRS_o_ai
9129vec_slo(vector signed long long __a, vector unsigned char __b) {
9130 return (vector signed long long)__builtin_altivec_vslo((vector int)__a,
9131 (vector int)__b);
9132}
9133
9134static __inline__ vector unsigned long long __ATTRS_o_ai
9135vec_slo(vector unsigned long long __a, vector signed char __b) {
9136 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9137 (vector int)__b);
9138}
9139
9140static __inline__ vector unsigned long long __ATTRS_o_ai
9141vec_slo(vector unsigned long long __a, vector unsigned char __b) {
9142 return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,
9143 (vector int)__b);
9144}
9145#endif
9146
9147/* vec_vslo */
9148
9149static __inline__ vector signed char __ATTRS_o_ai
9150vec_vslo(vector signed char __a, vector signed char __b) {
9151 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9152 (vector int)__b);
9153}
9154
9155static __inline__ vector signed char __ATTRS_o_ai
9156vec_vslo(vector signed char __a, vector unsigned char __b) {
9157 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
9158 (vector int)__b);
9159}
9160
9161static __inline__ vector unsigned char __ATTRS_o_ai
9162vec_vslo(vector unsigned char __a, vector signed char __b) {
9163 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9164 (vector int)__b);
9165}
9166
9167static __inline__ vector unsigned char __ATTRS_o_ai
9168vec_vslo(vector unsigned char __a, vector unsigned char __b) {
9169 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
9170 (vector int)__b);
9171}
9172
9173static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9174 vector signed char __b) {
9175 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9176}
9177
9178static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
9179 vector unsigned char __b) {
9180 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9181}
9182
9183static __inline__ vector unsigned short __ATTRS_o_ai
9184vec_vslo(vector unsigned short __a, vector signed char __b) {
9185 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9186 (vector int)__b);
9187}
9188
9189static __inline__ vector unsigned short __ATTRS_o_ai
9190vec_vslo(vector unsigned short __a, vector unsigned char __b) {
9191 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
9192 (vector int)__b);
9193}
9194
9195static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9196 vector signed char __b) {
9197 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9198}
9199
9200static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
9201 vector unsigned char __b) {
9202 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9203}
9204
9205static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9206 vector signed char __b) {
9207 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9208}
9209
9210static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
9211 vector unsigned char __b) {
9212 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
9213}
9214
9215static __inline__ vector unsigned int __ATTRS_o_ai
9216vec_vslo(vector unsigned int __a, vector signed char __b) {
9217 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9218 (vector int)__b);
9219}
9220
9221static __inline__ vector unsigned int __ATTRS_o_ai
9222vec_vslo(vector unsigned int __a, vector unsigned char __b) {
9223 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
9224 (vector int)__b);
9225}
9226
9227static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9228 vector signed char __b) {
9229 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9230}
9231
9232static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
9233 vector unsigned char __b) {
9234 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
9235}
9236
9237/* vec_splat */
9238
9239static __inline__ vector signed char __ATTRS_o_ai
9240vec_splat(vector signed char __a, unsigned const int __b) {
9241 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9242}
9243
9244static __inline__ vector unsigned char __ATTRS_o_ai
9245vec_splat(vector unsigned char __a, unsigned const int __b) {
9246 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9247}
9248
9249static __inline__ vector bool char __ATTRS_o_ai
9250vec_splat(vector bool char __a, unsigned const int __b) {
9251 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
9252}
9253
9254static __inline__ vector signed short __ATTRS_o_ai
9255vec_splat(vector signed short __a, unsigned const int __b) {
9256 unsigned char b0 = (__b & 0x07) * 2;
9257 unsigned char b1 = b0 + 1;
9258 return vec_perm(__a, __a,
9259 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9260 b0, b1, b0, b1, b0, b1));
9261}
9262
9263static __inline__ vector unsigned short __ATTRS_o_ai
9264vec_splat(vector unsigned short __a, unsigned const int __b) {
9265 unsigned char b0 = (__b & 0x07) * 2;
9266 unsigned char b1 = b0 + 1;
9267 return vec_perm(__a, __a,
9268 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9269 b0, b1, b0, b1, b0, b1));
9270}
9271
9272static __inline__ vector bool short __ATTRS_o_ai
9273vec_splat(vector bool short __a, unsigned const int __b) {
9274 unsigned char b0 = (__b & 0x07) * 2;
9275 unsigned char b1 = b0 + 1;
9276 return vec_perm(__a, __a,
9277 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9278 b0, b1, b0, b1, b0, b1));
9279}
9280
9281static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
9282 unsigned const int __b) {
9283 unsigned char b0 = (__b & 0x07) * 2;
9284 unsigned char b1 = b0 + 1;
9285 return vec_perm(__a, __a,
9286 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
9287 b0, b1, b0, b1, b0, b1));
9288}
9289
9290static __inline__ vector signed int __ATTRS_o_ai
9291vec_splat(vector signed int __a, unsigned const int __b) {
9292 unsigned char b0 = (__b & 0x03) * 4;
9293 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9294 return vec_perm(__a, __a,
9295 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9296 b2, b3, b0, b1, b2, b3));
9297}
9298
9299static __inline__ vector unsigned int __ATTRS_o_ai
9300vec_splat(vector unsigned int __a, unsigned const int __b) {
9301 unsigned char b0 = (__b & 0x03) * 4;
9302 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9303 return vec_perm(__a, __a,
9304 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9305 b2, b3, b0, b1, b2, b3));
9306}
9307
9308static __inline__ vector bool int __ATTRS_o_ai
9309vec_splat(vector bool int __a, unsigned const int __b) {
9310 unsigned char b0 = (__b & 0x03) * 4;
9311 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9312 return vec_perm(__a, __a,
9313 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9314 b2, b3, b0, b1, b2, b3));
9315}
9316
9317static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
9318 unsigned const int __b) {
9319 unsigned char b0 = (__b & 0x03) * 4;
9320 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
9321 return vec_perm(__a, __a,
9322 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
9323 b2, b3, b0, b1, b2, b3));
9324}
9325
9326#ifdef __VSX__
9327static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
9328 unsigned const int __b) {
9329 unsigned char b0 = (__b & 0x01) * 8;
9330 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9331 b6 = b0 + 6, b7 = b0 + 7;
9332 return vec_perm(__a, __a,
9333 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9334 b2, b3, b4, b5, b6, b7));
9335}
9336static __inline__ vector bool long long __ATTRS_o_ai
9337vec_splat(vector bool long long __a, unsigned const int __b) {
9338 unsigned char b0 = (__b & 0x01) * 8;
9339 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9340 b6 = b0 + 6, b7 = b0 + 7;
9341 return vec_perm(__a, __a,
9342 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9343 b2, b3, b4, b5, b6, b7));
9344}
9345static __inline__ vector signed long long __ATTRS_o_ai
9346vec_splat(vector signed long long __a, unsigned const int __b) {
9347 unsigned char b0 = (__b & 0x01) * 8;
9348 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9349 b6 = b0 + 6, b7 = b0 + 7;
9350 return vec_perm(__a, __a,
9351 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9352 b2, b3, b4, b5, b6, b7));
9353}
9354static __inline__ vector unsigned long long __ATTRS_o_ai
9355vec_splat(vector unsigned long long __a, unsigned const int __b) {
9356 unsigned char b0 = (__b & 0x01) * 8;
9357 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
9358 b6 = b0 + 6, b7 = b0 + 7;
9359 return vec_perm(__a, __a,
9360 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
9361 b2, b3, b4, b5, b6, b7));
9362}
9363#endif
9364
9365/* vec_vspltb */
9366
9367#define __builtin_altivec_vspltb vec_vspltb
9368
9369static __inline__ vector signed char __ATTRS_o_ai
9370vec_vspltb(vector signed char __a, unsigned char __b) {
9371 return vec_perm(__a, __a, (vector unsigned char)(__b));
9372}
9373
9374static __inline__ vector unsigned char __ATTRS_o_ai
9375vec_vspltb(vector unsigned char __a, unsigned char __b) {
9376 return vec_perm(__a, __a, (vector unsigned char)(__b));
9377}
9378
9379static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
9380 unsigned char __b) {
9381 return vec_perm(__a, __a, (vector unsigned char)(__b));
9382}
9383
9384/* vec_vsplth */
9385
9386#define __builtin_altivec_vsplth vec_vsplth
9387
9388static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
9389 unsigned char __b) {
9390 __b *= 2;
9391 unsigned char b1 = __b + 1;
9392 return vec_perm(__a, __a,
9393 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9394 __b, b1, __b, b1, __b, b1, __b, b1));
9395}
9396
9397static __inline__ vector unsigned short __ATTRS_o_ai
9398vec_vsplth(vector unsigned short __a, unsigned char __b) {
9399 __b *= 2;
9400 unsigned char b1 = __b + 1;
9401 return vec_perm(__a, __a,
9402 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9403 __b, b1, __b, b1, __b, b1, __b, b1));
9404}
9405
9406static __inline__ vector bool short __ATTRS_o_ai
9407vec_vsplth(vector bool short __a, unsigned char __b) {
9408 __b *= 2;
9409 unsigned char b1 = __b + 1;
9410 return vec_perm(__a, __a,
9411 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9412 __b, b1, __b, b1, __b, b1, __b, b1));
9413}
9414
9415static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
9416 unsigned char __b) {
9417 __b *= 2;
9418 unsigned char b1 = __b + 1;
9419 return vec_perm(__a, __a,
9420 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
9421 __b, b1, __b, b1, __b, b1, __b, b1));
9422}
9423
9424/* vec_vspltw */
9425
9426#define __builtin_altivec_vspltw vec_vspltw
9427
9428static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
9429 unsigned char __b) {
9430 __b *= 4;
9431 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9432 return vec_perm(__a, __a,
9433 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9434 b1, b2, b3, __b, b1, b2, b3));
9435}
9436
9437static __inline__ vector unsigned int __ATTRS_o_ai
9438vec_vspltw(vector unsigned int __a, unsigned char __b) {
9439 __b *= 4;
9440 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9441 return vec_perm(__a, __a,
9442 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9443 b1, b2, b3, __b, b1, b2, b3));
9444}
9445
9446static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
9447 unsigned char __b) {
9448 __b *= 4;
9449 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9450 return vec_perm(__a, __a,
9451 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9452 b1, b2, b3, __b, b1, b2, b3));
9453}
9454
9455static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
9456 unsigned char __b) {
9457 __b *= 4;
9458 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
9459 return vec_perm(__a, __a,
9460 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
9461 b1, b2, b3, __b, b1, b2, b3));
9462}
9463
9464/* vec_splat_s8 */
9465
9466#define __builtin_altivec_vspltisb vec_splat_s8
9467
9468// FIXME: parameter should be treated as 5-bit signed literal
9469static __inline__ vector signed char __ATTRS_o_ai
9470vec_splat_s8(signed char __a) {
9471 return (vector signed char)(__a);
9472}
9473
9474/* vec_vspltisb */
9475
9476// FIXME: parameter should be treated as 5-bit signed literal
9477static __inline__ vector signed char __ATTRS_o_ai
9478vec_vspltisb(signed char __a) {
9479 return (vector signed char)(__a);
9480}
9481
9482/* vec_splat_s16 */
9483
9484#define __builtin_altivec_vspltish vec_splat_s16
9485
9486// FIXME: parameter should be treated as 5-bit signed literal
9487static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
9488 return (vector short)(__a);
9489}
9490
9491/* vec_vspltish */
9492
9493// FIXME: parameter should be treated as 5-bit signed literal
9494static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
9495 return (vector short)(__a);
9496}
9497
9498/* vec_splat_s32 */
9499
9500#define __builtin_altivec_vspltisw vec_splat_s32
9501
9502// FIXME: parameter should be treated as 5-bit signed literal
9503static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
9504 return (vector int)(__a);
9505}
9506
9507/* vec_vspltisw */
9508
9509// FIXME: parameter should be treated as 5-bit signed literal
9510static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
9511 return (vector int)(__a);
9512}
9513
9514/* vec_splat_u8 */
9515
9516// FIXME: parameter should be treated as 5-bit signed literal
9517static __inline__ vector unsigned char __ATTRS_o_ai
9518vec_splat_u8(unsigned char __a) {
9519 return (vector unsigned char)(__a);
9520}
9521
9522/* vec_splat_u16 */
9523
9524// FIXME: parameter should be treated as 5-bit signed literal
9525static __inline__ vector unsigned short __ATTRS_o_ai
9526vec_splat_u16(signed char __a) {
9527 return (vector unsigned short)(__a);
9528}
9529
9530/* vec_splat_u32 */
9531
9532// FIXME: parameter should be treated as 5-bit signed literal
9533static __inline__ vector unsigned int __ATTRS_o_ai
9534vec_splat_u32(signed char __a) {
9535 return (vector unsigned int)(__a);
9536}
9537
9538/* vec_sr */
9539
9540// vec_sr does modulo arithmetic on __b first, so __b is allowed to be more
9541// than the length of __a.
9542static __inline__ vector unsigned char __ATTRS_o_ai
9543vec_sr(vector unsigned char __a, vector unsigned char __b) {
9544 return __a >>
9545 (__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));
9546}
9547
9548static __inline__ vector signed char __ATTRS_o_ai
9549vec_sr(vector signed char __a, vector unsigned char __b) {
9550 return (vector signed char)vec_sr((vector unsigned char)__a, __b);
9551}
9552
9553static __inline__ vector unsigned short __ATTRS_o_ai
9554vec_sr(vector unsigned short __a, vector unsigned short __b) {
9555 return __a >>
9556 (__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));
9557}
9558
9559static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,
9560 vector unsigned short __b) {
9561 return (vector short)vec_sr((vector unsigned short)__a, __b);
9562}
9563
9564static __inline__ vector unsigned int __ATTRS_o_ai
9565vec_sr(vector unsigned int __a, vector unsigned int __b) {
9566 return __a >>
9567 (__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));
9568}
9569
9570static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,
9571 vector unsigned int __b) {
9572 return (vector int)vec_sr((vector unsigned int)__a, __b);
9573}
9574
9575#ifdef __POWER8_VECTOR__
9576static __inline__ vector unsigned long long __ATTRS_o_ai
9577vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
9578 return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *
9579 __CHAR_BIT__));
9580}
9581
9582static __inline__ vector long long __ATTRS_o_ai
9583vec_sr(vector long long __a, vector unsigned long long __b) {
9584 return (vector long long)vec_sr((vector unsigned long long)__a, __b);
9585}
9586#endif
9587
9588/* vec_vsrb */
9589
9590#define __builtin_altivec_vsrb vec_vsrb
9591
9592static __inline__ vector signed char __ATTRS_o_ai
9593vec_vsrb(vector signed char __a, vector unsigned char __b) {
9594 return vec_sr(__a, __b);
9595}
9596
9597static __inline__ vector unsigned char __ATTRS_o_ai
9598vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
9599 return vec_sr(__a, __b);
9600}
9601
9602/* vec_vsrh */
9603
9604#define __builtin_altivec_vsrh vec_vsrh
9605
9606static __inline__ vector short __ATTRS_o_ai
9607vec_vsrh(vector short __a, vector unsigned short __b) {
9608 return vec_sr(__a, __b);
9609}
9610
9611static __inline__ vector unsigned short __ATTRS_o_ai
9612vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
9613 return vec_sr(__a, __b);
9614}
9615
9616/* vec_vsrw */
9617
9618#define __builtin_altivec_vsrw vec_vsrw
9619
9620static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
9621 vector unsigned int __b) {
9622 return vec_sr(__a, __b);
9623}
9624
9625static __inline__ vector unsigned int __ATTRS_o_ai
9626vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
9627 return vec_sr(__a, __b);
9628}
9629
9630/* vec_sra */
9631
9632static __inline__ vector signed char __ATTRS_o_ai
9633vec_sra(vector signed char __a, vector unsigned char __b) {
9634 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9635}
9636
9637static __inline__ vector unsigned char __ATTRS_o_ai
9638vec_sra(vector unsigned char __a, vector unsigned char __b) {
9639 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9640}
9641
9642static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
9643 vector unsigned short __b) {
9644 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9645}
9646
9647static __inline__ vector unsigned short __ATTRS_o_ai
9648vec_sra(vector unsigned short __a, vector unsigned short __b) {
9649 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9650}
9651
9652static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
9653 vector unsigned int __b) {
9654 return __builtin_altivec_vsraw(__a, __b);
9655}
9656
9657static __inline__ vector unsigned int __ATTRS_o_ai
9658vec_sra(vector unsigned int __a, vector unsigned int __b) {
9659 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9660}
9661
9662#ifdef __POWER8_VECTOR__
9663static __inline__ vector signed long long __ATTRS_o_ai
9664vec_sra(vector signed long long __a, vector unsigned long long __b) {
9665 return __a >> __b;
9666}
9667
9668static __inline__ vector unsigned long long __ATTRS_o_ai
9669vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
9670 return (vector unsigned long long)((vector signed long long)__a >> __b);
9671}
9672#endif
9673
9674/* vec_vsrab */
9675
9676static __inline__ vector signed char __ATTRS_o_ai
9677vec_vsrab(vector signed char __a, vector unsigned char __b) {
9678 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
9679}
9680
9681static __inline__ vector unsigned char __ATTRS_o_ai
9682vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
9683 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
9684}
9685
9686/* vec_vsrah */
9687
9688static __inline__ vector short __ATTRS_o_ai
9689vec_vsrah(vector short __a, vector unsigned short __b) {
9690 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
9691}
9692
9693static __inline__ vector unsigned short __ATTRS_o_ai
9694vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
9695 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
9696}
9697
9698/* vec_vsraw */
9699
9700static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
9701 vector unsigned int __b) {
9702 return __builtin_altivec_vsraw(__a, __b);
9703}
9704
9705static __inline__ vector unsigned int __ATTRS_o_ai
9706vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
9707 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
9708}
9709
9710/* vec_srl */
9711
9712static __inline__ vector signed char __ATTRS_o_ai
9713vec_srl(vector signed char __a, vector unsigned char __b) {
9714 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9715 (vector int)__b);
9716}
9717
9718static __inline__ vector signed char __ATTRS_o_ai
9719vec_srl(vector signed char __a, vector unsigned short __b) {
9720 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9721 (vector int)__b);
9722}
9723
9724static __inline__ vector signed char __ATTRS_o_ai
9725vec_srl(vector signed char __a, vector unsigned int __b) {
9726 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9727 (vector int)__b);
9728}
9729
9730static __inline__ vector unsigned char __ATTRS_o_ai
9731vec_srl(vector unsigned char __a, vector unsigned char __b) {
9732 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9733 (vector int)__b);
9734}
9735
9736static __inline__ vector unsigned char __ATTRS_o_ai
9737vec_srl(vector unsigned char __a, vector unsigned short __b) {
9738 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9739 (vector int)__b);
9740}
9741
9742static __inline__ vector unsigned char __ATTRS_o_ai
9743vec_srl(vector unsigned char __a, vector unsigned int __b) {
9744 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9745 (vector int)__b);
9746}
9747
9748static __inline__ vector bool char __ATTRS_o_ai
9749vec_srl(vector bool char __a, vector unsigned char __b) {
9750 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9751 (vector int)__b);
9752}
9753
9754static __inline__ vector bool char __ATTRS_o_ai
9755vec_srl(vector bool char __a, vector unsigned short __b) {
9756 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9757 (vector int)__b);
9758}
9759
9760static __inline__ vector bool char __ATTRS_o_ai
9761vec_srl(vector bool char __a, vector unsigned int __b) {
9762 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9763 (vector int)__b);
9764}
9765
9766static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9767 vector unsigned char __b) {
9768 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9769}
9770
9771static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9772 vector unsigned short __b) {
9773 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9774}
9775
9776static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
9777 vector unsigned int __b) {
9778 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9779}
9780
9781static __inline__ vector unsigned short __ATTRS_o_ai
9782vec_srl(vector unsigned short __a, vector unsigned char __b) {
9783 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9784 (vector int)__b);
9785}
9786
9787static __inline__ vector unsigned short __ATTRS_o_ai
9788vec_srl(vector unsigned short __a, vector unsigned short __b) {
9789 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9790 (vector int)__b);
9791}
9792
9793static __inline__ vector unsigned short __ATTRS_o_ai
9794vec_srl(vector unsigned short __a, vector unsigned int __b) {
9795 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9796 (vector int)__b);
9797}
9798
9799static __inline__ vector bool short __ATTRS_o_ai
9800vec_srl(vector bool short __a, vector unsigned char __b) {
9801 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9802 (vector int)__b);
9803}
9804
9805static __inline__ vector bool short __ATTRS_o_ai
9806vec_srl(vector bool short __a, vector unsigned short __b) {
9807 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9808 (vector int)__b);
9809}
9810
9811static __inline__ vector bool short __ATTRS_o_ai
9812vec_srl(vector bool short __a, vector unsigned int __b) {
9813 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9814 (vector int)__b);
9815}
9816
9817static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9818 vector unsigned char __b) {
9819 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9820}
9821
9822static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9823 vector unsigned short __b) {
9824 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9825}
9826
9827static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
9828 vector unsigned int __b) {
9829 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9830}
9831
9832static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9833 vector unsigned char __b) {
9834 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9835}
9836
9837static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9838 vector unsigned short __b) {
9839 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9840}
9841
9842static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
9843 vector unsigned int __b) {
9844 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
9845}
9846
9847static __inline__ vector unsigned int __ATTRS_o_ai
9848vec_srl(vector unsigned int __a, vector unsigned char __b) {
9849 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9850 (vector int)__b);
9851}
9852
9853static __inline__ vector unsigned int __ATTRS_o_ai
9854vec_srl(vector unsigned int __a, vector unsigned short __b) {
9855 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9856 (vector int)__b);
9857}
9858
9859static __inline__ vector unsigned int __ATTRS_o_ai
9860vec_srl(vector unsigned int __a, vector unsigned int __b) {
9861 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
9862 (vector int)__b);
9863}
9864
9865static __inline__ vector bool int __ATTRS_o_ai
9866vec_srl(vector bool int __a, vector unsigned char __b) {
9867 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9868 (vector int)__b);
9869}
9870
9871static __inline__ vector bool int __ATTRS_o_ai
9872vec_srl(vector bool int __a, vector unsigned short __b) {
9873 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9874 (vector int)__b);
9875}
9876
9877static __inline__ vector bool int __ATTRS_o_ai
9878vec_srl(vector bool int __a, vector unsigned int __b) {
9879 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
9880 (vector int)__b);
9881}
9882
9883#ifdef __VSX__
9884static __inline__ vector signed long long __ATTRS_o_ai
9885vec_srl(vector signed long long __a, vector unsigned char __b) {
9886 return (vector signed long long)__builtin_altivec_vsr((vector int)__a,
9887 (vector int)__b);
9888}
9889
9890static __inline__ vector unsigned long long __ATTRS_o_ai
9891vec_srl(vector unsigned long long __a, vector unsigned char __b) {
9892 return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,
9893 (vector int)__b);
9894}
9895#endif
9896
9897/* vec_vsr */
9898
9899static __inline__ vector signed char __ATTRS_o_ai
9900vec_vsr(vector signed char __a, vector unsigned char __b) {
9901 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9902 (vector int)__b);
9903}
9904
9905static __inline__ vector signed char __ATTRS_o_ai
9906vec_vsr(vector signed char __a, vector unsigned short __b) {
9907 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9908 (vector int)__b);
9909}
9910
9911static __inline__ vector signed char __ATTRS_o_ai
9912vec_vsr(vector signed char __a, vector unsigned int __b) {
9913 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
9914 (vector int)__b);
9915}
9916
9917static __inline__ vector unsigned char __ATTRS_o_ai
9918vec_vsr(vector unsigned char __a, vector unsigned char __b) {
9919 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9920 (vector int)__b);
9921}
9922
9923static __inline__ vector unsigned char __ATTRS_o_ai
9924vec_vsr(vector unsigned char __a, vector unsigned short __b) {
9925 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9926 (vector int)__b);
9927}
9928
9929static __inline__ vector unsigned char __ATTRS_o_ai
9930vec_vsr(vector unsigned char __a, vector unsigned int __b) {
9931 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
9932 (vector int)__b);
9933}
9934
9935static __inline__ vector bool char __ATTRS_o_ai
9936vec_vsr(vector bool char __a, vector unsigned char __b) {
9937 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9938 (vector int)__b);
9939}
9940
9941static __inline__ vector bool char __ATTRS_o_ai
9942vec_vsr(vector bool char __a, vector unsigned short __b) {
9943 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9944 (vector int)__b);
9945}
9946
9947static __inline__ vector bool char __ATTRS_o_ai
9948vec_vsr(vector bool char __a, vector unsigned int __b) {
9949 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
9950 (vector int)__b);
9951}
9952
9953static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9954 vector unsigned char __b) {
9955 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9956}
9957
9958static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9959 vector unsigned short __b) {
9960 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9961}
9962
9963static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
9964 vector unsigned int __b) {
9965 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
9966}
9967
9968static __inline__ vector unsigned short __ATTRS_o_ai
9969vec_vsr(vector unsigned short __a, vector unsigned char __b) {
9970 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9971 (vector int)__b);
9972}
9973
9974static __inline__ vector unsigned short __ATTRS_o_ai
9975vec_vsr(vector unsigned short __a, vector unsigned short __b) {
9976 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9977 (vector int)__b);
9978}
9979
9980static __inline__ vector unsigned short __ATTRS_o_ai
9981vec_vsr(vector unsigned short __a, vector unsigned int __b) {
9982 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
9983 (vector int)__b);
9984}
9985
9986static __inline__ vector bool short __ATTRS_o_ai
9987vec_vsr(vector bool short __a, vector unsigned char __b) {
9988 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9989 (vector int)__b);
9990}
9991
9992static __inline__ vector bool short __ATTRS_o_ai
9993vec_vsr(vector bool short __a, vector unsigned short __b) {
9994 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
9995 (vector int)__b);
9996}
9997
9998static __inline__ vector bool short __ATTRS_o_ai
9999vec_vsr(vector bool short __a, vector unsigned int __b) {
10000 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
10001 (vector int)__b);
10002}
10003
10004static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10005 vector unsigned char __b) {
10006 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10007}
10008
10009static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10010 vector unsigned short __b) {
10011 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10012}
10013
10014static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
10015 vector unsigned int __b) {
10016 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
10017}
10018
10019static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10020 vector unsigned char __b) {
10021 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10022}
10023
10024static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10025 vector unsigned short __b) {
10026 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10027}
10028
10029static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
10030 vector unsigned int __b) {
10031 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
10032}
10033
10034static __inline__ vector unsigned int __ATTRS_o_ai
10035vec_vsr(vector unsigned int __a, vector unsigned char __b) {
10036 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10037 (vector int)__b);
10038}
10039
10040static __inline__ vector unsigned int __ATTRS_o_ai
10041vec_vsr(vector unsigned int __a, vector unsigned short __b) {
10042 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10043 (vector int)__b);
10044}
10045
10046static __inline__ vector unsigned int __ATTRS_o_ai
10047vec_vsr(vector unsigned int __a, vector unsigned int __b) {
10048 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
10049 (vector int)__b);
10050}
10051
10052static __inline__ vector bool int __ATTRS_o_ai
10053vec_vsr(vector bool int __a, vector unsigned char __b) {
10054 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10055 (vector int)__b);
10056}
10057
10058static __inline__ vector bool int __ATTRS_o_ai
10059vec_vsr(vector bool int __a, vector unsigned short __b) {
10060 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10061 (vector int)__b);
10062}
10063
10064static __inline__ vector bool int __ATTRS_o_ai
10065vec_vsr(vector bool int __a, vector unsigned int __b) {
10066 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
10067 (vector int)__b);
10068}
10069
10070/* vec_sro */
10071
10072static __inline__ vector signed char __ATTRS_o_ai
10073vec_sro(vector signed char __a, vector signed char __b) {
10074 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10075 (vector int)__b);
10076}
10077
10078static __inline__ vector signed char __ATTRS_o_ai
10079vec_sro(vector signed char __a, vector unsigned char __b) {
10080 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10081 (vector int)__b);
10082}
10083
10084static __inline__ vector unsigned char __ATTRS_o_ai
10085vec_sro(vector unsigned char __a, vector signed char __b) {
10086 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10087 (vector int)__b);
10088}
10089
10090static __inline__ vector unsigned char __ATTRS_o_ai
10091vec_sro(vector unsigned char __a, vector unsigned char __b) {
10092 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10093 (vector int)__b);
10094}
10095
10096static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10097 vector signed char __b) {
10098 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10099}
10100
10101static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
10102 vector unsigned char __b) {
10103 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10104}
10105
10106static __inline__ vector unsigned short __ATTRS_o_ai
10107vec_sro(vector unsigned short __a, vector signed char __b) {
10108 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10109 (vector int)__b);
10110}
10111
10112static __inline__ vector unsigned short __ATTRS_o_ai
10113vec_sro(vector unsigned short __a, vector unsigned char __b) {
10114 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10115 (vector int)__b);
10116}
10117
10118static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10119 vector signed char __b) {
10120 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10121}
10122
10123static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
10124 vector unsigned char __b) {
10125 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10126}
10127
10128static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10129 vector signed char __b) {
10130 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10131}
10132
10133static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
10134 vector unsigned char __b) {
10135 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10136}
10137
10138static __inline__ vector unsigned int __ATTRS_o_ai
10139vec_sro(vector unsigned int __a, vector signed char __b) {
10140 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10141 (vector int)__b);
10142}
10143
10144static __inline__ vector unsigned int __ATTRS_o_ai
10145vec_sro(vector unsigned int __a, vector unsigned char __b) {
10146 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10147 (vector int)__b);
10148}
10149
10150static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10151 vector signed char __b) {
10152 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10153}
10154
10155static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
10156 vector unsigned char __b) {
10157 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10158}
10159
10160#ifdef __VSX__
10161static __inline__ vector signed long long __ATTRS_o_ai
10162vec_sro(vector signed long long __a, vector signed char __b) {
10163 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10164 (vector int)__b);
10165}
10166
10167static __inline__ vector signed long long __ATTRS_o_ai
10168vec_sro(vector signed long long __a, vector unsigned char __b) {
10169 return (vector signed long long)__builtin_altivec_vsro((vector int)__a,
10170 (vector int)__b);
10171}
10172
10173static __inline__ vector unsigned long long __ATTRS_o_ai
10174vec_sro(vector unsigned long long __a, vector signed char __b) {
10175 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10176 (vector int)__b);
10177}
10178
10179static __inline__ vector unsigned long long __ATTRS_o_ai
10180vec_sro(vector unsigned long long __a, vector unsigned char __b) {
10181 return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,
10182 (vector int)__b);
10183}
10184#endif
10185
10186/* vec_vsro */
10187
10188static __inline__ vector signed char __ATTRS_o_ai
10189vec_vsro(vector signed char __a, vector signed char __b) {
10190 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10191 (vector int)__b);
10192}
10193
10194static __inline__ vector signed char __ATTRS_o_ai
10195vec_vsro(vector signed char __a, vector unsigned char __b) {
10196 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
10197 (vector int)__b);
10198}
10199
10200static __inline__ vector unsigned char __ATTRS_o_ai
10201vec_vsro(vector unsigned char __a, vector signed char __b) {
10202 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10203 (vector int)__b);
10204}
10205
10206static __inline__ vector unsigned char __ATTRS_o_ai
10207vec_vsro(vector unsigned char __a, vector unsigned char __b) {
10208 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
10209 (vector int)__b);
10210}
10211
10212static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10213 vector signed char __b) {
10214 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10215}
10216
10217static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
10218 vector unsigned char __b) {
10219 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10220}
10221
10222static __inline__ vector unsigned short __ATTRS_o_ai
10223vec_vsro(vector unsigned short __a, vector signed char __b) {
10224 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10225 (vector int)__b);
10226}
10227
10228static __inline__ vector unsigned short __ATTRS_o_ai
10229vec_vsro(vector unsigned short __a, vector unsigned char __b) {
10230 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
10231 (vector int)__b);
10232}
10233
10234static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10235 vector signed char __b) {
10236 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10237}
10238
10239static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
10240 vector unsigned char __b) {
10241 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10242}
10243
10244static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10245 vector signed char __b) {
10246 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10247}
10248
10249static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
10250 vector unsigned char __b) {
10251 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
10252}
10253
10254static __inline__ vector unsigned int __ATTRS_o_ai
10255vec_vsro(vector unsigned int __a, vector signed char __b) {
10256 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10257 (vector int)__b);
10258}
10259
10260static __inline__ vector unsigned int __ATTRS_o_ai
10261vec_vsro(vector unsigned int __a, vector unsigned char __b) {
10262 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
10263 (vector int)__b);
10264}
10265
10266static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10267 vector signed char __b) {
10268 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10269}
10270
10271static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
10272 vector unsigned char __b) {
10273 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
10274}
10275
10276/* vec_st */
10277
10278static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10279 vector signed char *__c) {
10280 __builtin_altivec_stvx((vector int)__a, __b, __c);
10281}
10282
10283static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
10284 signed char *__c) {
10285 __builtin_altivec_stvx((vector int)__a, __b, __c);
10286}
10287
10288static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10289 vector unsigned char *__c) {
10290 __builtin_altivec_stvx((vector int)__a, __b, __c);
10291}
10292
10293static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
10294 unsigned char *__c) {
10295 __builtin_altivec_stvx((vector int)__a, __b, __c);
10296}
10297
10298static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10299 signed char *__c) {
10300 __builtin_altivec_stvx((vector int)__a, __b, __c);
10301}
10302
10303static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10304 unsigned char *__c) {
10305 __builtin_altivec_stvx((vector int)__a, __b, __c);
10306}
10307
10308static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
10309 vector bool char *__c) {
10310 __builtin_altivec_stvx((vector int)__a, __b, __c);
10311}
10312
10313static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10314 vector short *__c) {
10315 __builtin_altivec_stvx((vector int)__a, __b, __c);
10316}
10317
10318static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
10319 short *__c) {
10320 __builtin_altivec_stvx((vector int)__a, __b, __c);
10321}
10322
10323static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10324 vector unsigned short *__c) {
10325 __builtin_altivec_stvx((vector int)__a, __b, __c);
10326}
10327
10328static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
10329 unsigned short *__c) {
10330 __builtin_altivec_stvx((vector int)__a, __b, __c);
10331}
10332
10333static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10334 short *__c) {
10335 __builtin_altivec_stvx((vector int)__a, __b, __c);
10336}
10337
10338static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10339 unsigned short *__c) {
10340 __builtin_altivec_stvx((vector int)__a, __b, __c);
10341}
10342
10343static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
10344 vector bool short *__c) {
10345 __builtin_altivec_stvx((vector int)__a, __b, __c);
10346}
10347
10348static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10349 short *__c) {
10350 __builtin_altivec_stvx((vector int)__a, __b, __c);
10351}
10352
10353static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10354 unsigned short *__c) {
10355 __builtin_altivec_stvx((vector int)__a, __b, __c);
10356}
10357
10358static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
10359 vector pixel *__c) {
10360 __builtin_altivec_stvx((vector int)__a, __b, __c);
10361}
10362
10363static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
10364 vector int *__c) {
10365 __builtin_altivec_stvx(__a, __b, __c);
10366}
10367
10368static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
10369 __builtin_altivec_stvx(__a, __b, __c);
10370}
10371
10372static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10373 vector unsigned int *__c) {
10374 __builtin_altivec_stvx((vector int)__a, __b, __c);
10375}
10376
10377static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
10378 unsigned int *__c) {
10379 __builtin_altivec_stvx((vector int)__a, __b, __c);
10380}
10381
10382static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10383 int *__c) {
10384 __builtin_altivec_stvx((vector int)__a, __b, __c);
10385}
10386
10387static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10388 unsigned int *__c) {
10389 __builtin_altivec_stvx((vector int)__a, __b, __c);
10390}
10391
10392static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
10393 vector bool int *__c) {
10394 __builtin_altivec_stvx((vector int)__a, __b, __c);
10395}
10396
10397static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10398 vector float *__c) {
10399 __builtin_altivec_stvx((vector int)__a, __b, __c);
10400}
10401
10402static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
10403 float *__c) {
10404 __builtin_altivec_stvx((vector int)__a, __b, __c);
10405}
10406
10407/* vec_stvx */
10408
10409static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10410 vector signed char *__c) {
10411 __builtin_altivec_stvx((vector int)__a, __b, __c);
10412}
10413
10414static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
10415 signed char *__c) {
10416 __builtin_altivec_stvx((vector int)__a, __b, __c);
10417}
10418
10419static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10420 vector unsigned char *__c) {
10421 __builtin_altivec_stvx((vector int)__a, __b, __c);
10422}
10423
10424static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
10425 unsigned char *__c) {
10426 __builtin_altivec_stvx((vector int)__a, __b, __c);
10427}
10428
10429static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10430 signed char *__c) {
10431 __builtin_altivec_stvx((vector int)__a, __b, __c);
10432}
10433
10434static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10435 unsigned char *__c) {
10436 __builtin_altivec_stvx((vector int)__a, __b, __c);
10437}
10438
10439static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
10440 vector bool char *__c) {
10441 __builtin_altivec_stvx((vector int)__a, __b, __c);
10442}
10443
10444static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10445 vector short *__c) {
10446 __builtin_altivec_stvx((vector int)__a, __b, __c);
10447}
10448
10449static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
10450 short *__c) {
10451 __builtin_altivec_stvx((vector int)__a, __b, __c);
10452}
10453
10454static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10455 vector unsigned short *__c) {
10456 __builtin_altivec_stvx((vector int)__a, __b, __c);
10457}
10458
10459static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
10460 unsigned short *__c) {
10461 __builtin_altivec_stvx((vector int)__a, __b, __c);
10462}
10463
10464static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10465 short *__c) {
10466 __builtin_altivec_stvx((vector int)__a, __b, __c);
10467}
10468
10469static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10470 unsigned short *__c) {
10471 __builtin_altivec_stvx((vector int)__a, __b, __c);
10472}
10473
10474static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
10475 vector bool short *__c) {
10476 __builtin_altivec_stvx((vector int)__a, __b, __c);
10477}
10478
10479static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10480 short *__c) {
10481 __builtin_altivec_stvx((vector int)__a, __b, __c);
10482}
10483
10484static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10485 unsigned short *__c) {
10486 __builtin_altivec_stvx((vector int)__a, __b, __c);
10487}
10488
10489static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
10490 vector pixel *__c) {
10491 __builtin_altivec_stvx((vector int)__a, __b, __c);
10492}
10493
10494static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10495 vector int *__c) {
10496 __builtin_altivec_stvx(__a, __b, __c);
10497}
10498
10499static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
10500 int *__c) {
10501 __builtin_altivec_stvx(__a, __b, __c);
10502}
10503
10504static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10505 vector unsigned int *__c) {
10506 __builtin_altivec_stvx((vector int)__a, __b, __c);
10507}
10508
10509static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
10510 unsigned int *__c) {
10511 __builtin_altivec_stvx((vector int)__a, __b, __c);
10512}
10513
10514static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10515 int *__c) {
10516 __builtin_altivec_stvx((vector int)__a, __b, __c);
10517}
10518
10519static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10520 unsigned int *__c) {
10521 __builtin_altivec_stvx((vector int)__a, __b, __c);
10522}
10523
10524static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
10525 vector bool int *__c) {
10526 __builtin_altivec_stvx((vector int)__a, __b, __c);
10527}
10528
10529static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10530 vector float *__c) {
10531 __builtin_altivec_stvx((vector int)__a, __b, __c);
10532}
10533
10534static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
10535 float *__c) {
10536 __builtin_altivec_stvx((vector int)__a, __b, __c);
10537}
10538
10539/* vec_ste */
10540
10541static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
10542 signed char *__c) {
10543 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10544}
10545
10546static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
10547 unsigned char *__c) {
10548 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10549}
10550
10551static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10552 signed char *__c) {
10553 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10554}
10555
10556static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
10557 unsigned char *__c) {
10558 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10559}
10560
10561static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
10562 short *__c) {
10563 __builtin_altivec_stvehx(__a, __b, __c);
10564}
10565
10566static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
10567 unsigned short *__c) {
10568 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10569}
10570
10571static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10572 short *__c) {
10573 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10574}
10575
10576static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
10577 unsigned short *__c) {
10578 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10579}
10580
10581static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10582 short *__c) {
10583 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10584}
10585
10586static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
10587 unsigned short *__c) {
10588 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10589}
10590
10591static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
10592 __builtin_altivec_stvewx(__a, __b, __c);
10593}
10594
10595static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
10596 unsigned int *__c) {
10597 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10598}
10599
10600static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10601 int *__c) {
10602 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10603}
10604
10605static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
10606 unsigned int *__c) {
10607 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10608}
10609
10610static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
10611 float *__c) {
10612 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10613}
10614
10615/* vec_stvebx */
10616
10617static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
10618 signed char *__c) {
10619 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10620}
10621
10622static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
10623 int __b, unsigned char *__c) {
10624 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10625}
10626
10627static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10628 signed char *__c) {
10629 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10630}
10631
10632static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
10633 unsigned char *__c) {
10634 __builtin_altivec_stvebx((vector char)__a, __b, __c);
10635}
10636
10637/* vec_stvehx */
10638
10639static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
10640 short *__c) {
10641 __builtin_altivec_stvehx(__a, __b, __c);
10642}
10643
10644static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
10645 int __b, unsigned short *__c) {
10646 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10647}
10648
10649static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10650 short *__c) {
10651 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10652}
10653
10654static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
10655 unsigned short *__c) {
10656 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10657}
10658
10659static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10660 short *__c) {
10661 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10662}
10663
10664static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
10665 unsigned short *__c) {
10666 __builtin_altivec_stvehx((vector short)__a, __b, __c);
10667}
10668
10669/* vec_stvewx */
10670
10671static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
10672 int *__c) {
10673 __builtin_altivec_stvewx(__a, __b, __c);
10674}
10675
10676static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
10677 unsigned int *__c) {
10678 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10679}
10680
10681static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10682 int *__c) {
10683 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10684}
10685
10686static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
10687 unsigned int *__c) {
10688 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10689}
10690
10691static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
10692 float *__c) {
10693 __builtin_altivec_stvewx((vector int)__a, __b, __c);
10694}
10695
10696/* vec_stl */
10697
10698static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10699 vector signed char *__c) {
10700 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10701}
10702
10703static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
10704 signed char *__c) {
10705 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10706}
10707
10708static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10709 vector unsigned char *__c) {
10710 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10711}
10712
10713static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
10714 unsigned char *__c) {
10715 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10716}
10717
10718static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10719 signed char *__c) {
10720 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10721}
10722
10723static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10724 unsigned char *__c) {
10725 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10726}
10727
10728static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
10729 vector bool char *__c) {
10730 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10731}
10732
10733static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10734 vector short *__c) {
10735 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10736}
10737
10738static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
10739 short *__c) {
10740 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10741}
10742
10743static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10744 vector unsigned short *__c) {
10745 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10746}
10747
10748static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
10749 unsigned short *__c) {
10750 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10751}
10752
10753static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10754 short *__c) {
10755 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10756}
10757
10758static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10759 unsigned short *__c) {
10760 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10761}
10762
10763static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
10764 vector bool short *__c) {
10765 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10766}
10767
10768static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10769 short *__c) {
10770 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10771}
10772
10773static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10774 unsigned short *__c) {
10775 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10776}
10777
10778static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
10779 vector pixel *__c) {
10780 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10781}
10782
10783static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
10784 vector int *__c) {
10785 __builtin_altivec_stvxl(__a, __b, __c);
10786}
10787
10788static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
10789 __builtin_altivec_stvxl(__a, __b, __c);
10790}
10791
10792static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10793 vector unsigned int *__c) {
10794 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10795}
10796
10797static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
10798 unsigned int *__c) {
10799 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10800}
10801
10802static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10803 int *__c) {
10804 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10805}
10806
10807static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10808 unsigned int *__c) {
10809 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10810}
10811
10812static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
10813 vector bool int *__c) {
10814 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10815}
10816
10817static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10818 vector float *__c) {
10819 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10820}
10821
10822static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
10823 float *__c) {
10824 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10825}
10826
10827/* vec_stvxl */
10828
10829static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10830 vector signed char *__c) {
10831 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10832}
10833
10834static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
10835 signed char *__c) {
10836 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10837}
10838
10839static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10840 vector unsigned char *__c) {
10841 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10842}
10843
10844static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
10845 unsigned char *__c) {
10846 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10847}
10848
10849static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10850 signed char *__c) {
10851 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10852}
10853
10854static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10855 unsigned char *__c) {
10856 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10857}
10858
10859static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
10860 vector bool char *__c) {
10861 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10862}
10863
10864static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10865 vector short *__c) {
10866 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10867}
10868
10869static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
10870 short *__c) {
10871 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10872}
10873
10874static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10875 int __b,
10876 vector unsigned short *__c) {
10877 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10878}
10879
10880static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
10881 int __b, unsigned short *__c) {
10882 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10883}
10884
10885static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10886 short *__c) {
10887 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10888}
10889
10890static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10891 unsigned short *__c) {
10892 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10893}
10894
10895static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
10896 vector bool short *__c) {
10897 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10898}
10899
10900static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10901 short *__c) {
10902 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10903}
10904
10905static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10906 unsigned short *__c) {
10907 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10908}
10909
10910static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
10911 vector pixel *__c) {
10912 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10913}
10914
10915static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10916 vector int *__c) {
10917 __builtin_altivec_stvxl(__a, __b, __c);
10918}
10919
10920static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
10921 int *__c) {
10922 __builtin_altivec_stvxl(__a, __b, __c);
10923}
10924
10925static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10926 vector unsigned int *__c) {
10927 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10928}
10929
10930static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
10931 unsigned int *__c) {
10932 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10933}
10934
10935static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10936 int *__c) {
10937 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10938}
10939
10940static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10941 unsigned int *__c) {
10942 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10943}
10944
10945static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
10946 vector bool int *__c) {
10947 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10948}
10949
10950static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10951 vector float *__c) {
10952 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10953}
10954
10955static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
10956 float *__c) {
10957 __builtin_altivec_stvxl((vector int)__a, __b, __c);
10958}
10959
10960/* vec_sub */
10961
10962static __inline__ vector signed char __ATTRS_o_ai
10963vec_sub(vector signed char __a, vector signed char __b) {
10964 return __a - __b;
10965}
10966
10967static __inline__ vector signed char __ATTRS_o_ai
10968vec_sub(vector bool char __a, vector signed char __b) {
10969 return (vector signed char)__a - __b;
10970}
10971
10972static __inline__ vector signed char __ATTRS_o_ai
10973vec_sub(vector signed char __a, vector bool char __b) {
10974 return __a - (vector signed char)__b;
10975}
10976
10977static __inline__ vector unsigned char __ATTRS_o_ai
10978vec_sub(vector unsigned char __a, vector unsigned char __b) {
10979 return __a - __b;
10980}
10981
10982static __inline__ vector unsigned char __ATTRS_o_ai
10983vec_sub(vector bool char __a, vector unsigned char __b) {
10984 return (vector unsigned char)__a - __b;
10985}
10986
10987static __inline__ vector unsigned char __ATTRS_o_ai
10988vec_sub(vector unsigned char __a, vector bool char __b) {
10989 return __a - (vector unsigned char)__b;
10990}
10991
10992static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
10993 vector short __b) {
10994 return __a - __b;
10995}
10996
10997static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
10998 vector short __b) {
10999 return (vector short)__a - __b;
11000}
11001
11002static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
11003 vector bool short __b) {
11004 return __a - (vector short)__b;
11005}
11006
11007static __inline__ vector unsigned short __ATTRS_o_ai
11008vec_sub(vector unsigned short __a, vector unsigned short __b) {
11009 return __a - __b;
11010}
11011
11012static __inline__ vector unsigned short __ATTRS_o_ai
11013vec_sub(vector bool short __a, vector unsigned short __b) {
11014 return (vector unsigned short)__a - __b;
11015}
11016
11017static __inline__ vector unsigned short __ATTRS_o_ai
11018vec_sub(vector unsigned short __a, vector bool short __b) {
11019 return __a - (vector unsigned short)__b;
11020}
11021
11022static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11023 vector int __b) {
11024 return __a - __b;
11025}
11026
11027static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
11028 vector int __b) {
11029 return (vector int)__a - __b;
11030}
11031
11032static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
11033 vector bool int __b) {
11034 return __a - (vector int)__b;
11035}
11036
11037static __inline__ vector unsigned int __ATTRS_o_ai
11038vec_sub(vector unsigned int __a, vector unsigned int __b) {
11039 return __a - __b;
11040}
11041
11042static __inline__ vector unsigned int __ATTRS_o_ai
11043vec_sub(vector bool int __a, vector unsigned int __b) {
11044 return (vector unsigned int)__a - __b;
11045}
11046
11047static __inline__ vector unsigned int __ATTRS_o_ai
11048vec_sub(vector unsigned int __a, vector bool int __b) {
11049 return __a - (vector unsigned int)__b;
11050}
11051
11052#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11053static __inline__ vector signed __int128 __ATTRS_o_ai
11054vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
11055 return __a - __b;
11056}
11057
11058static __inline__ vector unsigned __int128 __ATTRS_o_ai
11059vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11060 return __a - __b;
11061}
11062#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11063
11064#ifdef __VSX__
11065static __inline__ vector signed long long __ATTRS_o_ai
11066vec_sub(vector signed long long __a, vector signed long long __b) {
11067 return __a - __b;
11068}
11069
11070static __inline__ vector unsigned long long __ATTRS_o_ai
11071vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
11072 return __a - __b;
11073}
11074
11075static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
11076 vector double __b) {
11077 return __a - __b;
11078}
11079#endif
11080
11081static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
11082 vector float __b) {
11083 return __a - __b;
11084}
11085
11086/* vec_vsububm */
11087
11088#define __builtin_altivec_vsububm vec_vsububm
11089
11090static __inline__ vector signed char __ATTRS_o_ai
11091vec_vsububm(vector signed char __a, vector signed char __b) {
11092 return __a - __b;
11093}
11094
11095static __inline__ vector signed char __ATTRS_o_ai
11096vec_vsububm(vector bool char __a, vector signed char __b) {
11097 return (vector signed char)__a - __b;
11098}
11099
11100static __inline__ vector signed char __ATTRS_o_ai
11101vec_vsububm(vector signed char __a, vector bool char __b) {
11102 return __a - (vector signed char)__b;
11103}
11104
11105static __inline__ vector unsigned char __ATTRS_o_ai
11106vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
11107 return __a - __b;
11108}
11109
11110static __inline__ vector unsigned char __ATTRS_o_ai
11111vec_vsububm(vector bool char __a, vector unsigned char __b) {
11112 return (vector unsigned char)__a - __b;
11113}
11114
11115static __inline__ vector unsigned char __ATTRS_o_ai
11116vec_vsububm(vector unsigned char __a, vector bool char __b) {
11117 return __a - (vector unsigned char)__b;
11118}
11119
11120/* vec_vsubuhm */
11121
11122#define __builtin_altivec_vsubuhm vec_vsubuhm
11123
11124static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11125 vector short __b) {
11126 return __a - __b;
11127}
11128
11129static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
11130 vector short __b) {
11131 return (vector short)__a - __b;
11132}
11133
11134static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
11135 vector bool short __b) {
11136 return __a - (vector short)__b;
11137}
11138
11139static __inline__ vector unsigned short __ATTRS_o_ai
11140vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
11141 return __a - __b;
11142}
11143
11144static __inline__ vector unsigned short __ATTRS_o_ai
11145vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
11146 return (vector unsigned short)__a - __b;
11147}
11148
11149static __inline__ vector unsigned short __ATTRS_o_ai
11150vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
11151 return __a - (vector unsigned short)__b;
11152}
11153
11154/* vec_vsubuwm */
11155
11156#define __builtin_altivec_vsubuwm vec_vsubuwm
11157
11158static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11159 vector int __b) {
11160 return __a - __b;
11161}
11162
11163static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
11164 vector int __b) {
11165 return (vector int)__a - __b;
11166}
11167
11168static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
11169 vector bool int __b) {
11170 return __a - (vector int)__b;
11171}
11172
11173static __inline__ vector unsigned int __ATTRS_o_ai
11174vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
11175 return __a - __b;
11176}
11177
11178static __inline__ vector unsigned int __ATTRS_o_ai
11179vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
11180 return (vector unsigned int)__a - __b;
11181}
11182
11183static __inline__ vector unsigned int __ATTRS_o_ai
11184vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
11185 return __a - (vector unsigned int)__b;
11186}
11187
11188/* vec_vsubfp */
11189
11190#define __builtin_altivec_vsubfp vec_vsubfp
11191
11192static __inline__ vector float __attribute__((__always_inline__))
11193vec_vsubfp(vector float __a, vector float __b) {
11194 return __a - __b;
11195}
11196
11197/* vec_subc */
11198
11199static __inline__ vector signed int __ATTRS_o_ai
11200vec_subc(vector signed int __a, vector signed int __b) {
11201 return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,
11202 (vector unsigned int) __b);
11203}
11204
11205static __inline__ vector unsigned int __ATTRS_o_ai
11206vec_subc(vector unsigned int __a, vector unsigned int __b) {
11207 return __builtin_altivec_vsubcuw(__a, __b);
11208}
11209
11210#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11211static __inline__ vector unsigned __int128 __ATTRS_o_ai
11212vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11213 return __builtin_altivec_vsubcuq(__a, __b);
11214}
11215
11216static __inline__ vector signed __int128 __ATTRS_o_ai
11217vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
11218 return __builtin_altivec_vsubcuq(__a, __b);
11219}
11220#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11221
11222/* vec_vsubcuw */
11223
11224static __inline__ vector unsigned int __attribute__((__always_inline__))
11225vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
11226 return __builtin_altivec_vsubcuw(__a, __b);
11227}
11228
11229/* vec_subs */
11230
11231static __inline__ vector signed char __ATTRS_o_ai
11232vec_subs(vector signed char __a, vector signed char __b) {
11233 return __builtin_altivec_vsubsbs(__a, __b);
11234}
11235
11236static __inline__ vector signed char __ATTRS_o_ai
11237vec_subs(vector bool char __a, vector signed char __b) {
11238 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11239}
11240
11241static __inline__ vector signed char __ATTRS_o_ai
11242vec_subs(vector signed char __a, vector bool char __b) {
11243 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11244}
11245
11246static __inline__ vector unsigned char __ATTRS_o_ai
11247vec_subs(vector unsigned char __a, vector unsigned char __b) {
11248 return __builtin_altivec_vsububs(__a, __b);
11249}
11250
11251static __inline__ vector unsigned char __ATTRS_o_ai
11252vec_subs(vector bool char __a, vector unsigned char __b) {
11253 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11254}
11255
11256static __inline__ vector unsigned char __ATTRS_o_ai
11257vec_subs(vector unsigned char __a, vector bool char __b) {
11258 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11259}
11260
11261static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11262 vector short __b) {
11263 return __builtin_altivec_vsubshs(__a, __b);
11264}
11265
11266static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
11267 vector short __b) {
11268 return __builtin_altivec_vsubshs((vector short)__a, __b);
11269}
11270
11271static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
11272 vector bool short __b) {
11273 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11274}
11275
11276static __inline__ vector unsigned short __ATTRS_o_ai
11277vec_subs(vector unsigned short __a, vector unsigned short __b) {
11278 return __builtin_altivec_vsubuhs(__a, __b);
11279}
11280
11281static __inline__ vector unsigned short __ATTRS_o_ai
11282vec_subs(vector bool short __a, vector unsigned short __b) {
11283 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11284}
11285
11286static __inline__ vector unsigned short __ATTRS_o_ai
11287vec_subs(vector unsigned short __a, vector bool short __b) {
11288 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11289}
11290
11291static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11292 vector int __b) {
11293 return __builtin_altivec_vsubsws(__a, __b);
11294}
11295
11296static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
11297 vector int __b) {
11298 return __builtin_altivec_vsubsws((vector int)__a, __b);
11299}
11300
11301static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
11302 vector bool int __b) {
11303 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11304}
11305
11306static __inline__ vector unsigned int __ATTRS_o_ai
11307vec_subs(vector unsigned int __a, vector unsigned int __b) {
11308 return __builtin_altivec_vsubuws(__a, __b);
11309}
11310
11311static __inline__ vector unsigned int __ATTRS_o_ai
11312vec_subs(vector bool int __a, vector unsigned int __b) {
11313 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11314}
11315
11316static __inline__ vector unsigned int __ATTRS_o_ai
11317vec_subs(vector unsigned int __a, vector bool int __b) {
11318 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11319}
11320
11321/* vec_vsubsbs */
11322
11323static __inline__ vector signed char __ATTRS_o_ai
11324vec_vsubsbs(vector signed char __a, vector signed char __b) {
11325 return __builtin_altivec_vsubsbs(__a, __b);
11326}
11327
11328static __inline__ vector signed char __ATTRS_o_ai
11329vec_vsubsbs(vector bool char __a, vector signed char __b) {
11330 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
11331}
11332
11333static __inline__ vector signed char __ATTRS_o_ai
11334vec_vsubsbs(vector signed char __a, vector bool char __b) {
11335 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
11336}
11337
11338/* vec_vsububs */
11339
11340static __inline__ vector unsigned char __ATTRS_o_ai
11341vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
11342 return __builtin_altivec_vsububs(__a, __b);
11343}
11344
11345static __inline__ vector unsigned char __ATTRS_o_ai
11346vec_vsububs(vector bool char __a, vector unsigned char __b) {
11347 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
11348}
11349
11350static __inline__ vector unsigned char __ATTRS_o_ai
11351vec_vsububs(vector unsigned char __a, vector bool char __b) {
11352 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
11353}
11354
11355/* vec_vsubshs */
11356
11357static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11358 vector short __b) {
11359 return __builtin_altivec_vsubshs(__a, __b);
11360}
11361
11362static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
11363 vector short __b) {
11364 return __builtin_altivec_vsubshs((vector short)__a, __b);
11365}
11366
11367static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
11368 vector bool short __b) {
11369 return __builtin_altivec_vsubshs(__a, (vector short)__b);
11370}
11371
11372/* vec_vsubuhs */
11373
11374static __inline__ vector unsigned short __ATTRS_o_ai
11375vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
11376 return __builtin_altivec_vsubuhs(__a, __b);
11377}
11378
11379static __inline__ vector unsigned short __ATTRS_o_ai
11380vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
11381 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
11382}
11383
11384static __inline__ vector unsigned short __ATTRS_o_ai
11385vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
11386 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
11387}
11388
11389/* vec_vsubsws */
11390
11391static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11392 vector int __b) {
11393 return __builtin_altivec_vsubsws(__a, __b);
11394}
11395
11396static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
11397 vector int __b) {
11398 return __builtin_altivec_vsubsws((vector int)__a, __b);
11399}
11400
11401static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
11402 vector bool int __b) {
11403 return __builtin_altivec_vsubsws(__a, (vector int)__b);
11404}
11405
11406/* vec_vsubuws */
11407
11408static __inline__ vector unsigned int __ATTRS_o_ai
11409vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
11410 return __builtin_altivec_vsubuws(__a, __b);
11411}
11412
11413static __inline__ vector unsigned int __ATTRS_o_ai
11414vec_vsubuws(vector bool int __a, vector unsigned int __b) {
11415 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
11416}
11417
11418static __inline__ vector unsigned int __ATTRS_o_ai
11419vec_vsubuws(vector unsigned int __a, vector bool int __b) {
11420 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
11421}
11422
11423#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11424/* vec_vsubuqm */
11425
11426static __inline__ vector signed __int128 __ATTRS_o_ai
11427vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
11428 return __a - __b;
11429}
11430
11431static __inline__ vector unsigned __int128 __ATTRS_o_ai
11432vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11433 return __a - __b;
11434}
11435
11436/* vec_vsubeuqm */
11437
11438
11439static __inline__ vector signed __int128 __ATTRS_o_ai
11440vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
11441 vector signed __int128 __c) {
11442 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11443}
11444
11445static __inline__ vector unsigned __int128 __ATTRS_o_ai
11446vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
11447 vector unsigned __int128 __c) {
11448 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11449}
11450
11451static __inline__ vector signed __int128 __ATTRS_o_ai
11452vec_sube(vector signed __int128 __a, vector signed __int128 __b,
11453 vector signed __int128 __c) {
11454 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11455}
11456
11457static __inline__ vector unsigned __int128 __ATTRS_o_ai
11458vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,
11459 vector unsigned __int128 __c) {
11460 return __builtin_altivec_vsubeuqm(__a, __b, __c);
11461}
11462
11463/* vec_vsubcuq */
11464
11465static __inline__ vector signed __int128 __ATTRS_o_ai
11466vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
11467 return __builtin_altivec_vsubcuq(__a, __b);
11468}
11469
11470static __inline__ vector unsigned __int128 __ATTRS_o_ai
11471vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
11472 return __builtin_altivec_vsubcuq(__a, __b);
11473}
11474
11475/* vec_vsubecuq */
11476
11477static __inline__ vector signed __int128 __ATTRS_o_ai
11478vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
11479 vector signed __int128 __c) {
11480 return __builtin_altivec_vsubecuq(__a, __b, __c);
11481}
11482
11483static __inline__ vector unsigned __int128 __ATTRS_o_ai
11484vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
11485 vector unsigned __int128 __c) {
11486 return __builtin_altivec_vsubecuq(__a, __b, __c);
11487}
11488
11489static __inline__ vector signed int __ATTRS_o_ai
11490vec_subec(vector signed int __a, vector signed int __b,
11491 vector signed int __c) {
11492 return vec_addec(__a, ~__b, __c);
11493}
11494
11495static __inline__ vector unsigned int __ATTRS_o_ai
11496vec_subec(vector unsigned int __a, vector unsigned int __b,
11497 vector unsigned int __c) {
11498 return vec_addec(__a, ~__b, __c);
11499}
11500
11501static __inline__ vector signed __int128 __ATTRS_o_ai
11502vec_subec(vector signed __int128 __a, vector signed __int128 __b,
11503 vector signed __int128 __c) {
11504 return __builtin_altivec_vsubecuq(__a, __b, __c);
11505}
11506
11507static __inline__ vector unsigned __int128 __ATTRS_o_ai
11508vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,
11509 vector unsigned __int128 __c) {
11510 return __builtin_altivec_vsubecuq(__a, __b, __c);
11511}
11512#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
11513
11514static __inline__ vector signed int __ATTRS_o_ai
11515vec_sube(vector signed int __a, vector signed int __b,
11516 vector signed int __c) {
11517 vector signed int __mask = {1, 1, 1, 1};
11518 vector signed int __carry = __c & __mask;
11519 return vec_adde(__a, ~__b, __carry);
11520}
11521
11522static __inline__ vector unsigned int __ATTRS_o_ai
11523vec_sube(vector unsigned int __a, vector unsigned int __b,
11524 vector unsigned int __c) {
11525 vector unsigned int __mask = {1, 1, 1, 1};
11526 vector unsigned int __carry = __c & __mask;
11527 return vec_adde(__a, ~__b, __carry);
11528}
11529/* vec_sum4s */
11530
11531static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
11532 vector int __b) {
11533 return __builtin_altivec_vsum4sbs(__a, __b);
11534}
11535
11536static __inline__ vector unsigned int __ATTRS_o_ai
11537vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
11538 return __builtin_altivec_vsum4ubs(__a, __b);
11539}
11540
11541static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
11542 vector int __b) {
11543 return __builtin_altivec_vsum4shs(__a, __b);
11544}
11545
11546/* vec_vsum4sbs */
11547
11548static __inline__ vector int __attribute__((__always_inline__))
11549vec_vsum4sbs(vector signed char __a, vector int __b) {
11550 return __builtin_altivec_vsum4sbs(__a, __b);
11551}
11552
11553/* vec_vsum4ubs */
11554
11555static __inline__ vector unsigned int __attribute__((__always_inline__))
11556vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
11557 return __builtin_altivec_vsum4ubs(__a, __b);
11558}
11559
11560/* vec_vsum4shs */
11561
11562static __inline__ vector int __attribute__((__always_inline__))
11563vec_vsum4shs(vector signed short __a, vector int __b) {
11564 return __builtin_altivec_vsum4shs(__a, __b);
11565}
11566
11567/* vec_sum2s */
11568
11569/* The vsum2sws instruction has a big-endian bias, so that the second
11570 input vector and the result always reference big-endian elements
11571 1 and 3 (little-endian element 0 and 2). For ease of porting the
11572 programmer wants elements 1 and 3 in both cases, so for little
11573 endian we must perform some permutes. */
11574
11575static __inline__ vector signed int __attribute__((__always_inline__))
11576vec_sum2s(vector int __a, vector int __b) {
11577#ifdef __LITTLE_ENDIAN__
11578 vector int __c = (vector signed int)vec_perm(
11579 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11580 8, 9, 10, 11));
11581 __c = __builtin_altivec_vsum2sws(__a, __c);
11582 return (vector signed int)vec_perm(
11583 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11584 8, 9, 10, 11));
11585#else
11586 return __builtin_altivec_vsum2sws(__a, __b);
11587#endif
11588}
11589
11590/* vec_vsum2sws */
11591
11592static __inline__ vector signed int __attribute__((__always_inline__))
11593vec_vsum2sws(vector int __a, vector int __b) {
11594#ifdef __LITTLE_ENDIAN__
11595 vector int __c = (vector signed int)vec_perm(
11596 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11597 8, 9, 10, 11));
11598 __c = __builtin_altivec_vsum2sws(__a, __c);
11599 return (vector signed int)vec_perm(
11600 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
11601 8, 9, 10, 11));
11602#else
11603 return __builtin_altivec_vsum2sws(__a, __b);
11604#endif
11605}
11606
11607/* vec_sums */
11608
11609/* The vsumsws instruction has a big-endian bias, so that the second
11610 input vector and the result always reference big-endian element 3
11611 (little-endian element 0). For ease of porting the programmer
11612 wants element 3 in both cases, so for little endian we must perform
11613 some permutes. */
11614
11615static __inline__ vector signed int __attribute__((__always_inline__))
11616vec_sums(vector signed int __a, vector signed int __b) {
11617#ifdef __LITTLE_ENDIAN__
11618 __b = (vector signed int)vec_splat(__b, 3);
11619 __b = __builtin_altivec_vsumsws(__a, __b);
11620 return (vector signed int)(0, 0, 0, __b[0]);
11621#else
11622 return __builtin_altivec_vsumsws(__a, __b);
11623#endif
11624}
11625
11626/* vec_vsumsws */
11627
11628static __inline__ vector signed int __attribute__((__always_inline__))
11629vec_vsumsws(vector signed int __a, vector signed int __b) {
11630#ifdef __LITTLE_ENDIAN__
11631 __b = (vector signed int)vec_splat(__b, 3);
11632 __b = __builtin_altivec_vsumsws(__a, __b);
11633 return (vector signed int)(0, 0, 0, __b[0]);
11634#else
11635 return __builtin_altivec_vsumsws(__a, __b);
11636#endif
11637}
11638
11639/* vec_trunc */
11640
11641static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
11642#ifdef __VSX__
11643 return __builtin_vsx_xvrspiz(__a);
11644#else
11645 return __builtin_altivec_vrfiz(__a);
11646#endif
11647}
11648
11649#ifdef __VSX__
11650static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
11651 return __builtin_vsx_xvrdpiz(__a);
11652}
11653#endif
11654
11655/* vec_vrfiz */
11656
11657static __inline__ vector float __attribute__((__always_inline__))
11658vec_vrfiz(vector float __a) {
11659 return __builtin_altivec_vrfiz(__a);
11660}
11661
11662/* vec_unpackh */
11663
11664/* The vector unpack instructions all have a big-endian bias, so for
11665 little endian we must reverse the meanings of "high" and "low." */
11666
11667static __inline__ vector short __ATTRS_o_ai
11668vec_unpackh(vector signed char __a) {
11669#ifdef __LITTLE_ENDIAN__
11670 return __builtin_altivec_vupklsb((vector char)__a);
11671#else
11672 return __builtin_altivec_vupkhsb((vector char)__a);
11673#endif
11674}
11675
11676static __inline__ vector bool short __ATTRS_o_ai
11677vec_unpackh(vector bool char __a) {
11678#ifdef __LITTLE_ENDIAN__
11679 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11680#else
11681 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11682#endif
11683}
11684
11685static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
11686#ifdef __LITTLE_ENDIAN__
11687 return __builtin_altivec_vupklsh(__a);
11688#else
11689 return __builtin_altivec_vupkhsh(__a);
11690#endif
11691}
11692
11693static __inline__ vector bool int __ATTRS_o_ai
11694vec_unpackh(vector bool short __a) {
11695#ifdef __LITTLE_ENDIAN__
11696 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11697#else
11698 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11699#endif
11700}
11701
11702static __inline__ vector unsigned int __ATTRS_o_ai
11703vec_unpackh(vector pixel __a) {
11704#ifdef __LITTLE_ENDIAN__
11705 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11706#else
11707 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11708#endif
11709}
11710
11711#ifdef __POWER8_VECTOR__
11712static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
11713#ifdef __LITTLE_ENDIAN__
11714 return __builtin_altivec_vupklsw(__a);
11715#else
11716 return __builtin_altivec_vupkhsw(__a);
11717#endif
11718}
11719
11720static __inline__ vector bool long long __ATTRS_o_ai
11721vec_unpackh(vector bool int __a) {
11722#ifdef __LITTLE_ENDIAN__
11723 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11724#else
11725 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11726#endif
11727}
11728
11729static __inline__ vector double __ATTRS_o_ai
11730vec_unpackh(vector float __a) {
11731 return (vector double)(__a[0], __a[1]);
11732}
11733#endif
11734
11735/* vec_vupkhsb */
11736
11737static __inline__ vector short __ATTRS_o_ai
11738vec_vupkhsb(vector signed char __a) {
11739#ifdef __LITTLE_ENDIAN__
11740 return __builtin_altivec_vupklsb((vector char)__a);
11741#else
11742 return __builtin_altivec_vupkhsb((vector char)__a);
11743#endif
11744}
11745
11746static __inline__ vector bool short __ATTRS_o_ai
11747vec_vupkhsb(vector bool char __a) {
11748#ifdef __LITTLE_ENDIAN__
11749 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11750#else
11751 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11752#endif
11753}
11754
11755/* vec_vupkhsh */
11756
11757static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
11758#ifdef __LITTLE_ENDIAN__
11759 return __builtin_altivec_vupklsh(__a);
11760#else
11761 return __builtin_altivec_vupkhsh(__a);
11762#endif
11763}
11764
11765static __inline__ vector bool int __ATTRS_o_ai
11766vec_vupkhsh(vector bool short __a) {
11767#ifdef __LITTLE_ENDIAN__
11768 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11769#else
11770 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11771#endif
11772}
11773
11774static __inline__ vector unsigned int __ATTRS_o_ai
11775vec_vupkhsh(vector pixel __a) {
11776#ifdef __LITTLE_ENDIAN__
11777 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11778#else
11779 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11780#endif
11781}
11782
11783/* vec_vupkhsw */
11784
11785#ifdef __POWER8_VECTOR__
11786static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
11787#ifdef __LITTLE_ENDIAN__
11788 return __builtin_altivec_vupklsw(__a);
11789#else
11790 return __builtin_altivec_vupkhsw(__a);
11791#endif
11792}
11793
11794static __inline__ vector bool long long __ATTRS_o_ai
11795vec_vupkhsw(vector bool int __a) {
11796#ifdef __LITTLE_ENDIAN__
11797 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11798#else
11799 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11800#endif
11801}
11802#endif
11803
11804/* vec_unpackl */
11805
11806static __inline__ vector short __ATTRS_o_ai
11807vec_unpackl(vector signed char __a) {
11808#ifdef __LITTLE_ENDIAN__
11809 return __builtin_altivec_vupkhsb((vector char)__a);
11810#else
11811 return __builtin_altivec_vupklsb((vector char)__a);
11812#endif
11813}
11814
11815static __inline__ vector bool short __ATTRS_o_ai
11816vec_unpackl(vector bool char __a) {
11817#ifdef __LITTLE_ENDIAN__
11818 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11819#else
11820 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11821#endif
11822}
11823
11824static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
11825#ifdef __LITTLE_ENDIAN__
11826 return __builtin_altivec_vupkhsh(__a);
11827#else
11828 return __builtin_altivec_vupklsh(__a);
11829#endif
11830}
11831
11832static __inline__ vector bool int __ATTRS_o_ai
11833vec_unpackl(vector bool short __a) {
11834#ifdef __LITTLE_ENDIAN__
11835 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11836#else
11837 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11838#endif
11839}
11840
11841static __inline__ vector unsigned int __ATTRS_o_ai
11842vec_unpackl(vector pixel __a) {
11843#ifdef __LITTLE_ENDIAN__
11844 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11845#else
11846 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11847#endif
11848}
11849
11850#ifdef __POWER8_VECTOR__
11851static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
11852#ifdef __LITTLE_ENDIAN__
11853 return __builtin_altivec_vupkhsw(__a);
11854#else
11855 return __builtin_altivec_vupklsw(__a);
11856#endif
11857}
11858
11859static __inline__ vector bool long long __ATTRS_o_ai
11860vec_unpackl(vector bool int __a) {
11861#ifdef __LITTLE_ENDIAN__
11862 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11863#else
11864 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11865#endif
11866}
11867
11868static __inline__ vector double __ATTRS_o_ai
11869vec_unpackl(vector float __a) {
11870 return (vector double)(__a[2], __a[3]);
11871}
11872#endif
11873
11874/* vec_vupklsb */
11875
11876static __inline__ vector short __ATTRS_o_ai
11877vec_vupklsb(vector signed char __a) {
11878#ifdef __LITTLE_ENDIAN__
11879 return __builtin_altivec_vupkhsb((vector char)__a);
11880#else
11881 return __builtin_altivec_vupklsb((vector char)__a);
11882#endif
11883}
11884
11885static __inline__ vector bool short __ATTRS_o_ai
11886vec_vupklsb(vector bool char __a) {
11887#ifdef __LITTLE_ENDIAN__
11888 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
11889#else
11890 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
11891#endif
11892}
11893
11894/* vec_vupklsh */
11895
11896static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
11897#ifdef __LITTLE_ENDIAN__
11898 return __builtin_altivec_vupkhsh(__a);
11899#else
11900 return __builtin_altivec_vupklsh(__a);
11901#endif
11902}
11903
11904static __inline__ vector bool int __ATTRS_o_ai
11905vec_vupklsh(vector bool short __a) {
11906#ifdef __LITTLE_ENDIAN__
11907 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
11908#else
11909 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
11910#endif
11911}
11912
11913static __inline__ vector unsigned int __ATTRS_o_ai
11914vec_vupklsh(vector pixel __a) {
11915#ifdef __LITTLE_ENDIAN__
11916 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
11917#else
11918 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
11919#endif
11920}
11921
11922/* vec_vupklsw */
11923
11924#ifdef __POWER8_VECTOR__
11925static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
11926#ifdef __LITTLE_ENDIAN__
11927 return __builtin_altivec_vupkhsw(__a);
11928#else
11929 return __builtin_altivec_vupklsw(__a);
11930#endif
11931}
11932
11933static __inline__ vector bool long long __ATTRS_o_ai
11934vec_vupklsw(vector bool int __a) {
11935#ifdef __LITTLE_ENDIAN__
11936 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
11937#else
11938 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
11939#endif
11940}
11941#endif
11942
11943/* vec_vsx_ld */
11944
11945#ifdef __VSX__
11946
11947static __inline__ vector bool int __ATTRS_o_ai
11948vec_vsx_ld(int __a, const vector bool int *__b) {
11949 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
11950}
11951
11952static __inline__ vector signed int __ATTRS_o_ai
11953vec_vsx_ld(int __a, const vector signed int *__b) {
11954 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11955}
11956
11957static __inline__ vector signed int __ATTRS_o_ai
11958vec_vsx_ld(int __a, const signed int *__b) {
11959 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
11960}
11961
11962static __inline__ vector unsigned int __ATTRS_o_ai
11963vec_vsx_ld(int __a, const vector unsigned int *__b) {
11964 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11965}
11966
11967static __inline__ vector unsigned int __ATTRS_o_ai
11968vec_vsx_ld(int __a, const unsigned int *__b) {
11969 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
11970}
11971
11972static __inline__ vector float __ATTRS_o_ai
11973vec_vsx_ld(int __a, const vector float *__b) {
11974 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11975}
11976
11977static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
11978 const float *__b) {
11979 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
11980}
11981
11982static __inline__ vector signed long long __ATTRS_o_ai
11983vec_vsx_ld(int __a, const vector signed long long *__b) {
11984 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
11985}
11986
11987static __inline__ vector unsigned long long __ATTRS_o_ai
11988vec_vsx_ld(int __a, const vector unsigned long long *__b) {
11989 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
11990}
11991
11992static __inline__ vector double __ATTRS_o_ai
11993vec_vsx_ld(int __a, const vector double *__b) {
11994 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
11995}
11996
11997static __inline__ vector double __ATTRS_o_ai
11998vec_vsx_ld(int __a, const double *__b) {
11999 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
12000}
12001
12002static __inline__ vector bool short __ATTRS_o_ai
12003vec_vsx_ld(int __a, const vector bool short *__b) {
12004 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
12005}
12006
12007static __inline__ vector signed short __ATTRS_o_ai
12008vec_vsx_ld(int __a, const vector signed short *__b) {
12009 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
12010}
12011
12012static __inline__ vector signed short __ATTRS_o_ai
12013vec_vsx_ld(int __a, const signed short *__b) {
12014 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
12015}
12016
12017static __inline__ vector unsigned short __ATTRS_o_ai
12018vec_vsx_ld(int __a, const vector unsigned short *__b) {
12019 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
12020}
12021
12022static __inline__ vector unsigned short __ATTRS_o_ai
12023vec_vsx_ld(int __a, const unsigned short *__b) {
12024 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
12025}
12026
12027static __inline__ vector bool char __ATTRS_o_ai
12028vec_vsx_ld(int __a, const vector bool char *__b) {
12029 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
12030}
12031
12032static __inline__ vector signed char __ATTRS_o_ai
12033vec_vsx_ld(int __a, const vector signed char *__b) {
12034 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
12035}
12036
12037static __inline__ vector signed char __ATTRS_o_ai
12038vec_vsx_ld(int __a, const signed char *__b) {
12039 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
12040}
12041
12042static __inline__ vector unsigned char __ATTRS_o_ai
12043vec_vsx_ld(int __a, const vector unsigned char *__b) {
12044 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12045}
12046
12047static __inline__ vector unsigned char __ATTRS_o_ai
12048vec_vsx_ld(int __a, const unsigned char *__b) {
12049 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
12050}
12051
12052#endif
12053
12054/* vec_vsx_st */
12055
12056#ifdef __VSX__
12057
12058static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12059 vector bool int *__c) {
12060 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12061}
12062
12063static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12064 signed int *__c) {
12065 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12066}
12067
12068static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
12069 unsigned int *__c) {
12070 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12071}
12072
12073static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12074 vector signed int *__c) {
12075 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12076}
12077
12078static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
12079 signed int *__c) {
12080 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12081}
12082
12083static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12084 vector unsigned int *__c) {
12085 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12086}
12087
12088static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
12089 unsigned int *__c) {
12090 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12091}
12092
12093static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12094 vector float *__c) {
12095 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12096}
12097
12098static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
12099 float *__c) {
12100 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12101}
12102
12103static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
12104 int __b,
12105 vector signed long long *__c) {
12106 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12107}
12108
12109static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
12110 int __b,
12111 vector unsigned long long *__c) {
12112 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12113}
12114
12115static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12116 vector double *__c) {
12117 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12118}
12119
12120static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
12121 double *__c) {
12122 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
12123}
12124
12125static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12126 vector bool short *__c) {
12127 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12128}
12129
12130static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12131 signed short *__c) {
12132 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12133}
12134
12135static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
12136 unsigned short *__c) {
12137 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12138}
12139static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12140 vector signed short *__c) {
12141 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12142}
12143
12144static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
12145 signed short *__c) {
12146 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12147}
12148
12149static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12150 int __b,
12151 vector unsigned short *__c) {
12152 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12153}
12154
12155static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
12156 int __b, unsigned short *__c) {
12157 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12158}
12159
12160static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12161 vector bool char *__c) {
12162 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12163}
12164
12165static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12166 signed char *__c) {
12167 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12168}
12169
12170static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
12171 unsigned char *__c) {
12172 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12173}
12174
12175static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12176 vector signed char *__c) {
12177 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12178}
12179
12180static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
12181 signed char *__c) {
12182 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12183}
12184
12185static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12186 int __b,
12187 vector unsigned char *__c) {
12188 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12189}
12190
12191static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
12192 int __b, unsigned char *__c) {
12193 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
12194}
12195
12196#endif
12197
12198#ifdef __VSX__
12199#define vec_xxpermdi __builtin_vsx_xxpermdi
12200#define vec_xxsldwi __builtin_vsx_xxsldwi
12201#endif
12202
12203/* vec_xor */
12204
12205#define __builtin_altivec_vxor vec_xor
12206
12207static __inline__ vector signed char __ATTRS_o_ai
12208vec_xor(vector signed char __a, vector signed char __b) {
12209 return __a ^ __b;
12210}
12211
12212static __inline__ vector signed char __ATTRS_o_ai
12213vec_xor(vector bool char __a, vector signed char __b) {
12214 return (vector signed char)__a ^ __b;
12215}
12216
12217static __inline__ vector signed char __ATTRS_o_ai
12218vec_xor(vector signed char __a, vector bool char __b) {
12219 return __a ^ (vector signed char)__b;
12220}
12221
12222static __inline__ vector unsigned char __ATTRS_o_ai
12223vec_xor(vector unsigned char __a, vector unsigned char __b) {
12224 return __a ^ __b;
12225}
12226
12227static __inline__ vector unsigned char __ATTRS_o_ai
12228vec_xor(vector bool char __a, vector unsigned char __b) {
12229 return (vector unsigned char)__a ^ __b;
12230}
12231
12232static __inline__ vector unsigned char __ATTRS_o_ai
12233vec_xor(vector unsigned char __a, vector bool char __b) {
12234 return __a ^ (vector unsigned char)__b;
12235}
12236
12237static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
12238 vector bool char __b) {
12239 return __a ^ __b;
12240}
12241
12242static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12243 vector short __b) {
12244 return __a ^ __b;
12245}
12246
12247static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
12248 vector short __b) {
12249 return (vector short)__a ^ __b;
12250}
12251
12252static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
12253 vector bool short __b) {
12254 return __a ^ (vector short)__b;
12255}
12256
12257static __inline__ vector unsigned short __ATTRS_o_ai
12258vec_xor(vector unsigned short __a, vector unsigned short __b) {
12259 return __a ^ __b;
12260}
12261
12262static __inline__ vector unsigned short __ATTRS_o_ai
12263vec_xor(vector bool short __a, vector unsigned short __b) {
12264 return (vector unsigned short)__a ^ __b;
12265}
12266
12267static __inline__ vector unsigned short __ATTRS_o_ai
12268vec_xor(vector unsigned short __a, vector bool short __b) {
12269 return __a ^ (vector unsigned short)__b;
12270}
12271
12272static __inline__ vector bool short __ATTRS_o_ai
12273vec_xor(vector bool short __a, vector bool short __b) {
12274 return __a ^ __b;
12275}
12276
12277static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12278 vector int __b) {
12279 return __a ^ __b;
12280}
12281
12282static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
12283 vector int __b) {
12284 return (vector int)__a ^ __b;
12285}
12286
12287static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
12288 vector bool int __b) {
12289 return __a ^ (vector int)__b;
12290}
12291
12292static __inline__ vector unsigned int __ATTRS_o_ai
12293vec_xor(vector unsigned int __a, vector unsigned int __b) {
12294 return __a ^ __b;
12295}
12296
12297static __inline__ vector unsigned int __ATTRS_o_ai
12298vec_xor(vector bool int __a, vector unsigned int __b) {
12299 return (vector unsigned int)__a ^ __b;
12300}
12301
12302static __inline__ vector unsigned int __ATTRS_o_ai
12303vec_xor(vector unsigned int __a, vector bool int __b) {
12304 return __a ^ (vector unsigned int)__b;
12305}
12306
12307static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
12308 vector bool int __b) {
12309 return __a ^ __b;
12310}
12311
12312static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12313 vector float __b) {
12314 vector unsigned int __res =
12315 (vector unsigned int)__a ^ (vector unsigned int)__b;
12316 return (vector float)__res;
12317}
12318
12319static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
12320 vector float __b) {
12321 vector unsigned int __res =
12322 (vector unsigned int)__a ^ (vector unsigned int)__b;
12323 return (vector float)__res;
12324}
12325
12326static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
12327 vector bool int __b) {
12328 vector unsigned int __res =
12329 (vector unsigned int)__a ^ (vector unsigned int)__b;
12330 return (vector float)__res;
12331}
12332
12333#ifdef __VSX__
12334static __inline__ vector signed long long __ATTRS_o_ai
12335vec_xor(vector signed long long __a, vector signed long long __b) {
12336 return __a ^ __b;
12337}
12338
12339static __inline__ vector signed long long __ATTRS_o_ai
12340vec_xor(vector bool long long __a, vector signed long long __b) {
12341 return (vector signed long long)__a ^ __b;
12342}
12343
12344static __inline__ vector signed long long __ATTRS_o_ai
12345vec_xor(vector signed long long __a, vector bool long long __b) {
12346 return __a ^ (vector signed long long)__b;
12347}
12348
12349static __inline__ vector unsigned long long __ATTRS_o_ai
12350vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
12351 return __a ^ __b;
12352}
12353
12354static __inline__ vector unsigned long long __ATTRS_o_ai
12355vec_xor(vector bool long long __a, vector unsigned long long __b) {
12356 return (vector unsigned long long)__a ^ __b;
12357}
12358
12359static __inline__ vector unsigned long long __ATTRS_o_ai
12360vec_xor(vector unsigned long long __a, vector bool long long __b) {
12361 return __a ^ (vector unsigned long long)__b;
12362}
12363
12364static __inline__ vector bool long long __ATTRS_o_ai
12365vec_xor(vector bool long long __a, vector bool long long __b) {
12366 return __a ^ __b;
12367}
12368
12369static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
12370 vector double __b) {
12371 return (vector double)((vector unsigned long long)__a ^
12372 (vector unsigned long long)__b);
12373}
12374
12375static __inline__ vector double __ATTRS_o_ai
12376vec_xor(vector double __a, vector bool long long __b) {
12377 return (vector double)((vector unsigned long long)__a ^
12378 (vector unsigned long long)__b);
12379}
12380
12381static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
12382 vector double __b) {
12383 return (vector double)((vector unsigned long long)__a ^
12384 (vector unsigned long long)__b);
12385}
12386#endif
12387
12388/* vec_vxor */
12389
12390static __inline__ vector signed char __ATTRS_o_ai
12391vec_vxor(vector signed char __a, vector signed char __b) {
12392 return __a ^ __b;
12393}
12394
12395static __inline__ vector signed char __ATTRS_o_ai
12396vec_vxor(vector bool char __a, vector signed char __b) {
12397 return (vector signed char)__a ^ __b;
12398}
12399
12400static __inline__ vector signed char __ATTRS_o_ai
12401vec_vxor(vector signed char __a, vector bool char __b) {
12402 return __a ^ (vector signed char)__b;
12403}
12404
12405static __inline__ vector unsigned char __ATTRS_o_ai
12406vec_vxor(vector unsigned char __a, vector unsigned char __b) {
12407 return __a ^ __b;
12408}
12409
12410static __inline__ vector unsigned char __ATTRS_o_ai
12411vec_vxor(vector bool char __a, vector unsigned char __b) {
12412 return (vector unsigned char)__a ^ __b;
12413}
12414
12415static __inline__ vector unsigned char __ATTRS_o_ai
12416vec_vxor(vector unsigned char __a, vector bool char __b) {
12417 return __a ^ (vector unsigned char)__b;
12418}
12419
12420static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
12421 vector bool char __b) {
12422 return __a ^ __b;
12423}
12424
12425static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12426 vector short __b) {
12427 return __a ^ __b;
12428}
12429
12430static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
12431 vector short __b) {
12432 return (vector short)__a ^ __b;
12433}
12434
12435static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
12436 vector bool short __b) {
12437 return __a ^ (vector short)__b;
12438}
12439
12440static __inline__ vector unsigned short __ATTRS_o_ai
12441vec_vxor(vector unsigned short __a, vector unsigned short __b) {
12442 return __a ^ __b;
12443}
12444
12445static __inline__ vector unsigned short __ATTRS_o_ai
12446vec_vxor(vector bool short __a, vector unsigned short __b) {
12447 return (vector unsigned short)__a ^ __b;
12448}
12449
12450static __inline__ vector unsigned short __ATTRS_o_ai
12451vec_vxor(vector unsigned short __a, vector bool short __b) {
12452 return __a ^ (vector unsigned short)__b;
12453}
12454
12455static __inline__ vector bool short __ATTRS_o_ai
12456vec_vxor(vector bool short __a, vector bool short __b) {
12457 return __a ^ __b;
12458}
12459
12460static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12461 vector int __b) {
12462 return __a ^ __b;
12463}
12464
12465static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
12466 vector int __b) {
12467 return (vector int)__a ^ __b;
12468}
12469
12470static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
12471 vector bool int __b) {
12472 return __a ^ (vector int)__b;
12473}
12474
12475static __inline__ vector unsigned int __ATTRS_o_ai
12476vec_vxor(vector unsigned int __a, vector unsigned int __b) {
12477 return __a ^ __b;
12478}
12479
12480static __inline__ vector unsigned int __ATTRS_o_ai
12481vec_vxor(vector bool int __a, vector unsigned int __b) {
12482 return (vector unsigned int)__a ^ __b;
12483}
12484
12485static __inline__ vector unsigned int __ATTRS_o_ai
12486vec_vxor(vector unsigned int __a, vector bool int __b) {
12487 return __a ^ (vector unsigned int)__b;
12488}
12489
12490static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
12491 vector bool int __b) {
12492 return __a ^ __b;
12493}
12494
12495static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12496 vector float __b) {
12497 vector unsigned int __res =
12498 (vector unsigned int)__a ^ (vector unsigned int)__b;
12499 return (vector float)__res;
12500}
12501
12502static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
12503 vector float __b) {
12504 vector unsigned int __res =
12505 (vector unsigned int)__a ^ (vector unsigned int)__b;
12506 return (vector float)__res;
12507}
12508
12509static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
12510 vector bool int __b) {
12511 vector unsigned int __res =
12512 (vector unsigned int)__a ^ (vector unsigned int)__b;
12513 return (vector float)__res;
12514}
12515
12516#ifdef __VSX__
12517static __inline__ vector signed long long __ATTRS_o_ai
12518vec_vxor(vector signed long long __a, vector signed long long __b) {
12519 return __a ^ __b;
12520}
12521
12522static __inline__ vector signed long long __ATTRS_o_ai
12523vec_vxor(vector bool long long __a, vector signed long long __b) {
12524 return (vector signed long long)__a ^ __b;
12525}
12526
12527static __inline__ vector signed long long __ATTRS_o_ai
12528vec_vxor(vector signed long long __a, vector bool long long __b) {
12529 return __a ^ (vector signed long long)__b;
12530}
12531
12532static __inline__ vector unsigned long long __ATTRS_o_ai
12533vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
12534 return __a ^ __b;
12535}
12536
12537static __inline__ vector unsigned long long __ATTRS_o_ai
12538vec_vxor(vector bool long long __a, vector unsigned long long __b) {
12539 return (vector unsigned long long)__a ^ __b;
12540}
12541
12542static __inline__ vector unsigned long long __ATTRS_o_ai
12543vec_vxor(vector unsigned long long __a, vector bool long long __b) {
12544 return __a ^ (vector unsigned long long)__b;
12545}
12546
12547static __inline__ vector bool long long __ATTRS_o_ai
12548vec_vxor(vector bool long long __a, vector bool long long __b) {
12549 return __a ^ __b;
12550}
12551#endif
12552
12553/* ------------------------ extensions for CBEA ----------------------------- */
12554
12555/* vec_extract */
12556
12557static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
12558 int __b) {
12559 return __a[__b];
12560}
12561
12562static __inline__ unsigned char __ATTRS_o_ai
12563vec_extract(vector unsigned char __a, int __b) {
12564 return __a[__b];
12565}
12566
12567static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
12568 int __b) {
12569 return __a[__b];
12570}
12571
12572static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
12573 int __b) {
12574 return __a[__b];
12575}
12576
12577static __inline__ unsigned short __ATTRS_o_ai
12578vec_extract(vector unsigned short __a, int __b) {
12579 return __a[__b];
12580}
12581
12582static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
12583 int __b) {
12584 return __a[__b];
12585}
12586
12587static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
12588 int __b) {
12589 return __a[__b];
12590}
12591
12592static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
12593 int __b) {
12594 return __a[__b];
12595}
12596
12597static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
12598 int __b) {
12599 return __a[__b];
12600}
12601
12602#ifdef __VSX__
12603static __inline__ signed long long __ATTRS_o_ai
12604vec_extract(vector signed long long __a, int __b) {
12605 return __a[__b];
12606}
12607
12608static __inline__ unsigned long long __ATTRS_o_ai
12609vec_extract(vector unsigned long long __a, int __b) {
12610 return __a[__b];
12611}
12612
12613static __inline__ unsigned long long __ATTRS_o_ai
12614vec_extract(vector bool long long __a, int __b) {
12615 return __a[__b];
12616}
12617
12618static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
12619 return __a[__b];
12620}
12621#endif
12622
12623static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
12624 return __a[__b];
12625}
12626
12627#ifdef __POWER9_VECTOR__
12628
12629#define vec_insert4b __builtin_vsx_insertword
12630#define vec_extract4b __builtin_vsx_extractuword
12631
12632/* vec_extract_exp */
12633
12634static __inline__ vector unsigned int __ATTRS_o_ai
12635vec_extract_exp(vector float __a) {
12636 return __builtin_vsx_xvxexpsp(__a);
12637}
12638
12639static __inline__ vector unsigned long long __ATTRS_o_ai
12640vec_extract_exp(vector double __a) {
12641 return __builtin_vsx_xvxexpdp(__a);
12642}
12643
12644/* vec_extract_sig */
12645
12646static __inline__ vector unsigned int __ATTRS_o_ai
12647vec_extract_sig(vector float __a) {
12648 return __builtin_vsx_xvxsigsp(__a);
12649}
12650
12651static __inline__ vector unsigned long long __ATTRS_o_ai
12652vec_extract_sig (vector double __a) {
12653 return __builtin_vsx_xvxsigdp(__a);
12654}
12655
12656static __inline__ vector float __ATTRS_o_ai
12657vec_extract_fp32_from_shorth(vector unsigned short __a) {
12658 vector unsigned short __b =
12659#ifdef __LITTLE_ENDIAN__
12660 __builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);
12661#else
12662 __builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);
12663#endif
12664 return __builtin_vsx_xvcvhpsp(__b);
12665}
12666
12667static __inline__ vector float __ATTRS_o_ai
12668vec_extract_fp32_from_shortl(vector unsigned short __a) {
12669 vector unsigned short __b =
12670#ifdef __LITTLE_ENDIAN__
12671 __builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);
12672#else
12673 __builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);
12674#endif
12675 return __builtin_vsx_xvcvhpsp(__b);
12676}
12677#endif /* __POWER9_VECTOR__ */
12678
12679/* vec_insert */
12680
12681static __inline__ vector signed char __ATTRS_o_ai
12682vec_insert(signed char __a, vector signed char __b, int __c) {
12683 __b[__c] = __a;
12684 return __b;
12685}
12686
12687static __inline__ vector unsigned char __ATTRS_o_ai
12688vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
12689 __b[__c] = __a;
12690 return __b;
12691}
12692
12693static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
12694 vector bool char __b,
12695 int __c) {
12696 __b[__c] = __a;
12697 return __b;
12698}
12699
12700static __inline__ vector signed short __ATTRS_o_ai
12701vec_insert(signed short __a, vector signed short __b, int __c) {
12702 __b[__c] = __a;
12703 return __b;
12704}
12705
12706static __inline__ vector unsigned short __ATTRS_o_ai
12707vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
12708 __b[__c] = __a;
12709 return __b;
12710}
12711
12712static __inline__ vector bool short __ATTRS_o_ai
12713vec_insert(unsigned short __a, vector bool short __b, int __c) {
12714 __b[__c] = __a;
12715 return __b;
12716}
12717
12718static __inline__ vector signed int __ATTRS_o_ai
12719vec_insert(signed int __a, vector signed int __b, int __c) {
12720 __b[__c] = __a;
12721 return __b;
12722}
12723
12724static __inline__ vector unsigned int __ATTRS_o_ai
12725vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
12726 __b[__c] = __a;
12727 return __b;
12728}
12729
12730static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
12731 vector bool int __b,
12732 int __c) {
12733 __b[__c] = __a;
12734 return __b;
12735}
12736
12737#ifdef __VSX__
12738static __inline__ vector signed long long __ATTRS_o_ai
12739vec_insert(signed long long __a, vector signed long long __b, int __c) {
12740 __b[__c] = __a;
12741 return __b;
12742}
12743
12744static __inline__ vector unsigned long long __ATTRS_o_ai
12745vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
12746 __b[__c] = __a;
12747 return __b;
12748}
12749
12750static __inline__ vector bool long long __ATTRS_o_ai
12751vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
12752 __b[__c] = __a;
12753 return __b;
12754}
12755static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
12756 vector double __b,
12757 int __c) {
12758 __b[__c] = __a;
12759 return __b;
12760}
12761#endif
12762
12763static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
12764 vector float __b,
12765 int __c) {
12766 __b[__c] = __a;
12767 return __b;
12768}
12769
12770/* vec_lvlx */
12771
12772static __inline__ vector signed char __ATTRS_o_ai
12773vec_lvlx(int __a, const signed char *__b) {
12774 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12775 vec_lvsl(__a, __b));
12776}
12777
12778static __inline__ vector signed char __ATTRS_o_ai
12779vec_lvlx(int __a, const vector signed char *__b) {
12780 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
12781 vec_lvsl(__a, (unsigned char *)__b));
12782}
12783
12784static __inline__ vector unsigned char __ATTRS_o_ai
12785vec_lvlx(int __a, const unsigned char *__b) {
12786 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12787 vec_lvsl(__a, __b));
12788}
12789
12790static __inline__ vector unsigned char __ATTRS_o_ai
12791vec_lvlx(int __a, const vector unsigned char *__b) {
12792 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
12793 vec_lvsl(__a, (unsigned char *)__b));
12794}
12795
12796static __inline__ vector bool char __ATTRS_o_ai
12797vec_lvlx(int __a, const vector bool char *__b) {
12798 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
12799 vec_lvsl(__a, (unsigned char *)__b));
12800}
12801
12802static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12803 const short *__b) {
12804 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12805}
12806
12807static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
12808 const vector short *__b) {
12809 return vec_perm(vec_ld(__a, __b), (vector short)(0),
12810 vec_lvsl(__a, (unsigned char *)__b));
12811}
12812
12813static __inline__ vector unsigned short __ATTRS_o_ai
12814vec_lvlx(int __a, const unsigned short *__b) {
12815 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12816 vec_lvsl(__a, __b));
12817}
12818
12819static __inline__ vector unsigned short __ATTRS_o_ai
12820vec_lvlx(int __a, const vector unsigned short *__b) {
12821 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
12822 vec_lvsl(__a, (unsigned char *)__b));
12823}
12824
12825static __inline__ vector bool short __ATTRS_o_ai
12826vec_lvlx(int __a, const vector bool short *__b) {
12827 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
12828 vec_lvsl(__a, (unsigned char *)__b));
12829}
12830
12831static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
12832 const vector pixel *__b) {
12833 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
12834 vec_lvsl(__a, (unsigned char *)__b));
12835}
12836
12837static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
12838 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12839}
12840
12841static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
12842 const vector int *__b) {
12843 return vec_perm(vec_ld(__a, __b), (vector int)(0),
12844 vec_lvsl(__a, (unsigned char *)__b));
12845}
12846
12847static __inline__ vector unsigned int __ATTRS_o_ai
12848vec_lvlx(int __a, const unsigned int *__b) {
12849 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12850 vec_lvsl(__a, __b));
12851}
12852
12853static __inline__ vector unsigned int __ATTRS_o_ai
12854vec_lvlx(int __a, const vector unsigned int *__b) {
12855 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
12856 vec_lvsl(__a, (unsigned char *)__b));
12857}
12858
12859static __inline__ vector bool int __ATTRS_o_ai
12860vec_lvlx(int __a, const vector bool int *__b) {
12861 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
12862 vec_lvsl(__a, (unsigned char *)__b));
12863}
12864
12865static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12866 const float *__b) {
12867 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12868}
12869
12870static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
12871 const vector float *__b) {
12872 return vec_perm(vec_ld(__a, __b), (vector float)(0),
12873 vec_lvsl(__a, (unsigned char *)__b));
12874}
12875
12876/* vec_lvlxl */
12877
12878static __inline__ vector signed char __ATTRS_o_ai
12879vec_lvlxl(int __a, const signed char *__b) {
12880 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12881 vec_lvsl(__a, __b));
12882}
12883
12884static __inline__ vector signed char __ATTRS_o_ai
12885vec_lvlxl(int __a, const vector signed char *__b) {
12886 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
12887 vec_lvsl(__a, (unsigned char *)__b));
12888}
12889
12890static __inline__ vector unsigned char __ATTRS_o_ai
12891vec_lvlxl(int __a, const unsigned char *__b) {
12892 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12893 vec_lvsl(__a, __b));
12894}
12895
12896static __inline__ vector unsigned char __ATTRS_o_ai
12897vec_lvlxl(int __a, const vector unsigned char *__b) {
12898 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
12899 vec_lvsl(__a, (unsigned char *)__b));
12900}
12901
12902static __inline__ vector bool char __ATTRS_o_ai
12903vec_lvlxl(int __a, const vector bool char *__b) {
12904 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
12905 vec_lvsl(__a, (unsigned char *)__b));
12906}
12907
12908static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12909 const short *__b) {
12910 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
12911}
12912
12913static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
12914 const vector short *__b) {
12915 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
12916 vec_lvsl(__a, (unsigned char *)__b));
12917}
12918
12919static __inline__ vector unsigned short __ATTRS_o_ai
12920vec_lvlxl(int __a, const unsigned short *__b) {
12921 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12922 vec_lvsl(__a, __b));
12923}
12924
12925static __inline__ vector unsigned short __ATTRS_o_ai
12926vec_lvlxl(int __a, const vector unsigned short *__b) {
12927 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
12928 vec_lvsl(__a, (unsigned char *)__b));
12929}
12930
12931static __inline__ vector bool short __ATTRS_o_ai
12932vec_lvlxl(int __a, const vector bool short *__b) {
12933 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
12934 vec_lvsl(__a, (unsigned char *)__b));
12935}
12936
12937static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
12938 const vector pixel *__b) {
12939 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
12940 vec_lvsl(__a, (unsigned char *)__b));
12941}
12942
12943static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
12944 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
12945}
12946
12947static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
12948 const vector int *__b) {
12949 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
12950 vec_lvsl(__a, (unsigned char *)__b));
12951}
12952
12953static __inline__ vector unsigned int __ATTRS_o_ai
12954vec_lvlxl(int __a, const unsigned int *__b) {
12955 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12956 vec_lvsl(__a, __b));
12957}
12958
12959static __inline__ vector unsigned int __ATTRS_o_ai
12960vec_lvlxl(int __a, const vector unsigned int *__b) {
12961 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
12962 vec_lvsl(__a, (unsigned char *)__b));
12963}
12964
12965static __inline__ vector bool int __ATTRS_o_ai
12966vec_lvlxl(int __a, const vector bool int *__b) {
12967 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
12968 vec_lvsl(__a, (unsigned char *)__b));
12969}
12970
12971static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12972 const float *__b) {
12973 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
12974}
12975
12976static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
12977 vector float *__b) {
12978 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
12979 vec_lvsl(__a, (unsigned char *)__b));
12980}
12981
12982/* vec_lvrx */
12983
12984static __inline__ vector signed char __ATTRS_o_ai
12985vec_lvrx(int __a, const signed char *__b) {
12986 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12987 vec_lvsl(__a, __b));
12988}
12989
12990static __inline__ vector signed char __ATTRS_o_ai
12991vec_lvrx(int __a, const vector signed char *__b) {
12992 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
12993 vec_lvsl(__a, (unsigned char *)__b));
12994}
12995
12996static __inline__ vector unsigned char __ATTRS_o_ai
12997vec_lvrx(int __a, const unsigned char *__b) {
12998 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
12999 vec_lvsl(__a, __b));
13000}
13001
13002static __inline__ vector unsigned char __ATTRS_o_ai
13003vec_lvrx(int __a, const vector unsigned char *__b) {
13004 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
13005 vec_lvsl(__a, (unsigned char *)__b));
13006}
13007
13008static __inline__ vector bool char __ATTRS_o_ai
13009vec_lvrx(int __a, const vector bool char *__b) {
13010 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
13011 vec_lvsl(__a, (unsigned char *)__b));
13012}
13013
13014static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
13015 const short *__b) {
13016 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13017}
13018
13019static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
13020 const vector short *__b) {
13021 return vec_perm((vector short)(0), vec_ld(__a, __b),
13022 vec_lvsl(__a, (unsigned char *)__b));
13023}
13024
13025static __inline__ vector unsigned short __ATTRS_o_ai
13026vec_lvrx(int __a, const unsigned short *__b) {
13027 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
13028 vec_lvsl(__a, __b));
13029}
13030
13031static __inline__ vector unsigned short __ATTRS_o_ai
13032vec_lvrx(int __a, const vector unsigned short *__b) {
13033 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
13034 vec_lvsl(__a, (unsigned char *)__b));
13035}
13036
13037static __inline__ vector bool short __ATTRS_o_ai
13038vec_lvrx(int __a, const vector bool short *__b) {
13039 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
13040 vec_lvsl(__a, (unsigned char *)__b));
13041}
13042
13043static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
13044 const vector pixel *__b) {
13045 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
13046 vec_lvsl(__a, (unsigned char *)__b));
13047}
13048
13049static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
13050 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13051}
13052
13053static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
13054 const vector int *__b) {
13055 return vec_perm((vector int)(0), vec_ld(__a, __b),
13056 vec_lvsl(__a, (unsigned char *)__b));
13057}
13058
13059static __inline__ vector unsigned int __ATTRS_o_ai
13060vec_lvrx(int __a, const unsigned int *__b) {
13061 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13062 vec_lvsl(__a, __b));
13063}
13064
13065static __inline__ vector unsigned int __ATTRS_o_ai
13066vec_lvrx(int __a, const vector unsigned int *__b) {
13067 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
13068 vec_lvsl(__a, (unsigned char *)__b));
13069}
13070
13071static __inline__ vector bool int __ATTRS_o_ai
13072vec_lvrx(int __a, const vector bool int *__b) {
13073 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
13074 vec_lvsl(__a, (unsigned char *)__b));
13075}
13076
13077static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13078 const float *__b) {
13079 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
13080}
13081
13082static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
13083 const vector float *__b) {
13084 return vec_perm((vector float)(0), vec_ld(__a, __b),
13085 vec_lvsl(__a, (unsigned char *)__b));
13086}
13087
13088/* vec_lvrxl */
13089
13090static __inline__ vector signed char __ATTRS_o_ai
13091vec_lvrxl(int __a, const signed char *__b) {
13092 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13093 vec_lvsl(__a, __b));
13094}
13095
13096static __inline__ vector signed char __ATTRS_o_ai
13097vec_lvrxl(int __a, const vector signed char *__b) {
13098 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
13099 vec_lvsl(__a, (unsigned char *)__b));
13100}
13101
13102static __inline__ vector unsigned char __ATTRS_o_ai
13103vec_lvrxl(int __a, const unsigned char *__b) {
13104 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13105 vec_lvsl(__a, __b));
13106}
13107
13108static __inline__ vector unsigned char __ATTRS_o_ai
13109vec_lvrxl(int __a, const vector unsigned char *__b) {
13110 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
13111 vec_lvsl(__a, (unsigned char *)__b));
13112}
13113
13114static __inline__ vector bool char __ATTRS_o_ai
13115vec_lvrxl(int __a, const vector bool char *__b) {
13116 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
13117 vec_lvsl(__a, (unsigned char *)__b));
13118}
13119
13120static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13121 const short *__b) {
13122 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13123}
13124
13125static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
13126 const vector short *__b) {
13127 return vec_perm((vector short)(0), vec_ldl(__a, __b),
13128 vec_lvsl(__a, (unsigned char *)__b));
13129}
13130
13131static __inline__ vector unsigned short __ATTRS_o_ai
13132vec_lvrxl(int __a, const unsigned short *__b) {
13133 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13134 vec_lvsl(__a, __b));
13135}
13136
13137static __inline__ vector unsigned short __ATTRS_o_ai
13138vec_lvrxl(int __a, const vector unsigned short *__b) {
13139 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
13140 vec_lvsl(__a, (unsigned char *)__b));
13141}
13142
13143static __inline__ vector bool short __ATTRS_o_ai
13144vec_lvrxl(int __a, const vector bool short *__b) {
13145 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
13146 vec_lvsl(__a, (unsigned char *)__b));
13147}
13148
13149static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
13150 const vector pixel *__b) {
13151 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
13152 vec_lvsl(__a, (unsigned char *)__b));
13153}
13154
13155static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
13156 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13157}
13158
13159static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
13160 const vector int *__b) {
13161 return vec_perm((vector int)(0), vec_ldl(__a, __b),
13162 vec_lvsl(__a, (unsigned char *)__b));
13163}
13164
13165static __inline__ vector unsigned int __ATTRS_o_ai
13166vec_lvrxl(int __a, const unsigned int *__b) {
13167 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13168 vec_lvsl(__a, __b));
13169}
13170
13171static __inline__ vector unsigned int __ATTRS_o_ai
13172vec_lvrxl(int __a, const vector unsigned int *__b) {
13173 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
13174 vec_lvsl(__a, (unsigned char *)__b));
13175}
13176
13177static __inline__ vector bool int __ATTRS_o_ai
13178vec_lvrxl(int __a, const vector bool int *__b) {
13179 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
13180 vec_lvsl(__a, (unsigned char *)__b));
13181}
13182
13183static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13184 const float *__b) {
13185 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
13186}
13187
13188static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
13189 const vector float *__b) {
13190 return vec_perm((vector float)(0), vec_ldl(__a, __b),
13191 vec_lvsl(__a, (unsigned char *)__b));
13192}
13193
13194/* vec_stvlx */
13195
13196static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13197 signed char *__c) {
13199 __c);
13200}
13201
13202static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
13203 vector signed char *__c) {
13204 return vec_st(
13205 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13206 __b, __c);
13207}
13208
13209static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13210 unsigned char *__c) {
13212 __c);
13213}
13214
13215static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
13216 vector unsigned char *__c) {
13217 return vec_st(
13218 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13219 __b, __c);
13220}
13221
13222static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
13223 vector bool char *__c) {
13224 return vec_st(
13225 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13226 __b, __c);
13227}
13228
13229static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13230 short *__c) {
13232 __c);
13233}
13234
13235static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
13236 vector short *__c) {
13237 return vec_st(
13238 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13239 __b, __c);
13240}
13241
13242static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13243 int __b, unsigned short *__c) {
13245 __c);
13246}
13247
13248static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
13249 int __b,
13250 vector unsigned short *__c) {
13251 return vec_st(
13252 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13253 __b, __c);
13254}
13255
13256static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
13257 vector bool short *__c) {
13258 return vec_st(
13259 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13260 __b, __c);
13261}
13262
13263static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
13264 vector pixel *__c) {
13265 return vec_st(
13266 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13267 __b, __c);
13268}
13269
13270static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13271 int *__c) {
13273 __c);
13274}
13275
13276static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
13277 vector int *__c) {
13278 return vec_st(
13279 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13280 __b, __c);
13281}
13282
13283static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13284 unsigned int *__c) {
13286 __c);
13287}
13288
13289static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
13290 vector unsigned int *__c) {
13291 return vec_st(
13292 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13293 __b, __c);
13294}
13295
13296static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
13297 vector bool int *__c) {
13298 return vec_st(
13299 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13300 __b, __c);
13301}
13302
13303static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
13304 vector float *__c) {
13305 return vec_st(
13306 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13307 __b, __c);
13308}
13309
13310/* vec_stvlxl */
13311
13312static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13313 signed char *__c) {
13315 __c);
13316}
13317
13318static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
13319 vector signed char *__c) {
13320 return vec_stl(
13321 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13322 __b, __c);
13323}
13324
13325static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13326 int __b, unsigned char *__c) {
13328 __c);
13329}
13330
13331static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
13332 int __b,
13333 vector unsigned char *__c) {
13334 return vec_stl(
13335 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13336 __b, __c);
13337}
13338
13339static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
13340 vector bool char *__c) {
13341 return vec_stl(
13342 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13343 __b, __c);
13344}
13345
13346static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13347 short *__c) {
13349 __c);
13350}
13351
13352static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
13353 vector short *__c) {
13354 return vec_stl(
13355 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13356 __b, __c);
13357}
13358
13359static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13360 int __b, unsigned short *__c) {
13362 __c);
13363}
13364
13365static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
13366 int __b,
13367 vector unsigned short *__c) {
13368 return vec_stl(
13369 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13370 __b, __c);
13371}
13372
13373static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
13374 vector bool short *__c) {
13375 return vec_stl(
13376 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13377 __b, __c);
13378}
13379
13380static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
13381 vector pixel *__c) {
13382 return vec_stl(
13383 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13384 __b, __c);
13385}
13386
13387static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13388 int *__c) {
13390 __c);
13391}
13392
13393static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
13394 vector int *__c) {
13395 return vec_stl(
13396 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13397 __b, __c);
13398}
13399
13400static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13401 unsigned int *__c) {
13403 __c);
13404}
13405
13406static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
13407 vector unsigned int *__c) {
13408 return vec_stl(
13409 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13410 __b, __c);
13411}
13412
13413static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
13414 vector bool int *__c) {
13415 return vec_stl(
13416 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13417 __b, __c);
13418}
13419
13420static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
13421 vector float *__c) {
13422 return vec_stl(
13423 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
13424 __b, __c);
13425}
13426
13427/* vec_stvrx */
13428
13429static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13430 signed char *__c) {
13432 __c);
13433}
13434
13435static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
13436 vector signed char *__c) {
13437 return vec_st(
13438 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13439 __b, __c);
13440}
13441
13442static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13443 unsigned char *__c) {
13445 __c);
13446}
13447
13448static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
13449 vector unsigned char *__c) {
13450 return vec_st(
13451 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13452 __b, __c);
13453}
13454
13455static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
13456 vector bool char *__c) {
13457 return vec_st(
13458 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13459 __b, __c);
13460}
13461
13462static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13463 short *__c) {
13465 __c);
13466}
13467
13468static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
13469 vector short *__c) {
13470 return vec_st(
13471 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13472 __b, __c);
13473}
13474
13475static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13476 int __b, unsigned short *__c) {
13478 __c);
13479}
13480
13481static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
13482 int __b,
13483 vector unsigned short *__c) {
13484 return vec_st(
13485 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13486 __b, __c);
13487}
13488
13489static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
13490 vector bool short *__c) {
13491 return vec_st(
13492 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13493 __b, __c);
13494}
13495
13496static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
13497 vector pixel *__c) {
13498 return vec_st(
13499 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13500 __b, __c);
13501}
13502
13503static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13504 int *__c) {
13506 __c);
13507}
13508
13509static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
13510 vector int *__c) {
13511 return vec_st(
13512 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13513 __b, __c);
13514}
13515
13516static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13517 unsigned int *__c) {
13519 __c);
13520}
13521
13522static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
13523 vector unsigned int *__c) {
13524 return vec_st(
13525 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13526 __b, __c);
13527}
13528
13529static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
13530 vector bool int *__c) {
13531 return vec_st(
13532 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13533 __b, __c);
13534}
13535
13536static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
13537 vector float *__c) {
13538 return vec_st(
13539 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13540 __b, __c);
13541}
13542
13543/* vec_stvrxl */
13544
13545static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13546 signed char *__c) {
13548 __c);
13549}
13550
13551static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
13552 vector signed char *__c) {
13553 return vec_stl(
13554 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13555 __b, __c);
13556}
13557
13558static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13559 int __b, unsigned char *__c) {
13561 __c);
13562}
13563
13564static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
13565 int __b,
13566 vector unsigned char *__c) {
13567 return vec_stl(
13568 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13569 __b, __c);
13570}
13571
13572static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
13573 vector bool char *__c) {
13574 return vec_stl(
13575 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13576 __b, __c);
13577}
13578
13579static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13580 short *__c) {
13582 __c);
13583}
13584
13585static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
13586 vector short *__c) {
13587 return vec_stl(
13588 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13589 __b, __c);
13590}
13591
13592static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13593 int __b, unsigned short *__c) {
13595 __c);
13596}
13597
13598static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
13599 int __b,
13600 vector unsigned short *__c) {
13601 return vec_stl(
13602 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13603 __b, __c);
13604}
13605
13606static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
13607 vector bool short *__c) {
13608 return vec_stl(
13609 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13610 __b, __c);
13611}
13612
13613static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
13614 vector pixel *__c) {
13615 return vec_stl(
13616 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13617 __b, __c);
13618}
13619
13620static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13621 int *__c) {
13623 __c);
13624}
13625
13626static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
13627 vector int *__c) {
13628 return vec_stl(
13629 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13630 __b, __c);
13631}
13632
13633static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13634 unsigned int *__c) {
13636 __c);
13637}
13638
13639static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
13640 vector unsigned int *__c) {
13641 return vec_stl(
13642 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13643 __b, __c);
13644}
13645
13646static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
13647 vector bool int *__c) {
13648 return vec_stl(
13649 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13650 __b, __c);
13651}
13652
13653static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
13654 vector float *__c) {
13655 return vec_stl(
13656 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
13657 __b, __c);
13658}
13659
13660/* vec_promote */
13661
13662static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
13663 int __b) {
13664 vector signed char __res = (vector signed char)(0);
13665 __res[__b] = __a;
13666 return __res;
13667}
13668
13669static __inline__ vector unsigned char __ATTRS_o_ai
13670vec_promote(unsigned char __a, int __b) {
13671 vector unsigned char __res = (vector unsigned char)(0);
13672 __res[__b] = __a;
13673 return __res;
13674}
13675
13676static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
13677 vector short __res = (vector short)(0);
13678 __res[__b] = __a;
13679 return __res;
13680}
13681
13682static __inline__ vector unsigned short __ATTRS_o_ai
13683vec_promote(unsigned short __a, int __b) {
13684 vector unsigned short __res = (vector unsigned short)(0);
13685 __res[__b] = __a;
13686 return __res;
13687}
13688
13689static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
13690 vector int __res = (vector int)(0);
13691 __res[__b] = __a;
13692 return __res;
13693}
13694
13695static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
13696 int __b) {
13697 vector unsigned int __res = (vector unsigned int)(0);
13698 __res[__b] = __a;
13699 return __res;
13700}
13701
13702static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
13703 vector float __res = (vector float)(0);
13704 __res[__b] = __a;
13705 return __res;
13706}
13707
13708/* vec_splats */
13709
13710static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
13711 return (vector signed char)(__a);
13712}
13713
13714static __inline__ vector unsigned char __ATTRS_o_ai
13715vec_splats(unsigned char __a) {
13716 return (vector unsigned char)(__a);
13717}
13718
13719static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
13720 return (vector short)(__a);
13721}
13722
13723static __inline__ vector unsigned short __ATTRS_o_ai
13724vec_splats(unsigned short __a) {
13725 return (vector unsigned short)(__a);
13726}
13727
13728static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
13729 return (vector int)(__a);
13730}
13731
13732static __inline__ vector unsigned int __ATTRS_o_ai
13733vec_splats(unsigned int __a) {
13734 return (vector unsigned int)(__a);
13735}
13736
13737#ifdef __VSX__
13738static __inline__ vector signed long long __ATTRS_o_ai
13739vec_splats(signed long long __a) {
13740 return (vector signed long long)(__a);
13741}
13742
13743static __inline__ vector unsigned long long __ATTRS_o_ai
13744vec_splats(unsigned long long __a) {
13745 return (vector unsigned long long)(__a);
13746}
13747
13748#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
13749static __inline__ vector signed __int128 __ATTRS_o_ai
13750vec_splats(signed __int128 __a) {
13751 return (vector signed __int128)(__a);
13752}
13753
13754static __inline__ vector unsigned __int128 __ATTRS_o_ai
13755vec_splats(unsigned __int128 __a) {
13756 return (vector unsigned __int128)(__a);
13757}
13758
13759#endif
13760
13761static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
13762 return (vector double)(__a);
13763}
13764#endif
13765
13766static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
13767 return (vector float)(__a);
13768}
13769
13770/* ----------------------------- predicates --------------------------------- */
13771
13772/* vec_all_eq */
13773
13774static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13775 vector signed char __b) {
13776 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13777 (vector char)__b);
13778}
13779
13780static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
13781 vector bool char __b) {
13782 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13783 (vector char)__b);
13784}
13785
13786static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13787 vector unsigned char __b) {
13788 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13789 (vector char)__b);
13790}
13791
13792static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
13793 vector bool char __b) {
13794 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13795 (vector char)__b);
13796}
13797
13798static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13799 vector signed char __b) {
13800 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13801 (vector char)__b);
13802}
13803
13804static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13805 vector unsigned char __b) {
13806 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13807 (vector char)__b);
13808}
13809
13810static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
13811 vector bool char __b) {
13812 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
13813 (vector char)__b);
13814}
13815
13816static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13817 vector short __b) {
13818 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
13819}
13820
13821static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
13822 vector bool short __b) {
13823 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
13824}
13825
13826static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13827 vector unsigned short __b) {
13828 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13829 (vector short)__b);
13830}
13831
13832static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
13833 vector bool short __b) {
13834 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13835 (vector short)__b);
13836}
13837
13838static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13839 vector short __b) {
13840 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13841 (vector short)__b);
13842}
13843
13844static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13845 vector unsigned short __b) {
13846 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13847 (vector short)__b);
13848}
13849
13850static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
13851 vector bool short __b) {
13852 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13853 (vector short)__b);
13854}
13855
13856static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
13857 vector pixel __b) {
13858 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
13859 (vector short)__b);
13860}
13861
13862static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
13863 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
13864}
13865
13866static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
13867 vector bool int __b) {
13868 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
13869}
13870
13871static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13872 vector unsigned int __b) {
13873 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13874 (vector int)__b);
13875}
13876
13877static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
13878 vector bool int __b) {
13879 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13880 (vector int)__b);
13881}
13882
13883static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13884 vector int __b) {
13885 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13886 (vector int)__b);
13887}
13888
13889static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13890 vector unsigned int __b) {
13891 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13892 (vector int)__b);
13893}
13894
13895static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
13896 vector bool int __b) {
13897 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
13898 (vector int)__b);
13899}
13900
13901#ifdef __POWER8_VECTOR__
13902static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
13903 vector signed long long __b) {
13904 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
13905}
13906
13907static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
13908 vector bool long long __b) {
13909 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
13910}
13911
13912static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13913 vector unsigned long long __b) {
13914 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13915 (vector long long)__b);
13916}
13917
13918static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
13919 vector bool long long __b) {
13920 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13921 (vector long long)__b);
13922}
13923
13924static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13925 vector long long __b) {
13926 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13927 (vector long long)__b);
13928}
13929
13930static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13931 vector unsigned long long __b) {
13932 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13933 (vector long long)__b);
13934}
13935
13936static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
13937 vector bool long long __b) {
13938 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
13939 (vector long long)__b);
13940}
13941#endif
13942
13943static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
13944 vector float __b) {
13945#ifdef __VSX__
13946 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
13947#else
13948 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
13949#endif
13950}
13951
13952#ifdef __VSX__
13953static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
13954 vector double __b) {
13955 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
13956}
13957#endif
13958
13959/* vec_all_ge */
13960
13961static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13962 vector signed char __b) {
13963 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
13964}
13965
13966static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
13967 vector bool char __b) {
13968 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
13969}
13970
13971static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13972 vector unsigned char __b) {
13973 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
13974}
13975
13976static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
13977 vector bool char __b) {
13978 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
13979}
13980
13981static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13982 vector signed char __b) {
13983 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13984 (vector unsigned char)__a);
13985}
13986
13987static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13988 vector unsigned char __b) {
13989 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
13990}
13991
13992static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
13993 vector bool char __b) {
13994 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
13995 (vector unsigned char)__a);
13996}
13997
13998static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
13999 vector short __b) {
14000 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
14001}
14002
14003static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
14004 vector bool short __b) {
14005 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
14006}
14007
14008static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14009 vector unsigned short __b) {
14010 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
14011}
14012
14013static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
14014 vector bool short __b) {
14015 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14016 __a);
14017}
14018
14019static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14020 vector short __b) {
14021 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14022 (vector unsigned short)__a);
14023}
14024
14025static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14026 vector unsigned short __b) {
14027 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
14028 (vector unsigned short)__a);
14029}
14030
14031static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
14032 vector bool short __b) {
14033 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
14034 (vector unsigned short)__a);
14035}
14036
14037static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
14038 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
14039}
14040
14041static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
14042 vector bool int __b) {
14043 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
14044}
14045
14046static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14047 vector unsigned int __b) {
14048 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
14049}
14050
14051static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
14052 vector bool int __b) {
14053 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
14054}
14055
14056static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14057 vector int __b) {
14058 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14059 (vector unsigned int)__a);
14060}
14061
14062static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14063 vector unsigned int __b) {
14064 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
14065}
14066
14067static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
14068 vector bool int __b) {
14069 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
14070 (vector unsigned int)__a);
14071}
14072
14073#ifdef __POWER8_VECTOR__
14074static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14075 vector signed long long __b) {
14076 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
14077}
14078static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
14079 vector bool long long __b) {
14080 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
14081 __a);
14082}
14083
14084static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14085 vector unsigned long long __b) {
14086 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
14087}
14088
14089static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
14090 vector bool long long __b) {
14091 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14092 __a);
14093}
14094
14095static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14096 vector signed long long __b) {
14097 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14098 (vector unsigned long long)__a);
14099}
14100
14101static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14102 vector unsigned long long __b) {
14103 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
14104 (vector unsigned long long)__a);
14105}
14106
14107static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
14108 vector bool long long __b) {
14109 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
14110 (vector unsigned long long)__a);
14111}
14112#endif
14113
14114static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
14115 vector float __b) {
14116#ifdef __VSX__
14117 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
14118#else
14119 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
14120#endif
14121}
14122
14123#ifdef __VSX__
14124static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
14125 vector double __b) {
14126 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
14127}
14128#endif
14129
14130/* vec_all_gt */
14131
14132static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14133 vector signed char __b) {
14134 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
14135}
14136
14137static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
14138 vector bool char __b) {
14139 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
14140}
14141
14142static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14143 vector unsigned char __b) {
14144 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
14145}
14146
14147static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
14148 vector bool char __b) {
14149 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
14150}
14151
14152static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14153 vector signed char __b) {
14154 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14155 (vector unsigned char)__b);
14156}
14157
14158static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14159 vector unsigned char __b) {
14160 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
14161}
14162
14163static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
14164 vector bool char __b) {
14165 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
14166 (vector unsigned char)__b);
14167}
14168
14169static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14170 vector short __b) {
14171 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
14172}
14173
14174static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
14175 vector bool short __b) {
14176 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
14177}
14178
14179static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14180 vector unsigned short __b) {
14181 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
14182}
14183
14184static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
14185 vector bool short __b) {
14186 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
14187 (vector unsigned short)__b);
14188}
14189
14190static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14191 vector short __b) {
14192 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14193 (vector unsigned short)__b);
14194}
14195
14196static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14197 vector unsigned short __b) {
14198 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14199 __b);
14200}
14201
14202static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
14203 vector bool short __b) {
14204 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
14205 (vector unsigned short)__b);
14206}
14207
14208static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
14209 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
14210}
14211
14212static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
14213 vector bool int __b) {
14214 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
14215}
14216
14217static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14218 vector unsigned int __b) {
14219 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
14220}
14221
14222static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
14223 vector bool int __b) {
14224 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
14225}
14226
14227static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14228 vector int __b) {
14229 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14230 (vector unsigned int)__b);
14231}
14232
14233static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14234 vector unsigned int __b) {
14235 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
14236}
14237
14238static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
14239 vector bool int __b) {
14240 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
14241 (vector unsigned int)__b);
14242}
14243
14244#ifdef __POWER8_VECTOR__
14245static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14246 vector signed long long __b) {
14247 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
14248}
14249static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
14250 vector bool long long __b) {
14251 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
14252 (vector signed long long)__b);
14253}
14254
14255static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14256 vector unsigned long long __b) {
14257 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
14258}
14259
14260static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
14261 vector bool long long __b) {
14262 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
14263 (vector unsigned long long)__b);
14264}
14265
14266static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14267 vector signed long long __b) {
14268 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14269 (vector unsigned long long)__b);
14270}
14271
14272static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14273 vector unsigned long long __b) {
14274 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14275 __b);
14276}
14277
14278static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
14279 vector bool long long __b) {
14280 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
14281 (vector unsigned long long)__b);
14282}
14283#endif
14284
14285static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
14286 vector float __b) {
14287#ifdef __VSX__
14288 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
14289#else
14290 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
14291#endif
14292}
14293
14294#ifdef __VSX__
14295static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
14296 vector double __b) {
14297 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
14298}
14299#endif
14300
14301/* vec_all_in */
14302
14303static __inline__ int __attribute__((__always_inline__))
14304vec_all_in(vector float __a, vector float __b) {
14305 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
14306}
14307
14308/* vec_all_le */
14309
14310static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14311 vector signed char __b) {
14312 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
14313}
14314
14315static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
14316 vector bool char __b) {
14317 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
14318}
14319
14320static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14321 vector unsigned char __b) {
14322 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
14323}
14324
14325static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
14326 vector bool char __b) {
14327 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
14328}
14329
14330static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14331 vector signed char __b) {
14332 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14333 (vector unsigned char)__b);
14334}
14335
14336static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14337 vector unsigned char __b) {
14338 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
14339}
14340
14341static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
14342 vector bool char __b) {
14343 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
14344 (vector unsigned char)__b);
14345}
14346
14347static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14348 vector short __b) {
14349 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
14350}
14351
14352static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
14353 vector bool short __b) {
14354 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
14355}
14356
14357static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14358 vector unsigned short __b) {
14359 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
14360}
14361
14362static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
14363 vector bool short __b) {
14364 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
14365 (vector unsigned short)__b);
14366}
14367
14368static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14369 vector short __b) {
14370 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14371 (vector unsigned short)__b);
14372}
14373
14374static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14375 vector unsigned short __b) {
14376 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14377 __b);
14378}
14379
14380static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
14381 vector bool short __b) {
14382 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
14383 (vector unsigned short)__b);
14384}
14385
14386static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
14387 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
14388}
14389
14390static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
14391 vector bool int __b) {
14392 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
14393}
14394
14395static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14396 vector unsigned int __b) {
14397 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
14398}
14399
14400static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
14401 vector bool int __b) {
14402 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
14403}
14404
14405static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14406 vector int __b) {
14407 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14408 (vector unsigned int)__b);
14409}
14410
14411static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14412 vector unsigned int __b) {
14413 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
14414}
14415
14416static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
14417 vector bool int __b) {
14418 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
14419 (vector unsigned int)__b);
14420}
14421
14422#ifdef __POWER8_VECTOR__
14423static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14424 vector signed long long __b) {
14425 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
14426}
14427
14428static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14429 vector unsigned long long __b) {
14430 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
14431}
14432
14433static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
14434 vector bool long long __b) {
14435 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
14436 (vector signed long long)__b);
14437}
14438
14439static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
14440 vector bool long long __b) {
14441 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
14442 (vector unsigned long long)__b);
14443}
14444
14445static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14446 vector signed long long __b) {
14447 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14448 (vector unsigned long long)__b);
14449}
14450
14451static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14452 vector unsigned long long __b) {
14453 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14454 __b);
14455}
14456
14457static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
14458 vector bool long long __b) {
14459 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
14460 (vector unsigned long long)__b);
14461}
14462#endif
14463
14464static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
14465 vector float __b) {
14466#ifdef __VSX__
14467 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
14468#else
14469 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
14470#endif
14471}
14472
14473#ifdef __VSX__
14474static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
14475 vector double __b) {
14476 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
14477}
14478#endif
14479
14480/* vec_all_lt */
14481
14482static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14483 vector signed char __b) {
14484 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
14485}
14486
14487static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
14488 vector bool char __b) {
14489 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
14490}
14491
14492static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14493 vector unsigned char __b) {
14494 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
14495}
14496
14497static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
14498 vector bool char __b) {
14499 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
14500}
14501
14502static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14503 vector signed char __b) {
14504 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14505 (vector unsigned char)__a);
14506}
14507
14508static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14509 vector unsigned char __b) {
14510 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
14511}
14512
14513static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
14514 vector bool char __b) {
14515 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
14516 (vector unsigned char)__a);
14517}
14518
14519static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14520 vector short __b) {
14521 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
14522}
14523
14524static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
14525 vector bool short __b) {
14526 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
14527}
14528
14529static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14530 vector unsigned short __b) {
14531 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
14532}
14533
14534static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
14535 vector bool short __b) {
14536 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14537 __a);
14538}
14539
14540static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14541 vector short __b) {
14542 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14543 (vector unsigned short)__a);
14544}
14545
14546static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14547 vector unsigned short __b) {
14548 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
14549 (vector unsigned short)__a);
14550}
14551
14552static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
14553 vector bool short __b) {
14554 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
14555 (vector unsigned short)__a);
14556}
14557
14558static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
14559 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
14560}
14561
14562static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
14563 vector bool int __b) {
14564 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
14565}
14566
14567static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14568 vector unsigned int __b) {
14569 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
14570}
14571
14572static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
14573 vector bool int __b) {
14574 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
14575}
14576
14577static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14578 vector int __b) {
14579 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14580 (vector unsigned int)__a);
14581}
14582
14583static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14584 vector unsigned int __b) {
14585 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
14586}
14587
14588static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
14589 vector bool int __b) {
14590 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
14591 (vector unsigned int)__a);
14592}
14593
14594#ifdef __POWER8_VECTOR__
14595static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14596 vector signed long long __b) {
14597 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
14598}
14599
14600static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14601 vector unsigned long long __b) {
14602 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
14603}
14604
14605static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
14606 vector bool long long __b) {
14607 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
14608 __a);
14609}
14610
14611static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
14612 vector bool long long __b) {
14613 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14614 __a);
14615}
14616
14617static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14618 vector signed long long __b) {
14619 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14620 (vector unsigned long long)__a);
14621}
14622
14623static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14624 vector unsigned long long __b) {
14625 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
14626 (vector unsigned long long)__a);
14627}
14628
14629static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
14630 vector bool long long __b) {
14631 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
14632 (vector unsigned long long)__a);
14633}
14634#endif
14635
14636static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
14637 vector float __b) {
14638#ifdef __VSX__
14639 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
14640#else
14641 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
14642#endif
14643}
14644
14645#ifdef __VSX__
14646static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
14647 vector double __b) {
14648 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
14649}
14650#endif
14651
14652/* vec_all_nan */
14653
14654static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
14655#ifdef __VSX__
14656 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
14657#else
14658 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
14659#endif
14660}
14661
14662#ifdef __VSX__
14663static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
14664 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
14665}
14666#endif
14667
14668/* vec_all_ne */
14669
14670static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14671 vector signed char __b) {
14672 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14673 (vector char)__b);
14674}
14675
14676static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
14677 vector bool char __b) {
14678 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14679 (vector char)__b);
14680}
14681
14682static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14683 vector unsigned char __b) {
14684 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14685 (vector char)__b);
14686}
14687
14688static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
14689 vector bool char __b) {
14690 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14691 (vector char)__b);
14692}
14693
14694static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14695 vector signed char __b) {
14696 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14697 (vector char)__b);
14698}
14699
14700static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14701 vector unsigned char __b) {
14702 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14703 (vector char)__b);
14704}
14705
14706static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
14707 vector bool char __b) {
14708 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
14709 (vector char)__b);
14710}
14711
14712static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14713 vector short __b) {
14714 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
14715}
14716
14717static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
14718 vector bool short __b) {
14719 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
14720}
14721
14722static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14723 vector unsigned short __b) {
14724 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14725 (vector short)__b);
14726}
14727
14728static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
14729 vector bool short __b) {
14730 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14731 (vector short)__b);
14732}
14733
14734static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14735 vector short __b) {
14736 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14737 (vector short)__b);
14738}
14739
14740static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14741 vector unsigned short __b) {
14742 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14743 (vector short)__b);
14744}
14745
14746static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
14747 vector bool short __b) {
14748 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14749 (vector short)__b);
14750}
14751
14752static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
14753 vector pixel __b) {
14754 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
14755 (vector short)__b);
14756}
14757
14758static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
14759 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
14760}
14761
14762static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
14763 vector bool int __b) {
14764 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
14765}
14766
14767static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14768 vector unsigned int __b) {
14769 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14770 (vector int)__b);
14771}
14772
14773static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
14774 vector bool int __b) {
14775 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14776 (vector int)__b);
14777}
14778
14779static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14780 vector int __b) {
14781 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14782 (vector int)__b);
14783}
14784
14785static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14786 vector unsigned int __b) {
14787 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14788 (vector int)__b);
14789}
14790
14791static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
14792 vector bool int __b) {
14793 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
14794 (vector int)__b);
14795}
14796
14797#ifdef __POWER8_VECTOR__
14798static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14799 vector signed long long __b) {
14800 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
14801}
14802
14803static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14804 vector unsigned long long __b) {
14805 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
14806 (vector long long)__b);
14807}
14808
14809static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
14810 vector bool long long __b) {
14811 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
14812 (vector signed long long)__b);
14813}
14814
14815static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
14816 vector bool long long __b) {
14817 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14818 (vector signed long long)__b);
14819}
14820
14821static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14822 vector signed long long __b) {
14823 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14824 (vector signed long long)__b);
14825}
14826
14827static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14828 vector unsigned long long __b) {
14829 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14830 (vector signed long long)__b);
14831}
14832
14833static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
14834 vector bool long long __b) {
14835 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
14836 (vector signed long long)__b);
14837}
14838#endif
14839
14840static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
14841 vector float __b) {
14842#ifdef __VSX__
14843 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __b);
14844#else
14845 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
14846#endif
14847}
14848
14849#ifdef __VSX__
14850static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
14851 vector double __b) {
14852 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
14853}
14854#endif
14855
14856/* vec_all_nge */
14857
14858static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
14859 vector float __b) {
14860#ifdef __VSX__
14861 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
14862#else
14863 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
14864#endif
14865}
14866
14867#ifdef __VSX__
14868static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
14869 vector double __b) {
14870 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
14871}
14872#endif
14873
14874/* vec_all_ngt */
14875
14876static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
14877 vector float __b) {
14878#ifdef __VSX__
14879 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
14880#else
14881 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
14882#endif
14883}
14884
14885#ifdef __VSX__
14886static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
14887 vector double __b) {
14888 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
14889}
14890#endif
14891
14892/* vec_all_nle */
14893
14894static __inline__ int __attribute__((__always_inline__))
14895vec_all_nle(vector float __a, vector float __b) {
14896 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
14897}
14898
14899/* vec_all_nlt */
14900
14901static __inline__ int __attribute__((__always_inline__))
14902vec_all_nlt(vector float __a, vector float __b) {
14903 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
14904}
14905
14906/* vec_all_numeric */
14907
14908static __inline__ int __attribute__((__always_inline__))
14909vec_all_numeric(vector float __a) {
14910 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
14911}
14912
14913/* vec_any_eq */
14914
14915static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14916 vector signed char __b) {
14917 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14918 (vector char)__b);
14919}
14920
14921static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
14922 vector bool char __b) {
14923 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14924 (vector char)__b);
14925}
14926
14927static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14928 vector unsigned char __b) {
14929 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14930 (vector char)__b);
14931}
14932
14933static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
14934 vector bool char __b) {
14935 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14936 (vector char)__b);
14937}
14938
14939static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14940 vector signed char __b) {
14941 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14942 (vector char)__b);
14943}
14944
14945static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14946 vector unsigned char __b) {
14947 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14948 (vector char)__b);
14949}
14950
14951static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
14952 vector bool char __b) {
14953 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
14954 (vector char)__b);
14955}
14956
14957static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14958 vector short __b) {
14959 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
14960}
14961
14962static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
14963 vector bool short __b) {
14964 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
14965}
14966
14967static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14968 vector unsigned short __b) {
14969 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14970 (vector short)__b);
14971}
14972
14973static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
14974 vector bool short __b) {
14975 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14976 (vector short)__b);
14977}
14978
14979static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14980 vector short __b) {
14981 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14982 (vector short)__b);
14983}
14984
14985static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14986 vector unsigned short __b) {
14987 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14988 (vector short)__b);
14989}
14990
14991static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
14992 vector bool short __b) {
14993 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
14994 (vector short)__b);
14995}
14996
14997static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
14998 vector pixel __b) {
14999 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
15000 (vector short)__b);
15001}
15002
15003static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
15004 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
15005}
15006
15007static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
15008 vector bool int __b) {
15009 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
15010}
15011
15012static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
15013 vector unsigned int __b) {
15014 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15015 (vector int)__b);
15016}
15017
15018static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
15019 vector bool int __b) {
15020 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15021 (vector int)__b);
15022}
15023
15024static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15025 vector int __b) {
15026 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15027 (vector int)__b);
15028}
15029
15030static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15031 vector unsigned int __b) {
15032 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15033 (vector int)__b);
15034}
15035
15036static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
15037 vector bool int __b) {
15038 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
15039 (vector int)__b);
15040}
15041
15042#ifdef __POWER8_VECTOR__
15043static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15044 vector signed long long __b) {
15045 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
15046}
15047
15048static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15049 vector unsigned long long __b) {
15050 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
15051 (vector long long)__b);
15052}
15053
15054static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
15055 vector bool long long __b) {
15056 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
15057 (vector signed long long)__b);
15058}
15059
15060static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
15061 vector bool long long __b) {
15062 return __builtin_altivec_vcmpequd_p(
15063 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15064}
15065
15066static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15067 vector signed long long __b) {
15068 return __builtin_altivec_vcmpequd_p(
15069 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15070}
15071
15072static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15073 vector unsigned long long __b) {
15074 return __builtin_altivec_vcmpequd_p(
15075 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15076}
15077
15078static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
15079 vector bool long long __b) {
15080 return __builtin_altivec_vcmpequd_p(
15081 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
15082}
15083#endif
15084
15085static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
15086 vector float __b) {
15087#ifdef __VSX__
15088 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
15089#else
15090 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
15091#endif
15092}
15093
15094#ifdef __VSX__
15095static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
15096 vector double __b) {
15097 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
15098}
15099#endif
15100
15101/* vec_any_ge */
15102
15103static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15104 vector signed char __b) {
15105 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
15106}
15107
15108static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
15109 vector bool char __b) {
15110 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
15111 __a);
15112}
15113
15114static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15115 vector unsigned char __b) {
15116 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
15117}
15118
15119static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
15120 vector bool char __b) {
15121 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15122 __a);
15123}
15124
15125static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15126 vector signed char __b) {
15127 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15128 (vector unsigned char)__a);
15129}
15130
15131static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15132 vector unsigned char __b) {
15133 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
15134 (vector unsigned char)__a);
15135}
15136
15137static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
15138 vector bool char __b) {
15139 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
15140 (vector unsigned char)__a);
15141}
15142
15143static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15144 vector short __b) {
15145 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
15146}
15147
15148static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
15149 vector bool short __b) {
15150 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
15151}
15152
15153static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15154 vector unsigned short __b) {
15155 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
15156}
15157
15158static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
15159 vector bool short __b) {
15160 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15161 __a);
15162}
15163
15164static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15165 vector short __b) {
15166 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15167 (vector unsigned short)__a);
15168}
15169
15170static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15171 vector unsigned short __b) {
15172 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
15173 (vector unsigned short)__a);
15174}
15175
15176static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
15177 vector bool short __b) {
15178 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
15179 (vector unsigned short)__a);
15180}
15181
15182static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
15183 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
15184}
15185
15186static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
15187 vector bool int __b) {
15188 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
15189}
15190
15191static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15192 vector unsigned int __b) {
15193 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
15194}
15195
15196static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
15197 vector bool int __b) {
15198 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15199 __a);
15200}
15201
15202static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15203 vector int __b) {
15204 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15205 (vector unsigned int)__a);
15206}
15207
15208static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15209 vector unsigned int __b) {
15210 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
15211 (vector unsigned int)__a);
15212}
15213
15214static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
15215 vector bool int __b) {
15216 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
15217 (vector unsigned int)__a);
15218}
15219
15220#ifdef __POWER8_VECTOR__
15221static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15222 vector signed long long __b) {
15223 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
15224}
15225
15226static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15227 vector unsigned long long __b) {
15228 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
15229}
15230
15231static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
15232 vector bool long long __b) {
15233 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
15234 (vector signed long long)__b, __a);
15235}
15236
15237static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
15238 vector bool long long __b) {
15239 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15240 (vector unsigned long long)__b, __a);
15241}
15242
15243static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15244 vector signed long long __b) {
15245 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15246 (vector unsigned long long)__b,
15247 (vector unsigned long long)__a);
15248}
15249
15250static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15251 vector unsigned long long __b) {
15252 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
15253 (vector unsigned long long)__a);
15254}
15255
15256static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
15257 vector bool long long __b) {
15258 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15259 (vector unsigned long long)__b,
15260 (vector unsigned long long)__a);
15261}
15262#endif
15263
15264static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
15265 vector float __b) {
15266#ifdef __VSX__
15267 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
15268#else
15269 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
15270#endif
15271}
15272
15273#ifdef __VSX__
15274static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
15275 vector double __b) {
15276 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
15277}
15278#endif
15279
15280/* vec_any_gt */
15281
15282static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15283 vector signed char __b) {
15284 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
15285}
15286
15287static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
15288 vector bool char __b) {
15289 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
15290 (vector signed char)__b);
15291}
15292
15293static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15294 vector unsigned char __b) {
15295 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
15296}
15297
15298static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
15299 vector bool char __b) {
15300 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
15301 (vector unsigned char)__b);
15302}
15303
15304static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15305 vector signed char __b) {
15306 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15307 (vector unsigned char)__b);
15308}
15309
15310static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15311 vector unsigned char __b) {
15312 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15313 __b);
15314}
15315
15316static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
15317 vector bool char __b) {
15318 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
15319 (vector unsigned char)__b);
15320}
15321
15322static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15323 vector short __b) {
15324 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
15325}
15326
15327static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
15328 vector bool short __b) {
15329 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
15330}
15331
15332static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15333 vector unsigned short __b) {
15334 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
15335}
15336
15337static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
15338 vector bool short __b) {
15339 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
15340 (vector unsigned short)__b);
15341}
15342
15343static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15344 vector short __b) {
15345 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15346 (vector unsigned short)__b);
15347}
15348
15349static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15350 vector unsigned short __b) {
15351 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15352 __b);
15353}
15354
15355static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
15356 vector bool short __b) {
15357 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
15358 (vector unsigned short)__b);
15359}
15360
15361static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
15362 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
15363}
15364
15365static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
15366 vector bool int __b) {
15367 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
15368}
15369
15370static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15371 vector unsigned int __b) {
15372 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
15373}
15374
15375static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
15376 vector bool int __b) {
15377 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
15378 (vector unsigned int)__b);
15379}
15380
15381static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15382 vector int __b) {
15383 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15384 (vector unsigned int)__b);
15385}
15386
15387static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15388 vector unsigned int __b) {
15389 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15390 __b);
15391}
15392
15393static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
15394 vector bool int __b) {
15395 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
15396 (vector unsigned int)__b);
15397}
15398
15399#ifdef __POWER8_VECTOR__
15400static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15401 vector signed long long __b) {
15402 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
15403}
15404
15405static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15406 vector unsigned long long __b) {
15407 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
15408}
15409
15410static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
15411 vector bool long long __b) {
15412 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
15413 (vector signed long long)__b);
15414}
15415
15416static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
15417 vector bool long long __b) {
15418 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
15419 (vector unsigned long long)__b);
15420}
15421
15422static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15423 vector signed long long __b) {
15424 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15425 (vector unsigned long long)__a,
15426 (vector unsigned long long)__b);
15427}
15428
15429static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15430 vector unsigned long long __b) {
15431 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15432 (vector unsigned long long)__a, __b);
15433}
15434
15435static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
15436 vector bool long long __b) {
15437 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15438 (vector unsigned long long)__a,
15439 (vector unsigned long long)__b);
15440}
15441#endif
15442
15443static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
15444 vector float __b) {
15445#ifdef __VSX__
15446 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
15447#else
15448 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
15449#endif
15450}
15451
15452#ifdef __VSX__
15453static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
15454 vector double __b) {
15455 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
15456}
15457#endif
15458
15459/* vec_any_le */
15460
15461static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15462 vector signed char __b) {
15463 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
15464}
15465
15466static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
15467 vector bool char __b) {
15468 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
15469 (vector signed char)__b);
15470}
15471
15472static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15473 vector unsigned char __b) {
15474 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
15475}
15476
15477static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
15478 vector bool char __b) {
15479 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
15480 (vector unsigned char)__b);
15481}
15482
15483static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15484 vector signed char __b) {
15485 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15486 (vector unsigned char)__b);
15487}
15488
15489static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15490 vector unsigned char __b) {
15491 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15492 __b);
15493}
15494
15495static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
15496 vector bool char __b) {
15497 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
15498 (vector unsigned char)__b);
15499}
15500
15501static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15502 vector short __b) {
15503 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
15504}
15505
15506static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
15507 vector bool short __b) {
15508 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
15509}
15510
15511static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15512 vector unsigned short __b) {
15513 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
15514}
15515
15516static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
15517 vector bool short __b) {
15518 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
15519 (vector unsigned short)__b);
15520}
15521
15522static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15523 vector short __b) {
15524 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15525 (vector unsigned short)__b);
15526}
15527
15528static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15529 vector unsigned short __b) {
15530 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15531 __b);
15532}
15533
15534static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
15535 vector bool short __b) {
15536 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
15537 (vector unsigned short)__b);
15538}
15539
15540static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
15541 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
15542}
15543
15544static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
15545 vector bool int __b) {
15546 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
15547}
15548
15549static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15550 vector unsigned int __b) {
15551 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
15552}
15553
15554static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
15555 vector bool int __b) {
15556 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
15557 (vector unsigned int)__b);
15558}
15559
15560static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15561 vector int __b) {
15562 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15563 (vector unsigned int)__b);
15564}
15565
15566static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15567 vector unsigned int __b) {
15568 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15569 __b);
15570}
15571
15572static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
15573 vector bool int __b) {
15574 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
15575 (vector unsigned int)__b);
15576}
15577
15578#ifdef __POWER8_VECTOR__
15579static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15580 vector signed long long __b) {
15581 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
15582}
15583
15584static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15585 vector unsigned long long __b) {
15586 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
15587}
15588
15589static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
15590 vector bool long long __b) {
15591 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
15592 (vector signed long long)__b);
15593}
15594
15595static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
15596 vector bool long long __b) {
15597 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
15598 (vector unsigned long long)__b);
15599}
15600
15601static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15602 vector signed long long __b) {
15603 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15604 (vector unsigned long long)__a,
15605 (vector unsigned long long)__b);
15606}
15607
15608static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15609 vector unsigned long long __b) {
15610 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15611 (vector unsigned long long)__a, __b);
15612}
15613
15614static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
15615 vector bool long long __b) {
15616 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
15617 (vector unsigned long long)__a,
15618 (vector unsigned long long)__b);
15619}
15620#endif
15621
15622static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
15623 vector float __b) {
15624#ifdef __VSX__
15625 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
15626#else
15627 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
15628#endif
15629}
15630
15631#ifdef __VSX__
15632static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
15633 vector double __b) {
15634 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
15635}
15636#endif
15637
15638/* vec_any_lt */
15639
15640static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15641 vector signed char __b) {
15642 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
15643}
15644
15645static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
15646 vector bool char __b) {
15647 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
15648 __a);
15649}
15650
15651static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15652 vector unsigned char __b) {
15653 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
15654}
15655
15656static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
15657 vector bool char __b) {
15658 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15659 __a);
15660}
15661
15662static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15663 vector signed char __b) {
15664 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15665 (vector unsigned char)__a);
15666}
15667
15668static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15669 vector unsigned char __b) {
15670 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
15671 (vector unsigned char)__a);
15672}
15673
15674static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
15675 vector bool char __b) {
15676 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
15677 (vector unsigned char)__a);
15678}
15679
15680static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15681 vector short __b) {
15682 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
15683}
15684
15685static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
15686 vector bool short __b) {
15687 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
15688}
15689
15690static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15691 vector unsigned short __b) {
15692 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
15693}
15694
15695static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
15696 vector bool short __b) {
15697 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15698 __a);
15699}
15700
15701static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15702 vector short __b) {
15703 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15704 (vector unsigned short)__a);
15705}
15706
15707static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15708 vector unsigned short __b) {
15709 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
15710 (vector unsigned short)__a);
15711}
15712
15713static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
15714 vector bool short __b) {
15715 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
15716 (vector unsigned short)__a);
15717}
15718
15719static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
15720 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
15721}
15722
15723static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
15724 vector bool int __b) {
15725 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
15726}
15727
15728static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15729 vector unsigned int __b) {
15730 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
15731}
15732
15733static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
15734 vector bool int __b) {
15735 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15736 __a);
15737}
15738
15739static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15740 vector int __b) {
15741 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15742 (vector unsigned int)__a);
15743}
15744
15745static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15746 vector unsigned int __b) {
15747 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
15748 (vector unsigned int)__a);
15749}
15750
15751static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
15752 vector bool int __b) {
15753 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
15754 (vector unsigned int)__a);
15755}
15756
15757#ifdef __POWER8_VECTOR__
15758static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15759 vector signed long long __b) {
15760 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
15761}
15762
15763static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15764 vector unsigned long long __b) {
15765 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
15766}
15767
15768static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
15769 vector bool long long __b) {
15770 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
15771 (vector signed long long)__b, __a);
15772}
15773
15774static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
15775 vector bool long long __b) {
15776 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15777 (vector unsigned long long)__b, __a);
15778}
15779
15780static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15781 vector signed long long __b) {
15782 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15783 (vector unsigned long long)__b,
15784 (vector unsigned long long)__a);
15785}
15786
15787static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15788 vector unsigned long long __b) {
15789 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
15790 (vector unsigned long long)__a);
15791}
15792
15793static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
15794 vector bool long long __b) {
15795 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
15796 (vector unsigned long long)__b,
15797 (vector unsigned long long)__a);
15798}
15799#endif
15800
15801static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
15802 vector float __b) {
15803#ifdef __VSX__
15804 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
15805#else
15806 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
15807#endif
15808}
15809
15810#ifdef __VSX__
15811static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
15812 vector double __b) {
15813 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
15814}
15815#endif
15816
15817/* vec_any_nan */
15818
15819static __inline__ int __attribute__((__always_inline__))
15820vec_any_nan(vector float __a) {
15821 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
15822}
15823
15824/* vec_any_ne */
15825
15826static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15827 vector signed char __b) {
15828 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15829 (vector char)__b);
15830}
15831
15832static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
15833 vector bool char __b) {
15834 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15835 (vector char)__b);
15836}
15837
15838static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15839 vector unsigned char __b) {
15840 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15841 (vector char)__b);
15842}
15843
15844static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
15845 vector bool char __b) {
15846 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15847 (vector char)__b);
15848}
15849
15850static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15851 vector signed char __b) {
15852 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15853 (vector char)__b);
15854}
15855
15856static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15857 vector unsigned char __b) {
15858 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15859 (vector char)__b);
15860}
15861
15862static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
15863 vector bool char __b) {
15864 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
15865 (vector char)__b);
15866}
15867
15868static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15869 vector short __b) {
15870 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
15871}
15872
15873static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
15874 vector bool short __b) {
15875 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
15876}
15877
15878static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15879 vector unsigned short __b) {
15880 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15881 (vector short)__b);
15882}
15883
15884static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
15885 vector bool short __b) {
15886 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15887 (vector short)__b);
15888}
15889
15890static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15891 vector short __b) {
15892 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15893 (vector short)__b);
15894}
15895
15896static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15897 vector unsigned short __b) {
15898 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15899 (vector short)__b);
15900}
15901
15902static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
15903 vector bool short __b) {
15904 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15905 (vector short)__b);
15906}
15907
15908static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
15909 vector pixel __b) {
15910 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
15911 (vector short)__b);
15912}
15913
15914static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
15915 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
15916}
15917
15918static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
15919 vector bool int __b) {
15920 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
15921}
15922
15923static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15924 vector unsigned int __b) {
15925 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15926 (vector int)__b);
15927}
15928
15929static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
15930 vector bool int __b) {
15931 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15932 (vector int)__b);
15933}
15934
15935static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15936 vector int __b) {
15937 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15938 (vector int)__b);
15939}
15940
15941static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15942 vector unsigned int __b) {
15943 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15944 (vector int)__b);
15945}
15946
15947static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
15948 vector bool int __b) {
15949 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
15950 (vector int)__b);
15951}
15952
15953#ifdef __POWER8_VECTOR__
15954static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15955 vector signed long long __b) {
15956 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
15957}
15958
15959static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15960 vector unsigned long long __b) {
15961 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
15962 (vector long long)__b);
15963}
15964
15965static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
15966 vector bool long long __b) {
15967 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
15968 (vector signed long long)__b);
15969}
15970
15971static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
15972 vector bool long long __b) {
15973 return __builtin_altivec_vcmpequd_p(
15974 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15975}
15976
15977static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15978 vector signed long long __b) {
15979 return __builtin_altivec_vcmpequd_p(
15980 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15981}
15982
15983static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15984 vector unsigned long long __b) {
15985 return __builtin_altivec_vcmpequd_p(
15986 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15987}
15988
15989static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
15990 vector bool long long __b) {
15991 return __builtin_altivec_vcmpequd_p(
15992 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
15993}
15994#endif
15995
15996static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
15997 vector float __b) {
15998#ifdef __VSX__
15999 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
16000#else
16001 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
16002#endif
16003}
16004
16005#ifdef __VSX__
16006static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
16007 vector double __b) {
16008 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
16009}
16010#endif
16011
16012/* vec_any_nge */
16013
16014static __inline__ int __attribute__((__always_inline__))
16015vec_any_nge(vector float __a, vector float __b) {
16016 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
16017}
16018
16019/* vec_any_ngt */
16020
16021static __inline__ int __attribute__((__always_inline__))
16022vec_any_ngt(vector float __a, vector float __b) {
16023 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
16024}
16025
16026/* vec_any_nle */
16027
16028static __inline__ int __attribute__((__always_inline__))
16029vec_any_nle(vector float __a, vector float __b) {
16030 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
16031}
16032
16033/* vec_any_nlt */
16034
16035static __inline__ int __attribute__((__always_inline__))
16036vec_any_nlt(vector float __a, vector float __b) {
16037 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
16038}
16039
16040/* vec_any_numeric */
16041
16042static __inline__ int __attribute__((__always_inline__))
16043vec_any_numeric(vector float __a) {
16044 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
16045}
16046
16047/* vec_any_out */
16048
16049static __inline__ int __attribute__((__always_inline__))
16050vec_any_out(vector float __a, vector float __b) {
16051 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
16052}
16053
16054/* Power 8 Crypto functions
16055Note: We diverge from the current GCC implementation with regard
16056to cryptography and related functions as follows:
16057- Only the SHA and AES instructions and builtins are disabled by -mno-crypto
16058- The remaining ones are only available on Power8 and up so
16059 require -mpower8-vector
16060The justification for this is that export requirements require that
16061Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
16062support). As a result, we need to be able to turn off support for those.
16063The remaining ones (currently controlled by -mcrypto for GCC) still
16064need to be provided on compliant hardware even if Vector.Crypto is not
16065provided.
16066*/
16067#ifdef __CRYPTO__
16068#define vec_sbox_be __builtin_altivec_crypto_vsbox
16069#define vec_cipher_be __builtin_altivec_crypto_vcipher
16070#define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
16071#define vec_ncipher_be __builtin_altivec_crypto_vncipher
16072#define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
16073
16074static __inline__ vector unsigned long long __attribute__((__always_inline__))
16075__builtin_crypto_vsbox(vector unsigned long long __a) {
16076 return __builtin_altivec_crypto_vsbox(__a);
16077}
16078
16079static __inline__ vector unsigned long long __attribute__((__always_inline__))
16080__builtin_crypto_vcipher(vector unsigned long long __a,
16081 vector unsigned long long __b) {
16082 return __builtin_altivec_crypto_vcipher(__a, __b);
16083}
16084
16085static __inline__ vector unsigned long long __attribute__((__always_inline__))
16086__builtin_crypto_vcipherlast(vector unsigned long long __a,
16087 vector unsigned long long __b) {
16088 return __builtin_altivec_crypto_vcipherlast(__a, __b);
16089}
16090
16091static __inline__ vector unsigned long long __attribute__((__always_inline__))
16092__builtin_crypto_vncipher(vector unsigned long long __a,
16093 vector unsigned long long __b) {
16094 return __builtin_altivec_crypto_vncipher(__a, __b);
16095}
16096
16097static __inline__ vector unsigned long long __attribute__((__always_inline__))
16098__builtin_crypto_vncipherlast(vector unsigned long long __a,
16099 vector unsigned long long __b) {
16100 return __builtin_altivec_crypto_vncipherlast(__a, __b);
16101}
16102
16103#define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
16104#define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
16105
16106#define vec_shasigma_be(X, Y, Z) \
16107 _Generic((X), vector unsigned int \
16108 : __builtin_crypto_vshasigmaw, vector unsigned long long \
16109 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
16110#endif
16111
16112#ifdef __POWER8_VECTOR__
16113static __inline__ vector bool char __ATTRS_o_ai
16114vec_permxor(vector bool char __a, vector bool char __b,
16115 vector bool char __c) {
16116 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16117}
16118
16119static __inline__ vector signed char __ATTRS_o_ai
16120vec_permxor(vector signed char __a, vector signed char __b,
16121 vector signed char __c) {
16122 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16123}
16124
16125static __inline__ vector unsigned char __ATTRS_o_ai
16126vec_permxor(vector unsigned char __a, vector unsigned char __b,
16127 vector unsigned char __c) {
16128 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16129}
16130
16131static __inline__ vector unsigned char __ATTRS_o_ai
16132__builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
16133 vector unsigned char __c) {
16134 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
16135}
16136
16137static __inline__ vector unsigned short __ATTRS_o_ai
16138__builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
16139 vector unsigned short __c) {
16140 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
16141 (vector unsigned char)__a, (vector unsigned char)__b,
16142 (vector unsigned char)__c);
16143}
16144
16145static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
16146 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
16147 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
16148 (vector unsigned char)__a, (vector unsigned char)__b,
16149 (vector unsigned char)__c);
16150}
16151
16152static __inline__ vector unsigned long long __ATTRS_o_ai
16153__builtin_crypto_vpermxor(vector unsigned long long __a,
16154 vector unsigned long long __b,
16155 vector unsigned long long __c) {
16156 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
16157 (vector unsigned char)__a, (vector unsigned char)__b,
16158 (vector unsigned char)__c);
16159}
16160
16161static __inline__ vector unsigned char __ATTRS_o_ai
16162__builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
16163 return __builtin_altivec_crypto_vpmsumb(__a, __b);
16164}
16165
16166static __inline__ vector unsigned short __ATTRS_o_ai
16167__builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
16168 return __builtin_altivec_crypto_vpmsumh(__a, __b);
16169}
16170
16171static __inline__ vector unsigned int __ATTRS_o_ai
16172__builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
16173 return __builtin_altivec_crypto_vpmsumw(__a, __b);
16174}
16175
16176static __inline__ vector unsigned long long __ATTRS_o_ai
16177__builtin_crypto_vpmsumb(vector unsigned long long __a,
16178 vector unsigned long long __b) {
16179 return __builtin_altivec_crypto_vpmsumd(__a, __b);
16180}
16181
16182static __inline__ vector signed char __ATTRS_o_ai
16183vec_vgbbd(vector signed char __a) {
16184 return __builtin_altivec_vgbbd((vector unsigned char)__a);
16185}
16186
16187#define vec_pmsum_be __builtin_crypto_vpmsumb
16188#define vec_gb __builtin_altivec_vgbbd
16189
16190static __inline__ vector unsigned char __ATTRS_o_ai
16191vec_vgbbd(vector unsigned char __a) {
16192 return __builtin_altivec_vgbbd(__a);
16193}
16194
16195static __inline__ vector long long __ATTRS_o_ai
16196vec_vbpermq(vector signed char __a, vector signed char __b) {
16197 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16198 (vector unsigned char)__b);
16199}
16200
16201static __inline__ vector long long __ATTRS_o_ai
16202vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
16203 return __builtin_altivec_vbpermq(__a, __b);
16204}
16205
16206#ifdef __powerpc64__
16207static __inline__ vector unsigned long long __attribute__((__always_inline__))
16208vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
16209 return __builtin_altivec_vbpermq((vector unsigned char)__a,
16210 (vector unsigned char)__b);
16211}
16212#endif
16213#endif
16214
16215
16216/* vec_reve */
16217
16218static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {
16219 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16220 5, 4, 3, 2, 1, 0);
16221}
16222
16223static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {
16224 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16225 5, 4, 3, 2, 1, 0);
16226}
16227
16228static inline __ATTRS_o_ai vector unsigned char
16229vec_reve(vector unsigned char __a) {
16230 return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,
16231 5, 4, 3, 2, 1, 0);
16232}
16233
16234static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {
16235 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16236}
16237
16238static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {
16239 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16240}
16241
16242static inline __ATTRS_o_ai vector unsigned int
16243vec_reve(vector unsigned int __a) {
16244 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16245}
16246
16247static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {
16248 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16249}
16250
16251static inline __ATTRS_o_ai vector signed short
16252vec_reve(vector signed short __a) {
16253 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16254}
16255
16256static inline __ATTRS_o_ai vector unsigned short
16257vec_reve(vector unsigned short __a) {
16258 return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);
16259}
16260
16261static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {
16262 return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);
16263}
16264
16265#ifdef __VSX__
16266static inline __ATTRS_o_ai vector bool long long
16267vec_reve(vector bool long long __a) {
16268 return __builtin_shufflevector(__a, __a, 1, 0);
16269}
16270
16271static inline __ATTRS_o_ai vector signed long long
16272vec_reve(vector signed long long __a) {
16273 return __builtin_shufflevector(__a, __a, 1, 0);
16274}
16275
16276static inline __ATTRS_o_ai vector unsigned long long
16277vec_reve(vector unsigned long long __a) {
16278 return __builtin_shufflevector(__a, __a, 1, 0);
16279}
16280
16281static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {
16282 return __builtin_shufflevector(__a, __a, 1, 0);
16283}
16284#endif
16285
16286/* vec_revb */
16287static __inline__ vector bool char __ATTRS_o_ai
16288vec_revb(vector bool char __a) {
16289 return __a;
16290}
16291
16292static __inline__ vector signed char __ATTRS_o_ai
16293vec_revb(vector signed char __a) {
16294 return __a;
16295}
16296
16297static __inline__ vector unsigned char __ATTRS_o_ai
16298vec_revb(vector unsigned char __a) {
16299 return __a;
16300}
16301
16302static __inline__ vector bool short __ATTRS_o_ai
16303vec_revb(vector bool short __a) {
16304 vector unsigned char __indices =
16305 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16306 return vec_perm(__a, __a, __indices);
16307}
16308
16309static __inline__ vector signed short __ATTRS_o_ai
16310vec_revb(vector signed short __a) {
16311 vector unsigned char __indices =
16312 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16313 return vec_perm(__a, __a, __indices);
16314}
16315
16316static __inline__ vector unsigned short __ATTRS_o_ai
16317vec_revb(vector unsigned short __a) {
16318 vector unsigned char __indices =
16319 { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };
16320 return vec_perm(__a, __a, __indices);
16321}
16322
16323static __inline__ vector bool int __ATTRS_o_ai
16324vec_revb(vector bool int __a) {
16325 vector unsigned char __indices =
16326 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16327 return vec_perm(__a, __a, __indices);
16328}
16329
16330static __inline__ vector signed int __ATTRS_o_ai
16331vec_revb(vector signed int __a) {
16332 vector unsigned char __indices =
16333 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16334 return vec_perm(__a, __a, __indices);
16335}
16336
16337static __inline__ vector unsigned int __ATTRS_o_ai
16338vec_revb(vector unsigned int __a) {
16339 vector unsigned char __indices =
16340 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16341 return vec_perm(__a, __a, __indices);
16342}
16343
16344static __inline__ vector float __ATTRS_o_ai
16345vec_revb(vector float __a) {
16346 vector unsigned char __indices =
16347 { 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };
16348 return vec_perm(__a, __a, __indices);
16349}
16350
16351#ifdef __VSX__
16352static __inline__ vector bool long long __ATTRS_o_ai
16353vec_revb(vector bool long long __a) {
16354 vector unsigned char __indices =
16355 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16356 return vec_perm(__a, __a, __indices);
16357}
16358
16359static __inline__ vector signed long long __ATTRS_o_ai
16360vec_revb(vector signed long long __a) {
16361 vector unsigned char __indices =
16362 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16363 return vec_perm(__a, __a, __indices);
16364}
16365
16366static __inline__ vector unsigned long long __ATTRS_o_ai
16367vec_revb(vector unsigned long long __a) {
16368 vector unsigned char __indices =
16369 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16370 return vec_perm(__a, __a, __indices);
16371}
16372
16373static __inline__ vector double __ATTRS_o_ai
16374vec_revb(vector double __a) {
16375 vector unsigned char __indices =
16376 { 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };
16377 return vec_perm(__a, __a, __indices);
16378}
16379#endif /* End __VSX__ */
16380
16381#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16382static __inline__ vector signed __int128 __ATTRS_o_ai
16383vec_revb(vector signed __int128 __a) {
16384 vector unsigned char __indices =
16385 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16386 return (vector signed __int128)vec_perm((vector signed int)__a,
16387 (vector signed int)__a,
16388 __indices);
16389}
16390
16391static __inline__ vector unsigned __int128 __ATTRS_o_ai
16392vec_revb(vector unsigned __int128 __a) {
16393 vector unsigned char __indices =
16394 { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
16395 return (vector unsigned __int128)vec_perm((vector signed int)__a,
16396 (vector signed int)__a,
16397 __indices);
16398}
16399#endif /* END __POWER8_VECTOR__ && __powerpc64__ */
16400
16401/* vec_xl */
16402
16403typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));
16404typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));
16405typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));
16406typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));
16407typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));
16408typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));
16409typedef vector float unaligned_vec_float __attribute__((aligned(1)));
16410
16411static inline __ATTRS_o_ai vector signed char vec_xl(signed long long __offset,
16412 const signed char *__ptr) {
16413 return *(unaligned_vec_schar *)(__ptr + __offset);
16414}
16415
16416static inline __ATTRS_o_ai vector unsigned char
16417vec_xl(signed long long __offset, const unsigned char *__ptr) {
16418 return *(unaligned_vec_uchar*)(__ptr + __offset);
16419}
16420
16421static inline __ATTRS_o_ai vector signed short vec_xl(signed long long __offset,
16422 const signed short *__ptr) {
16423 signed char *__addr = (signed char *)__ptr + __offset;
16424 return *(unaligned_vec_sshort *)__addr;
16425}
16426
16427static inline __ATTRS_o_ai vector unsigned short
16428vec_xl(signed long long __offset, const unsigned short *__ptr) {
16429 signed char *__addr = (signed char *)__ptr + __offset;
16430 return *(unaligned_vec_ushort *)__addr;
16431}
16432
16433static inline __ATTRS_o_ai vector signed int vec_xl(signed long long __offset,
16434 const signed int *__ptr) {
16435 signed char *__addr = (signed char *)__ptr + __offset;
16436 return *(unaligned_vec_sint *)__addr;
16437}
16438
16439static inline __ATTRS_o_ai vector unsigned int vec_xl(signed long long __offset,
16440 const unsigned int *__ptr) {
16441 signed char *__addr = (signed char *)__ptr + __offset;
16442 return *(unaligned_vec_uint *)__addr;
16443}
16444
16445static inline __ATTRS_o_ai vector float vec_xl(signed long long __offset,
16446 const float *__ptr) {
16447 signed char *__addr = (signed char *)__ptr + __offset;
16448 return *(unaligned_vec_float *)__addr;
16449}
16450
16451#ifdef __VSX__
16452typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));
16453typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));
16454typedef vector double unaligned_vec_double __attribute__((aligned(1)));
16455
16456static inline __ATTRS_o_ai vector signed long long
16457vec_xl(signed long long __offset, const signed long long *__ptr) {
16458 signed char *__addr = (signed char *)__ptr + __offset;
16459 return *(unaligned_vec_sll *)__addr;
16460}
16461
16462static inline __ATTRS_o_ai vector unsigned long long
16463vec_xl(signed long long __offset, const unsigned long long *__ptr) {
16464 signed char *__addr = (signed char *)__ptr + __offset;
16465 return *(unaligned_vec_ull *)__addr;
16466}
16467
16468static inline __ATTRS_o_ai vector double vec_xl(signed long long __offset,
16469 const double *__ptr) {
16470 signed char *__addr = (signed char *)__ptr + __offset;
16471 return *(unaligned_vec_double *)__addr;
16472}
16473#endif
16474
16475#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16476typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));
16477typedef vector unsigned __int128 unaligned_vec_ui128
16478 __attribute__((aligned(1)));
16479static inline __ATTRS_o_ai vector signed __int128
16480vec_xl(signed long long __offset, const signed __int128 *__ptr) {
16481 signed char *__addr = (signed char *)__ptr + __offset;
16482 return *(unaligned_vec_si128 *)__addr;
16483}
16484
16485static inline __ATTRS_o_ai vector unsigned __int128
16486vec_xl(signed long long __offset, const unsigned __int128 *__ptr) {
16487 signed char *__addr = (signed char *)__ptr + __offset;
16488 return *(unaligned_vec_ui128 *)__addr;
16489}
16490#endif
16491
16492/* vec_xl_be */
16493
16494#ifdef __LITTLE_ENDIAN__
16495static __inline__ vector signed char __ATTRS_o_ai
16496vec_xl_be(signed long long __offset, const signed char *__ptr) {
16497 vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16498 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16499 13, 12, 11, 10, 9, 8);
16500}
16501
16502static __inline__ vector unsigned char __ATTRS_o_ai
16503vec_xl_be(signed long long __offset, const unsigned char *__ptr) {
16504 vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16505 return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16506 13, 12, 11, 10, 9, 8);
16507}
16508
16509static __inline__ vector signed short __ATTRS_o_ai
16510vec_xl_be(signed long long __offset, const signed short *__ptr) {
16511 vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16512 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16513}
16514
16515static __inline__ vector unsigned short __ATTRS_o_ai
16516vec_xl_be(signed long long __offset, const unsigned short *__ptr) {
16517 vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16518 return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16519}
16520
16521static __inline__ vector signed int __ATTRS_o_ai
16522vec_xl_be(signed long long __offset, const signed int *__ptr) {
16523 return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16524}
16525
16526static __inline__ vector unsigned int __ATTRS_o_ai
16527vec_xl_be(signed long long __offset, const unsigned int *__ptr) {
16528 return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16529}
16530
16531static __inline__ vector float __ATTRS_o_ai
16532vec_xl_be(signed long long __offset, const float *__ptr) {
16533 return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);
16534}
16535
16536#ifdef __VSX__
16537static __inline__ vector signed long long __ATTRS_o_ai
16538vec_xl_be(signed long long __offset, const signed long long *__ptr) {
16539 return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16540}
16541
16542static __inline__ vector unsigned long long __ATTRS_o_ai
16543vec_xl_be(signed long long __offset, const unsigned long long *__ptr) {
16544 return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16545}
16546
16547static __inline__ vector double __ATTRS_o_ai
16548vec_xl_be(signed long long __offset, const double *__ptr) {
16549 return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);
16550}
16551#endif
16552
16553#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16554static __inline__ vector signed __int128 __ATTRS_o_ai
16555vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {
16556 return vec_xl(__offset, __ptr);
16557}
16558
16559static __inline__ vector unsigned __int128 __ATTRS_o_ai
16560vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {
16561 return vec_xl(__offset, __ptr);
16562}
16563#endif
16564#else
16565 #define vec_xl_be vec_xl
16566#endif
16567
16568/* vec_xst */
16569
16570static inline __ATTRS_o_ai void vec_xst(vector signed char __vec,
16571 signed long long __offset,
16572 signed char *__ptr) {
16573 *(unaligned_vec_schar *)(__ptr + __offset) = __vec;
16574}
16575
16576static inline __ATTRS_o_ai void vec_xst(vector unsigned char __vec,
16577 signed long long __offset,
16578 unsigned char *__ptr) {
16579 *(unaligned_vec_uchar *)(__ptr + __offset) = __vec;
16580}
16581
16582static inline __ATTRS_o_ai void vec_xst(vector signed short __vec,
16583 signed long long __offset,
16584 signed short *__ptr) {
16585 signed char *__addr = (signed char *)__ptr + __offset;
16586 *(unaligned_vec_sshort *)__addr = __vec;
16587}
16588
16589static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,
16590 signed long long __offset,
16591 unsigned short *__ptr) {
16592 signed char *__addr = (signed char *)__ptr + __offset;
16593 *(unaligned_vec_ushort *)__addr = __vec;
16594}
16595
16596static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,
16597 signed long long __offset,
16598 signed int *__ptr) {
16599 signed char *__addr = (signed char *)__ptr + __offset;
16600 *(unaligned_vec_sint *)__addr = __vec;
16601}
16602
16603static inline __ATTRS_o_ai void vec_xst(vector unsigned int __vec,
16604 signed long long __offset,
16605 unsigned int *__ptr) {
16606 signed char *__addr = (signed char *)__ptr + __offset;
16607 *(unaligned_vec_uint *)__addr = __vec;
16608}
16609
16610static inline __ATTRS_o_ai void vec_xst(vector float __vec,
16611 signed long long __offset,
16612 float *__ptr) {
16613 signed char *__addr = (signed char *)__ptr + __offset;
16614 *(unaligned_vec_float *)__addr = __vec;
16615}
16616
16617#ifdef __VSX__
16618static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,
16619 signed long long __offset,
16620 signed long long *__ptr) {
16621 signed char *__addr = (signed char *)__ptr + __offset;
16622 *(unaligned_vec_sll *)__addr = __vec;
16623}
16624
16625static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,
16626 signed long long __offset,
16627 unsigned long long *__ptr) {
16628 signed char *__addr = (signed char *)__ptr + __offset;
16629 *(unaligned_vec_ull *)__addr = __vec;
16630}
16631
16632static inline __ATTRS_o_ai void vec_xst(vector double __vec,
16633 signed long long __offset,
16634 double *__ptr) {
16635 signed char *__addr = (signed char *)__ptr + __offset;
16636 *(unaligned_vec_double *)__addr = __vec;
16637}
16638#endif
16639
16640#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16641static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,
16642 signed long long __offset,
16643 signed __int128 *__ptr) {
16644 signed char *__addr = (signed char *)__ptr + __offset;
16645 *(unaligned_vec_si128 *)__addr = __vec;
16646}
16647
16648static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,
16649 signed long long __offset,
16650 unsigned __int128 *__ptr) {
16651 signed char *__addr = (signed char *)__ptr + __offset;
16652 *(unaligned_vec_ui128 *)__addr = __vec;
16653}
16654#endif
16655
16656/* vec_xst_be */
16657
16658#ifdef __LITTLE_ENDIAN__
16659static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,
16660 signed long long __offset,
16661 signed char *__ptr) {
16662 vector signed char __tmp =
16663 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16664 13, 12, 11, 10, 9, 8);
16665 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16666 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16667}
16668
16669static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,
16670 signed long long __offset,
16671 unsigned char *__ptr) {
16672 vector unsigned char __tmp =
16673 __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,
16674 13, 12, 11, 10, 9, 8);
16675 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16676 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16677}
16678
16679static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,
16680 signed long long __offset,
16681 signed short *__ptr) {
16682 vector signed short __tmp =
16683 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16684 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16685 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16686}
16687
16688static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,
16689 signed long long __offset,
16690 unsigned short *__ptr) {
16691 vector unsigned short __tmp =
16692 __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);
16693 typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;
16694 __builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);
16695}
16696
16697static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,
16698 signed long long __offset,
16699 signed int *__ptr) {
16700 __builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);
16701}
16702
16703static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,
16704 signed long long __offset,
16705 unsigned int *__ptr) {
16706 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
16707}
16708
16709static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,
16710 signed long long __offset,
16711 float *__ptr) {
16712 __builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);
16713}
16714
16715#ifdef __VSX__
16716static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,
16717 signed long long __offset,
16718 signed long long *__ptr) {
16719 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16720}
16721
16722static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,
16723 signed long long __offset,
16724 unsigned long long *__ptr) {
16725 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16726}
16727
16728static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,
16729 signed long long __offset,
16730 double *__ptr) {
16731 __builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);
16732}
16733#endif
16734
16735#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16736static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,
16737 signed long long __offset,
16738 signed __int128 *__ptr) {
16739 vec_xst(__vec, __offset, __ptr);
16740}
16741
16742static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,
16743 signed long long __offset,
16744 unsigned __int128 *__ptr) {
16745 vec_xst(__vec, __offset, __ptr);
16746}
16747#endif
16748#else
16749 #define vec_xst_be vec_xst
16750#endif
16751
16752#ifdef __POWER9_VECTOR__
16753#define vec_test_data_class(__a, __b) \
16754 _Generic( \
16755 (__a), vector float \
16756 : (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \
16757 vector double \
16758 : (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \
16759 (__b)))
16760
16761#endif /* #ifdef __POWER9_VECTOR__ */
16762
16763static vector float __ATTRS_o_ai vec_neg(vector float __a) {
16764 return -__a;
16765}
16766
16767#ifdef __VSX__
16768static vector double __ATTRS_o_ai vec_neg(vector double __a) {
16769 return -__a;
16770}
16771
16772#endif
16773
16774#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16775static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {
16776 return -__a;
16777}
16778#endif
16779
16780static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {
16781 return -__a;
16782}
16783
16784static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {
16785 return -__a;
16786}
16787
16788static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {
16789 return -__a;
16790}
16791
16792static vector float __ATTRS_o_ai vec_nabs(vector float __a) {
16793 return - vec_abs(__a);
16794}
16795
16796#ifdef __VSX__
16797static vector double __ATTRS_o_ai vec_nabs(vector double __a) {
16798 return - vec_abs(__a);
16799}
16800
16801#endif
16802
16803#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
16804static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {
16805 return __builtin_altivec_vminsd(__a, -__a);
16806}
16807#endif
16808
16809static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {
16810 return __builtin_altivec_vminsw(__a, -__a);
16811}
16812
16813static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {
16814 return __builtin_altivec_vminsh(__a, -__a);
16815}
16816
16817static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {
16818 return __builtin_altivec_vminsb(__a, -__a);
16819}
16820
16821#ifdef __POWER10_VECTOR__
16822/* vec_pdep */
16823
16824static __inline__ vector unsigned long long __ATTRS_o_ai
16825vec_pdep(vector unsigned long long __a, vector unsigned long long __b) {
16826 return __builtin_altivec_vpdepd(__a, __b);
16827}
16828
16829/* vec_pext */
16830
16831static __inline__ vector unsigned long long __ATTRS_o_ai
16832vec_pext(vector unsigned long long __a, vector unsigned long long __b) {
16833 return __builtin_altivec_vpextd(__a, __b);
16834}
16835
16836/* vec_cfuge */
16837
16838static __inline__ vector unsigned long long __ATTRS_o_ai
16839vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {
16840 return __builtin_altivec_vcfuged(__a, __b);
16841}
16842
16843/* vec_gnb */
16844
16845#define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)
16846
16847/* vec_ternarylogic */
16848#ifdef __VSX__
16849#define vec_ternarylogic(__a, __b, __c, __imm) \
16850 _Generic((__a), vector unsigned char \
16851 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16852 (vector unsigned long long)(__b), \
16853 (vector unsigned long long)(__c), (__imm)), \
16854 vector unsigned short \
16855 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16856 (vector unsigned long long)(__b), \
16857 (vector unsigned long long)(__c), (__imm)), \
16858 vector unsigned int \
16859 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16860 (vector unsigned long long)(__b), \
16861 (vector unsigned long long)(__c), (__imm)), \
16862 vector unsigned long long \
16863 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16864 (vector unsigned long long)(__b), \
16865 (vector unsigned long long)(__c), (__imm)), \
16866 vector unsigned __int128 \
16867 : __builtin_vsx_xxeval((vector unsigned long long)(__a), \
16868 (vector unsigned long long)(__b), \
16869 (vector unsigned long long)(__c), (__imm)))
16870#endif /* __VSX__ */
16871
16872/* vec_genpcvm */
16873
16874#ifdef __VSX__
16875#define vec_genpcvm(__a, __imm) \
16876 _Generic((__a), vector unsigned char \
16877 : __builtin_vsx_xxgenpcvbm((__a), (int)(__imm)), \
16878 vector unsigned short \
16879 : __builtin_vsx_xxgenpcvhm((__a), (int)(__imm)), \
16880 vector unsigned int \
16881 : __builtin_vsx_xxgenpcvwm((__a), (int)(__imm)), \
16882 vector unsigned long long \
16883 : __builtin_vsx_xxgenpcvdm((__a), (int)(__imm)))
16884#endif /* __VSX__ */
16885
16886/* vec_clrl */
16887
16888static __inline__ vector signed char __ATTRS_o_ai
16889vec_clrl(vector signed char __a, unsigned int __n) {
16890#ifdef __LITTLE_ENDIAN__
16891 return __builtin_altivec_vclrrb(__a, __n);
16892#else
16893 return __builtin_altivec_vclrlb( __a, __n);
16894#endif
16895}
16896
16897static __inline__ vector unsigned char __ATTRS_o_ai
16898vec_clrl(vector unsigned char __a, unsigned int __n) {
16899#ifdef __LITTLE_ENDIAN__
16900 return __builtin_altivec_vclrrb((vector signed char)__a, __n);
16901#else
16902 return __builtin_altivec_vclrlb((vector signed char)__a, __n);
16903#endif
16904}
16905
16906/* vec_clrr */
16907
16908static __inline__ vector signed char __ATTRS_o_ai
16909vec_clrr(vector signed char __a, unsigned int __n) {
16910#ifdef __LITTLE_ENDIAN__
16911 return __builtin_altivec_vclrlb(__a, __n);
16912#else
16913 return __builtin_altivec_vclrrb( __a, __n);
16914#endif
16915}
16916
16917static __inline__ vector unsigned char __ATTRS_o_ai
16918vec_clrr(vector unsigned char __a, unsigned int __n) {
16919#ifdef __LITTLE_ENDIAN__
16920 return __builtin_altivec_vclrlb((vector signed char)__a, __n);
16921#else
16922 return __builtin_altivec_vclrrb((vector signed char)__a, __n);
16923#endif
16924}
16925
16926/* vec_cntlzm */
16927
16928static __inline__ vector unsigned long long __ATTRS_o_ai
16929vec_cntlzm(vector unsigned long long __a, vector unsigned long long __b) {
16930 return __builtin_altivec_vclzdm(__a, __b);
16931}
16932
16933/* vec_cnttzm */
16934
16935static __inline__ vector unsigned long long __ATTRS_o_ai
16936vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {
16937 return __builtin_altivec_vctzdm(__a, __b);
16938}
16939
16940/* vec_sldbi */
16941
16942#define vec_sldb(__a, __b, __c) __builtin_altivec_vsldbi(__a, __b, (__c & 0x7))
16943
16944/* vec_srdbi */
16945
16946#define vec_srdb(__a, __b, __c) __builtin_altivec_vsrdbi(__a, __b, (__c & 0x7))
16947
16948/* vec_insertl */
16949
16950static __inline__ vector unsigned char __ATTRS_o_ai
16951vec_insertl(unsigned char __a, vector unsigned char __b, unsigned int __c) {
16952#ifdef __LITTLE_ENDIAN__
16953 return __builtin_altivec_vinsbrx(__b, __c, __a);
16954#else
16955 return __builtin_altivec_vinsblx(__b, __c, __a);
16956#endif
16957}
16958
16959static __inline__ vector unsigned short __ATTRS_o_ai
16960vec_insertl(unsigned short __a, vector unsigned short __b, unsigned int __c) {
16961#ifdef __LITTLE_ENDIAN__
16962 return __builtin_altivec_vinshrx(__b, __c, __a);
16963#else
16964 return __builtin_altivec_vinshlx(__b, __c, __a);
16965#endif
16966}
16967
16968static __inline__ vector unsigned int __ATTRS_o_ai
16969vec_insertl(unsigned int __a, vector unsigned int __b, unsigned int __c) {
16970#ifdef __LITTLE_ENDIAN__
16971 return __builtin_altivec_vinswrx(__b, __c, __a);
16972#else
16973 return __builtin_altivec_vinswlx(__b, __c, __a);
16974#endif
16975}
16976
16977static __inline__ vector unsigned long long __ATTRS_o_ai
16978vec_insertl(unsigned long long __a, vector unsigned long long __b,
16979 unsigned int __c) {
16980#ifdef __LITTLE_ENDIAN__
16981 return __builtin_altivec_vinsdrx(__b, __c, __a);
16982#else
16983 return __builtin_altivec_vinsdlx(__b, __c, __a);
16984#endif
16985}
16986
16987static __inline__ vector unsigned char __ATTRS_o_ai
16988vec_insertl(vector unsigned char __a, vector unsigned char __b,
16989 unsigned int __c) {
16990#ifdef __LITTLE_ENDIAN__
16991 return __builtin_altivec_vinsbvrx(__b, __c, __a);
16992#else
16993 return __builtin_altivec_vinsbvlx(__b, __c, __a);
16994#endif
16995}
16996
16997static __inline__ vector unsigned short __ATTRS_o_ai
16998vec_insertl(vector unsigned short __a, vector unsigned short __b,
16999 unsigned int __c) {
17000#ifdef __LITTLE_ENDIAN__
17001 return __builtin_altivec_vinshvrx(__b, __c, __a);
17002#else
17003 return __builtin_altivec_vinshvlx(__b, __c, __a);
17004#endif
17005}
17006
17007static __inline__ vector unsigned int __ATTRS_o_ai
17008vec_insertl(vector unsigned int __a, vector unsigned int __b,
17009 unsigned int __c) {
17010#ifdef __LITTLE_ENDIAN__
17011 return __builtin_altivec_vinswvrx(__b, __c, __a);
17012#else
17013 return __builtin_altivec_vinswvlx(__b, __c, __a);
17014#endif
17015}
17016
17017/* vec_inserth */
17018
17019static __inline__ vector unsigned char __ATTRS_o_ai
17020vec_inserth(unsigned char __a, vector unsigned char __b, unsigned int __c) {
17021#ifdef __LITTLE_ENDIAN__
17022 return __builtin_altivec_vinsblx(__b, __c, __a);
17023#else
17024 return __builtin_altivec_vinsbrx(__b, __c, __a);
17025#endif
17026}
17027
17028static __inline__ vector unsigned short __ATTRS_o_ai
17029vec_inserth(unsigned short __a, vector unsigned short __b, unsigned int __c) {
17030#ifdef __LITTLE_ENDIAN__
17031 return __builtin_altivec_vinshlx(__b, __c, __a);
17032#else
17033 return __builtin_altivec_vinshrx(__b, __c, __a);
17034#endif
17035}
17036
17037static __inline__ vector unsigned int __ATTRS_o_ai
17038vec_inserth(unsigned int __a, vector unsigned int __b, unsigned int __c) {
17039#ifdef __LITTLE_ENDIAN__
17040 return __builtin_altivec_vinswlx(__b, __c, __a);
17041#else
17042 return __builtin_altivec_vinswrx(__b, __c, __a);
17043#endif
17044}
17045
17046static __inline__ vector unsigned long long __ATTRS_o_ai
17047vec_inserth(unsigned long long __a, vector unsigned long long __b,
17048 unsigned int __c) {
17049#ifdef __LITTLE_ENDIAN__
17050 return __builtin_altivec_vinsdlx(__b, __c, __a);
17051#else
17052 return __builtin_altivec_vinsdrx(__b, __c, __a);
17053#endif
17054}
17055
17056static __inline__ vector unsigned char __ATTRS_o_ai
17057vec_inserth(vector unsigned char __a, vector unsigned char __b,
17058 unsigned int __c) {
17059#ifdef __LITTLE_ENDIAN__
17060 return __builtin_altivec_vinsbvlx(__b, __c, __a);
17061#else
17062 return __builtin_altivec_vinsbvrx(__b, __c, __a);
17063#endif
17064}
17065
17066static __inline__ vector unsigned short __ATTRS_o_ai
17067vec_inserth(vector unsigned short __a, vector unsigned short __b,
17068 unsigned int __c) {
17069#ifdef __LITTLE_ENDIAN__
17070 return __builtin_altivec_vinshvlx(__b, __c, __a);
17071#else
17072 return __builtin_altivec_vinshvrx(__b, __c, __a);
17073#endif
17074}
17075
17076static __inline__ vector unsigned int __ATTRS_o_ai
17077vec_inserth(vector unsigned int __a, vector unsigned int __b,
17078 unsigned int __c) {
17079#ifdef __LITTLE_ENDIAN__
17080 return __builtin_altivec_vinswvlx(__b, __c, __a);
17081#else
17082 return __builtin_altivec_vinswvrx(__b, __c, __a);
17083#endif
17084}
17085
17086#ifdef __VSX__
17087
17088/* vec_permx */
17089
17090#define vec_permx(__a, __b, __c, __d) \
17091 __builtin_vsx_xxpermx((__a), (__b), (__c), (__d))
17092
17093/* vec_blendv */
17094
17095static __inline__ vector signed char __ATTRS_o_ai
17096vec_blendv(vector signed char __a, vector signed char __b,
17097 vector unsigned char __c) {
17098 return __builtin_vsx_xxblendvb(__a, __b, __c);
17099}
17100
17101static __inline__ vector unsigned char __ATTRS_o_ai
17102vec_blendv(vector unsigned char __a, vector unsigned char __b,
17103 vector unsigned char __c) {
17104 return __builtin_vsx_xxblendvb(__a, __b, __c);
17105}
17106
17107static __inline__ vector signed short __ATTRS_o_ai
17108vec_blendv(vector signed short __a, vector signed short __b,
17109 vector unsigned short __c) {
17110 return __builtin_vsx_xxblendvh(__a, __b, __c);
17111}
17112
17113static __inline__ vector unsigned short __ATTRS_o_ai
17114vec_blendv(vector unsigned short __a, vector unsigned short __b,
17115 vector unsigned short __c) {
17116 return __builtin_vsx_xxblendvh(__a, __b, __c);
17117}
17118
17119static __inline__ vector signed int __ATTRS_o_ai
17120vec_blendv(vector signed int __a, vector signed int __b,
17121 vector unsigned int __c) {
17122 return __builtin_vsx_xxblendvw(__a, __b, __c);
17123}
17124
17125static __inline__ vector unsigned int __ATTRS_o_ai
17126vec_blendv(vector unsigned int __a, vector unsigned int __b,
17127 vector unsigned int __c) {
17128 return __builtin_vsx_xxblendvw(__a, __b, __c);
17129}
17130
17131static __inline__ vector signed long long __ATTRS_o_ai
17132vec_blendv(vector signed long long __a, vector signed long long __b,
17133 vector unsigned long long __c) {
17134 return __builtin_vsx_xxblendvd(__a, __b, __c);
17135}
17136
17137static __inline__ vector unsigned long long __ATTRS_o_ai
17138vec_blendv(vector unsigned long long __a, vector unsigned long long __b,
17139 vector unsigned long long __c) {
17140 return __builtin_vsx_xxblendvd(__a, __b, __c);
17141}
17142
17143static __inline__ vector float __ATTRS_o_ai
17144vec_blendv(vector float __a, vector float __b, vector unsigned int __c) {
17145 return __builtin_vsx_xxblendvw(__a, __b, __c);
17146}
17147
17148static __inline__ vector double __ATTRS_o_ai
17149vec_blendv(vector double __a, vector double __b,
17150 vector unsigned long long __c) {
17151 return __builtin_vsx_xxblendvd(__a, __b, __c);
17152}
17153
17154/* vec_splati */
17155
17156#define vec_splati(__a) \
17157 _Generic((__a), signed int \
17158 : ((vector signed int)__a), unsigned int \
17159 : ((vector unsigned int)__a), float \
17160 : ((vector float)__a))
17161
17162/* vec_spatid */
17163
17164static __inline__ vector double __ATTRS_o_ai vec_splatid(const float __a) {
17165 return ((vector double)((double)__a));
17166}
17167
17168/* vec_splati_ins */
17169
17170static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins(
17171 vector signed int __a, const unsigned int __b, const signed int __c) {
17172#ifdef __LITTLE_ENDIAN__
17173 __a[1 - __b] = __c;
17174 __a[3 - __b] = __c;
17175#else
17176 __a[__b] = __c;
17177 __a[2 + __b] = __c;
17178#endif
17179 return __a;
17180}
17181
17182static __inline__ vector unsigned int __ATTRS_o_ai vec_splati_ins(
17183 vector unsigned int __a, const unsigned int __b, const unsigned int __c) {
17184#ifdef __LITTLE_ENDIAN__
17185 __a[1 - __b] = __c;
17186 __a[3 - __b] = __c;
17187#else
17188 __a[__b] = __c;
17189 __a[2 + __b] = __c;
17190#endif
17191 return __a;
17192}
17193
17194static __inline__ vector float __ATTRS_o_ai
17195vec_splati_ins(vector float __a, const unsigned int __b, const float __c) {
17196#ifdef __LITTLE_ENDIAN__
17197 __a[1 - __b] = __c;
17198 __a[3 - __b] = __c;
17199#else
17200 __a[__b] = __c;
17201 __a[2 + __b] = __c;
17202#endif
17203 return __a;
17204}
17205
17206/* vec_test_lsbb_all_ones */
17207
17208static __inline__ int __ATTRS_o_ai
17209vec_test_lsbb_all_ones(vector unsigned char __a) {
17210 return __builtin_vsx_xvtlsbb(__a, 1);
17211}
17212
17213/* vec_test_lsbb_all_zeros */
17214
17215static __inline__ int __ATTRS_o_ai
17216vec_test_lsbb_all_zeros(vector unsigned char __a) {
17217 return __builtin_vsx_xvtlsbb(__a, 0);
17218}
17219#endif /* __VSX__ */
17220#endif /* __POWER10_VECTOR__ */
17221
17222#undef __ATTRS_o_ai
17223
17224#endif /* __ALTIVEC_H */
__device__ float
static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a, vector int __b)
Definition altivec.h:11391
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:11515
static __inline__ vector unsigned char __ATTRS_o_ai vec_sr(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:9543
static __inline__ vector unsigned short __ATTRS_o_ai vec_vadduhs(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:703
static __inline__ vector bool char __ATTRS_o_ai vec_cmpeq(vector signed char __a, vector signed char __b)
Definition altivec.h:1625
static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a, vector short __b)
Definition altivec.h:4454
static __inline__ vector signed char __ATTRS_o_ai vec_sra(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9633
static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a, const short *__b)
Definition altivec.h:3727
static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a, vector int __b)
Definition altivec.h:4769
static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a, vector short __b)
Definition altivec.h:11357
static __inline__ vector signed char __ATTRS_o_ai vec_sro(vector signed char __a, vector signed char __b)
Definition altivec.h:10073
static __inline__ vector signed char __ATTRS_o_ai vec_lvrx(int __a, const signed char *__b)
Definition altivec.h:12985
static __inline__ vector signed char __ATTRS_o_ai vec_lde(int __a, const signed char *__b)
Definition altivec.h:3682
static __inline__ vector signed char __ATTRS_o_ai vec_ld(int __a, const vector signed char *__b)
Definition altivec.h:3504
static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:10617
static __inline__ vector signed char __ATTRS_o_ai vec_abss(vector signed char __a)
Definition altivec.h:158
static __inline__ vector signed char __ATTRS_o_ai vec_vsubsbs(vector signed char __a, vector signed char __b)
Definition altivec.h:11324
static __inline__ vector unsigned int __ATTRS_o_ai vec_vmaxuw(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:4506
static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a)
Definition altivec.h:1587
static __inline__ vector signed char __ATTRS_o_ai vec_vslb(vector signed char __a, vector unsigned char __b)
Definition altivec.h:8138
static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a, unsigned char __b)
Definition altivec.h:9388
static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a, vector short __b, vector short __c)
Definition altivec.h:5464
static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a)
Definition altivec.h:11757
static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b, vector signed char *__c)
Definition altivec.h:10409
static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a, vector signed char __b)
Definition altivec.h:15826
static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:13312
#define vec_xst_be
Definition altivec.h:16749
static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a, vector unsigned int __b)
Definition altivec.h:9700
static __inline__ vector bool char __ATTRS_o_ai vec_cmpne(vector bool char __a, vector bool char __b)
Definition altivec.h:1883
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:8461
vector signed char unaligned_vec_schar __attribute__((aligned(1)))
Definition altivec.h:16403
static __inline__ vector short __ATTRS_o_ai vec_vslh(vector short __a, vector unsigned short __b)
Definition altivec.h:8152
static __inline__ vector float vector float vector float __c
Definition altivec.h:4243
static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a, vector short __b)
Definition altivec.h:685
static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a, vector unsigned char __b, vector int __c)
Definition altivec.h:5502
static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a, vector signed char __b)
Definition altivec.h:5696
static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a, vector signed char __b)
Definition altivec.h:15461
static __inline__ vector signed char __ATTRS_o_ai vec_vaddubm(vector signed char __a, vector signed char __b)
Definition altivec.h:418
static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a)
Definition altivec.h:9494
static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a, const signed char *__b)
Definition altivec.h:4082
static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a, vector short __b)
Definition altivec.h:11124
static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a)
Definition altivec.h:7754
static __inline__ vector signed char __ATTRS_o_ai vec_vrlb(vector signed char __a, vector unsigned char __b)
Definition altivec.h:7719
static __inline__ vector signed int __ATTRS_o_ai vec_subc(vector signed int __a, vector signed int __b)
Definition altivec.h:11200
static __inline__ vector unsigned char __ATTRS_o_ai vec_vaddubs(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:669
static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b)
Definition altivec.h:3739
static __inline__ vector signed char __ATTRS_o_ai vec_vpkuhum(vector signed short __a, vector signed short __b)
Definition altivec.h:6905
static __inline__ vector signed int __ATTRS_o_ai vec_addc(vector signed int __a, vector signed int __b)
Definition altivec.h:527
static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a, vector signed char __b)
Definition altivec.h:14310
static __ATTRS_o_ai vector bool char vec_reve(vector bool char __a)
Definition altivec.h:16218
static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a, vector short __b)
Definition altivec.h:5358
static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a)
Definition altivec.h:13710
static __inline__ vector short __ATTRS_o_ai vec_vupkhsb(vector signed char __a)
Definition altivec.h:11738
#define __CR6_LT
Definition altivec.h:20
static __inline__ vector bool char __ATTRS_o_ai vec_revb(vector bool char __a)
Definition altivec.h:16288
static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a, vector signed char __b)
Definition altivec.h:13774
static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b, vector signed char *__c)
Definition altivec.h:10278
static __inline__ vector signed char __ATTRS_o_ai vec_andc(vector signed char __a, vector signed char __b)
Definition altivec.h:1163
static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a, const signed char *__b)
Definition altivec.h:3961
static __inline__ vector signed int __ATTRS_o_ai vec_sld(vector signed int, vector signed int, unsigned const int __c)
Definition altivec.h:8309
static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a, vector unsigned int __b)
Definition altivec.h:9620
static __inline__ vector short __ATTRS_o_ai vec_unpackl(vector signed char __a)
Definition altivec.h:11807
static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a, vector signed char __b)
Definition altivec.h:14670
static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a, vector int __b)
Definition altivec.h:11531
static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a)
Definition altivec.h:5587
static __inline__ vector signed char __ATTRS_o_ai vec_vandc(vector signed char __a, vector signed char __b)
Definition altivec.h:1349
static __inline__ vector signed char __ATTRS_o_ai vec_mul(vector signed char __a, vector signed char __b)
Definition altivec.h:5638
static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b, vector signed char *__c)
Definition altivec.h:10829
static __inline__ vector signed int __ATTRS_o_ai vec_signed(vector float __a)
Definition altivec.h:3016
static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b, vector signed char *__c)
Definition altivec.h:10698
static __inline__ vector signed char __ATTRS_o_ai vec_and(vector signed char __a, vector signed char __b)
Definition altivec.h:810
static __inline__ vector signed char __ATTRS_o_ai vec_avg(vector signed char __a, vector signed char __b)
Definition altivec.h:1514
static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:10541
static __inline__ vector signed char __ATTRS_o_ai vec_splat_s8(signed char __a)
Definition altivec.h:9470
static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a)
Definition altivec.h:14654
static __inline__ vector signed char __ATTRS_o_ai vec_mergel(vector signed char __a, vector signed char __b)
Definition altivec.h:4804
static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a)
Definition altivec.h:9510
static __inline__ vector signed char __ATTRS_o_ai vec_subs(vector signed char __a, vector signed char __b)
Definition altivec.h:11232
static __inline__ vector float vector float __b
Definition altivec.h:520
static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a, vector int __b)
Definition altivec.h:5032
static __inline__ vector signed char __ATTRS_o_ai vec_vxor(vector signed char __a, vector signed char __b)
Definition altivec.h:12391
static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a, vector short __b)
Definition altivec.h:4996
static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a, vector float __b)
Definition altivec.h:14876
static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a)
Definition altivec.h:3480
static __inline__ vector signed char __ATTRS_o_ai vec_lvlx(int __a, const signed char *__b)
Definition altivec.h:12773
static __inline__ vector short __ATTRS_o_ai vec_vrlh(vector short __a, vector unsigned short __b)
Definition altivec.h:7731
static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a, vector unsigned int __b)
Definition altivec.h:7742
#define __CR6_LT_REV
Definition altivec.h:21
static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b, short *__c)
Definition altivec.h:10639
static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a, vector signed char __b)
Definition altivec.h:14132
static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a)
Definition altivec.h:9503
static __inline__ vector signed char __ATTRS_o_ai vec_vmrglb(vector signed char __a, vector signed char __b)
Definition altivec.h:4969
static __inline__ vector signed char __ATTRS_o_ai vec_adds(vector signed char __a, vector signed char __b)
Definition altivec.h:560
#define __ATTRS_o_ai
Definition altivec.h:42
static __inline__ vector unsigned short __ATTRS_o_ai vec_vsubuhs(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:11375
static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a, int __b)
Definition altivec.h:13662
static __inline__ vector unsigned short __ATTRS_o_ai vec_vmaxuh(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:4472
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:7320
static __inline__ vector unsigned char __ATTRS_o_ai vec_vminub(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:5342
static __inline__ vector signed char __ATTRS_o_ai vec_vsrab(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9677
static __inline__ vector signed char __ATTRS_o_ai vec_vsububm(vector signed char __a, vector signed char __b)
Definition altivec.h:11091
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:13196
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:7834
static __inline__ vector signed char __ATTRS_o_ai vec_vmaxsb(vector signed char __a, vector signed char __b)
Definition altivec.h:4421
static __inline__ vector float __ATTRS_o_ai vec_float(vector signed int __a)
Definition altivec.h:3100
static __inline__ vector unsigned int __ATTRS_o_ai vec_splat_u32(signed char __a)
Definition altivec.h:9534
static __inline__ vector signed char __ATTRS_o_ai vec_mergeh(vector signed char __a, vector signed char __b)
Definition altivec.h:4534
static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a)
Definition altivec.h:11896
#define __CR6_EQ_REV
Definition altivec.h:19
static __inline__ vector signed char __ATTRS_o_ai vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c)
Definition altivec.h:8524
static __inline__ vector signed char __ATTRS_o_ai vec_rl(vector signed char __a, vector unsigned char __b)
Definition altivec.h:7645
static __inline__ vector bool char __ATTRS_o_ai vec_cmplt(vector signed char __a, vector signed char __b)
Definition altivec.h:2196
static __inline__ vector unsigned int __ATTRS_o_ai vec_unsigned(vector float __a)
Definition altivec.h:3058
static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a, vector unsigned int __b)
Definition altivec.h:8165
static __inline__ vector unsigned char __ATTRS_o_ai vec_vmaxub(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:4438
static __inline__ vector unsigned short __ATTRS_o_ai vec_vpkswus(vector int __a, vector int __b)
Definition altivec.h:7280
static __inline__ vector short __ATTRS_o_ai vec_vsrh(vector short __a, vector unsigned short __b)
Definition altivec.h:9607
static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a, int __b)
Definition altivec.h:12557
static __inline__ vector signed char __ATTRS_o_ai vec_vmrghb(vector signed char __a, vector signed char __b)
Definition altivec.h:4706
static __inline__ vector signed char __ATTRS_o_ai vec_vnor(vector signed char __a, vector signed char __b)
Definition altivec.h:6161
static __inline__ vector signed char __ATTRS_o_ai vec_max(vector signed char __a, vector signed char __b)
Definition altivec.h:4281
static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a, vector signed char __b)
Definition altivec.h:14482
static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a, vector signed char __b)
Definition altivec.h:15103
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:338
static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a, unsigned char __b)
Definition altivec.h:9428
static __inline__ vector signed char __ATTRS_o_ai vec_slo(vector signed char __a, vector signed char __b)
Definition altivec.h:9034
static __inline__ vector signed char __ATTRS_o_ai vec_nor(vector signed char __a, vector signed char __b)
Definition altivec.h:6098
#define vec_xl_be
Definition altivec.h:16565
static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a, vector int __b)
Definition altivec.h:6953
static __inline__ vector bool char __ATTRS_o_ai vec_cmpge(vector signed char __a, vector signed char __b)
Definition altivec.h:2024
static __inline__ vector signed char __ATTRS_o_ai vec_lvlxl(int __a, const signed char *__b)
Definition altivec.h:12879
static __inline__ vector signed char __ATTRS_o_ai vec_pack(vector signed short __a, vector signed short __b)
Definition altivec.h:6747
static __inline__ vector unsigned char __ATTRS_o_ai vec_packsu(vector short __a, vector short __b)
Definition altivec.h:7202
static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a, vector signed char __b)
Definition altivec.h:5798
static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a, vector float __b)
Definition altivec.h:14858
static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a, vector int __b)
Definition altivec.h:11158
static __inline__ vector signed char __ATTRS_o_ai vec_srl(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9713
static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a)
Definition altivec.h:7621
static __inline__ vector signed char __ATTRS_o_ai vec_min(vector signed char __a, vector signed char __b)
Definition altivec.h:5185
static __inline__ vector signed char __ATTRS_o_ai vec_vand(vector signed char __a, vector signed char __b)
Definition altivec.h:996
static __inline__ vector signed char __ATTRS_o_ai vec_splat(vector signed char __a, unsigned const int __b)
Definition altivec.h:9240
static __inline__ vector unsigned char __ATTRS_o_ai vec_vpkshus(vector short __a, vector short __b)
Definition altivec.h:7260
static __inline__ vector unsigned int __ATTRS_o_ai vec_vminuw(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:5410
static __inline__ vector signed char __ATTRS_o_ai vec_lvrxl(int __a, const signed char *__b)
Definition altivec.h:13091
static vector float __ATTRS_o_ai vec_neg(vector float __a)
Definition altivec.h:16763
static vector float __ATTRS_o_ai vec_nabs(vector float __a)
Definition altivec.h:16792
static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a, vector signed char __b)
Definition altivec.h:6234
static __inline__ vector signed char __ATTRS_o_ai vec_lvxl(int __a, const vector signed char *__b)
Definition altivec.h:3845
static __inline__ vector short __ATTRS_o_ai vec_unpackh(vector signed char __a)
Definition altivec.h:11668
static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a, vector short __b)
Definition altivec.h:4733
static __inline__ vector signed char __ATTRS_o_ai vec_vsr(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9900
static __inline__ vector unsigned char __ATTRS_o_ai vec_sl(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:8088
static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a, vector short __b)
Definition altivec.h:451
static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a)
Definition altivec.h:9487
static __inline__ vector signed char __ATTRS_o_ai vec_vminsb(vector signed char __a, vector signed char __b)
Definition altivec.h:5325
static __inline__ vector signed char __ATTRS_o_ai vec_add(vector signed char __a, vector signed char __b)
Definition altivec.h:198
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:7542
static __ATTRS_o_ai void vec_xst(vector signed char __vec, signed long long __offset, signed char *__ptr)
Definition altivec.h:16570
static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a, vector int __b)
Definition altivec.h:719
static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:13545
static __inline__ vector signed char __ATTRS_o_ai vec_ldl(int __a, const vector signed char *__b)
Definition altivec.h:3756
static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b, int *__c)
Definition altivec.h:10671
static __inline__ vector signed char __ATTRS_o_ai vec_abs(vector signed char __a)
Definition altivec.h:115
static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b, signed char *__c)
Definition altivec.h:13429
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:4199
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:7968
static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a, vector signed char __b)
Definition altivec.h:15640
static __inline__ vector unsigned char __ATTRS_o_ai vec_xor(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:12223
static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a, vector int __b)
Definition altivec.h:5392
static __inline__ vector signed char __ATTRS_o_ai vec_lvebx(int __a, const signed char *__b)
Definition altivec.h:3716
static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a, vector signed char __b)
Definition altivec.h:13961
static __inline__ vector unsigned int __ATTRS_o_ai vec_vadduws(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:737
static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a, vector int __b)
Definition altivec.h:4488
static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a)
Definition altivec.h:7809
static __inline__ vector unsigned char __ATTRS_o_ai vec_vsububs(vector unsigned char __a, vector unsigned char __b)
Definition altivec.h:11341
static __inline__ vector unsigned short __ATTRS_o_ai vec_vminuh(vector unsigned short __a, vector unsigned short __b)
Definition altivec.h:5376
static __inline__ vector signed char __ATTRS_o_ai vec_vspltb(vector signed char __a, unsigned char __b)
Definition altivec.h:9370
static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a)
Definition altivec.h:11641
static __inline__ vector short __ATTRS_o_ai vec_vupklsb(vector signed char __a)
Definition altivec.h:11877
static __inline__ vector bool char __ATTRS_o_ai vec_cmpgt(vector signed char __a, vector signed char __b)
Definition altivec.h:1964
static __inline__ vector signed char __ATTRS_o_ai vec_insert(signed char __a, vector signed char __b, int __c)
Definition altivec.h:12682
static __inline__ vector signed char __ATTRS_o_ai vec_sll(vector signed char __a, vector unsigned char __b)
Definition altivec.h:8674
static __inline__ vector signed char __ATTRS_o_ai vec_vsrb(vector signed char __a, vector unsigned char __b)
Definition altivec.h:9593
static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a, vector signed char __b)
Definition altivec.h:15282
static __inline__ vector signed char __ATTRS_o_ai vec_vsro(vector signed char __a, vector signed char __b)
Definition altivec.h:10189
static __inline__ vector bool char __ATTRS_o_ai vec_cmple(vector signed char __a, vector signed char __b)
Definition altivec.h:2140
static __inline__ vector signed char __ATTRS_o_ai vec_vsl(vector signed char __a, vector unsigned char __b)
Definition altivec.h:8861
static __inline__ vector unsigned short __ATTRS_o_ai vec_splat_u16(signed char __a)
Definition altivec.h:9526
static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a, vector int __b)
Definition altivec.h:485
#define __CR6_EQ
Definition altivec.h:18
static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a, vector short __b)
Definition altivec.h:7073
static __inline__ vector signed char __ATTRS_o_ai vec_vspltisb(signed char __a)
Definition altivec.h:9478
static __inline__ vector signed char __ATTRS_o_ai vec_vslo(vector signed char __a, vector signed char __b)
Definition altivec.h:9150
static __inline__ vector signed char __ATTRS_o_ai vec_vaddsbs(vector signed char __a, vector signed char __b)
Definition altivec.h:652
static __inline__ vector signed char __ATTRS_o_ai vec_lvx(int __a, const vector signed char *__b)
Definition altivec.h:3593
static __inline__ vector signed char __ATTRS_o_ai vec_div(vector signed char __a, vector signed char __b)
Definition altivec.h:3296
static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a, vector short __b, vector int __c)
Definition altivec.h:5558
static __inline__ vector signed char __ATTRS_o_ai vec_vor(vector signed char __a, vector signed char __b)
Definition altivec.h:6579
static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a, vector signed char __b)
Definition altivec.h:14915
static __ATTRS_o_ai vector signed char vec_xl(signed long long __offset, const signed char *__ptr)
Definition altivec.h:16411
static __inline__ vector signed char __ATTRS_o_ai vec_sub(vector signed char __a, vector signed char __b)
Definition altivec.h:10963
static __inline__ vector short __ATTRS_o_ai vec_vsrah(vector short __a, vector unsigned short __b)
Definition altivec.h:9689
static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a, vector float __b, vector float __c)
Definition altivec.h:6068
static __inline__ vector unsigned char __ATTRS_o_ai vec_splat_u8(unsigned char __a)
Definition altivec.h:9518
static __inline__ vector unsigned int __ATTRS_o_ai vec_vsubuws(vector unsigned int __a, vector unsigned int __b)
Definition altivec.h:11409
static __inline__ void int __a
Definition emmintrin.h:4185
#define NULL
void reverse(I begin, I end)
Definition pugixml.cpp:6344