blob: 77bc92861591ce23456bd78b46a78e689f3ffe2a [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001/*===---- altivec.h - Standard header for type generic math ---------------===*\
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 *
21\*===----------------------------------------------------------------------===*/
22
23#ifndef __ALTIVEC_H
24#define __ALTIVEC_H
25
26#ifndef __ALTIVEC__
27#error "AltiVec support not enabled"
28#endif
29
30/* Constants for mapping CR6 bits to predicate result. */
31
32#define __CR6_EQ 0
33#define __CR6_EQ_REV 1
34#define __CR6_LT 2
35#define __CR6_LT_REV 3
36
37#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
38
39static __inline__ vector signed char __ATTRS_o_ai vec_perm(
40 vector signed char __a, vector signed char __b, vector unsigned char __c);
41
42static __inline__ vector unsigned char __ATTRS_o_ai
43vec_perm(vector unsigned char __a, vector unsigned char __b,
44 vector unsigned char __c);
45
46static __inline__ vector bool char __ATTRS_o_ai
47vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
48
49static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
50 vector signed short __b,
51 vector unsigned char __c);
52
53static __inline__ vector unsigned short __ATTRS_o_ai
54vec_perm(vector unsigned short __a, vector unsigned short __b,
55 vector unsigned char __c);
56
57static __inline__ vector bool short __ATTRS_o_ai vec_perm(
58 vector bool short __a, vector bool short __b, vector unsigned char __c);
59
60static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
61 vector pixel __b,
62 vector unsigned char __c);
63
64static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
65 vector signed int __b,
66 vector unsigned char __c);
67
68static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
69 vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
70
71static __inline__ vector bool int __ATTRS_o_ai
72vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
73
74static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
75 vector float __b,
76 vector unsigned char __c);
77
78#ifdef __VSX__
79static __inline__ vector long long __ATTRS_o_ai
80vec_perm(vector signed long long __a, vector signed long long __b,
81 vector unsigned char __c);
82
83static __inline__ vector unsigned long long __ATTRS_o_ai
84vec_perm(vector unsigned long long __a, vector unsigned long long __b,
85 vector unsigned char __c);
86
87static __inline__ vector bool long long __ATTRS_o_ai
88vec_perm(vector bool long long __a, vector bool long long __b,
89 vector unsigned char __c);
90
91static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
92 vector double __b,
93 vector unsigned char __c);
94#endif
95
96static __inline__ vector unsigned char __ATTRS_o_ai
97vec_xor(vector unsigned char __a, vector unsigned char __b);
98
99/* vec_abs */
100
101#define __builtin_altivec_abs_v16qi vec_abs
102#define __builtin_altivec_abs_v8hi vec_abs
103#define __builtin_altivec_abs_v4si vec_abs
104
105static __inline__ vector signed char __ATTRS_o_ai
106vec_abs(vector signed char __a) {
107 return __builtin_altivec_vmaxsb(__a, -__a);
108}
109
110static __inline__ vector signed short __ATTRS_o_ai
111vec_abs(vector signed short __a) {
112 return __builtin_altivec_vmaxsh(__a, -__a);
113}
114
115static __inline__ vector signed int __ATTRS_o_ai
116vec_abs(vector signed int __a) {
117 return __builtin_altivec_vmaxsw(__a, -__a);
118}
119
120#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
121static __inline__ vector signed long long __ATTRS_o_ai
122vec_abs(vector signed long long __a) {
123 return __builtin_altivec_vmaxsd(__a, -__a);
124}
125#endif
126
127static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
128#ifdef __VSX__
129 return __builtin_vsx_xvabssp(__a);
130#else
131 vector unsigned int __res =
132 (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
133 return (vector float)__res;
134#endif
135}
136
137#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
138static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
139 return __builtin_vsx_xvabsdp(__a);
140}
141#endif
142
143/* vec_abss */
144#define __builtin_altivec_abss_v16qi vec_abss
145#define __builtin_altivec_abss_v8hi vec_abss
146#define __builtin_altivec_abss_v4si vec_abss
147
148static __inline__ vector signed char __ATTRS_o_ai
149vec_abss(vector signed char __a) {
150 return __builtin_altivec_vmaxsb(
151 __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
152}
153
154static __inline__ vector signed short __ATTRS_o_ai
155vec_abss(vector signed short __a) {
156 return __builtin_altivec_vmaxsh(
157 __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
158}
159
160static __inline__ vector signed int __ATTRS_o_ai
161vec_abss(vector signed int __a) {
162 return __builtin_altivec_vmaxsw(
163 __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
164}
165
166/* vec_add */
167
168static __inline__ vector signed char __ATTRS_o_ai
169vec_add(vector signed char __a, vector signed char __b) {
170 return __a + __b;
171}
172
173static __inline__ vector signed char __ATTRS_o_ai
174vec_add(vector bool char __a, vector signed char __b) {
175 return (vector signed char)__a + __b;
176}
177
178static __inline__ vector signed char __ATTRS_o_ai
179vec_add(vector signed char __a, vector bool char __b) {
180 return __a + (vector signed char)__b;
181}
182
183static __inline__ vector unsigned char __ATTRS_o_ai
184vec_add(vector unsigned char __a, vector unsigned char __b) {
185 return __a + __b;
186}
187
188static __inline__ vector unsigned char __ATTRS_o_ai
189vec_add(vector bool char __a, vector unsigned char __b) {
190 return (vector unsigned char)__a + __b;
191}
192
193static __inline__ vector unsigned char __ATTRS_o_ai
194vec_add(vector unsigned char __a, vector bool char __b) {
195 return __a + (vector unsigned char)__b;
196}
197
198static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
199 vector short __b) {
200 return __a + __b;
201}
202
203static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
204 vector short __b) {
205 return (vector short)__a + __b;
206}
207
208static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
209 vector bool short __b) {
210 return __a + (vector short)__b;
211}
212
213static __inline__ vector unsigned short __ATTRS_o_ai
214vec_add(vector unsigned short __a, vector unsigned short __b) {
215 return __a + __b;
216}
217
218static __inline__ vector unsigned short __ATTRS_o_ai
219vec_add(vector bool short __a, vector unsigned short __b) {
220 return (vector unsigned short)__a + __b;
221}
222
223static __inline__ vector unsigned short __ATTRS_o_ai
224vec_add(vector unsigned short __a, vector bool short __b) {
225 return __a + (vector unsigned short)__b;
226}
227
228static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
229 vector int __b) {
230 return __a + __b;
231}
232
233static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
234 vector int __b) {
235 return (vector int)__a + __b;
236}
237
238static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
239 vector bool int __b) {
240 return __a + (vector int)__b;
241}
242
243static __inline__ vector unsigned int __ATTRS_o_ai
244vec_add(vector unsigned int __a, vector unsigned int __b) {
245 return __a + __b;
246}
247
248static __inline__ vector unsigned int __ATTRS_o_ai
249vec_add(vector bool int __a, vector unsigned int __b) {
250 return (vector unsigned int)__a + __b;
251}
252
253static __inline__ vector unsigned int __ATTRS_o_ai
254vec_add(vector unsigned int __a, vector bool int __b) {
255 return __a + (vector unsigned int)__b;
256}
257
258#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
259static __inline__ vector signed long long __ATTRS_o_ai
260vec_add(vector signed long long __a, vector signed long long __b) {
261 return __a + __b;
262}
263
264static __inline__ vector unsigned long long __ATTRS_o_ai
265vec_add(vector unsigned long long __a, vector unsigned long long __b) {
266 return __a + __b;
267}
268
269static __inline__ vector signed __int128 __ATTRS_o_ai
270vec_add(vector signed __int128 __a, vector signed __int128 __b) {
271 return __a + __b;
272}
273
274static __inline__ vector unsigned __int128 __ATTRS_o_ai
275vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
276 return __a + __b;
277}
278#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
279
280static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
281 vector float __b) {
282 return __a + __b;
283}
284
285#ifdef __VSX__
286static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
287 vector double __b) {
288 return __a + __b;
289}
290#endif // __VSX__
291
292/* vec_adde */
293
294#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
295static __inline__ vector signed __int128 __ATTRS_o_ai
296vec_adde(vector signed __int128 __a, vector signed __int128 __b,
297 vector signed __int128 __c) {
298 return __builtin_altivec_vaddeuqm(__a, __b, __c);
299}
300
301static __inline__ vector unsigned __int128 __ATTRS_o_ai
302vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
303 vector unsigned __int128 __c) {
304 return __builtin_altivec_vaddeuqm(__a, __b, __c);
305}
306#endif
307
308/* vec_addec */
309
310#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
311static __inline__ vector signed __int128 __ATTRS_o_ai
312vec_addec(vector signed __int128 __a, vector signed __int128 __b,
313 vector signed __int128 __c) {
314 return __builtin_altivec_vaddecuq(__a, __b, __c);
315}
316
317static __inline__ vector unsigned __int128 __ATTRS_o_ai
318vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
319 vector unsigned __int128 __c) {
320 return __builtin_altivec_vaddecuq(__a, __b, __c);
321}
322#endif
323
324/* vec_vaddubm */
325
326#define __builtin_altivec_vaddubm vec_vaddubm
327
328static __inline__ vector signed char __ATTRS_o_ai
329vec_vaddubm(vector signed char __a, vector signed char __b) {
330 return __a + __b;
331}
332
333static __inline__ vector signed char __ATTRS_o_ai
334vec_vaddubm(vector bool char __a, vector signed char __b) {
335 return (vector signed char)__a + __b;
336}
337
338static __inline__ vector signed char __ATTRS_o_ai
339vec_vaddubm(vector signed char __a, vector bool char __b) {
340 return __a + (vector signed char)__b;
341}
342
343static __inline__ vector unsigned char __ATTRS_o_ai
344vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
345 return __a + __b;
346}
347
348static __inline__ vector unsigned char __ATTRS_o_ai
349vec_vaddubm(vector bool char __a, vector unsigned char __b) {
350 return (vector unsigned char)__a + __b;
351}
352
353static __inline__ vector unsigned char __ATTRS_o_ai
354vec_vaddubm(vector unsigned char __a, vector bool char __b) {
355 return __a + (vector unsigned char)__b;
356}
357
358/* vec_vadduhm */
359
360#define __builtin_altivec_vadduhm vec_vadduhm
361
362static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
363 vector short __b) {
364 return __a + __b;
365}
366
367static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
368 vector short __b) {
369 return (vector short)__a + __b;
370}
371
372static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
373 vector bool short __b) {
374 return __a + (vector short)__b;
375}
376
377static __inline__ vector unsigned short __ATTRS_o_ai
378vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
379 return __a + __b;
380}
381
382static __inline__ vector unsigned short __ATTRS_o_ai
383vec_vadduhm(vector bool short __a, vector unsigned short __b) {
384 return (vector unsigned short)__a + __b;
385}
386
387static __inline__ vector unsigned short __ATTRS_o_ai
388vec_vadduhm(vector unsigned short __a, vector bool short __b) {
389 return __a + (vector unsigned short)__b;
390}
391
392/* vec_vadduwm */
393
394#define __builtin_altivec_vadduwm vec_vadduwm
395
396static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
397 vector int __b) {
398 return __a + __b;
399}
400
401static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
402 vector int __b) {
403 return (vector int)__a + __b;
404}
405
406static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
407 vector bool int __b) {
408 return __a + (vector int)__b;
409}
410
411static __inline__ vector unsigned int __ATTRS_o_ai
412vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
413 return __a + __b;
414}
415
416static __inline__ vector unsigned int __ATTRS_o_ai
417vec_vadduwm(vector bool int __a, vector unsigned int __b) {
418 return (vector unsigned int)__a + __b;
419}
420
421static __inline__ vector unsigned int __ATTRS_o_ai
422vec_vadduwm(vector unsigned int __a, vector bool int __b) {
423 return __a + (vector unsigned int)__b;
424}
425
426/* vec_vaddfp */
427
428#define __builtin_altivec_vaddfp vec_vaddfp
429
430static __inline__ vector float __attribute__((__always_inline__))
431vec_vaddfp(vector float __a, vector float __b) {
432 return __a + __b;
433}
434
435/* vec_addc */
436
437static __inline__ vector signed int __ATTRS_o_ai
438vec_addc(vector signed int __a, vector signed int __b) {
439 return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
440 (vector unsigned int)__b);
441}
442
443static __inline__ vector unsigned int __ATTRS_o_ai
444vec_addc(vector unsigned int __a, vector unsigned int __b) {
445 return __builtin_altivec_vaddcuw(__a, __b);
446}
447
448#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
449static __inline__ vector signed __int128 __ATTRS_o_ai
450vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
451 return (vector signed __int128)__builtin_altivec_vaddcuq(
452 (vector unsigned __int128)__a, (vector unsigned __int128)__b);
453}
454
455static __inline__ vector unsigned __int128 __ATTRS_o_ai
456vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
457 return __builtin_altivec_vaddcuq(__a, __b);
458}
459#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
460
461/* vec_vaddcuw */
462
463static __inline__ vector unsigned int __attribute__((__always_inline__))
464vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
465 return __builtin_altivec_vaddcuw(__a, __b);
466}
467
468/* vec_adds */
469
470static __inline__ vector signed char __ATTRS_o_ai
471vec_adds(vector signed char __a, vector signed char __b) {
472 return __builtin_altivec_vaddsbs(__a, __b);
473}
474
475static __inline__ vector signed char __ATTRS_o_ai
476vec_adds(vector bool char __a, vector signed char __b) {
477 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
478}
479
480static __inline__ vector signed char __ATTRS_o_ai
481vec_adds(vector signed char __a, vector bool char __b) {
482 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
483}
484
485static __inline__ vector unsigned char __ATTRS_o_ai
486vec_adds(vector unsigned char __a, vector unsigned char __b) {
487 return __builtin_altivec_vaddubs(__a, __b);
488}
489
490static __inline__ vector unsigned char __ATTRS_o_ai
491vec_adds(vector bool char __a, vector unsigned char __b) {
492 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
493}
494
495static __inline__ vector unsigned char __ATTRS_o_ai
496vec_adds(vector unsigned char __a, vector bool char __b) {
497 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
498}
499
500static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
501 vector short __b) {
502 return __builtin_altivec_vaddshs(__a, __b);
503}
504
505static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
506 vector short __b) {
507 return __builtin_altivec_vaddshs((vector short)__a, __b);
508}
509
510static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
511 vector bool short __b) {
512 return __builtin_altivec_vaddshs(__a, (vector short)__b);
513}
514
515static __inline__ vector unsigned short __ATTRS_o_ai
516vec_adds(vector unsigned short __a, vector unsigned short __b) {
517 return __builtin_altivec_vadduhs(__a, __b);
518}
519
520static __inline__ vector unsigned short __ATTRS_o_ai
521vec_adds(vector bool short __a, vector unsigned short __b) {
522 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
523}
524
525static __inline__ vector unsigned short __ATTRS_o_ai
526vec_adds(vector unsigned short __a, vector bool short __b) {
527 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
528}
529
530static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
531 vector int __b) {
532 return __builtin_altivec_vaddsws(__a, __b);
533}
534
535static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
536 vector int __b) {
537 return __builtin_altivec_vaddsws((vector int)__a, __b);
538}
539
540static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
541 vector bool int __b) {
542 return __builtin_altivec_vaddsws(__a, (vector int)__b);
543}
544
545static __inline__ vector unsigned int __ATTRS_o_ai
546vec_adds(vector unsigned int __a, vector unsigned int __b) {
547 return __builtin_altivec_vadduws(__a, __b);
548}
549
550static __inline__ vector unsigned int __ATTRS_o_ai
551vec_adds(vector bool int __a, vector unsigned int __b) {
552 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
553}
554
555static __inline__ vector unsigned int __ATTRS_o_ai
556vec_adds(vector unsigned int __a, vector bool int __b) {
557 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
558}
559
560/* vec_vaddsbs */
561
562static __inline__ vector signed char __ATTRS_o_ai
563vec_vaddsbs(vector signed char __a, vector signed char __b) {
564 return __builtin_altivec_vaddsbs(__a, __b);
565}
566
567static __inline__ vector signed char __ATTRS_o_ai
568vec_vaddsbs(vector bool char __a, vector signed char __b) {
569 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
570}
571
572static __inline__ vector signed char __ATTRS_o_ai
573vec_vaddsbs(vector signed char __a, vector bool char __b) {
574 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
575}
576
577/* vec_vaddubs */
578
579static __inline__ vector unsigned char __ATTRS_o_ai
580vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
581 return __builtin_altivec_vaddubs(__a, __b);
582}
583
584static __inline__ vector unsigned char __ATTRS_o_ai
585vec_vaddubs(vector bool char __a, vector unsigned char __b) {
586 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
587}
588
589static __inline__ vector unsigned char __ATTRS_o_ai
590vec_vaddubs(vector unsigned char __a, vector bool char __b) {
591 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
592}
593
594/* vec_vaddshs */
595
596static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
597 vector short __b) {
598 return __builtin_altivec_vaddshs(__a, __b);
599}
600
601static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
602 vector short __b) {
603 return __builtin_altivec_vaddshs((vector short)__a, __b);
604}
605
606static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
607 vector bool short __b) {
608 return __builtin_altivec_vaddshs(__a, (vector short)__b);
609}
610
611/* vec_vadduhs */
612
613static __inline__ vector unsigned short __ATTRS_o_ai
614vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
615 return __builtin_altivec_vadduhs(__a, __b);
616}
617
618static __inline__ vector unsigned short __ATTRS_o_ai
619vec_vadduhs(vector bool short __a, vector unsigned short __b) {
620 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
621}
622
623static __inline__ vector unsigned short __ATTRS_o_ai
624vec_vadduhs(vector unsigned short __a, vector bool short __b) {
625 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
626}
627
628/* vec_vaddsws */
629
630static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
631 vector int __b) {
632 return __builtin_altivec_vaddsws(__a, __b);
633}
634
635static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
636 vector int __b) {
637 return __builtin_altivec_vaddsws((vector int)__a, __b);
638}
639
640static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
641 vector bool int __b) {
642 return __builtin_altivec_vaddsws(__a, (vector int)__b);
643}
644
645/* vec_vadduws */
646
647static __inline__ vector unsigned int __ATTRS_o_ai
648vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
649 return __builtin_altivec_vadduws(__a, __b);
650}
651
652static __inline__ vector unsigned int __ATTRS_o_ai
653vec_vadduws(vector bool int __a, vector unsigned int __b) {
654 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
655}
656
657static __inline__ vector unsigned int __ATTRS_o_ai
658vec_vadduws(vector unsigned int __a, vector bool int __b) {
659 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
660}
661
662#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
663/* vec_vadduqm */
664
665static __inline__ vector signed __int128 __ATTRS_o_ai
666vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
667 return __a + __b;
668}
669
670static __inline__ vector unsigned __int128 __ATTRS_o_ai
671vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
672 return __a + __b;
673}
674
675/* vec_vaddeuqm */
676
677static __inline__ vector signed __int128 __ATTRS_o_ai
678vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
679 vector signed __int128 __c) {
680 return __builtin_altivec_vaddeuqm(__a, __b, __c);
681}
682
683static __inline__ vector unsigned __int128 __ATTRS_o_ai
684vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
685 vector unsigned __int128 __c) {
686 return __builtin_altivec_vaddeuqm(__a, __b, __c);
687}
688
689/* vec_vaddcuq */
690
691static __inline__ vector signed __int128 __ATTRS_o_ai
692vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
693 return __builtin_altivec_vaddcuq(__a, __b);
694}
695
696static __inline__ vector unsigned __int128 __ATTRS_o_ai
697vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
698 return __builtin_altivec_vaddcuq(__a, __b);
699}
700
701/* vec_vaddecuq */
702
703static __inline__ vector signed __int128 __ATTRS_o_ai
704vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
705 vector signed __int128 __c) {
706 return __builtin_altivec_vaddecuq(__a, __b, __c);
707}
708
709static __inline__ vector unsigned __int128 __ATTRS_o_ai
710vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
711 vector unsigned __int128 __c) {
712 return __builtin_altivec_vaddecuq(__a, __b, __c);
713}
714#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
715
716/* vec_and */
717
718#define __builtin_altivec_vand vec_and
719
720static __inline__ vector signed char __ATTRS_o_ai
721vec_and(vector signed char __a, vector signed char __b) {
722 return __a & __b;
723}
724
725static __inline__ vector signed char __ATTRS_o_ai
726vec_and(vector bool char __a, vector signed char __b) {
727 return (vector signed char)__a & __b;
728}
729
730static __inline__ vector signed char __ATTRS_o_ai
731vec_and(vector signed char __a, vector bool char __b) {
732 return __a & (vector signed char)__b;
733}
734
735static __inline__ vector unsigned char __ATTRS_o_ai
736vec_and(vector unsigned char __a, vector unsigned char __b) {
737 return __a & __b;
738}
739
740static __inline__ vector unsigned char __ATTRS_o_ai
741vec_and(vector bool char __a, vector unsigned char __b) {
742 return (vector unsigned char)__a & __b;
743}
744
745static __inline__ vector unsigned char __ATTRS_o_ai
746vec_and(vector unsigned char __a, vector bool char __b) {
747 return __a & (vector unsigned char)__b;
748}
749
750static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
751 vector bool char __b) {
752 return __a & __b;
753}
754
755static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
756 vector short __b) {
757 return __a & __b;
758}
759
760static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
761 vector short __b) {
762 return (vector short)__a & __b;
763}
764
765static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
766 vector bool short __b) {
767 return __a & (vector short)__b;
768}
769
770static __inline__ vector unsigned short __ATTRS_o_ai
771vec_and(vector unsigned short __a, vector unsigned short __b) {
772 return __a & __b;
773}
774
775static __inline__ vector unsigned short __ATTRS_o_ai
776vec_and(vector bool short __a, vector unsigned short __b) {
777 return (vector unsigned short)__a & __b;
778}
779
780static __inline__ vector unsigned short __ATTRS_o_ai
781vec_and(vector unsigned short __a, vector bool short __b) {
782 return __a & (vector unsigned short)__b;
783}
784
785static __inline__ vector bool short __ATTRS_o_ai
786vec_and(vector bool short __a, vector bool short __b) {
787 return __a & __b;
788}
789
790static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
791 vector int __b) {
792 return __a & __b;
793}
794
795static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
796 vector int __b) {
797 return (vector int)__a & __b;
798}
799
800static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
801 vector bool int __b) {
802 return __a & (vector int)__b;
803}
804
805static __inline__ vector unsigned int __ATTRS_o_ai
806vec_and(vector unsigned int __a, vector unsigned int __b) {
807 return __a & __b;
808}
809
810static __inline__ vector unsigned int __ATTRS_o_ai
811vec_and(vector bool int __a, vector unsigned int __b) {
812 return (vector unsigned int)__a & __b;
813}
814
815static __inline__ vector unsigned int __ATTRS_o_ai
816vec_and(vector unsigned int __a, vector bool int __b) {
817 return __a & (vector unsigned int)__b;
818}
819
820static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
821 vector bool int __b) {
822 return __a & __b;
823}
824
825static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
826 vector float __b) {
827 vector unsigned int __res =
828 (vector unsigned int)__a & (vector unsigned int)__b;
829 return (vector float)__res;
830}
831
832static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
833 vector float __b) {
834 vector unsigned int __res =
835 (vector unsigned int)__a & (vector unsigned int)__b;
836 return (vector float)__res;
837}
838
839static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
840 vector bool int __b) {
841 vector unsigned int __res =
842 (vector unsigned int)__a & (vector unsigned int)__b;
843 return (vector float)__res;
844}
845
846#ifdef __VSX__
847static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
848 vector double __b) {
849 vector unsigned long long __res =
850 (vector unsigned long long)__a & (vector unsigned long long)__b;
851 return (vector double)__res;
852}
853
854static __inline__ vector double __ATTRS_o_ai
855vec_and(vector double __a, vector bool long long __b) {
856 vector unsigned long long __res =
857 (vector unsigned long long)__a & (vector unsigned long long)__b;
858 return (vector double)__res;
859}
860
861static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
862 vector double __b) {
863 vector unsigned long long __res =
864 (vector unsigned long long)__a & (vector unsigned long long)__b;
865 return (vector double)__res;
866}
867
868static __inline__ vector signed long long __ATTRS_o_ai
869vec_and(vector signed long long __a, vector signed long long __b) {
870 return __a & __b;
871}
872
873static __inline__ vector signed long long __ATTRS_o_ai
874vec_and(vector bool long long __a, vector signed long long __b) {
875 return (vector signed long long)__a & __b;
876}
877
878static __inline__ vector signed long long __ATTRS_o_ai
879vec_and(vector signed long long __a, vector bool long long __b) {
880 return __a & (vector signed long long)__b;
881}
882
883static __inline__ vector unsigned long long __ATTRS_o_ai
884vec_and(vector unsigned long long __a, vector unsigned long long __b) {
885 return __a & __b;
886}
887
888static __inline__ vector unsigned long long __ATTRS_o_ai
889vec_and(vector bool long long __a, vector unsigned long long __b) {
890 return (vector unsigned long long)__a & __b;
891}
892
893static __inline__ vector unsigned long long __ATTRS_o_ai
894vec_and(vector unsigned long long __a, vector bool long long __b) {
895 return __a & (vector unsigned long long)__b;
896}
897
898static __inline__ vector bool long long __ATTRS_o_ai
899vec_and(vector bool long long __a, vector bool long long __b) {
900 return __a & __b;
901}
902#endif
903
904/* vec_vand */
905
906static __inline__ vector signed char __ATTRS_o_ai
907vec_vand(vector signed char __a, vector signed char __b) {
908 return __a & __b;
909}
910
911static __inline__ vector signed char __ATTRS_o_ai
912vec_vand(vector bool char __a, vector signed char __b) {
913 return (vector signed char)__a & __b;
914}
915
916static __inline__ vector signed char __ATTRS_o_ai
917vec_vand(vector signed char __a, vector bool char __b) {
918 return __a & (vector signed char)__b;
919}
920
921static __inline__ vector unsigned char __ATTRS_o_ai
922vec_vand(vector unsigned char __a, vector unsigned char __b) {
923 return __a & __b;
924}
925
926static __inline__ vector unsigned char __ATTRS_o_ai
927vec_vand(vector bool char __a, vector unsigned char __b) {
928 return (vector unsigned char)__a & __b;
929}
930
931static __inline__ vector unsigned char __ATTRS_o_ai
932vec_vand(vector unsigned char __a, vector bool char __b) {
933 return __a & (vector unsigned char)__b;
934}
935
936static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
937 vector bool char __b) {
938 return __a & __b;
939}
940
941static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
942 vector short __b) {
943 return __a & __b;
944}
945
946static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
947 vector short __b) {
948 return (vector short)__a & __b;
949}
950
951static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
952 vector bool short __b) {
953 return __a & (vector short)__b;
954}
955
956static __inline__ vector unsigned short __ATTRS_o_ai
957vec_vand(vector unsigned short __a, vector unsigned short __b) {
958 return __a & __b;
959}
960
961static __inline__ vector unsigned short __ATTRS_o_ai
962vec_vand(vector bool short __a, vector unsigned short __b) {
963 return (vector unsigned short)__a & __b;
964}
965
966static __inline__ vector unsigned short __ATTRS_o_ai
967vec_vand(vector unsigned short __a, vector bool short __b) {
968 return __a & (vector unsigned short)__b;
969}
970
971static __inline__ vector bool short __ATTRS_o_ai
972vec_vand(vector bool short __a, vector bool short __b) {
973 return __a & __b;
974}
975
976static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
977 vector int __b) {
978 return __a & __b;
979}
980
981static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
982 vector int __b) {
983 return (vector int)__a & __b;
984}
985
986static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
987 vector bool int __b) {
988 return __a & (vector int)__b;
989}
990
991static __inline__ vector unsigned int __ATTRS_o_ai
992vec_vand(vector unsigned int __a, vector unsigned int __b) {
993 return __a & __b;
994}
995
996static __inline__ vector unsigned int __ATTRS_o_ai
997vec_vand(vector bool int __a, vector unsigned int __b) {
998 return (vector unsigned int)__a & __b;
999}
1000
1001static __inline__ vector unsigned int __ATTRS_o_ai
1002vec_vand(vector unsigned int __a, vector bool int __b) {
1003 return __a & (vector unsigned int)__b;
1004}
1005
1006static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1007 vector bool int __b) {
1008 return __a & __b;
1009}
1010
1011static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1012 vector float __b) {
1013 vector unsigned int __res =
1014 (vector unsigned int)__a & (vector unsigned int)__b;
1015 return (vector float)__res;
1016}
1017
1018static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1019 vector float __b) {
1020 vector unsigned int __res =
1021 (vector unsigned int)__a & (vector unsigned int)__b;
1022 return (vector float)__res;
1023}
1024
1025static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1026 vector bool int __b) {
1027 vector unsigned int __res =
1028 (vector unsigned int)__a & (vector unsigned int)__b;
1029 return (vector float)__res;
1030}
1031
1032#ifdef __VSX__
1033static __inline__ vector signed long long __ATTRS_o_ai
1034vec_vand(vector signed long long __a, vector signed long long __b) {
1035 return __a & __b;
1036}
1037
1038static __inline__ vector signed long long __ATTRS_o_ai
1039vec_vand(vector bool long long __a, vector signed long long __b) {
1040 return (vector signed long long)__a & __b;
1041}
1042
1043static __inline__ vector signed long long __ATTRS_o_ai
1044vec_vand(vector signed long long __a, vector bool long long __b) {
1045 return __a & (vector signed long long)__b;
1046}
1047
1048static __inline__ vector unsigned long long __ATTRS_o_ai
1049vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1050 return __a & __b;
1051}
1052
1053static __inline__ vector unsigned long long __ATTRS_o_ai
1054vec_vand(vector bool long long __a, vector unsigned long long __b) {
1055 return (vector unsigned long long)__a & __b;
1056}
1057
1058static __inline__ vector unsigned long long __ATTRS_o_ai
1059vec_vand(vector unsigned long long __a, vector bool long long __b) {
1060 return __a & (vector unsigned long long)__b;
1061}
1062
1063static __inline__ vector bool long long __ATTRS_o_ai
1064vec_vand(vector bool long long __a, vector bool long long __b) {
1065 return __a & __b;
1066}
1067#endif
1068
1069/* vec_andc */
1070
1071#define __builtin_altivec_vandc vec_andc
1072
1073static __inline__ vector signed char __ATTRS_o_ai
1074vec_andc(vector signed char __a, vector signed char __b) {
1075 return __a & ~__b;
1076}
1077
1078static __inline__ vector signed char __ATTRS_o_ai
1079vec_andc(vector bool char __a, vector signed char __b) {
1080 return (vector signed char)__a & ~__b;
1081}
1082
1083static __inline__ vector signed char __ATTRS_o_ai
1084vec_andc(vector signed char __a, vector bool char __b) {
1085 return __a & ~(vector signed char)__b;
1086}
1087
1088static __inline__ vector unsigned char __ATTRS_o_ai
1089vec_andc(vector unsigned char __a, vector unsigned char __b) {
1090 return __a & ~__b;
1091}
1092
1093static __inline__ vector unsigned char __ATTRS_o_ai
1094vec_andc(vector bool char __a, vector unsigned char __b) {
1095 return (vector unsigned char)__a & ~__b;
1096}
1097
1098static __inline__ vector unsigned char __ATTRS_o_ai
1099vec_andc(vector unsigned char __a, vector bool char __b) {
1100 return __a & ~(vector unsigned char)__b;
1101}
1102
1103static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1104 vector bool char __b) {
1105 return __a & ~__b;
1106}
1107
1108static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1109 vector short __b) {
1110 return __a & ~__b;
1111}
1112
1113static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1114 vector short __b) {
1115 return (vector short)__a & ~__b;
1116}
1117
1118static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1119 vector bool short __b) {
1120 return __a & ~(vector short)__b;
1121}
1122
1123static __inline__ vector unsigned short __ATTRS_o_ai
1124vec_andc(vector unsigned short __a, vector unsigned short __b) {
1125 return __a & ~__b;
1126}
1127
1128static __inline__ vector unsigned short __ATTRS_o_ai
1129vec_andc(vector bool short __a, vector unsigned short __b) {
1130 return (vector unsigned short)__a & ~__b;
1131}
1132
1133static __inline__ vector unsigned short __ATTRS_o_ai
1134vec_andc(vector unsigned short __a, vector bool short __b) {
1135 return __a & ~(vector unsigned short)__b;
1136}
1137
1138static __inline__ vector bool short __ATTRS_o_ai
1139vec_andc(vector bool short __a, vector bool short __b) {
1140 return __a & ~__b;
1141}
1142
1143static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1144 vector int __b) {
1145 return __a & ~__b;
1146}
1147
1148static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1149 vector int __b) {
1150 return (vector int)__a & ~__b;
1151}
1152
1153static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1154 vector bool int __b) {
1155 return __a & ~(vector int)__b;
1156}
1157
1158static __inline__ vector unsigned int __ATTRS_o_ai
1159vec_andc(vector unsigned int __a, vector unsigned int __b) {
1160 return __a & ~__b;
1161}
1162
1163static __inline__ vector unsigned int __ATTRS_o_ai
1164vec_andc(vector bool int __a, vector unsigned int __b) {
1165 return (vector unsigned int)__a & ~__b;
1166}
1167
1168static __inline__ vector unsigned int __ATTRS_o_ai
1169vec_andc(vector unsigned int __a, vector bool int __b) {
1170 return __a & ~(vector unsigned int)__b;
1171}
1172
1173static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1174 vector bool int __b) {
1175 return __a & ~__b;
1176}
1177
1178static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1179 vector float __b) {
1180 vector unsigned int __res =
1181 (vector unsigned int)__a & ~(vector unsigned int)__b;
1182 return (vector float)__res;
1183}
1184
1185static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1186 vector float __b) {
1187 vector unsigned int __res =
1188 (vector unsigned int)__a & ~(vector unsigned int)__b;
1189 return (vector float)__res;
1190}
1191
1192static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1193 vector bool int __b) {
1194 vector unsigned int __res =
1195 (vector unsigned int)__a & ~(vector unsigned int)__b;
1196 return (vector float)__res;
1197}
1198
1199#ifdef __VSX__
1200static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1201 vector double __b) {
1202 vector unsigned long long __res =
1203 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1204 return (vector double)__res;
1205}
1206
1207static __inline__ vector double __ATTRS_o_ai
1208vec_andc(vector double __a, vector bool long long __b) {
1209 vector unsigned long long __res =
1210 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1211 return (vector double)__res;
1212}
1213
1214static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1215 vector double __b) {
1216 vector unsigned long long __res =
1217 (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1218 return (vector double)__res;
1219}
1220
1221static __inline__ vector signed long long __ATTRS_o_ai
1222vec_andc(vector signed long long __a, vector signed long long __b) {
1223 return __a & ~__b;
1224}
1225
1226static __inline__ vector signed long long __ATTRS_o_ai
1227vec_andc(vector bool long long __a, vector signed long long __b) {
1228 return (vector signed long long)__a & ~__b;
1229}
1230
1231static __inline__ vector signed long long __ATTRS_o_ai
1232vec_andc(vector signed long long __a, vector bool long long __b) {
1233 return __a & ~(vector signed long long)__b;
1234}
1235
1236static __inline__ vector unsigned long long __ATTRS_o_ai
1237vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1238 return __a & ~__b;
1239}
1240
1241static __inline__ vector unsigned long long __ATTRS_o_ai
1242vec_andc(vector bool long long __a, vector unsigned long long __b) {
1243 return (vector unsigned long long)__a & ~__b;
1244}
1245
1246static __inline__ vector unsigned long long __ATTRS_o_ai
1247vec_andc(vector unsigned long long __a, vector bool long long __b) {
1248 return __a & ~(vector unsigned long long)__b;
1249}
1250
1251static __inline__ vector bool long long __ATTRS_o_ai
1252vec_andc(vector bool long long __a, vector bool long long __b) {
1253 return __a & ~__b;
1254}
1255#endif
1256
1257/* vec_vandc */
1258
1259static __inline__ vector signed char __ATTRS_o_ai
1260vec_vandc(vector signed char __a, vector signed char __b) {
1261 return __a & ~__b;
1262}
1263
1264static __inline__ vector signed char __ATTRS_o_ai
1265vec_vandc(vector bool char __a, vector signed char __b) {
1266 return (vector signed char)__a & ~__b;
1267}
1268
1269static __inline__ vector signed char __ATTRS_o_ai
1270vec_vandc(vector signed char __a, vector bool char __b) {
1271 return __a & ~(vector signed char)__b;
1272}
1273
1274static __inline__ vector unsigned char __ATTRS_o_ai
1275vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1276 return __a & ~__b;
1277}
1278
1279static __inline__ vector unsigned char __ATTRS_o_ai
1280vec_vandc(vector bool char __a, vector unsigned char __b) {
1281 return (vector unsigned char)__a & ~__b;
1282}
1283
1284static __inline__ vector unsigned char __ATTRS_o_ai
1285vec_vandc(vector unsigned char __a, vector bool char __b) {
1286 return __a & ~(vector unsigned char)__b;
1287}
1288
1289static __inline__ vector bool char __ATTRS_o_ai
1290vec_vandc(vector bool char __a, vector bool char __b) {
1291 return __a & ~__b;
1292}
1293
1294static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1295 vector short __b) {
1296 return __a & ~__b;
1297}
1298
1299static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1300 vector short __b) {
1301 return (vector short)__a & ~__b;
1302}
1303
1304static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1305 vector bool short __b) {
1306 return __a & ~(vector short)__b;
1307}
1308
1309static __inline__ vector unsigned short __ATTRS_o_ai
1310vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1311 return __a & ~__b;
1312}
1313
1314static __inline__ vector unsigned short __ATTRS_o_ai
1315vec_vandc(vector bool short __a, vector unsigned short __b) {
1316 return (vector unsigned short)__a & ~__b;
1317}
1318
1319static __inline__ vector unsigned short __ATTRS_o_ai
1320vec_vandc(vector unsigned short __a, vector bool short __b) {
1321 return __a & ~(vector unsigned short)__b;
1322}
1323
1324static __inline__ vector bool short __ATTRS_o_ai
1325vec_vandc(vector bool short __a, vector bool short __b) {
1326 return __a & ~__b;
1327}
1328
1329static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1330 vector int __b) {
1331 return __a & ~__b;
1332}
1333
1334static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1335 vector int __b) {
1336 return (vector int)__a & ~__b;
1337}
1338
1339static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1340 vector bool int __b) {
1341 return __a & ~(vector int)__b;
1342}
1343
1344static __inline__ vector unsigned int __ATTRS_o_ai
1345vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1346 return __a & ~__b;
1347}
1348
1349static __inline__ vector unsigned int __ATTRS_o_ai
1350vec_vandc(vector bool int __a, vector unsigned int __b) {
1351 return (vector unsigned int)__a & ~__b;
1352}
1353
1354static __inline__ vector unsigned int __ATTRS_o_ai
1355vec_vandc(vector unsigned int __a, vector bool int __b) {
1356 return __a & ~(vector unsigned int)__b;
1357}
1358
1359static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1360 vector bool int __b) {
1361 return __a & ~__b;
1362}
1363
1364static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1365 vector float __b) {
1366 vector unsigned int __res =
1367 (vector unsigned int)__a & ~(vector unsigned int)__b;
1368 return (vector float)__res;
1369}
1370
1371static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1372 vector float __b) {
1373 vector unsigned int __res =
1374 (vector unsigned int)__a & ~(vector unsigned int)__b;
1375 return (vector float)__res;
1376}
1377
1378static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1379 vector bool int __b) {
1380 vector unsigned int __res =
1381 (vector unsigned int)__a & ~(vector unsigned int)__b;
1382 return (vector float)__res;
1383}
1384
1385#ifdef __VSX__
1386static __inline__ vector signed long long __ATTRS_o_ai
1387vec_vandc(vector signed long long __a, vector signed long long __b) {
1388 return __a & ~__b;
1389}
1390
1391static __inline__ vector signed long long __ATTRS_o_ai
1392vec_vandc(vector bool long long __a, vector signed long long __b) {
1393 return (vector signed long long)__a & ~__b;
1394}
1395
1396static __inline__ vector signed long long __ATTRS_o_ai
1397vec_vandc(vector signed long long __a, vector bool long long __b) {
1398 return __a & ~(vector signed long long)__b;
1399}
1400
1401static __inline__ vector unsigned long long __ATTRS_o_ai
1402vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1403 return __a & ~__b;
1404}
1405
1406static __inline__ vector unsigned long long __ATTRS_o_ai
1407vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1408 return (vector unsigned long long)__a & ~__b;
1409}
1410
1411static __inline__ vector unsigned long long __ATTRS_o_ai
1412vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1413 return __a & ~(vector unsigned long long)__b;
1414}
1415
1416static __inline__ vector bool long long __ATTRS_o_ai
1417vec_vandc(vector bool long long __a, vector bool long long __b) {
1418 return __a & ~__b;
1419}
1420#endif
1421
1422/* vec_avg */
1423
1424static __inline__ vector signed char __ATTRS_o_ai
1425vec_avg(vector signed char __a, vector signed char __b) {
1426 return __builtin_altivec_vavgsb(__a, __b);
1427}
1428
1429static __inline__ vector unsigned char __ATTRS_o_ai
1430vec_avg(vector unsigned char __a, vector unsigned char __b) {
1431 return __builtin_altivec_vavgub(__a, __b);
1432}
1433
1434static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1435 vector short __b) {
1436 return __builtin_altivec_vavgsh(__a, __b);
1437}
1438
1439static __inline__ vector unsigned short __ATTRS_o_ai
1440vec_avg(vector unsigned short __a, vector unsigned short __b) {
1441 return __builtin_altivec_vavguh(__a, __b);
1442}
1443
1444static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1445 vector int __b) {
1446 return __builtin_altivec_vavgsw(__a, __b);
1447}
1448
1449static __inline__ vector unsigned int __ATTRS_o_ai
1450vec_avg(vector unsigned int __a, vector unsigned int __b) {
1451 return __builtin_altivec_vavguw(__a, __b);
1452}
1453
1454/* vec_vavgsb */
1455
1456static __inline__ vector signed char __attribute__((__always_inline__))
1457vec_vavgsb(vector signed char __a, vector signed char __b) {
1458 return __builtin_altivec_vavgsb(__a, __b);
1459}
1460
1461/* vec_vavgub */
1462
1463static __inline__ vector unsigned char __attribute__((__always_inline__))
1464vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1465 return __builtin_altivec_vavgub(__a, __b);
1466}
1467
1468/* vec_vavgsh */
1469
1470static __inline__ vector short __attribute__((__always_inline__))
1471vec_vavgsh(vector short __a, vector short __b) {
1472 return __builtin_altivec_vavgsh(__a, __b);
1473}
1474
1475/* vec_vavguh */
1476
1477static __inline__ vector unsigned short __attribute__((__always_inline__))
1478vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1479 return __builtin_altivec_vavguh(__a, __b);
1480}
1481
1482/* vec_vavgsw */
1483
1484static __inline__ vector int __attribute__((__always_inline__))
1485vec_vavgsw(vector int __a, vector int __b) {
1486 return __builtin_altivec_vavgsw(__a, __b);
1487}
1488
1489/* vec_vavguw */
1490
1491static __inline__ vector unsigned int __attribute__((__always_inline__))
1492vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1493 return __builtin_altivec_vavguw(__a, __b);
1494}
1495
1496/* vec_ceil */
1497
1498static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1499#ifdef __VSX__
1500 return __builtin_vsx_xvrspip(__a);
1501#else
1502 return __builtin_altivec_vrfip(__a);
1503#endif
1504}
1505
1506#ifdef __VSX__
1507static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1508 return __builtin_vsx_xvrdpip(__a);
1509}
1510#endif
1511
1512/* vec_vrfip */
1513
1514static __inline__ vector float __attribute__((__always_inline__))
1515vec_vrfip(vector float __a) {
1516 return __builtin_altivec_vrfip(__a);
1517}
1518
1519/* vec_cmpb */
1520
1521static __inline__ vector int __attribute__((__always_inline__))
1522vec_cmpb(vector float __a, vector float __b) {
1523 return __builtin_altivec_vcmpbfp(__a, __b);
1524}
1525
1526/* vec_vcmpbfp */
1527
1528static __inline__ vector int __attribute__((__always_inline__))
1529vec_vcmpbfp(vector float __a, vector float __b) {
1530 return __builtin_altivec_vcmpbfp(__a, __b);
1531}
1532
1533/* vec_cmpeq */
1534
1535static __inline__ vector bool char __ATTRS_o_ai
1536vec_cmpeq(vector signed char __a, vector signed char __b) {
1537 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1538 (vector char)__b);
1539}
1540
1541static __inline__ vector bool char __ATTRS_o_ai
1542vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1543 return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1544 (vector char)__b);
1545}
1546
1547static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1548 vector short __b) {
1549 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1550}
1551
1552static __inline__ vector bool short __ATTRS_o_ai
1553vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1554 return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1555 (vector short)__b);
1556}
1557
1558static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1559 vector int __b) {
1560 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1561}
1562
1563static __inline__ vector bool int __ATTRS_o_ai
1564vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1565 return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1566 (vector int)__b);
1567}
1568
1569#ifdef __POWER8_VECTOR__
1570static __inline__ vector bool long long __ATTRS_o_ai
1571vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1572 return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1573}
1574
1575static __inline__ vector bool long long __ATTRS_o_ai
1576vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1577 return (vector bool long long)__builtin_altivec_vcmpequd(
1578 (vector long long)__a, (vector long long)__b);
1579}
1580#endif
1581
1582static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1583 vector float __b) {
1584#ifdef __VSX__
1585 return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1586#else
1587 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1588#endif
1589}
1590
1591#ifdef __VSX__
1592static __inline__ vector bool long long __ATTRS_o_ai
1593vec_cmpeq(vector double __a, vector double __b) {
1594 return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1595}
1596#endif
1597
1598/* vec_cmpgt */
1599
1600static __inline__ vector bool char __ATTRS_o_ai
1601vec_cmpgt(vector signed char __a, vector signed char __b) {
1602 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1603}
1604
1605static __inline__ vector bool char __ATTRS_o_ai
1606vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1607 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1608}
1609
1610static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1611 vector short __b) {
1612 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1613}
1614
1615static __inline__ vector bool short __ATTRS_o_ai
1616vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1617 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1618}
1619
1620static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1621 vector int __b) {
1622 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1623}
1624
1625static __inline__ vector bool int __ATTRS_o_ai
1626vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1627 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1628}
1629
1630#ifdef __POWER8_VECTOR__
1631static __inline__ vector bool long long __ATTRS_o_ai
1632vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1633 return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1634}
1635
1636static __inline__ vector bool long long __ATTRS_o_ai
1637vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
1638 return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1639}
1640#endif
1641
1642static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
1643 vector float __b) {
1644#ifdef __VSX__
1645 return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
1646#else
1647 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1648#endif
1649}
1650
1651#ifdef __VSX__
1652static __inline__ vector bool long long __ATTRS_o_ai
1653vec_cmpgt(vector double __a, vector double __b) {
1654 return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
1655}
1656#endif
1657
1658/* vec_cmpge */
1659
1660static __inline__ vector bool char __ATTRS_o_ai
1661vec_cmpge(vector signed char __a, vector signed char __b) {
1662 return ~(vec_cmpgt(__b, __a));
1663}
1664
1665static __inline__ vector bool char __ATTRS_o_ai
1666vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
1667 return ~(vec_cmpgt(__b, __a));
1668}
1669
1670static __inline__ vector bool short __ATTRS_o_ai
1671vec_cmpge(vector signed short __a, vector signed short __b) {
1672 return ~(vec_cmpgt(__b, __a));
1673}
1674
1675static __inline__ vector bool short __ATTRS_o_ai
1676vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
1677 return ~(vec_cmpgt(__b, __a));
1678}
1679
1680static __inline__ vector bool int __ATTRS_o_ai
1681vec_cmpge(vector signed int __a, vector signed int __b) {
1682 return ~(vec_cmpgt(__b, __a));
1683}
1684
1685static __inline__ vector bool int __ATTRS_o_ai
1686vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
1687 return ~(vec_cmpgt(__b, __a));
1688}
1689
1690static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
1691 vector float __b) {
1692#ifdef __VSX__
1693 return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
1694#else
1695 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
1696#endif
1697}
1698
1699#ifdef __VSX__
1700static __inline__ vector bool long long __ATTRS_o_ai
1701vec_cmpge(vector double __a, vector double __b) {
1702 return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
1703}
1704#endif
1705
1706#ifdef __POWER8_VECTOR__
1707static __inline__ vector bool long long __ATTRS_o_ai
1708vec_cmpge(vector signed long long __a, vector signed long long __b) {
1709 return ~(vec_cmpgt(__b, __a));
1710}
1711
1712static __inline__ vector bool long long __ATTRS_o_ai
1713vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
1714 return ~(vec_cmpgt(__b, __a));
1715}
1716#endif
1717
1718/* vec_vcmpgefp */
1719
1720static __inline__ vector bool int __attribute__((__always_inline__))
1721vec_vcmpgefp(vector float __a, vector float __b) {
1722 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
1723}
1724
1725/* vec_vcmpgtsb */
1726
1727static __inline__ vector bool char __attribute__((__always_inline__))
1728vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
1729 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1730}
1731
1732/* vec_vcmpgtub */
1733
1734static __inline__ vector bool char __attribute__((__always_inline__))
1735vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
1736 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1737}
1738
1739/* vec_vcmpgtsh */
1740
1741static __inline__ vector bool short __attribute__((__always_inline__))
1742vec_vcmpgtsh(vector short __a, vector short __b) {
1743 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1744}
1745
1746/* vec_vcmpgtuh */
1747
1748static __inline__ vector bool short __attribute__((__always_inline__))
1749vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
1750 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1751}
1752
1753/* vec_vcmpgtsw */
1754
1755static __inline__ vector bool int __attribute__((__always_inline__))
1756vec_vcmpgtsw(vector int __a, vector int __b) {
1757 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1758}
1759
1760/* vec_vcmpgtuw */
1761
1762static __inline__ vector bool int __attribute__((__always_inline__))
1763vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
1764 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1765}
1766
1767/* vec_vcmpgtfp */
1768
1769static __inline__ vector bool int __attribute__((__always_inline__))
1770vec_vcmpgtfp(vector float __a, vector float __b) {
1771 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1772}
1773
1774/* vec_cmple */
1775
1776static __inline__ vector bool char __ATTRS_o_ai
1777vec_cmple(vector signed char __a, vector signed char __b) {
1778 return vec_cmpge(__b, __a);
1779}
1780
1781static __inline__ vector bool char __ATTRS_o_ai
1782vec_cmple(vector unsigned char __a, vector unsigned char __b) {
1783 return vec_cmpge(__b, __a);
1784}
1785
1786static __inline__ vector bool short __ATTRS_o_ai
1787vec_cmple(vector signed short __a, vector signed short __b) {
1788 return vec_cmpge(__b, __a);
1789}
1790
1791static __inline__ vector bool short __ATTRS_o_ai
1792vec_cmple(vector unsigned short __a, vector unsigned short __b) {
1793 return vec_cmpge(__b, __a);
1794}
1795
1796static __inline__ vector bool int __ATTRS_o_ai
1797vec_cmple(vector signed int __a, vector signed int __b) {
1798 return vec_cmpge(__b, __a);
1799}
1800
1801static __inline__ vector bool int __ATTRS_o_ai
1802vec_cmple(vector unsigned int __a, vector unsigned int __b) {
1803 return vec_cmpge(__b, __a);
1804}
1805
1806static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
1807 vector float __b) {
1808 return vec_cmpge(__b, __a);
1809}
1810
1811#ifdef __VSX__
1812static __inline__ vector bool long long __ATTRS_o_ai
1813vec_cmple(vector double __a, vector double __b) {
1814 return vec_cmpge(__b, __a);
1815}
1816#endif
1817
1818#ifdef __POWER8_VECTOR__
1819static __inline__ vector bool long long __ATTRS_o_ai
1820vec_cmple(vector signed long long __a, vector signed long long __b) {
1821 return vec_cmpge(__b, __a);
1822}
1823
1824static __inline__ vector bool long long __ATTRS_o_ai
1825vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
1826 return vec_cmpge(__b, __a);
1827}
1828#endif
1829
1830/* vec_cmplt */
1831
1832static __inline__ vector bool char __ATTRS_o_ai
1833vec_cmplt(vector signed char __a, vector signed char __b) {
1834 return vec_cmpgt(__b, __a);
1835}
1836
1837static __inline__ vector bool char __ATTRS_o_ai
1838vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
1839 return vec_cmpgt(__b, __a);
1840}
1841
1842static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
1843 vector short __b) {
1844 return vec_cmpgt(__b, __a);
1845}
1846
1847static __inline__ vector bool short __ATTRS_o_ai
1848vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
1849 return vec_cmpgt(__b, __a);
1850}
1851
1852static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
1853 vector int __b) {
1854 return vec_cmpgt(__b, __a);
1855}
1856
1857static __inline__ vector bool int __ATTRS_o_ai
1858vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
1859 return vec_cmpgt(__b, __a);
1860}
1861
1862static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
1863 vector float __b) {
1864 return vec_cmpgt(__b, __a);
1865}
1866
1867#ifdef __VSX__
1868static __inline__ vector bool long long __ATTRS_o_ai
1869vec_cmplt(vector double __a, vector double __b) {
1870 return vec_cmpgt(__b, __a);
1871}
1872#endif
1873
1874#ifdef __POWER8_VECTOR__
1875static __inline__ vector bool long long __ATTRS_o_ai
1876vec_cmplt(vector signed long long __a, vector signed long long __b) {
1877 return vec_cmpgt(__b, __a);
1878}
1879
1880static __inline__ vector bool long long __ATTRS_o_ai
1881vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
1882 return vec_cmpgt(__b, __a);
1883}
1884
1885/* vec_cntlz */
1886
1887static __inline__ vector signed char __ATTRS_o_ai
1888vec_cntlz(vector signed char __a) {
1889 return __builtin_altivec_vclzb(__a);
1890}
1891static __inline__ vector unsigned char __ATTRS_o_ai
1892vec_cntlz(vector unsigned char __a) {
1893 return __builtin_altivec_vclzb(__a);
1894}
1895static __inline__ vector signed short __ATTRS_o_ai
1896vec_cntlz(vector signed short __a) {
1897 return __builtin_altivec_vclzh(__a);
1898}
1899static __inline__ vector unsigned short __ATTRS_o_ai
1900vec_cntlz(vector unsigned short __a) {
1901 return __builtin_altivec_vclzh(__a);
1902}
1903static __inline__ vector signed int __ATTRS_o_ai
1904vec_cntlz(vector signed int __a) {
1905 return __builtin_altivec_vclzw(__a);
1906}
1907static __inline__ vector unsigned int __ATTRS_o_ai
1908vec_cntlz(vector unsigned int __a) {
1909 return __builtin_altivec_vclzw(__a);
1910}
1911static __inline__ vector signed long long __ATTRS_o_ai
1912vec_cntlz(vector signed long long __a) {
1913 return __builtin_altivec_vclzd(__a);
1914}
1915static __inline__ vector unsigned long long __ATTRS_o_ai
1916vec_cntlz(vector unsigned long long __a) {
1917 return __builtin_altivec_vclzd(__a);
1918}
1919#endif
1920
1921/* vec_cpsgn */
1922
1923#ifdef __VSX__
1924static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
1925 vector float __b) {
1926 return __builtin_vsx_xvcpsgnsp(__a, __b);
1927}
1928
1929static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
1930 vector double __b) {
1931 return __builtin_vsx_xvcpsgndp(__a, __b);
1932}
1933#endif
1934
1935/* vec_ctf */
1936
1937static __inline__ vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) {
1938 return __builtin_altivec_vcfsx(__a, __b);
1939}
1940
1941static __inline__ vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a,
1942 int __b) {
1943 return __builtin_altivec_vcfux((vector int)__a, __b);
1944}
1945
1946#ifdef __VSX__
1947static __inline__ vector double __ATTRS_o_ai
1948vec_ctf(vector unsigned long long __a, int __b) {
1949 vector double __ret = __builtin_convertvector(__a, vector double);
1950 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
1951 return __ret;
1952}
1953
1954static __inline__ vector double __ATTRS_o_ai
1955vec_ctf(vector signed long long __a, int __b) {
1956 vector double __ret = __builtin_convertvector(__a, vector double);
1957 __ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);
1958 return __ret;
1959}
1960#endif
1961
1962/* vec_vcfsx */
1963
1964static __inline__ vector float __attribute__((__always_inline__))
1965vec_vcfsx(vector int __a, int __b) {
1966 return __builtin_altivec_vcfsx(__a, __b);
1967}
1968
1969/* vec_vcfux */
1970
1971static __inline__ vector float __attribute__((__always_inline__))
1972vec_vcfux(vector unsigned int __a, int __b) {
1973 return __builtin_altivec_vcfux((vector int)__a, __b);
1974}
1975
1976/* vec_cts */
1977
1978static __inline__ vector int __ATTRS_o_ai vec_cts(vector float __a, int __b) {
1979 return __builtin_altivec_vctsxs(__a, __b);
1980}
1981
1982#ifdef __VSX__
1983static __inline__ vector signed long long __ATTRS_o_ai
1984vec_cts(vector double __a, int __b) {
1985 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
1986 return __builtin_convertvector(__a, vector signed long long);
1987}
1988#endif
1989
1990/* vec_vctsxs */
1991
1992static __inline__ vector int __attribute__((__always_inline__))
1993vec_vctsxs(vector float __a, int __b) {
1994 return __builtin_altivec_vctsxs(__a, __b);
1995}
1996
1997/* vec_ctu */
1998
1999static __inline__ vector unsigned int __ATTRS_o_ai vec_ctu(vector float __a,
2000 int __b) {
2001 return __builtin_altivec_vctuxs(__a, __b);
2002}
2003
2004#ifdef __VSX__
2005static __inline__ vector unsigned long long __ATTRS_o_ai
2006vec_ctu(vector double __a, int __b) {
2007 __a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);
2008 return __builtin_convertvector(__a, vector unsigned long long);
2009}
2010#endif
2011
2012/* vec_vctuxs */
2013
2014static __inline__ vector unsigned int __attribute__((__always_inline__))
2015vec_vctuxs(vector float __a, int __b) {
2016 return __builtin_altivec_vctuxs(__a, __b);
2017}
2018
2019/* vec_double */
2020
2021#ifdef __VSX__
2022static __inline__ vector double __ATTRS_o_ai
2023vec_double(vector signed long long __a) {
2024 vector double __ret = {__a[0], __a[1]};
2025 return __ret;
2026}
2027
2028static __inline__ vector double __ATTRS_o_ai
2029vec_double(vector unsigned long long __a) {
2030 vector double __ret = {__a[0], __a[1]};
2031 return __ret;
2032}
2033#endif
2034
2035/* vec_div */
2036
2037/* Integer vector divides (vectors are scalarized, elements divided
2038 and the vectors reassembled).
2039*/
2040static __inline__ vector signed char __ATTRS_o_ai
2041vec_div(vector signed char __a, vector signed char __b) {
2042 return __a / __b;
2043}
2044
2045static __inline__ vector unsigned char __ATTRS_o_ai
2046vec_div(vector unsigned char __a, vector unsigned char __b) {
2047 return __a / __b;
2048}
2049
2050static __inline__ vector signed short __ATTRS_o_ai
2051vec_div(vector signed short __a, vector signed short __b) {
2052 return __a / __b;
2053}
2054
2055static __inline__ vector unsigned short __ATTRS_o_ai
2056vec_div(vector unsigned short __a, vector unsigned short __b) {
2057 return __a / __b;
2058}
2059
2060static __inline__ vector signed int __ATTRS_o_ai
2061vec_div(vector signed int __a, vector signed int __b) {
2062 return __a / __b;
2063}
2064
2065static __inline__ vector unsigned int __ATTRS_o_ai
2066vec_div(vector unsigned int __a, vector unsigned int __b) {
2067 return __a / __b;
2068}
2069
2070#ifdef __VSX__
2071static __inline__ vector signed long long __ATTRS_o_ai
2072vec_div(vector signed long long __a, vector signed long long __b) {
2073 return __a / __b;
2074}
2075
2076static __inline__ vector unsigned long long __ATTRS_o_ai
2077vec_div(vector unsigned long long __a, vector unsigned long long __b) {
2078 return __a / __b;
2079}
2080
2081static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
2082 vector float __b) {
2083 return __a / __b;
2084}
2085
2086static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
2087 vector double __b) {
2088 return __a / __b;
2089}
2090#endif
2091
2092/* vec_dss */
2093
2094static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
2095 __builtin_altivec_dss(__a);
2096}
2097
2098/* vec_dssall */
2099
2100static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
2101 __builtin_altivec_dssall();
2102}
2103
2104/* vec_dst */
2105
2106static __inline__ void __attribute__((__always_inline__))
2107vec_dst(const void *__a, int __b, int __c) {
2108 __builtin_altivec_dst(__a, __b, __c);
2109}
2110
2111/* vec_dstst */
2112
2113static __inline__ void __attribute__((__always_inline__))
2114vec_dstst(const void *__a, int __b, int __c) {
2115 __builtin_altivec_dstst(__a, __b, __c);
2116}
2117
2118/* vec_dststt */
2119
2120static __inline__ void __attribute__((__always_inline__))
2121vec_dststt(const void *__a, int __b, int __c) {
2122 __builtin_altivec_dststt(__a, __b, __c);
2123}
2124
2125/* vec_dstt */
2126
2127static __inline__ void __attribute__((__always_inline__))
2128vec_dstt(const void *__a, int __b, int __c) {
2129 __builtin_altivec_dstt(__a, __b, __c);
2130}
2131
2132/* vec_eqv */
2133
2134#ifdef __POWER8_VECTOR__
2135static __inline__ vector signed char __ATTRS_o_ai
2136vec_eqv(vector signed char __a, vector signed char __b) {
2137 return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
2138 (vector unsigned int)__b);
2139}
2140
2141static __inline__ vector unsigned char __ATTRS_o_ai
2142vec_eqv(vector unsigned char __a, vector unsigned char __b) {
2143 return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
2144 (vector unsigned int)__b);
2145}
2146
2147static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
2148 vector bool char __b) {
2149 return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
2150 (vector unsigned int)__b);
2151}
2152
2153static __inline__ vector signed short __ATTRS_o_ai
2154vec_eqv(vector signed short __a, vector signed short __b) {
2155 return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
2156 (vector unsigned int)__b);
2157}
2158
2159static __inline__ vector unsigned short __ATTRS_o_ai
2160vec_eqv(vector unsigned short __a, vector unsigned short __b) {
2161 return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
2162 (vector unsigned int)__b);
2163}
2164
2165static __inline__ vector bool short __ATTRS_o_ai
2166vec_eqv(vector bool short __a, vector bool short __b) {
2167 return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
2168 (vector unsigned int)__b);
2169}
2170
2171static __inline__ vector signed int __ATTRS_o_ai
2172vec_eqv(vector signed int __a, vector signed int __b) {
2173 return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
2174 (vector unsigned int)__b);
2175}
2176
2177static __inline__ vector unsigned int __ATTRS_o_ai
2178vec_eqv(vector unsigned int __a, vector unsigned int __b) {
2179 return __builtin_vsx_xxleqv(__a, __b);
2180}
2181
2182static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
2183 vector bool int __b) {
2184 return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
2185 (vector unsigned int)__b);
2186}
2187
2188static __inline__ vector signed long long __ATTRS_o_ai
2189vec_eqv(vector signed long long __a, vector signed long long __b) {
2190 return (vector signed long long)__builtin_vsx_xxleqv(
2191 (vector unsigned int)__a, (vector unsigned int)__b);
2192}
2193
2194static __inline__ vector unsigned long long __ATTRS_o_ai
2195vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
2196 return (vector unsigned long long)__builtin_vsx_xxleqv(
2197 (vector unsigned int)__a, (vector unsigned int)__b);
2198}
2199
2200static __inline__ vector bool long long __ATTRS_o_ai
2201vec_eqv(vector bool long long __a, vector bool long long __b) {
2202 return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
2203 (vector unsigned int)__b);
2204}
2205
2206static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
2207 vector float __b) {
2208 return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
2209 (vector unsigned int)__b);
2210}
2211
2212static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
2213 vector double __b) {
2214 return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
2215 (vector unsigned int)__b);
2216}
2217#endif
2218
2219/* vec_expte */
2220
2221static __inline__ vector float __attribute__((__always_inline__))
2222vec_expte(vector float __a) {
2223 return __builtin_altivec_vexptefp(__a);
2224}
2225
2226/* vec_vexptefp */
2227
2228static __inline__ vector float __attribute__((__always_inline__))
2229vec_vexptefp(vector float __a) {
2230 return __builtin_altivec_vexptefp(__a);
2231}
2232
2233/* vec_floor */
2234
2235static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
2236#ifdef __VSX__
2237 return __builtin_vsx_xvrspim(__a);
2238#else
2239 return __builtin_altivec_vrfim(__a);
2240#endif
2241}
2242
2243#ifdef __VSX__
2244static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
2245 return __builtin_vsx_xvrdpim(__a);
2246}
2247#endif
2248
2249/* vec_vrfim */
2250
2251static __inline__ vector float __attribute__((__always_inline__))
2252vec_vrfim(vector float __a) {
2253 return __builtin_altivec_vrfim(__a);
2254}
2255
2256/* vec_ld */
2257
2258static __inline__ vector signed char __ATTRS_o_ai
2259vec_ld(int __a, const vector signed char *__b) {
2260 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2261}
2262
2263static __inline__ vector signed char __ATTRS_o_ai
2264vec_ld(int __a, const signed char *__b) {
2265 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2266}
2267
2268static __inline__ vector unsigned char __ATTRS_o_ai
2269vec_ld(int __a, const vector unsigned char *__b) {
2270 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2271}
2272
2273static __inline__ vector unsigned char __ATTRS_o_ai
2274vec_ld(int __a, const unsigned char *__b) {
2275 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2276}
2277
2278static __inline__ vector bool char __ATTRS_o_ai
2279vec_ld(int __a, const vector bool char *__b) {
2280 return (vector bool char)__builtin_altivec_lvx(__a, __b);
2281}
2282
2283static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
2284 const vector short *__b) {
2285 return (vector short)__builtin_altivec_lvx(__a, __b);
2286}
2287
2288static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
2289 return (vector short)__builtin_altivec_lvx(__a, __b);
2290}
2291
2292static __inline__ vector unsigned short __ATTRS_o_ai
2293vec_ld(int __a, const vector unsigned short *__b) {
2294 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2295}
2296
2297static __inline__ vector unsigned short __ATTRS_o_ai
2298vec_ld(int __a, const unsigned short *__b) {
2299 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2300}
2301
2302static __inline__ vector bool short __ATTRS_o_ai
2303vec_ld(int __a, const vector bool short *__b) {
2304 return (vector bool short)__builtin_altivec_lvx(__a, __b);
2305}
2306
2307static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
2308 const vector pixel *__b) {
2309 return (vector pixel)__builtin_altivec_lvx(__a, __b);
2310}
2311
2312static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
2313 const vector int *__b) {
2314 return (vector int)__builtin_altivec_lvx(__a, __b);
2315}
2316
2317static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
2318 return (vector int)__builtin_altivec_lvx(__a, __b);
2319}
2320
2321static __inline__ vector unsigned int __ATTRS_o_ai
2322vec_ld(int __a, const vector unsigned int *__b) {
2323 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2324}
2325
2326static __inline__ vector unsigned int __ATTRS_o_ai
2327vec_ld(int __a, const unsigned int *__b) {
2328 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2329}
2330
2331static __inline__ vector bool int __ATTRS_o_ai
2332vec_ld(int __a, const vector bool int *__b) {
2333 return (vector bool int)__builtin_altivec_lvx(__a, __b);
2334}
2335
2336static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
2337 const vector float *__b) {
2338 return (vector float)__builtin_altivec_lvx(__a, __b);
2339}
2340
2341static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
2342 return (vector float)__builtin_altivec_lvx(__a, __b);
2343}
2344
2345/* vec_lvx */
2346
2347static __inline__ vector signed char __ATTRS_o_ai
2348vec_lvx(int __a, const vector signed char *__b) {
2349 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2350}
2351
2352static __inline__ vector signed char __ATTRS_o_ai
2353vec_lvx(int __a, const signed char *__b) {
2354 return (vector signed char)__builtin_altivec_lvx(__a, __b);
2355}
2356
2357static __inline__ vector unsigned char __ATTRS_o_ai
2358vec_lvx(int __a, const vector unsigned char *__b) {
2359 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2360}
2361
2362static __inline__ vector unsigned char __ATTRS_o_ai
2363vec_lvx(int __a, const unsigned char *__b) {
2364 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
2365}
2366
2367static __inline__ vector bool char __ATTRS_o_ai
2368vec_lvx(int __a, const vector bool char *__b) {
2369 return (vector bool char)__builtin_altivec_lvx(__a, __b);
2370}
2371
2372static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
2373 const vector short *__b) {
2374 return (vector short)__builtin_altivec_lvx(__a, __b);
2375}
2376
2377static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
2378 return (vector short)__builtin_altivec_lvx(__a, __b);
2379}
2380
2381static __inline__ vector unsigned short __ATTRS_o_ai
2382vec_lvx(int __a, const vector unsigned short *__b) {
2383 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2384}
2385
2386static __inline__ vector unsigned short __ATTRS_o_ai
2387vec_lvx(int __a, const unsigned short *__b) {
2388 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
2389}
2390
2391static __inline__ vector bool short __ATTRS_o_ai
2392vec_lvx(int __a, const vector bool short *__b) {
2393 return (vector bool short)__builtin_altivec_lvx(__a, __b);
2394}
2395
2396static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
2397 const vector pixel *__b) {
2398 return (vector pixel)__builtin_altivec_lvx(__a, __b);
2399}
2400
2401static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
2402 const vector int *__b) {
2403 return (vector int)__builtin_altivec_lvx(__a, __b);
2404}
2405
2406static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
2407 return (vector int)__builtin_altivec_lvx(__a, __b);
2408}
2409
2410static __inline__ vector unsigned int __ATTRS_o_ai
2411vec_lvx(int __a, const vector unsigned int *__b) {
2412 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2413}
2414
2415static __inline__ vector unsigned int __ATTRS_o_ai
2416vec_lvx(int __a, const unsigned int *__b) {
2417 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
2418}
2419
2420static __inline__ vector bool int __ATTRS_o_ai
2421vec_lvx(int __a, const vector bool int *__b) {
2422 return (vector bool int)__builtin_altivec_lvx(__a, __b);
2423}
2424
2425static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
2426 const vector float *__b) {
2427 return (vector float)__builtin_altivec_lvx(__a, __b);
2428}
2429
2430static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
2431 return (vector float)__builtin_altivec_lvx(__a, __b);
2432}
2433
2434/* vec_lde */
2435
2436static __inline__ vector signed char __ATTRS_o_ai
2437vec_lde(int __a, const signed char *__b) {
2438 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
2439}
2440
2441static __inline__ vector unsigned char __ATTRS_o_ai
2442vec_lde(int __a, const unsigned char *__b) {
2443 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
2444}
2445
2446static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
2447 return (vector short)__builtin_altivec_lvehx(__a, __b);
2448}
2449
2450static __inline__ vector unsigned short __ATTRS_o_ai
2451vec_lde(int __a, const unsigned short *__b) {
2452 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
2453}
2454
2455static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
2456 return (vector int)__builtin_altivec_lvewx(__a, __b);
2457}
2458
2459static __inline__ vector unsigned int __ATTRS_o_ai
2460vec_lde(int __a, const unsigned int *__b) {
2461 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
2462}
2463
2464static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
2465 return (vector float)__builtin_altivec_lvewx(__a, __b);
2466}
2467
2468/* vec_lvebx */
2469
2470static __inline__ vector signed char __ATTRS_o_ai
2471vec_lvebx(int __a, const signed char *__b) {
2472 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
2473}
2474
2475static __inline__ vector unsigned char __ATTRS_o_ai
2476vec_lvebx(int __a, const unsigned char *__b) {
2477 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
2478}
2479
2480/* vec_lvehx */
2481
2482static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
2483 const short *__b) {
2484 return (vector short)__builtin_altivec_lvehx(__a, __b);
2485}
2486
2487static __inline__ vector unsigned short __ATTRS_o_ai
2488vec_lvehx(int __a, const unsigned short *__b) {
2489 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
2490}
2491
2492/* vec_lvewx */
2493
2494static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
2495 return (vector int)__builtin_altivec_lvewx(__a, __b);
2496}
2497
2498static __inline__ vector unsigned int __ATTRS_o_ai
2499vec_lvewx(int __a, const unsigned int *__b) {
2500 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
2501}
2502
2503static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
2504 const float *__b) {
2505 return (vector float)__builtin_altivec_lvewx(__a, __b);
2506}
2507
2508/* vec_ldl */
2509
2510static __inline__ vector signed char __ATTRS_o_ai
2511vec_ldl(int __a, const vector signed char *__b) {
2512 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2513}
2514
2515static __inline__ vector signed char __ATTRS_o_ai
2516vec_ldl(int __a, const signed char *__b) {
2517 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2518}
2519
2520static __inline__ vector unsigned char __ATTRS_o_ai
2521vec_ldl(int __a, const vector unsigned char *__b) {
2522 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2523}
2524
2525static __inline__ vector unsigned char __ATTRS_o_ai
2526vec_ldl(int __a, const unsigned char *__b) {
2527 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2528}
2529
2530static __inline__ vector bool char __ATTRS_o_ai
2531vec_ldl(int __a, const vector bool char *__b) {
2532 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
2533}
2534
2535static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
2536 const vector short *__b) {
2537 return (vector short)__builtin_altivec_lvxl(__a, __b);
2538}
2539
2540static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
2541 return (vector short)__builtin_altivec_lvxl(__a, __b);
2542}
2543
2544static __inline__ vector unsigned short __ATTRS_o_ai
2545vec_ldl(int __a, const vector unsigned short *__b) {
2546 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2547}
2548
2549static __inline__ vector unsigned short __ATTRS_o_ai
2550vec_ldl(int __a, const unsigned short *__b) {
2551 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2552}
2553
2554static __inline__ vector bool short __ATTRS_o_ai
2555vec_ldl(int __a, const vector bool short *__b) {
2556 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
2557}
2558
2559static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
2560 const vector pixel *__b) {
2561 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
2562}
2563
2564static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
2565 const vector int *__b) {
2566 return (vector int)__builtin_altivec_lvxl(__a, __b);
2567}
2568
2569static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
2570 return (vector int)__builtin_altivec_lvxl(__a, __b);
2571}
2572
2573static __inline__ vector unsigned int __ATTRS_o_ai
2574vec_ldl(int __a, const vector unsigned int *__b) {
2575 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2576}
2577
2578static __inline__ vector unsigned int __ATTRS_o_ai
2579vec_ldl(int __a, const unsigned int *__b) {
2580 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2581}
2582
2583static __inline__ vector bool int __ATTRS_o_ai
2584vec_ldl(int __a, const vector bool int *__b) {
2585 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
2586}
2587
2588static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
2589 const vector float *__b) {
2590 return (vector float)__builtin_altivec_lvxl(__a, __b);
2591}
2592
2593static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
2594 return (vector float)__builtin_altivec_lvxl(__a, __b);
2595}
2596
2597/* vec_lvxl */
2598
2599static __inline__ vector signed char __ATTRS_o_ai
2600vec_lvxl(int __a, const vector signed char *__b) {
2601 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2602}
2603
2604static __inline__ vector signed char __ATTRS_o_ai
2605vec_lvxl(int __a, const signed char *__b) {
2606 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
2607}
2608
2609static __inline__ vector unsigned char __ATTRS_o_ai
2610vec_lvxl(int __a, const vector unsigned char *__b) {
2611 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2612}
2613
2614static __inline__ vector unsigned char __ATTRS_o_ai
2615vec_lvxl(int __a, const unsigned char *__b) {
2616 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
2617}
2618
2619static __inline__ vector bool char __ATTRS_o_ai
2620vec_lvxl(int __a, const vector bool char *__b) {
2621 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
2622}
2623
2624static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
2625 const vector short *__b) {
2626 return (vector short)__builtin_altivec_lvxl(__a, __b);
2627}
2628
2629static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
2630 const short *__b) {
2631 return (vector short)__builtin_altivec_lvxl(__a, __b);
2632}
2633
2634static __inline__ vector unsigned short __ATTRS_o_ai
2635vec_lvxl(int __a, const vector unsigned short *__b) {
2636 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2637}
2638
2639static __inline__ vector unsigned short __ATTRS_o_ai
2640vec_lvxl(int __a, const unsigned short *__b) {
2641 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
2642}
2643
2644static __inline__ vector bool short __ATTRS_o_ai
2645vec_lvxl(int __a, const vector bool short *__b) {
2646 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
2647}
2648
2649static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
2650 const vector pixel *__b) {
2651 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
2652}
2653
2654static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
2655 const vector int *__b) {
2656 return (vector int)__builtin_altivec_lvxl(__a, __b);
2657}
2658
2659static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
2660 return (vector int)__builtin_altivec_lvxl(__a, __b);
2661}
2662
2663static __inline__ vector unsigned int __ATTRS_o_ai
2664vec_lvxl(int __a, const vector unsigned int *__b) {
2665 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2666}
2667
2668static __inline__ vector unsigned int __ATTRS_o_ai
2669vec_lvxl(int __a, const unsigned int *__b) {
2670 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
2671}
2672
2673static __inline__ vector bool int __ATTRS_o_ai
2674vec_lvxl(int __a, const vector bool int *__b) {
2675 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
2676}
2677
2678static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
2679 const vector float *__b) {
2680 return (vector float)__builtin_altivec_lvxl(__a, __b);
2681}
2682
2683static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
2684 const float *__b) {
2685 return (vector float)__builtin_altivec_lvxl(__a, __b);
2686}
2687
2688/* vec_loge */
2689
2690static __inline__ vector float __attribute__((__always_inline__))
2691vec_loge(vector float __a) {
2692 return __builtin_altivec_vlogefp(__a);
2693}
2694
2695/* vec_vlogefp */
2696
2697static __inline__ vector float __attribute__((__always_inline__))
2698vec_vlogefp(vector float __a) {
2699 return __builtin_altivec_vlogefp(__a);
2700}
2701
2702/* vec_lvsl */
2703
2704#ifdef __LITTLE_ENDIAN__
2705static __inline__ vector unsigned char __ATTRS_o_ai
2706 __attribute__((__deprecated__("use assignment for unaligned little endian \
2707loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
2708 vector unsigned char mask =
2709 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2710 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2711 7, 6, 5, 4, 3, 2, 1, 0};
2712 return vec_perm(mask, mask, reverse);
2713}
2714#else
2715static __inline__ vector unsigned char __ATTRS_o_ai
2716vec_lvsl(int __a, const signed char *__b) {
2717 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2718}
2719#endif
2720
2721#ifdef __LITTLE_ENDIAN__
2722static __inline__ vector unsigned char __ATTRS_o_ai
2723 __attribute__((__deprecated__("use assignment for unaligned little endian \
2724loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
2725 vector unsigned char mask =
2726 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2727 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2728 7, 6, 5, 4, 3, 2, 1, 0};
2729 return vec_perm(mask, mask, reverse);
2730}
2731#else
2732static __inline__ vector unsigned char __ATTRS_o_ai
2733vec_lvsl(int __a, const unsigned char *__b) {
2734 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2735}
2736#endif
2737
2738#ifdef __LITTLE_ENDIAN__
2739static __inline__ vector unsigned char __ATTRS_o_ai
2740 __attribute__((__deprecated__("use assignment for unaligned little endian \
2741loads/stores"))) vec_lvsl(int __a, const short *__b) {
2742 vector unsigned char mask =
2743 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2744 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2745 7, 6, 5, 4, 3, 2, 1, 0};
2746 return vec_perm(mask, mask, reverse);
2747}
2748#else
2749static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
2750 const short *__b) {
2751 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2752}
2753#endif
2754
2755#ifdef __LITTLE_ENDIAN__
2756static __inline__ vector unsigned char __ATTRS_o_ai
2757 __attribute__((__deprecated__("use assignment for unaligned little endian \
2758loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
2759 vector unsigned char mask =
2760 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2761 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2762 7, 6, 5, 4, 3, 2, 1, 0};
2763 return vec_perm(mask, mask, reverse);
2764}
2765#else
2766static __inline__ vector unsigned char __ATTRS_o_ai
2767vec_lvsl(int __a, const unsigned short *__b) {
2768 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2769}
2770#endif
2771
2772#ifdef __LITTLE_ENDIAN__
2773static __inline__ vector unsigned char __ATTRS_o_ai
2774 __attribute__((__deprecated__("use assignment for unaligned little endian \
2775loads/stores"))) vec_lvsl(int __a, const int *__b) {
2776 vector unsigned char mask =
2777 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2778 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2779 7, 6, 5, 4, 3, 2, 1, 0};
2780 return vec_perm(mask, mask, reverse);
2781}
2782#else
2783static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
2784 const int *__b) {
2785 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2786}
2787#endif
2788
2789#ifdef __LITTLE_ENDIAN__
2790static __inline__ vector unsigned char __ATTRS_o_ai
2791 __attribute__((__deprecated__("use assignment for unaligned little endian \
2792loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
2793 vector unsigned char mask =
2794 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2795 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2796 7, 6, 5, 4, 3, 2, 1, 0};
2797 return vec_perm(mask, mask, reverse);
2798}
2799#else
2800static __inline__ vector unsigned char __ATTRS_o_ai
2801vec_lvsl(int __a, const unsigned int *__b) {
2802 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2803}
2804#endif
2805
2806#ifdef __LITTLE_ENDIAN__
2807static __inline__ vector unsigned char __ATTRS_o_ai
2808 __attribute__((__deprecated__("use assignment for unaligned little endian \
2809loads/stores"))) vec_lvsl(int __a, const float *__b) {
2810 vector unsigned char mask =
2811 (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2812 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2813 7, 6, 5, 4, 3, 2, 1, 0};
2814 return vec_perm(mask, mask, reverse);
2815}
2816#else
2817static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
2818 const float *__b) {
2819 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
2820}
2821#endif
2822
2823/* vec_lvsr */
2824
2825#ifdef __LITTLE_ENDIAN__
2826static __inline__ vector unsigned char __ATTRS_o_ai
2827 __attribute__((__deprecated__("use assignment for unaligned little endian \
2828loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
2829 vector unsigned char mask =
2830 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2831 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2832 7, 6, 5, 4, 3, 2, 1, 0};
2833 return vec_perm(mask, mask, reverse);
2834}
2835#else
2836static __inline__ vector unsigned char __ATTRS_o_ai
2837vec_lvsr(int __a, const signed char *__b) {
2838 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2839}
2840#endif
2841
2842#ifdef __LITTLE_ENDIAN__
2843static __inline__ vector unsigned char __ATTRS_o_ai
2844 __attribute__((__deprecated__("use assignment for unaligned little endian \
2845loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
2846 vector unsigned char mask =
2847 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2848 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2849 7, 6, 5, 4, 3, 2, 1, 0};
2850 return vec_perm(mask, mask, reverse);
2851}
2852#else
2853static __inline__ vector unsigned char __ATTRS_o_ai
2854vec_lvsr(int __a, const unsigned char *__b) {
2855 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2856}
2857#endif
2858
2859#ifdef __LITTLE_ENDIAN__
2860static __inline__ vector unsigned char __ATTRS_o_ai
2861 __attribute__((__deprecated__("use assignment for unaligned little endian \
2862loads/stores"))) vec_lvsr(int __a, const short *__b) {
2863 vector unsigned char mask =
2864 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2865 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2866 7, 6, 5, 4, 3, 2, 1, 0};
2867 return vec_perm(mask, mask, reverse);
2868}
2869#else
2870static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
2871 const short *__b) {
2872 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2873}
2874#endif
2875
2876#ifdef __LITTLE_ENDIAN__
2877static __inline__ vector unsigned char __ATTRS_o_ai
2878 __attribute__((__deprecated__("use assignment for unaligned little endian \
2879loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
2880 vector unsigned char mask =
2881 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2882 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2883 7, 6, 5, 4, 3, 2, 1, 0};
2884 return vec_perm(mask, mask, reverse);
2885}
2886#else
2887static __inline__ vector unsigned char __ATTRS_o_ai
2888vec_lvsr(int __a, const unsigned short *__b) {
2889 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2890}
2891#endif
2892
2893#ifdef __LITTLE_ENDIAN__
2894static __inline__ vector unsigned char __ATTRS_o_ai
2895 __attribute__((__deprecated__("use assignment for unaligned little endian \
2896loads/stores"))) vec_lvsr(int __a, const int *__b) {
2897 vector unsigned char mask =
2898 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2899 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2900 7, 6, 5, 4, 3, 2, 1, 0};
2901 return vec_perm(mask, mask, reverse);
2902}
2903#else
2904static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
2905 const int *__b) {
2906 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2907}
2908#endif
2909
2910#ifdef __LITTLE_ENDIAN__
2911static __inline__ vector unsigned char __ATTRS_o_ai
2912 __attribute__((__deprecated__("use assignment for unaligned little endian \
2913loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
2914 vector unsigned char mask =
2915 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2916 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2917 7, 6, 5, 4, 3, 2, 1, 0};
2918 return vec_perm(mask, mask, reverse);
2919}
2920#else
2921static __inline__ vector unsigned char __ATTRS_o_ai
2922vec_lvsr(int __a, const unsigned int *__b) {
2923 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2924}
2925#endif
2926
2927#ifdef __LITTLE_ENDIAN__
2928static __inline__ vector unsigned char __ATTRS_o_ai
2929 __attribute__((__deprecated__("use assignment for unaligned little endian \
2930loads/stores"))) vec_lvsr(int __a, const float *__b) {
2931 vector unsigned char mask =
2932 (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2933 vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
2934 7, 6, 5, 4, 3, 2, 1, 0};
2935 return vec_perm(mask, mask, reverse);
2936}
2937#else
2938static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
2939 const float *__b) {
2940 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
2941}
2942#endif
2943
2944/* vec_madd */
2945static __inline__ vector signed short __ATTRS_o_ai
2946vec_mladd(vector signed short, vector signed short, vector signed short);
2947static __inline__ vector signed short __ATTRS_o_ai
2948vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
2949static __inline__ vector signed short __ATTRS_o_ai
2950vec_mladd(vector unsigned short, vector signed short, vector signed short);
2951static __inline__ vector unsigned short __ATTRS_o_ai
2952vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
2953
2954static __inline__ vector signed short __ATTRS_o_ai vec_madd(
2955 vector signed short __a, vector signed short __b, vector signed short __c) {
2956 return vec_mladd(__a, __b, __c);
2957}
2958
2959static __inline__ vector signed short __ATTRS_o_ai
2960vec_madd(vector signed short __a, vector unsigned short __b,
2961 vector unsigned short __c) {
2962 return vec_mladd(__a, __b, __c);
2963}
2964
2965static __inline__ vector signed short __ATTRS_o_ai
2966vec_madd(vector unsigned short __a, vector signed short __b,
2967 vector signed short __c) {
2968 return vec_mladd(__a, __b, __c);
2969}
2970
2971static __inline__ vector unsigned short __ATTRS_o_ai
2972vec_madd(vector unsigned short __a, vector unsigned short __b,
2973 vector unsigned short __c) {
2974 return vec_mladd(__a, __b, __c);
2975}
2976
2977static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
2978 vector float __b,
2979 vector float __c) {
2980#ifdef __VSX__
2981 return __builtin_vsx_xvmaddasp(__a, __b, __c);
2982#else
2983 return __builtin_altivec_vmaddfp(__a, __b, __c);
2984#endif
2985}
2986
2987#ifdef __VSX__
2988static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
2989 vector double __b,
2990 vector double __c) {
2991 return __builtin_vsx_xvmaddadp(__a, __b, __c);
2992}
2993#endif
2994
2995/* vec_vmaddfp */
2996
2997static __inline__ vector float __attribute__((__always_inline__))
2998vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
2999 return __builtin_altivec_vmaddfp(__a, __b, __c);
3000}
3001
3002/* vec_madds */
3003
3004static __inline__ vector signed short __attribute__((__always_inline__))
3005vec_madds(vector signed short __a, vector signed short __b,
3006 vector signed short __c) {
3007 return __builtin_altivec_vmhaddshs(__a, __b, __c);
3008}
3009
3010/* vec_vmhaddshs */
3011static __inline__ vector signed short __attribute__((__always_inline__))
3012vec_vmhaddshs(vector signed short __a, vector signed short __b,
3013 vector signed short __c) {
3014 return __builtin_altivec_vmhaddshs(__a, __b, __c);
3015}
3016
3017/* vec_msub */
3018
3019#ifdef __VSX__
3020static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
3021 vector float __b,
3022 vector float __c) {
3023 return __builtin_vsx_xvmsubasp(__a, __b, __c);
3024}
3025
3026static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
3027 vector double __b,
3028 vector double __c) {
3029 return __builtin_vsx_xvmsubadp(__a, __b, __c);
3030}
3031#endif
3032
3033/* vec_max */
3034
3035static __inline__ vector signed char __ATTRS_o_ai
3036vec_max(vector signed char __a, vector signed char __b) {
3037 return __builtin_altivec_vmaxsb(__a, __b);
3038}
3039
3040static __inline__ vector signed char __ATTRS_o_ai
3041vec_max(vector bool char __a, vector signed char __b) {
3042 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
3043}
3044
3045static __inline__ vector signed char __ATTRS_o_ai
3046vec_max(vector signed char __a, vector bool char __b) {
3047 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
3048}
3049
3050static __inline__ vector unsigned char __ATTRS_o_ai
3051vec_max(vector unsigned char __a, vector unsigned char __b) {
3052 return __builtin_altivec_vmaxub(__a, __b);
3053}
3054
3055static __inline__ vector unsigned char __ATTRS_o_ai
3056vec_max(vector bool char __a, vector unsigned char __b) {
3057 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
3058}
3059
3060static __inline__ vector unsigned char __ATTRS_o_ai
3061vec_max(vector unsigned char __a, vector bool char __b) {
3062 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
3063}
3064
3065static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
3066 vector short __b) {
3067 return __builtin_altivec_vmaxsh(__a, __b);
3068}
3069
3070static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
3071 vector short __b) {
3072 return __builtin_altivec_vmaxsh((vector short)__a, __b);
3073}
3074
3075static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
3076 vector bool short __b) {
3077 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
3078}
3079
3080static __inline__ vector unsigned short __ATTRS_o_ai
3081vec_max(vector unsigned short __a, vector unsigned short __b) {
3082 return __builtin_altivec_vmaxuh(__a, __b);
3083}
3084
3085static __inline__ vector unsigned short __ATTRS_o_ai
3086vec_max(vector bool short __a, vector unsigned short __b) {
3087 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
3088}
3089
3090static __inline__ vector unsigned short __ATTRS_o_ai
3091vec_max(vector unsigned short __a, vector bool short __b) {
3092 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
3093}
3094
3095static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
3096 vector int __b) {
3097 return __builtin_altivec_vmaxsw(__a, __b);
3098}
3099
3100static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
3101 vector int __b) {
3102 return __builtin_altivec_vmaxsw((vector int)__a, __b);
3103}
3104
3105static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
3106 vector bool int __b) {
3107 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
3108}
3109
3110static __inline__ vector unsigned int __ATTRS_o_ai
3111vec_max(vector unsigned int __a, vector unsigned int __b) {
3112 return __builtin_altivec_vmaxuw(__a, __b);
3113}
3114
3115static __inline__ vector unsigned int __ATTRS_o_ai
3116vec_max(vector bool int __a, vector unsigned int __b) {
3117 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
3118}
3119
3120static __inline__ vector unsigned int __ATTRS_o_ai
3121vec_max(vector unsigned int __a, vector bool int __b) {
3122 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
3123}
3124
3125#ifdef __POWER8_VECTOR__
3126static __inline__ vector signed long long __ATTRS_o_ai
3127vec_max(vector signed long long __a, vector signed long long __b) {
3128 return __builtin_altivec_vmaxsd(__a, __b);
3129}
3130
3131static __inline__ vector signed long long __ATTRS_o_ai
3132vec_max(vector bool long long __a, vector signed long long __b) {
3133 return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
3134}
3135
3136static __inline__ vector signed long long __ATTRS_o_ai
3137vec_max(vector signed long long __a, vector bool long long __b) {
3138 return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
3139}
3140
3141static __inline__ vector unsigned long long __ATTRS_o_ai
3142vec_max(vector unsigned long long __a, vector unsigned long long __b) {
3143 return __builtin_altivec_vmaxud(__a, __b);
3144}
3145
3146static __inline__ vector unsigned long long __ATTRS_o_ai
3147vec_max(vector bool long long __a, vector unsigned long long __b) {
3148 return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
3149}
3150
3151static __inline__ vector unsigned long long __ATTRS_o_ai
3152vec_max(vector unsigned long long __a, vector bool long long __b) {
3153 return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
3154}
3155#endif
3156
3157static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
3158 vector float __b) {
3159#ifdef __VSX__
3160 return __builtin_vsx_xvmaxsp(__a, __b);
3161#else
3162 return __builtin_altivec_vmaxfp(__a, __b);
3163#endif
3164}
3165
3166#ifdef __VSX__
3167static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
3168 vector double __b) {
3169 return __builtin_vsx_xvmaxdp(__a, __b);
3170}
3171#endif
3172
3173/* vec_vmaxsb */
3174
3175static __inline__ vector signed char __ATTRS_o_ai
3176vec_vmaxsb(vector signed char __a, vector signed char __b) {
3177 return __builtin_altivec_vmaxsb(__a, __b);
3178}
3179
3180static __inline__ vector signed char __ATTRS_o_ai
3181vec_vmaxsb(vector bool char __a, vector signed char __b) {
3182 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
3183}
3184
3185static __inline__ vector signed char __ATTRS_o_ai
3186vec_vmaxsb(vector signed char __a, vector bool char __b) {
3187 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
3188}
3189
3190/* vec_vmaxub */
3191
3192static __inline__ vector unsigned char __ATTRS_o_ai
3193vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
3194 return __builtin_altivec_vmaxub(__a, __b);
3195}
3196
3197static __inline__ vector unsigned char __ATTRS_o_ai
3198vec_vmaxub(vector bool char __a, vector unsigned char __b) {
3199 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
3200}
3201
3202static __inline__ vector unsigned char __ATTRS_o_ai
3203vec_vmaxub(vector unsigned char __a, vector bool char __b) {
3204 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
3205}
3206
3207/* vec_vmaxsh */
3208
3209static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
3210 vector short __b) {
3211 return __builtin_altivec_vmaxsh(__a, __b);
3212}
3213
3214static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
3215 vector short __b) {
3216 return __builtin_altivec_vmaxsh((vector short)__a, __b);
3217}
3218
3219static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
3220 vector bool short __b) {
3221 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
3222}
3223
3224/* vec_vmaxuh */
3225
3226static __inline__ vector unsigned short __ATTRS_o_ai
3227vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
3228 return __builtin_altivec_vmaxuh(__a, __b);
3229}
3230
3231static __inline__ vector unsigned short __ATTRS_o_ai
3232vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
3233 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
3234}
3235
3236static __inline__ vector unsigned short __ATTRS_o_ai
3237vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
3238 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
3239}
3240
3241/* vec_vmaxsw */
3242
3243static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
3244 vector int __b) {
3245 return __builtin_altivec_vmaxsw(__a, __b);
3246}
3247
3248static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
3249 vector int __b) {
3250 return __builtin_altivec_vmaxsw((vector int)__a, __b);
3251}
3252
3253static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
3254 vector bool int __b) {
3255 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
3256}
3257
3258/* vec_vmaxuw */
3259
3260static __inline__ vector unsigned int __ATTRS_o_ai
3261vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
3262 return __builtin_altivec_vmaxuw(__a, __b);
3263}
3264
3265static __inline__ vector unsigned int __ATTRS_o_ai
3266vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
3267 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
3268}
3269
3270static __inline__ vector unsigned int __ATTRS_o_ai
3271vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
3272 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
3273}
3274
3275/* vec_vmaxfp */
3276
3277static __inline__ vector float __attribute__((__always_inline__))
3278vec_vmaxfp(vector float __a, vector float __b) {
3279#ifdef __VSX__
3280 return __builtin_vsx_xvmaxsp(__a, __b);
3281#else
3282 return __builtin_altivec_vmaxfp(__a, __b);
3283#endif
3284}
3285
3286/* vec_mergeh */
3287
3288static __inline__ vector signed char __ATTRS_o_ai
3289vec_mergeh(vector signed char __a, vector signed char __b) {
3290 return vec_perm(__a, __b,
3291 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3292 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3293 0x06, 0x16, 0x07, 0x17));
3294}
3295
3296static __inline__ vector unsigned char __ATTRS_o_ai
3297vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
3298 return vec_perm(__a, __b,
3299 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3300 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3301 0x06, 0x16, 0x07, 0x17));
3302}
3303
3304static __inline__ vector bool char __ATTRS_o_ai
3305vec_mergeh(vector bool char __a, vector bool char __b) {
3306 return vec_perm(__a, __b,
3307 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3308 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3309 0x06, 0x16, 0x07, 0x17));
3310}
3311
3312static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
3313 vector short __b) {
3314 return vec_perm(__a, __b,
3315 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3316 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3317 0x06, 0x07, 0x16, 0x17));
3318}
3319
3320static __inline__ vector unsigned short __ATTRS_o_ai
3321vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
3322 return vec_perm(__a, __b,
3323 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3324 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3325 0x06, 0x07, 0x16, 0x17));
3326}
3327
3328static __inline__ vector bool short __ATTRS_o_ai
3329vec_mergeh(vector bool short __a, vector bool short __b) {
3330 return vec_perm(__a, __b,
3331 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3332 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3333 0x06, 0x07, 0x16, 0x17));
3334}
3335
3336static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
3337 vector pixel __b) {
3338 return vec_perm(__a, __b,
3339 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3340 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3341 0x06, 0x07, 0x16, 0x17));
3342}
3343
3344static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
3345 vector int __b) {
3346 return vec_perm(__a, __b,
3347 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3348 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3349 0x14, 0x15, 0x16, 0x17));
3350}
3351
3352static __inline__ vector unsigned int __ATTRS_o_ai
3353vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
3354 return vec_perm(__a, __b,
3355 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3356 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3357 0x14, 0x15, 0x16, 0x17));
3358}
3359
3360static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
3361 vector bool int __b) {
3362 return vec_perm(__a, __b,
3363 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3364 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3365 0x14, 0x15, 0x16, 0x17));
3366}
3367
3368static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
3369 vector float __b) {
3370 return vec_perm(__a, __b,
3371 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3372 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3373 0x14, 0x15, 0x16, 0x17));
3374}
3375
3376#ifdef __VSX__
3377static __inline__ vector signed long long __ATTRS_o_ai
3378vec_mergeh(vector signed long long __a, vector signed long long __b) {
3379 return vec_perm(__a, __b,
3380 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3381 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3382 0x14, 0x15, 0x16, 0x17));
3383}
3384
3385static __inline__ vector signed long long __ATTRS_o_ai
3386vec_mergeh(vector signed long long __a, vector bool long long __b) {
3387 return vec_perm(__a, (vector signed long long)__b,
3388 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3389 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3390 0x14, 0x15, 0x16, 0x17));
3391}
3392
3393static __inline__ vector signed long long __ATTRS_o_ai
3394vec_mergeh(vector bool long long __a, vector signed long long __b) {
3395 return vec_perm((vector signed long long)__a, __b,
3396 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3397 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3398 0x14, 0x15, 0x16, 0x17));
3399}
3400
3401static __inline__ vector unsigned long long __ATTRS_o_ai
3402vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
3403 return vec_perm(__a, __b,
3404 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3405 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3406 0x14, 0x15, 0x16, 0x17));
3407}
3408
3409static __inline__ vector unsigned long long __ATTRS_o_ai
3410vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
3411 return vec_perm(__a, (vector unsigned long long)__b,
3412 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3413 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3414 0x14, 0x15, 0x16, 0x17));
3415}
3416
3417static __inline__ vector unsigned long long __ATTRS_o_ai
3418vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
3419 return vec_perm((vector unsigned long long)__a, __b,
3420 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3421 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3422 0x14, 0x15, 0x16, 0x17));
3423}
3424
3425static __inline__ vector bool long long __ATTRS_o_ai
3426vec_mergeh(vector bool long long __a, vector bool long long __b) {
3427 return vec_perm(__a, __b,
3428 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3429 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3430 0x14, 0x15, 0x16, 0x17));
3431}
3432
3433static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
3434 vector double __b) {
3435 return vec_perm(__a, __b,
3436 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3437 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3438 0x14, 0x15, 0x16, 0x17));
3439}
3440static __inline__ vector double __ATTRS_o_ai
3441vec_mergeh(vector double __a, vector bool long long __b) {
3442 return vec_perm(__a, (vector double)__b,
3443 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3444 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3445 0x14, 0x15, 0x16, 0x17));
3446}
3447static __inline__ vector double __ATTRS_o_ai
3448vec_mergeh(vector bool long long __a, vector double __b) {
3449 return vec_perm((vector double)__a, __b,
3450 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
3451 0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
3452 0x14, 0x15, 0x16, 0x17));
3453}
3454#endif
3455
3456/* vec_vmrghb */
3457
3458#define __builtin_altivec_vmrghb vec_vmrghb
3459
3460static __inline__ vector signed char __ATTRS_o_ai
3461vec_vmrghb(vector signed char __a, vector signed char __b) {
3462 return vec_perm(__a, __b,
3463 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3464 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3465 0x06, 0x16, 0x07, 0x17));
3466}
3467
3468static __inline__ vector unsigned char __ATTRS_o_ai
3469vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
3470 return vec_perm(__a, __b,
3471 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3472 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3473 0x06, 0x16, 0x07, 0x17));
3474}
3475
3476static __inline__ vector bool char __ATTRS_o_ai
3477vec_vmrghb(vector bool char __a, vector bool char __b) {
3478 return vec_perm(__a, __b,
3479 (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
3480 0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
3481 0x06, 0x16, 0x07, 0x17));
3482}
3483
3484/* vec_vmrghh */
3485
3486#define __builtin_altivec_vmrghh vec_vmrghh
3487
3488static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
3489 vector short __b) {
3490 return vec_perm(__a, __b,
3491 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3492 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3493 0x06, 0x07, 0x16, 0x17));
3494}
3495
3496static __inline__ vector unsigned short __ATTRS_o_ai
3497vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
3498 return vec_perm(__a, __b,
3499 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3500 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3501 0x06, 0x07, 0x16, 0x17));
3502}
3503
3504static __inline__ vector bool short __ATTRS_o_ai
3505vec_vmrghh(vector bool short __a, vector bool short __b) {
3506 return vec_perm(__a, __b,
3507 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3508 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3509 0x06, 0x07, 0x16, 0x17));
3510}
3511
3512static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
3513 vector pixel __b) {
3514 return vec_perm(__a, __b,
3515 (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
3516 0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
3517 0x06, 0x07, 0x16, 0x17));
3518}
3519
3520/* vec_vmrghw */
3521
3522#define __builtin_altivec_vmrghw vec_vmrghw
3523
3524static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
3525 vector int __b) {
3526 return vec_perm(__a, __b,
3527 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3528 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3529 0x14, 0x15, 0x16, 0x17));
3530}
3531
3532static __inline__ vector unsigned int __ATTRS_o_ai
3533vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
3534 return vec_perm(__a, __b,
3535 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3536 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3537 0x14, 0x15, 0x16, 0x17));
3538}
3539
3540static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
3541 vector bool int __b) {
3542 return vec_perm(__a, __b,
3543 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3544 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3545 0x14, 0x15, 0x16, 0x17));
3546}
3547
3548static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
3549 vector float __b) {
3550 return vec_perm(__a, __b,
3551 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3552 0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
3553 0x14, 0x15, 0x16, 0x17));
3554}
3555
3556/* vec_mergel */
3557
3558static __inline__ vector signed char __ATTRS_o_ai
3559vec_mergel(vector signed char __a, vector signed char __b) {
3560 return vec_perm(__a, __b,
3561 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3562 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3563 0x0E, 0x1E, 0x0F, 0x1F));
3564}
3565
3566static __inline__ vector unsigned char __ATTRS_o_ai
3567vec_mergel(vector unsigned char __a, vector unsigned char __b) {
3568 return vec_perm(__a, __b,
3569 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3570 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3571 0x0E, 0x1E, 0x0F, 0x1F));
3572}
3573
3574static __inline__ vector bool char __ATTRS_o_ai
3575vec_mergel(vector bool char __a, vector bool char __b) {
3576 return vec_perm(__a, __b,
3577 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3578 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3579 0x0E, 0x1E, 0x0F, 0x1F));
3580}
3581
3582static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
3583 vector short __b) {
3584 return vec_perm(__a, __b,
3585 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3586 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3587 0x0E, 0x0F, 0x1E, 0x1F));
3588}
3589
3590static __inline__ vector unsigned short __ATTRS_o_ai
3591vec_mergel(vector unsigned short __a, vector unsigned short __b) {
3592 return vec_perm(__a, __b,
3593 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3594 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3595 0x0E, 0x0F, 0x1E, 0x1F));
3596}
3597
3598static __inline__ vector bool short __ATTRS_o_ai
3599vec_mergel(vector bool short __a, vector bool short __b) {
3600 return vec_perm(__a, __b,
3601 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3602 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3603 0x0E, 0x0F, 0x1E, 0x1F));
3604}
3605
3606static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
3607 vector pixel __b) {
3608 return vec_perm(__a, __b,
3609 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3610 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3611 0x0E, 0x0F, 0x1E, 0x1F));
3612}
3613
3614static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
3615 vector int __b) {
3616 return vec_perm(__a, __b,
3617 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3618 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3619 0x1C, 0x1D, 0x1E, 0x1F));
3620}
3621
3622static __inline__ vector unsigned int __ATTRS_o_ai
3623vec_mergel(vector unsigned int __a, vector unsigned int __b) {
3624 return vec_perm(__a, __b,
3625 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3626 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3627 0x1C, 0x1D, 0x1E, 0x1F));
3628}
3629
3630static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
3631 vector bool int __b) {
3632 return vec_perm(__a, __b,
3633 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3634 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3635 0x1C, 0x1D, 0x1E, 0x1F));
3636}
3637
3638static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
3639 vector float __b) {
3640 return vec_perm(__a, __b,
3641 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3642 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3643 0x1C, 0x1D, 0x1E, 0x1F));
3644}
3645
3646#ifdef __VSX__
3647static __inline__ vector signed long long __ATTRS_o_ai
3648vec_mergel(vector signed long long __a, vector signed long long __b) {
3649 return vec_perm(__a, __b,
3650 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3651 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3652 0x1C, 0x1D, 0x1E, 0x1F));
3653}
3654static __inline__ vector signed long long __ATTRS_o_ai
3655vec_mergel(vector signed long long __a, vector bool long long __b) {
3656 return vec_perm(__a, (vector signed long long)__b,
3657 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3658 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3659 0x1C, 0x1D, 0x1E, 0x1F));
3660}
3661static __inline__ vector signed long long __ATTRS_o_ai
3662vec_mergel(vector bool long long __a, vector signed long long __b) {
3663 return vec_perm((vector signed long long)__a, __b,
3664 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3665 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3666 0x1C, 0x1D, 0x1E, 0x1F));
3667}
3668static __inline__ vector unsigned long long __ATTRS_o_ai
3669vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
3670 return vec_perm(__a, __b,
3671 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3672 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3673 0x1C, 0x1D, 0x1E, 0x1F));
3674}
3675static __inline__ vector unsigned long long __ATTRS_o_ai
3676vec_mergel(vector unsigned long long __a, vector bool long long __b) {
3677 return vec_perm(__a, (vector unsigned long long)__b,
3678 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3679 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3680 0x1C, 0x1D, 0x1E, 0x1F));
3681}
3682static __inline__ vector unsigned long long __ATTRS_o_ai
3683vec_mergel(vector bool long long __a, vector unsigned long long __b) {
3684 return vec_perm((vector unsigned long long)__a, __b,
3685 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3686 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3687 0x1C, 0x1D, 0x1E, 0x1F));
3688}
3689static __inline__ vector bool long long __ATTRS_o_ai
3690vec_mergel(vector bool long long __a, vector bool long long __b) {
3691 return vec_perm(__a, __b,
3692 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3693 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3694 0x1C, 0x1D, 0x1E, 0x1F));
3695}
3696static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
3697 vector double __b) {
3698 return vec_perm(__a, __b,
3699 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3700 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3701 0x1C, 0x1D, 0x1E, 0x1F));
3702}
3703static __inline__ vector double __ATTRS_o_ai
3704vec_mergel(vector double __a, vector bool long long __b) {
3705 return vec_perm(__a, (vector double)__b,
3706 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3707 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3708 0x1C, 0x1D, 0x1E, 0x1F));
3709}
3710static __inline__ vector double __ATTRS_o_ai
3711vec_mergel(vector bool long long __a, vector double __b) {
3712 return vec_perm((vector double)__a, __b,
3713 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
3714 0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
3715 0x1C, 0x1D, 0x1E, 0x1F));
3716}
3717#endif
3718
3719/* vec_vmrglb */
3720
3721#define __builtin_altivec_vmrglb vec_vmrglb
3722
3723static __inline__ vector signed char __ATTRS_o_ai
3724vec_vmrglb(vector signed char __a, vector signed char __b) {
3725 return vec_perm(__a, __b,
3726 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3727 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3728 0x0E, 0x1E, 0x0F, 0x1F));
3729}
3730
3731static __inline__ vector unsigned char __ATTRS_o_ai
3732vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
3733 return vec_perm(__a, __b,
3734 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3735 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3736 0x0E, 0x1E, 0x0F, 0x1F));
3737}
3738
3739static __inline__ vector bool char __ATTRS_o_ai
3740vec_vmrglb(vector bool char __a, vector bool char __b) {
3741 return vec_perm(__a, __b,
3742 (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
3743 0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
3744 0x0E, 0x1E, 0x0F, 0x1F));
3745}
3746
3747/* vec_vmrglh */
3748
3749#define __builtin_altivec_vmrglh vec_vmrglh
3750
3751static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
3752 vector short __b) {
3753 return vec_perm(__a, __b,
3754 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3755 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3756 0x0E, 0x0F, 0x1E, 0x1F));
3757}
3758
3759static __inline__ vector unsigned short __ATTRS_o_ai
3760vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
3761 return vec_perm(__a, __b,
3762 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3763 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3764 0x0E, 0x0F, 0x1E, 0x1F));
3765}
3766
3767static __inline__ vector bool short __ATTRS_o_ai
3768vec_vmrglh(vector bool short __a, vector bool short __b) {
3769 return vec_perm(__a, __b,
3770 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3771 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3772 0x0E, 0x0F, 0x1E, 0x1F));
3773}
3774
3775static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
3776 vector pixel __b) {
3777 return vec_perm(__a, __b,
3778 (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
3779 0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
3780 0x0E, 0x0F, 0x1E, 0x1F));
3781}
3782
3783/* vec_vmrglw */
3784
3785#define __builtin_altivec_vmrglw vec_vmrglw
3786
3787static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
3788 vector int __b) {
3789 return vec_perm(__a, __b,
3790 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3791 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3792 0x1C, 0x1D, 0x1E, 0x1F));
3793}
3794
3795static __inline__ vector unsigned int __ATTRS_o_ai
3796vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
3797 return vec_perm(__a, __b,
3798 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3799 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3800 0x1C, 0x1D, 0x1E, 0x1F));
3801}
3802
3803static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
3804 vector bool int __b) {
3805 return vec_perm(__a, __b,
3806 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3807 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3808 0x1C, 0x1D, 0x1E, 0x1F));
3809}
3810
3811static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
3812 vector float __b) {
3813 return vec_perm(__a, __b,
3814 (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
3815 0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
3816 0x1C, 0x1D, 0x1E, 0x1F));
3817}
3818
3819#ifdef __POWER8_VECTOR__
3820/* vec_mergee */
3821
3822static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
3823 vector bool int __b) {
3824 return vec_perm(__a, __b,
3825 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3826 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
3827 0x18, 0x19, 0x1A, 0x1B));
3828}
3829
3830static __inline__ vector signed int __ATTRS_o_ai
3831vec_mergee(vector signed int __a, vector signed int __b) {
3832 return vec_perm(__a, __b,
3833 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3834 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
3835 0x18, 0x19, 0x1A, 0x1B));
3836}
3837
3838static __inline__ vector unsigned int __ATTRS_o_ai
3839vec_mergee(vector unsigned int __a, vector unsigned int __b) {
3840 return vec_perm(__a, __b,
3841 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
3842 0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
3843 0x18, 0x19, 0x1A, 0x1B));
3844}
3845
3846/* vec_mergeo */
3847
3848static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
3849 vector bool int __b) {
3850 return vec_perm(__a, __b,
3851 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
3852 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
3853 0x1C, 0x1D, 0x1E, 0x1F));
3854}
3855
3856static __inline__ vector signed int __ATTRS_o_ai
3857vec_mergeo(vector signed int __a, vector signed int __b) {
3858 return vec_perm(__a, __b,
3859 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
3860 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
3861 0x1C, 0x1D, 0x1E, 0x1F));
3862}
3863
3864static __inline__ vector unsigned int __ATTRS_o_ai
3865vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
3866 return vec_perm(__a, __b,
3867 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
3868 0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
3869 0x1C, 0x1D, 0x1E, 0x1F));
3870}
3871
3872#endif
3873
3874/* vec_mfvscr */
3875
3876static __inline__ vector unsigned short __attribute__((__always_inline__))
3877vec_mfvscr(void) {
3878 return __builtin_altivec_mfvscr();
3879}
3880
3881/* vec_min */
3882
3883static __inline__ vector signed char __ATTRS_o_ai
3884vec_min(vector signed char __a, vector signed char __b) {
3885 return __builtin_altivec_vminsb(__a, __b);
3886}
3887
3888static __inline__ vector signed char __ATTRS_o_ai
3889vec_min(vector bool char __a, vector signed char __b) {
3890 return __builtin_altivec_vminsb((vector signed char)__a, __b);
3891}
3892
3893static __inline__ vector signed char __ATTRS_o_ai
3894vec_min(vector signed char __a, vector bool char __b) {
3895 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
3896}
3897
3898static __inline__ vector unsigned char __ATTRS_o_ai
3899vec_min(vector unsigned char __a, vector unsigned char __b) {
3900 return __builtin_altivec_vminub(__a, __b);
3901}
3902
3903static __inline__ vector unsigned char __ATTRS_o_ai
3904vec_min(vector bool char __a, vector unsigned char __b) {
3905 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
3906}
3907
3908static __inline__ vector unsigned char __ATTRS_o_ai
3909vec_min(vector unsigned char __a, vector bool char __b) {
3910 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
3911}
3912
3913static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
3914 vector short __b) {
3915 return __builtin_altivec_vminsh(__a, __b);
3916}
3917
3918static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
3919 vector short __b) {
3920 return __builtin_altivec_vminsh((vector short)__a, __b);
3921}
3922
3923static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
3924 vector bool short __b) {
3925 return __builtin_altivec_vminsh(__a, (vector short)__b);
3926}
3927
3928static __inline__ vector unsigned short __ATTRS_o_ai
3929vec_min(vector unsigned short __a, vector unsigned short __b) {
3930 return __builtin_altivec_vminuh(__a, __b);
3931}
3932
3933static __inline__ vector unsigned short __ATTRS_o_ai
3934vec_min(vector bool short __a, vector unsigned short __b) {
3935 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
3936}
3937
3938static __inline__ vector unsigned short __ATTRS_o_ai
3939vec_min(vector unsigned short __a, vector bool short __b) {
3940 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
3941}
3942
3943static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
3944 vector int __b) {
3945 return __builtin_altivec_vminsw(__a, __b);
3946}
3947
3948static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,
3949 vector int __b) {
3950 return __builtin_altivec_vminsw((vector int)__a, __b);
3951}
3952
3953static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,
3954 vector bool int __b) {
3955 return __builtin_altivec_vminsw(__a, (vector int)__b);
3956}
3957
3958static __inline__ vector unsigned int __ATTRS_o_ai
3959vec_min(vector unsigned int __a, vector unsigned int __b) {
3960 return __builtin_altivec_vminuw(__a, __b);
3961}
3962
3963static __inline__ vector unsigned int __ATTRS_o_ai
3964vec_min(vector bool int __a, vector unsigned int __b) {
3965 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
3966}
3967
3968static __inline__ vector unsigned int __ATTRS_o_ai
3969vec_min(vector unsigned int __a, vector bool int __b) {
3970 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
3971}
3972
3973#ifdef __POWER8_VECTOR__
3974static __inline__ vector signed long long __ATTRS_o_ai
3975vec_min(vector signed long long __a, vector signed long long __b) {
3976 return __builtin_altivec_vminsd(__a, __b);
3977}
3978
3979static __inline__ vector signed long long __ATTRS_o_ai
3980vec_min(vector bool long long __a, vector signed long long __b) {
3981 return __builtin_altivec_vminsd((vector signed long long)__a, __b);
3982}
3983
3984static __inline__ vector signed long long __ATTRS_o_ai
3985vec_min(vector signed long long __a, vector bool long long __b) {
3986 return __builtin_altivec_vminsd(__a, (vector signed long long)__b);
3987}
3988
3989static __inline__ vector unsigned long long __ATTRS_o_ai
3990vec_min(vector unsigned long long __a, vector unsigned long long __b) {
3991 return __builtin_altivec_vminud(__a, __b);
3992}
3993
3994static __inline__ vector unsigned long long __ATTRS_o_ai
3995vec_min(vector bool long long __a, vector unsigned long long __b) {
3996 return __builtin_altivec_vminud((vector unsigned long long)__a, __b);
3997}
3998
3999static __inline__ vector unsigned long long __ATTRS_o_ai
4000vec_min(vector unsigned long long __a, vector bool long long __b) {
4001 return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);
4002}
4003#endif
4004
4005static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,
4006 vector float __b) {
4007#ifdef __VSX__
4008 return __builtin_vsx_xvminsp(__a, __b);
4009#else
4010 return __builtin_altivec_vminfp(__a, __b);
4011#endif
4012}
4013
4014#ifdef __VSX__
4015static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,
4016 vector double __b) {
4017 return __builtin_vsx_xvmindp(__a, __b);
4018}
4019#endif
4020
4021/* vec_vminsb */
4022
4023static __inline__ vector signed char __ATTRS_o_ai
4024vec_vminsb(vector signed char __a, vector signed char __b) {
4025 return __builtin_altivec_vminsb(__a, __b);
4026}
4027
4028static __inline__ vector signed char __ATTRS_o_ai
4029vec_vminsb(vector bool char __a, vector signed char __b) {
4030 return __builtin_altivec_vminsb((vector signed char)__a, __b);
4031}
4032
4033static __inline__ vector signed char __ATTRS_o_ai
4034vec_vminsb(vector signed char __a, vector bool char __b) {
4035 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
4036}
4037
4038/* vec_vminub */
4039
4040static __inline__ vector unsigned char __ATTRS_o_ai
4041vec_vminub(vector unsigned char __a, vector unsigned char __b) {
4042 return __builtin_altivec_vminub(__a, __b);
4043}
4044
4045static __inline__ vector unsigned char __ATTRS_o_ai
4046vec_vminub(vector bool char __a, vector unsigned char __b) {
4047 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
4048}
4049
4050static __inline__ vector unsigned char __ATTRS_o_ai
4051vec_vminub(vector unsigned char __a, vector bool char __b) {
4052 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
4053}
4054
4055/* vec_vminsh */
4056
4057static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
4058 vector short __b) {
4059 return __builtin_altivec_vminsh(__a, __b);
4060}
4061
4062static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,
4063 vector short __b) {
4064 return __builtin_altivec_vminsh((vector short)__a, __b);
4065}
4066
4067static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,
4068 vector bool short __b) {
4069 return __builtin_altivec_vminsh(__a, (vector short)__b);
4070}
4071
4072/* vec_vminuh */
4073
4074static __inline__ vector unsigned short __ATTRS_o_ai
4075vec_vminuh(vector unsigned short __a, vector unsigned short __b) {
4076 return __builtin_altivec_vminuh(__a, __b);
4077}
4078
4079static __inline__ vector unsigned short __ATTRS_o_ai
4080vec_vminuh(vector bool short __a, vector unsigned short __b) {
4081 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
4082}
4083
4084static __inline__ vector unsigned short __ATTRS_o_ai
4085vec_vminuh(vector unsigned short __a, vector bool short __b) {
4086 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
4087}
4088
4089/* vec_vminsw */
4090
4091static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
4092 vector int __b) {
4093 return __builtin_altivec_vminsw(__a, __b);
4094}
4095
4096static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,
4097 vector int __b) {
4098 return __builtin_altivec_vminsw((vector int)__a, __b);
4099}
4100
4101static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,
4102 vector bool int __b) {
4103 return __builtin_altivec_vminsw(__a, (vector int)__b);
4104}
4105
4106/* vec_vminuw */
4107
4108static __inline__ vector unsigned int __ATTRS_o_ai
4109vec_vminuw(vector unsigned int __a, vector unsigned int __b) {
4110 return __builtin_altivec_vminuw(__a, __b);
4111}
4112
4113static __inline__ vector unsigned int __ATTRS_o_ai
4114vec_vminuw(vector bool int __a, vector unsigned int __b) {
4115 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
4116}
4117
4118static __inline__ vector unsigned int __ATTRS_o_ai
4119vec_vminuw(vector unsigned int __a, vector bool int __b) {
4120 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
4121}
4122
4123/* vec_vminfp */
4124
4125static __inline__ vector float __attribute__((__always_inline__))
4126vec_vminfp(vector float __a, vector float __b) {
4127#ifdef __VSX__
4128 return __builtin_vsx_xvminsp(__a, __b);
4129#else
4130 return __builtin_altivec_vminfp(__a, __b);
4131#endif
4132}
4133
4134/* vec_mladd */
4135
4136#define __builtin_altivec_vmladduhm vec_mladd
4137
4138static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,
4139 vector short __b,
4140 vector short __c) {
4141 return __a * __b + __c;
4142}
4143
4144static __inline__ vector short __ATTRS_o_ai vec_mladd(
4145 vector short __a, vector unsigned short __b, vector unsigned short __c) {
4146 return __a * (vector short)__b + (vector short)__c;
4147}
4148
4149static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,
4150 vector short __b,
4151 vector short __c) {
4152 return (vector short)__a * __b + __c;
4153}
4154
4155static __inline__ vector unsigned short __ATTRS_o_ai
4156vec_mladd(vector unsigned short __a, vector unsigned short __b,
4157 vector unsigned short __c) {
4158 return __a * __b + __c;
4159}
4160
4161/* vec_vmladduhm */
4162
4163static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,
4164 vector short __b,
4165 vector short __c) {
4166 return __a * __b + __c;
4167}
4168
4169static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(
4170 vector short __a, vector unsigned short __b, vector unsigned short __c) {
4171 return __a * (vector short)__b + (vector short)__c;
4172}
4173
4174static __inline__ vector short __ATTRS_o_ai
4175vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {
4176 return (vector short)__a * __b + __c;
4177}
4178
4179static __inline__ vector unsigned short __ATTRS_o_ai
4180vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,
4181 vector unsigned short __c) {
4182 return __a * __b + __c;
4183}
4184
4185/* vec_mradds */
4186
4187static __inline__ vector short __attribute__((__always_inline__))
4188vec_mradds(vector short __a, vector short __b, vector short __c) {
4189 return __builtin_altivec_vmhraddshs(__a, __b, __c);
4190}
4191
4192/* vec_vmhraddshs */
4193
4194static __inline__ vector short __attribute__((__always_inline__))
4195vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {
4196 return __builtin_altivec_vmhraddshs(__a, __b, __c);
4197}
4198
4199/* vec_msum */
4200
4201static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,
4202 vector unsigned char __b,
4203 vector int __c) {
4204 return __builtin_altivec_vmsummbm(__a, __b, __c);
4205}
4206
4207static __inline__ vector unsigned int __ATTRS_o_ai
4208vec_msum(vector unsigned char __a, vector unsigned char __b,
4209 vector unsigned int __c) {
4210 return __builtin_altivec_vmsumubm(__a, __b, __c);
4211}
4212
4213static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,
4214 vector short __b,
4215 vector int __c) {
4216 return __builtin_altivec_vmsumshm(__a, __b, __c);
4217}
4218
4219static __inline__ vector unsigned int __ATTRS_o_ai
4220vec_msum(vector unsigned short __a, vector unsigned short __b,
4221 vector unsigned int __c) {
4222 return __builtin_altivec_vmsumuhm(__a, __b, __c);
4223}
4224
4225/* vec_vmsummbm */
4226
4227static __inline__ vector int __attribute__((__always_inline__))
4228vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {
4229 return __builtin_altivec_vmsummbm(__a, __b, __c);
4230}
4231
4232/* vec_vmsumubm */
4233
4234static __inline__ vector unsigned int __attribute__((__always_inline__))
4235vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,
4236 vector unsigned int __c) {
4237 return __builtin_altivec_vmsumubm(__a, __b, __c);
4238}
4239
4240/* vec_vmsumshm */
4241
4242static __inline__ vector int __attribute__((__always_inline__))
4243vec_vmsumshm(vector short __a, vector short __b, vector int __c) {
4244 return __builtin_altivec_vmsumshm(__a, __b, __c);
4245}
4246
4247/* vec_vmsumuhm */
4248
4249static __inline__ vector unsigned int __attribute__((__always_inline__))
4250vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,
4251 vector unsigned int __c) {
4252 return __builtin_altivec_vmsumuhm(__a, __b, __c);
4253}
4254
4255/* vec_msums */
4256
4257static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,
4258 vector short __b,
4259 vector int __c) {
4260 return __builtin_altivec_vmsumshs(__a, __b, __c);
4261}
4262
4263static __inline__ vector unsigned int __ATTRS_o_ai
4264vec_msums(vector unsigned short __a, vector unsigned short __b,
4265 vector unsigned int __c) {
4266 return __builtin_altivec_vmsumuhs(__a, __b, __c);
4267}
4268
4269/* vec_vmsumshs */
4270
4271static __inline__ vector int __attribute__((__always_inline__))
4272vec_vmsumshs(vector short __a, vector short __b, vector int __c) {
4273 return __builtin_altivec_vmsumshs(__a, __b, __c);
4274}
4275
4276/* vec_vmsumuhs */
4277
4278static __inline__ vector unsigned int __attribute__((__always_inline__))
4279vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,
4280 vector unsigned int __c) {
4281 return __builtin_altivec_vmsumuhs(__a, __b, __c);
4282}
4283
4284/* vec_mtvscr */
4285
4286static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {
4287 __builtin_altivec_mtvscr((vector int)__a);
4288}
4289
4290static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {
4291 __builtin_altivec_mtvscr((vector int)__a);
4292}
4293
4294static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {
4295 __builtin_altivec_mtvscr((vector int)__a);
4296}
4297
4298static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {
4299 __builtin_altivec_mtvscr((vector int)__a);
4300}
4301
4302static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {
4303 __builtin_altivec_mtvscr((vector int)__a);
4304}
4305
4306static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {
4307 __builtin_altivec_mtvscr((vector int)__a);
4308}
4309
4310static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {
4311 __builtin_altivec_mtvscr((vector int)__a);
4312}
4313
4314static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {
4315 __builtin_altivec_mtvscr((vector int)__a);
4316}
4317
4318static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {
4319 __builtin_altivec_mtvscr((vector int)__a);
4320}
4321
4322static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {
4323 __builtin_altivec_mtvscr((vector int)__a);
4324}
4325
4326static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {
4327 __builtin_altivec_mtvscr((vector int)__a);
4328}
4329
4330/* vec_mul */
4331
4332/* Integer vector multiplication will involve multiplication of the odd/even
4333 elements separately, then truncating the results and moving to the
4334 result vector.
4335*/
4336static __inline__ vector signed char __ATTRS_o_ai
4337vec_mul(vector signed char __a, vector signed char __b) {
4338 return __a * __b;
4339}
4340
4341static __inline__ vector unsigned char __ATTRS_o_ai
4342vec_mul(vector unsigned char __a, vector unsigned char __b) {
4343 return __a * __b;
4344}
4345
4346static __inline__ vector signed short __ATTRS_o_ai
4347vec_mul(vector signed short __a, vector signed short __b) {
4348 return __a * __b;
4349}
4350
4351static __inline__ vector unsigned short __ATTRS_o_ai
4352vec_mul(vector unsigned short __a, vector unsigned short __b) {
4353 return __a * __b;
4354}
4355
4356static __inline__ vector signed int __ATTRS_o_ai
4357vec_mul(vector signed int __a, vector signed int __b) {
4358 return __a * __b;
4359}
4360
4361static __inline__ vector unsigned int __ATTRS_o_ai
4362vec_mul(vector unsigned int __a, vector unsigned int __b) {
4363 return __a * __b;
4364}
4365
4366#ifdef __VSX__
4367static __inline__ vector signed long long __ATTRS_o_ai
4368vec_mul(vector signed long long __a, vector signed long long __b) {
4369 return __a * __b;
4370}
4371
4372static __inline__ vector unsigned long long __ATTRS_o_ai
4373vec_mul(vector unsigned long long __a, vector unsigned long long __b) {
4374 return __a * __b;
4375}
4376#endif
4377
4378static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,
4379 vector float __b) {
4380 return __a * __b;
4381}
4382
4383#ifdef __VSX__
4384static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,
4385 vector double __b) {
4386 return __a * __b;
4387}
4388#endif
4389
4390/* The vmulos* and vmules* instructions have a big endian bias, so
4391 we must reverse the meaning of "even" and "odd" for little endian. */
4392
4393/* vec_mule */
4394
4395static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,
4396 vector signed char __b) {
4397#ifdef __LITTLE_ENDIAN__
4398 return __builtin_altivec_vmulosb(__a, __b);
4399#else
4400 return __builtin_altivec_vmulesb(__a, __b);
4401#endif
4402}
4403
4404static __inline__ vector unsigned short __ATTRS_o_ai
4405vec_mule(vector unsigned char __a, vector unsigned char __b) {
4406#ifdef __LITTLE_ENDIAN__
4407 return __builtin_altivec_vmuloub(__a, __b);
4408#else
4409 return __builtin_altivec_vmuleub(__a, __b);
4410#endif
4411}
4412
4413static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,
4414 vector short __b) {
4415#ifdef __LITTLE_ENDIAN__
4416 return __builtin_altivec_vmulosh(__a, __b);
4417#else
4418 return __builtin_altivec_vmulesh(__a, __b);
4419#endif
4420}
4421
4422static __inline__ vector unsigned int __ATTRS_o_ai
4423vec_mule(vector unsigned short __a, vector unsigned short __b) {
4424#ifdef __LITTLE_ENDIAN__
4425 return __builtin_altivec_vmulouh(__a, __b);
4426#else
4427 return __builtin_altivec_vmuleuh(__a, __b);
4428#endif
4429}
4430
4431#ifdef __POWER8_VECTOR__
4432static __inline__ vector signed long long __ATTRS_o_ai
4433vec_mule(vector signed int __a, vector signed int __b) {
4434#ifdef __LITTLE_ENDIAN__
4435 return __builtin_altivec_vmulosw(__a, __b);
4436#else
4437 return __builtin_altivec_vmulesw(__a, __b);
4438#endif
4439}
4440
4441static __inline__ vector unsigned long long __ATTRS_o_ai
4442vec_mule(vector unsigned int __a, vector unsigned int __b) {
4443#ifdef __LITTLE_ENDIAN__
4444 return __builtin_altivec_vmulouw(__a, __b);
4445#else
4446 return __builtin_altivec_vmuleuw(__a, __b);
4447#endif
4448}
4449#endif
4450
4451/* vec_vmulesb */
4452
4453static __inline__ vector short __attribute__((__always_inline__))
4454vec_vmulesb(vector signed char __a, vector signed char __b) {
4455#ifdef __LITTLE_ENDIAN__
4456 return __builtin_altivec_vmulosb(__a, __b);
4457#else
4458 return __builtin_altivec_vmulesb(__a, __b);
4459#endif
4460}
4461
4462/* vec_vmuleub */
4463
4464static __inline__ vector unsigned short __attribute__((__always_inline__))
4465vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {
4466#ifdef __LITTLE_ENDIAN__
4467 return __builtin_altivec_vmuloub(__a, __b);
4468#else
4469 return __builtin_altivec_vmuleub(__a, __b);
4470#endif
4471}
4472
4473/* vec_vmulesh */
4474
4475static __inline__ vector int __attribute__((__always_inline__))
4476vec_vmulesh(vector short __a, vector short __b) {
4477#ifdef __LITTLE_ENDIAN__
4478 return __builtin_altivec_vmulosh(__a, __b);
4479#else
4480 return __builtin_altivec_vmulesh(__a, __b);
4481#endif
4482}
4483
4484/* vec_vmuleuh */
4485
4486static __inline__ vector unsigned int __attribute__((__always_inline__))
4487vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {
4488#ifdef __LITTLE_ENDIAN__
4489 return __builtin_altivec_vmulouh(__a, __b);
4490#else
4491 return __builtin_altivec_vmuleuh(__a, __b);
4492#endif
4493}
4494
4495/* vec_mulo */
4496
4497static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,
4498 vector signed char __b) {
4499#ifdef __LITTLE_ENDIAN__
4500 return __builtin_altivec_vmulesb(__a, __b);
4501#else
4502 return __builtin_altivec_vmulosb(__a, __b);
4503#endif
4504}
4505
4506static __inline__ vector unsigned short __ATTRS_o_ai
4507vec_mulo(vector unsigned char __a, vector unsigned char __b) {
4508#ifdef __LITTLE_ENDIAN__
4509 return __builtin_altivec_vmuleub(__a, __b);
4510#else
4511 return __builtin_altivec_vmuloub(__a, __b);
4512#endif
4513}
4514
4515static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,
4516 vector short __b) {
4517#ifdef __LITTLE_ENDIAN__
4518 return __builtin_altivec_vmulesh(__a, __b);
4519#else
4520 return __builtin_altivec_vmulosh(__a, __b);
4521#endif
4522}
4523
4524static __inline__ vector unsigned int __ATTRS_o_ai
4525vec_mulo(vector unsigned short __a, vector unsigned short __b) {
4526#ifdef __LITTLE_ENDIAN__
4527 return __builtin_altivec_vmuleuh(__a, __b);
4528#else
4529 return __builtin_altivec_vmulouh(__a, __b);
4530#endif
4531}
4532
4533#ifdef __POWER8_VECTOR__
4534static __inline__ vector signed long long __ATTRS_o_ai
4535vec_mulo(vector signed int __a, vector signed int __b) {
4536#ifdef __LITTLE_ENDIAN__
4537 return __builtin_altivec_vmulesw(__a, __b);
4538#else
4539 return __builtin_altivec_vmulosw(__a, __b);
4540#endif
4541}
4542
4543static __inline__ vector unsigned long long __ATTRS_o_ai
4544vec_mulo(vector unsigned int __a, vector unsigned int __b) {
4545#ifdef __LITTLE_ENDIAN__
4546 return __builtin_altivec_vmuleuw(__a, __b);
4547#else
4548 return __builtin_altivec_vmulouw(__a, __b);
4549#endif
4550}
4551#endif
4552
4553/* vec_vmulosb */
4554
4555static __inline__ vector short __attribute__((__always_inline__))
4556vec_vmulosb(vector signed char __a, vector signed char __b) {
4557#ifdef __LITTLE_ENDIAN__
4558 return __builtin_altivec_vmulesb(__a, __b);
4559#else
4560 return __builtin_altivec_vmulosb(__a, __b);
4561#endif
4562}
4563
4564/* vec_vmuloub */
4565
4566static __inline__ vector unsigned short __attribute__((__always_inline__))
4567vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {
4568#ifdef __LITTLE_ENDIAN__
4569 return __builtin_altivec_vmuleub(__a, __b);
4570#else
4571 return __builtin_altivec_vmuloub(__a, __b);
4572#endif
4573}
4574
4575/* vec_vmulosh */
4576
4577static __inline__ vector int __attribute__((__always_inline__))
4578vec_vmulosh(vector short __a, vector short __b) {
4579#ifdef __LITTLE_ENDIAN__
4580 return __builtin_altivec_vmulesh(__a, __b);
4581#else
4582 return __builtin_altivec_vmulosh(__a, __b);
4583#endif
4584}
4585
4586/* vec_vmulouh */
4587
4588static __inline__ vector unsigned int __attribute__((__always_inline__))
4589vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {
4590#ifdef __LITTLE_ENDIAN__
4591 return __builtin_altivec_vmuleuh(__a, __b);
4592#else
4593 return __builtin_altivec_vmulouh(__a, __b);
4594#endif
4595}
4596
4597/* vec_nand */
4598
4599#ifdef __POWER8_VECTOR__
4600static __inline__ vector signed char __ATTRS_o_ai
4601vec_nand(vector signed char __a, vector signed char __b) {
4602 return ~(__a & __b);
4603}
4604
4605static __inline__ vector signed char __ATTRS_o_ai
4606vec_nand(vector signed char __a, vector bool char __b) {
4607 return ~(__a & __b);
4608}
4609
4610static __inline__ vector signed char __ATTRS_o_ai
4611vec_nand(vector bool char __a, vector signed char __b) {
4612 return ~(__a & __b);
4613}
4614
4615static __inline__ vector unsigned char __ATTRS_o_ai
4616vec_nand(vector unsigned char __a, vector unsigned char __b) {
4617 return ~(__a & __b);
4618}
4619
4620static __inline__ vector unsigned char __ATTRS_o_ai
4621vec_nand(vector unsigned char __a, vector bool char __b) {
4622 return ~(__a & __b);
4623}
4624
4625static __inline__ vector unsigned char __ATTRS_o_ai
4626vec_nand(vector bool char __a, vector unsigned char __b) {
4627 return ~(__a & __b);
4628}
4629
4630static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,
4631 vector bool char __b) {
4632 return ~(__a & __b);
4633}
4634
4635static __inline__ vector signed short __ATTRS_o_ai
4636vec_nand(vector signed short __a, vector signed short __b) {
4637 return ~(__a & __b);
4638}
4639
4640static __inline__ vector signed short __ATTRS_o_ai
4641vec_nand(vector signed short __a, vector bool short __b) {
4642 return ~(__a & __b);
4643}
4644
4645static __inline__ vector signed short __ATTRS_o_ai
4646vec_nand(vector bool short __a, vector signed short __b) {
4647 return ~(__a & __b);
4648}
4649
4650static __inline__ vector unsigned short __ATTRS_o_ai
4651vec_nand(vector unsigned short __a, vector unsigned short __b) {
4652 return ~(__a & __b);
4653}
4654
4655static __inline__ vector unsigned short __ATTRS_o_ai
4656vec_nand(vector unsigned short __a, vector bool short __b) {
4657 return ~(__a & __b);
4658}
4659
4660static __inline__ vector bool short __ATTRS_o_ai
4661vec_nand(vector bool short __a, vector bool short __b) {
4662 return ~(__a & __b);
4663}
4664
4665static __inline__ vector signed int __ATTRS_o_ai
4666vec_nand(vector signed int __a, vector signed int __b) {
4667 return ~(__a & __b);
4668}
4669
4670static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,
4671 vector bool int __b) {
4672 return ~(__a & __b);
4673}
4674
4675static __inline__ vector signed int __ATTRS_o_ai
4676vec_nand(vector bool int __a, vector signed int __b) {
4677 return ~(__a & __b);
4678}
4679
4680static __inline__ vector unsigned int __ATTRS_o_ai
4681vec_nand(vector unsigned int __a, vector unsigned int __b) {
4682 return ~(__a & __b);
4683}
4684
4685static __inline__ vector unsigned int __ATTRS_o_ai
4686vec_nand(vector unsigned int __a, vector bool int __b) {
4687 return ~(__a & __b);
4688}
4689
4690static __inline__ vector unsigned int __ATTRS_o_ai
4691vec_nand(vector bool int __a, vector unsigned int __b) {
4692 return ~(__a & __b);
4693}
4694
4695static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,
4696 vector bool int __b) {
4697 return ~(__a & __b);
4698}
4699
4700static __inline__ vector signed long long __ATTRS_o_ai
4701vec_nand(vector signed long long __a, vector signed long long __b) {
4702 return ~(__a & __b);
4703}
4704
4705static __inline__ vector signed long long __ATTRS_o_ai
4706vec_nand(vector signed long long __a, vector bool long long __b) {
4707 return ~(__a & __b);
4708}
4709
4710static __inline__ vector signed long long __ATTRS_o_ai
4711vec_nand(vector bool long long __a, vector signed long long __b) {
4712 return ~(__a & __b);
4713}
4714
4715static __inline__ vector unsigned long long __ATTRS_o_ai
4716vec_nand(vector unsigned long long __a, vector unsigned long long __b) {
4717 return ~(__a & __b);
4718}
4719
4720static __inline__ vector unsigned long long __ATTRS_o_ai
4721vec_nand(vector unsigned long long __a, vector bool long long __b) {
4722 return ~(__a & __b);
4723}
4724
4725static __inline__ vector unsigned long long __ATTRS_o_ai
4726vec_nand(vector bool long long __a, vector unsigned long long __b) {
4727 return ~(__a & __b);
4728}
4729
4730static __inline__ vector bool long long __ATTRS_o_ai
4731vec_nand(vector bool long long __a, vector bool long long __b) {
4732 return ~(__a & __b);
4733}
4734
4735#endif
4736
4737/* vec_nmadd */
4738
4739#ifdef __VSX__
4740static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,
4741 vector float __b,
4742 vector float __c) {
4743 return __builtin_vsx_xvnmaddasp(__a, __b, __c);
4744}
4745
4746static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,
4747 vector double __b,
4748 vector double __c) {
4749 return __builtin_vsx_xvnmaddadp(__a, __b, __c);
4750}
4751#endif
4752
4753/* vec_nmsub */
4754
4755static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,
4756 vector float __b,
4757 vector float __c) {
4758#ifdef __VSX__
4759 return __builtin_vsx_xvnmsubasp(__a, __b, __c);
4760#else
4761 return __builtin_altivec_vnmsubfp(__a, __b, __c);
4762#endif
4763}
4764
4765#ifdef __VSX__
4766static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,
4767 vector double __b,
4768 vector double __c) {
4769 return __builtin_vsx_xvnmsubadp(__a, __b, __c);
4770}
4771#endif
4772
4773/* vec_vnmsubfp */
4774
4775static __inline__ vector float __attribute__((__always_inline__))
4776vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {
4777 return __builtin_altivec_vnmsubfp(__a, __b, __c);
4778}
4779
4780/* vec_nor */
4781
4782#define __builtin_altivec_vnor vec_nor
4783
4784static __inline__ vector signed char __ATTRS_o_ai
4785vec_nor(vector signed char __a, vector signed char __b) {
4786 return ~(__a | __b);
4787}
4788
4789static __inline__ vector unsigned char __ATTRS_o_ai
4790vec_nor(vector unsigned char __a, vector unsigned char __b) {
4791 return ~(__a | __b);
4792}
4793
4794static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,
4795 vector bool char __b) {
4796 return ~(__a | __b);
4797}
4798
4799static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,
4800 vector short __b) {
4801 return ~(__a | __b);
4802}
4803
4804static __inline__ vector unsigned short __ATTRS_o_ai
4805vec_nor(vector unsigned short __a, vector unsigned short __b) {
4806 return ~(__a | __b);
4807}
4808
4809static __inline__ vector bool short __ATTRS_o_ai
4810vec_nor(vector bool short __a, vector bool short __b) {
4811 return ~(__a | __b);
4812}
4813
4814static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,
4815 vector int __b) {
4816 return ~(__a | __b);
4817}
4818
4819static __inline__ vector unsigned int __ATTRS_o_ai
4820vec_nor(vector unsigned int __a, vector unsigned int __b) {
4821 return ~(__a | __b);
4822}
4823
4824static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,
4825 vector bool int __b) {
4826 return ~(__a | __b);
4827}
4828
4829static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,
4830 vector float __b) {
4831 vector unsigned int __res =
4832 ~((vector unsigned int)__a | (vector unsigned int)__b);
4833 return (vector float)__res;
4834}
4835
4836#ifdef __VSX__
4837static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,
4838 vector double __b) {
4839 vector unsigned long long __res =
4840 ~((vector unsigned long long)__a | (vector unsigned long long)__b);
4841 return (vector double)__res;
4842}
4843#endif
4844
4845/* vec_vnor */
4846
4847static __inline__ vector signed char __ATTRS_o_ai
4848vec_vnor(vector signed char __a, vector signed char __b) {
4849 return ~(__a | __b);
4850}
4851
4852static __inline__ vector unsigned char __ATTRS_o_ai
4853vec_vnor(vector unsigned char __a, vector unsigned char __b) {
4854 return ~(__a | __b);
4855}
4856
4857static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,
4858 vector bool char __b) {
4859 return ~(__a | __b);
4860}
4861
4862static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,
4863 vector short __b) {
4864 return ~(__a | __b);
4865}
4866
4867static __inline__ vector unsigned short __ATTRS_o_ai
4868vec_vnor(vector unsigned short __a, vector unsigned short __b) {
4869 return ~(__a | __b);
4870}
4871
4872static __inline__ vector bool short __ATTRS_o_ai
4873vec_vnor(vector bool short __a, vector bool short __b) {
4874 return ~(__a | __b);
4875}
4876
4877static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,
4878 vector int __b) {
4879 return ~(__a | __b);
4880}
4881
4882static __inline__ vector unsigned int __ATTRS_o_ai
4883vec_vnor(vector unsigned int __a, vector unsigned int __b) {
4884 return ~(__a | __b);
4885}
4886
4887static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,
4888 vector bool int __b) {
4889 return ~(__a | __b);
4890}
4891
4892static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,
4893 vector float __b) {
4894 vector unsigned int __res =
4895 ~((vector unsigned int)__a | (vector unsigned int)__b);
4896 return (vector float)__res;
4897}
4898
4899#ifdef __VSX__
4900static __inline__ vector signed long long __ATTRS_o_ai
4901vec_nor(vector signed long long __a, vector signed long long __b) {
4902 return ~(__a | __b);
4903}
4904
4905static __inline__ vector unsigned long long __ATTRS_o_ai
4906vec_nor(vector unsigned long long __a, vector unsigned long long __b) {
4907 return ~(__a | __b);
4908}
4909
4910static __inline__ vector bool long long __ATTRS_o_ai
4911vec_nor(vector bool long long __a, vector bool long long __b) {
4912 return ~(__a | __b);
4913}
4914#endif
4915
4916/* vec_or */
4917
4918#define __builtin_altivec_vor vec_or
4919
4920static __inline__ vector signed char __ATTRS_o_ai
4921vec_or(vector signed char __a, vector signed char __b) {
4922 return __a | __b;
4923}
4924
4925static __inline__ vector signed char __ATTRS_o_ai
4926vec_or(vector bool char __a, vector signed char __b) {
4927 return (vector signed char)__a | __b;
4928}
4929
4930static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,
4931 vector bool char __b) {
4932 return __a | (vector signed char)__b;
4933}
4934
4935static __inline__ vector unsigned char __ATTRS_o_ai
4936vec_or(vector unsigned char __a, vector unsigned char __b) {
4937 return __a | __b;
4938}
4939
4940static __inline__ vector unsigned char __ATTRS_o_ai
4941vec_or(vector bool char __a, vector unsigned char __b) {
4942 return (vector unsigned char)__a | __b;
4943}
4944
4945static __inline__ vector unsigned char __ATTRS_o_ai
4946vec_or(vector unsigned char __a, vector bool char __b) {
4947 return __a | (vector unsigned char)__b;
4948}
4949
4950static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,
4951 vector bool char __b) {
4952 return __a | __b;
4953}
4954
4955static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
4956 vector short __b) {
4957 return __a | __b;
4958}
4959
4960static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,
4961 vector short __b) {
4962 return (vector short)__a | __b;
4963}
4964
4965static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,
4966 vector bool short __b) {
4967 return __a | (vector short)__b;
4968}
4969
4970static __inline__ vector unsigned short __ATTRS_o_ai
4971vec_or(vector unsigned short __a, vector unsigned short __b) {
4972 return __a | __b;
4973}
4974
4975static __inline__ vector unsigned short __ATTRS_o_ai
4976vec_or(vector bool short __a, vector unsigned short __b) {
4977 return (vector unsigned short)__a | __b;
4978}
4979
4980static __inline__ vector unsigned short __ATTRS_o_ai
4981vec_or(vector unsigned short __a, vector bool short __b) {
4982 return __a | (vector unsigned short)__b;
4983}
4984
4985static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,
4986 vector bool short __b) {
4987 return __a | __b;
4988}
4989
4990static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
4991 vector int __b) {
4992 return __a | __b;
4993}
4994
4995static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,
4996 vector int __b) {
4997 return (vector int)__a | __b;
4998}
4999
5000static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,
5001 vector bool int __b) {
5002 return __a | (vector int)__b;
5003}
5004
5005static __inline__ vector unsigned int __ATTRS_o_ai
5006vec_or(vector unsigned int __a, vector unsigned int __b) {
5007 return __a | __b;
5008}
5009
5010static __inline__ vector unsigned int __ATTRS_o_ai
5011vec_or(vector bool int __a, vector unsigned int __b) {
5012 return (vector unsigned int)__a | __b;
5013}
5014
5015static __inline__ vector unsigned int __ATTRS_o_ai
5016vec_or(vector unsigned int __a, vector bool int __b) {
5017 return __a | (vector unsigned int)__b;
5018}
5019
5020static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,
5021 vector bool int __b) {
5022 return __a | __b;
5023}
5024
5025static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
5026 vector float __b) {
5027 vector unsigned int __res =
5028 (vector unsigned int)__a | (vector unsigned int)__b;
5029 return (vector float)__res;
5030}
5031
5032static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,
5033 vector float __b) {
5034 vector unsigned int __res =
5035 (vector unsigned int)__a | (vector unsigned int)__b;
5036 return (vector float)__res;
5037}
5038
5039static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,
5040 vector bool int __b) {
5041 vector unsigned int __res =
5042 (vector unsigned int)__a | (vector unsigned int)__b;
5043 return (vector float)__res;
5044}
5045
5046#ifdef __VSX__
5047static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,
5048 vector double __b) {
5049 return (vector unsigned long long)__a | (vector unsigned long long)__b;
5050}
5051
5052static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
5053 vector bool long long __b) {
5054 return (vector unsigned long long)__a | (vector unsigned long long)__b;
5055}
5056
5057static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,
5058 vector double __b) {
5059 vector unsigned long long __res =
5060 (vector unsigned long long)__a | (vector unsigned long long)__b;
5061 return (vector double)__res;
5062}
5063
5064static __inline__ vector signed long long __ATTRS_o_ai
5065vec_or(vector signed long long __a, vector signed long long __b) {
5066 return __a | __b;
5067}
5068
5069static __inline__ vector signed long long __ATTRS_o_ai
5070vec_or(vector bool long long __a, vector signed long long __b) {
5071 return (vector signed long long)__a | __b;
5072}
5073
5074static __inline__ vector signed long long __ATTRS_o_ai
5075vec_or(vector signed long long __a, vector bool long long __b) {
5076 return __a | (vector signed long long)__b;
5077}
5078
5079static __inline__ vector unsigned long long __ATTRS_o_ai
5080vec_or(vector unsigned long long __a, vector unsigned long long __b) {
5081 return __a | __b;
5082}
5083
5084static __inline__ vector unsigned long long __ATTRS_o_ai
5085vec_or(vector bool long long __a, vector unsigned long long __b) {
5086 return (vector unsigned long long)__a | __b;
5087}
5088
5089static __inline__ vector unsigned long long __ATTRS_o_ai
5090vec_or(vector unsigned long long __a, vector bool long long __b) {
5091 return __a | (vector unsigned long long)__b;
5092}
5093
5094static __inline__ vector bool long long __ATTRS_o_ai
5095vec_or(vector bool long long __a, vector bool long long __b) {
5096 return __a | __b;
5097}
5098#endif
5099
5100#ifdef __POWER8_VECTOR__
5101static __inline__ vector signed char __ATTRS_o_ai
5102vec_orc(vector signed char __a, vector signed char __b) {
5103 return __a | ~__b;
5104}
5105
5106static __inline__ vector signed char __ATTRS_o_ai
5107vec_orc(vector signed char __a, vector bool char __b) {
5108 return __a | ~__b;
5109}
5110
5111static __inline__ vector signed char __ATTRS_o_ai
5112vec_orc(vector bool char __a, vector signed char __b) {
5113 return __a | ~__b;
5114}
5115
5116static __inline__ vector unsigned char __ATTRS_o_ai
5117vec_orc(vector unsigned char __a, vector unsigned char __b) {
5118 return __a | ~__b;
5119}
5120
5121static __inline__ vector unsigned char __ATTRS_o_ai
5122vec_orc(vector unsigned char __a, vector bool char __b) {
5123 return __a | ~__b;
5124}
5125
5126static __inline__ vector unsigned char __ATTRS_o_ai
5127vec_orc(vector bool char __a, vector unsigned char __b) {
5128 return __a | ~__b;
5129}
5130
5131static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,
5132 vector bool char __b) {
5133 return __a | ~__b;
5134}
5135
5136static __inline__ vector signed short __ATTRS_o_ai
5137vec_orc(vector signed short __a, vector signed short __b) {
5138 return __a | ~__b;
5139}
5140
5141static __inline__ vector signed short __ATTRS_o_ai
5142vec_orc(vector signed short __a, vector bool short __b) {
5143 return __a | ~__b;
5144}
5145
5146static __inline__ vector signed short __ATTRS_o_ai
5147vec_orc(vector bool short __a, vector signed short __b) {
5148 return __a | ~__b;
5149}
5150
5151static __inline__ vector unsigned short __ATTRS_o_ai
5152vec_orc(vector unsigned short __a, vector unsigned short __b) {
5153 return __a | ~__b;
5154}
5155
5156static __inline__ vector unsigned short __ATTRS_o_ai
5157vec_orc(vector unsigned short __a, vector bool short __b) {
5158 return __a | ~__b;
5159}
5160
5161static __inline__ vector unsigned short __ATTRS_o_ai
5162vec_orc(vector bool short __a, vector unsigned short __b) {
5163 return __a | ~__b;
5164}
5165
5166static __inline__ vector bool short __ATTRS_o_ai
5167vec_orc(vector bool short __a, vector bool short __b) {
5168 return __a | ~__b;
5169}
5170
5171static __inline__ vector signed int __ATTRS_o_ai
5172vec_orc(vector signed int __a, vector signed int __b) {
5173 return __a | ~__b;
5174}
5175
5176static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,
5177 vector bool int __b) {
5178 return __a | ~__b;
5179}
5180
5181static __inline__ vector signed int __ATTRS_o_ai
5182vec_orc(vector bool int __a, vector signed int __b) {
5183 return __a | ~__b;
5184}
5185
5186static __inline__ vector unsigned int __ATTRS_o_ai
5187vec_orc(vector unsigned int __a, vector unsigned int __b) {
5188 return __a | ~__b;
5189}
5190
5191static __inline__ vector unsigned int __ATTRS_o_ai
5192vec_orc(vector unsigned int __a, vector bool int __b) {
5193 return __a | ~__b;
5194}
5195
5196static __inline__ vector unsigned int __ATTRS_o_ai
5197vec_orc(vector bool int __a, vector unsigned int __b) {
5198 return __a | ~__b;
5199}
5200
5201static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,
5202 vector bool int __b) {
5203 return __a | ~__b;
5204}
5205
5206static __inline__ vector signed long long __ATTRS_o_ai
5207vec_orc(vector signed long long __a, vector signed long long __b) {
5208 return __a | ~__b;
5209}
5210
5211static __inline__ vector signed long long __ATTRS_o_ai
5212vec_orc(vector signed long long __a, vector bool long long __b) {
5213 return __a | ~__b;
5214}
5215
5216static __inline__ vector signed long long __ATTRS_o_ai
5217vec_orc(vector bool long long __a, vector signed long long __b) {
5218 return __a | ~__b;
5219}
5220
5221static __inline__ vector unsigned long long __ATTRS_o_ai
5222vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
5223 return __a | ~__b;
5224}
5225
5226static __inline__ vector unsigned long long __ATTRS_o_ai
5227vec_orc(vector unsigned long long __a, vector bool long long __b) {
5228 return __a | ~__b;
5229}
5230
5231static __inline__ vector unsigned long long __ATTRS_o_ai
5232vec_orc(vector bool long long __a, vector unsigned long long __b) {
5233 return __a | ~__b;
5234}
5235
5236static __inline__ vector bool long long __ATTRS_o_ai
5237vec_orc(vector bool long long __a, vector bool long long __b) {
5238 return __a | ~__b;
5239}
5240#endif
5241
5242/* vec_vor */
5243
5244static __inline__ vector signed char __ATTRS_o_ai
5245vec_vor(vector signed char __a, vector signed char __b) {
5246 return __a | __b;
5247}
5248
5249static __inline__ vector signed char __ATTRS_o_ai
5250vec_vor(vector bool char __a, vector signed char __b) {
5251 return (vector signed char)__a | __b;
5252}
5253
5254static __inline__ vector signed char __ATTRS_o_ai
5255vec_vor(vector signed char __a, vector bool char __b) {
5256 return __a | (vector signed char)__b;
5257}
5258
5259static __inline__ vector unsigned char __ATTRS_o_ai
5260vec_vor(vector unsigned char __a, vector unsigned char __b) {
5261 return __a | __b;
5262}
5263
5264static __inline__ vector unsigned char __ATTRS_o_ai
5265vec_vor(vector bool char __a, vector unsigned char __b) {
5266 return (vector unsigned char)__a | __b;
5267}
5268
5269static __inline__ vector unsigned char __ATTRS_o_ai
5270vec_vor(vector unsigned char __a, vector bool char __b) {
5271 return __a | (vector unsigned char)__b;
5272}
5273
5274static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,
5275 vector bool char __b) {
5276 return __a | __b;
5277}
5278
5279static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
5280 vector short __b) {
5281 return __a | __b;
5282}
5283
5284static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,
5285 vector short __b) {
5286 return (vector short)__a | __b;
5287}
5288
5289static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,
5290 vector bool short __b) {
5291 return __a | (vector short)__b;
5292}
5293
5294static __inline__ vector unsigned short __ATTRS_o_ai
5295vec_vor(vector unsigned short __a, vector unsigned short __b) {
5296 return __a | __b;
5297}
5298
5299static __inline__ vector unsigned short __ATTRS_o_ai
5300vec_vor(vector bool short __a, vector unsigned short __b) {
5301 return (vector unsigned short)__a | __b;
5302}
5303
5304static __inline__ vector unsigned short __ATTRS_o_ai
5305vec_vor(vector unsigned short __a, vector bool short __b) {
5306 return __a | (vector unsigned short)__b;
5307}
5308
5309static __inline__ vector bool short __ATTRS_o_ai
5310vec_vor(vector bool short __a, vector bool short __b) {
5311 return __a | __b;
5312}
5313
5314static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
5315 vector int __b) {
5316 return __a | __b;
5317}
5318
5319static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,
5320 vector int __b) {
5321 return (vector int)__a | __b;
5322}
5323
5324static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,
5325 vector bool int __b) {
5326 return __a | (vector int)__b;
5327}
5328
5329static __inline__ vector unsigned int __ATTRS_o_ai
5330vec_vor(vector unsigned int __a, vector unsigned int __b) {
5331 return __a | __b;
5332}
5333
5334static __inline__ vector unsigned int __ATTRS_o_ai
5335vec_vor(vector bool int __a, vector unsigned int __b) {
5336 return (vector unsigned int)__a | __b;
5337}
5338
5339static __inline__ vector unsigned int __ATTRS_o_ai
5340vec_vor(vector unsigned int __a, vector bool int __b) {
5341 return __a | (vector unsigned int)__b;
5342}
5343
5344static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,
5345 vector bool int __b) {
5346 return __a | __b;
5347}
5348
5349static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
5350 vector float __b) {
5351 vector unsigned int __res =
5352 (vector unsigned int)__a | (vector unsigned int)__b;
5353 return (vector float)__res;
5354}
5355
5356static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,
5357 vector float __b) {
5358 vector unsigned int __res =
5359 (vector unsigned int)__a | (vector unsigned int)__b;
5360 return (vector float)__res;
5361}
5362
5363static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,
5364 vector bool int __b) {
5365 vector unsigned int __res =
5366 (vector unsigned int)__a | (vector unsigned int)__b;
5367 return (vector float)__res;
5368}
5369
5370#ifdef __VSX__
5371static __inline__ vector signed long long __ATTRS_o_ai
5372vec_vor(vector signed long long __a, vector signed long long __b) {
5373 return __a | __b;
5374}
5375
5376static __inline__ vector signed long long __ATTRS_o_ai
5377vec_vor(vector bool long long __a, vector signed long long __b) {
5378 return (vector signed long long)__a | __b;
5379}
5380
5381static __inline__ vector signed long long __ATTRS_o_ai
5382vec_vor(vector signed long long __a, vector bool long long __b) {
5383 return __a | (vector signed long long)__b;
5384}
5385
5386static __inline__ vector unsigned long long __ATTRS_o_ai
5387vec_vor(vector unsigned long long __a, vector unsigned long long __b) {
5388 return __a | __b;
5389}
5390
5391static __inline__ vector unsigned long long __ATTRS_o_ai
5392vec_vor(vector bool long long __a, vector unsigned long long __b) {
5393 return (vector unsigned long long)__a | __b;
5394}
5395
5396static __inline__ vector unsigned long long __ATTRS_o_ai
5397vec_vor(vector unsigned long long __a, vector bool long long __b) {
5398 return __a | (vector unsigned long long)__b;
5399}
5400
5401static __inline__ vector bool long long __ATTRS_o_ai
5402vec_vor(vector bool long long __a, vector bool long long __b) {
5403 return __a | __b;
5404}
5405#endif
5406
5407/* vec_pack */
5408
5409/* The various vector pack instructions have a big-endian bias, so for
5410 little endian we must handle reversed element numbering. */
5411
5412static __inline__ vector signed char __ATTRS_o_ai
5413vec_pack(vector signed short __a, vector signed short __b) {
5414#ifdef __LITTLE_ENDIAN__
5415 return (vector signed char)vec_perm(
5416 __a, __b,
5417 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5418 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5419#else
5420 return (vector signed char)vec_perm(
5421 __a, __b,
5422 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5423 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5424#endif
5425}
5426
5427static __inline__ vector unsigned char __ATTRS_o_ai
5428vec_pack(vector unsigned short __a, vector unsigned short __b) {
5429#ifdef __LITTLE_ENDIAN__
5430 return (vector unsigned char)vec_perm(
5431 __a, __b,
5432 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5433 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5434#else
5435 return (vector unsigned char)vec_perm(
5436 __a, __b,
5437 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5438 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5439#endif
5440}
5441
5442static __inline__ vector bool char __ATTRS_o_ai
5443vec_pack(vector bool short __a, vector bool short __b) {
5444#ifdef __LITTLE_ENDIAN__
5445 return (vector bool char)vec_perm(
5446 __a, __b,
5447 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5448 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5449#else
5450 return (vector bool char)vec_perm(
5451 __a, __b,
5452 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5453 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5454#endif
5455}
5456
5457static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,
5458 vector int __b) {
5459#ifdef __LITTLE_ENDIAN__
5460 return (vector short)vec_perm(
5461 __a, __b,
5462 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5463 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5464#else
5465 return (vector short)vec_perm(
5466 __a, __b,
5467 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5468 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5469#endif
5470}
5471
5472static __inline__ vector unsigned short __ATTRS_o_ai
5473vec_pack(vector unsigned int __a, vector unsigned int __b) {
5474#ifdef __LITTLE_ENDIAN__
5475 return (vector unsigned short)vec_perm(
5476 __a, __b,
5477 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5478 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5479#else
5480 return (vector unsigned short)vec_perm(
5481 __a, __b,
5482 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5483 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5484#endif
5485}
5486
5487static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,
5488 vector bool int __b) {
5489#ifdef __LITTLE_ENDIAN__
5490 return (vector bool short)vec_perm(
5491 __a, __b,
5492 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5493 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5494#else
5495 return (vector bool short)vec_perm(
5496 __a, __b,
5497 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5498 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5499#endif
5500}
5501
5502#ifdef __VSX__
5503static __inline__ vector signed int __ATTRS_o_ai
5504vec_pack(vector signed long long __a, vector signed long long __b) {
5505#ifdef __LITTLE_ENDIAN__
5506 return (vector signed int)vec_perm(
5507 __a, __b,
5508 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5509 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5510#else
5511 return (vector signed int)vec_perm(
5512 __a, __b,
5513 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5514 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5515#endif
5516}
5517static __inline__ vector unsigned int __ATTRS_o_ai
5518vec_pack(vector unsigned long long __a, vector unsigned long long __b) {
5519#ifdef __LITTLE_ENDIAN__
5520 return (vector unsigned int)vec_perm(
5521 __a, __b,
5522 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5523 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5524#else
5525 return (vector unsigned int)vec_perm(
5526 __a, __b,
5527 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5528 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5529#endif
5530}
5531
5532static __inline__ vector bool int __ATTRS_o_ai
5533vec_pack(vector bool long long __a, vector bool long long __b) {
5534#ifdef __LITTLE_ENDIAN__
5535 return (vector bool int)vec_perm(
5536 __a, __b,
5537 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5538 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5539#else
5540 return (vector bool int)vec_perm(
5541 __a, __b,
5542 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5543 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5544#endif
5545}
5546
5547#endif
5548
5549/* vec_vpkuhum */
5550
5551#define __builtin_altivec_vpkuhum vec_vpkuhum
5552
5553static __inline__ vector signed char __ATTRS_o_ai
5554vec_vpkuhum(vector signed short __a, vector signed short __b) {
5555#ifdef __LITTLE_ENDIAN__
5556 return (vector signed char)vec_perm(
5557 __a, __b,
5558 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5559 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5560#else
5561 return (vector signed char)vec_perm(
5562 __a, __b,
5563 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5564 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5565#endif
5566}
5567
5568static __inline__ vector unsigned char __ATTRS_o_ai
5569vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {
5570#ifdef __LITTLE_ENDIAN__
5571 return (vector unsigned char)vec_perm(
5572 __a, __b,
5573 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5574 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5575#else
5576 return (vector unsigned char)vec_perm(
5577 __a, __b,
5578 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5579 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5580#endif
5581}
5582
5583static __inline__ vector bool char __ATTRS_o_ai
5584vec_vpkuhum(vector bool short __a, vector bool short __b) {
5585#ifdef __LITTLE_ENDIAN__
5586 return (vector bool char)vec_perm(
5587 __a, __b,
5588 (vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,
5589 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));
5590#else
5591 return (vector bool char)vec_perm(
5592 __a, __b,
5593 (vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
5594 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
5595#endif
5596}
5597
5598/* vec_vpkuwum */
5599
5600#define __builtin_altivec_vpkuwum vec_vpkuwum
5601
5602static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,
5603 vector int __b) {
5604#ifdef __LITTLE_ENDIAN__
5605 return (vector short)vec_perm(
5606 __a, __b,
5607 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5608 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5609#else
5610 return (vector short)vec_perm(
5611 __a, __b,
5612 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5613 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5614#endif
5615}
5616
5617static __inline__ vector unsigned short __ATTRS_o_ai
5618vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {
5619#ifdef __LITTLE_ENDIAN__
5620 return (vector unsigned short)vec_perm(
5621 __a, __b,
5622 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5623 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5624#else
5625 return (vector unsigned short)vec_perm(
5626 __a, __b,
5627 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5628 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5629#endif
5630}
5631
5632static __inline__ vector bool short __ATTRS_o_ai
5633vec_vpkuwum(vector bool int __a, vector bool int __b) {
5634#ifdef __LITTLE_ENDIAN__
5635 return (vector bool short)vec_perm(
5636 __a, __b,
5637 (vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,
5638 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));
5639#else
5640 return (vector bool short)vec_perm(
5641 __a, __b,
5642 (vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
5643 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
5644#endif
5645}
5646
5647/* vec_vpkudum */
5648
5649#ifdef __POWER8_VECTOR__
5650#define __builtin_altivec_vpkudum vec_vpkudum
5651
5652static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,
5653 vector long long __b) {
5654#ifdef __LITTLE_ENDIAN__
5655 return (vector int)vec_perm(
5656 __a, __b,
5657 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5658 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5659#else
5660 return (vector int)vec_perm(
5661 __a, __b,
5662 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5663 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5664#endif
5665}
5666
5667static __inline__ vector unsigned int __ATTRS_o_ai
5668vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {
5669#ifdef __LITTLE_ENDIAN__
5670 return (vector unsigned int)vec_perm(
5671 __a, __b,
5672 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5673 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5674#else
5675 return (vector unsigned int)vec_perm(
5676 __a, __b,
5677 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5678 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5679#endif
5680}
5681
5682static __inline__ vector bool int __ATTRS_o_ai
5683vec_vpkudum(vector bool long long __a, vector bool long long __b) {
5684#ifdef __LITTLE_ENDIAN__
5685 return (vector bool int)vec_perm(
5686 (vector long long)__a, (vector long long)__b,
5687 (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,
5688 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));
5689#else
5690 return (vector bool int)vec_perm(
5691 (vector long long)__a, (vector long long)__b,
5692 (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,
5693 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));
5694#endif
5695}
5696#endif
5697
5698/* vec_packpx */
5699
5700static __inline__ vector pixel __attribute__((__always_inline__))
5701vec_packpx(vector unsigned int __a, vector unsigned int __b) {
5702#ifdef __LITTLE_ENDIAN__
5703 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
5704#else
5705 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
5706#endif
5707}
5708
5709/* vec_vpkpx */
5710
5711static __inline__ vector pixel __attribute__((__always_inline__))
5712vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {
5713#ifdef __LITTLE_ENDIAN__
5714 return (vector pixel)__builtin_altivec_vpkpx(__b, __a);
5715#else
5716 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
5717#endif
5718}
5719
5720/* vec_packs */
5721
5722static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,
5723 vector short __b) {
5724#ifdef __LITTLE_ENDIAN__
5725 return __builtin_altivec_vpkshss(__b, __a);
5726#else
5727 return __builtin_altivec_vpkshss(__a, __b);
5728#endif
5729}
5730
5731static __inline__ vector unsigned char __ATTRS_o_ai
5732vec_packs(vector unsigned short __a, vector unsigned short __b) {
5733#ifdef __LITTLE_ENDIAN__
5734 return __builtin_altivec_vpkuhus(__b, __a);
5735#else
5736 return __builtin_altivec_vpkuhus(__a, __b);
5737#endif
5738}
5739
5740static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,
5741 vector int __b) {
5742#ifdef __LITTLE_ENDIAN__
5743 return __builtin_altivec_vpkswss(__b, __a);
5744#else
5745 return __builtin_altivec_vpkswss(__a, __b);
5746#endif
5747}
5748
5749static __inline__ vector unsigned short __ATTRS_o_ai
5750vec_packs(vector unsigned int __a, vector unsigned int __b) {
5751#ifdef __LITTLE_ENDIAN__
5752 return __builtin_altivec_vpkuwus(__b, __a);
5753#else
5754 return __builtin_altivec_vpkuwus(__a, __b);
5755#endif
5756}
5757
5758#ifdef __POWER8_VECTOR__
5759static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,
5760 vector long long __b) {
5761#ifdef __LITTLE_ENDIAN__
5762 return __builtin_altivec_vpksdss(__b, __a);
5763#else
5764 return __builtin_altivec_vpksdss(__a, __b);
5765#endif
5766}
5767
5768static __inline__ vector unsigned int __ATTRS_o_ai
5769vec_packs(vector unsigned long long __a, vector unsigned long long __b) {
5770#ifdef __LITTLE_ENDIAN__
5771 return __builtin_altivec_vpkudus(__b, __a);
5772#else
5773 return __builtin_altivec_vpkudus(__a, __b);
5774#endif
5775}
5776#endif
5777
5778/* vec_vpkshss */
5779
5780static __inline__ vector signed char __attribute__((__always_inline__))
5781vec_vpkshss(vector short __a, vector short __b) {
5782#ifdef __LITTLE_ENDIAN__
5783 return __builtin_altivec_vpkshss(__b, __a);
5784#else
5785 return __builtin_altivec_vpkshss(__a, __b);
5786#endif
5787}
5788
5789/* vec_vpksdss */
5790
5791#ifdef __POWER8_VECTOR__
5792static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,
5793 vector long long __b) {
5794#ifdef __LITTLE_ENDIAN__
5795 return __builtin_altivec_vpksdss(__b, __a);
5796#else
5797 return __builtin_altivec_vpksdss(__a, __b);
5798#endif
5799}
5800#endif
5801
5802/* vec_vpkuhus */
5803
5804static __inline__ vector unsigned char __attribute__((__always_inline__))
5805vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {
5806#ifdef __LITTLE_ENDIAN__
5807 return __builtin_altivec_vpkuhus(__b, __a);
5808#else
5809 return __builtin_altivec_vpkuhus(__a, __b);
5810#endif
5811}
5812
5813/* vec_vpkudus */
5814
5815#ifdef __POWER8_VECTOR__
5816static __inline__ vector unsigned int __attribute__((__always_inline__))
5817vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {
5818#ifdef __LITTLE_ENDIAN__
5819 return __builtin_altivec_vpkudus(__b, __a);
5820#else
5821 return __builtin_altivec_vpkudus(__a, __b);
5822#endif
5823}
5824#endif
5825
5826/* vec_vpkswss */
5827
5828static __inline__ vector signed short __attribute__((__always_inline__))
5829vec_vpkswss(vector int __a, vector int __b) {
5830#ifdef __LITTLE_ENDIAN__
5831 return __builtin_altivec_vpkswss(__b, __a);
5832#else
5833 return __builtin_altivec_vpkswss(__a, __b);
5834#endif
5835}
5836
5837/* vec_vpkuwus */
5838
5839static __inline__ vector unsigned short __attribute__((__always_inline__))
5840vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {
5841#ifdef __LITTLE_ENDIAN__
5842 return __builtin_altivec_vpkuwus(__b, __a);
5843#else
5844 return __builtin_altivec_vpkuwus(__a, __b);
5845#endif
5846}
5847
5848/* vec_packsu */
5849
5850static __inline__ vector unsigned char __ATTRS_o_ai
5851vec_packsu(vector short __a, vector short __b) {
5852#ifdef __LITTLE_ENDIAN__
5853 return __builtin_altivec_vpkshus(__b, __a);
5854#else
5855 return __builtin_altivec_vpkshus(__a, __b);
5856#endif
5857}
5858
5859static __inline__ vector unsigned char __ATTRS_o_ai
5860vec_packsu(vector unsigned short __a, vector unsigned short __b) {
5861#ifdef __LITTLE_ENDIAN__
5862 return __builtin_altivec_vpkuhus(__b, __a);
5863#else
5864 return __builtin_altivec_vpkuhus(__a, __b);
5865#endif
5866}
5867
5868static __inline__ vector unsigned short __ATTRS_o_ai
5869vec_packsu(vector int __a, vector int __b) {
5870#ifdef __LITTLE_ENDIAN__
5871 return __builtin_altivec_vpkswus(__b, __a);
5872#else
5873 return __builtin_altivec_vpkswus(__a, __b);
5874#endif
5875}
5876
5877static __inline__ vector unsigned short __ATTRS_o_ai
5878vec_packsu(vector unsigned int __a, vector unsigned int __b) {
5879#ifdef __LITTLE_ENDIAN__
5880 return __builtin_altivec_vpkuwus(__b, __a);
5881#else
5882 return __builtin_altivec_vpkuwus(__a, __b);
5883#endif
5884}
5885
5886#ifdef __POWER8_VECTOR__
5887static __inline__ vector unsigned int __ATTRS_o_ai
5888vec_packsu(vector long long __a, vector long long __b) {
5889#ifdef __LITTLE_ENDIAN__
5890 return __builtin_altivec_vpksdus(__b, __a);
5891#else
5892 return __builtin_altivec_vpksdus(__a, __b);
5893#endif
5894}
5895
5896static __inline__ vector unsigned int __ATTRS_o_ai
5897vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {
5898#ifdef __LITTLE_ENDIAN__
5899 return __builtin_altivec_vpkudus(__b, __a);
5900#else
5901 return __builtin_altivec_vpkudus(__a, __b);
5902#endif
5903}
5904#endif
5905
5906/* vec_vpkshus */
5907
5908static __inline__ vector unsigned char __ATTRS_o_ai
5909vec_vpkshus(vector short __a, vector short __b) {
5910#ifdef __LITTLE_ENDIAN__
5911 return __builtin_altivec_vpkshus(__b, __a);
5912#else
5913 return __builtin_altivec_vpkshus(__a, __b);
5914#endif
5915}
5916
5917static __inline__ vector unsigned char __ATTRS_o_ai
5918vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {
5919#ifdef __LITTLE_ENDIAN__
5920 return __builtin_altivec_vpkuhus(__b, __a);
5921#else
5922 return __builtin_altivec_vpkuhus(__a, __b);
5923#endif
5924}
5925
5926/* vec_vpkswus */
5927
5928static __inline__ vector unsigned short __ATTRS_o_ai
5929vec_vpkswus(vector int __a, vector int __b) {
5930#ifdef __LITTLE_ENDIAN__
5931 return __builtin_altivec_vpkswus(__b, __a);
5932#else
5933 return __builtin_altivec_vpkswus(__a, __b);
5934#endif
5935}
5936
5937static __inline__ vector unsigned short __ATTRS_o_ai
5938vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {
5939#ifdef __LITTLE_ENDIAN__
5940 return __builtin_altivec_vpkuwus(__b, __a);
5941#else
5942 return __builtin_altivec_vpkuwus(__a, __b);
5943#endif
5944}
5945
5946/* vec_vpksdus */
5947
5948#ifdef __POWER8_VECTOR__
5949static __inline__ vector unsigned int __ATTRS_o_ai
5950vec_vpksdus(vector long long __a, vector long long __b) {
5951#ifdef __LITTLE_ENDIAN__
5952 return __builtin_altivec_vpksdus(__b, __a);
5953#else
5954 return __builtin_altivec_vpksdus(__a, __b);
5955#endif
5956}
5957#endif
5958
5959/* vec_perm */
5960
5961// The vperm instruction is defined architecturally with a big-endian bias.
5962// For little endian, we swap the input operands and invert the permute
5963// control vector. Only the rightmost 5 bits matter, so we could use
5964// a vector of all 31s instead of all 255s to perform the inversion.
5965// However, when the PCV is not a constant, using 255 has an advantage
5966// in that the vec_xor can be recognized as a vec_nor (and for P8 and
5967// later, possibly a vec_nand).
5968
5969static __inline__ vector signed char __ATTRS_o_ai vec_perm(
5970 vector signed char __a, vector signed char __b, vector unsigned char __c) {
5971#ifdef __LITTLE_ENDIAN__
5972 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
5973 255, 255, 255, 255, 255, 255, 255, 255};
5974 __d = vec_xor(__c, __d);
5975 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,
5976 (vector int)__a, __d);
5977#else
5978 return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,
5979 (vector int)__b, __c);
5980#endif
5981}
5982
5983static __inline__ vector unsigned char __ATTRS_o_ai
5984vec_perm(vector unsigned char __a, vector unsigned char __b,
5985 vector unsigned char __c) {
5986#ifdef __LITTLE_ENDIAN__
5987 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
5988 255, 255, 255, 255, 255, 255, 255, 255};
5989 __d = vec_xor(__c, __d);
5990 return (vector unsigned char)__builtin_altivec_vperm_4si(
5991 (vector int)__b, (vector int)__a, __d);
5992#else
5993 return (vector unsigned char)__builtin_altivec_vperm_4si(
5994 (vector int)__a, (vector int)__b, __c);
5995#endif
5996}
5997
5998static __inline__ vector bool char __ATTRS_o_ai
5999vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {
6000#ifdef __LITTLE_ENDIAN__
6001 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6002 255, 255, 255, 255, 255, 255, 255, 255};
6003 __d = vec_xor(__c, __d);
6004 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,
6005 (vector int)__a, __d);
6006#else
6007 return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,
6008 (vector int)__b, __c);
6009#endif
6010}
6011
6012static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
6013 vector signed short __b,
6014 vector unsigned char __c) {
6015#ifdef __LITTLE_ENDIAN__
6016 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6017 255, 255, 255, 255, 255, 255, 255, 255};
6018 __d = vec_xor(__c, __d);
6019 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,
6020 (vector int)__a, __d);
6021#else
6022 return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,
6023 (vector int)__b, __c);
6024#endif
6025}
6026
6027static __inline__ vector unsigned short __ATTRS_o_ai
6028vec_perm(vector unsigned short __a, vector unsigned short __b,
6029 vector unsigned char __c) {
6030#ifdef __LITTLE_ENDIAN__
6031 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6032 255, 255, 255, 255, 255, 255, 255, 255};
6033 __d = vec_xor(__c, __d);
6034 return (vector unsigned short)__builtin_altivec_vperm_4si(
6035 (vector int)__b, (vector int)__a, __d);
6036#else
6037 return (vector unsigned short)__builtin_altivec_vperm_4si(
6038 (vector int)__a, (vector int)__b, __c);
6039#endif
6040}
6041
6042static __inline__ vector bool short __ATTRS_o_ai vec_perm(
6043 vector bool short __a, vector bool short __b, vector unsigned char __c) {
6044#ifdef __LITTLE_ENDIAN__
6045 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6046 255, 255, 255, 255, 255, 255, 255, 255};
6047 __d = vec_xor(__c, __d);
6048 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,
6049 (vector int)__a, __d);
6050#else
6051 return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,
6052 (vector int)__b, __c);
6053#endif
6054}
6055
6056static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
6057 vector pixel __b,
6058 vector unsigned char __c) {
6059#ifdef __LITTLE_ENDIAN__
6060 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6061 255, 255, 255, 255, 255, 255, 255, 255};
6062 __d = vec_xor(__c, __d);
6063 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,
6064 (vector int)__a, __d);
6065#else
6066 return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,
6067 (vector int)__b, __c);
6068#endif
6069}
6070
6071static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
6072 vector signed int __b,
6073 vector unsigned char __c) {
6074#ifdef __LITTLE_ENDIAN__
6075 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6076 255, 255, 255, 255, 255, 255, 255, 255};
6077 __d = vec_xor(__c, __d);
6078 return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);
6079#else
6080 return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);
6081#endif
6082}
6083
6084static __inline__ vector unsigned int __ATTRS_o_ai
6085vec_perm(vector unsigned int __a, vector unsigned int __b,
6086 vector unsigned char __c) {
6087#ifdef __LITTLE_ENDIAN__
6088 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6089 255, 255, 255, 255, 255, 255, 255, 255};
6090 __d = vec_xor(__c, __d);
6091 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,
6092 (vector int)__a, __d);
6093#else
6094 return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,
6095 (vector int)__b, __c);
6096#endif
6097}
6098
6099static __inline__ vector bool int __ATTRS_o_ai
6100vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
6101#ifdef __LITTLE_ENDIAN__
6102 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6103 255, 255, 255, 255, 255, 255, 255, 255};
6104 __d = vec_xor(__c, __d);
6105 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,
6106 (vector int)__a, __d);
6107#else
6108 return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,
6109 (vector int)__b, __c);
6110#endif
6111}
6112
6113static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
6114 vector float __b,
6115 vector unsigned char __c) {
6116#ifdef __LITTLE_ENDIAN__
6117 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6118 255, 255, 255, 255, 255, 255, 255, 255};
6119 __d = vec_xor(__c, __d);
6120 return (vector float)__builtin_altivec_vperm_4si((vector int)__b,
6121 (vector int)__a, __d);
6122#else
6123 return (vector float)__builtin_altivec_vperm_4si((vector int)__a,
6124 (vector int)__b, __c);
6125#endif
6126}
6127
6128#ifdef __VSX__
6129static __inline__ vector long long __ATTRS_o_ai
6130vec_perm(vector signed long long __a, vector signed long long __b,
6131 vector unsigned char __c) {
6132#ifdef __LITTLE_ENDIAN__
6133 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6134 255, 255, 255, 255, 255, 255, 255, 255};
6135 __d = vec_xor(__c, __d);
6136 return (vector signed long long)__builtin_altivec_vperm_4si(
6137 (vector int)__b, (vector int)__a, __d);
6138#else
6139 return (vector signed long long)__builtin_altivec_vperm_4si(
6140 (vector int)__a, (vector int)__b, __c);
6141#endif
6142}
6143
6144static __inline__ vector unsigned long long __ATTRS_o_ai
6145vec_perm(vector unsigned long long __a, vector unsigned long long __b,
6146 vector unsigned char __c) {
6147#ifdef __LITTLE_ENDIAN__
6148 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6149 255, 255, 255, 255, 255, 255, 255, 255};
6150 __d = vec_xor(__c, __d);
6151 return (vector unsigned long long)__builtin_altivec_vperm_4si(
6152 (vector int)__b, (vector int)__a, __d);
6153#else
6154 return (vector unsigned long long)__builtin_altivec_vperm_4si(
6155 (vector int)__a, (vector int)__b, __c);
6156#endif
6157}
6158
6159static __inline__ vector bool long long __ATTRS_o_ai
6160vec_perm(vector bool long long __a, vector bool long long __b,
6161 vector unsigned char __c) {
6162#ifdef __LITTLE_ENDIAN__
6163 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6164 255, 255, 255, 255, 255, 255, 255, 255};
6165 __d = vec_xor(__c, __d);
6166 return (vector bool long long)__builtin_altivec_vperm_4si(
6167 (vector int)__b, (vector int)__a, __d);
6168#else
6169 return (vector bool long long)__builtin_altivec_vperm_4si(
6170 (vector int)__a, (vector int)__b, __c);
6171#endif
6172}
6173
6174static __inline__ vector double __ATTRS_o_ai
6175vec_perm(vector double __a, vector double __b, vector unsigned char __c) {
6176#ifdef __LITTLE_ENDIAN__
6177 vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,
6178 255, 255, 255, 255, 255, 255, 255, 255};
6179 __d = vec_xor(__c, __d);
6180 return (vector double)__builtin_altivec_vperm_4si((vector int)__b,
6181 (vector int)__a, __d);
6182#else
6183 return (vector double)__builtin_altivec_vperm_4si((vector int)__a,
6184 (vector int)__b, __c);
6185#endif
6186}
6187#endif
6188
6189/* vec_vperm */
6190
6191static __inline__ vector signed char __ATTRS_o_ai vec_vperm(
6192 vector signed char __a, vector signed char __b, vector unsigned char __c) {
6193 return vec_perm(__a, __b, __c);
6194}
6195
6196static __inline__ vector unsigned char __ATTRS_o_ai
6197vec_vperm(vector unsigned char __a, vector unsigned char __b,
6198 vector unsigned char __c) {
6199 return vec_perm(__a, __b, __c);
6200}
6201
6202static __inline__ vector bool char __ATTRS_o_ai vec_vperm(
6203 vector bool char __a, vector bool char __b, vector unsigned char __c) {
6204 return vec_perm(__a, __b, __c);
6205}
6206
6207static __inline__ vector short __ATTRS_o_ai
6208vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {
6209 return vec_perm(__a, __b, __c);
6210}
6211
6212static __inline__ vector unsigned short __ATTRS_o_ai
6213vec_vperm(vector unsigned short __a, vector unsigned short __b,
6214 vector unsigned char __c) {
6215 return vec_perm(__a, __b, __c);
6216}
6217
6218static __inline__ vector bool short __ATTRS_o_ai vec_vperm(
6219 vector bool short __a, vector bool short __b, vector unsigned char __c) {
6220 return vec_perm(__a, __b, __c);
6221}
6222
6223static __inline__ vector pixel __ATTRS_o_ai
6224vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {
6225 return vec_perm(__a, __b, __c);
6226}
6227
6228static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,
6229 vector int __b,
6230 vector unsigned char __c) {
6231 return vec_perm(__a, __b, __c);
6232}
6233
6234static __inline__ vector unsigned int __ATTRS_o_ai
6235vec_vperm(vector unsigned int __a, vector unsigned int __b,
6236 vector unsigned char __c) {
6237 return vec_perm(__a, __b, __c);
6238}
6239
6240static __inline__ vector bool int __ATTRS_o_ai
6241vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {
6242 return vec_perm(__a, __b, __c);
6243}
6244
6245static __inline__ vector float __ATTRS_o_ai
6246vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {
6247 return vec_perm(__a, __b, __c);
6248}
6249
6250#ifdef __VSX__
6251static __inline__ vector long long __ATTRS_o_ai vec_vperm(
6252 vector long long __a, vector long long __b, vector unsigned char __c) {
6253 return vec_perm(__a, __b, __c);
6254}
6255
6256static __inline__ vector unsigned long long __ATTRS_o_ai
6257vec_vperm(vector unsigned long long __a, vector unsigned long long __b,
6258 vector unsigned char __c) {
6259 return vec_perm(__a, __b, __c);
6260}
6261
6262static __inline__ vector double __ATTRS_o_ai
6263vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {
6264 return vec_perm(__a, __b, __c);
6265}
6266#endif
6267
6268/* vec_re */
6269
6270static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {
6271#ifdef __VSX__
6272 return __builtin_vsx_xvresp(__a);
6273#else
6274 return __builtin_altivec_vrefp(__a);
6275#endif
6276}
6277
6278#ifdef __VSX__
6279static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {
6280 return __builtin_vsx_xvredp(__a);
6281}
6282#endif
6283
6284/* vec_vrefp */
6285
6286static __inline__ vector float __attribute__((__always_inline__))
6287vec_vrefp(vector float __a) {
6288 return __builtin_altivec_vrefp(__a);
6289}
6290
6291/* vec_rl */
6292
6293static __inline__ vector signed char __ATTRS_o_ai
6294vec_rl(vector signed char __a, vector unsigned char __b) {
6295 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
6296}
6297
6298static __inline__ vector unsigned char __ATTRS_o_ai
6299vec_rl(vector unsigned char __a, vector unsigned char __b) {
6300 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
6301}
6302
6303static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,
6304 vector unsigned short __b) {
6305 return __builtin_altivec_vrlh(__a, __b);
6306}
6307
6308static __inline__ vector unsigned short __ATTRS_o_ai
6309vec_rl(vector unsigned short __a, vector unsigned short __b) {
6310 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
6311}
6312
6313static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,
6314 vector unsigned int __b) {
6315 return __builtin_altivec_vrlw(__a, __b);
6316}
6317
6318static __inline__ vector unsigned int __ATTRS_o_ai
6319vec_rl(vector unsigned int __a, vector unsigned int __b) {
6320 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
6321}
6322
6323#ifdef __POWER8_VECTOR__
6324static __inline__ vector signed long long __ATTRS_o_ai
6325vec_rl(vector signed long long __a, vector unsigned long long __b) {
6326 return __builtin_altivec_vrld(__a, __b);
6327}
6328
6329static __inline__ vector unsigned long long __ATTRS_o_ai
6330vec_rl(vector unsigned long long __a, vector unsigned long long __b) {
6331 return __builtin_altivec_vrld(__a, __b);
6332}
6333#endif
6334
6335/* vec_vrlb */
6336
6337static __inline__ vector signed char __ATTRS_o_ai
6338vec_vrlb(vector signed char __a, vector unsigned char __b) {
6339 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
6340}
6341
6342static __inline__ vector unsigned char __ATTRS_o_ai
6343vec_vrlb(vector unsigned char __a, vector unsigned char __b) {
6344 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
6345}
6346
6347/* vec_vrlh */
6348
6349static __inline__ vector short __ATTRS_o_ai
6350vec_vrlh(vector short __a, vector unsigned short __b) {
6351 return __builtin_altivec_vrlh(__a, __b);
6352}
6353
6354static __inline__ vector unsigned short __ATTRS_o_ai
6355vec_vrlh(vector unsigned short __a, vector unsigned short __b) {
6356 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
6357}
6358
6359/* vec_vrlw */
6360
6361static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,
6362 vector unsigned int __b) {
6363 return __builtin_altivec_vrlw(__a, __b);
6364}
6365
6366static __inline__ vector unsigned int __ATTRS_o_ai
6367vec_vrlw(vector unsigned int __a, vector unsigned int __b) {
6368 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
6369}
6370
6371/* vec_round */
6372
6373static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {
6374#ifdef __VSX__
6375 return __builtin_vsx_xvrspi(__a);
6376#else
6377 return __builtin_altivec_vrfin(__a);
6378#endif
6379}
6380
6381#ifdef __VSX__
6382static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {
6383 return __builtin_vsx_xvrdpi(__a);
6384}
6385
6386/* vec_rint */
6387
6388static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {
6389 return __builtin_vsx_xvrspic(__a);
6390}
6391
6392static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {
6393 return __builtin_vsx_xvrdpic(__a);
6394}
6395
6396/* vec_nearbyint */
6397
6398static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {
6399 return __builtin_vsx_xvrspi(__a);
6400}
6401
6402static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {
6403 return __builtin_vsx_xvrdpi(__a);
6404}
6405#endif
6406
6407/* vec_vrfin */
6408
6409static __inline__ vector float __attribute__((__always_inline__))
6410vec_vrfin(vector float __a) {
6411 return __builtin_altivec_vrfin(__a);
6412}
6413
6414/* vec_sqrt */
6415
6416#ifdef __VSX__
6417static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {
6418 return __builtin_vsx_xvsqrtsp(__a);
6419}
6420
6421static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {
6422 return __builtin_vsx_xvsqrtdp(__a);
6423}
6424#endif
6425
6426/* vec_rsqrte */
6427
6428static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {
6429#ifdef __VSX__
6430 return __builtin_vsx_xvrsqrtesp(__a);
6431#else
6432 return __builtin_altivec_vrsqrtefp(__a);
6433#endif
6434}
6435
6436#ifdef __VSX__
6437static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {
6438 return __builtin_vsx_xvrsqrtedp(__a);
6439}
6440#endif
6441
6442/* vec_vrsqrtefp */
6443
6444static __inline__ __vector float __attribute__((__always_inline__))
6445vec_vrsqrtefp(vector float __a) {
6446 return __builtin_altivec_vrsqrtefp(__a);
6447}
6448
6449/* vec_sel */
6450
6451#define __builtin_altivec_vsel_4si vec_sel
6452
6453static __inline__ vector signed char __ATTRS_o_ai vec_sel(
6454 vector signed char __a, vector signed char __b, vector unsigned char __c) {
6455 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6456}
6457
6458static __inline__ vector signed char __ATTRS_o_ai
6459vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {
6460 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6461}
6462
6463static __inline__ vector unsigned char __ATTRS_o_ai
6464vec_sel(vector unsigned char __a, vector unsigned char __b,
6465 vector unsigned char __c) {
6466 return (__a & ~__c) | (__b & __c);
6467}
6468
6469static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(
6470 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
6471 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
6472}
6473
6474static __inline__ vector bool char __ATTRS_o_ai
6475vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
6476 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
6477}
6478
6479static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,
6480 vector bool char __b,
6481 vector bool char __c) {
6482 return (__a & ~__c) | (__b & __c);
6483}
6484
6485static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
6486 vector short __b,
6487 vector unsigned short __c) {
6488 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6489}
6490
6491static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,
6492 vector short __b,
6493 vector bool short __c) {
6494 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6495}
6496
6497static __inline__ vector unsigned short __ATTRS_o_ai
6498vec_sel(vector unsigned short __a, vector unsigned short __b,
6499 vector unsigned short __c) {
6500 return (__a & ~__c) | (__b & __c);
6501}
6502
6503static __inline__ vector unsigned short __ATTRS_o_ai
6504vec_sel(vector unsigned short __a, vector unsigned short __b,
6505 vector bool short __c) {
6506 return (__a & ~(vector unsigned short)__c) |
6507 (__b & (vector unsigned short)__c);
6508}
6509
6510static __inline__ vector bool short __ATTRS_o_ai vec_sel(
6511 vector bool short __a, vector bool short __b, vector unsigned short __c) {
6512 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
6513}
6514
6515static __inline__ vector bool short __ATTRS_o_ai
6516vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {
6517 return (__a & ~__c) | (__b & __c);
6518}
6519
6520static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
6521 vector int __b,
6522 vector unsigned int __c) {
6523 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6524}
6525
6526static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,
6527 vector int __b,
6528 vector bool int __c) {
6529 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6530}
6531
6532static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(
6533 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
6534 return (__a & ~__c) | (__b & __c);
6535}
6536
6537static __inline__ vector unsigned int __ATTRS_o_ai
6538vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
6539 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
6540}
6541
6542static __inline__ vector bool int __ATTRS_o_ai
6543vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
6544 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
6545}
6546
6547static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,
6548 vector bool int __b,
6549 vector bool int __c) {
6550 return (__a & ~__c) | (__b & __c);
6551}
6552
6553static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
6554 vector float __b,
6555 vector unsigned int __c) {
6556 vector int __res = ((vector int)__a & ~(vector int)__c) |
6557 ((vector int)__b & (vector int)__c);
6558 return (vector float)__res;
6559}
6560
6561static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,
6562 vector float __b,
6563 vector bool int __c) {
6564 vector int __res = ((vector int)__a & ~(vector int)__c) |
6565 ((vector int)__b & (vector int)__c);
6566 return (vector float)__res;
6567}
6568
6569#ifdef __VSX__
6570static __inline__ vector double __ATTRS_o_ai
6571vec_sel(vector double __a, vector double __b, vector bool long long __c) {
6572 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
6573 ((vector long long)__b & (vector long long)__c);
6574 return (vector double)__res;
6575}
6576
6577static __inline__ vector double __ATTRS_o_ai
6578vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {
6579 vector long long __res = ((vector long long)__a & ~(vector long long)__c) |
6580 ((vector long long)__b & (vector long long)__c);
6581 return (vector double)__res;
6582}
6583#endif
6584
6585/* vec_vsel */
6586
6587static __inline__ vector signed char __ATTRS_o_ai vec_vsel(
6588 vector signed char __a, vector signed char __b, vector unsigned char __c) {
6589 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6590}
6591
6592static __inline__ vector signed char __ATTRS_o_ai
6593vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {
6594 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
6595}
6596
6597static __inline__ vector unsigned char __ATTRS_o_ai
6598vec_vsel(vector unsigned char __a, vector unsigned char __b,
6599 vector unsigned char __c) {
6600 return (__a & ~__c) | (__b & __c);
6601}
6602
6603static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(
6604 vector unsigned char __a, vector unsigned char __b, vector bool char __c) {
6605 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
6606}
6607
6608static __inline__ vector bool char __ATTRS_o_ai
6609vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {
6610 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
6611}
6612
6613static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,
6614 vector bool char __b,
6615 vector bool char __c) {
6616 return (__a & ~__c) | (__b & __c);
6617}
6618
6619static __inline__ vector short __ATTRS_o_ai
6620vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {
6621 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6622}
6623
6624static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,
6625 vector short __b,
6626 vector bool short __c) {
6627 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
6628}
6629
6630static __inline__ vector unsigned short __ATTRS_o_ai
6631vec_vsel(vector unsigned short __a, vector unsigned short __b,
6632 vector unsigned short __c) {
6633 return (__a & ~__c) | (__b & __c);
6634}
6635
6636static __inline__ vector unsigned short __ATTRS_o_ai
6637vec_vsel(vector unsigned short __a, vector unsigned short __b,
6638 vector bool short __c) {
6639 return (__a & ~(vector unsigned short)__c) |
6640 (__b & (vector unsigned short)__c);
6641}
6642
6643static __inline__ vector bool short __ATTRS_o_ai vec_vsel(
6644 vector bool short __a, vector bool short __b, vector unsigned short __c) {
6645 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
6646}
6647
6648static __inline__ vector bool short __ATTRS_o_ai
6649vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {
6650 return (__a & ~__c) | (__b & __c);
6651}
6652
6653static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
6654 vector int __b,
6655 vector unsigned int __c) {
6656 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6657}
6658
6659static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,
6660 vector int __b,
6661 vector bool int __c) {
6662 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
6663}
6664
6665static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
6666 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
6667 return (__a & ~__c) | (__b & __c);
6668}
6669
6670static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(
6671 vector unsigned int __a, vector unsigned int __b, vector bool int __c) {
6672 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
6673}
6674
6675static __inline__ vector bool int __ATTRS_o_ai
6676vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {
6677 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
6678}
6679
6680static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,
6681 vector bool int __b,
6682 vector bool int __c) {
6683 return (__a & ~__c) | (__b & __c);
6684}
6685
6686static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
6687 vector float __b,
6688 vector unsigned int __c) {
6689 vector int __res = ((vector int)__a & ~(vector int)__c) |
6690 ((vector int)__b & (vector int)__c);
6691 return (vector float)__res;
6692}
6693
6694static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,
6695 vector float __b,
6696 vector bool int __c) {
6697 vector int __res = ((vector int)__a & ~(vector int)__c) |
6698 ((vector int)__b & (vector int)__c);
6699 return (vector float)__res;
6700}
6701
6702/* vec_sl */
6703
6704static __inline__ vector signed char __ATTRS_o_ai
6705vec_sl(vector signed char __a, vector unsigned char __b) {
6706 return __a << (vector signed char)__b;
6707}
6708
6709static __inline__ vector unsigned char __ATTRS_o_ai
6710vec_sl(vector unsigned char __a, vector unsigned char __b) {
6711 return __a << __b;
6712}
6713
6714static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,
6715 vector unsigned short __b) {
6716 return __a << (vector short)__b;
6717}
6718
6719static __inline__ vector unsigned short __ATTRS_o_ai
6720vec_sl(vector unsigned short __a, vector unsigned short __b) {
6721 return __a << __b;
6722}
6723
6724static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,
6725 vector unsigned int __b) {
6726 return __a << (vector int)__b;
6727}
6728
6729static __inline__ vector unsigned int __ATTRS_o_ai
6730vec_sl(vector unsigned int __a, vector unsigned int __b) {
6731 return __a << __b;
6732}
6733
6734#ifdef __POWER8_VECTOR__
6735static __inline__ vector signed long long __ATTRS_o_ai
6736vec_sl(vector signed long long __a, vector unsigned long long __b) {
6737 return __a << (vector long long)__b;
6738}
6739
6740static __inline__ vector unsigned long long __ATTRS_o_ai
6741vec_sl(vector unsigned long long __a, vector unsigned long long __b) {
6742 return __a << __b;
6743}
6744#endif
6745
6746/* vec_vslb */
6747
6748#define __builtin_altivec_vslb vec_vslb
6749
6750static __inline__ vector signed char __ATTRS_o_ai
6751vec_vslb(vector signed char __a, vector unsigned char __b) {
6752 return vec_sl(__a, __b);
6753}
6754
6755static __inline__ vector unsigned char __ATTRS_o_ai
6756vec_vslb(vector unsigned char __a, vector unsigned char __b) {
6757 return vec_sl(__a, __b);
6758}
6759
6760/* vec_vslh */
6761
6762#define __builtin_altivec_vslh vec_vslh
6763
6764static __inline__ vector short __ATTRS_o_ai
6765vec_vslh(vector short __a, vector unsigned short __b) {
6766 return vec_sl(__a, __b);
6767}
6768
6769static __inline__ vector unsigned short __ATTRS_o_ai
6770vec_vslh(vector unsigned short __a, vector unsigned short __b) {
6771 return vec_sl(__a, __b);
6772}
6773
6774/* vec_vslw */
6775
6776#define __builtin_altivec_vslw vec_vslw
6777
6778static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,
6779 vector unsigned int __b) {
6780 return vec_sl(__a, __b);
6781}
6782
6783static __inline__ vector unsigned int __ATTRS_o_ai
6784vec_vslw(vector unsigned int __a, vector unsigned int __b) {
6785 return vec_sl(__a, __b);
6786}
6787
6788/* vec_sld */
6789
6790#define __builtin_altivec_vsldoi_4si vec_sld
6791
6792static __inline__ vector signed char __ATTRS_o_ai vec_sld(
6793 vector signed char __a, vector signed char __b, unsigned const int __c) {
6794 unsigned char __d = __c & 0x0F;
6795#ifdef __LITTLE_ENDIAN__
6796 return vec_perm(
6797 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6798 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6799 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6800 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6801#else
6802 return vec_perm(
6803 __a, __b,
6804 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6805 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6806 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6807#endif
6808}
6809
6810static __inline__ vector unsigned char __ATTRS_o_ai
6811vec_sld(vector unsigned char __a, vector unsigned char __b,
6812 unsigned const int __c) {
6813 unsigned char __d = __c & 0x0F;
6814#ifdef __LITTLE_ENDIAN__
6815 return vec_perm(
6816 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6817 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6818 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6819 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6820#else
6821 return vec_perm(
6822 __a, __b,
6823 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6824 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6825 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6826#endif
6827}
6828
6829static __inline__ vector bool char __ATTRS_o_ai
6830vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {
6831 unsigned char __d = __c & 0x0F;
6832#ifdef __LITTLE_ENDIAN__
6833 return vec_perm(
6834 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6835 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6836 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6837 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6838#else
6839 return vec_perm(
6840 __a, __b,
6841 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6842 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6843 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6844#endif
6845}
6846
6847static __inline__ vector signed short __ATTRS_o_ai vec_sld(
6848 vector signed short __a, vector signed short __b, unsigned const int __c) {
6849 unsigned char __d = __c & 0x0F;
6850#ifdef __LITTLE_ENDIAN__
6851 return vec_perm(
6852 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6853 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6854 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6855 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6856#else
6857 return vec_perm(
6858 __a, __b,
6859 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6860 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6861 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6862#endif
6863}
6864
6865static __inline__ vector unsigned short __ATTRS_o_ai
6866vec_sld(vector unsigned short __a, vector unsigned short __b,
6867 unsigned const int __c) {
6868 unsigned char __d = __c & 0x0F;
6869#ifdef __LITTLE_ENDIAN__
6870 return vec_perm(
6871 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6872 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6873 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6874 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6875#else
6876 return vec_perm(
6877 __a, __b,
6878 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6879 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6880 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6881#endif
6882}
6883
6884static __inline__ vector bool short __ATTRS_o_ai
6885vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {
6886 unsigned char __d = __c & 0x0F;
6887#ifdef __LITTLE_ENDIAN__
6888 return vec_perm(
6889 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6890 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6891 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6892 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6893#else
6894 return vec_perm(
6895 __a, __b,
6896 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6897 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6898 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6899#endif
6900}
6901
6902static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,
6903 vector pixel __b,
6904 unsigned const int __c) {
6905 unsigned char __d = __c & 0x0F;
6906#ifdef __LITTLE_ENDIAN__
6907 return vec_perm(
6908 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6909 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6910 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6911 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6912#else
6913 return vec_perm(
6914 __a, __b,
6915 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6916 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6917 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6918#endif
6919}
6920
6921static __inline__ vector signed int __ATTRS_o_ai
6922vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {
6923 unsigned char __d = __c & 0x0F;
6924#ifdef __LITTLE_ENDIAN__
6925 return vec_perm(
6926 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6927 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6928 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6929 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6930#else
6931 return vec_perm(
6932 __a, __b,
6933 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6934 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6935 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6936#endif
6937}
6938
6939static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(
6940 vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {
6941 unsigned char __d = __c & 0x0F;
6942#ifdef __LITTLE_ENDIAN__
6943 return vec_perm(
6944 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6945 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6946 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6947 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6948#else
6949 return vec_perm(
6950 __a, __b,
6951 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6952 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6953 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6954#endif
6955}
6956
6957static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,
6958 vector bool int __b,
6959 unsigned const int __c) {
6960 unsigned char __d = __c & 0x0F;
6961#ifdef __LITTLE_ENDIAN__
6962 return vec_perm(
6963 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6964 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6965 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6966 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6967#else
6968 return vec_perm(
6969 __a, __b,
6970 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6971 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6972 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6973#endif
6974}
6975
6976static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,
6977 vector float __b,
6978 unsigned const int __c) {
6979 unsigned char __d = __c & 0x0F;
6980#ifdef __LITTLE_ENDIAN__
6981 return vec_perm(
6982 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
6983 20 - __d, 21 - __d, 22 - __d, 23 - __d,
6984 24 - __d, 25 - __d, 26 - __d, 27 - __d,
6985 28 - __d, 29 - __d, 30 - __d, 31 - __d));
6986#else
6987 return vec_perm(
6988 __a, __b,
6989 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
6990 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
6991 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
6992#endif
6993}
6994
6995/* vec_vsldoi */
6996
6997static __inline__ vector signed char __ATTRS_o_ai
6998vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {
6999 unsigned char __d = __c & 0x0F;
7000#ifdef __LITTLE_ENDIAN__
7001 return vec_perm(
7002 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7003 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7004 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7005 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7006#else
7007 return vec_perm(
7008 __a, __b,
7009 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7010 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7011 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7012#endif
7013}
7014
7015static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(
7016 vector unsigned char __a, vector unsigned char __b, unsigned char __c) {
7017 unsigned char __d = __c & 0x0F;
7018#ifdef __LITTLE_ENDIAN__
7019 return vec_perm(
7020 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7021 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7022 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7023 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7024#else
7025 return vec_perm(
7026 __a, __b,
7027 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7028 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7029 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7030#endif
7031}
7032
7033static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,
7034 vector short __b,
7035 unsigned char __c) {
7036 unsigned char __d = __c & 0x0F;
7037#ifdef __LITTLE_ENDIAN__
7038 return vec_perm(
7039 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7040 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7041 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7042 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7043#else
7044 return vec_perm(
7045 __a, __b,
7046 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7047 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7048 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7049#endif
7050}
7051
7052static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(
7053 vector unsigned short __a, vector unsigned short __b, unsigned char __c) {
7054 unsigned char __d = __c & 0x0F;
7055#ifdef __LITTLE_ENDIAN__
7056 return vec_perm(
7057 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7058 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7059 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7060 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7061#else
7062 return vec_perm(
7063 __a, __b,
7064 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7065 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7066 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7067#endif
7068}
7069
7070static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,
7071 vector pixel __b,
7072 unsigned char __c) {
7073 unsigned char __d = __c & 0x0F;
7074#ifdef __LITTLE_ENDIAN__
7075 return vec_perm(
7076 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7077 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7078 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7079 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7080#else
7081 return vec_perm(
7082 __a, __b,
7083 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7084 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7085 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7086#endif
7087}
7088
7089static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,
7090 vector int __b,
7091 unsigned char __c) {
7092 unsigned char __d = __c & 0x0F;
7093#ifdef __LITTLE_ENDIAN__
7094 return vec_perm(
7095 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7096 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7097 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7098 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7099#else
7100 return vec_perm(
7101 __a, __b,
7102 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7103 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7104 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7105#endif
7106}
7107
7108static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(
7109 vector unsigned int __a, vector unsigned int __b, unsigned char __c) {
7110 unsigned char __d = __c & 0x0F;
7111#ifdef __LITTLE_ENDIAN__
7112 return vec_perm(
7113 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7114 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7115 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7116 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7117#else
7118 return vec_perm(
7119 __a, __b,
7120 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7121 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7122 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7123#endif
7124}
7125
7126static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,
7127 vector float __b,
7128 unsigned char __c) {
7129 unsigned char __d = __c & 0x0F;
7130#ifdef __LITTLE_ENDIAN__
7131 return vec_perm(
7132 __b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,
7133 20 - __d, 21 - __d, 22 - __d, 23 - __d,
7134 24 - __d, 25 - __d, 26 - __d, 27 - __d,
7135 28 - __d, 29 - __d, 30 - __d, 31 - __d));
7136#else
7137 return vec_perm(
7138 __a, __b,
7139 (vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,
7140 __d + 6, __d + 7, __d + 8, __d + 9, __d + 10,
7141 __d + 11, __d + 12, __d + 13, __d + 14, __d + 15));
7142#endif
7143}
7144
7145/* vec_sll */
7146
7147static __inline__ vector signed char __ATTRS_o_ai
7148vec_sll(vector signed char __a, vector unsigned char __b) {
7149 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7150 (vector int)__b);
7151}
7152
7153static __inline__ vector signed char __ATTRS_o_ai
7154vec_sll(vector signed char __a, vector unsigned short __b) {
7155 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7156 (vector int)__b);
7157}
7158
7159static __inline__ vector signed char __ATTRS_o_ai
7160vec_sll(vector signed char __a, vector unsigned int __b) {
7161 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7162 (vector int)__b);
7163}
7164
7165static __inline__ vector unsigned char __ATTRS_o_ai
7166vec_sll(vector unsigned char __a, vector unsigned char __b) {
7167 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7168 (vector int)__b);
7169}
7170
7171static __inline__ vector unsigned char __ATTRS_o_ai
7172vec_sll(vector unsigned char __a, vector unsigned short __b) {
7173 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7174 (vector int)__b);
7175}
7176
7177static __inline__ vector unsigned char __ATTRS_o_ai
7178vec_sll(vector unsigned char __a, vector unsigned int __b) {
7179 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7180 (vector int)__b);
7181}
7182
7183static __inline__ vector bool char __ATTRS_o_ai
7184vec_sll(vector bool char __a, vector unsigned char __b) {
7185 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7186 (vector int)__b);
7187}
7188
7189static __inline__ vector bool char __ATTRS_o_ai
7190vec_sll(vector bool char __a, vector unsigned short __b) {
7191 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7192 (vector int)__b);
7193}
7194
7195static __inline__ vector bool char __ATTRS_o_ai
7196vec_sll(vector bool char __a, vector unsigned int __b) {
7197 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7198 (vector int)__b);
7199}
7200
7201static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
7202 vector unsigned char __b) {
7203 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7204}
7205
7206static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
7207 vector unsigned short __b) {
7208 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7209}
7210
7211static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,
7212 vector unsigned int __b) {
7213 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7214}
7215
7216static __inline__ vector unsigned short __ATTRS_o_ai
7217vec_sll(vector unsigned short __a, vector unsigned char __b) {
7218 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7219 (vector int)__b);
7220}
7221
7222static __inline__ vector unsigned short __ATTRS_o_ai
7223vec_sll(vector unsigned short __a, vector unsigned short __b) {
7224 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7225 (vector int)__b);
7226}
7227
7228static __inline__ vector unsigned short __ATTRS_o_ai
7229vec_sll(vector unsigned short __a, vector unsigned int __b) {
7230 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7231 (vector int)__b);
7232}
7233
7234static __inline__ vector bool short __ATTRS_o_ai
7235vec_sll(vector bool short __a, vector unsigned char __b) {
7236 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7237 (vector int)__b);
7238}
7239
7240static __inline__ vector bool short __ATTRS_o_ai
7241vec_sll(vector bool short __a, vector unsigned short __b) {
7242 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7243 (vector int)__b);
7244}
7245
7246static __inline__ vector bool short __ATTRS_o_ai
7247vec_sll(vector bool short __a, vector unsigned int __b) {
7248 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7249 (vector int)__b);
7250}
7251
7252static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
7253 vector unsigned char __b) {
7254 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7255}
7256
7257static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
7258 vector unsigned short __b) {
7259 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7260}
7261
7262static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,
7263 vector unsigned int __b) {
7264 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7265}
7266
7267static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
7268 vector unsigned char __b) {
7269 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7270}
7271
7272static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
7273 vector unsigned short __b) {
7274 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7275}
7276
7277static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,
7278 vector unsigned int __b) {
7279 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7280}
7281
7282static __inline__ vector unsigned int __ATTRS_o_ai
7283vec_sll(vector unsigned int __a, vector unsigned char __b) {
7284 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7285 (vector int)__b);
7286}
7287
7288static __inline__ vector unsigned int __ATTRS_o_ai
7289vec_sll(vector unsigned int __a, vector unsigned short __b) {
7290 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7291 (vector int)__b);
7292}
7293
7294static __inline__ vector unsigned int __ATTRS_o_ai
7295vec_sll(vector unsigned int __a, vector unsigned int __b) {
7296 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7297 (vector int)__b);
7298}
7299
7300static __inline__ vector bool int __ATTRS_o_ai
7301vec_sll(vector bool int __a, vector unsigned char __b) {
7302 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7303 (vector int)__b);
7304}
7305
7306static __inline__ vector bool int __ATTRS_o_ai
7307vec_sll(vector bool int __a, vector unsigned short __b) {
7308 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7309 (vector int)__b);
7310}
7311
7312static __inline__ vector bool int __ATTRS_o_ai
7313vec_sll(vector bool int __a, vector unsigned int __b) {
7314 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7315 (vector int)__b);
7316}
7317
7318/* vec_vsl */
7319
7320static __inline__ vector signed char __ATTRS_o_ai
7321vec_vsl(vector signed char __a, vector unsigned char __b) {
7322 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7323 (vector int)__b);
7324}
7325
7326static __inline__ vector signed char __ATTRS_o_ai
7327vec_vsl(vector signed char __a, vector unsigned short __b) {
7328 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7329 (vector int)__b);
7330}
7331
7332static __inline__ vector signed char __ATTRS_o_ai
7333vec_vsl(vector signed char __a, vector unsigned int __b) {
7334 return (vector signed char)__builtin_altivec_vsl((vector int)__a,
7335 (vector int)__b);
7336}
7337
7338static __inline__ vector unsigned char __ATTRS_o_ai
7339vec_vsl(vector unsigned char __a, vector unsigned char __b) {
7340 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7341 (vector int)__b);
7342}
7343
7344static __inline__ vector unsigned char __ATTRS_o_ai
7345vec_vsl(vector unsigned char __a, vector unsigned short __b) {
7346 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7347 (vector int)__b);
7348}
7349
7350static __inline__ vector unsigned char __ATTRS_o_ai
7351vec_vsl(vector unsigned char __a, vector unsigned int __b) {
7352 return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,
7353 (vector int)__b);
7354}
7355
7356static __inline__ vector bool char __ATTRS_o_ai
7357vec_vsl(vector bool char __a, vector unsigned char __b) {
7358 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7359 (vector int)__b);
7360}
7361
7362static __inline__ vector bool char __ATTRS_o_ai
7363vec_vsl(vector bool char __a, vector unsigned short __b) {
7364 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7365 (vector int)__b);
7366}
7367
7368static __inline__ vector bool char __ATTRS_o_ai
7369vec_vsl(vector bool char __a, vector unsigned int __b) {
7370 return (vector bool char)__builtin_altivec_vsl((vector int)__a,
7371 (vector int)__b);
7372}
7373
7374static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
7375 vector unsigned char __b) {
7376 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7377}
7378
7379static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
7380 vector unsigned short __b) {
7381 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7382}
7383
7384static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,
7385 vector unsigned int __b) {
7386 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7387}
7388
7389static __inline__ vector unsigned short __ATTRS_o_ai
7390vec_vsl(vector unsigned short __a, vector unsigned char __b) {
7391 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7392 (vector int)__b);
7393}
7394
7395static __inline__ vector unsigned short __ATTRS_o_ai
7396vec_vsl(vector unsigned short __a, vector unsigned short __b) {
7397 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7398 (vector int)__b);
7399}
7400
7401static __inline__ vector unsigned short __ATTRS_o_ai
7402vec_vsl(vector unsigned short __a, vector unsigned int __b) {
7403 return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,
7404 (vector int)__b);
7405}
7406
7407static __inline__ vector bool short __ATTRS_o_ai
7408vec_vsl(vector bool short __a, vector unsigned char __b) {
7409 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7410 (vector int)__b);
7411}
7412
7413static __inline__ vector bool short __ATTRS_o_ai
7414vec_vsl(vector bool short __a, vector unsigned short __b) {
7415 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7416 (vector int)__b);
7417}
7418
7419static __inline__ vector bool short __ATTRS_o_ai
7420vec_vsl(vector bool short __a, vector unsigned int __b) {
7421 return (vector bool short)__builtin_altivec_vsl((vector int)__a,
7422 (vector int)__b);
7423}
7424
7425static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
7426 vector unsigned char __b) {
7427 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7428}
7429
7430static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
7431 vector unsigned short __b) {
7432 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7433}
7434
7435static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,
7436 vector unsigned int __b) {
7437 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
7438}
7439
7440static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
7441 vector unsigned char __b) {
7442 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7443}
7444
7445static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
7446 vector unsigned short __b) {
7447 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7448}
7449
7450static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,
7451 vector unsigned int __b) {
7452 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
7453}
7454
7455static __inline__ vector unsigned int __ATTRS_o_ai
7456vec_vsl(vector unsigned int __a, vector unsigned char __b) {
7457 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7458 (vector int)__b);
7459}
7460
7461static __inline__ vector unsigned int __ATTRS_o_ai
7462vec_vsl(vector unsigned int __a, vector unsigned short __b) {
7463 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7464 (vector int)__b);
7465}
7466
7467static __inline__ vector unsigned int __ATTRS_o_ai
7468vec_vsl(vector unsigned int __a, vector unsigned int __b) {
7469 return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,
7470 (vector int)__b);
7471}
7472
7473static __inline__ vector bool int __ATTRS_o_ai
7474vec_vsl(vector bool int __a, vector unsigned char __b) {
7475 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7476 (vector int)__b);
7477}
7478
7479static __inline__ vector bool int __ATTRS_o_ai
7480vec_vsl(vector bool int __a, vector unsigned short __b) {
7481 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7482 (vector int)__b);
7483}
7484
7485static __inline__ vector bool int __ATTRS_o_ai
7486vec_vsl(vector bool int __a, vector unsigned int __b) {
7487 return (vector bool int)__builtin_altivec_vsl((vector int)__a,
7488 (vector int)__b);
7489}
7490
7491/* vec_slo */
7492
7493static __inline__ vector signed char __ATTRS_o_ai
7494vec_slo(vector signed char __a, vector signed char __b) {
7495 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7496 (vector int)__b);
7497}
7498
7499static __inline__ vector signed char __ATTRS_o_ai
7500vec_slo(vector signed char __a, vector unsigned char __b) {
7501 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7502 (vector int)__b);
7503}
7504
7505static __inline__ vector unsigned char __ATTRS_o_ai
7506vec_slo(vector unsigned char __a, vector signed char __b) {
7507 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7508 (vector int)__b);
7509}
7510
7511static __inline__ vector unsigned char __ATTRS_o_ai
7512vec_slo(vector unsigned char __a, vector unsigned char __b) {
7513 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7514 (vector int)__b);
7515}
7516
7517static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
7518 vector signed char __b) {
7519 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7520}
7521
7522static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,
7523 vector unsigned char __b) {
7524 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7525}
7526
7527static __inline__ vector unsigned short __ATTRS_o_ai
7528vec_slo(vector unsigned short __a, vector signed char __b) {
7529 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7530 (vector int)__b);
7531}
7532
7533static __inline__ vector unsigned short __ATTRS_o_ai
7534vec_slo(vector unsigned short __a, vector unsigned char __b) {
7535 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7536 (vector int)__b);
7537}
7538
7539static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
7540 vector signed char __b) {
7541 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7542}
7543
7544static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,
7545 vector unsigned char __b) {
7546 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7547}
7548
7549static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
7550 vector signed char __b) {
7551 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7552}
7553
7554static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,
7555 vector unsigned char __b) {
7556 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7557}
7558
7559static __inline__ vector unsigned int __ATTRS_o_ai
7560vec_slo(vector unsigned int __a, vector signed char __b) {
7561 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7562 (vector int)__b);
7563}
7564
7565static __inline__ vector unsigned int __ATTRS_o_ai
7566vec_slo(vector unsigned int __a, vector unsigned char __b) {
7567 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7568 (vector int)__b);
7569}
7570
7571static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
7572 vector signed char __b) {
7573 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7574}
7575
7576static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,
7577 vector unsigned char __b) {
7578 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7579}
7580
7581/* vec_vslo */
7582
7583static __inline__ vector signed char __ATTRS_o_ai
7584vec_vslo(vector signed char __a, vector signed char __b) {
7585 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7586 (vector int)__b);
7587}
7588
7589static __inline__ vector signed char __ATTRS_o_ai
7590vec_vslo(vector signed char __a, vector unsigned char __b) {
7591 return (vector signed char)__builtin_altivec_vslo((vector int)__a,
7592 (vector int)__b);
7593}
7594
7595static __inline__ vector unsigned char __ATTRS_o_ai
7596vec_vslo(vector unsigned char __a, vector signed char __b) {
7597 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7598 (vector int)__b);
7599}
7600
7601static __inline__ vector unsigned char __ATTRS_o_ai
7602vec_vslo(vector unsigned char __a, vector unsigned char __b) {
7603 return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,
7604 (vector int)__b);
7605}
7606
7607static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
7608 vector signed char __b) {
7609 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7610}
7611
7612static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,
7613 vector unsigned char __b) {
7614 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7615}
7616
7617static __inline__ vector unsigned short __ATTRS_o_ai
7618vec_vslo(vector unsigned short __a, vector signed char __b) {
7619 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7620 (vector int)__b);
7621}
7622
7623static __inline__ vector unsigned short __ATTRS_o_ai
7624vec_vslo(vector unsigned short __a, vector unsigned char __b) {
7625 return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,
7626 (vector int)__b);
7627}
7628
7629static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
7630 vector signed char __b) {
7631 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7632}
7633
7634static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,
7635 vector unsigned char __b) {
7636 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7637}
7638
7639static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
7640 vector signed char __b) {
7641 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7642}
7643
7644static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,
7645 vector unsigned char __b) {
7646 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
7647}
7648
7649static __inline__ vector unsigned int __ATTRS_o_ai
7650vec_vslo(vector unsigned int __a, vector signed char __b) {
7651 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7652 (vector int)__b);
7653}
7654
7655static __inline__ vector unsigned int __ATTRS_o_ai
7656vec_vslo(vector unsigned int __a, vector unsigned char __b) {
7657 return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,
7658 (vector int)__b);
7659}
7660
7661static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
7662 vector signed char __b) {
7663 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7664}
7665
7666static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,
7667 vector unsigned char __b) {
7668 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
7669}
7670
7671/* vec_splat */
7672
7673static __inline__ vector signed char __ATTRS_o_ai
7674vec_splat(vector signed char __a, unsigned const int __b) {
7675 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
7676}
7677
7678static __inline__ vector unsigned char __ATTRS_o_ai
7679vec_splat(vector unsigned char __a, unsigned const int __b) {
7680 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
7681}
7682
7683static __inline__ vector bool char __ATTRS_o_ai
7684vec_splat(vector bool char __a, unsigned const int __b) {
7685 return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));
7686}
7687
7688static __inline__ vector signed short __ATTRS_o_ai
7689vec_splat(vector signed short __a, unsigned const int __b) {
7690 unsigned char b0 = (__b & 0x07) * 2;
7691 unsigned char b1 = b0 + 1;
7692 return vec_perm(__a, __a,
7693 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7694 b0, b1, b0, b1, b0, b1));
7695}
7696
7697static __inline__ vector unsigned short __ATTRS_o_ai
7698vec_splat(vector unsigned short __a, unsigned const int __b) {
7699 unsigned char b0 = (__b & 0x07) * 2;
7700 unsigned char b1 = b0 + 1;
7701 return vec_perm(__a, __a,
7702 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7703 b0, b1, b0, b1, b0, b1));
7704}
7705
7706static __inline__ vector bool short __ATTRS_o_ai
7707vec_splat(vector bool short __a, unsigned const int __b) {
7708 unsigned char b0 = (__b & 0x07) * 2;
7709 unsigned char b1 = b0 + 1;
7710 return vec_perm(__a, __a,
7711 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7712 b0, b1, b0, b1, b0, b1));
7713}
7714
7715static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,
7716 unsigned const int __b) {
7717 unsigned char b0 = (__b & 0x07) * 2;
7718 unsigned char b1 = b0 + 1;
7719 return vec_perm(__a, __a,
7720 (vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,
7721 b0, b1, b0, b1, b0, b1));
7722}
7723
7724static __inline__ vector signed int __ATTRS_o_ai
7725vec_splat(vector signed int __a, unsigned const int __b) {
7726 unsigned char b0 = (__b & 0x03) * 4;
7727 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7728 return vec_perm(__a, __a,
7729 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7730 b2, b3, b0, b1, b2, b3));
7731}
7732
7733static __inline__ vector unsigned int __ATTRS_o_ai
7734vec_splat(vector unsigned int __a, unsigned const int __b) {
7735 unsigned char b0 = (__b & 0x03) * 4;
7736 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7737 return vec_perm(__a, __a,
7738 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7739 b2, b3, b0, b1, b2, b3));
7740}
7741
7742static __inline__ vector bool int __ATTRS_o_ai
7743vec_splat(vector bool int __a, unsigned const int __b) {
7744 unsigned char b0 = (__b & 0x03) * 4;
7745 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7746 return vec_perm(__a, __a,
7747 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7748 b2, b3, b0, b1, b2, b3));
7749}
7750
7751static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,
7752 unsigned const int __b) {
7753 unsigned char b0 = (__b & 0x03) * 4;
7754 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;
7755 return vec_perm(__a, __a,
7756 (vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,
7757 b2, b3, b0, b1, b2, b3));
7758}
7759
7760#ifdef __VSX__
7761static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,
7762 unsigned const int __b) {
7763 unsigned char b0 = (__b & 0x01) * 8;
7764 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7765 b6 = b0 + 6, b7 = b0 + 7;
7766 return vec_perm(__a, __a,
7767 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7768 b2, b3, b4, b5, b6, b7));
7769}
7770static __inline__ vector bool long long __ATTRS_o_ai
7771vec_splat(vector bool long long __a, unsigned const int __b) {
7772 unsigned char b0 = (__b & 0x01) * 8;
7773 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7774 b6 = b0 + 6, b7 = b0 + 7;
7775 return vec_perm(__a, __a,
7776 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7777 b2, b3, b4, b5, b6, b7));
7778}
7779static __inline__ vector signed long long __ATTRS_o_ai
7780vec_splat(vector signed long long __a, unsigned const int __b) {
7781 unsigned char b0 = (__b & 0x01) * 8;
7782 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7783 b6 = b0 + 6, b7 = b0 + 7;
7784 return vec_perm(__a, __a,
7785 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7786 b2, b3, b4, b5, b6, b7));
7787}
7788static __inline__ vector unsigned long long __ATTRS_o_ai
7789vec_splat(vector unsigned long long __a, unsigned const int __b) {
7790 unsigned char b0 = (__b & 0x01) * 8;
7791 unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,
7792 b6 = b0 + 6, b7 = b0 + 7;
7793 return vec_perm(__a, __a,
7794 (vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,
7795 b2, b3, b4, b5, b6, b7));
7796}
7797#endif
7798
7799/* vec_vspltb */
7800
7801#define __builtin_altivec_vspltb vec_vspltb
7802
7803static __inline__ vector signed char __ATTRS_o_ai
7804vec_vspltb(vector signed char __a, unsigned char __b) {
7805 return vec_perm(__a, __a, (vector unsigned char)(__b));
7806}
7807
7808static __inline__ vector unsigned char __ATTRS_o_ai
7809vec_vspltb(vector unsigned char __a, unsigned char __b) {
7810 return vec_perm(__a, __a, (vector unsigned char)(__b));
7811}
7812
7813static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,
7814 unsigned char __b) {
7815 return vec_perm(__a, __a, (vector unsigned char)(__b));
7816}
7817
7818/* vec_vsplth */
7819
7820#define __builtin_altivec_vsplth vec_vsplth
7821
7822static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,
7823 unsigned char __b) {
7824 __b *= 2;
7825 unsigned char b1 = __b + 1;
7826 return vec_perm(__a, __a,
7827 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7828 __b, b1, __b, b1, __b, b1, __b, b1));
7829}
7830
7831static __inline__ vector unsigned short __ATTRS_o_ai
7832vec_vsplth(vector unsigned short __a, unsigned char __b) {
7833 __b *= 2;
7834 unsigned char b1 = __b + 1;
7835 return vec_perm(__a, __a,
7836 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7837 __b, b1, __b, b1, __b, b1, __b, b1));
7838}
7839
7840static __inline__ vector bool short __ATTRS_o_ai
7841vec_vsplth(vector bool short __a, unsigned char __b) {
7842 __b *= 2;
7843 unsigned char b1 = __b + 1;
7844 return vec_perm(__a, __a,
7845 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7846 __b, b1, __b, b1, __b, b1, __b, b1));
7847}
7848
7849static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,
7850 unsigned char __b) {
7851 __b *= 2;
7852 unsigned char b1 = __b + 1;
7853 return vec_perm(__a, __a,
7854 (vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,
7855 __b, b1, __b, b1, __b, b1, __b, b1));
7856}
7857
7858/* vec_vspltw */
7859
7860#define __builtin_altivec_vspltw vec_vspltw
7861
7862static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,
7863 unsigned char __b) {
7864 __b *= 4;
7865 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7866 return vec_perm(__a, __a,
7867 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7868 b1, b2, b3, __b, b1, b2, b3));
7869}
7870
7871static __inline__ vector unsigned int __ATTRS_o_ai
7872vec_vspltw(vector unsigned int __a, unsigned char __b) {
7873 __b *= 4;
7874 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7875 return vec_perm(__a, __a,
7876 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7877 b1, b2, b3, __b, b1, b2, b3));
7878}
7879
7880static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,
7881 unsigned char __b) {
7882 __b *= 4;
7883 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7884 return vec_perm(__a, __a,
7885 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7886 b1, b2, b3, __b, b1, b2, b3));
7887}
7888
7889static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,
7890 unsigned char __b) {
7891 __b *= 4;
7892 unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;
7893 return vec_perm(__a, __a,
7894 (vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,
7895 b1, b2, b3, __b, b1, b2, b3));
7896}
7897
7898/* vec_splat_s8 */
7899
7900#define __builtin_altivec_vspltisb vec_splat_s8
7901
7902// FIXME: parameter should be treated as 5-bit signed literal
7903static __inline__ vector signed char __ATTRS_o_ai
7904vec_splat_s8(signed char __a) {
7905 return (vector signed char)(__a);
7906}
7907
7908/* vec_vspltisb */
7909
7910// FIXME: parameter should be treated as 5-bit signed literal
7911static __inline__ vector signed char __ATTRS_o_ai
7912vec_vspltisb(signed char __a) {
7913 return (vector signed char)(__a);
7914}
7915
7916/* vec_splat_s16 */
7917
7918#define __builtin_altivec_vspltish vec_splat_s16
7919
7920// FIXME: parameter should be treated as 5-bit signed literal
7921static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {
7922 return (vector short)(__a);
7923}
7924
7925/* vec_vspltish */
7926
7927// FIXME: parameter should be treated as 5-bit signed literal
7928static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {
7929 return (vector short)(__a);
7930}
7931
7932/* vec_splat_s32 */
7933
7934#define __builtin_altivec_vspltisw vec_splat_s32
7935
7936// FIXME: parameter should be treated as 5-bit signed literal
7937static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {
7938 return (vector int)(__a);
7939}
7940
7941/* vec_vspltisw */
7942
7943// FIXME: parameter should be treated as 5-bit signed literal
7944static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {
7945 return (vector int)(__a);
7946}
7947
7948/* vec_splat_u8 */
7949
7950// FIXME: parameter should be treated as 5-bit signed literal
7951static __inline__ vector unsigned char __ATTRS_o_ai
7952vec_splat_u8(unsigned char __a) {
7953 return (vector unsigned char)(__a);
7954}
7955
7956/* vec_splat_u16 */
7957
7958// FIXME: parameter should be treated as 5-bit signed literal
7959static __inline__ vector unsigned short __ATTRS_o_ai
7960vec_splat_u16(signed char __a) {
7961 return (vector unsigned short)(__a);
7962}
7963
7964/* vec_splat_u32 */
7965
7966// FIXME: parameter should be treated as 5-bit signed literal
7967static __inline__ vector unsigned int __ATTRS_o_ai
7968vec_splat_u32(signed char __a) {
7969 return (vector unsigned int)(__a);
7970}
7971
7972/* vec_sr */
7973
7974static __inline__ vector signed char __ATTRS_o_ai
7975vec_sr(vector signed char __a, vector unsigned char __b) {
7976 vector unsigned char __res = (vector unsigned char)__a >> __b;
7977 return (vector signed char)__res;
7978}
7979
7980static __inline__ vector unsigned char __ATTRS_o_ai
7981vec_sr(vector unsigned char __a, vector unsigned char __b) {
7982 return __a >> __b;
7983}
7984
7985static __inline__ vector signed short __ATTRS_o_ai
7986vec_sr(vector signed short __a, vector unsigned short __b) {
7987 vector unsigned short __res = (vector unsigned short)__a >> __b;
7988 return (vector signed short)__res;
7989}
7990
7991static __inline__ vector unsigned short __ATTRS_o_ai
7992vec_sr(vector unsigned short __a, vector unsigned short __b) {
7993 return __a >> __b;
7994}
7995
7996static __inline__ vector signed int __ATTRS_o_ai
7997vec_sr(vector signed int __a, vector unsigned int __b) {
7998 vector unsigned int __res = (vector unsigned int)__a >> __b;
7999 return (vector signed int)__res;
8000}
8001
8002static __inline__ vector unsigned int __ATTRS_o_ai
8003vec_sr(vector unsigned int __a, vector unsigned int __b) {
8004 return __a >> __b;
8005}
8006
8007#ifdef __POWER8_VECTOR__
8008static __inline__ vector signed long long __ATTRS_o_ai
8009vec_sr(vector signed long long __a, vector unsigned long long __b) {
8010 vector unsigned long long __res = (vector unsigned long long)__a >> __b;
8011 return (vector signed long long)__res;
8012}
8013
8014static __inline__ vector unsigned long long __ATTRS_o_ai
8015vec_sr(vector unsigned long long __a, vector unsigned long long __b) {
8016 return __a >> __b;
8017}
8018#endif
8019
8020/* vec_vsrb */
8021
8022#define __builtin_altivec_vsrb vec_vsrb
8023
8024static __inline__ vector signed char __ATTRS_o_ai
8025vec_vsrb(vector signed char __a, vector unsigned char __b) {
8026 return __a >> (vector signed char)__b;
8027}
8028
8029static __inline__ vector unsigned char __ATTRS_o_ai
8030vec_vsrb(vector unsigned char __a, vector unsigned char __b) {
8031 return __a >> __b;
8032}
8033
8034/* vec_vsrh */
8035
8036#define __builtin_altivec_vsrh vec_vsrh
8037
8038static __inline__ vector short __ATTRS_o_ai
8039vec_vsrh(vector short __a, vector unsigned short __b) {
8040 return __a >> (vector short)__b;
8041}
8042
8043static __inline__ vector unsigned short __ATTRS_o_ai
8044vec_vsrh(vector unsigned short __a, vector unsigned short __b) {
8045 return __a >> __b;
8046}
8047
8048/* vec_vsrw */
8049
8050#define __builtin_altivec_vsrw vec_vsrw
8051
8052static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,
8053 vector unsigned int __b) {
8054 return __a >> (vector int)__b;
8055}
8056
8057static __inline__ vector unsigned int __ATTRS_o_ai
8058vec_vsrw(vector unsigned int __a, vector unsigned int __b) {
8059 return __a >> __b;
8060}
8061
8062/* vec_sra */
8063
8064static __inline__ vector signed char __ATTRS_o_ai
8065vec_sra(vector signed char __a, vector unsigned char __b) {
8066 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
8067}
8068
8069static __inline__ vector unsigned char __ATTRS_o_ai
8070vec_sra(vector unsigned char __a, vector unsigned char __b) {
8071 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
8072}
8073
8074static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,
8075 vector unsigned short __b) {
8076 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
8077}
8078
8079static __inline__ vector unsigned short __ATTRS_o_ai
8080vec_sra(vector unsigned short __a, vector unsigned short __b) {
8081 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
8082}
8083
8084static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,
8085 vector unsigned int __b) {
8086 return __builtin_altivec_vsraw(__a, __b);
8087}
8088
8089static __inline__ vector unsigned int __ATTRS_o_ai
8090vec_sra(vector unsigned int __a, vector unsigned int __b) {
8091 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
8092}
8093
8094#ifdef __POWER8_VECTOR__
8095static __inline__ vector signed long long __ATTRS_o_ai
8096vec_sra(vector signed long long __a, vector unsigned long long __b) {
8097 return __a >> __b;
8098}
8099
8100static __inline__ vector unsigned long long __ATTRS_o_ai
8101vec_sra(vector unsigned long long __a, vector unsigned long long __b) {
8102 return (vector unsigned long long)((vector signed long long)__a >> __b);
8103}
8104#endif
8105
8106/* vec_vsrab */
8107
8108static __inline__ vector signed char __ATTRS_o_ai
8109vec_vsrab(vector signed char __a, vector unsigned char __b) {
8110 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
8111}
8112
8113static __inline__ vector unsigned char __ATTRS_o_ai
8114vec_vsrab(vector unsigned char __a, vector unsigned char __b) {
8115 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
8116}
8117
8118/* vec_vsrah */
8119
8120static __inline__ vector short __ATTRS_o_ai
8121vec_vsrah(vector short __a, vector unsigned short __b) {
8122 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
8123}
8124
8125static __inline__ vector unsigned short __ATTRS_o_ai
8126vec_vsrah(vector unsigned short __a, vector unsigned short __b) {
8127 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
8128}
8129
8130/* vec_vsraw */
8131
8132static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,
8133 vector unsigned int __b) {
8134 return __builtin_altivec_vsraw(__a, __b);
8135}
8136
8137static __inline__ vector unsigned int __ATTRS_o_ai
8138vec_vsraw(vector unsigned int __a, vector unsigned int __b) {
8139 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
8140}
8141
8142/* vec_srl */
8143
8144static __inline__ vector signed char __ATTRS_o_ai
8145vec_srl(vector signed char __a, vector unsigned char __b) {
8146 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8147 (vector int)__b);
8148}
8149
8150static __inline__ vector signed char __ATTRS_o_ai
8151vec_srl(vector signed char __a, vector unsigned short __b) {
8152 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8153 (vector int)__b);
8154}
8155
8156static __inline__ vector signed char __ATTRS_o_ai
8157vec_srl(vector signed char __a, vector unsigned int __b) {
8158 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8159 (vector int)__b);
8160}
8161
8162static __inline__ vector unsigned char __ATTRS_o_ai
8163vec_srl(vector unsigned char __a, vector unsigned char __b) {
8164 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8165 (vector int)__b);
8166}
8167
8168static __inline__ vector unsigned char __ATTRS_o_ai
8169vec_srl(vector unsigned char __a, vector unsigned short __b) {
8170 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8171 (vector int)__b);
8172}
8173
8174static __inline__ vector unsigned char __ATTRS_o_ai
8175vec_srl(vector unsigned char __a, vector unsigned int __b) {
8176 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8177 (vector int)__b);
8178}
8179
8180static __inline__ vector bool char __ATTRS_o_ai
8181vec_srl(vector bool char __a, vector unsigned char __b) {
8182 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8183 (vector int)__b);
8184}
8185
8186static __inline__ vector bool char __ATTRS_o_ai
8187vec_srl(vector bool char __a, vector unsigned short __b) {
8188 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8189 (vector int)__b);
8190}
8191
8192static __inline__ vector bool char __ATTRS_o_ai
8193vec_srl(vector bool char __a, vector unsigned int __b) {
8194 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8195 (vector int)__b);
8196}
8197
8198static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
8199 vector unsigned char __b) {
8200 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8201}
8202
8203static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
8204 vector unsigned short __b) {
8205 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8206}
8207
8208static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,
8209 vector unsigned int __b) {
8210 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8211}
8212
8213static __inline__ vector unsigned short __ATTRS_o_ai
8214vec_srl(vector unsigned short __a, vector unsigned char __b) {
8215 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8216 (vector int)__b);
8217}
8218
8219static __inline__ vector unsigned short __ATTRS_o_ai
8220vec_srl(vector unsigned short __a, vector unsigned short __b) {
8221 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8222 (vector int)__b);
8223}
8224
8225static __inline__ vector unsigned short __ATTRS_o_ai
8226vec_srl(vector unsigned short __a, vector unsigned int __b) {
8227 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8228 (vector int)__b);
8229}
8230
8231static __inline__ vector bool short __ATTRS_o_ai
8232vec_srl(vector bool short __a, vector unsigned char __b) {
8233 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8234 (vector int)__b);
8235}
8236
8237static __inline__ vector bool short __ATTRS_o_ai
8238vec_srl(vector bool short __a, vector unsigned short __b) {
8239 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8240 (vector int)__b);
8241}
8242
8243static __inline__ vector bool short __ATTRS_o_ai
8244vec_srl(vector bool short __a, vector unsigned int __b) {
8245 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8246 (vector int)__b);
8247}
8248
8249static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
8250 vector unsigned char __b) {
8251 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8252}
8253
8254static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
8255 vector unsigned short __b) {
8256 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8257}
8258
8259static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,
8260 vector unsigned int __b) {
8261 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8262}
8263
8264static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
8265 vector unsigned char __b) {
8266 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8267}
8268
8269static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
8270 vector unsigned short __b) {
8271 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8272}
8273
8274static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,
8275 vector unsigned int __b) {
8276 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8277}
8278
8279static __inline__ vector unsigned int __ATTRS_o_ai
8280vec_srl(vector unsigned int __a, vector unsigned char __b) {
8281 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8282 (vector int)__b);
8283}
8284
8285static __inline__ vector unsigned int __ATTRS_o_ai
8286vec_srl(vector unsigned int __a, vector unsigned short __b) {
8287 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8288 (vector int)__b);
8289}
8290
8291static __inline__ vector unsigned int __ATTRS_o_ai
8292vec_srl(vector unsigned int __a, vector unsigned int __b) {
8293 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8294 (vector int)__b);
8295}
8296
8297static __inline__ vector bool int __ATTRS_o_ai
8298vec_srl(vector bool int __a, vector unsigned char __b) {
8299 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8300 (vector int)__b);
8301}
8302
8303static __inline__ vector bool int __ATTRS_o_ai
8304vec_srl(vector bool int __a, vector unsigned short __b) {
8305 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8306 (vector int)__b);
8307}
8308
8309static __inline__ vector bool int __ATTRS_o_ai
8310vec_srl(vector bool int __a, vector unsigned int __b) {
8311 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8312 (vector int)__b);
8313}
8314
8315/* vec_vsr */
8316
8317static __inline__ vector signed char __ATTRS_o_ai
8318vec_vsr(vector signed char __a, vector unsigned char __b) {
8319 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8320 (vector int)__b);
8321}
8322
8323static __inline__ vector signed char __ATTRS_o_ai
8324vec_vsr(vector signed char __a, vector unsigned short __b) {
8325 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8326 (vector int)__b);
8327}
8328
8329static __inline__ vector signed char __ATTRS_o_ai
8330vec_vsr(vector signed char __a, vector unsigned int __b) {
8331 return (vector signed char)__builtin_altivec_vsr((vector int)__a,
8332 (vector int)__b);
8333}
8334
8335static __inline__ vector unsigned char __ATTRS_o_ai
8336vec_vsr(vector unsigned char __a, vector unsigned char __b) {
8337 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8338 (vector int)__b);
8339}
8340
8341static __inline__ vector unsigned char __ATTRS_o_ai
8342vec_vsr(vector unsigned char __a, vector unsigned short __b) {
8343 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8344 (vector int)__b);
8345}
8346
8347static __inline__ vector unsigned char __ATTRS_o_ai
8348vec_vsr(vector unsigned char __a, vector unsigned int __b) {
8349 return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,
8350 (vector int)__b);
8351}
8352
8353static __inline__ vector bool char __ATTRS_o_ai
8354vec_vsr(vector bool char __a, vector unsigned char __b) {
8355 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8356 (vector int)__b);
8357}
8358
8359static __inline__ vector bool char __ATTRS_o_ai
8360vec_vsr(vector bool char __a, vector unsigned short __b) {
8361 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8362 (vector int)__b);
8363}
8364
8365static __inline__ vector bool char __ATTRS_o_ai
8366vec_vsr(vector bool char __a, vector unsigned int __b) {
8367 return (vector bool char)__builtin_altivec_vsr((vector int)__a,
8368 (vector int)__b);
8369}
8370
8371static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
8372 vector unsigned char __b) {
8373 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8374}
8375
8376static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
8377 vector unsigned short __b) {
8378 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8379}
8380
8381static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,
8382 vector unsigned int __b) {
8383 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8384}
8385
8386static __inline__ vector unsigned short __ATTRS_o_ai
8387vec_vsr(vector unsigned short __a, vector unsigned char __b) {
8388 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8389 (vector int)__b);
8390}
8391
8392static __inline__ vector unsigned short __ATTRS_o_ai
8393vec_vsr(vector unsigned short __a, vector unsigned short __b) {
8394 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8395 (vector int)__b);
8396}
8397
8398static __inline__ vector unsigned short __ATTRS_o_ai
8399vec_vsr(vector unsigned short __a, vector unsigned int __b) {
8400 return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,
8401 (vector int)__b);
8402}
8403
8404static __inline__ vector bool short __ATTRS_o_ai
8405vec_vsr(vector bool short __a, vector unsigned char __b) {
8406 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8407 (vector int)__b);
8408}
8409
8410static __inline__ vector bool short __ATTRS_o_ai
8411vec_vsr(vector bool short __a, vector unsigned short __b) {
8412 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8413 (vector int)__b);
8414}
8415
8416static __inline__ vector bool short __ATTRS_o_ai
8417vec_vsr(vector bool short __a, vector unsigned int __b) {
8418 return (vector bool short)__builtin_altivec_vsr((vector int)__a,
8419 (vector int)__b);
8420}
8421
8422static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
8423 vector unsigned char __b) {
8424 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8425}
8426
8427static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
8428 vector unsigned short __b) {
8429 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8430}
8431
8432static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,
8433 vector unsigned int __b) {
8434 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
8435}
8436
8437static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
8438 vector unsigned char __b) {
8439 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8440}
8441
8442static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
8443 vector unsigned short __b) {
8444 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8445}
8446
8447static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,
8448 vector unsigned int __b) {
8449 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
8450}
8451
8452static __inline__ vector unsigned int __ATTRS_o_ai
8453vec_vsr(vector unsigned int __a, vector unsigned char __b) {
8454 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8455 (vector int)__b);
8456}
8457
8458static __inline__ vector unsigned int __ATTRS_o_ai
8459vec_vsr(vector unsigned int __a, vector unsigned short __b) {
8460 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8461 (vector int)__b);
8462}
8463
8464static __inline__ vector unsigned int __ATTRS_o_ai
8465vec_vsr(vector unsigned int __a, vector unsigned int __b) {
8466 return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,
8467 (vector int)__b);
8468}
8469
8470static __inline__ vector bool int __ATTRS_o_ai
8471vec_vsr(vector bool int __a, vector unsigned char __b) {
8472 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8473 (vector int)__b);
8474}
8475
8476static __inline__ vector bool int __ATTRS_o_ai
8477vec_vsr(vector bool int __a, vector unsigned short __b) {
8478 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8479 (vector int)__b);
8480}
8481
8482static __inline__ vector bool int __ATTRS_o_ai
8483vec_vsr(vector bool int __a, vector unsigned int __b) {
8484 return (vector bool int)__builtin_altivec_vsr((vector int)__a,
8485 (vector int)__b);
8486}
8487
8488/* vec_sro */
8489
8490static __inline__ vector signed char __ATTRS_o_ai
8491vec_sro(vector signed char __a, vector signed char __b) {
8492 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8493 (vector int)__b);
8494}
8495
8496static __inline__ vector signed char __ATTRS_o_ai
8497vec_sro(vector signed char __a, vector unsigned char __b) {
8498 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8499 (vector int)__b);
8500}
8501
8502static __inline__ vector unsigned char __ATTRS_o_ai
8503vec_sro(vector unsigned char __a, vector signed char __b) {
8504 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8505 (vector int)__b);
8506}
8507
8508static __inline__ vector unsigned char __ATTRS_o_ai
8509vec_sro(vector unsigned char __a, vector unsigned char __b) {
8510 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8511 (vector int)__b);
8512}
8513
8514static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
8515 vector signed char __b) {
8516 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8517}
8518
8519static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,
8520 vector unsigned char __b) {
8521 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8522}
8523
8524static __inline__ vector unsigned short __ATTRS_o_ai
8525vec_sro(vector unsigned short __a, vector signed char __b) {
8526 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8527 (vector int)__b);
8528}
8529
8530static __inline__ vector unsigned short __ATTRS_o_ai
8531vec_sro(vector unsigned short __a, vector unsigned char __b) {
8532 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8533 (vector int)__b);
8534}
8535
8536static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
8537 vector signed char __b) {
8538 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8539}
8540
8541static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,
8542 vector unsigned char __b) {
8543 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8544}
8545
8546static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
8547 vector signed char __b) {
8548 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8549}
8550
8551static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,
8552 vector unsigned char __b) {
8553 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8554}
8555
8556static __inline__ vector unsigned int __ATTRS_o_ai
8557vec_sro(vector unsigned int __a, vector signed char __b) {
8558 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8559 (vector int)__b);
8560}
8561
8562static __inline__ vector unsigned int __ATTRS_o_ai
8563vec_sro(vector unsigned int __a, vector unsigned char __b) {
8564 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8565 (vector int)__b);
8566}
8567
8568static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
8569 vector signed char __b) {
8570 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8571}
8572
8573static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,
8574 vector unsigned char __b) {
8575 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8576}
8577
8578/* vec_vsro */
8579
8580static __inline__ vector signed char __ATTRS_o_ai
8581vec_vsro(vector signed char __a, vector signed char __b) {
8582 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8583 (vector int)__b);
8584}
8585
8586static __inline__ vector signed char __ATTRS_o_ai
8587vec_vsro(vector signed char __a, vector unsigned char __b) {
8588 return (vector signed char)__builtin_altivec_vsro((vector int)__a,
8589 (vector int)__b);
8590}
8591
8592static __inline__ vector unsigned char __ATTRS_o_ai
8593vec_vsro(vector unsigned char __a, vector signed char __b) {
8594 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8595 (vector int)__b);
8596}
8597
8598static __inline__ vector unsigned char __ATTRS_o_ai
8599vec_vsro(vector unsigned char __a, vector unsigned char __b) {
8600 return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,
8601 (vector int)__b);
8602}
8603
8604static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
8605 vector signed char __b) {
8606 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8607}
8608
8609static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,
8610 vector unsigned char __b) {
8611 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8612}
8613
8614static __inline__ vector unsigned short __ATTRS_o_ai
8615vec_vsro(vector unsigned short __a, vector signed char __b) {
8616 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8617 (vector int)__b);
8618}
8619
8620static __inline__ vector unsigned short __ATTRS_o_ai
8621vec_vsro(vector unsigned short __a, vector unsigned char __b) {
8622 return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,
8623 (vector int)__b);
8624}
8625
8626static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
8627 vector signed char __b) {
8628 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8629}
8630
8631static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,
8632 vector unsigned char __b) {
8633 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8634}
8635
8636static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
8637 vector signed char __b) {
8638 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8639}
8640
8641static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,
8642 vector unsigned char __b) {
8643 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
8644}
8645
8646static __inline__ vector unsigned int __ATTRS_o_ai
8647vec_vsro(vector unsigned int __a, vector signed char __b) {
8648 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8649 (vector int)__b);
8650}
8651
8652static __inline__ vector unsigned int __ATTRS_o_ai
8653vec_vsro(vector unsigned int __a, vector unsigned char __b) {
8654 return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,
8655 (vector int)__b);
8656}
8657
8658static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
8659 vector signed char __b) {
8660 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8661}
8662
8663static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,
8664 vector unsigned char __b) {
8665 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
8666}
8667
8668/* vec_st */
8669
8670static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
8671 vector signed char *__c) {
8672 __builtin_altivec_stvx((vector int)__a, __b, __c);
8673}
8674
8675static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,
8676 signed char *__c) {
8677 __builtin_altivec_stvx((vector int)__a, __b, __c);
8678}
8679
8680static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
8681 vector unsigned char *__c) {
8682 __builtin_altivec_stvx((vector int)__a, __b, __c);
8683}
8684
8685static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,
8686 unsigned char *__c) {
8687 __builtin_altivec_stvx((vector int)__a, __b, __c);
8688}
8689
8690static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
8691 signed char *__c) {
8692 __builtin_altivec_stvx((vector int)__a, __b, __c);
8693}
8694
8695static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
8696 unsigned char *__c) {
8697 __builtin_altivec_stvx((vector int)__a, __b, __c);
8698}
8699
8700static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,
8701 vector bool char *__c) {
8702 __builtin_altivec_stvx((vector int)__a, __b, __c);
8703}
8704
8705static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
8706 vector short *__c) {
8707 __builtin_altivec_stvx((vector int)__a, __b, __c);
8708}
8709
8710static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,
8711 short *__c) {
8712 __builtin_altivec_stvx((vector int)__a, __b, __c);
8713}
8714
8715static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
8716 vector unsigned short *__c) {
8717 __builtin_altivec_stvx((vector int)__a, __b, __c);
8718}
8719
8720static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,
8721 unsigned short *__c) {
8722 __builtin_altivec_stvx((vector int)__a, __b, __c);
8723}
8724
8725static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
8726 short *__c) {
8727 __builtin_altivec_stvx((vector int)__a, __b, __c);
8728}
8729
8730static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
8731 unsigned short *__c) {
8732 __builtin_altivec_stvx((vector int)__a, __b, __c);
8733}
8734
8735static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,
8736 vector bool short *__c) {
8737 __builtin_altivec_stvx((vector int)__a, __b, __c);
8738}
8739
8740static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
8741 short *__c) {
8742 __builtin_altivec_stvx((vector int)__a, __b, __c);
8743}
8744
8745static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
8746 unsigned short *__c) {
8747 __builtin_altivec_stvx((vector int)__a, __b, __c);
8748}
8749
8750static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,
8751 vector pixel *__c) {
8752 __builtin_altivec_stvx((vector int)__a, __b, __c);
8753}
8754
8755static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,
8756 vector int *__c) {
8757 __builtin_altivec_stvx(__a, __b, __c);
8758}
8759
8760static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {
8761 __builtin_altivec_stvx(__a, __b, __c);
8762}
8763
8764static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
8765 vector unsigned int *__c) {
8766 __builtin_altivec_stvx((vector int)__a, __b, __c);
8767}
8768
8769static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,
8770 unsigned int *__c) {
8771 __builtin_altivec_stvx((vector int)__a, __b, __c);
8772}
8773
8774static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
8775 int *__c) {
8776 __builtin_altivec_stvx((vector int)__a, __b, __c);
8777}
8778
8779static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
8780 unsigned int *__c) {
8781 __builtin_altivec_stvx((vector int)__a, __b, __c);
8782}
8783
8784static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,
8785 vector bool int *__c) {
8786 __builtin_altivec_stvx((vector int)__a, __b, __c);
8787}
8788
8789static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
8790 vector float *__c) {
8791 __builtin_altivec_stvx((vector int)__a, __b, __c);
8792}
8793
8794static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,
8795 float *__c) {
8796 __builtin_altivec_stvx((vector int)__a, __b, __c);
8797}
8798
8799/* vec_stvx */
8800
8801static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
8802 vector signed char *__c) {
8803 __builtin_altivec_stvx((vector int)__a, __b, __c);
8804}
8805
8806static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,
8807 signed char *__c) {
8808 __builtin_altivec_stvx((vector int)__a, __b, __c);
8809}
8810
8811static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
8812 vector unsigned char *__c) {
8813 __builtin_altivec_stvx((vector int)__a, __b, __c);
8814}
8815
8816static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,
8817 unsigned char *__c) {
8818 __builtin_altivec_stvx((vector int)__a, __b, __c);
8819}
8820
8821static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
8822 signed char *__c) {
8823 __builtin_altivec_stvx((vector int)__a, __b, __c);
8824}
8825
8826static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
8827 unsigned char *__c) {
8828 __builtin_altivec_stvx((vector int)__a, __b, __c);
8829}
8830
8831static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,
8832 vector bool char *__c) {
8833 __builtin_altivec_stvx((vector int)__a, __b, __c);
8834}
8835
8836static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
8837 vector short *__c) {
8838 __builtin_altivec_stvx((vector int)__a, __b, __c);
8839}
8840
8841static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,
8842 short *__c) {
8843 __builtin_altivec_stvx((vector int)__a, __b, __c);
8844}
8845
8846static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
8847 vector unsigned short *__c) {
8848 __builtin_altivec_stvx((vector int)__a, __b, __c);
8849}
8850
8851static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,
8852 unsigned short *__c) {
8853 __builtin_altivec_stvx((vector int)__a, __b, __c);
8854}
8855
8856static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
8857 short *__c) {
8858 __builtin_altivec_stvx((vector int)__a, __b, __c);
8859}
8860
8861static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
8862 unsigned short *__c) {
8863 __builtin_altivec_stvx((vector int)__a, __b, __c);
8864}
8865
8866static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,
8867 vector bool short *__c) {
8868 __builtin_altivec_stvx((vector int)__a, __b, __c);
8869}
8870
8871static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
8872 short *__c) {
8873 __builtin_altivec_stvx((vector int)__a, __b, __c);
8874}
8875
8876static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
8877 unsigned short *__c) {
8878 __builtin_altivec_stvx((vector int)__a, __b, __c);
8879}
8880
8881static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,
8882 vector pixel *__c) {
8883 __builtin_altivec_stvx((vector int)__a, __b, __c);
8884}
8885
8886static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
8887 vector int *__c) {
8888 __builtin_altivec_stvx(__a, __b, __c);
8889}
8890
8891static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,
8892 int *__c) {
8893 __builtin_altivec_stvx(__a, __b, __c);
8894}
8895
8896static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
8897 vector unsigned int *__c) {
8898 __builtin_altivec_stvx((vector int)__a, __b, __c);
8899}
8900
8901static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,
8902 unsigned int *__c) {
8903 __builtin_altivec_stvx((vector int)__a, __b, __c);
8904}
8905
8906static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
8907 int *__c) {
8908 __builtin_altivec_stvx((vector int)__a, __b, __c);
8909}
8910
8911static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
8912 unsigned int *__c) {
8913 __builtin_altivec_stvx((vector int)__a, __b, __c);
8914}
8915
8916static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,
8917 vector bool int *__c) {
8918 __builtin_altivec_stvx((vector int)__a, __b, __c);
8919}
8920
8921static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
8922 vector float *__c) {
8923 __builtin_altivec_stvx((vector int)__a, __b, __c);
8924}
8925
8926static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,
8927 float *__c) {
8928 __builtin_altivec_stvx((vector int)__a, __b, __c);
8929}
8930
8931/* vec_ste */
8932
8933static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,
8934 signed char *__c) {
8935 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8936}
8937
8938static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,
8939 unsigned char *__c) {
8940 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8941}
8942
8943static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
8944 signed char *__c) {
8945 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8946}
8947
8948static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,
8949 unsigned char *__c) {
8950 __builtin_altivec_stvebx((vector char)__a, __b, __c);
8951}
8952
8953static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,
8954 short *__c) {
8955 __builtin_altivec_stvehx(__a, __b, __c);
8956}
8957
8958static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,
8959 unsigned short *__c) {
8960 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8961}
8962
8963static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
8964 short *__c) {
8965 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8966}
8967
8968static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,
8969 unsigned short *__c) {
8970 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8971}
8972
8973static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
8974 short *__c) {
8975 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8976}
8977
8978static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,
8979 unsigned short *__c) {
8980 __builtin_altivec_stvehx((vector short)__a, __b, __c);
8981}
8982
8983static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {
8984 __builtin_altivec_stvewx(__a, __b, __c);
8985}
8986
8987static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,
8988 unsigned int *__c) {
8989 __builtin_altivec_stvewx((vector int)__a, __b, __c);
8990}
8991
8992static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
8993 int *__c) {
8994 __builtin_altivec_stvewx((vector int)__a, __b, __c);
8995}
8996
8997static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,
8998 unsigned int *__c) {
8999 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9000}
9001
9002static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,
9003 float *__c) {
9004 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9005}
9006
9007/* vec_stvebx */
9008
9009static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,
9010 signed char *__c) {
9011 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9012}
9013
9014static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,
9015 int __b, unsigned char *__c) {
9016 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9017}
9018
9019static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
9020 signed char *__c) {
9021 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9022}
9023
9024static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,
9025 unsigned char *__c) {
9026 __builtin_altivec_stvebx((vector char)__a, __b, __c);
9027}
9028
9029/* vec_stvehx */
9030
9031static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,
9032 short *__c) {
9033 __builtin_altivec_stvehx(__a, __b, __c);
9034}
9035
9036static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,
9037 int __b, unsigned short *__c) {
9038 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9039}
9040
9041static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
9042 short *__c) {
9043 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9044}
9045
9046static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,
9047 unsigned short *__c) {
9048 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9049}
9050
9051static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
9052 short *__c) {
9053 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9054}
9055
9056static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,
9057 unsigned short *__c) {
9058 __builtin_altivec_stvehx((vector short)__a, __b, __c);
9059}
9060
9061/* vec_stvewx */
9062
9063static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,
9064 int *__c) {
9065 __builtin_altivec_stvewx(__a, __b, __c);
9066}
9067
9068static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,
9069 unsigned int *__c) {
9070 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9071}
9072
9073static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
9074 int *__c) {
9075 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9076}
9077
9078static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,
9079 unsigned int *__c) {
9080 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9081}
9082
9083static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,
9084 float *__c) {
9085 __builtin_altivec_stvewx((vector int)__a, __b, __c);
9086}
9087
9088/* vec_stl */
9089
9090static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
9091 vector signed char *__c) {
9092 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9093}
9094
9095static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,
9096 signed char *__c) {
9097 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9098}
9099
9100static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
9101 vector unsigned char *__c) {
9102 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9103}
9104
9105static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,
9106 unsigned char *__c) {
9107 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9108}
9109
9110static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
9111 signed char *__c) {
9112 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9113}
9114
9115static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
9116 unsigned char *__c) {
9117 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9118}
9119
9120static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,
9121 vector bool char *__c) {
9122 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9123}
9124
9125static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
9126 vector short *__c) {
9127 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9128}
9129
9130static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,
9131 short *__c) {
9132 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9133}
9134
9135static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
9136 vector unsigned short *__c) {
9137 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9138}
9139
9140static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,
9141 unsigned short *__c) {
9142 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9143}
9144
9145static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
9146 short *__c) {
9147 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9148}
9149
9150static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
9151 unsigned short *__c) {
9152 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9153}
9154
9155static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,
9156 vector bool short *__c) {
9157 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9158}
9159
9160static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
9161 short *__c) {
9162 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9163}
9164
9165static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
9166 unsigned short *__c) {
9167 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9168}
9169
9170static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,
9171 vector pixel *__c) {
9172 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9173}
9174
9175static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,
9176 vector int *__c) {
9177 __builtin_altivec_stvxl(__a, __b, __c);
9178}
9179
9180static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {
9181 __builtin_altivec_stvxl(__a, __b, __c);
9182}
9183
9184static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
9185 vector unsigned int *__c) {
9186 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9187}
9188
9189static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,
9190 unsigned int *__c) {
9191 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9192}
9193
9194static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
9195 int *__c) {
9196 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9197}
9198
9199static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
9200 unsigned int *__c) {
9201 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9202}
9203
9204static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,
9205 vector bool int *__c) {
9206 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9207}
9208
9209static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
9210 vector float *__c) {
9211 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9212}
9213
9214static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,
9215 float *__c) {
9216 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9217}
9218
9219/* vec_stvxl */
9220
9221static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
9222 vector signed char *__c) {
9223 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9224}
9225
9226static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,
9227 signed char *__c) {
9228 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9229}
9230
9231static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
9232 vector unsigned char *__c) {
9233 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9234}
9235
9236static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,
9237 unsigned char *__c) {
9238 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9239}
9240
9241static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
9242 signed char *__c) {
9243 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9244}
9245
9246static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
9247 unsigned char *__c) {
9248 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9249}
9250
9251static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,
9252 vector bool char *__c) {
9253 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9254}
9255
9256static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
9257 vector short *__c) {
9258 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9259}
9260
9261static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,
9262 short *__c) {
9263 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9264}
9265
9266static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
9267 int __b,
9268 vector unsigned short *__c) {
9269 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9270}
9271
9272static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,
9273 int __b, unsigned short *__c) {
9274 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9275}
9276
9277static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
9278 short *__c) {
9279 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9280}
9281
9282static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
9283 unsigned short *__c) {
9284 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9285}
9286
9287static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,
9288 vector bool short *__c) {
9289 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9290}
9291
9292static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
9293 short *__c) {
9294 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9295}
9296
9297static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
9298 unsigned short *__c) {
9299 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9300}
9301
9302static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,
9303 vector pixel *__c) {
9304 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9305}
9306
9307static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
9308 vector int *__c) {
9309 __builtin_altivec_stvxl(__a, __b, __c);
9310}
9311
9312static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,
9313 int *__c) {
9314 __builtin_altivec_stvxl(__a, __b, __c);
9315}
9316
9317static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
9318 vector unsigned int *__c) {
9319 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9320}
9321
9322static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,
9323 unsigned int *__c) {
9324 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9325}
9326
9327static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
9328 int *__c) {
9329 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9330}
9331
9332static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
9333 unsigned int *__c) {
9334 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9335}
9336
9337static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,
9338 vector bool int *__c) {
9339 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9340}
9341
9342static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
9343 vector float *__c) {
9344 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9345}
9346
9347static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,
9348 float *__c) {
9349 __builtin_altivec_stvxl((vector int)__a, __b, __c);
9350}
9351
9352/* vec_sub */
9353
9354static __inline__ vector signed char __ATTRS_o_ai
9355vec_sub(vector signed char __a, vector signed char __b) {
9356 return __a - __b;
9357}
9358
9359static __inline__ vector signed char __ATTRS_o_ai
9360vec_sub(vector bool char __a, vector signed char __b) {
9361 return (vector signed char)__a - __b;
9362}
9363
9364static __inline__ vector signed char __ATTRS_o_ai
9365vec_sub(vector signed char __a, vector bool char __b) {
9366 return __a - (vector signed char)__b;
9367}
9368
9369static __inline__ vector unsigned char __ATTRS_o_ai
9370vec_sub(vector unsigned char __a, vector unsigned char __b) {
9371 return __a - __b;
9372}
9373
9374static __inline__ vector unsigned char __ATTRS_o_ai
9375vec_sub(vector bool char __a, vector unsigned char __b) {
9376 return (vector unsigned char)__a - __b;
9377}
9378
9379static __inline__ vector unsigned char __ATTRS_o_ai
9380vec_sub(vector unsigned char __a, vector bool char __b) {
9381 return __a - (vector unsigned char)__b;
9382}
9383
9384static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
9385 vector short __b) {
9386 return __a - __b;
9387}
9388
9389static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,
9390 vector short __b) {
9391 return (vector short)__a - __b;
9392}
9393
9394static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,
9395 vector bool short __b) {
9396 return __a - (vector short)__b;
9397}
9398
9399static __inline__ vector unsigned short __ATTRS_o_ai
9400vec_sub(vector unsigned short __a, vector unsigned short __b) {
9401 return __a - __b;
9402}
9403
9404static __inline__ vector unsigned short __ATTRS_o_ai
9405vec_sub(vector bool short __a, vector unsigned short __b) {
9406 return (vector unsigned short)__a - __b;
9407}
9408
9409static __inline__ vector unsigned short __ATTRS_o_ai
9410vec_sub(vector unsigned short __a, vector bool short __b) {
9411 return __a - (vector unsigned short)__b;
9412}
9413
9414static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
9415 vector int __b) {
9416 return __a - __b;
9417}
9418
9419static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,
9420 vector int __b) {
9421 return (vector int)__a - __b;
9422}
9423
9424static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,
9425 vector bool int __b) {
9426 return __a - (vector int)__b;
9427}
9428
9429static __inline__ vector unsigned int __ATTRS_o_ai
9430vec_sub(vector unsigned int __a, vector unsigned int __b) {
9431 return __a - __b;
9432}
9433
9434static __inline__ vector unsigned int __ATTRS_o_ai
9435vec_sub(vector bool int __a, vector unsigned int __b) {
9436 return (vector unsigned int)__a - __b;
9437}
9438
9439static __inline__ vector unsigned int __ATTRS_o_ai
9440vec_sub(vector unsigned int __a, vector bool int __b) {
9441 return __a - (vector unsigned int)__b;
9442}
9443
9444#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9445static __inline__ vector signed __int128 __ATTRS_o_ai
9446vec_sub(vector signed __int128 __a, vector signed __int128 __b) {
9447 return __a - __b;
9448}
9449
9450static __inline__ vector unsigned __int128 __ATTRS_o_ai
9451vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9452 return __a - __b;
9453}
9454#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9455
9456#ifdef __VSX__
9457static __inline__ vector signed long long __ATTRS_o_ai
9458vec_sub(vector signed long long __a, vector signed long long __b) {
9459 return __a - __b;
9460}
9461
9462static __inline__ vector unsigned long long __ATTRS_o_ai
9463vec_sub(vector unsigned long long __a, vector unsigned long long __b) {
9464 return __a - __b;
9465}
9466
9467static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,
9468 vector double __b) {
9469 return __a - __b;
9470}
9471#endif
9472
9473static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,
9474 vector float __b) {
9475 return __a - __b;
9476}
9477
9478/* vec_vsububm */
9479
9480#define __builtin_altivec_vsububm vec_vsububm
9481
9482static __inline__ vector signed char __ATTRS_o_ai
9483vec_vsububm(vector signed char __a, vector signed char __b) {
9484 return __a - __b;
9485}
9486
9487static __inline__ vector signed char __ATTRS_o_ai
9488vec_vsububm(vector bool char __a, vector signed char __b) {
9489 return (vector signed char)__a - __b;
9490}
9491
9492static __inline__ vector signed char __ATTRS_o_ai
9493vec_vsububm(vector signed char __a, vector bool char __b) {
9494 return __a - (vector signed char)__b;
9495}
9496
9497static __inline__ vector unsigned char __ATTRS_o_ai
9498vec_vsububm(vector unsigned char __a, vector unsigned char __b) {
9499 return __a - __b;
9500}
9501
9502static __inline__ vector unsigned char __ATTRS_o_ai
9503vec_vsububm(vector bool char __a, vector unsigned char __b) {
9504 return (vector unsigned char)__a - __b;
9505}
9506
9507static __inline__ vector unsigned char __ATTRS_o_ai
9508vec_vsububm(vector unsigned char __a, vector bool char __b) {
9509 return __a - (vector unsigned char)__b;
9510}
9511
9512/* vec_vsubuhm */
9513
9514#define __builtin_altivec_vsubuhm vec_vsubuhm
9515
9516static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
9517 vector short __b) {
9518 return __a - __b;
9519}
9520
9521static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,
9522 vector short __b) {
9523 return (vector short)__a - __b;
9524}
9525
9526static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,
9527 vector bool short __b) {
9528 return __a - (vector short)__b;
9529}
9530
9531static __inline__ vector unsigned short __ATTRS_o_ai
9532vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {
9533 return __a - __b;
9534}
9535
9536static __inline__ vector unsigned short __ATTRS_o_ai
9537vec_vsubuhm(vector bool short __a, vector unsigned short __b) {
9538 return (vector unsigned short)__a - __b;
9539}
9540
9541static __inline__ vector unsigned short __ATTRS_o_ai
9542vec_vsubuhm(vector unsigned short __a, vector bool short __b) {
9543 return __a - (vector unsigned short)__b;
9544}
9545
9546/* vec_vsubuwm */
9547
9548#define __builtin_altivec_vsubuwm vec_vsubuwm
9549
9550static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
9551 vector int __b) {
9552 return __a - __b;
9553}
9554
9555static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,
9556 vector int __b) {
9557 return (vector int)__a - __b;
9558}
9559
9560static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,
9561 vector bool int __b) {
9562 return __a - (vector int)__b;
9563}
9564
9565static __inline__ vector unsigned int __ATTRS_o_ai
9566vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {
9567 return __a - __b;
9568}
9569
9570static __inline__ vector unsigned int __ATTRS_o_ai
9571vec_vsubuwm(vector bool int __a, vector unsigned int __b) {
9572 return (vector unsigned int)__a - __b;
9573}
9574
9575static __inline__ vector unsigned int __ATTRS_o_ai
9576vec_vsubuwm(vector unsigned int __a, vector bool int __b) {
9577 return __a - (vector unsigned int)__b;
9578}
9579
9580/* vec_vsubfp */
9581
9582#define __builtin_altivec_vsubfp vec_vsubfp
9583
9584static __inline__ vector float __attribute__((__always_inline__))
9585vec_vsubfp(vector float __a, vector float __b) {
9586 return __a - __b;
9587}
9588
9589/* vec_subc */
9590
9591static __inline__ vector unsigned int __ATTRS_o_ai
9592vec_subc(vector unsigned int __a, vector unsigned int __b) {
9593 return __builtin_altivec_vsubcuw(__a, __b);
9594}
9595
9596#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9597static __inline__ vector unsigned __int128 __ATTRS_o_ai
9598vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9599 return __builtin_altivec_vsubcuq(__a, __b);
9600}
9601
9602static __inline__ vector signed __int128 __ATTRS_o_ai
9603vec_subc(vector signed __int128 __a, vector signed __int128 __b) {
9604 return __builtin_altivec_vsubcuq(__a, __b);
9605}
9606#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9607
9608/* vec_vsubcuw */
9609
9610static __inline__ vector unsigned int __attribute__((__always_inline__))
9611vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {
9612 return __builtin_altivec_vsubcuw(__a, __b);
9613}
9614
9615/* vec_subs */
9616
9617static __inline__ vector signed char __ATTRS_o_ai
9618vec_subs(vector signed char __a, vector signed char __b) {
9619 return __builtin_altivec_vsubsbs(__a, __b);
9620}
9621
9622static __inline__ vector signed char __ATTRS_o_ai
9623vec_subs(vector bool char __a, vector signed char __b) {
9624 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
9625}
9626
9627static __inline__ vector signed char __ATTRS_o_ai
9628vec_subs(vector signed char __a, vector bool char __b) {
9629 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
9630}
9631
9632static __inline__ vector unsigned char __ATTRS_o_ai
9633vec_subs(vector unsigned char __a, vector unsigned char __b) {
9634 return __builtin_altivec_vsububs(__a, __b);
9635}
9636
9637static __inline__ vector unsigned char __ATTRS_o_ai
9638vec_subs(vector bool char __a, vector unsigned char __b) {
9639 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
9640}
9641
9642static __inline__ vector unsigned char __ATTRS_o_ai
9643vec_subs(vector unsigned char __a, vector bool char __b) {
9644 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
9645}
9646
9647static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
9648 vector short __b) {
9649 return __builtin_altivec_vsubshs(__a, __b);
9650}
9651
9652static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,
9653 vector short __b) {
9654 return __builtin_altivec_vsubshs((vector short)__a, __b);
9655}
9656
9657static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,
9658 vector bool short __b) {
9659 return __builtin_altivec_vsubshs(__a, (vector short)__b);
9660}
9661
9662static __inline__ vector unsigned short __ATTRS_o_ai
9663vec_subs(vector unsigned short __a, vector unsigned short __b) {
9664 return __builtin_altivec_vsubuhs(__a, __b);
9665}
9666
9667static __inline__ vector unsigned short __ATTRS_o_ai
9668vec_subs(vector bool short __a, vector unsigned short __b) {
9669 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
9670}
9671
9672static __inline__ vector unsigned short __ATTRS_o_ai
9673vec_subs(vector unsigned short __a, vector bool short __b) {
9674 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
9675}
9676
9677static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
9678 vector int __b) {
9679 return __builtin_altivec_vsubsws(__a, __b);
9680}
9681
9682static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,
9683 vector int __b) {
9684 return __builtin_altivec_vsubsws((vector int)__a, __b);
9685}
9686
9687static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,
9688 vector bool int __b) {
9689 return __builtin_altivec_vsubsws(__a, (vector int)__b);
9690}
9691
9692static __inline__ vector unsigned int __ATTRS_o_ai
9693vec_subs(vector unsigned int __a, vector unsigned int __b) {
9694 return __builtin_altivec_vsubuws(__a, __b);
9695}
9696
9697static __inline__ vector unsigned int __ATTRS_o_ai
9698vec_subs(vector bool int __a, vector unsigned int __b) {
9699 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
9700}
9701
9702static __inline__ vector unsigned int __ATTRS_o_ai
9703vec_subs(vector unsigned int __a, vector bool int __b) {
9704 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
9705}
9706
9707/* vec_vsubsbs */
9708
9709static __inline__ vector signed char __ATTRS_o_ai
9710vec_vsubsbs(vector signed char __a, vector signed char __b) {
9711 return __builtin_altivec_vsubsbs(__a, __b);
9712}
9713
9714static __inline__ vector signed char __ATTRS_o_ai
9715vec_vsubsbs(vector bool char __a, vector signed char __b) {
9716 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
9717}
9718
9719static __inline__ vector signed char __ATTRS_o_ai
9720vec_vsubsbs(vector signed char __a, vector bool char __b) {
9721 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
9722}
9723
9724/* vec_vsububs */
9725
9726static __inline__ vector unsigned char __ATTRS_o_ai
9727vec_vsububs(vector unsigned char __a, vector unsigned char __b) {
9728 return __builtin_altivec_vsububs(__a, __b);
9729}
9730
9731static __inline__ vector unsigned char __ATTRS_o_ai
9732vec_vsububs(vector bool char __a, vector unsigned char __b) {
9733 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
9734}
9735
9736static __inline__ vector unsigned char __ATTRS_o_ai
9737vec_vsububs(vector unsigned char __a, vector bool char __b) {
9738 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
9739}
9740
9741/* vec_vsubshs */
9742
9743static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
9744 vector short __b) {
9745 return __builtin_altivec_vsubshs(__a, __b);
9746}
9747
9748static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,
9749 vector short __b) {
9750 return __builtin_altivec_vsubshs((vector short)__a, __b);
9751}
9752
9753static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,
9754 vector bool short __b) {
9755 return __builtin_altivec_vsubshs(__a, (vector short)__b);
9756}
9757
9758/* vec_vsubuhs */
9759
9760static __inline__ vector unsigned short __ATTRS_o_ai
9761vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {
9762 return __builtin_altivec_vsubuhs(__a, __b);
9763}
9764
9765static __inline__ vector unsigned short __ATTRS_o_ai
9766vec_vsubuhs(vector bool short __a, vector unsigned short __b) {
9767 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
9768}
9769
9770static __inline__ vector unsigned short __ATTRS_o_ai
9771vec_vsubuhs(vector unsigned short __a, vector bool short __b) {
9772 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
9773}
9774
9775/* vec_vsubsws */
9776
9777static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
9778 vector int __b) {
9779 return __builtin_altivec_vsubsws(__a, __b);
9780}
9781
9782static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,
9783 vector int __b) {
9784 return __builtin_altivec_vsubsws((vector int)__a, __b);
9785}
9786
9787static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,
9788 vector bool int __b) {
9789 return __builtin_altivec_vsubsws(__a, (vector int)__b);
9790}
9791
9792/* vec_vsubuws */
9793
9794static __inline__ vector unsigned int __ATTRS_o_ai
9795vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {
9796 return __builtin_altivec_vsubuws(__a, __b);
9797}
9798
9799static __inline__ vector unsigned int __ATTRS_o_ai
9800vec_vsubuws(vector bool int __a, vector unsigned int __b) {
9801 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
9802}
9803
9804static __inline__ vector unsigned int __ATTRS_o_ai
9805vec_vsubuws(vector unsigned int __a, vector bool int __b) {
9806 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
9807}
9808
9809#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9810/* vec_vsubuqm */
9811
9812static __inline__ vector signed __int128 __ATTRS_o_ai
9813vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {
9814 return __a - __b;
9815}
9816
9817static __inline__ vector unsigned __int128 __ATTRS_o_ai
9818vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9819 return __a - __b;
9820}
9821
9822/* vec_vsubeuqm */
9823
9824static __inline__ vector signed __int128 __ATTRS_o_ai
9825vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,
9826 vector signed __int128 __c) {
9827 return __builtin_altivec_vsubeuqm(__a, __b, __c);
9828}
9829
9830static __inline__ vector unsigned __int128 __ATTRS_o_ai
9831vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
9832 vector unsigned __int128 __c) {
9833 return __builtin_altivec_vsubeuqm(__a, __b, __c);
9834}
9835
9836/* vec_vsubcuq */
9837
9838static __inline__ vector signed __int128 __ATTRS_o_ai
9839vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {
9840 return __builtin_altivec_vsubcuq(__a, __b);
9841}
9842
9843static __inline__ vector unsigned __int128 __ATTRS_o_ai
9844vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
9845 return __builtin_altivec_vsubcuq(__a, __b);
9846}
9847
9848/* vec_vsubecuq */
9849
9850static __inline__ vector signed __int128 __ATTRS_o_ai
9851vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,
9852 vector signed __int128 __c) {
9853 return __builtin_altivec_vsubecuq(__a, __b, __c);
9854}
9855
9856static __inline__ vector unsigned __int128 __ATTRS_o_ai
9857vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
9858 vector unsigned __int128 __c) {
9859 return __builtin_altivec_vsubecuq(__a, __b, __c);
9860}
9861#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
9862
9863/* vec_sum4s */
9864
9865static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,
9866 vector int __b) {
9867 return __builtin_altivec_vsum4sbs(__a, __b);
9868}
9869
9870static __inline__ vector unsigned int __ATTRS_o_ai
9871vec_sum4s(vector unsigned char __a, vector unsigned int __b) {
9872 return __builtin_altivec_vsum4ubs(__a, __b);
9873}
9874
9875static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,
9876 vector int __b) {
9877 return __builtin_altivec_vsum4shs(__a, __b);
9878}
9879
9880/* vec_vsum4sbs */
9881
9882static __inline__ vector int __attribute__((__always_inline__))
9883vec_vsum4sbs(vector signed char __a, vector int __b) {
9884 return __builtin_altivec_vsum4sbs(__a, __b);
9885}
9886
9887/* vec_vsum4ubs */
9888
9889static __inline__ vector unsigned int __attribute__((__always_inline__))
9890vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {
9891 return __builtin_altivec_vsum4ubs(__a, __b);
9892}
9893
9894/* vec_vsum4shs */
9895
9896static __inline__ vector int __attribute__((__always_inline__))
9897vec_vsum4shs(vector signed short __a, vector int __b) {
9898 return __builtin_altivec_vsum4shs(__a, __b);
9899}
9900
9901/* vec_sum2s */
9902
9903/* The vsum2sws instruction has a big-endian bias, so that the second
9904 input vector and the result always reference big-endian elements
9905 1 and 3 (little-endian element 0 and 2). For ease of porting the
9906 programmer wants elements 1 and 3 in both cases, so for little
9907 endian we must perform some permutes. */
9908
9909static __inline__ vector signed int __attribute__((__always_inline__))
9910vec_sum2s(vector int __a, vector int __b) {
9911#ifdef __LITTLE_ENDIAN__
9912 vector int __c = (vector signed int)vec_perm(
9913 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9914 8, 9, 10, 11));
9915 __c = __builtin_altivec_vsum2sws(__a, __c);
9916 return (vector signed int)vec_perm(
9917 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9918 8, 9, 10, 11));
9919#else
9920 return __builtin_altivec_vsum2sws(__a, __b);
9921#endif
9922}
9923
9924/* vec_vsum2sws */
9925
9926static __inline__ vector signed int __attribute__((__always_inline__))
9927vec_vsum2sws(vector int __a, vector int __b) {
9928#ifdef __LITTLE_ENDIAN__
9929 vector int __c = (vector signed int)vec_perm(
9930 __b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9931 8, 9, 10, 11));
9932 __c = __builtin_altivec_vsum2sws(__a, __c);
9933 return (vector signed int)vec_perm(
9934 __c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
9935 8, 9, 10, 11));
9936#else
9937 return __builtin_altivec_vsum2sws(__a, __b);
9938#endif
9939}
9940
9941/* vec_sums */
9942
9943/* The vsumsws instruction has a big-endian bias, so that the second
9944 input vector and the result always reference big-endian element 3
9945 (little-endian element 0). For ease of porting the programmer
9946 wants element 3 in both cases, so for little endian we must perform
9947 some permutes. */
9948
9949static __inline__ vector signed int __attribute__((__always_inline__))
9950vec_sums(vector signed int __a, vector signed int __b) {
9951#ifdef __LITTLE_ENDIAN__
9952 __b = (vector signed int)vec_splat(__b, 3);
9953 __b = __builtin_altivec_vsumsws(__a, __b);
9954 return (vector signed int)(0, 0, 0, __b[0]);
9955#else
9956 return __builtin_altivec_vsumsws(__a, __b);
9957#endif
9958}
9959
9960/* vec_vsumsws */
9961
9962static __inline__ vector signed int __attribute__((__always_inline__))
9963vec_vsumsws(vector signed int __a, vector signed int __b) {
9964#ifdef __LITTLE_ENDIAN__
9965 __b = (vector signed int)vec_splat(__b, 3);
9966 __b = __builtin_altivec_vsumsws(__a, __b);
9967 return (vector signed int)(0, 0, 0, __b[0]);
9968#else
9969 return __builtin_altivec_vsumsws(__a, __b);
9970#endif
9971}
9972
9973/* vec_trunc */
9974
9975static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {
9976#ifdef __VSX__
9977 return __builtin_vsx_xvrspiz(__a);
9978#else
9979 return __builtin_altivec_vrfiz(__a);
9980#endif
9981}
9982
9983#ifdef __VSX__
9984static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {
9985 return __builtin_vsx_xvrdpiz(__a);
9986}
9987#endif
9988
9989/* vec_vrfiz */
9990
9991static __inline__ vector float __attribute__((__always_inline__))
9992vec_vrfiz(vector float __a) {
9993 return __builtin_altivec_vrfiz(__a);
9994}
9995
9996/* vec_unpackh */
9997
9998/* The vector unpack instructions all have a big-endian bias, so for
9999 little endian we must reverse the meanings of "high" and "low." */
10000
10001static __inline__ vector short __ATTRS_o_ai
10002vec_unpackh(vector signed char __a) {
10003#ifdef __LITTLE_ENDIAN__
10004 return __builtin_altivec_vupklsb((vector char)__a);
10005#else
10006 return __builtin_altivec_vupkhsb((vector char)__a);
10007#endif
10008}
10009
10010static __inline__ vector bool short __ATTRS_o_ai
10011vec_unpackh(vector bool char __a) {
10012#ifdef __LITTLE_ENDIAN__
10013 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10014#else
10015 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10016#endif
10017}
10018
10019static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {
10020#ifdef __LITTLE_ENDIAN__
10021 return __builtin_altivec_vupklsh(__a);
10022#else
10023 return __builtin_altivec_vupkhsh(__a);
10024#endif
10025}
10026
10027static __inline__ vector bool int __ATTRS_o_ai
10028vec_unpackh(vector bool short __a) {
10029#ifdef __LITTLE_ENDIAN__
10030 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10031#else
10032 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10033#endif
10034}
10035
10036static __inline__ vector unsigned int __ATTRS_o_ai
10037vec_unpackh(vector pixel __a) {
10038#ifdef __LITTLE_ENDIAN__
10039 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10040#else
10041 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10042#endif
10043}
10044
10045#ifdef __POWER8_VECTOR__
10046static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {
10047#ifdef __LITTLE_ENDIAN__
10048 return __builtin_altivec_vupklsw(__a);
10049#else
10050 return __builtin_altivec_vupkhsw(__a);
10051#endif
10052}
10053
10054static __inline__ vector bool long long __ATTRS_o_ai
10055vec_unpackh(vector bool int __a) {
10056#ifdef __LITTLE_ENDIAN__
10057 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10058#else
10059 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10060#endif
10061}
10062#endif
10063
10064/* vec_vupkhsb */
10065
10066static __inline__ vector short __ATTRS_o_ai
10067vec_vupkhsb(vector signed char __a) {
10068#ifdef __LITTLE_ENDIAN__
10069 return __builtin_altivec_vupklsb((vector char)__a);
10070#else
10071 return __builtin_altivec_vupkhsb((vector char)__a);
10072#endif
10073}
10074
10075static __inline__ vector bool short __ATTRS_o_ai
10076vec_vupkhsb(vector bool char __a) {
10077#ifdef __LITTLE_ENDIAN__
10078 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10079#else
10080 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10081#endif
10082}
10083
10084/* vec_vupkhsh */
10085
10086static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {
10087#ifdef __LITTLE_ENDIAN__
10088 return __builtin_altivec_vupklsh(__a);
10089#else
10090 return __builtin_altivec_vupkhsh(__a);
10091#endif
10092}
10093
10094static __inline__ vector bool int __ATTRS_o_ai
10095vec_vupkhsh(vector bool short __a) {
10096#ifdef __LITTLE_ENDIAN__
10097 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10098#else
10099 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10100#endif
10101}
10102
10103static __inline__ vector unsigned int __ATTRS_o_ai
10104vec_vupkhsh(vector pixel __a) {
10105#ifdef __LITTLE_ENDIAN__
10106 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10107#else
10108 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10109#endif
10110}
10111
10112/* vec_vupkhsw */
10113
10114#ifdef __POWER8_VECTOR__
10115static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {
10116#ifdef __LITTLE_ENDIAN__
10117 return __builtin_altivec_vupklsw(__a);
10118#else
10119 return __builtin_altivec_vupkhsw(__a);
10120#endif
10121}
10122
10123static __inline__ vector bool long long __ATTRS_o_ai
10124vec_vupkhsw(vector bool int __a) {
10125#ifdef __LITTLE_ENDIAN__
10126 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10127#else
10128 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10129#endif
10130}
10131#endif
10132
10133/* vec_unpackl */
10134
10135static __inline__ vector short __ATTRS_o_ai
10136vec_unpackl(vector signed char __a) {
10137#ifdef __LITTLE_ENDIAN__
10138 return __builtin_altivec_vupkhsb((vector char)__a);
10139#else
10140 return __builtin_altivec_vupklsb((vector char)__a);
10141#endif
10142}
10143
10144static __inline__ vector bool short __ATTRS_o_ai
10145vec_unpackl(vector bool char __a) {
10146#ifdef __LITTLE_ENDIAN__
10147 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10148#else
10149 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10150#endif
10151}
10152
10153static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {
10154#ifdef __LITTLE_ENDIAN__
10155 return __builtin_altivec_vupkhsh(__a);
10156#else
10157 return __builtin_altivec_vupklsh(__a);
10158#endif
10159}
10160
10161static __inline__ vector bool int __ATTRS_o_ai
10162vec_unpackl(vector bool short __a) {
10163#ifdef __LITTLE_ENDIAN__
10164 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10165#else
10166 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10167#endif
10168}
10169
10170static __inline__ vector unsigned int __ATTRS_o_ai
10171vec_unpackl(vector pixel __a) {
10172#ifdef __LITTLE_ENDIAN__
10173 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10174#else
10175 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10176#endif
10177}
10178
10179#ifdef __POWER8_VECTOR__
10180static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {
10181#ifdef __LITTLE_ENDIAN__
10182 return __builtin_altivec_vupkhsw(__a);
10183#else
10184 return __builtin_altivec_vupklsw(__a);
10185#endif
10186}
10187
10188static __inline__ vector bool long long __ATTRS_o_ai
10189vec_unpackl(vector bool int __a) {
10190#ifdef __LITTLE_ENDIAN__
10191 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10192#else
10193 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10194#endif
10195}
10196#endif
10197
10198/* vec_vupklsb */
10199
10200static __inline__ vector short __ATTRS_o_ai
10201vec_vupklsb(vector signed char __a) {
10202#ifdef __LITTLE_ENDIAN__
10203 return __builtin_altivec_vupkhsb((vector char)__a);
10204#else
10205 return __builtin_altivec_vupklsb((vector char)__a);
10206#endif
10207}
10208
10209static __inline__ vector bool short __ATTRS_o_ai
10210vec_vupklsb(vector bool char __a) {
10211#ifdef __LITTLE_ENDIAN__
10212 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
10213#else
10214 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
10215#endif
10216}
10217
10218/* vec_vupklsh */
10219
10220static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {
10221#ifdef __LITTLE_ENDIAN__
10222 return __builtin_altivec_vupkhsh(__a);
10223#else
10224 return __builtin_altivec_vupklsh(__a);
10225#endif
10226}
10227
10228static __inline__ vector bool int __ATTRS_o_ai
10229vec_vupklsh(vector bool short __a) {
10230#ifdef __LITTLE_ENDIAN__
10231 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
10232#else
10233 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
10234#endif
10235}
10236
10237static __inline__ vector unsigned int __ATTRS_o_ai
10238vec_vupklsh(vector pixel __a) {
10239#ifdef __LITTLE_ENDIAN__
10240 return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);
10241#else
10242 return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);
10243#endif
10244}
10245
10246/* vec_vupklsw */
10247
10248#ifdef __POWER8_VECTOR__
10249static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {
10250#ifdef __LITTLE_ENDIAN__
10251 return __builtin_altivec_vupkhsw(__a);
10252#else
10253 return __builtin_altivec_vupklsw(__a);
10254#endif
10255}
10256
10257static __inline__ vector bool long long __ATTRS_o_ai
10258vec_vupklsw(vector bool int __a) {
10259#ifdef __LITTLE_ENDIAN__
10260 return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);
10261#else
10262 return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);
10263#endif
10264}
10265#endif
10266
10267/* vec_vsx_ld */
10268
10269#ifdef __VSX__
10270
Ben Murdoch61f157c2016-09-16 13:49:30 +010010271static __inline__ vector bool int __ATTRS_o_ai
10272vec_vsx_ld(int __a, const vector bool int *__b) {
10273 return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);
10274}
10275
Ben Murdoch097c5b22016-05-18 11:27:45 +010010276static __inline__ vector signed int __ATTRS_o_ai
10277vec_vsx_ld(int __a, const vector signed int *__b) {
10278 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
10279}
10280
Ben Murdoch61f157c2016-09-16 13:49:30 +010010281static __inline__ vector signed int __ATTRS_o_ai
10282vec_vsx_ld(int __a, const signed int *__b) {
10283 return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);
10284}
10285
Ben Murdoch097c5b22016-05-18 11:27:45 +010010286static __inline__ vector unsigned int __ATTRS_o_ai
10287vec_vsx_ld(int __a, const vector unsigned int *__b) {
10288 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
10289}
10290
Ben Murdoch61f157c2016-09-16 13:49:30 +010010291static __inline__ vector unsigned int __ATTRS_o_ai
10292vec_vsx_ld(int __a, const unsigned int *__b) {
10293 return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);
10294}
10295
Ben Murdoch097c5b22016-05-18 11:27:45 +010010296static __inline__ vector float __ATTRS_o_ai
10297vec_vsx_ld(int __a, const vector float *__b) {
10298 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
10299}
10300
Ben Murdoch61f157c2016-09-16 13:49:30 +010010301static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
10302 const float *__b) {
10303 return (vector float)__builtin_vsx_lxvw4x(__a, __b);
10304}
10305
Ben Murdoch097c5b22016-05-18 11:27:45 +010010306static __inline__ vector signed long long __ATTRS_o_ai
10307vec_vsx_ld(int __a, const vector signed long long *__b) {
10308 return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
10309}
10310
10311static __inline__ vector unsigned long long __ATTRS_o_ai
10312vec_vsx_ld(int __a, const vector unsigned long long *__b) {
10313 return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);
10314}
10315
10316static __inline__ vector double __ATTRS_o_ai
10317vec_vsx_ld(int __a, const vector double *__b) {
10318 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
10319}
10320
Ben Murdoch61f157c2016-09-16 13:49:30 +010010321static __inline__ vector double __ATTRS_o_ai
10322vec_vsx_ld(int __a, const double *__b) {
10323 return (vector double)__builtin_vsx_lxvd2x(__a, __b);
10324}
10325
10326static __inline__ vector bool short __ATTRS_o_ai
10327vec_vsx_ld(int __a, const vector bool short *__b) {
10328 return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);
10329}
10330
Ben Murdoch097c5b22016-05-18 11:27:45 +010010331static __inline__ vector signed short __ATTRS_o_ai
10332vec_vsx_ld(int __a, const vector signed short *__b) {
10333 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
10334}
10335
10336static __inline__ vector signed short __ATTRS_o_ai
10337vec_vsx_ld(int __a, const signed short *__b) {
10338 return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);
10339}
10340
10341static __inline__ vector unsigned short __ATTRS_o_ai
10342vec_vsx_ld(int __a, const vector unsigned short *__b) {
10343 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
10344}
10345
10346static __inline__ vector unsigned short __ATTRS_o_ai
10347vec_vsx_ld(int __a, const unsigned short *__b) {
10348 return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);
10349}
10350
10351static __inline__ vector bool char __ATTRS_o_ai
10352vec_vsx_ld(int __a, const vector bool char *__b) {
10353 return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);
10354}
10355
10356static __inline__ vector signed char __ATTRS_o_ai
10357vec_vsx_ld(int __a, const vector signed char *__b) {
10358 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
10359}
10360
10361static __inline__ vector signed char __ATTRS_o_ai
10362vec_vsx_ld(int __a, const signed char *__b) {
10363 return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);
10364}
10365
10366static __inline__ vector unsigned char __ATTRS_o_ai
10367vec_vsx_ld(int __a, const vector unsigned char *__b) {
10368 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
10369}
10370
10371static __inline__ vector unsigned char __ATTRS_o_ai
10372vec_vsx_ld(int __a, const unsigned char *__b) {
10373 return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);
10374}
10375
10376#endif
10377
10378/* vec_vsx_st */
10379
10380#ifdef __VSX__
10381
Ben Murdoch61f157c2016-09-16 13:49:30 +010010382static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
10383 vector bool int *__c) {
10384 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10385}
10386
10387static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
10388 signed int *__c) {
10389 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10390}
10391
10392static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,
10393 unsigned int *__c) {
10394 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10395}
10396
Ben Murdoch097c5b22016-05-18 11:27:45 +010010397static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
10398 vector signed int *__c) {
10399 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10400}
10401
10402static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,
10403 signed int *__c) {
10404 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10405}
10406
10407static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
10408 vector unsigned int *__c) {
10409 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10410}
10411
10412static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,
10413 unsigned int *__c) {
10414 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10415}
10416
10417static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
10418 vector float *__c) {
10419 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10420}
10421
Ben Murdoch61f157c2016-09-16 13:49:30 +010010422static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
10423 float *__c) {
10424 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10425}
10426
Ben Murdoch097c5b22016-05-18 11:27:45 +010010427static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
10428 int __b,
10429 vector signed long long *__c) {
10430 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10431}
10432
10433static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,
10434 int __b,
10435 vector unsigned long long *__c) {
10436 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10437}
10438
10439static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
10440 vector double *__c) {
10441 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10442}
10443
Ben Murdoch61f157c2016-09-16 13:49:30 +010010444static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,
10445 double *__c) {
10446 __builtin_vsx_stxvd2x((vector double)__a, __b, __c);
10447}
10448
10449static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
10450 vector bool short *__c) {
10451 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10452}
10453
10454static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
10455 signed short *__c) {
10456 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10457}
10458
10459static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,
10460 unsigned short *__c) {
10461 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10462}
Ben Murdoch097c5b22016-05-18 11:27:45 +010010463static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
10464 vector signed short *__c) {
10465 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10466}
10467
10468static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,
10469 signed short *__c) {
10470 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10471}
10472
10473static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
10474 int __b,
10475 vector unsigned short *__c) {
10476 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10477}
10478
10479static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,
10480 int __b, unsigned short *__c) {
10481 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10482}
10483
Ben Murdoch61f157c2016-09-16 13:49:30 +010010484static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
10485 vector bool char *__c) {
10486 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10487}
10488
10489static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
10490 signed char *__c) {
10491 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10492}
10493
10494static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,
10495 unsigned char *__c) {
10496 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10497}
10498
Ben Murdoch097c5b22016-05-18 11:27:45 +010010499static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
10500 vector signed char *__c) {
10501 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10502}
10503
10504static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,
10505 signed char *__c) {
10506 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10507}
10508
10509static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
10510 int __b,
10511 vector unsigned char *__c) {
10512 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10513}
10514
10515static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,
10516 int __b, unsigned char *__c) {
10517 __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
10518}
10519
Ben Murdoch097c5b22016-05-18 11:27:45 +010010520#endif
10521
10522/* vec_xor */
10523
10524#define __builtin_altivec_vxor vec_xor
10525
10526static __inline__ vector signed char __ATTRS_o_ai
10527vec_xor(vector signed char __a, vector signed char __b) {
10528 return __a ^ __b;
10529}
10530
10531static __inline__ vector signed char __ATTRS_o_ai
10532vec_xor(vector bool char __a, vector signed char __b) {
10533 return (vector signed char)__a ^ __b;
10534}
10535
10536static __inline__ vector signed char __ATTRS_o_ai
10537vec_xor(vector signed char __a, vector bool char __b) {
10538 return __a ^ (vector signed char)__b;
10539}
10540
10541static __inline__ vector unsigned char __ATTRS_o_ai
10542vec_xor(vector unsigned char __a, vector unsigned char __b) {
10543 return __a ^ __b;
10544}
10545
10546static __inline__ vector unsigned char __ATTRS_o_ai
10547vec_xor(vector bool char __a, vector unsigned char __b) {
10548 return (vector unsigned char)__a ^ __b;
10549}
10550
10551static __inline__ vector unsigned char __ATTRS_o_ai
10552vec_xor(vector unsigned char __a, vector bool char __b) {
10553 return __a ^ (vector unsigned char)__b;
10554}
10555
10556static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,
10557 vector bool char __b) {
10558 return __a ^ __b;
10559}
10560
10561static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
10562 vector short __b) {
10563 return __a ^ __b;
10564}
10565
10566static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,
10567 vector short __b) {
10568 return (vector short)__a ^ __b;
10569}
10570
10571static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,
10572 vector bool short __b) {
10573 return __a ^ (vector short)__b;
10574}
10575
10576static __inline__ vector unsigned short __ATTRS_o_ai
10577vec_xor(vector unsigned short __a, vector unsigned short __b) {
10578 return __a ^ __b;
10579}
10580
10581static __inline__ vector unsigned short __ATTRS_o_ai
10582vec_xor(vector bool short __a, vector unsigned short __b) {
10583 return (vector unsigned short)__a ^ __b;
10584}
10585
10586static __inline__ vector unsigned short __ATTRS_o_ai
10587vec_xor(vector unsigned short __a, vector bool short __b) {
10588 return __a ^ (vector unsigned short)__b;
10589}
10590
10591static __inline__ vector bool short __ATTRS_o_ai
10592vec_xor(vector bool short __a, vector bool short __b) {
10593 return __a ^ __b;
10594}
10595
10596static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
10597 vector int __b) {
10598 return __a ^ __b;
10599}
10600
10601static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,
10602 vector int __b) {
10603 return (vector int)__a ^ __b;
10604}
10605
10606static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,
10607 vector bool int __b) {
10608 return __a ^ (vector int)__b;
10609}
10610
10611static __inline__ vector unsigned int __ATTRS_o_ai
10612vec_xor(vector unsigned int __a, vector unsigned int __b) {
10613 return __a ^ __b;
10614}
10615
10616static __inline__ vector unsigned int __ATTRS_o_ai
10617vec_xor(vector bool int __a, vector unsigned int __b) {
10618 return (vector unsigned int)__a ^ __b;
10619}
10620
10621static __inline__ vector unsigned int __ATTRS_o_ai
10622vec_xor(vector unsigned int __a, vector bool int __b) {
10623 return __a ^ (vector unsigned int)__b;
10624}
10625
10626static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,
10627 vector bool int __b) {
10628 return __a ^ __b;
10629}
10630
10631static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
10632 vector float __b) {
10633 vector unsigned int __res =
10634 (vector unsigned int)__a ^ (vector unsigned int)__b;
10635 return (vector float)__res;
10636}
10637
10638static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,
10639 vector float __b) {
10640 vector unsigned int __res =
10641 (vector unsigned int)__a ^ (vector unsigned int)__b;
10642 return (vector float)__res;
10643}
10644
10645static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,
10646 vector bool int __b) {
10647 vector unsigned int __res =
10648 (vector unsigned int)__a ^ (vector unsigned int)__b;
10649 return (vector float)__res;
10650}
10651
10652#ifdef __VSX__
10653static __inline__ vector signed long long __ATTRS_o_ai
10654vec_xor(vector signed long long __a, vector signed long long __b) {
10655 return __a ^ __b;
10656}
10657
10658static __inline__ vector signed long long __ATTRS_o_ai
10659vec_xor(vector bool long long __a, vector signed long long __b) {
10660 return (vector signed long long)__a ^ __b;
10661}
10662
10663static __inline__ vector signed long long __ATTRS_o_ai
10664vec_xor(vector signed long long __a, vector bool long long __b) {
10665 return __a ^ (vector signed long long)__b;
10666}
10667
10668static __inline__ vector unsigned long long __ATTRS_o_ai
10669vec_xor(vector unsigned long long __a, vector unsigned long long __b) {
10670 return __a ^ __b;
10671}
10672
10673static __inline__ vector unsigned long long __ATTRS_o_ai
10674vec_xor(vector bool long long __a, vector unsigned long long __b) {
10675 return (vector unsigned long long)__a ^ __b;
10676}
10677
10678static __inline__ vector unsigned long long __ATTRS_o_ai
10679vec_xor(vector unsigned long long __a, vector bool long long __b) {
10680 return __a ^ (vector unsigned long long)__b;
10681}
10682
10683static __inline__ vector bool long long __ATTRS_o_ai
10684vec_xor(vector bool long long __a, vector bool long long __b) {
10685 return __a ^ __b;
10686}
10687
10688static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,
10689 vector double __b) {
10690 return (vector double)((vector unsigned long long)__a ^
10691 (vector unsigned long long)__b);
10692}
10693
10694static __inline__ vector double __ATTRS_o_ai
10695vec_xor(vector double __a, vector bool long long __b) {
10696 return (vector double)((vector unsigned long long)__a ^
10697 (vector unsigned long long)__b);
10698}
10699
10700static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,
10701 vector double __b) {
10702 return (vector double)((vector unsigned long long)__a ^
10703 (vector unsigned long long)__b);
10704}
10705#endif
10706
10707/* vec_vxor */
10708
10709static __inline__ vector signed char __ATTRS_o_ai
10710vec_vxor(vector signed char __a, vector signed char __b) {
10711 return __a ^ __b;
10712}
10713
10714static __inline__ vector signed char __ATTRS_o_ai
10715vec_vxor(vector bool char __a, vector signed char __b) {
10716 return (vector signed char)__a ^ __b;
10717}
10718
10719static __inline__ vector signed char __ATTRS_o_ai
10720vec_vxor(vector signed char __a, vector bool char __b) {
10721 return __a ^ (vector signed char)__b;
10722}
10723
10724static __inline__ vector unsigned char __ATTRS_o_ai
10725vec_vxor(vector unsigned char __a, vector unsigned char __b) {
10726 return __a ^ __b;
10727}
10728
10729static __inline__ vector unsigned char __ATTRS_o_ai
10730vec_vxor(vector bool char __a, vector unsigned char __b) {
10731 return (vector unsigned char)__a ^ __b;
10732}
10733
10734static __inline__ vector unsigned char __ATTRS_o_ai
10735vec_vxor(vector unsigned char __a, vector bool char __b) {
10736 return __a ^ (vector unsigned char)__b;
10737}
10738
10739static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,
10740 vector bool char __b) {
10741 return __a ^ __b;
10742}
10743
10744static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
10745 vector short __b) {
10746 return __a ^ __b;
10747}
10748
10749static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,
10750 vector short __b) {
10751 return (vector short)__a ^ __b;
10752}
10753
10754static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,
10755 vector bool short __b) {
10756 return __a ^ (vector short)__b;
10757}
10758
10759static __inline__ vector unsigned short __ATTRS_o_ai
10760vec_vxor(vector unsigned short __a, vector unsigned short __b) {
10761 return __a ^ __b;
10762}
10763
10764static __inline__ vector unsigned short __ATTRS_o_ai
10765vec_vxor(vector bool short __a, vector unsigned short __b) {
10766 return (vector unsigned short)__a ^ __b;
10767}
10768
10769static __inline__ vector unsigned short __ATTRS_o_ai
10770vec_vxor(vector unsigned short __a, vector bool short __b) {
10771 return __a ^ (vector unsigned short)__b;
10772}
10773
10774static __inline__ vector bool short __ATTRS_o_ai
10775vec_vxor(vector bool short __a, vector bool short __b) {
10776 return __a ^ __b;
10777}
10778
10779static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
10780 vector int __b) {
10781 return __a ^ __b;
10782}
10783
10784static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,
10785 vector int __b) {
10786 return (vector int)__a ^ __b;
10787}
10788
10789static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,
10790 vector bool int __b) {
10791 return __a ^ (vector int)__b;
10792}
10793
10794static __inline__ vector unsigned int __ATTRS_o_ai
10795vec_vxor(vector unsigned int __a, vector unsigned int __b) {
10796 return __a ^ __b;
10797}
10798
10799static __inline__ vector unsigned int __ATTRS_o_ai
10800vec_vxor(vector bool int __a, vector unsigned int __b) {
10801 return (vector unsigned int)__a ^ __b;
10802}
10803
10804static __inline__ vector unsigned int __ATTRS_o_ai
10805vec_vxor(vector unsigned int __a, vector bool int __b) {
10806 return __a ^ (vector unsigned int)__b;
10807}
10808
10809static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,
10810 vector bool int __b) {
10811 return __a ^ __b;
10812}
10813
10814static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
10815 vector float __b) {
10816 vector unsigned int __res =
10817 (vector unsigned int)__a ^ (vector unsigned int)__b;
10818 return (vector float)__res;
10819}
10820
10821static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,
10822 vector float __b) {
10823 vector unsigned int __res =
10824 (vector unsigned int)__a ^ (vector unsigned int)__b;
10825 return (vector float)__res;
10826}
10827
10828static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,
10829 vector bool int __b) {
10830 vector unsigned int __res =
10831 (vector unsigned int)__a ^ (vector unsigned int)__b;
10832 return (vector float)__res;
10833}
10834
10835#ifdef __VSX__
10836static __inline__ vector signed long long __ATTRS_o_ai
10837vec_vxor(vector signed long long __a, vector signed long long __b) {
10838 return __a ^ __b;
10839}
10840
10841static __inline__ vector signed long long __ATTRS_o_ai
10842vec_vxor(vector bool long long __a, vector signed long long __b) {
10843 return (vector signed long long)__a ^ __b;
10844}
10845
10846static __inline__ vector signed long long __ATTRS_o_ai
10847vec_vxor(vector signed long long __a, vector bool long long __b) {
10848 return __a ^ (vector signed long long)__b;
10849}
10850
10851static __inline__ vector unsigned long long __ATTRS_o_ai
10852vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {
10853 return __a ^ __b;
10854}
10855
10856static __inline__ vector unsigned long long __ATTRS_o_ai
10857vec_vxor(vector bool long long __a, vector unsigned long long __b) {
10858 return (vector unsigned long long)__a ^ __b;
10859}
10860
10861static __inline__ vector unsigned long long __ATTRS_o_ai
10862vec_vxor(vector unsigned long long __a, vector bool long long __b) {
10863 return __a ^ (vector unsigned long long)__b;
10864}
10865
10866static __inline__ vector bool long long __ATTRS_o_ai
10867vec_vxor(vector bool long long __a, vector bool long long __b) {
10868 return __a ^ __b;
10869}
10870#endif
10871
10872/* ------------------------ extensions for CBEA ----------------------------- */
10873
10874/* vec_extract */
10875
10876static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,
10877 int __b) {
10878 return __a[__b];
10879}
10880
10881static __inline__ unsigned char __ATTRS_o_ai
10882vec_extract(vector unsigned char __a, int __b) {
10883 return __a[__b];
10884}
10885
10886static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,
10887 int __b) {
10888 return __a[__b];
10889}
10890
10891static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,
10892 int __b) {
10893 return __a[__b];
10894}
10895
10896static __inline__ unsigned short __ATTRS_o_ai
10897vec_extract(vector unsigned short __a, int __b) {
10898 return __a[__b];
10899}
10900
10901static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,
10902 int __b) {
10903 return __a[__b];
10904}
10905
10906static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,
10907 int __b) {
10908 return __a[__b];
10909}
10910
10911static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,
10912 int __b) {
10913 return __a[__b];
10914}
10915
10916static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,
10917 int __b) {
10918 return __a[__b];
10919}
10920
10921#ifdef __VSX__
10922static __inline__ signed long long __ATTRS_o_ai
10923vec_extract(vector signed long long __a, int __b) {
10924 return __a[__b];
10925}
10926
10927static __inline__ unsigned long long __ATTRS_o_ai
10928vec_extract(vector unsigned long long __a, int __b) {
10929 return __a[__b];
10930}
10931
10932static __inline__ unsigned long long __ATTRS_o_ai
10933vec_extract(vector bool long long __a, int __b) {
10934 return __a[__b];
10935}
10936
10937static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {
10938 return __a[__b];
10939}
10940#endif
10941
10942static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {
10943 return __a[__b];
10944}
10945
10946/* vec_insert */
10947
10948static __inline__ vector signed char __ATTRS_o_ai
10949vec_insert(signed char __a, vector signed char __b, int __c) {
10950 __b[__c] = __a;
10951 return __b;
10952}
10953
10954static __inline__ vector unsigned char __ATTRS_o_ai
10955vec_insert(unsigned char __a, vector unsigned char __b, int __c) {
10956 __b[__c] = __a;
10957 return __b;
10958}
10959
10960static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,
10961 vector bool char __b,
10962 int __c) {
10963 __b[__c] = __a;
10964 return __b;
10965}
10966
10967static __inline__ vector signed short __ATTRS_o_ai
10968vec_insert(signed short __a, vector signed short __b, int __c) {
10969 __b[__c] = __a;
10970 return __b;
10971}
10972
10973static __inline__ vector unsigned short __ATTRS_o_ai
10974vec_insert(unsigned short __a, vector unsigned short __b, int __c) {
10975 __b[__c] = __a;
10976 return __b;
10977}
10978
10979static __inline__ vector bool short __ATTRS_o_ai
10980vec_insert(unsigned short __a, vector bool short __b, int __c) {
10981 __b[__c] = __a;
10982 return __b;
10983}
10984
10985static __inline__ vector signed int __ATTRS_o_ai
10986vec_insert(signed int __a, vector signed int __b, int __c) {
10987 __b[__c] = __a;
10988 return __b;
10989}
10990
10991static __inline__ vector unsigned int __ATTRS_o_ai
10992vec_insert(unsigned int __a, vector unsigned int __b, int __c) {
10993 __b[__c] = __a;
10994 return __b;
10995}
10996
10997static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,
10998 vector bool int __b,
10999 int __c) {
11000 __b[__c] = __a;
11001 return __b;
11002}
11003
11004#ifdef __VSX__
11005static __inline__ vector signed long long __ATTRS_o_ai
11006vec_insert(signed long long __a, vector signed long long __b, int __c) {
11007 __b[__c] = __a;
11008 return __b;
11009}
11010
11011static __inline__ vector unsigned long long __ATTRS_o_ai
11012vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {
11013 __b[__c] = __a;
11014 return __b;
11015}
11016
11017static __inline__ vector bool long long __ATTRS_o_ai
11018vec_insert(unsigned long long __a, vector bool long long __b, int __c) {
11019 __b[__c] = __a;
11020 return __b;
11021}
11022static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,
11023 vector double __b,
11024 int __c) {
11025 __b[__c] = __a;
11026 return __b;
11027}
11028#endif
11029
11030static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,
11031 vector float __b,
11032 int __c) {
11033 __b[__c] = __a;
11034 return __b;
11035}
11036
11037/* vec_lvlx */
11038
11039static __inline__ vector signed char __ATTRS_o_ai
11040vec_lvlx(int __a, const signed char *__b) {
11041 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
11042 vec_lvsl(__a, __b));
11043}
11044
11045static __inline__ vector signed char __ATTRS_o_ai
11046vec_lvlx(int __a, const vector signed char *__b) {
11047 return vec_perm(vec_ld(__a, __b), (vector signed char)(0),
11048 vec_lvsl(__a, (unsigned char *)__b));
11049}
11050
11051static __inline__ vector unsigned char __ATTRS_o_ai
11052vec_lvlx(int __a, const unsigned char *__b) {
11053 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
11054 vec_lvsl(__a, __b));
11055}
11056
11057static __inline__ vector unsigned char __ATTRS_o_ai
11058vec_lvlx(int __a, const vector unsigned char *__b) {
11059 return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),
11060 vec_lvsl(__a, (unsigned char *)__b));
11061}
11062
11063static __inline__ vector bool char __ATTRS_o_ai
11064vec_lvlx(int __a, const vector bool char *__b) {
11065 return vec_perm(vec_ld(__a, __b), (vector bool char)(0),
11066 vec_lvsl(__a, (unsigned char *)__b));
11067}
11068
11069static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
11070 const short *__b) {
11071 return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
11072}
11073
11074static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,
11075 const vector short *__b) {
11076 return vec_perm(vec_ld(__a, __b), (vector short)(0),
11077 vec_lvsl(__a, (unsigned char *)__b));
11078}
11079
11080static __inline__ vector unsigned short __ATTRS_o_ai
11081vec_lvlx(int __a, const unsigned short *__b) {
11082 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
11083 vec_lvsl(__a, __b));
11084}
11085
11086static __inline__ vector unsigned short __ATTRS_o_ai
11087vec_lvlx(int __a, const vector unsigned short *__b) {
11088 return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),
11089 vec_lvsl(__a, (unsigned char *)__b));
11090}
11091
11092static __inline__ vector bool short __ATTRS_o_ai
11093vec_lvlx(int __a, const vector bool short *__b) {
11094 return vec_perm(vec_ld(__a, __b), (vector bool short)(0),
11095 vec_lvsl(__a, (unsigned char *)__b));
11096}
11097
11098static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,
11099 const vector pixel *__b) {
11100 return vec_perm(vec_ld(__a, __b), (vector pixel)(0),
11101 vec_lvsl(__a, (unsigned char *)__b));
11102}
11103
11104static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {
11105 return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
11106}
11107
11108static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,
11109 const vector int *__b) {
11110 return vec_perm(vec_ld(__a, __b), (vector int)(0),
11111 vec_lvsl(__a, (unsigned char *)__b));
11112}
11113
11114static __inline__ vector unsigned int __ATTRS_o_ai
11115vec_lvlx(int __a, const unsigned int *__b) {
11116 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
11117 vec_lvsl(__a, __b));
11118}
11119
11120static __inline__ vector unsigned int __ATTRS_o_ai
11121vec_lvlx(int __a, const vector unsigned int *__b) {
11122 return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),
11123 vec_lvsl(__a, (unsigned char *)__b));
11124}
11125
11126static __inline__ vector bool int __ATTRS_o_ai
11127vec_lvlx(int __a, const vector bool int *__b) {
11128 return vec_perm(vec_ld(__a, __b), (vector bool int)(0),
11129 vec_lvsl(__a, (unsigned char *)__b));
11130}
11131
11132static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
11133 const float *__b) {
11134 return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
11135}
11136
11137static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,
11138 const vector float *__b) {
11139 return vec_perm(vec_ld(__a, __b), (vector float)(0),
11140 vec_lvsl(__a, (unsigned char *)__b));
11141}
11142
11143/* vec_lvlxl */
11144
11145static __inline__ vector signed char __ATTRS_o_ai
11146vec_lvlxl(int __a, const signed char *__b) {
11147 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
11148 vec_lvsl(__a, __b));
11149}
11150
11151static __inline__ vector signed char __ATTRS_o_ai
11152vec_lvlxl(int __a, const vector signed char *__b) {
11153 return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),
11154 vec_lvsl(__a, (unsigned char *)__b));
11155}
11156
11157static __inline__ vector unsigned char __ATTRS_o_ai
11158vec_lvlxl(int __a, const unsigned char *__b) {
11159 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
11160 vec_lvsl(__a, __b));
11161}
11162
11163static __inline__ vector unsigned char __ATTRS_o_ai
11164vec_lvlxl(int __a, const vector unsigned char *__b) {
11165 return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),
11166 vec_lvsl(__a, (unsigned char *)__b));
11167}
11168
11169static __inline__ vector bool char __ATTRS_o_ai
11170vec_lvlxl(int __a, const vector bool char *__b) {
11171 return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),
11172 vec_lvsl(__a, (unsigned char *)__b));
11173}
11174
11175static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
11176 const short *__b) {
11177 return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));
11178}
11179
11180static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,
11181 const vector short *__b) {
11182 return vec_perm(vec_ldl(__a, __b), (vector short)(0),
11183 vec_lvsl(__a, (unsigned char *)__b));
11184}
11185
11186static __inline__ vector unsigned short __ATTRS_o_ai
11187vec_lvlxl(int __a, const unsigned short *__b) {
11188 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
11189 vec_lvsl(__a, __b));
11190}
11191
11192static __inline__ vector unsigned short __ATTRS_o_ai
11193vec_lvlxl(int __a, const vector unsigned short *__b) {
11194 return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),
11195 vec_lvsl(__a, (unsigned char *)__b));
11196}
11197
11198static __inline__ vector bool short __ATTRS_o_ai
11199vec_lvlxl(int __a, const vector bool short *__b) {
11200 return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),
11201 vec_lvsl(__a, (unsigned char *)__b));
11202}
11203
11204static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,
11205 const vector pixel *__b) {
11206 return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),
11207 vec_lvsl(__a, (unsigned char *)__b));
11208}
11209
11210static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {
11211 return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));
11212}
11213
11214static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,
11215 const vector int *__b) {
11216 return vec_perm(vec_ldl(__a, __b), (vector int)(0),
11217 vec_lvsl(__a, (unsigned char *)__b));
11218}
11219
11220static __inline__ vector unsigned int __ATTRS_o_ai
11221vec_lvlxl(int __a, const unsigned int *__b) {
11222 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
11223 vec_lvsl(__a, __b));
11224}
11225
11226static __inline__ vector unsigned int __ATTRS_o_ai
11227vec_lvlxl(int __a, const vector unsigned int *__b) {
11228 return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),
11229 vec_lvsl(__a, (unsigned char *)__b));
11230}
11231
11232static __inline__ vector bool int __ATTRS_o_ai
11233vec_lvlxl(int __a, const vector bool int *__b) {
11234 return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),
11235 vec_lvsl(__a, (unsigned char *)__b));
11236}
11237
11238static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
11239 const float *__b) {
11240 return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));
11241}
11242
11243static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,
11244 vector float *__b) {
11245 return vec_perm(vec_ldl(__a, __b), (vector float)(0),
11246 vec_lvsl(__a, (unsigned char *)__b));
11247}
11248
11249/* vec_lvrx */
11250
11251static __inline__ vector signed char __ATTRS_o_ai
11252vec_lvrx(int __a, const signed char *__b) {
11253 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
11254 vec_lvsl(__a, __b));
11255}
11256
11257static __inline__ vector signed char __ATTRS_o_ai
11258vec_lvrx(int __a, const vector signed char *__b) {
11259 return vec_perm((vector signed char)(0), vec_ld(__a, __b),
11260 vec_lvsl(__a, (unsigned char *)__b));
11261}
11262
11263static __inline__ vector unsigned char __ATTRS_o_ai
11264vec_lvrx(int __a, const unsigned char *__b) {
11265 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
11266 vec_lvsl(__a, __b));
11267}
11268
11269static __inline__ vector unsigned char __ATTRS_o_ai
11270vec_lvrx(int __a, const vector unsigned char *__b) {
11271 return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),
11272 vec_lvsl(__a, (unsigned char *)__b));
11273}
11274
11275static __inline__ vector bool char __ATTRS_o_ai
11276vec_lvrx(int __a, const vector bool char *__b) {
11277 return vec_perm((vector bool char)(0), vec_ld(__a, __b),
11278 vec_lvsl(__a, (unsigned char *)__b));
11279}
11280
11281static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
11282 const short *__b) {
11283 return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
11284}
11285
11286static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,
11287 const vector short *__b) {
11288 return vec_perm((vector short)(0), vec_ld(__a, __b),
11289 vec_lvsl(__a, (unsigned char *)__b));
11290}
11291
11292static __inline__ vector unsigned short __ATTRS_o_ai
11293vec_lvrx(int __a, const unsigned short *__b) {
11294 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
11295 vec_lvsl(__a, __b));
11296}
11297
11298static __inline__ vector unsigned short __ATTRS_o_ai
11299vec_lvrx(int __a, const vector unsigned short *__b) {
11300 return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),
11301 vec_lvsl(__a, (unsigned char *)__b));
11302}
11303
11304static __inline__ vector bool short __ATTRS_o_ai
11305vec_lvrx(int __a, const vector bool short *__b) {
11306 return vec_perm((vector bool short)(0), vec_ld(__a, __b),
11307 vec_lvsl(__a, (unsigned char *)__b));
11308}
11309
11310static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,
11311 const vector pixel *__b) {
11312 return vec_perm((vector pixel)(0), vec_ld(__a, __b),
11313 vec_lvsl(__a, (unsigned char *)__b));
11314}
11315
11316static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {
11317 return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
11318}
11319
11320static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,
11321 const vector int *__b) {
11322 return vec_perm((vector int)(0), vec_ld(__a, __b),
11323 vec_lvsl(__a, (unsigned char *)__b));
11324}
11325
11326static __inline__ vector unsigned int __ATTRS_o_ai
11327vec_lvrx(int __a, const unsigned int *__b) {
11328 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
11329 vec_lvsl(__a, __b));
11330}
11331
11332static __inline__ vector unsigned int __ATTRS_o_ai
11333vec_lvrx(int __a, const vector unsigned int *__b) {
11334 return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),
11335 vec_lvsl(__a, (unsigned char *)__b));
11336}
11337
11338static __inline__ vector bool int __ATTRS_o_ai
11339vec_lvrx(int __a, const vector bool int *__b) {
11340 return vec_perm((vector bool int)(0), vec_ld(__a, __b),
11341 vec_lvsl(__a, (unsigned char *)__b));
11342}
11343
11344static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
11345 const float *__b) {
11346 return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));
11347}
11348
11349static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,
11350 const vector float *__b) {
11351 return vec_perm((vector float)(0), vec_ld(__a, __b),
11352 vec_lvsl(__a, (unsigned char *)__b));
11353}
11354
11355/* vec_lvrxl */
11356
11357static __inline__ vector signed char __ATTRS_o_ai
11358vec_lvrxl(int __a, const signed char *__b) {
11359 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
11360 vec_lvsl(__a, __b));
11361}
11362
11363static __inline__ vector signed char __ATTRS_o_ai
11364vec_lvrxl(int __a, const vector signed char *__b) {
11365 return vec_perm((vector signed char)(0), vec_ldl(__a, __b),
11366 vec_lvsl(__a, (unsigned char *)__b));
11367}
11368
11369static __inline__ vector unsigned char __ATTRS_o_ai
11370vec_lvrxl(int __a, const unsigned char *__b) {
11371 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
11372 vec_lvsl(__a, __b));
11373}
11374
11375static __inline__ vector unsigned char __ATTRS_o_ai
11376vec_lvrxl(int __a, const vector unsigned char *__b) {
11377 return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),
11378 vec_lvsl(__a, (unsigned char *)__b));
11379}
11380
11381static __inline__ vector bool char __ATTRS_o_ai
11382vec_lvrxl(int __a, const vector bool char *__b) {
11383 return vec_perm((vector bool char)(0), vec_ldl(__a, __b),
11384 vec_lvsl(__a, (unsigned char *)__b));
11385}
11386
11387static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
11388 const short *__b) {
11389 return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
11390}
11391
11392static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,
11393 const vector short *__b) {
11394 return vec_perm((vector short)(0), vec_ldl(__a, __b),
11395 vec_lvsl(__a, (unsigned char *)__b));
11396}
11397
11398static __inline__ vector unsigned short __ATTRS_o_ai
11399vec_lvrxl(int __a, const unsigned short *__b) {
11400 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
11401 vec_lvsl(__a, __b));
11402}
11403
11404static __inline__ vector unsigned short __ATTRS_o_ai
11405vec_lvrxl(int __a, const vector unsigned short *__b) {
11406 return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),
11407 vec_lvsl(__a, (unsigned char *)__b));
11408}
11409
11410static __inline__ vector bool short __ATTRS_o_ai
11411vec_lvrxl(int __a, const vector bool short *__b) {
11412 return vec_perm((vector bool short)(0), vec_ldl(__a, __b),
11413 vec_lvsl(__a, (unsigned char *)__b));
11414}
11415
11416static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,
11417 const vector pixel *__b) {
11418 return vec_perm((vector pixel)(0), vec_ldl(__a, __b),
11419 vec_lvsl(__a, (unsigned char *)__b));
11420}
11421
11422static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {
11423 return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
11424}
11425
11426static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,
11427 const vector int *__b) {
11428 return vec_perm((vector int)(0), vec_ldl(__a, __b),
11429 vec_lvsl(__a, (unsigned char *)__b));
11430}
11431
11432static __inline__ vector unsigned int __ATTRS_o_ai
11433vec_lvrxl(int __a, const unsigned int *__b) {
11434 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
11435 vec_lvsl(__a, __b));
11436}
11437
11438static __inline__ vector unsigned int __ATTRS_o_ai
11439vec_lvrxl(int __a, const vector unsigned int *__b) {
11440 return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),
11441 vec_lvsl(__a, (unsigned char *)__b));
11442}
11443
11444static __inline__ vector bool int __ATTRS_o_ai
11445vec_lvrxl(int __a, const vector bool int *__b) {
11446 return vec_perm((vector bool int)(0), vec_ldl(__a, __b),
11447 vec_lvsl(__a, (unsigned char *)__b));
11448}
11449
11450static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
11451 const float *__b) {
11452 return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));
11453}
11454
11455static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,
11456 const vector float *__b) {
11457 return vec_perm((vector float)(0), vec_ldl(__a, __b),
11458 vec_lvsl(__a, (unsigned char *)__b));
11459}
11460
11461/* vec_stvlx */
11462
11463static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
11464 signed char *__c) {
11465 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11466 __c);
11467}
11468
11469static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,
11470 vector signed char *__c) {
11471 return vec_st(
11472 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11473 __b, __c);
11474}
11475
11476static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
11477 unsigned char *__c) {
11478 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11479 __c);
11480}
11481
11482static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,
11483 vector unsigned char *__c) {
11484 return vec_st(
11485 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11486 __b, __c);
11487}
11488
11489static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,
11490 vector bool char *__c) {
11491 return vec_st(
11492 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11493 __b, __c);
11494}
11495
11496static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
11497 short *__c) {
11498 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11499 __c);
11500}
11501
11502static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,
11503 vector short *__c) {
11504 return vec_st(
11505 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11506 __b, __c);
11507}
11508
11509static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
11510 int __b, unsigned short *__c) {
11511 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11512 __c);
11513}
11514
11515static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,
11516 int __b,
11517 vector unsigned short *__c) {
11518 return vec_st(
11519 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11520 __b, __c);
11521}
11522
11523static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,
11524 vector bool short *__c) {
11525 return vec_st(
11526 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11527 __b, __c);
11528}
11529
11530static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,
11531 vector pixel *__c) {
11532 return vec_st(
11533 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11534 __b, __c);
11535}
11536
11537static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
11538 int *__c) {
11539 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11540 __c);
11541}
11542
11543static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,
11544 vector int *__c) {
11545 return vec_st(
11546 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11547 __b, __c);
11548}
11549
11550static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
11551 unsigned int *__c) {
11552 return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11553 __c);
11554}
11555
11556static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,
11557 vector unsigned int *__c) {
11558 return vec_st(
11559 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11560 __b, __c);
11561}
11562
11563static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,
11564 vector bool int *__c) {
11565 return vec_st(
11566 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11567 __b, __c);
11568}
11569
11570static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,
11571 vector float *__c) {
11572 return vec_st(
11573 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11574 __b, __c);
11575}
11576
11577/* vec_stvlxl */
11578
11579static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
11580 signed char *__c) {
11581 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11582 __c);
11583}
11584
11585static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,
11586 vector signed char *__c) {
11587 return vec_stl(
11588 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11589 __b, __c);
11590}
11591
11592static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
11593 int __b, unsigned char *__c) {
11594 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11595 __c);
11596}
11597
11598static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,
11599 int __b,
11600 vector unsigned char *__c) {
11601 return vec_stl(
11602 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11603 __b, __c);
11604}
11605
11606static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,
11607 vector bool char *__c) {
11608 return vec_stl(
11609 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11610 __b, __c);
11611}
11612
11613static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
11614 short *__c) {
11615 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11616 __c);
11617}
11618
11619static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,
11620 vector short *__c) {
11621 return vec_stl(
11622 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11623 __b, __c);
11624}
11625
11626static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
11627 int __b, unsigned short *__c) {
11628 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11629 __c);
11630}
11631
11632static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,
11633 int __b,
11634 vector unsigned short *__c) {
11635 return vec_stl(
11636 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11637 __b, __c);
11638}
11639
11640static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,
11641 vector bool short *__c) {
11642 return vec_stl(
11643 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11644 __b, __c);
11645}
11646
11647static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,
11648 vector pixel *__c) {
11649 return vec_stl(
11650 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11651 __b, __c);
11652}
11653
11654static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
11655 int *__c) {
11656 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11657 __c);
11658}
11659
11660static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,
11661 vector int *__c) {
11662 return vec_stl(
11663 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11664 __b, __c);
11665}
11666
11667static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
11668 unsigned int *__c) {
11669 return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,
11670 __c);
11671}
11672
11673static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,
11674 vector unsigned int *__c) {
11675 return vec_stl(
11676 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11677 __b, __c);
11678}
11679
11680static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,
11681 vector bool int *__c) {
11682 return vec_stl(
11683 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11684 __b, __c);
11685}
11686
11687static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,
11688 vector float *__c) {
11689 return vec_stl(
11690 vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),
11691 __b, __c);
11692}
11693
11694/* vec_stvrx */
11695
11696static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
11697 signed char *__c) {
11698 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11699 __c);
11700}
11701
11702static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,
11703 vector signed char *__c) {
11704 return vec_st(
11705 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11706 __b, __c);
11707}
11708
11709static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
11710 unsigned char *__c) {
11711 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11712 __c);
11713}
11714
11715static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,
11716 vector unsigned char *__c) {
11717 return vec_st(
11718 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11719 __b, __c);
11720}
11721
11722static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,
11723 vector bool char *__c) {
11724 return vec_st(
11725 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11726 __b, __c);
11727}
11728
11729static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
11730 short *__c) {
11731 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11732 __c);
11733}
11734
11735static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,
11736 vector short *__c) {
11737 return vec_st(
11738 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11739 __b, __c);
11740}
11741
11742static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
11743 int __b, unsigned short *__c) {
11744 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11745 __c);
11746}
11747
11748static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,
11749 int __b,
11750 vector unsigned short *__c) {
11751 return vec_st(
11752 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11753 __b, __c);
11754}
11755
11756static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,
11757 vector bool short *__c) {
11758 return vec_st(
11759 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11760 __b, __c);
11761}
11762
11763static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,
11764 vector pixel *__c) {
11765 return vec_st(
11766 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11767 __b, __c);
11768}
11769
11770static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
11771 int *__c) {
11772 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11773 __c);
11774}
11775
11776static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,
11777 vector int *__c) {
11778 return vec_st(
11779 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11780 __b, __c);
11781}
11782
11783static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
11784 unsigned int *__c) {
11785 return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11786 __c);
11787}
11788
11789static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,
11790 vector unsigned int *__c) {
11791 return vec_st(
11792 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11793 __b, __c);
11794}
11795
11796static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,
11797 vector bool int *__c) {
11798 return vec_st(
11799 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11800 __b, __c);
11801}
11802
11803static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,
11804 vector float *__c) {
11805 return vec_st(
11806 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11807 __b, __c);
11808}
11809
11810/* vec_stvrxl */
11811
11812static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
11813 signed char *__c) {
11814 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11815 __c);
11816}
11817
11818static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,
11819 vector signed char *__c) {
11820 return vec_stl(
11821 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11822 __b, __c);
11823}
11824
11825static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
11826 int __b, unsigned char *__c) {
11827 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11828 __c);
11829}
11830
11831static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,
11832 int __b,
11833 vector unsigned char *__c) {
11834 return vec_stl(
11835 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11836 __b, __c);
11837}
11838
11839static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,
11840 vector bool char *__c) {
11841 return vec_stl(
11842 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11843 __b, __c);
11844}
11845
11846static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
11847 short *__c) {
11848 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11849 __c);
11850}
11851
11852static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,
11853 vector short *__c) {
11854 return vec_stl(
11855 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11856 __b, __c);
11857}
11858
11859static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
11860 int __b, unsigned short *__c) {
11861 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11862 __c);
11863}
11864
11865static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,
11866 int __b,
11867 vector unsigned short *__c) {
11868 return vec_stl(
11869 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11870 __b, __c);
11871}
11872
11873static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,
11874 vector bool short *__c) {
11875 return vec_stl(
11876 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11877 __b, __c);
11878}
11879
11880static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,
11881 vector pixel *__c) {
11882 return vec_stl(
11883 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11884 __b, __c);
11885}
11886
11887static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
11888 int *__c) {
11889 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11890 __c);
11891}
11892
11893static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,
11894 vector int *__c) {
11895 return vec_stl(
11896 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11897 __b, __c);
11898}
11899
11900static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
11901 unsigned int *__c) {
11902 return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,
11903 __c);
11904}
11905
11906static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,
11907 vector unsigned int *__c) {
11908 return vec_stl(
11909 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11910 __b, __c);
11911}
11912
11913static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,
11914 vector bool int *__c) {
11915 return vec_stl(
11916 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11917 __b, __c);
11918}
11919
11920static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
11921 vector float *__c) {
11922 return vec_stl(
11923 vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),
11924 __b, __c);
11925}
11926
11927/* vec_promote */
11928
11929static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
11930 int __b) {
11931 vector signed char __res = (vector signed char)(0);
11932 __res[__b] = __a;
11933 return __res;
11934}
11935
11936static __inline__ vector unsigned char __ATTRS_o_ai
11937vec_promote(unsigned char __a, int __b) {
11938 vector unsigned char __res = (vector unsigned char)(0);
11939 __res[__b] = __a;
11940 return __res;
11941}
11942
11943static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
11944 vector short __res = (vector short)(0);
11945 __res[__b] = __a;
11946 return __res;
11947}
11948
11949static __inline__ vector unsigned short __ATTRS_o_ai
11950vec_promote(unsigned short __a, int __b) {
11951 vector unsigned short __res = (vector unsigned short)(0);
11952 __res[__b] = __a;
11953 return __res;
11954}
11955
11956static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
11957 vector int __res = (vector int)(0);
11958 __res[__b] = __a;
11959 return __res;
11960}
11961
11962static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
11963 int __b) {
11964 vector unsigned int __res = (vector unsigned int)(0);
11965 __res[__b] = __a;
11966 return __res;
11967}
11968
11969static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
11970 vector float __res = (vector float)(0);
11971 __res[__b] = __a;
11972 return __res;
11973}
11974
11975/* vec_splats */
11976
11977static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {
11978 return (vector signed char)(__a);
11979}
11980
11981static __inline__ vector unsigned char __ATTRS_o_ai
11982vec_splats(unsigned char __a) {
11983 return (vector unsigned char)(__a);
11984}
11985
11986static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {
11987 return (vector short)(__a);
11988}
11989
11990static __inline__ vector unsigned short __ATTRS_o_ai
11991vec_splats(unsigned short __a) {
11992 return (vector unsigned short)(__a);
11993}
11994
11995static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {
11996 return (vector int)(__a);
11997}
11998
11999static __inline__ vector unsigned int __ATTRS_o_ai
12000vec_splats(unsigned int __a) {
12001 return (vector unsigned int)(__a);
12002}
12003
12004#ifdef __VSX__
12005static __inline__ vector signed long long __ATTRS_o_ai
12006vec_splats(signed long long __a) {
12007 return (vector signed long long)(__a);
12008}
12009
12010static __inline__ vector unsigned long long __ATTRS_o_ai
12011vec_splats(unsigned long long __a) {
12012 return (vector unsigned long long)(__a);
12013}
12014
12015#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
12016static __inline__ vector signed __int128 __ATTRS_o_ai
12017vec_splats(signed __int128 __a) {
12018 return (vector signed __int128)(__a);
12019}
12020
12021static __inline__ vector unsigned __int128 __ATTRS_o_ai
12022vec_splats(unsigned __int128 __a) {
12023 return (vector unsigned __int128)(__a);
12024}
12025
12026#endif
12027
12028static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {
12029 return (vector double)(__a);
12030}
12031#endif
12032
12033static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {
12034 return (vector float)(__a);
12035}
12036
12037/* ----------------------------- predicates --------------------------------- */
12038
12039/* vec_all_eq */
12040
12041static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
12042 vector signed char __b) {
12043 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12044 (vector char)__b);
12045}
12046
12047static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,
12048 vector bool char __b) {
12049 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12050 (vector char)__b);
12051}
12052
12053static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
12054 vector unsigned char __b) {
12055 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12056 (vector char)__b);
12057}
12058
12059static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,
12060 vector bool char __b) {
12061 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12062 (vector char)__b);
12063}
12064
12065static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
12066 vector signed char __b) {
12067 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12068 (vector char)__b);
12069}
12070
12071static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
12072 vector unsigned char __b) {
12073 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12074 (vector char)__b);
12075}
12076
12077static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,
12078 vector bool char __b) {
12079 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,
12080 (vector char)__b);
12081}
12082
12083static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
12084 vector short __b) {
12085 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
12086}
12087
12088static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,
12089 vector bool short __b) {
12090 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
12091}
12092
12093static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
12094 vector unsigned short __b) {
12095 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12096 (vector short)__b);
12097}
12098
12099static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,
12100 vector bool short __b) {
12101 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12102 (vector short)__b);
12103}
12104
12105static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
12106 vector short __b) {
12107 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12108 (vector short)__b);
12109}
12110
12111static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
12112 vector unsigned short __b) {
12113 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12114 (vector short)__b);
12115}
12116
12117static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,
12118 vector bool short __b) {
12119 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12120 (vector short)__b);
12121}
12122
12123static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,
12124 vector pixel __b) {
12125 return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,
12126 (vector short)__b);
12127}
12128
12129static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {
12130 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
12131}
12132
12133static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,
12134 vector bool int __b) {
12135 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
12136}
12137
12138static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
12139 vector unsigned int __b) {
12140 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12141 (vector int)__b);
12142}
12143
12144static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,
12145 vector bool int __b) {
12146 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12147 (vector int)__b);
12148}
12149
12150static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
12151 vector int __b) {
12152 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12153 (vector int)__b);
12154}
12155
12156static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
12157 vector unsigned int __b) {
12158 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12159 (vector int)__b);
12160}
12161
12162static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,
12163 vector bool int __b) {
12164 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,
12165 (vector int)__b);
12166}
12167
12168#ifdef __POWER8_VECTOR__
12169static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,
12170 vector signed long long __b) {
12171 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);
12172}
12173
12174static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,
12175 vector bool long long __b) {
12176 return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);
12177}
12178
12179static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
12180 vector unsigned long long __b) {
12181 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12182 (vector long long)__b);
12183}
12184
12185static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,
12186 vector bool long long __b) {
12187 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12188 (vector long long)__b);
12189}
12190
12191static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
12192 vector long long __b) {
12193 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12194 (vector long long)__b);
12195}
12196
12197static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
12198 vector unsigned long long __b) {
12199 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12200 (vector long long)__b);
12201}
12202
12203static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,
12204 vector bool long long __b) {
12205 return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,
12206 (vector long long)__b);
12207}
12208#endif
12209
12210static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,
12211 vector float __b) {
12212#ifdef __VSX__
12213 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);
12214#else
12215 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
12216#endif
12217}
12218
12219#ifdef __VSX__
12220static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,
12221 vector double __b) {
12222 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);
12223}
12224#endif
12225
12226/* vec_all_ge */
12227
12228static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
12229 vector signed char __b) {
12230 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
12231}
12232
12233static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,
12234 vector bool char __b) {
12235 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
12236}
12237
12238static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
12239 vector unsigned char __b) {
12240 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
12241}
12242
12243static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,
12244 vector bool char __b) {
12245 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
12246}
12247
12248static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
12249 vector signed char __b) {
12250 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
12251 (vector unsigned char)__a);
12252}
12253
12254static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
12255 vector unsigned char __b) {
12256 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
12257}
12258
12259static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,
12260 vector bool char __b) {
12261 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,
12262 (vector unsigned char)__a);
12263}
12264
12265static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
12266 vector short __b) {
12267 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
12268}
12269
12270static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,
12271 vector bool short __b) {
12272 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
12273}
12274
12275static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
12276 vector unsigned short __b) {
12277 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
12278}
12279
12280static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,
12281 vector bool short __b) {
12282 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
12283 __a);
12284}
12285
12286static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
12287 vector short __b) {
12288 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
12289 (vector unsigned short)__a);
12290}
12291
12292static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
12293 vector unsigned short __b) {
12294 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,
12295 (vector unsigned short)__a);
12296}
12297
12298static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,
12299 vector bool short __b) {
12300 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,
12301 (vector unsigned short)__a);
12302}
12303
12304static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {
12305 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
12306}
12307
12308static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,
12309 vector bool int __b) {
12310 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
12311}
12312
12313static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
12314 vector unsigned int __b) {
12315 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
12316}
12317
12318static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,
12319 vector bool int __b) {
12320 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
12321}
12322
12323static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
12324 vector int __b) {
12325 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
12326 (vector unsigned int)__a);
12327}
12328
12329static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
12330 vector unsigned int __b) {
12331 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
12332}
12333
12334static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,
12335 vector bool int __b) {
12336 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,
12337 (vector unsigned int)__a);
12338}
12339
12340#ifdef __POWER8_VECTOR__
12341static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
12342 vector signed long long __b) {
12343 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);
12344}
12345static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,
12346 vector bool long long __b) {
12347 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,
12348 __a);
12349}
12350
12351static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
12352 vector unsigned long long __b) {
12353 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);
12354}
12355
12356static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,
12357 vector bool long long __b) {
12358 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
12359 __a);
12360}
12361
12362static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
12363 vector signed long long __b) {
12364 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
12365 (vector unsigned long long)__a);
12366}
12367
12368static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
12369 vector unsigned long long __b) {
12370 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,
12371 (vector unsigned long long)__a);
12372}
12373
12374static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,
12375 vector bool long long __b) {
12376 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,
12377 (vector unsigned long long)__a);
12378}
12379#endif
12380
12381static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,
12382 vector float __b) {
12383#ifdef __VSX__
12384 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);
12385#else
12386 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
12387#endif
12388}
12389
12390#ifdef __VSX__
12391static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,
12392 vector double __b) {
12393 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);
12394}
12395#endif
12396
12397/* vec_all_gt */
12398
12399static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
12400 vector signed char __b) {
12401 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
12402}
12403
12404static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,
12405 vector bool char __b) {
12406 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
12407}
12408
12409static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
12410 vector unsigned char __b) {
12411 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
12412}
12413
12414static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,
12415 vector bool char __b) {
12416 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
12417}
12418
12419static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
12420 vector signed char __b) {
12421 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
12422 (vector unsigned char)__b);
12423}
12424
12425static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
12426 vector unsigned char __b) {
12427 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
12428}
12429
12430static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,
12431 vector bool char __b) {
12432 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,
12433 (vector unsigned char)__b);
12434}
12435
12436static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
12437 vector short __b) {
12438 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
12439}
12440
12441static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,
12442 vector bool short __b) {
12443 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
12444}
12445
12446static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
12447 vector unsigned short __b) {
12448 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
12449}
12450
12451static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,
12452 vector bool short __b) {
12453 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,
12454 (vector unsigned short)__b);
12455}
12456
12457static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
12458 vector short __b) {
12459 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
12460 (vector unsigned short)__b);
12461}
12462
12463static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
12464 vector unsigned short __b) {
12465 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
12466 __b);
12467}
12468
12469static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,
12470 vector bool short __b) {
12471 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,
12472 (vector unsigned short)__b);
12473}
12474
12475static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {
12476 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
12477}
12478
12479static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,
12480 vector bool int __b) {
12481 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
12482}
12483
12484static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
12485 vector unsigned int __b) {
12486 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
12487}
12488
12489static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,
12490 vector bool int __b) {
12491 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
12492}
12493
12494static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
12495 vector int __b) {
12496 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
12497 (vector unsigned int)__b);
12498}
12499
12500static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
12501 vector unsigned int __b) {
12502 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
12503}
12504
12505static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,
12506 vector bool int __b) {
12507 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,
12508 (vector unsigned int)__b);
12509}
12510
12511#ifdef __POWER8_VECTOR__
12512static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
12513 vector signed long long __b) {
12514 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);
12515}
12516static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,
12517 vector bool long long __b) {
12518 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,
12519 (vector signed long long)__b);
12520}
12521
12522static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
12523 vector unsigned long long __b) {
12524 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);
12525}
12526
12527static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,
12528 vector bool long long __b) {
12529 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,
12530 (vector unsigned long long)__b);
12531}
12532
12533static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
12534 vector signed long long __b) {
12535 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
12536 (vector unsigned long long)__b);
12537}
12538
12539static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
12540 vector unsigned long long __b) {
12541 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
12542 __b);
12543}
12544
12545static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,
12546 vector bool long long __b) {
12547 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,
12548 (vector unsigned long long)__b);
12549}
12550#endif
12551
12552static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,
12553 vector float __b) {
12554#ifdef __VSX__
12555 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);
12556#else
12557 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
12558#endif
12559}
12560
12561#ifdef __VSX__
12562static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,
12563 vector double __b) {
12564 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);
12565}
12566#endif
12567
12568/* vec_all_in */
12569
12570static __inline__ int __attribute__((__always_inline__))
12571vec_all_in(vector float __a, vector float __b) {
12572 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
12573}
12574
12575/* vec_all_le */
12576
12577static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
12578 vector signed char __b) {
12579 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
12580}
12581
12582static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,
12583 vector bool char __b) {
12584 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
12585}
12586
12587static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
12588 vector unsigned char __b) {
12589 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
12590}
12591
12592static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,
12593 vector bool char __b) {
12594 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
12595}
12596
12597static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
12598 vector signed char __b) {
12599 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
12600 (vector unsigned char)__b);
12601}
12602
12603static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
12604 vector unsigned char __b) {
12605 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
12606}
12607
12608static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,
12609 vector bool char __b) {
12610 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,
12611 (vector unsigned char)__b);
12612}
12613
12614static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
12615 vector short __b) {
12616 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
12617}
12618
12619static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,
12620 vector bool short __b) {
12621 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
12622}
12623
12624static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
12625 vector unsigned short __b) {
12626 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
12627}
12628
12629static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,
12630 vector bool short __b) {
12631 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,
12632 (vector unsigned short)__b);
12633}
12634
12635static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
12636 vector short __b) {
12637 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
12638 (vector unsigned short)__b);
12639}
12640
12641static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
12642 vector unsigned short __b) {
12643 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
12644 __b);
12645}
12646
12647static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,
12648 vector bool short __b) {
12649 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,
12650 (vector unsigned short)__b);
12651}
12652
12653static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {
12654 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
12655}
12656
12657static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,
12658 vector bool int __b) {
12659 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
12660}
12661
12662static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
12663 vector unsigned int __b) {
12664 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
12665}
12666
12667static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,
12668 vector bool int __b) {
12669 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
12670}
12671
12672static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
12673 vector int __b) {
12674 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
12675 (vector unsigned int)__b);
12676}
12677
12678static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
12679 vector unsigned int __b) {
12680 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
12681}
12682
12683static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,
12684 vector bool int __b) {
12685 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,
12686 (vector unsigned int)__b);
12687}
12688
12689#ifdef __POWER8_VECTOR__
12690static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
12691 vector signed long long __b) {
12692 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);
12693}
12694
12695static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
12696 vector unsigned long long __b) {
12697 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);
12698}
12699
12700static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,
12701 vector bool long long __b) {
12702 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,
12703 (vector signed long long)__b);
12704}
12705
12706static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,
12707 vector bool long long __b) {
12708 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,
12709 (vector unsigned long long)__b);
12710}
12711
12712static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
12713 vector signed long long __b) {
12714 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12715 (vector unsigned long long)__b);
12716}
12717
12718static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
12719 vector unsigned long long __b) {
12720 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12721 __b);
12722}
12723
12724static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,
12725 vector bool long long __b) {
12726 return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,
12727 (vector unsigned long long)__b);
12728}
12729#endif
12730
12731static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,
12732 vector float __b) {
12733#ifdef __VSX__
12734 return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);
12735#else
12736 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
12737#endif
12738}
12739
12740#ifdef __VSX__
12741static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,
12742 vector double __b) {
12743 return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);
12744}
12745#endif
12746
12747/* vec_all_lt */
12748
12749static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
12750 vector signed char __b) {
12751 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
12752}
12753
12754static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,
12755 vector bool char __b) {
12756 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
12757}
12758
12759static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
12760 vector unsigned char __b) {
12761 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
12762}
12763
12764static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,
12765 vector bool char __b) {
12766 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
12767}
12768
12769static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
12770 vector signed char __b) {
12771 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
12772 (vector unsigned char)__a);
12773}
12774
12775static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
12776 vector unsigned char __b) {
12777 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
12778}
12779
12780static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,
12781 vector bool char __b) {
12782 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,
12783 (vector unsigned char)__a);
12784}
12785
12786static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
12787 vector short __b) {
12788 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
12789}
12790
12791static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,
12792 vector bool short __b) {
12793 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
12794}
12795
12796static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
12797 vector unsigned short __b) {
12798 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
12799}
12800
12801static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,
12802 vector bool short __b) {
12803 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
12804 __a);
12805}
12806
12807static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
12808 vector short __b) {
12809 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
12810 (vector unsigned short)__a);
12811}
12812
12813static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
12814 vector unsigned short __b) {
12815 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,
12816 (vector unsigned short)__a);
12817}
12818
12819static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,
12820 vector bool short __b) {
12821 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,
12822 (vector unsigned short)__a);
12823}
12824
12825static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {
12826 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
12827}
12828
12829static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,
12830 vector bool int __b) {
12831 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
12832}
12833
12834static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
12835 vector unsigned int __b) {
12836 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
12837}
12838
12839static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,
12840 vector bool int __b) {
12841 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
12842}
12843
12844static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
12845 vector int __b) {
12846 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
12847 (vector unsigned int)__a);
12848}
12849
12850static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
12851 vector unsigned int __b) {
12852 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
12853}
12854
12855static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,
12856 vector bool int __b) {
12857 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,
12858 (vector unsigned int)__a);
12859}
12860
12861#ifdef __POWER8_VECTOR__
12862static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
12863 vector signed long long __b) {
12864 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);
12865}
12866
12867static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
12868 vector unsigned long long __b) {
12869 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);
12870}
12871
12872static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,
12873 vector bool long long __b) {
12874 return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,
12875 __a);
12876}
12877
12878static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,
12879 vector bool long long __b) {
12880 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12881 __a);
12882}
12883
12884static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
12885 vector signed long long __b) {
12886 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12887 (vector unsigned long long)__a);
12888}
12889
12890static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
12891 vector unsigned long long __b) {
12892 return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,
12893 (vector unsigned long long)__a);
12894}
12895
12896static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,
12897 vector bool long long __b) {
12898 return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,
12899 (vector unsigned long long)__a);
12900}
12901#endif
12902
12903static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,
12904 vector float __b) {
12905#ifdef __VSX__
12906 return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);
12907#else
12908 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
12909#endif
12910}
12911
12912#ifdef __VSX__
12913static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,
12914 vector double __b) {
12915 return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);
12916}
12917#endif
12918
12919/* vec_all_nan */
12920
12921static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {
12922#ifdef __VSX__
12923 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);
12924#else
12925 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
12926#endif
12927}
12928
12929#ifdef __VSX__
12930static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {
12931 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);
12932}
12933#endif
12934
12935/* vec_all_ne */
12936
12937static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
12938 vector signed char __b) {
12939 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12940 (vector char)__b);
12941}
12942
12943static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,
12944 vector bool char __b) {
12945 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12946 (vector char)__b);
12947}
12948
12949static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
12950 vector unsigned char __b) {
12951 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12952 (vector char)__b);
12953}
12954
12955static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,
12956 vector bool char __b) {
12957 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12958 (vector char)__b);
12959}
12960
12961static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
12962 vector signed char __b) {
12963 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12964 (vector char)__b);
12965}
12966
12967static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
12968 vector unsigned char __b) {
12969 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12970 (vector char)__b);
12971}
12972
12973static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,
12974 vector bool char __b) {
12975 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,
12976 (vector char)__b);
12977}
12978
12979static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
12980 vector short __b) {
12981 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
12982}
12983
12984static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,
12985 vector bool short __b) {
12986 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
12987}
12988
12989static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
12990 vector unsigned short __b) {
12991 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
12992 (vector short)__b);
12993}
12994
12995static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,
12996 vector bool short __b) {
12997 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
12998 (vector short)__b);
12999}
13000
13001static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
13002 vector short __b) {
13003 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13004 (vector short)__b);
13005}
13006
13007static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
13008 vector unsigned short __b) {
13009 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13010 (vector short)__b);
13011}
13012
13013static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,
13014 vector bool short __b) {
13015 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13016 (vector short)__b);
13017}
13018
13019static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,
13020 vector pixel __b) {
13021 return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,
13022 (vector short)__b);
13023}
13024
13025static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {
13026 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
13027}
13028
13029static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,
13030 vector bool int __b) {
13031 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
13032}
13033
13034static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
13035 vector unsigned int __b) {
13036 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13037 (vector int)__b);
13038}
13039
13040static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,
13041 vector bool int __b) {
13042 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13043 (vector int)__b);
13044}
13045
13046static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
13047 vector int __b) {
13048 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13049 (vector int)__b);
13050}
13051
13052static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
13053 vector unsigned int __b) {
13054 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13055 (vector int)__b);
13056}
13057
13058static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,
13059 vector bool int __b) {
13060 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,
13061 (vector int)__b);
13062}
13063
13064#ifdef __POWER8_VECTOR__
13065static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
13066 vector signed long long __b) {
13067 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);
13068}
13069
13070static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
13071 vector unsigned long long __b) {
13072 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,
13073 (vector long long)__b);
13074}
13075
13076static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,
13077 vector bool long long __b) {
13078 return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,
13079 (vector signed long long)__b);
13080}
13081
13082static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,
13083 vector bool long long __b) {
13084 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13085 (vector signed long long)__b);
13086}
13087
13088static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
13089 vector signed long long __b) {
13090 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13091 (vector signed long long)__b);
13092}
13093
13094static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
13095 vector unsigned long long __b) {
13096 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13097 (vector signed long long)__b);
13098}
13099
13100static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,
13101 vector bool long long __b) {
13102 return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,
13103 (vector signed long long)__b);
13104}
13105#endif
13106
13107static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,
13108 vector float __b) {
13109#ifdef __VSX__
13110 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
13111#else
13112 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
13113#endif
13114}
13115
13116#ifdef __VSX__
13117static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,
13118 vector double __b) {
13119 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);
13120}
13121#endif
13122
13123/* vec_all_nge */
13124
13125static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,
13126 vector float __b) {
13127#ifdef __VSX__
13128 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);
13129#else
13130 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
13131#endif
13132}
13133
13134#ifdef __VSX__
13135static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,
13136 vector double __b) {
13137 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);
13138}
13139#endif
13140
13141/* vec_all_ngt */
13142
13143static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,
13144 vector float __b) {
13145#ifdef __VSX__
13146 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);
13147#else
13148 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
13149#endif
13150}
13151
13152#ifdef __VSX__
13153static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
13154 vector double __b) {
13155 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);
13156}
13157#endif
13158
13159/* vec_all_nle */
13160
13161static __inline__ int __attribute__((__always_inline__))
13162vec_all_nle(vector float __a, vector float __b) {
13163 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
13164}
13165
13166/* vec_all_nlt */
13167
13168static __inline__ int __attribute__((__always_inline__))
13169vec_all_nlt(vector float __a, vector float __b) {
13170 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
13171}
13172
13173/* vec_all_numeric */
13174
13175static __inline__ int __attribute__((__always_inline__))
13176vec_all_numeric(vector float __a) {
13177 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
13178}
13179
13180/* vec_any_eq */
13181
13182static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
13183 vector signed char __b) {
13184 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13185 (vector char)__b);
13186}
13187
13188static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
13189 vector bool char __b) {
13190 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13191 (vector char)__b);
13192}
13193
13194static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
13195 vector unsigned char __b) {
13196 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13197 (vector char)__b);
13198}
13199
13200static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,
13201 vector bool char __b) {
13202 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13203 (vector char)__b);
13204}
13205
13206static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
13207 vector signed char __b) {
13208 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13209 (vector char)__b);
13210}
13211
13212static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
13213 vector unsigned char __b) {
13214 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13215 (vector char)__b);
13216}
13217
13218static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,
13219 vector bool char __b) {
13220 return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,
13221 (vector char)__b);
13222}
13223
13224static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
13225 vector short __b) {
13226 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
13227}
13228
13229static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,
13230 vector bool short __b) {
13231 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
13232}
13233
13234static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
13235 vector unsigned short __b) {
13236 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13237 (vector short)__b);
13238}
13239
13240static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,
13241 vector bool short __b) {
13242 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13243 (vector short)__b);
13244}
13245
13246static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
13247 vector short __b) {
13248 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13249 (vector short)__b);
13250}
13251
13252static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
13253 vector unsigned short __b) {
13254 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13255 (vector short)__b);
13256}
13257
13258static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,
13259 vector bool short __b) {
13260 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13261 (vector short)__b);
13262}
13263
13264static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,
13265 vector pixel __b) {
13266 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,
13267 (vector short)__b);
13268}
13269
13270static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {
13271 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
13272}
13273
13274static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,
13275 vector bool int __b) {
13276 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
13277}
13278
13279static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
13280 vector unsigned int __b) {
13281 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13282 (vector int)__b);
13283}
13284
13285static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,
13286 vector bool int __b) {
13287 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13288 (vector int)__b);
13289}
13290
13291static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
13292 vector int __b) {
13293 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13294 (vector int)__b);
13295}
13296
13297static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
13298 vector unsigned int __b) {
13299 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13300 (vector int)__b);
13301}
13302
13303static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,
13304 vector bool int __b) {
13305 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,
13306 (vector int)__b);
13307}
13308
13309#ifdef __POWER8_VECTOR__
13310static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
13311 vector signed long long __b) {
13312 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);
13313}
13314
13315static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
13316 vector unsigned long long __b) {
13317 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,
13318 (vector long long)__b);
13319}
13320
13321static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,
13322 vector bool long long __b) {
13323 return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,
13324 (vector signed long long)__b);
13325}
13326
13327static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,
13328 vector bool long long __b) {
13329 return __builtin_altivec_vcmpequd_p(
13330 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13331}
13332
13333static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
13334 vector signed long long __b) {
13335 return __builtin_altivec_vcmpequd_p(
13336 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13337}
13338
13339static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
13340 vector unsigned long long __b) {
13341 return __builtin_altivec_vcmpequd_p(
13342 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13343}
13344
13345static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,
13346 vector bool long long __b) {
13347 return __builtin_altivec_vcmpequd_p(
13348 __CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);
13349}
13350#endif
13351
13352static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,
13353 vector float __b) {
13354#ifdef __VSX__
13355 return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);
13356#else
13357 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
13358#endif
13359}
13360
13361#ifdef __VSX__
13362static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,
13363 vector double __b) {
13364 return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);
13365}
13366#endif
13367
13368/* vec_any_ge */
13369
13370static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
13371 vector signed char __b) {
13372 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
13373}
13374
13375static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,
13376 vector bool char __b) {
13377 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,
13378 __a);
13379}
13380
13381static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
13382 vector unsigned char __b) {
13383 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
13384}
13385
13386static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,
13387 vector bool char __b) {
13388 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
13389 __a);
13390}
13391
13392static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
13393 vector signed char __b) {
13394 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
13395 (vector unsigned char)__a);
13396}
13397
13398static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
13399 vector unsigned char __b) {
13400 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,
13401 (vector unsigned char)__a);
13402}
13403
13404static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,
13405 vector bool char __b) {
13406 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,
13407 (vector unsigned char)__a);
13408}
13409
13410static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
13411 vector short __b) {
13412 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
13413}
13414
13415static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,
13416 vector bool short __b) {
13417 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
13418}
13419
13420static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
13421 vector unsigned short __b) {
13422 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
13423}
13424
13425static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,
13426 vector bool short __b) {
13427 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
13428 __a);
13429}
13430
13431static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
13432 vector short __b) {
13433 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
13434 (vector unsigned short)__a);
13435}
13436
13437static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
13438 vector unsigned short __b) {
13439 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,
13440 (vector unsigned short)__a);
13441}
13442
13443static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,
13444 vector bool short __b) {
13445 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,
13446 (vector unsigned short)__a);
13447}
13448
13449static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {
13450 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
13451}
13452
13453static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,
13454 vector bool int __b) {
13455 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
13456}
13457
13458static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
13459 vector unsigned int __b) {
13460 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
13461}
13462
13463static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,
13464 vector bool int __b) {
13465 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
13466 __a);
13467}
13468
13469static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
13470 vector int __b) {
13471 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
13472 (vector unsigned int)__a);
13473}
13474
13475static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
13476 vector unsigned int __b) {
13477 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,
13478 (vector unsigned int)__a);
13479}
13480
13481static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,
13482 vector bool int __b) {
13483 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,
13484 (vector unsigned int)__a);
13485}
13486
13487#ifdef __POWER8_VECTOR__
13488static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
13489 vector signed long long __b) {
13490 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);
13491}
13492
13493static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
13494 vector unsigned long long __b) {
13495 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);
13496}
13497
13498static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,
13499 vector bool long long __b) {
13500 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,
13501 (vector signed long long)__b, __a);
13502}
13503
13504static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,
13505 vector bool long long __b) {
13506 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13507 (vector unsigned long long)__b, __a);
13508}
13509
13510static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
13511 vector signed long long __b) {
13512 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13513 (vector unsigned long long)__b,
13514 (vector unsigned long long)__a);
13515}
13516
13517static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
13518 vector unsigned long long __b) {
13519 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,
13520 (vector unsigned long long)__a);
13521}
13522
13523static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,
13524 vector bool long long __b) {
13525 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13526 (vector unsigned long long)__b,
13527 (vector unsigned long long)__a);
13528}
13529#endif
13530
13531static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,
13532 vector float __b) {
13533#ifdef __VSX__
13534 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);
13535#else
13536 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
13537#endif
13538}
13539
13540#ifdef __VSX__
13541static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,
13542 vector double __b) {
13543 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);
13544}
13545#endif
13546
13547/* vec_any_gt */
13548
13549static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
13550 vector signed char __b) {
13551 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
13552}
13553
13554static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,
13555 vector bool char __b) {
13556 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,
13557 (vector signed char)__b);
13558}
13559
13560static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
13561 vector unsigned char __b) {
13562 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
13563}
13564
13565static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,
13566 vector bool char __b) {
13567 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,
13568 (vector unsigned char)__b);
13569}
13570
13571static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
13572 vector signed char __b) {
13573 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
13574 (vector unsigned char)__b);
13575}
13576
13577static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
13578 vector unsigned char __b) {
13579 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
13580 __b);
13581}
13582
13583static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,
13584 vector bool char __b) {
13585 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,
13586 (vector unsigned char)__b);
13587}
13588
13589static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
13590 vector short __b) {
13591 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
13592}
13593
13594static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,
13595 vector bool short __b) {
13596 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
13597}
13598
13599static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
13600 vector unsigned short __b) {
13601 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
13602}
13603
13604static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,
13605 vector bool short __b) {
13606 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,
13607 (vector unsigned short)__b);
13608}
13609
13610static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
13611 vector short __b) {
13612 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
13613 (vector unsigned short)__b);
13614}
13615
13616static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
13617 vector unsigned short __b) {
13618 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
13619 __b);
13620}
13621
13622static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,
13623 vector bool short __b) {
13624 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,
13625 (vector unsigned short)__b);
13626}
13627
13628static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {
13629 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
13630}
13631
13632static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,
13633 vector bool int __b) {
13634 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
13635}
13636
13637static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
13638 vector unsigned int __b) {
13639 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
13640}
13641
13642static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,
13643 vector bool int __b) {
13644 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,
13645 (vector unsigned int)__b);
13646}
13647
13648static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
13649 vector int __b) {
13650 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
13651 (vector unsigned int)__b);
13652}
13653
13654static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
13655 vector unsigned int __b) {
13656 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
13657 __b);
13658}
13659
13660static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,
13661 vector bool int __b) {
13662 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,
13663 (vector unsigned int)__b);
13664}
13665
13666#ifdef __POWER8_VECTOR__
13667static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
13668 vector signed long long __b) {
13669 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);
13670}
13671
13672static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
13673 vector unsigned long long __b) {
13674 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);
13675}
13676
13677static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,
13678 vector bool long long __b) {
13679 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,
13680 (vector signed long long)__b);
13681}
13682
13683static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,
13684 vector bool long long __b) {
13685 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,
13686 (vector unsigned long long)__b);
13687}
13688
13689static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
13690 vector signed long long __b) {
13691 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13692 (vector unsigned long long)__a,
13693 (vector unsigned long long)__b);
13694}
13695
13696static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
13697 vector unsigned long long __b) {
13698 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13699 (vector unsigned long long)__a, __b);
13700}
13701
13702static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,
13703 vector bool long long __b) {
13704 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
13705 (vector unsigned long long)__a,
13706 (vector unsigned long long)__b);
13707}
13708#endif
13709
13710static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,
13711 vector float __b) {
13712#ifdef __VSX__
13713 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);
13714#else
13715 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
13716#endif
13717}
13718
13719#ifdef __VSX__
13720static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,
13721 vector double __b) {
13722 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);
13723}
13724#endif
13725
13726/* vec_any_le */
13727
13728static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
13729 vector signed char __b) {
13730 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
13731}
13732
13733static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,
13734 vector bool char __b) {
13735 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,
13736 (vector signed char)__b);
13737}
13738
13739static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
13740 vector unsigned char __b) {
13741 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
13742}
13743
13744static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,
13745 vector bool char __b) {
13746 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,
13747 (vector unsigned char)__b);
13748}
13749
13750static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
13751 vector signed char __b) {
13752 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
13753 (vector unsigned char)__b);
13754}
13755
13756static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
13757 vector unsigned char __b) {
13758 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
13759 __b);
13760}
13761
13762static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,
13763 vector bool char __b) {
13764 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,
13765 (vector unsigned char)__b);
13766}
13767
13768static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
13769 vector short __b) {
13770 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
13771}
13772
13773static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,
13774 vector bool short __b) {
13775 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
13776}
13777
13778static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
13779 vector unsigned short __b) {
13780 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
13781}
13782
13783static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,
13784 vector bool short __b) {
13785 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,
13786 (vector unsigned short)__b);
13787}
13788
13789static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
13790 vector short __b) {
13791 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
13792 (vector unsigned short)__b);
13793}
13794
13795static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
13796 vector unsigned short __b) {
13797 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
13798 __b);
13799}
13800
13801static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,
13802 vector bool short __b) {
13803 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,
13804 (vector unsigned short)__b);
13805}
13806
13807static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {
13808 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
13809}
13810
13811static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,
13812 vector bool int __b) {
13813 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
13814}
13815
13816static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
13817 vector unsigned int __b) {
13818 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
13819}
13820
13821static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,
13822 vector bool int __b) {
13823 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,
13824 (vector unsigned int)__b);
13825}
13826
13827static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
13828 vector int __b) {
13829 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
13830 (vector unsigned int)__b);
13831}
13832
13833static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
13834 vector unsigned int __b) {
13835 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
13836 __b);
13837}
13838
13839static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,
13840 vector bool int __b) {
13841 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,
13842 (vector unsigned int)__b);
13843}
13844
13845#ifdef __POWER8_VECTOR__
13846static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
13847 vector signed long long __b) {
13848 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);
13849}
13850
13851static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
13852 vector unsigned long long __b) {
13853 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);
13854}
13855
13856static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,
13857 vector bool long long __b) {
13858 return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,
13859 (vector signed long long)__b);
13860}
13861
13862static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,
13863 vector bool long long __b) {
13864 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,
13865 (vector unsigned long long)__b);
13866}
13867
13868static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
13869 vector signed long long __b) {
13870 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13871 (vector unsigned long long)__a,
13872 (vector unsigned long long)__b);
13873}
13874
13875static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
13876 vector unsigned long long __b) {
13877 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13878 (vector unsigned long long)__a, __b);
13879}
13880
13881static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,
13882 vector bool long long __b) {
13883 return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,
13884 (vector unsigned long long)__a,
13885 (vector unsigned long long)__b);
13886}
13887#endif
13888
13889static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,
13890 vector float __b) {
13891#ifdef __VSX__
13892 return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);
13893#else
13894 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
13895#endif
13896}
13897
13898#ifdef __VSX__
13899static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,
13900 vector double __b) {
13901 return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);
13902}
13903#endif
13904
13905/* vec_any_lt */
13906
13907static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
13908 vector signed char __b) {
13909 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
13910}
13911
13912static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,
13913 vector bool char __b) {
13914 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,
13915 __a);
13916}
13917
13918static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
13919 vector unsigned char __b) {
13920 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
13921}
13922
13923static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,
13924 vector bool char __b) {
13925 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
13926 __a);
13927}
13928
13929static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
13930 vector signed char __b) {
13931 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
13932 (vector unsigned char)__a);
13933}
13934
13935static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
13936 vector unsigned char __b) {
13937 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,
13938 (vector unsigned char)__a);
13939}
13940
13941static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,
13942 vector bool char __b) {
13943 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,
13944 (vector unsigned char)__a);
13945}
13946
13947static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
13948 vector short __b) {
13949 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
13950}
13951
13952static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,
13953 vector bool short __b) {
13954 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
13955}
13956
13957static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
13958 vector unsigned short __b) {
13959 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
13960}
13961
13962static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,
13963 vector bool short __b) {
13964 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
13965 __a);
13966}
13967
13968static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
13969 vector short __b) {
13970 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
13971 (vector unsigned short)__a);
13972}
13973
13974static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
13975 vector unsigned short __b) {
13976 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,
13977 (vector unsigned short)__a);
13978}
13979
13980static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,
13981 vector bool short __b) {
13982 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,
13983 (vector unsigned short)__a);
13984}
13985
13986static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {
13987 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
13988}
13989
13990static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,
13991 vector bool int __b) {
13992 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
13993}
13994
13995static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
13996 vector unsigned int __b) {
13997 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
13998}
13999
14000static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,
14001 vector bool int __b) {
14002 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
14003 __a);
14004}
14005
14006static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
14007 vector int __b) {
14008 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
14009 (vector unsigned int)__a);
14010}
14011
14012static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
14013 vector unsigned int __b) {
14014 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,
14015 (vector unsigned int)__a);
14016}
14017
14018static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,
14019 vector bool int __b) {
14020 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,
14021 (vector unsigned int)__a);
14022}
14023
14024#ifdef __POWER8_VECTOR__
14025static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
14026 vector signed long long __b) {
14027 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);
14028}
14029
14030static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
14031 vector unsigned long long __b) {
14032 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);
14033}
14034
14035static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,
14036 vector bool long long __b) {
14037 return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,
14038 (vector signed long long)__b, __a);
14039}
14040
14041static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,
14042 vector bool long long __b) {
14043 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
14044 (vector unsigned long long)__b, __a);
14045}
14046
14047static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
14048 vector signed long long __b) {
14049 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
14050 (vector unsigned long long)__b,
14051 (vector unsigned long long)__a);
14052}
14053
14054static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
14055 vector unsigned long long __b) {
14056 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,
14057 (vector unsigned long long)__a);
14058}
14059
14060static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,
14061 vector bool long long __b) {
14062 return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,
14063 (vector unsigned long long)__b,
14064 (vector unsigned long long)__a);
14065}
14066#endif
14067
14068static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,
14069 vector float __b) {
14070#ifdef __VSX__
14071 return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);
14072#else
14073 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
14074#endif
14075}
14076
14077#ifdef __VSX__
14078static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,
14079 vector double __b) {
14080 return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);
14081}
14082#endif
14083
14084/* vec_any_nan */
14085
14086static __inline__ int __attribute__((__always_inline__))
14087vec_any_nan(vector float __a) {
14088 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
14089}
14090
14091/* vec_any_ne */
14092
14093static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
14094 vector signed char __b) {
14095 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14096 (vector char)__b);
14097}
14098
14099static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,
14100 vector bool char __b) {
14101 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14102 (vector char)__b);
14103}
14104
14105static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
14106 vector unsigned char __b) {
14107 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14108 (vector char)__b);
14109}
14110
14111static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,
14112 vector bool char __b) {
14113 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14114 (vector char)__b);
14115}
14116
14117static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
14118 vector signed char __b) {
14119 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14120 (vector char)__b);
14121}
14122
14123static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
14124 vector unsigned char __b) {
14125 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14126 (vector char)__b);
14127}
14128
14129static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,
14130 vector bool char __b) {
14131 return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,
14132 (vector char)__b);
14133}
14134
14135static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
14136 vector short __b) {
14137 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
14138}
14139
14140static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,
14141 vector bool short __b) {
14142 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
14143}
14144
14145static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
14146 vector unsigned short __b) {
14147 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14148 (vector short)__b);
14149}
14150
14151static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,
14152 vector bool short __b) {
14153 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14154 (vector short)__b);
14155}
14156
14157static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
14158 vector short __b) {
14159 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14160 (vector short)__b);
14161}
14162
14163static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
14164 vector unsigned short __b) {
14165 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14166 (vector short)__b);
14167}
14168
14169static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,
14170 vector bool short __b) {
14171 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14172 (vector short)__b);
14173}
14174
14175static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,
14176 vector pixel __b) {
14177 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,
14178 (vector short)__b);
14179}
14180
14181static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {
14182 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
14183}
14184
14185static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,
14186 vector bool int __b) {
14187 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
14188}
14189
14190static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
14191 vector unsigned int __b) {
14192 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14193 (vector int)__b);
14194}
14195
14196static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,
14197 vector bool int __b) {
14198 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14199 (vector int)__b);
14200}
14201
14202static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
14203 vector int __b) {
14204 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14205 (vector int)__b);
14206}
14207
14208static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
14209 vector unsigned int __b) {
14210 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14211 (vector int)__b);
14212}
14213
14214static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,
14215 vector bool int __b) {
14216 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,
14217 (vector int)__b);
14218}
14219
14220#ifdef __POWER8_VECTOR__
14221static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
14222 vector signed long long __b) {
14223 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);
14224}
14225
14226static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
14227 vector unsigned long long __b) {
14228 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,
14229 (vector long long)__b);
14230}
14231
14232static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,
14233 vector bool long long __b) {
14234 return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,
14235 (vector signed long long)__b);
14236}
14237
14238static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,
14239 vector bool long long __b) {
14240 return __builtin_altivec_vcmpequd_p(
14241 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14242}
14243
14244static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
14245 vector signed long long __b) {
14246 return __builtin_altivec_vcmpequd_p(
14247 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14248}
14249
14250static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
14251 vector unsigned long long __b) {
14252 return __builtin_altivec_vcmpequd_p(
14253 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14254}
14255
14256static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,
14257 vector bool long long __b) {
14258 return __builtin_altivec_vcmpequd_p(
14259 __CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);
14260}
14261#endif
14262
14263static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,
14264 vector float __b) {
14265#ifdef __VSX__
14266 return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);
14267#else
14268 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
14269#endif
14270}
14271
14272#ifdef __VSX__
14273static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,
14274 vector double __b) {
14275 return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);
14276}
14277#endif
14278
14279/* vec_any_nge */
14280
14281static __inline__ int __attribute__((__always_inline__))
14282vec_any_nge(vector float __a, vector float __b) {
14283 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
14284}
14285
14286/* vec_any_ngt */
14287
14288static __inline__ int __attribute__((__always_inline__))
14289vec_any_ngt(vector float __a, vector float __b) {
14290 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
14291}
14292
14293/* vec_any_nle */
14294
14295static __inline__ int __attribute__((__always_inline__))
14296vec_any_nle(vector float __a, vector float __b) {
14297 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
14298}
14299
14300/* vec_any_nlt */
14301
14302static __inline__ int __attribute__((__always_inline__))
14303vec_any_nlt(vector float __a, vector float __b) {
14304 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
14305}
14306
14307/* vec_any_numeric */
14308
14309static __inline__ int __attribute__((__always_inline__))
14310vec_any_numeric(vector float __a) {
14311 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
14312}
14313
14314/* vec_any_out */
14315
14316static __inline__ int __attribute__((__always_inline__))
14317vec_any_out(vector float __a, vector float __b) {
14318 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
14319}
14320
14321/* Power 8 Crypto functions
14322Note: We diverge from the current GCC implementation with regard
14323to cryptography and related functions as follows:
14324- Only the SHA and AES instructions and builtins are disabled by -mno-crypto
14325- The remaining ones are only available on Power8 and up so
14326 require -mpower8-vector
14327The justification for this is that export requirements require that
14328Category:Vector.Crypto is optional (i.e. compliant hardware may not provide
14329support). As a result, we need to be able to turn off support for those.
14330The remaining ones (currently controlled by -mcrypto for GCC) still
14331need to be provided on compliant hardware even if Vector.Crypto is not
14332provided.
14333*/
14334#ifdef __CRYPTO__
14335#define vec_sbox_be __builtin_altivec_crypto_vsbox
14336#define vec_cipher_be __builtin_altivec_crypto_vcipher
14337#define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast
14338#define vec_ncipher_be __builtin_altivec_crypto_vncipher
14339#define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast
14340
14341static __inline__ vector unsigned long long __attribute__((__always_inline__))
14342__builtin_crypto_vsbox(vector unsigned long long __a) {
14343 return __builtin_altivec_crypto_vsbox(__a);
14344}
14345
14346static __inline__ vector unsigned long long __attribute__((__always_inline__))
14347__builtin_crypto_vcipher(vector unsigned long long __a,
14348 vector unsigned long long __b) {
14349 return __builtin_altivec_crypto_vcipher(__a, __b);
14350}
14351
14352static __inline__ vector unsigned long long __attribute__((__always_inline__))
14353__builtin_crypto_vcipherlast(vector unsigned long long __a,
14354 vector unsigned long long __b) {
14355 return __builtin_altivec_crypto_vcipherlast(__a, __b);
14356}
14357
14358static __inline__ vector unsigned long long __attribute__((__always_inline__))
14359__builtin_crypto_vncipher(vector unsigned long long __a,
14360 vector unsigned long long __b) {
14361 return __builtin_altivec_crypto_vncipher(__a, __b);
14362}
14363
14364static __inline__ vector unsigned long long __attribute__((__always_inline__))
14365__builtin_crypto_vncipherlast(vector unsigned long long __a,
14366 vector unsigned long long __b) {
14367 return __builtin_altivec_crypto_vncipherlast(__a, __b);
14368}
14369
14370#define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad
14371#define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw
14372
14373#define vec_shasigma_be(X, Y, Z) \
14374 _Generic((X), vector unsigned int \
14375 : __builtin_crypto_vshasigmaw, vector unsigned long long \
14376 : __builtin_crypto_vshasigmad)((X), (Y), (Z))
14377#endif
14378
14379#ifdef __POWER8_VECTOR__
14380static __inline__ vector unsigned char __ATTRS_o_ai
14381__builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,
14382 vector unsigned char __c) {
14383 return __builtin_altivec_crypto_vpermxor(__a, __b, __c);
14384}
14385
14386static __inline__ vector unsigned short __ATTRS_o_ai
14387__builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,
14388 vector unsigned short __c) {
14389 return (vector unsigned short)__builtin_altivec_crypto_vpermxor(
14390 (vector unsigned char)__a, (vector unsigned char)__b,
14391 (vector unsigned char)__c);
14392}
14393
14394static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(
14395 vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {
14396 return (vector unsigned int)__builtin_altivec_crypto_vpermxor(
14397 (vector unsigned char)__a, (vector unsigned char)__b,
14398 (vector unsigned char)__c);
14399}
14400
14401static __inline__ vector unsigned long long __ATTRS_o_ai
14402__builtin_crypto_vpermxor(vector unsigned long long __a,
14403 vector unsigned long long __b,
14404 vector unsigned long long __c) {
14405 return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(
14406 (vector unsigned char)__a, (vector unsigned char)__b,
14407 (vector unsigned char)__c);
14408}
14409
14410static __inline__ vector unsigned char __ATTRS_o_ai
14411__builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {
14412 return __builtin_altivec_crypto_vpmsumb(__a, __b);
14413}
14414
14415static __inline__ vector unsigned short __ATTRS_o_ai
14416__builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {
14417 return __builtin_altivec_crypto_vpmsumh(__a, __b);
14418}
14419
14420static __inline__ vector unsigned int __ATTRS_o_ai
14421__builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {
14422 return __builtin_altivec_crypto_vpmsumw(__a, __b);
14423}
14424
14425static __inline__ vector unsigned long long __ATTRS_o_ai
14426__builtin_crypto_vpmsumb(vector unsigned long long __a,
14427 vector unsigned long long __b) {
14428 return __builtin_altivec_crypto_vpmsumd(__a, __b);
14429}
14430
14431static __inline__ vector signed char __ATTRS_o_ai
14432vec_vgbbd(vector signed char __a) {
14433 return __builtin_altivec_vgbbd((vector unsigned char)__a);
14434}
14435
14436#define vec_pmsum_be __builtin_crypto_vpmsumb
14437#define vec_gb __builtin_altivec_vgbbd
14438
14439static __inline__ vector unsigned char __ATTRS_o_ai
14440vec_vgbbd(vector unsigned char __a) {
14441 return __builtin_altivec_vgbbd(__a);
14442}
14443
14444static __inline__ vector long long __ATTRS_o_ai
14445vec_vbpermq(vector signed char __a, vector signed char __b) {
14446 return __builtin_altivec_vbpermq((vector unsigned char)__a,
14447 (vector unsigned char)__b);
14448}
14449
14450static __inline__ vector long long __ATTRS_o_ai
14451vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {
14452 return __builtin_altivec_vbpermq(__a, __b);
14453}
14454
14455#ifdef __powerpc64__
14456static __inline__ vector unsigned long long __attribute__((__always_inline__))
14457vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
14458 return __builtin_altivec_vbpermq((vector unsigned char)__a,
14459 (vector unsigned char)__b);
14460}
14461#endif
14462#endif
14463
14464#undef __ATTRS_o_ai
14465
14466#endif /* __ALTIVEC_H */