clang  10.0.0svn
altivec.h
Go to the documentation of this file.
1 /*===---- altivec.h - Standard header for type generic math ---------------===*\
2  *
3  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4  * See https://llvm.org/LICENSE.txt for license information.
5  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6  *
7 \*===----------------------------------------------------------------------===*/
8 
9 #ifndef __ALTIVEC_H
10 #define __ALTIVEC_H
11 
12 #ifndef __ALTIVEC__
13 #error "AltiVec support not enabled"
14 #endif
15 
16 /* Constants for mapping CR6 bits to predicate result. */
17 
18 #define __CR6_EQ 0
19 #define __CR6_EQ_REV 1
20 #define __CR6_LT 2
21 #define __CR6_LT_REV 3
22 
23 /* Constants for vec_test_data_class */
24 #define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)
25 #define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)
26 #define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \
27  __VEC_CLASS_FP_SUBNORMAL_N)
28 #define __VEC_CLASS_FP_ZERO_N (1<<2)
29 #define __VEC_CLASS_FP_ZERO_P (1<<3)
30 #define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \
31  __VEC_CLASS_FP_ZERO_N)
32 #define __VEC_CLASS_FP_INFINITY_N (1<<4)
33 #define __VEC_CLASS_FP_INFINITY_P (1<<5)
34 #define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \
35  __VEC_CLASS_FP_INFINITY_N)
36 #define __VEC_CLASS_FP_NAN (1<<6)
37 #define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \
38  __VEC_CLASS_FP_SUBNORMAL | \
39  __VEC_CLASS_FP_ZERO | \
40  __VEC_CLASS_FP_INFINITY)
41 
42 #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
43 
44 #ifdef __POWER9_VECTOR__
45 #include <stddef.h>
46 #endif
47 
48 static __inline__ vector signed char __ATTRS_o_ai vec_perm(
49  vector signed char __a, vector signed char __b, vector unsigned char __c);
50 
51 static __inline__ vector unsigned char __ATTRS_o_ai
52 vec_perm(vector unsigned char __a, vector unsigned char __b,
53  vector unsigned char __c);
54 
55 static __inline__ vector bool char __ATTRS_o_ai
56 vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
57 
58 static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,
59  vector signed short __b,
60  vector unsigned char __c);
61 
62 static __inline__ vector unsigned short __ATTRS_o_ai
63 vec_perm(vector unsigned short __a, vector unsigned short __b,
64  vector unsigned char __c);
65 
66 static __inline__ vector bool short __ATTRS_o_ai vec_perm(
67  vector bool short __a, vector bool short __b, vector unsigned char __c);
68 
69 static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,
70  vector pixel __b,
71  vector unsigned char __c);
72 
73 static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,
74  vector signed int __b,
75  vector unsigned char __c);
76 
77 static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(
78  vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
79 
80 static __inline__ vector bool int __ATTRS_o_ai
81 vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
82 
83 static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,
84  vector float __b,
85  vector unsigned char __c);
86 
87 #ifdef __VSX__
88 static __inline__ vector long long __ATTRS_o_ai
89 vec_perm(vector signed long long __a, vector signed long long __b,
90  vector unsigned char __c);
91 
92 static __inline__ vector unsigned long long __ATTRS_o_ai
93 vec_perm(vector unsigned long long __a, vector unsigned long long __b,
94  vector unsigned char __c);
95 
96 static __inline__ vector bool long long __ATTRS_o_ai
97 vec_perm(vector bool long long __a, vector bool long long __b,
98  vector unsigned char __c);
99 
100 static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,
101  vector double __b,
102  vector unsigned char __c);
103 #endif
104 
105 static __inline__ vector unsigned char __ATTRS_o_ai
106 vec_xor(vector unsigned char __a, vector unsigned char __b);
107 
108 /* vec_abs */
109 
110 #define __builtin_altivec_abs_v16qi vec_abs
111 #define __builtin_altivec_abs_v8hi vec_abs
112 #define __builtin_altivec_abs_v4si vec_abs
113 
114 static __inline__ vector signed char __ATTRS_o_ai
115 vec_abs(vector signed char __a) {
116  return __builtin_altivec_vmaxsb(__a, -__a);
117 }
118 
119 static __inline__ vector signed short __ATTRS_o_ai
120 vec_abs(vector signed short __a) {
121  return __builtin_altivec_vmaxsh(__a, -__a);
122 }
123 
124 static __inline__ vector signed int __ATTRS_o_ai
125 vec_abs(vector signed int __a) {
126  return __builtin_altivec_vmaxsw(__a, -__a);
127 }
128 
129 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
130 static __inline__ vector signed long long __ATTRS_o_ai
131 vec_abs(vector signed long long __a) {
132  return __builtin_altivec_vmaxsd(__a, -__a);
133 }
134 #endif
135 
136 static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {
137 #ifdef __VSX__
138  return __builtin_vsx_xvabssp(__a);
139 #else
140  vector unsigned int __res =
141  (vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);
142  return (vector float)__res;
143 #endif
144 }
145 
146 #ifdef __VSX__
147 static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {
148  return __builtin_vsx_xvabsdp(__a);
149 }
150 #endif
151 
152 /* vec_abss */
153 #define __builtin_altivec_abss_v16qi vec_abss
154 #define __builtin_altivec_abss_v8hi vec_abss
155 #define __builtin_altivec_abss_v4si vec_abss
156 
157 static __inline__ vector signed char __ATTRS_o_ai
158 vec_abss(vector signed char __a) {
159  return __builtin_altivec_vmaxsb(
160  __a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
161 }
162 
163 static __inline__ vector signed short __ATTRS_o_ai
164 vec_abss(vector signed short __a) {
165  return __builtin_altivec_vmaxsh(
166  __a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
167 }
168 
169 static __inline__ vector signed int __ATTRS_o_ai
170 vec_abss(vector signed int __a) {
171  return __builtin_altivec_vmaxsw(
172  __a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
173 }
174 
175 /* vec_absd */
176 #if defined(__POWER9_VECTOR__)
177 
178 static __inline__ vector unsigned char __ATTRS_o_ai
179 vec_absd(vector unsigned char __a, vector unsigned char __b) {
180  return __builtin_altivec_vabsdub(__a, __b);
181 }
182 
183 static __inline__ vector unsigned short __ATTRS_o_ai
184 vec_absd(vector unsigned short __a, vector unsigned short __b) {
185  return __builtin_altivec_vabsduh(__a, __b);
186 }
187 
188 static __inline__ vector unsigned int __ATTRS_o_ai
189 vec_absd(vector unsigned int __a, vector unsigned int __b) {
190  return __builtin_altivec_vabsduw(__a, __b);
191 }
192 
193 #endif /* End __POWER9_VECTOR__ */
194 
195 /* vec_add */
196 
197 static __inline__ vector signed char __ATTRS_o_ai
198 vec_add(vector signed char __a, vector signed char __b) {
199  return __a + __b;
200 }
201 
202 static __inline__ vector signed char __ATTRS_o_ai
203 vec_add(vector bool char __a, vector signed char __b) {
204  return (vector signed char)__a + __b;
205 }
206 
207 static __inline__ vector signed char __ATTRS_o_ai
208 vec_add(vector signed char __a, vector bool char __b) {
209  return __a + (vector signed char)__b;
210 }
211 
212 static __inline__ vector unsigned char __ATTRS_o_ai
213 vec_add(vector unsigned char __a, vector unsigned char __b) {
214  return __a + __b;
215 }
216 
217 static __inline__ vector unsigned char __ATTRS_o_ai
218 vec_add(vector bool char __a, vector unsigned char __b) {
219  return (vector unsigned char)__a + __b;
220 }
221 
222 static __inline__ vector unsigned char __ATTRS_o_ai
223 vec_add(vector unsigned char __a, vector bool char __b) {
224  return __a + (vector unsigned char)__b;
225 }
226 
227 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
228  vector short __b) {
229  return __a + __b;
230 }
231 
232 static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,
233  vector short __b) {
234  return (vector short)__a + __b;
235 }
236 
237 static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,
238  vector bool short __b) {
239  return __a + (vector short)__b;
240 }
241 
242 static __inline__ vector unsigned short __ATTRS_o_ai
243 vec_add(vector unsigned short __a, vector unsigned short __b) {
244  return __a + __b;
245 }
246 
247 static __inline__ vector unsigned short __ATTRS_o_ai
248 vec_add(vector bool short __a, vector unsigned short __b) {
249  return (vector unsigned short)__a + __b;
250 }
251 
252 static __inline__ vector unsigned short __ATTRS_o_ai
253 vec_add(vector unsigned short __a, vector bool short __b) {
254  return __a + (vector unsigned short)__b;
255 }
256 
257 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
258  vector int __b) {
259  return __a + __b;
260 }
261 
262 static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,
263  vector int __b) {
264  return (vector int)__a + __b;
265 }
266 
267 static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,
268  vector bool int __b) {
269  return __a + (vector int)__b;
270 }
271 
272 static __inline__ vector unsigned int __ATTRS_o_ai
273 vec_add(vector unsigned int __a, vector unsigned int __b) {
274  return __a + __b;
275 }
276 
277 static __inline__ vector unsigned int __ATTRS_o_ai
278 vec_add(vector bool int __a, vector unsigned int __b) {
279  return (vector unsigned int)__a + __b;
280 }
281 
282 static __inline__ vector unsigned int __ATTRS_o_ai
283 vec_add(vector unsigned int __a, vector bool int __b) {
284  return __a + (vector unsigned int)__b;
285 }
286 
287 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
288 static __inline__ vector signed long long __ATTRS_o_ai
289 vec_add(vector signed long long __a, vector signed long long __b) {
290  return __a + __b;
291 }
292 
293 static __inline__ vector unsigned long long __ATTRS_o_ai
294 vec_add(vector unsigned long long __a, vector unsigned long long __b) {
295  return __a + __b;
296 }
297 
298 static __inline__ vector signed __int128 __ATTRS_o_ai
299 vec_add(vector signed __int128 __a, vector signed __int128 __b) {
300  return __a + __b;
301 }
302 
303 static __inline__ vector unsigned __int128 __ATTRS_o_ai
304 vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {
305  return __a + __b;
306 }
307 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
308 
309 static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,
310  vector float __b) {
311  return __a + __b;
312 }
313 
314 #ifdef __VSX__
315 static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,
316  vector double __b) {
317  return __a + __b;
318 }
319 #endif // __VSX__
320 
321 /* vec_adde */
322 
323 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
324 static __inline__ vector signed __int128 __ATTRS_o_ai
325 vec_adde(vector signed __int128 __a, vector signed __int128 __b,
326  vector signed __int128 __c) {
327  return __builtin_altivec_vaddeuqm(__a, __b, __c);
328 }
329 
330 static __inline__ vector unsigned __int128 __ATTRS_o_ai
331 vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,
332  vector unsigned __int128 __c) {
333  return __builtin_altivec_vaddeuqm(__a, __b, __c);
334 }
335 #endif
336 
337 static __inline__ vector signed int __ATTRS_o_ai
338 vec_adde(vector signed int __a, vector signed int __b,
339  vector signed int __c) {
340  vector signed int __mask = {1, 1, 1, 1};
341  vector signed int __carry = __c & __mask;
342  return vec_add(vec_add(__a, __b), __carry);
343 }
344 
345 static __inline__ vector unsigned int __ATTRS_o_ai
346 vec_adde(vector unsigned int __a, vector unsigned int __b,
347  vector unsigned int __c) {
348  vector unsigned int __mask = {1, 1, 1, 1};
349  vector unsigned int __carry = __c & __mask;
350  return vec_add(vec_add(__a, __b), __carry);
351 }
352 
353 /* vec_addec */
354 
355 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
356 static __inline__ vector signed __int128 __ATTRS_o_ai
357 vec_addec(vector signed __int128 __a, vector signed __int128 __b,
358  vector signed __int128 __c) {
359  return __builtin_altivec_vaddecuq(__a, __b, __c);
360 }
361 
362 static __inline__ vector unsigned __int128 __ATTRS_o_ai
363 vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,
364  vector unsigned __int128 __c) {
365  return __builtin_altivec_vaddecuq(__a, __b, __c);
366 }
367 
368 static __inline__ vector signed int __ATTRS_o_ai
369 vec_addec(vector signed int __a, vector signed int __b,
370  vector signed int __c) {
371 
372  signed int __result[4];
373  for (int i = 0; i < 4; i++) {
374  unsigned int __tempa = (unsigned int) __a[i];
375  unsigned int __tempb = (unsigned int) __b[i];
376  unsigned int __tempc = (unsigned int) __c[i];
377  __tempc = __tempc & 0x00000001;
378  unsigned long long __longa = (unsigned long long) __tempa;
379  unsigned long long __longb = (unsigned long long) __tempb;
380  unsigned long long __longc = (unsigned long long) __tempc;
381  unsigned long long __sum = __longa + __longb + __longc;
382  unsigned long long __res = (__sum >> 32) & 0x01;
383  unsigned long long __tempres = (unsigned int) __res;
384  __result[i] = (signed int) __tempres;
385  }
386 
387  vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };
388  return ret;
389 }
390 
391 static __inline__ vector unsigned int __ATTRS_o_ai
392 vec_addec(vector unsigned int __a, vector unsigned int __b,
393  vector unsigned int __c) {
394 
395  unsigned int __result[4];
396  for (int i = 0; i < 4; i++) {
397  unsigned int __tempc = __c[i] & 1;
398  unsigned long long __longa = (unsigned long long) __a[i];
399  unsigned long long __longb = (unsigned long long) __b[i];
400  unsigned long long __longc = (unsigned long long) __tempc;
401  unsigned long long __sum = __longa + __longb + __longc;
402  unsigned long long __res = (__sum >> 32) & 0x01;
403  unsigned long long __tempres = (unsigned int) __res;
404  __result[i] = (signed int) __tempres;
405  }
406 
407  vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };
408  return ret;
409 }
410 
411 #endif
412 
413 /* vec_vaddubm */
414 
415 #define __builtin_altivec_vaddubm vec_vaddubm
416 
417 static __inline__ vector signed char __ATTRS_o_ai
418 vec_vaddubm(vector signed char __a, vector signed char __b) {
419  return __a + __b;
420 }
421 
422 static __inline__ vector signed char __ATTRS_o_ai
423 vec_vaddubm(vector bool char __a, vector signed char __b) {
424  return (vector signed char)__a + __b;
425 }
426 
427 static __inline__ vector signed char __ATTRS_o_ai
428 vec_vaddubm(vector signed char __a, vector bool char __b) {
429  return __a + (vector signed char)__b;
430 }
431 
432 static __inline__ vector unsigned char __ATTRS_o_ai
433 vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {
434  return __a + __b;
435 }
436 
437 static __inline__ vector unsigned char __ATTRS_o_ai
438 vec_vaddubm(vector bool char __a, vector unsigned char __b) {
439  return (vector unsigned char)__a + __b;
440 }
441 
442 static __inline__ vector unsigned char __ATTRS_o_ai
443 vec_vaddubm(vector unsigned char __a, vector bool char __b) {
444  return __a + (vector unsigned char)__b;
445 }
446 
447 /* vec_vadduhm */
448 
449 #define __builtin_altivec_vadduhm vec_vadduhm
450 
451 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
452  vector short __b) {
453  return __a + __b;
454 }
455 
456 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,
457  vector short __b) {
458  return (vector short)__a + __b;
459 }
460 
461 static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,
462  vector bool short __b) {
463  return __a + (vector short)__b;
464 }
465 
466 static __inline__ vector unsigned short __ATTRS_o_ai
467 vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {
468  return __a + __b;
469 }
470 
471 static __inline__ vector unsigned short __ATTRS_o_ai
472 vec_vadduhm(vector bool short __a, vector unsigned short __b) {
473  return (vector unsigned short)__a + __b;
474 }
475 
476 static __inline__ vector unsigned short __ATTRS_o_ai
477 vec_vadduhm(vector unsigned short __a, vector bool short __b) {
478  return __a + (vector unsigned short)__b;
479 }
480 
481 /* vec_vadduwm */
482 
483 #define __builtin_altivec_vadduwm vec_vadduwm
484 
485 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
486  vector int __b) {
487  return __a + __b;
488 }
489 
490 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,
491  vector int __b) {
492  return (vector int)__a + __b;
493 }
494 
495 static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,
496  vector bool int __b) {
497  return __a + (vector int)__b;
498 }
499 
500 static __inline__ vector unsigned int __ATTRS_o_ai
501 vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {
502  return __a + __b;
503 }
504 
505 static __inline__ vector unsigned int __ATTRS_o_ai
506 vec_vadduwm(vector bool int __a, vector unsigned int __b) {
507  return (vector unsigned int)__a + __b;
508 }
509 
510 static __inline__ vector unsigned int __ATTRS_o_ai
511 vec_vadduwm(vector unsigned int __a, vector bool int __b) {
512  return __a + (vector unsigned int)__b;
513 }
514 
515 /* vec_vaddfp */
516 
517 #define __builtin_altivec_vaddfp vec_vaddfp
518 
519 static __inline__ vector float __attribute__((__always_inline__))
520 vec_vaddfp(vector float __a, vector float __b) {
521  return __a + __b;
522 }
523 
524 /* vec_addc */
525 
526 static __inline__ vector signed int __ATTRS_o_ai
527 vec_addc(vector signed int __a, vector signed int __b) {
528  return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,
529  (vector unsigned int)__b);
530 }
531 
532 static __inline__ vector unsigned int __ATTRS_o_ai
533 vec_addc(vector unsigned int __a, vector unsigned int __b) {
534  return __builtin_altivec_vaddcuw(__a, __b);
535 }
536 
537 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
538 static __inline__ vector signed __int128 __ATTRS_o_ai
539 vec_addc(vector signed __int128 __a, vector signed __int128 __b) {
540  return (vector signed __int128)__builtin_altivec_vaddcuq(
541  (vector unsigned __int128)__a, (vector unsigned __int128)__b);
542 }
543 
544 static __inline__ vector unsigned __int128 __ATTRS_o_ai
545 vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {
546  return __builtin_altivec_vaddcuq(__a, __b);
547 }
548 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
549 
550 /* vec_vaddcuw */
551 
552 static __inline__ vector unsigned int __attribute__((__always_inline__))
553 vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {
554  return __builtin_altivec_vaddcuw(__a, __b);
555 }
556 
557 /* vec_adds */
558 
559 static __inline__ vector signed char __ATTRS_o_ai
560 vec_adds(vector signed char __a, vector signed char __b) {
561  return __builtin_altivec_vaddsbs(__a, __b);
562 }
563 
564 static __inline__ vector signed char __ATTRS_o_ai
565 vec_adds(vector bool char __a, vector signed char __b) {
566  return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
567 }
568 
569 static __inline__ vector signed char __ATTRS_o_ai
570 vec_adds(vector signed char __a, vector bool char __b) {
571  return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
572 }
573 
574 static __inline__ vector unsigned char __ATTRS_o_ai
575 vec_adds(vector unsigned char __a, vector unsigned char __b) {
576  return __builtin_altivec_vaddubs(__a, __b);
577 }
578 
579 static __inline__ vector unsigned char __ATTRS_o_ai
580 vec_adds(vector bool char __a, vector unsigned char __b) {
581  return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
582 }
583 
584 static __inline__ vector unsigned char __ATTRS_o_ai
585 vec_adds(vector unsigned char __a, vector bool char __b) {
586  return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
587 }
588 
589 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
590  vector short __b) {
591  return __builtin_altivec_vaddshs(__a, __b);
592 }
593 
594 static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,
595  vector short __b) {
596  return __builtin_altivec_vaddshs((vector short)__a, __b);
597 }
598 
599 static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,
600  vector bool short __b) {
601  return __builtin_altivec_vaddshs(__a, (vector short)__b);
602 }
603 
604 static __inline__ vector unsigned short __ATTRS_o_ai
605 vec_adds(vector unsigned short __a, vector unsigned short __b) {
606  return __builtin_altivec_vadduhs(__a, __b);
607 }
608 
609 static __inline__ vector unsigned short __ATTRS_o_ai
610 vec_adds(vector bool short __a, vector unsigned short __b) {
611  return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
612 }
613 
614 static __inline__ vector unsigned short __ATTRS_o_ai
615 vec_adds(vector unsigned short __a, vector bool short __b) {
616  return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
617 }
618 
619 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
620  vector int __b) {
621  return __builtin_altivec_vaddsws(__a, __b);
622 }
623 
624 static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,
625  vector int __b) {
626  return __builtin_altivec_vaddsws((vector int)__a, __b);
627 }
628 
629 static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,
630  vector bool int __b) {
631  return __builtin_altivec_vaddsws(__a, (vector int)__b);
632 }
633 
634 static __inline__ vector unsigned int __ATTRS_o_ai
635 vec_adds(vector unsigned int __a, vector unsigned int __b) {
636  return __builtin_altivec_vadduws(__a, __b);
637 }
638 
639 static __inline__ vector unsigned int __ATTRS_o_ai
640 vec_adds(vector bool int __a, vector unsigned int __b) {
641  return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
642 }
643 
644 static __inline__ vector unsigned int __ATTRS_o_ai
645 vec_adds(vector unsigned int __a, vector bool int __b) {
646  return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
647 }
648 
649 /* vec_vaddsbs */
650 
651 static __inline__ vector signed char __ATTRS_o_ai
652 vec_vaddsbs(vector signed char __a, vector signed char __b) {
653  return __builtin_altivec_vaddsbs(__a, __b);
654 }
655 
656 static __inline__ vector signed char __ATTRS_o_ai
657 vec_vaddsbs(vector bool char __a, vector signed char __b) {
658  return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
659 }
660 
661 static __inline__ vector signed char __ATTRS_o_ai
662 vec_vaddsbs(vector signed char __a, vector bool char __b) {
663  return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
664 }
665 
666 /* vec_vaddubs */
667 
668 static __inline__ vector unsigned char __ATTRS_o_ai
669 vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {
670  return __builtin_altivec_vaddubs(__a, __b);
671 }
672 
673 static __inline__ vector unsigned char __ATTRS_o_ai
674 vec_vaddubs(vector bool char __a, vector unsigned char __b) {
675  return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
676 }
677 
678 static __inline__ vector unsigned char __ATTRS_o_ai
679 vec_vaddubs(vector unsigned char __a, vector bool char __b) {
680  return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
681 }
682 
683 /* vec_vaddshs */
684 
685 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
686  vector short __b) {
687  return __builtin_altivec_vaddshs(__a, __b);
688 }
689 
690 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,
691  vector short __b) {
692  return __builtin_altivec_vaddshs((vector short)__a, __b);
693 }
694 
695 static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,
696  vector bool short __b) {
697  return __builtin_altivec_vaddshs(__a, (vector short)__b);
698 }
699 
700 /* vec_vadduhs */
701 
702 static __inline__ vector unsigned short __ATTRS_o_ai
703 vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {
704  return __builtin_altivec_vadduhs(__a, __b);
705 }
706 
707 static __inline__ vector unsigned short __ATTRS_o_ai
708 vec_vadduhs(vector bool short __a, vector unsigned short __b) {
709  return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
710 }
711 
712 static __inline__ vector unsigned short __ATTRS_o_ai
713 vec_vadduhs(vector unsigned short __a, vector bool short __b) {
714  return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
715 }
716 
717 /* vec_vaddsws */
718 
719 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
720  vector int __b) {
721  return __builtin_altivec_vaddsws(__a, __b);
722 }
723 
724 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,
725  vector int __b) {
726  return __builtin_altivec_vaddsws((vector int)__a, __b);
727 }
728 
729 static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,
730  vector bool int __b) {
731  return __builtin_altivec_vaddsws(__a, (vector int)__b);
732 }
733 
734 /* vec_vadduws */
735 
736 static __inline__ vector unsigned int __ATTRS_o_ai
737 vec_vadduws(vector unsigned int __a, vector unsigned int __b) {
738  return __builtin_altivec_vadduws(__a, __b);
739 }
740 
741 static __inline__ vector unsigned int __ATTRS_o_ai
742 vec_vadduws(vector bool int __a, vector unsigned int __b) {
743  return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
744 }
745 
746 static __inline__ vector unsigned int __ATTRS_o_ai
747 vec_vadduws(vector unsigned int __a, vector bool int __b) {
748  return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
749 }
750 
751 #if defined(__POWER8_VECTOR__) && defined(__powerpc64__)
752 /* vec_vadduqm */
753 
754 static __inline__ vector signed __int128 __ATTRS_o_ai
755 vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {
756  return __a + __b;
757 }
758 
759 static __inline__ vector unsigned __int128 __ATTRS_o_ai
760 vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {
761  return __a + __b;
762 }
763 
764 /* vec_vaddeuqm */
765 
766 static __inline__ vector signed __int128 __ATTRS_o_ai
767 vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,
768  vector signed __int128 __c) {
769  return __builtin_altivec_vaddeuqm(__a, __b, __c);
770 }
771 
772 static __inline__ vector unsigned __int128 __ATTRS_o_ai
773 vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,
774  vector unsigned __int128 __c) {
775  return __builtin_altivec_vaddeuqm(__a, __b, __c);
776 }
777 
778 /* vec_vaddcuq */
779 
780 static __inline__ vector signed __int128 __ATTRS_o_ai
781 vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {
782  return __builtin_altivec_vaddcuq(__a, __b);
783 }
784 
785 static __inline__ vector unsigned __int128 __ATTRS_o_ai
786 vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {
787  return __builtin_altivec_vaddcuq(__a, __b);
788 }
789 
790 /* vec_vaddecuq */
791 
792 static __inline__ vector signed __int128 __ATTRS_o_ai
793 vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,
794  vector signed __int128 __c) {
795  return __builtin_altivec_vaddecuq(__a, __b, __c);
796 }
797 
798 static __inline__ vector unsigned __int128 __ATTRS_o_ai
799 vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,
800  vector unsigned __int128 __c) {
801  return __builtin_altivec_vaddecuq(__a, __b, __c);
802 }
803 #endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)
804 
805 /* vec_and */
806 
807 #define __builtin_altivec_vand vec_and
808 
809 static __inline__ vector signed char __ATTRS_o_ai
810 vec_and(vector signed char __a, vector signed char __b) {
811  return __a & __b;
812 }
813 
814 static __inline__ vector signed char __ATTRS_o_ai
815 vec_and(vector bool char __a, vector signed char __b) {
816  return (vector signed char)__a & __b;
817 }
818 
819 static __inline__ vector signed char __ATTRS_o_ai
820 vec_and(vector signed char __a, vector bool char __b) {
821  return __a & (vector signed char)__b;
822 }
823 
824 static __inline__ vector unsigned char __ATTRS_o_ai
825 vec_and(vector unsigned char __a, vector unsigned char __b) {
826  return __a & __b;
827 }
828 
829 static __inline__ vector unsigned char __ATTRS_o_ai
830 vec_and(vector bool char __a, vector unsigned char __b) {
831  return (vector unsigned char)__a & __b;
832 }
833 
834 static __inline__ vector unsigned char __ATTRS_o_ai
835 vec_and(vector unsigned char __a, vector bool char __b) {
836  return __a & (vector unsigned char)__b;
837 }
838 
839 static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,
840  vector bool char __b) {
841  return __a & __b;
842 }
843 
844 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
845  vector short __b) {
846  return __a & __b;
847 }
848 
849 static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,
850  vector short __b) {
851  return (vector short)__a & __b;
852 }
853 
854 static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,
855  vector bool short __b) {
856  return __a & (vector short)__b;
857 }
858 
859 static __inline__ vector unsigned short __ATTRS_o_ai
860 vec_and(vector unsigned short __a, vector unsigned short __b) {
861  return __a & __b;
862 }
863 
864 static __inline__ vector unsigned short __ATTRS_o_ai
865 vec_and(vector bool short __a, vector unsigned short __b) {
866  return (vector unsigned short)__a & __b;
867 }
868 
869 static __inline__ vector unsigned short __ATTRS_o_ai
870 vec_and(vector unsigned short __a, vector bool short __b) {
871  return __a & (vector unsigned short)__b;
872 }
873 
874 static __inline__ vector bool short __ATTRS_o_ai
875 vec_and(vector bool short __a, vector bool short __b) {
876  return __a & __b;
877 }
878 
879 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
880  vector int __b) {
881  return __a & __b;
882 }
883 
884 static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,
885  vector int __b) {
886  return (vector int)__a & __b;
887 }
888 
889 static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,
890  vector bool int __b) {
891  return __a & (vector int)__b;
892 }
893 
894 static __inline__ vector unsigned int __ATTRS_o_ai
895 vec_and(vector unsigned int __a, vector unsigned int __b) {
896  return __a & __b;
897 }
898 
899 static __inline__ vector unsigned int __ATTRS_o_ai
900 vec_and(vector bool int __a, vector unsigned int __b) {
901  return (vector unsigned int)__a & __b;
902 }
903 
904 static __inline__ vector unsigned int __ATTRS_o_ai
905 vec_and(vector unsigned int __a, vector bool int __b) {
906  return __a & (vector unsigned int)__b;
907 }
908 
909 static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,
910  vector bool int __b) {
911  return __a & __b;
912 }
913 
914 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
915  vector float __b) {
916  vector unsigned int __res =
917  (vector unsigned int)__a & (vector unsigned int)__b;
918  return (vector float)__res;
919 }
920 
921 static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,
922  vector float __b) {
923  vector unsigned int __res =
924  (vector unsigned int)__a & (vector unsigned int)__b;
925  return (vector float)__res;
926 }
927 
928 static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,
929  vector bool int __b) {
930  vector unsigned int __res =
931  (vector unsigned int)__a & (vector unsigned int)__b;
932  return (vector float)__res;
933 }
934 
935 #ifdef __VSX__
936 static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,
937  vector double __b) {
938  vector unsigned long long __res =
939  (vector unsigned long long)__a & (vector unsigned long long)__b;
940  return (vector double)__res;
941 }
942 
943 static __inline__ vector double __ATTRS_o_ai
944 vec_and(vector double __a, vector bool long long __b) {
945  vector unsigned long long __res =
946  (vector unsigned long long)__a & (vector unsigned long long)__b;
947  return (vector double)__res;
948 }
949 
950 static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,
951  vector double __b) {
952  vector unsigned long long __res =
953  (vector unsigned long long)__a & (vector unsigned long long)__b;
954  return (vector double)__res;
955 }
956 
957 static __inline__ vector signed long long __ATTRS_o_ai
958 vec_and(vector signed long long __a, vector signed long long __b) {
959  return __a & __b;
960 }
961 
962 static __inline__ vector signed long long __ATTRS_o_ai
963 vec_and(vector bool long long __a, vector signed long long __b) {
964  return (vector signed long long)__a & __b;
965 }
966 
967 static __inline__ vector signed long long __ATTRS_o_ai
968 vec_and(vector signed long long __a, vector bool long long __b) {
969  return __a & (vector signed long long)__b;
970 }
971 
972 static __inline__ vector unsigned long long __ATTRS_o_ai
973 vec_and(vector unsigned long long __a, vector unsigned long long __b) {
974  return __a & __b;
975 }
976 
977 static __inline__ vector unsigned long long __ATTRS_o_ai
978 vec_and(vector bool long long __a, vector unsigned long long __b) {
979  return (vector unsigned long long)__a & __b;
980 }
981 
982 static __inline__ vector unsigned long long __ATTRS_o_ai
983 vec_and(vector unsigned long long __a, vector bool long long __b) {
984  return __a & (vector unsigned long long)__b;
985 }
986 
987 static __inline__ vector bool long long __ATTRS_o_ai
988 vec_and(vector bool long long __a, vector bool long long __b) {
989  return __a & __b;
990 }
991 #endif
992 
993 /* vec_vand */
994 
995 static __inline__ vector signed char __ATTRS_o_ai
996 vec_vand(vector signed char __a, vector signed char __b) {
997  return __a & __b;
998 }
999 
1000 static __inline__ vector signed char __ATTRS_o_ai
1001 vec_vand(vector bool char __a, vector signed char __b) {
1002  return (vector signed char)__a & __b;
1003 }
1004 
1005 static __inline__ vector signed char __ATTRS_o_ai
1006 vec_vand(vector signed char __a, vector bool char __b) {
1007  return __a & (vector signed char)__b;
1008 }
1009 
1010 static __inline__ vector unsigned char __ATTRS_o_ai
1011 vec_vand(vector unsigned char __a, vector unsigned char __b) {
1012  return __a & __b;
1013 }
1014 
1015 static __inline__ vector unsigned char __ATTRS_o_ai
1016 vec_vand(vector bool char __a, vector unsigned char __b) {
1017  return (vector unsigned char)__a & __b;
1018 }
1019 
1020 static __inline__ vector unsigned char __ATTRS_o_ai
1021 vec_vand(vector unsigned char __a, vector bool char __b) {
1022  return __a & (vector unsigned char)__b;
1023 }
1024 
1025 static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,
1026  vector bool char __b) {
1027  return __a & __b;
1028 }
1029 
1030 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1031  vector short __b) {
1032  return __a & __b;
1033 }
1034 
1035 static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,
1036  vector short __b) {
1037  return (vector short)__a & __b;
1038 }
1039 
1040 static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,
1041  vector bool short __b) {
1042  return __a & (vector short)__b;
1043 }
1044 
1045 static __inline__ vector unsigned short __ATTRS_o_ai
1046 vec_vand(vector unsigned short __a, vector unsigned short __b) {
1047  return __a & __b;
1048 }
1049 
1050 static __inline__ vector unsigned short __ATTRS_o_ai
1051 vec_vand(vector bool short __a, vector unsigned short __b) {
1052  return (vector unsigned short)__a & __b;
1053 }
1054 
1055 static __inline__ vector unsigned short __ATTRS_o_ai
1056 vec_vand(vector unsigned short __a, vector bool short __b) {
1057  return __a & (vector unsigned short)__b;
1058 }
1059 
1060 static __inline__ vector bool short __ATTRS_o_ai
1061 vec_vand(vector bool short __a, vector bool short __b) {
1062  return __a & __b;
1063 }
1064 
1065 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1066  vector int __b) {
1067  return __a & __b;
1068 }
1069 
1070 static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,
1071  vector int __b) {
1072  return (vector int)__a & __b;
1073 }
1074 
1075 static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,
1076  vector bool int __b) {
1077  return __a & (vector int)__b;
1078 }
1079 
1080 static __inline__ vector unsigned int __ATTRS_o_ai
1081 vec_vand(vector unsigned int __a, vector unsigned int __b) {
1082  return __a & __b;
1083 }
1084 
1085 static __inline__ vector unsigned int __ATTRS_o_ai
1086 vec_vand(vector bool int __a, vector unsigned int __b) {
1087  return (vector unsigned int)__a & __b;
1088 }
1089 
1090 static __inline__ vector unsigned int __ATTRS_o_ai
1091 vec_vand(vector unsigned int __a, vector bool int __b) {
1092  return __a & (vector unsigned int)__b;
1093 }
1094 
1095 static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,
1096  vector bool int __b) {
1097  return __a & __b;
1098 }
1099 
1100 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1101  vector float __b) {
1102  vector unsigned int __res =
1103  (vector unsigned int)__a & (vector unsigned int)__b;
1104  return (vector float)__res;
1105 }
1106 
1107 static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,
1108  vector float __b) {
1109  vector unsigned int __res =
1110  (vector unsigned int)__a & (vector unsigned int)__b;
1111  return (vector float)__res;
1112 }
1113 
1114 static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,
1115  vector bool int __b) {
1116  vector unsigned int __res =
1117  (vector unsigned int)__a & (vector unsigned int)__b;
1118  return (vector float)__res;
1119 }
1120 
1121 #ifdef __VSX__
1122 static __inline__ vector signed long long __ATTRS_o_ai
1123 vec_vand(vector signed long long __a, vector signed long long __b) {
1124  return __a & __b;
1125 }
1126 
1127 static __inline__ vector signed long long __ATTRS_o_ai
1128 vec_vand(vector bool long long __a, vector signed long long __b) {
1129  return (vector signed long long)__a & __b;
1130 }
1131 
1132 static __inline__ vector signed long long __ATTRS_o_ai
1133 vec_vand(vector signed long long __a, vector bool long long __b) {
1134  return __a & (vector signed long long)__b;
1135 }
1136 
1137 static __inline__ vector unsigned long long __ATTRS_o_ai
1138 vec_vand(vector unsigned long long __a, vector unsigned long long __b) {
1139  return __a & __b;
1140 }
1141 
1142 static __inline__ vector unsigned long long __ATTRS_o_ai
1143 vec_vand(vector bool long long __a, vector unsigned long long __b) {
1144  return (vector unsigned long long)__a & __b;
1145 }
1146 
1147 static __inline__ vector unsigned long long __ATTRS_o_ai
1148 vec_vand(vector unsigned long long __a, vector bool long long __b) {
1149  return __a & (vector unsigned long long)__b;
1150 }
1151 
1152 static __inline__ vector bool long long __ATTRS_o_ai
1153 vec_vand(vector bool long long __a, vector bool long long __b) {
1154  return __a & __b;
1155 }
1156 #endif
1157 
1158 /* vec_andc */
1159 
1160 #define __builtin_altivec_vandc vec_andc
1161 
1162 static __inline__ vector signed char __ATTRS_o_ai
1163 vec_andc(vector signed char __a, vector signed char __b) {
1164  return __a & ~__b;
1165 }
1166 
1167 static __inline__ vector signed char __ATTRS_o_ai
1168 vec_andc(vector bool char __a, vector signed char __b) {
1169  return (vector signed char)__a & ~__b;
1170 }
1171 
1172 static __inline__ vector signed char __ATTRS_o_ai
1173 vec_andc(vector signed char __a, vector bool char __b) {
1174  return __a & ~(vector signed char)__b;
1175 }
1176 
1177 static __inline__ vector unsigned char __ATTRS_o_ai
1178 vec_andc(vector unsigned char __a, vector unsigned char __b) {
1179  return __a & ~__b;
1180 }
1181 
1182 static __inline__ vector unsigned char __ATTRS_o_ai
1183 vec_andc(vector bool char __a, vector unsigned char __b) {
1184  return (vector unsigned char)__a & ~__b;
1185 }
1186 
1187 static __inline__ vector unsigned char __ATTRS_o_ai
1188 vec_andc(vector unsigned char __a, vector bool char __b) {
1189  return __a & ~(vector unsigned char)__b;
1190 }
1191 
1192 static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,
1193  vector bool char __b) {
1194  return __a & ~__b;
1195 }
1196 
1197 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1198  vector short __b) {
1199  return __a & ~__b;
1200 }
1201 
1202 static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,
1203  vector short __b) {
1204  return (vector short)__a & ~__b;
1205 }
1206 
1207 static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,
1208  vector bool short __b) {
1209  return __a & ~(vector short)__b;
1210 }
1211 
1212 static __inline__ vector unsigned short __ATTRS_o_ai
1213 vec_andc(vector unsigned short __a, vector unsigned short __b) {
1214  return __a & ~__b;
1215 }
1216 
1217 static __inline__ vector unsigned short __ATTRS_o_ai
1218 vec_andc(vector bool short __a, vector unsigned short __b) {
1219  return (vector unsigned short)__a & ~__b;
1220 }
1221 
1222 static __inline__ vector unsigned short __ATTRS_o_ai
1223 vec_andc(vector unsigned short __a, vector bool short __b) {
1224  return __a & ~(vector unsigned short)__b;
1225 }
1226 
1227 static __inline__ vector bool short __ATTRS_o_ai
1228 vec_andc(vector bool short __a, vector bool short __b) {
1229  return __a & ~__b;
1230 }
1231 
1232 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1233  vector int __b) {
1234  return __a & ~__b;
1235 }
1236 
1237 static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,
1238  vector int __b) {
1239  return (vector int)__a & ~__b;
1240 }
1241 
1242 static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,
1243  vector bool int __b) {
1244  return __a & ~(vector int)__b;
1245 }
1246 
1247 static __inline__ vector unsigned int __ATTRS_o_ai
1248 vec_andc(vector unsigned int __a, vector unsigned int __b) {
1249  return __a & ~__b;
1250 }
1251 
1252 static __inline__ vector unsigned int __ATTRS_o_ai
1253 vec_andc(vector bool int __a, vector unsigned int __b) {
1254  return (vector unsigned int)__a & ~__b;
1255 }
1256 
1257 static __inline__ vector unsigned int __ATTRS_o_ai
1258 vec_andc(vector unsigned int __a, vector bool int __b) {
1259  return __a & ~(vector unsigned int)__b;
1260 }
1261 
1262 static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,
1263  vector bool int __b) {
1264  return __a & ~__b;
1265 }
1266 
1267 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1268  vector float __b) {
1269  vector unsigned int __res =
1270  (vector unsigned int)__a & ~(vector unsigned int)__b;
1271  return (vector float)__res;
1272 }
1273 
1274 static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,
1275  vector float __b) {
1276  vector unsigned int __res =
1277  (vector unsigned int)__a & ~(vector unsigned int)__b;
1278  return (vector float)__res;
1279 }
1280 
1281 static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,
1282  vector bool int __b) {
1283  vector unsigned int __res =
1284  (vector unsigned int)__a & ~(vector unsigned int)__b;
1285  return (vector float)__res;
1286 }
1287 
1288 #ifdef __VSX__
1289 static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,
1290  vector double __b) {
1291  vector unsigned long long __res =
1292  (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1293  return (vector double)__res;
1294 }
1295 
1296 static __inline__ vector double __ATTRS_o_ai
1297 vec_andc(vector double __a, vector bool long long __b) {
1298  vector unsigned long long __res =
1299  (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1300  return (vector double)__res;
1301 }
1302 
1303 static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,
1304  vector double __b) {
1305  vector unsigned long long __res =
1306  (vector unsigned long long)__a & ~(vector unsigned long long)__b;
1307  return (vector double)__res;
1308 }
1309 
1310 static __inline__ vector signed long long __ATTRS_o_ai
1311 vec_andc(vector signed long long __a, vector signed long long __b) {
1312  return __a & ~__b;
1313 }
1314 
1315 static __inline__ vector signed long long __ATTRS_o_ai
1316 vec_andc(vector bool long long __a, vector signed long long __b) {
1317  return (vector signed long long)__a & ~__b;
1318 }
1319 
1320 static __inline__ vector signed long long __ATTRS_o_ai
1321 vec_andc(vector signed long long __a, vector bool long long __b) {
1322  return __a & ~(vector signed long long)__b;
1323 }
1324 
1325 static __inline__ vector unsigned long long __ATTRS_o_ai
1326 vec_andc(vector unsigned long long __a, vector unsigned long long __b) {
1327  return __a & ~__b;
1328 }
1329 
1330 static __inline__ vector unsigned long long __ATTRS_o_ai
1331 vec_andc(vector bool long long __a, vector unsigned long long __b) {
1332  return (vector unsigned long long)__a & ~__b;
1333 }
1334 
1335 static __inline__ vector unsigned long long __ATTRS_o_ai
1336 vec_andc(vector unsigned long long __a, vector bool long long __b) {
1337  return __a & ~(vector unsigned long long)__b;
1338 }
1339 
1340 static __inline__ vector bool long long __ATTRS_o_ai
1341 vec_andc(vector bool long long __a, vector bool long long __b) {
1342  return __a & ~__b;
1343 }
1344 #endif
1345 
1346 /* vec_vandc */
1347 
1348 static __inline__ vector signed char __ATTRS_o_ai
1349 vec_vandc(vector signed char __a, vector signed char __b) {
1350  return __a & ~__b;
1351 }
1352 
1353 static __inline__ vector signed char __ATTRS_o_ai
1354 vec_vandc(vector bool char __a, vector signed char __b) {
1355  return (vector signed char)__a & ~__b;
1356 }
1357 
1358 static __inline__ vector signed char __ATTRS_o_ai
1359 vec_vandc(vector signed char __a, vector bool char __b) {
1360  return __a & ~(vector signed char)__b;
1361 }
1362 
1363 static __inline__ vector unsigned char __ATTRS_o_ai
1364 vec_vandc(vector unsigned char __a, vector unsigned char __b) {
1365  return __a & ~__b;
1366 }
1367 
1368 static __inline__ vector unsigned char __ATTRS_o_ai
1369 vec_vandc(vector bool char __a, vector unsigned char __b) {
1370  return (vector unsigned char)__a & ~__b;
1371 }
1372 
1373 static __inline__ vector unsigned char __ATTRS_o_ai
1374 vec_vandc(vector unsigned char __a, vector bool char __b) {
1375  return __a & ~(vector unsigned char)__b;
1376 }
1377 
1378 static __inline__ vector bool char __ATTRS_o_ai
1379 vec_vandc(vector bool char __a, vector bool char __b) {
1380  return __a & ~__b;
1381 }
1382 
1383 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1384  vector short __b) {
1385  return __a & ~__b;
1386 }
1387 
1388 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,
1389  vector short __b) {
1390  return (vector short)__a & ~__b;
1391 }
1392 
1393 static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,
1394  vector bool short __b) {
1395  return __a & ~(vector short)__b;
1396 }
1397 
1398 static __inline__ vector unsigned short __ATTRS_o_ai
1399 vec_vandc(vector unsigned short __a, vector unsigned short __b) {
1400  return __a & ~__b;
1401 }
1402 
1403 static __inline__ vector unsigned short __ATTRS_o_ai
1404 vec_vandc(vector bool short __a, vector unsigned short __b) {
1405  return (vector unsigned short)__a & ~__b;
1406 }
1407 
1408 static __inline__ vector unsigned short __ATTRS_o_ai
1409 vec_vandc(vector unsigned short __a, vector bool short __b) {
1410  return __a & ~(vector unsigned short)__b;
1411 }
1412 
1413 static __inline__ vector bool short __ATTRS_o_ai
1414 vec_vandc(vector bool short __a, vector bool short __b) {
1415  return __a & ~__b;
1416 }
1417 
1418 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1419  vector int __b) {
1420  return __a & ~__b;
1421 }
1422 
1423 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,
1424  vector int __b) {
1425  return (vector int)__a & ~__b;
1426 }
1427 
1428 static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,
1429  vector bool int __b) {
1430  return __a & ~(vector int)__b;
1431 }
1432 
1433 static __inline__ vector unsigned int __ATTRS_o_ai
1434 vec_vandc(vector unsigned int __a, vector unsigned int __b) {
1435  return __a & ~__b;
1436 }
1437 
1438 static __inline__ vector unsigned int __ATTRS_o_ai
1439 vec_vandc(vector bool int __a, vector unsigned int __b) {
1440  return (vector unsigned int)__a & ~__b;
1441 }
1442 
1443 static __inline__ vector unsigned int __ATTRS_o_ai
1444 vec_vandc(vector unsigned int __a, vector bool int __b) {
1445  return __a & ~(vector unsigned int)__b;
1446 }
1447 
1448 static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,
1449  vector bool int __b) {
1450  return __a & ~__b;
1451 }
1452 
1453 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1454  vector float __b) {
1455  vector unsigned int __res =
1456  (vector unsigned int)__a & ~(vector unsigned int)__b;
1457  return (vector float)__res;
1458 }
1459 
1460 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,
1461  vector float __b) {
1462  vector unsigned int __res =
1463  (vector unsigned int)__a & ~(vector unsigned int)__b;
1464  return (vector float)__res;
1465 }
1466 
1467 static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,
1468  vector bool int __b) {
1469  vector unsigned int __res =
1470  (vector unsigned int)__a & ~(vector unsigned int)__b;
1471  return (vector float)__res;
1472 }
1473 
1474 #ifdef __VSX__
1475 static __inline__ vector signed long long __ATTRS_o_ai
1476 vec_vandc(vector signed long long __a, vector signed long long __b) {
1477  return __a & ~__b;
1478 }
1479 
1480 static __inline__ vector signed long long __ATTRS_o_ai
1481 vec_vandc(vector bool long long __a, vector signed long long __b) {
1482  return (vector signed long long)__a & ~__b;
1483 }
1484 
1485 static __inline__ vector signed long long __ATTRS_o_ai
1486 vec_vandc(vector signed long long __a, vector bool long long __b) {
1487  return __a & ~(vector signed long long)__b;
1488 }
1489 
1490 static __inline__ vector unsigned long long __ATTRS_o_ai
1491 vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {
1492  return __a & ~__b;
1493 }
1494 
1495 static __inline__ vector unsigned long long __ATTRS_o_ai
1496 vec_vandc(vector bool long long __a, vector unsigned long long __b) {
1497  return (vector unsigned long long)__a & ~__b;
1498 }
1499 
1500 static __inline__ vector unsigned long long __ATTRS_o_ai
1501 vec_vandc(vector unsigned long long __a, vector bool long long __b) {
1502  return __a & ~(vector unsigned long long)__b;
1503 }
1504 
1505 static __inline__ vector bool long long __ATTRS_o_ai
1506 vec_vandc(vector bool long long __a, vector bool long long __b) {
1507  return __a & ~__b;
1508 }
1509 #endif
1510 
1511 /* vec_avg */
1512 
1513 static __inline__ vector signed char __ATTRS_o_ai
1514 vec_avg(vector signed char __a, vector signed char __b) {
1515  return __builtin_altivec_vavgsb(__a, __b);
1516 }
1517 
1518 static __inline__ vector unsigned char __ATTRS_o_ai
1519 vec_avg(vector unsigned char __a, vector unsigned char __b) {
1520  return __builtin_altivec_vavgub(__a, __b);
1521 }
1522 
1523 static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,
1524  vector short __b) {
1525  return __builtin_altivec_vavgsh(__a, __b);
1526 }
1527 
1528 static __inline__ vector unsigned short __ATTRS_o_ai
1529 vec_avg(vector unsigned short __a, vector unsigned short __b) {
1530  return __builtin_altivec_vavguh(__a, __b);
1531 }
1532 
1533 static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,
1534  vector int __b) {
1535  return __builtin_altivec_vavgsw(__a, __b);
1536 }
1537 
1538 static __inline__ vector unsigned int __ATTRS_o_ai
1539 vec_avg(vector unsigned int __a, vector unsigned int __b) {
1540  return __builtin_altivec_vavguw(__a, __b);
1541 }
1542 
1543 /* vec_vavgsb */
1544 
1545 static __inline__ vector signed char __attribute__((__always_inline__))
1546 vec_vavgsb(vector signed char __a, vector signed char __b) {
1547  return __builtin_altivec_vavgsb(__a, __b);
1548 }
1549 
1550 /* vec_vavgub */
1551 
1552 static __inline__ vector unsigned char __attribute__((__always_inline__))
1553 vec_vavgub(vector unsigned char __a, vector unsigned char __b) {
1554  return __builtin_altivec_vavgub(__a, __b);
1555 }
1556 
1557 /* vec_vavgsh */
1558 
1559 static __inline__ vector short __attribute__((__always_inline__))
1560 vec_vavgsh(vector short __a, vector short __b) {
1561  return __builtin_altivec_vavgsh(__a, __b);
1562 }
1563 
1564 /* vec_vavguh */
1565 
1566 static __inline__ vector unsigned short __attribute__((__always_inline__))
1567 vec_vavguh(vector unsigned short __a, vector unsigned short __b) {
1568  return __builtin_altivec_vavguh(__a, __b);
1569 }
1570 
1571 /* vec_vavgsw */
1572 
1573 static __inline__ vector int __attribute__((__always_inline__))
1574 vec_vavgsw(vector int __a, vector int __b) {
1575  return __builtin_altivec_vavgsw(__a, __b);
1576 }
1577 
1578 /* vec_vavguw */
1579 
1580 static __inline__ vector unsigned int __attribute__((__always_inline__))
1581 vec_vavguw(vector unsigned int __a, vector unsigned int __b) {
1582  return __builtin_altivec_vavguw(__a, __b);
1583 }
1584 
1585 /* vec_ceil */
1586 
1587 static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {
1588 #ifdef __VSX__
1589  return __builtin_vsx_xvrspip(__a);
1590 #else
1591  return __builtin_altivec_vrfip(__a);
1592 #endif
1593 }
1594 
1595 #ifdef __VSX__
1596 static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {
1597  return __builtin_vsx_xvrdpip(__a);
1598 }
1599 #endif
1600 
1601 /* vec_vrfip */
1602 
1603 static __inline__ vector float __attribute__((__always_inline__))
1604 vec_vrfip(vector float __a) {
1605  return __builtin_altivec_vrfip(__a);
1606 }
1607 
1608 /* vec_cmpb */
1609 
1610 static __inline__ vector int __attribute__((__always_inline__))
1611 vec_cmpb(vector float __a, vector float __b) {
1612  return __builtin_altivec_vcmpbfp(__a, __b);
1613 }
1614 
1615 /* vec_vcmpbfp */
1616 
1617 static __inline__ vector int __attribute__((__always_inline__))
1618 vec_vcmpbfp(vector float __a, vector float __b) {
1619  return __builtin_altivec_vcmpbfp(__a, __b);
1620 }
1621 
1622 /* vec_cmpeq */
1623 
1624 static __inline__ vector bool char __ATTRS_o_ai
1625 vec_cmpeq(vector signed char __a, vector signed char __b) {
1626  return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1627  (vector char)__b);
1628 }
1629 
1630 static __inline__ vector bool char __ATTRS_o_ai
1631 vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {
1632  return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1633  (vector char)__b);
1634 }
1635 
1636 static __inline__ vector bool char __ATTRS_o_ai
1637 vec_cmpeq(vector bool char __a, vector bool char __b) {
1638  return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
1639  (vector char)__b);
1640 }
1641 
1642 static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
1643  vector short __b) {
1644  return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
1645 }
1646 
1647 static __inline__ vector bool short __ATTRS_o_ai
1648 vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {
1649  return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1650  (vector short)__b);
1651 }
1652 
1653 static __inline__ vector bool short __ATTRS_o_ai
1654 vec_cmpeq(vector bool short __a, vector bool short __b) {
1655  return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
1656  (vector short)__b);
1657 }
1658 
1659 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
1660  vector int __b) {
1661  return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
1662 }
1663 
1664 static __inline__ vector bool int __ATTRS_o_ai
1665 vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {
1666  return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1667  (vector int)__b);
1668 }
1669 
1670 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
1671  vector bool int __b) {
1672  return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
1673  (vector int)__b);
1674 }
1675 
1676 #ifdef __POWER8_VECTOR__
1677 static __inline__ vector bool long long __ATTRS_o_ai
1678 vec_cmpeq(vector signed long long __a, vector signed long long __b) {
1679  return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);
1680 }
1681 
1682 static __inline__ vector bool long long __ATTRS_o_ai
1683 vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {
1684  return (vector bool long long)__builtin_altivec_vcmpequd(
1685  (vector long long)__a, (vector long long)__b);
1686 }
1687 
1688 static __inline__ vector bool long long __ATTRS_o_ai
1689 vec_cmpeq(vector bool long long __a, vector bool long long __b) {
1690  return (vector bool long long)__builtin_altivec_vcmpequd(
1691  (vector long long)__a, (vector long long)__b);
1692 }
1693 
1694 #endif
1695 
1696 static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
1697  vector float __b) {
1698 #ifdef __VSX__
1699  return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);
1700 #else
1701  return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
1702 #endif
1703 }
1704 
1705 #ifdef __VSX__
1706 static __inline__ vector bool long long __ATTRS_o_ai
1707 vec_cmpeq(vector double __a, vector double __b) {
1708  return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);
1709 }
1710 #endif
1711 
1712 #ifdef __POWER9_VECTOR__
1713 /* vec_cmpne */
1714 
1715 static __inline__ vector bool char __ATTRS_o_ai
1716 vec_cmpne(vector bool char __a, vector bool char __b) {
1717  return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1718  (vector char)__b);
1719 }
1720 
1721 static __inline__ vector bool char __ATTRS_o_ai
1722 vec_cmpne(vector signed char __a, vector signed char __b) {
1723  return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1724  (vector char)__b);
1725 }
1726 
1727 static __inline__ vector bool char __ATTRS_o_ai
1728 vec_cmpne(vector unsigned char __a, vector unsigned char __b) {
1729  return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,
1730  (vector char)__b);
1731 }
1732 
1733 static __inline__ vector bool short __ATTRS_o_ai
1734 vec_cmpne(vector bool short __a, vector bool short __b) {
1735  return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1736  (vector short)__b);
1737 }
1738 
1739 static __inline__ vector bool short __ATTRS_o_ai
1740 vec_cmpne(vector signed short __a, vector signed short __b) {
1741  return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1742  (vector short)__b);
1743 }
1744 
1745 static __inline__ vector bool short __ATTRS_o_ai
1746 vec_cmpne(vector unsigned short __a, vector unsigned short __b) {
1747  return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,
1748  (vector short)__b);
1749 }
1750 
1751 static __inline__ vector bool int __ATTRS_o_ai
1752 vec_cmpne(vector bool int __a, vector bool int __b) {
1753  return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1754  (vector int)__b);
1755 }
1756 
1757 static __inline__ vector bool int __ATTRS_o_ai
1758 vec_cmpne(vector signed int __a, vector signed int __b) {
1759  return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1760  (vector int)__b);
1761 }
1762 
1763 static __inline__ vector bool int __ATTRS_o_ai
1764 vec_cmpne(vector unsigned int __a, vector unsigned int __b) {
1765  return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1766  (vector int)__b);
1767 }
1768 
1769 static __inline__ vector bool long long __ATTRS_o_ai
1770 vec_cmpne(vector bool long long __a, vector bool long long __b) {
1771  return (vector bool long long)
1772  ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1773 }
1774 
1775 static __inline__ vector bool long long __ATTRS_o_ai
1776 vec_cmpne(vector signed long long __a, vector signed long long __b) {
1777  return (vector bool long long)
1778  ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1779 }
1780 
1781 static __inline__ vector bool long long __ATTRS_o_ai
1782 vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {
1783  return (vector bool long long)
1784  ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1785 }
1786 
1787 static __inline__ vector bool int __ATTRS_o_ai
1788 vec_cmpne(vector float __a, vector float __b) {
1789  return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,
1790  (vector int)__b);
1791 }
1792 
1793 static __inline__ vector bool long long __ATTRS_o_ai
1794 vec_cmpne(vector double __a, vector double __b) {
1795  return (vector bool long long)
1796  ~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));
1797 }
1798 
1799 /* vec_cmpnez */
1800 
1801 static __inline__ vector bool char __ATTRS_o_ai
1802 vec_cmpnez(vector signed char __a, vector signed char __b) {
1803  return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1804  (vector char)__b);
1805 }
1806 
1807 static __inline__ vector bool char __ATTRS_o_ai
1808 vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {
1809  return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,
1810  (vector char)__b);
1811 }
1812 
1813 static __inline__ vector bool short __ATTRS_o_ai
1814 vec_cmpnez(vector signed short __a, vector signed short __b) {
1815  return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1816  (vector short)__b);
1817 }
1818 
1819 static __inline__ vector bool short __ATTRS_o_ai
1820 vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {
1821  return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,
1822  (vector short)__b);
1823 }
1824 
1825 static __inline__ vector bool int __ATTRS_o_ai
1826 vec_cmpnez(vector signed int __a, vector signed int __b) {
1827  return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1828  (vector int)__b);
1829 }
1830 
1831 static __inline__ vector bool int __ATTRS_o_ai
1832 vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {
1833  return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,
1834  (vector int)__b);
1835 }
1836 
1837 static __inline__ signed int __ATTRS_o_ai
1838 vec_cntlz_lsbb(vector signed char __a) {
1839 #ifdef __LITTLE_ENDIAN__
1840  return __builtin_altivec_vctzlsbb(__a);
1841 #else
1842  return __builtin_altivec_vclzlsbb(__a);
1843 #endif
1844 }
1845 
1846 static __inline__ signed int __ATTRS_o_ai
1847 vec_cntlz_lsbb(vector unsigned char __a) {
1848 #ifdef __LITTLE_ENDIAN__
1849  return __builtin_altivec_vctzlsbb(__a);
1850 #else
1851  return __builtin_altivec_vclzlsbb(__a);
1852 #endif
1853 }
1854 
1855 static __inline__ signed int __ATTRS_o_ai
1856 vec_cnttz_lsbb(vector signed char __a) {
1857 #ifdef __LITTLE_ENDIAN__
1858  return __builtin_altivec_vclzlsbb(__a);
1859 #else
1860  return __builtin_altivec_vctzlsbb(__a);
1861 #endif
1862 }
1863 
1864 static __inline__ signed int __ATTRS_o_ai
1865 vec_cnttz_lsbb(vector unsigned char __a) {
1866 #ifdef __LITTLE_ENDIAN__
1867  return __builtin_altivec_vclzlsbb(__a);
1868 #else
1869  return __builtin_altivec_vctzlsbb(__a);
1870 #endif
1871 }
1872 
1873 static __inline__ vector unsigned int __ATTRS_o_ai
1874 vec_parity_lsbb(vector unsigned int __a) {
1875  return __builtin_altivec_vprtybw(__a);
1876 }
1877 
1878 static __inline__ vector unsigned int __ATTRS_o_ai
1879 vec_parity_lsbb(vector signed int __a) {
1880  return __builtin_altivec_vprtybw(__a);
1881 }
1882 
1883 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1884 vec_parity_lsbb(vector unsigned __int128 __a) {
1885  return __builtin_altivec_vprtybq(__a);
1886 }
1887 
1888 static __inline__ vector unsigned __int128 __ATTRS_o_ai
1889 vec_parity_lsbb(vector signed __int128 __a) {
1890  return __builtin_altivec_vprtybq(__a);
1891 }
1892 
1893 static __inline__ vector unsigned long long __ATTRS_o_ai
1894 vec_parity_lsbb(vector unsigned long long __a) {
1895  return __builtin_altivec_vprtybd(__a);
1896 }
1897 
1898 static __inline__ vector unsigned long long __ATTRS_o_ai
1899 vec_parity_lsbb(vector signed long long __a) {
1900  return __builtin_altivec_vprtybd(__a);
1901 }
1902 
1903 #endif
1904 
1905 /* vec_cmpgt */
1906 
1907 static __inline__ vector bool char __ATTRS_o_ai
1908 vec_cmpgt(vector signed char __a, vector signed char __b) {
1909  return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
1910 }
1911 
1912 static __inline__ vector bool char __ATTRS_o_ai
1913 vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {
1914  return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
1915 }
1916 
1917 static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,
1918  vector short __b) {
1919  return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
1920 }
1921 
1922 static __inline__ vector bool short __ATTRS_o_ai
1923 vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {
1924  return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
1925 }
1926 
1927 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,
1928  vector int __b) {
1929  return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
1930 }
1931 
1932 static __inline__ vector bool int __ATTRS_o_ai
1933 vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {
1934  return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
1935 }
1936 
1937 #ifdef __POWER8_VECTOR__
1938 static __inline__ vector bool long long __ATTRS_o_ai
1939 vec_cmpgt(vector signed long long __a, vector signed long long __b) {
1940  return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);
1941 }
1942 
1943 static __inline__ vector bool long long __ATTRS_o_ai
1944 vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {
1945  return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);
1946 }
1947 #endif
1948 
1949 static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,
1950  vector float __b) {
1951 #ifdef __VSX__
1952  return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);
1953 #else
1954  return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
1955 #endif
1956 }
1957 
1958 #ifdef __VSX__
1959 static __inline__ vector bool long long __ATTRS_o_ai
1960 vec_cmpgt(vector double __a, vector double __b) {
1961  return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);
1962 }
1963 #endif
1964 
1965 /* vec_cmpge */
1966 
1967 static __inline__ vector bool char __ATTRS_o_ai
1968 vec_cmpge(vector signed char __a, vector signed char __b) {
1969  return ~(vec_cmpgt(__b, __a));
1970 }
1971 
1972 static __inline__ vector bool char __ATTRS_o_ai
1973 vec_cmpge(vector unsigned char __a, vector unsigned char __b) {
1974  return ~(vec_cmpgt(__b, __a));
1975 }
1976 
1977 static __inline__ vector bool short __ATTRS_o_ai
1978 vec_cmpge(vector signed short __a, vector signed short __b) {
1979  return ~(vec_cmpgt(__b, __a));
1980 }
1981 
1982 static __inline__ vector bool short __ATTRS_o_ai
1983 vec_cmpge(vector unsigned short __a, vector unsigned short __b) {
1984  return ~(vec_cmpgt(__b, __a));
1985 }
1986 
1987 static __inline__ vector bool int __ATTRS_o_ai
1988 vec_cmpge(vector signed int __a, vector signed int __b) {
1989  return ~(vec_cmpgt(__b, __a));
1990 }
1991 
1992 static __inline__ vector bool int __ATTRS_o_ai
1993 vec_cmpge(vector unsigned int __a, vector unsigned int __b) {
1994  return ~(vec_cmpgt(__b, __a));
1995 }
1996 
1997 static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,
1998  vector float __b) {
1999 #ifdef __VSX__
2000  return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);
2001 #else
2002  return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2003 #endif
2004 }
2005 
2006 #ifdef __VSX__
2007 static __inline__ vector bool long long __ATTRS_o_ai
2008 vec_cmpge(vector double __a, vector double __b) {
2009  return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);
2010 }
2011 #endif
2012 
2013 #ifdef __POWER8_VECTOR__
2014 static __inline__ vector bool long long __ATTRS_o_ai
2015 vec_cmpge(vector signed long long __a, vector signed long long __b) {
2016  return ~(vec_cmpgt(__b, __a));
2017 }
2018 
2019 static __inline__ vector bool long long __ATTRS_o_ai
2020 vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {
2021  return ~(vec_cmpgt(__b, __a));
2022 }
2023 #endif
2024 
2025 /* vec_vcmpgefp */
2026 
2027 static __inline__ vector bool int __attribute__((__always_inline__))
2028 vec_vcmpgefp(vector float __a, vector float __b) {
2029  return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
2030 }
2031 
2032 /* vec_vcmpgtsb */
2033 
2034 static __inline__ vector bool char __attribute__((__always_inline__))
2035 vec_vcmpgtsb(vector signed char __a, vector signed char __b) {
2036  return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
2037 }
2038 
2039 /* vec_vcmpgtub */
2040 
2041 static __inline__ vector bool char __attribute__((__always_inline__))
2042 vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {
2043  return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
2044 }
2045 
2046 /* vec_vcmpgtsh */
2047 
2048 static __inline__ vector bool short __attribute__((__always_inline__))
2049 vec_vcmpgtsh(vector short __a, vector short __b) {
2050  return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
2051 }
2052 
2053 /* vec_vcmpgtuh */
2054 
2055 static __inline__ vector bool short __attribute__((__always_inline__))
2056 vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {
2057  return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
2058 }
2059 
2060 /* vec_vcmpgtsw */
2061 
2062 static __inline__ vector bool int __attribute__((__always_inline__))
2063 vec_vcmpgtsw(vector int __a, vector int __b) {
2064  return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
2065 }
2066 
2067 /* vec_vcmpgtuw */
2068 
2069 static __inline__ vector bool int __attribute__((__always_inline__))
2070 vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {
2071  return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
2072 }
2073 
2074 /* vec_vcmpgtfp */
2075 
2076 static __inline__ vector bool int __attribute__((__always_inline__))
2077 vec_vcmpgtfp(vector float __a, vector float __b) {
2078  return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
2079 }
2080 
2081 /* vec_cmple */
2082 
2083 static __inline__ vector bool char __ATTRS_o_ai
2084 vec_cmple(vector signed char __a, vector signed char __b) {
2085  return vec_cmpge(__b, __a);
2086 }
2087 
2088 static __inline__ vector bool char __ATTRS_o_ai
2089 vec_cmple(vector unsigned char __a, vector unsigned char __b) {
2090  return vec_cmpge(__b, __a);
2091 }
2092 
2093 static __inline__ vector bool short __ATTRS_o_ai
2094 vec_cmple(vector signed short __a, vector signed short __b) {
2095  return vec_cmpge(__b, __a);
2096 }
2097 
2098 static __inline__ vector bool short __ATTRS_o_ai
2099 vec_cmple(vector unsigned short __a, vector unsigned short __b) {
2100  return vec_cmpge(__b, __a);
2101 }
2102 
2103 static __inline__ vector bool int __ATTRS_o_ai
2104 vec_cmple(vector signed int __a, vector signed int __b) {
2105  return vec_cmpge(__b, __a);
2106 }
2107 
2108 static __inline__ vector bool int __ATTRS_o_ai
2109 vec_cmple(vector unsigned int __a, vector unsigned int __b) {
2110  return vec_cmpge(__b, __a);
2111 }
2112 
2113 static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,
2114  vector float __b) {
2115  return vec_cmpge(__b, __a);
2116 }
2117 
2118 #ifdef __VSX__
2119 static __inline__ vector bool long long __ATTRS_o_ai
2120 vec_cmple(vector double __a, vector double __b) {
2121  return vec_cmpge(__b, __a);
2122 }
2123 #endif
2124 
2125 #ifdef __POWER8_VECTOR__
2126 static __inline__ vector bool long long __ATTRS_o_ai
2127 vec_cmple(vector signed long long __a, vector signed long long __b) {
2128  return vec_cmpge(__b, __a);
2129 }
2130 
2131 static __inline__ vector bool long long __ATTRS_o_ai
2132 vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {
2133  return vec_cmpge(__b, __a);
2134 }
2135 #endif
2136 
2137 /* vec_cmplt */
2138 
2139 static __inline__ vector bool char __ATTRS_o_ai
2140 vec_cmplt(vector signed char __a, vector signed char __b) {
2141  return vec_cmpgt(__b, __a);
2142 }
2143 
2144 static __inline__ vector bool char __ATTRS_o_ai
2145 vec_cmplt(vector unsigned char __a, vector unsigned char __b) {
2146  return vec_cmpgt(__b, __a);
2147 }
2148 
2149 static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,
2150  vector short __b) {
2151  return vec_cmpgt(__b, __a);
2152 }
2153 
2154 static __inline__ vector bool short __ATTRS_o_ai
2155 vec_cmplt(vector unsigned short __a, vector unsigned short __b) {
2156  return vec_cmpgt(__b, __a);
2157 }
2158 
2159 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,
2160  vector int __b) {
2161  return vec_cmpgt(__b, __a);
2162 }
2163 
2164 static __inline__ vector bool int __ATTRS_o_ai
2165 vec_cmplt(vector unsigned int __a, vector unsigned int __b) {
2166  return vec_cmpgt(__b, __a);
2167 }
2168 
2169 static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,
2170  vector float __b) {
2171  return vec_cmpgt(__b, __a);
2172 }
2173 
2174 #ifdef __VSX__
2175 static __inline__ vector bool long long __ATTRS_o_ai
2176 vec_cmplt(vector double __a, vector double __b) {
2177  return vec_cmpgt(__b, __a);
2178 }
2179 #endif
2180 
2181 #ifdef __POWER8_VECTOR__
2182 static __inline__ vector bool long long __ATTRS_o_ai
2183 vec_cmplt(vector signed long long __a, vector signed long long __b) {
2184  return vec_cmpgt(__b, __a);
2185 }
2186 
2187 static __inline__ vector bool long long __ATTRS_o_ai
2188 vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {
2189  return vec_cmpgt(__b, __a);
2190 }
2191 
2192 /* vec_popcnt */
2193 
2194 static __inline__ vector signed char __ATTRS_o_ai
2195 vec_popcnt(vector signed char __a) {
2196  return __builtin_altivec_vpopcntb(__a);
2197 }
2198 static __inline__ vector unsigned char __ATTRS_o_ai
2199 vec_popcnt(vector unsigned char __a) {
2200  return __builtin_altivec_vpopcntb(__a);
2201 }
2202 static __inline__ vector signed short __ATTRS_o_ai
2203 vec_popcnt(vector signed short __a) {
2204  return __builtin_altivec_vpopcnth(__a);
2205 }
2206 static __inline__ vector unsigned short __ATTRS_o_ai
2207 vec_popcnt(vector unsigned short __a) {
2208  return __builtin_altivec_vpopcnth(__a);
2209 }
2210 static __inline__ vector signed int __ATTRS_o_ai
2211 vec_popcnt(vector signed int __a) {
2212  return __builtin_altivec_vpopcntw(__a);
2213 }
2214 static __inline__ vector unsigned int __ATTRS_o_ai
2215 vec_popcnt(vector unsigned int __a) {
2216  return __builtin_altivec_vpopcntw(__a);
2217 }
2218 static __inline__ vector signed long long __ATTRS_o_ai
2219 vec_popcnt(vector signed long long __a) {
2220  return __builtin_altivec_vpopcntd(__a);
2221 }
2222 static __inline__ vector unsigned long long __ATTRS_o_ai
2223 vec_popcnt(vector unsigned long long __a) {
2224  return __builtin_altivec_vpopcntd(__a);
2225 }
2226 
2227 /* vec_cntlz */
2228 
2229 static __inline__ vector signed char __ATTRS_o_ai
2230 vec_cntlz(vector signed char __a) {
2231  return __builtin_altivec_vclzb(__a);
2232 }
2233 static __inline__ vector unsigned char __ATTRS_o_ai
2234 vec_cntlz(vector unsigned char __a) {
2235  return __builtin_altivec_vclzb(__a);
2236 }
2237 static __inline__ vector signed short __ATTRS_o_ai
2238 vec_cntlz(vector signed short __a) {
2239  return __builtin_altivec_vclzh(__a);
2240 }
2241 static __inline__ vector unsigned short __ATTRS_o_ai
2242 vec_cntlz(vector unsigned short __a) {
2243  return __builtin_altivec_vclzh(__a);
2244 }
2245 static __inline__ vector signed int __ATTRS_o_ai
2246 vec_cntlz(vector signed int __a) {
2247  return __builtin_altivec_vclzw(__a);
2248 }
2249 static __inline__ vector unsigned int __ATTRS_o_ai
2250 vec_cntlz(vector unsigned int __a) {
2251  return __builtin_altivec_vclzw(__a);
2252 }
2253 static __inline__ vector signed long long __ATTRS_o_ai
2254 vec_cntlz(vector signed long long __a) {
2255  return __builtin_altivec_vclzd(__a);
2256 }
2257 static __inline__ vector unsigned long long __ATTRS_o_ai
2258 vec_cntlz(vector unsigned long long __a) {
2259  return __builtin_altivec_vclzd(__a);
2260 }
2261 #endif
2262 
2263 #ifdef __POWER9_VECTOR__
2264 
2265 /* vec_cnttz */
2266 
2267 static __inline__ vector signed char __ATTRS_o_ai
2268 vec_cnttz(vector signed char __a) {
2269  return __builtin_altivec_vctzb(__a);
2270 }
2271 static __inline__ vector unsigned char __ATTRS_o_ai
2272 vec_cnttz(vector unsigned char __a) {
2273  return __builtin_altivec_vctzb(__a);
2274 }
2275 static __inline__ vector signed short __ATTRS_o_ai
2276 vec_cnttz(vector signed short __a) {
2277  return __builtin_altivec_vctzh(__a);
2278 }
2279 static __inline__ vector unsigned short __ATTRS_o_ai
2280 vec_cnttz(vector unsigned short __a) {
2281  return __builtin_altivec_vctzh(__a);
2282 }
2283 static __inline__ vector signed int __ATTRS_o_ai
2284 vec_cnttz(vector signed int __a) {
2285  return __builtin_altivec_vctzw(__a);
2286 }
2287 static __inline__ vector unsigned int __ATTRS_o_ai
2288 vec_cnttz(vector unsigned int __a) {
2289  return __builtin_altivec_vctzw(__a);
2290 }
2291 static __inline__ vector signed long long __ATTRS_o_ai
2292 vec_cnttz(vector signed long long __a) {
2293  return __builtin_altivec_vctzd(__a);
2294 }
2295 static __inline__ vector unsigned long long __ATTRS_o_ai
2296 vec_cnttz(vector unsigned long long __a) {
2297  return __builtin_altivec_vctzd(__a);
2298 }
2299 
2300 /* vec_first_match_index */
2301 
2302 static __inline__ unsigned __ATTRS_o_ai
2303 vec_first_match_index(vector signed char __a, vector signed char __b) {
2304  vector unsigned long long __res =
2305 #ifdef __LITTLE_ENDIAN__
2306  vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2307 #else
2308  vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2309 #endif
2310  if (__res[0] == 64) {
2311  return (__res[1] + 64) >> 3;
2312  }
2313  return __res[0] >> 3;
2314 }
2315 
2316 static __inline__ unsigned __ATTRS_o_ai
2317 vec_first_match_index(vector unsigned char __a, vector unsigned char __b) {
2318  vector unsigned long long __res =
2319 #ifdef __LITTLE_ENDIAN__
2320  vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2321 #else
2322  vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2323 #endif
2324  if (__res[0] == 64) {
2325  return (__res[1] + 64) >> 3;
2326  }
2327  return __res[0] >> 3;
2328 }
2329 
2330 static __inline__ unsigned __ATTRS_o_ai
2331 vec_first_match_index(vector signed short __a, vector signed short __b) {
2332  vector unsigned long long __res =
2333 #ifdef __LITTLE_ENDIAN__
2334  vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2335 #else
2336  vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2337 #endif
2338  if (__res[0] == 64) {
2339  return (__res[1] + 64) >> 4;
2340  }
2341  return __res[0] >> 4;
2342 }
2343 
2344 static __inline__ unsigned __ATTRS_o_ai
2345 vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {
2346  vector unsigned long long __res =
2347 #ifdef __LITTLE_ENDIAN__
2348  vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2349 #else
2350  vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2351 #endif
2352  if (__res[0] == 64) {
2353  return (__res[1] + 64) >> 4;
2354  }
2355  return __res[0] >> 4;
2356 }
2357 
2358 static __inline__ unsigned __ATTRS_o_ai
2359 vec_first_match_index(vector signed int __a, vector signed int __b) {
2360  vector unsigned long long __res =
2361 #ifdef __LITTLE_ENDIAN__
2362  vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2363 #else
2364  vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2365 #endif
2366  if (__res[0] == 64) {
2367  return (__res[1] + 64) >> 5;
2368  }
2369  return __res[0] >> 5;
2370 }
2371 
2372 static __inline__ unsigned __ATTRS_o_ai
2373 vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {
2374  vector unsigned long long __res =
2375 #ifdef __LITTLE_ENDIAN__
2376  vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));
2377 #else
2378  vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));
2379 #endif
2380  if (__res[0] == 64) {
2381  return (__res[1] + 64) >> 5;
2382  }
2383  return __res[0] >> 5;
2384 }
2385 
2386 /* vec_first_match_or_eos_index */
2387 
2388 static __inline__ unsigned __ATTRS_o_ai
2389 vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {
2390  /* Compare the result of the comparison of two vectors with either and OR the
2391  result. Either the elements are equal or one will equal the comparison
2392  result if either is zero.
2393  */
2394  vector bool char __tmp1 = vec_cmpeq(__a, __b);
2395  vector bool char __tmp2 = __tmp1 |
2396  vec_cmpeq((vector signed char)__tmp1, __a) |
2397  vec_cmpeq((vector signed char)__tmp1, __b);
2398 
2399  vector unsigned long long __res =
2400 #ifdef __LITTLE_ENDIAN__
2401  vec_cnttz((vector unsigned long long)__tmp2);
2402 #else
2403  vec_cntlz((vector unsigned long long)__tmp2);
2404 #endif
2405  if (__res[0] == 64) {
2406  return (__res[1] + 64) >> 3;
2407  }
2408  return __res[0] >> 3;
2409 }
2410 
2411 static __inline__ unsigned __ATTRS_o_ai
2412 vec_first_match_or_eos_index(vector unsigned char __a,
2413  vector unsigned char __b) {
2414  vector bool char __tmp1 = vec_cmpeq(__a, __b);
2415  vector bool char __tmp2 = __tmp1 |
2416  vec_cmpeq((vector unsigned char)__tmp1, __a) |
2417  vec_cmpeq((vector unsigned char)__tmp1, __b);
2418 
2419  vector unsigned long long __res =
2420 #ifdef __LITTLE_ENDIAN__
2421  vec_cnttz((vector unsigned long long)__tmp2);
2422 #else
2423  vec_cntlz((vector unsigned long long)__tmp2);
2424 #endif
2425  if (__res[0] == 64) {
2426  return (__res[1] + 64) >> 3;
2427  }
2428  return __res[0] >> 3;
2429 }
2430 
2431 static __inline__ unsigned __ATTRS_o_ai
2432 vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
2433  vector bool short __tmp1 = vec_cmpeq(__a, __b);
2434  vector bool short __tmp2 = __tmp1 |
2435  vec_cmpeq((vector signed short)__tmp1, __a) |
2436  vec_cmpeq((vector signed short)__tmp1, __b);
2437 
2438  vector unsigned long long __res =
2439 #ifdef __LITTLE_ENDIAN__
2440  vec_cnttz((vector unsigned long long)__tmp2);
2441 #else
2442  vec_cntlz((vector unsigned long long)__tmp2);
2443 #endif
2444  if (__res[0] == 64) {
2445  return (__res[1] + 64) >> 4;
2446  }
2447  return __res[0] >> 4;
2448 }
2449 
2450 static __inline__ unsigned __ATTRS_o_ai
2451 vec_first_match_or_eos_index(vector unsigned short __a,
2452  vector unsigned short __b) {
2453  vector bool short __tmp1 = vec_cmpeq(__a, __b);
2454  vector bool short __tmp2 = __tmp1 |
2455  vec_cmpeq((vector unsigned short)__tmp1, __a) |
2456  vec_cmpeq((vector unsigned short)__tmp1, __b);
2457 
2458  vector unsigned long long __res =
2459 #ifdef __LITTLE_ENDIAN__
2460  vec_cnttz((vector unsigned long long)__tmp2);
2461 #else
2462  vec_cntlz((vector unsigned long long)__tmp2);
2463 #endif
2464  if (__res[0] == 64) {
2465  return (__res[1] + 64) >> 4;
2466  }
2467  return __res[0] >> 4;
2468 }
2469 
2470 static __inline__ unsigned __ATTRS_o_ai
2471 vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
2472  vector bool int __tmp1 = vec_cmpeq(__a, __b);
2473  vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
2474  vec_cmpeq((vector signed int)__tmp1, __b);
2475 
2476  vector unsigned long long __res =
2477 #ifdef __LITTLE_ENDIAN__
2478  vec_cnttz((vector unsigned long long)__tmp2);
2479 #else
2480  vec_cntlz((vector unsigned long long)__tmp2);
2481 #endif
2482  if (__res[0] == 64) {
2483  return (__res[1] + 64) >> 5;
2484  }
2485  return __res[0] >> 5;
2486 }
2487 
2488 static __inline__ unsigned __ATTRS_o_ai
2489 vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
2490  vector bool int __tmp1 = vec_cmpeq(__a, __b);
2491  vector bool int __tmp2 = __tmp1 |
2492  vec_cmpeq((vector unsigned int)__tmp1, __a) |
2493  vec_cmpeq((vector unsigned int)__tmp1, __b);
2494 
2495  vector unsigned long long __res =
2496 #ifdef __LITTLE_ENDIAN__
2497  vec_cnttz((vector unsigned long long)__tmp2);
2498 #else
2499  vec_cntlz((vector unsigned long long)__tmp2);
2500 #endif
2501  if (__res[0] == 64) {
2502  return (__res[1] + 64) >> 5;
2503  }
2504  return __res[0] >> 5;
2505 }
2506 
2507 /* vec_first_mismatch_index */
2508 
2509 static __inline__ unsigned __ATTRS_o_ai
2510 vec_first_mismatch_index(vector signed char __a, vector signed char __b) {
2511  vector unsigned long long __res =
2512 #ifdef __LITTLE_ENDIAN__
2513  vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2514 #else
2515  vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2516 #endif
2517  if (__res[0] == 64) {
2518  return (__res[1] + 64) >> 3;
2519  }
2520  return __res[0] >> 3;
2521 }
2522 
2523 static __inline__ unsigned __ATTRS_o_ai
2524 vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __b) {
2525  vector unsigned long long __res =
2526 #ifdef __LITTLE_ENDIAN__
2527  vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2528 #else
2529  vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2530 #endif
2531  if (__res[0] == 64) {
2532  return (__res[1] + 64) >> 3;
2533  }
2534  return __res[0] >> 3;
2535 }
2536 
2537 static __inline__ unsigned __ATTRS_o_ai
2538 vec_first_mismatch_index(vector signed short __a, vector signed short __b) {
2539  vector unsigned long long __res =
2540 #ifdef __LITTLE_ENDIAN__
2541  vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2542 #else
2543  vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2544 #endif
2545  if (__res[0] == 64) {
2546  return (__res[1] + 64) >> 4;
2547  }
2548  return __res[0] >> 4;
2549 }
2550 
2551 static __inline__ unsigned __ATTRS_o_ai
2552 vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {
2553  vector unsigned long long __res =
2554 #ifdef __LITTLE_ENDIAN__
2555  vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2556 #else
2557  vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2558 #endif
2559  if (__res[0] == 64) {
2560  return (__res[1] + 64) >> 4;
2561  }
2562  return __res[0] >> 4;
2563 }
2564 
2565 static __inline__ unsigned __ATTRS_o_ai
2566 vec_first_mismatch_index(vector signed int __a, vector signed int __b) {
2567  vector unsigned long long __res =
2568 #ifdef __LITTLE_ENDIAN__
2569  vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2570 #else
2571  vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2572 #endif
2573  if (__res[0] == 64) {
2574  return (__res[1] + 64) >> 5;
2575  }
2576  return __res[0] >> 5;
2577 }
2578 
2579 static __inline__ unsigned __ATTRS_o_ai
2580 vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {
2581  vector unsigned long long __res =
2582 #ifdef __LITTLE_ENDIAN__
2583  vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));
2584 #else
2585  vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));
2586 #endif
2587  if (__res[0] == 64) {
2588  return (__res[1] + 64) >> 5;
2589  }
2590  return __res[0] >> 5;
2591 }
2592 
2593 /* vec_first_mismatch_or_eos_index */
2594 
2595 static __inline__ unsigned __ATTRS_o_ai
2596 vec_first_mismatch_or_eos_index(vector signed char __a,
2597  vector signed char __b) {
2598  vector unsigned long long __res =
2599 #ifdef __LITTLE_ENDIAN__
2600  vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2601 #else
2602  vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2603 #endif
2604  if (__res[0] == 64) {
2605  return (__res[1] + 64) >> 3;
2606  }
2607  return __res[0] >> 3;
2608 }
2609 
2610 static __inline__ unsigned __ATTRS_o_ai
2611 vec_first_mismatch_or_eos_index(vector unsigned char __a,
2612  vector unsigned char __b) {
2613  vector unsigned long long __res =
2614 #ifdef __LITTLE_ENDIAN__
2615  vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2616 #else
2617  vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2618 #endif
2619  if (__res[0] == 64) {
2620  return (__res[1] + 64) >> 3;
2621  }
2622  return __res[0] >> 3;
2623 }
2624 
2625 static __inline__ unsigned __ATTRS_o_ai
2626 vec_first_mismatch_or_eos_index(vector signed short __a,
2627  vector signed short __b) {
2628  vector unsigned long long __res =
2629 #ifdef __LITTLE_ENDIAN__
2630  vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2631 #else
2632  vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2633 #endif
2634  if (__res[0] == 64) {
2635  return (__res[1] + 64) >> 4;
2636  }
2637  return __res[0] >> 4;
2638 }
2639 
2640 static __inline__ unsigned __ATTRS_o_ai
2641 vec_first_mismatch_or_eos_index(vector unsigned short __a,
2642  vector unsigned short __b) {
2643  vector unsigned long long __res =
2644 #ifdef __LITTLE_ENDIAN__
2645  vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2646 #else
2647  vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2648 #endif
2649  if (__res[0] == 64) {
2650  return (__res[1] + 64) >> 4;
2651  }
2652  return __res[0] >> 4;
2653 }
2654 
2655 static __inline__ unsigned __ATTRS_o_ai
2656 vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {
2657  vector unsigned long long __res =
2658 #ifdef __LITTLE_ENDIAN__
2659  vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2660 #else
2661  vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2662 #endif
2663  if (__res[0] == 64) {
2664  return (__res[1] + 64) >> 5;
2665  }
2666  return __res[0] >> 5;
2667 }
2668 
2669 static __inline__ unsigned __ATTRS_o_ai
2670 vec_first_mismatch_or_eos_index(vector unsigned int __a,
2671  vector unsigned int __b) {
2672  vector unsigned long long __res =
2673 #ifdef __LITTLE_ENDIAN__
2674  vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));
2675 #else
2676  vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));
2677 #endif
2678  if (__res[0] == 64) {
2679  return (__res[1] + 64) >> 5;
2680  }
2681  return __res[0] >> 5;
2682 }
2683 
2684 static __inline__ vector double __ATTRS_o_ai
2685 vec_insert_exp(vector double __a, vector unsigned long long __b) {
2686  return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);
2687 }
2688 
2689 static __inline__ vector double __ATTRS_o_ai
2690 vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {
2691  return __builtin_vsx_xviexpdp(__a,__b);
2692 }
2693 
2694 static __inline__ vector float __ATTRS_o_ai
2695 vec_insert_exp(vector float __a, vector unsigned int __b) {
2696  return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);
2697 }
2698 
2699 static __inline__ vector float __ATTRS_o_ai
2700 vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {
2701  return __builtin_vsx_xviexpsp(__a,__b);
2702 }
2703 
2704 #if defined(__powerpc64__)
2705 static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(signed char *__a,
2706  size_t __b) {
2707  return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));
2708 }
2709 
2710 static __inline__ vector unsigned char __ATTRS_o_ai
2711 vec_xl_len(unsigned char *__a, size_t __b) {
2712  return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));
2713 }
2714 
2715 static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(signed short *__a,
2716  size_t __b) {
2717  return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));
2718 }
2719 
2720 static __inline__ vector unsigned short __ATTRS_o_ai
2721 vec_xl_len(unsigned short *__a, size_t __b) {
2722  return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));
2723 }
2724 
2725 static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(signed int *__a,
2726  size_t __b) {
2727  return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));
2728 }
2729 
2730 static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(unsigned int *__a,
2731  size_t __b) {
2732  return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));
2733 }
2734 
2735 static __inline__ vector float __ATTRS_o_ai vec_xl_len(float *__a, size_t __b) {
2736  return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));
2737 }
2738 
2739 static __inline__ vector signed __int128 __ATTRS_o_ai
2740 vec_xl_len(signed __int128 *__a, size_t __b) {
2741  return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2742 }
2743 
2744 static __inline__ vector unsigned __int128 __ATTRS_o_ai
2745 vec_xl_len(unsigned __int128 *__a, size_t __b) {
2746  return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));
2747 }
2748 
2749 static __inline__ vector signed long long __ATTRS_o_ai
2750 vec_xl_len(signed long long *__a, size_t __b) {
2751  return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));
2752 }
2753 
2754 static __inline__ vector unsigned long long __ATTRS_o_ai
2755 vec_xl_len(unsigned long long *__a, size_t __b) {
2756  return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));
2757 }
2758 
2759 static __inline__ vector double __ATTRS_o_ai vec_xl_len(double *__a,
2760  size_t __b) {
2761  return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));
2762 }
2763 
2764 static __inline__ vector double __ATTRS_o_ai vec_xl_len_r(unsigned char *__a,
2765  size_t __b) {
2766  vector unsigned char __res =
2767  (vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));
2768 #ifdef __LITTLE_ENDIAN__
2769  vector unsigned char __mask =
2770  (vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);
2771  __res = (vector unsigned char)__builtin_altivec_vperm_4si(
2772  (vector int)__res, (vector int)__res, __mask);
2773 #endif
2774  return __res;
2775 }
2776 
2777 // vec_xst_len
2778 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,
2779  unsigned char *__b,
2780  size_t __c) {
2781  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2782 }
2783 
2784 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,
2785  signed char *__b, size_t __c) {
2786  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2787 }
2788 
2789 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,
2790  signed short *__b, size_t __c) {
2791  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2792 }
2793 
2794 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,
2795  unsigned short *__b,
2796  size_t __c) {
2797  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2798 }
2799 
2800 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,
2801  signed int *__b, size_t __c) {
2802  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2803 }
2804 
2805 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,
2806  unsigned int *__b, size_t __c) {
2807  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2808 }
2809 
2810 static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,
2811  size_t __c) {
2812  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2813 }
2814 
2815 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,
2816  signed __int128 *__b,
2817  size_t __c) {
2818  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2819 }
2820 
2821 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,
2822  unsigned __int128 *__b,
2823  size_t __c) {
2824  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2825 }
2826 
2827 static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,
2828  signed long long *__b,
2829  size_t __c) {
2830  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2831 }
2832 
2833 static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,
2834  unsigned long long *__b,
2835  size_t __c) {
2836  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2837 }
2838 
2839 static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,
2840  size_t __c) {
2841  return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));
2842 }
2843 
2844 static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,
2845  unsigned char *__b,
2846  size_t __c) {
2847 #ifdef __LITTLE_ENDIAN__
2848  vector unsigned char __mask =
2849  (vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);
2850  vector unsigned char __res =
2851  __builtin_altivec_vperm_4si((vector int)__a, (vector int)__a, __mask);
2852  return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));
2853 #else
2854  return __builtin_vsx_stxvll((vector int)__a, __b, (__c << 56));
2855 #endif
2856 }
2857 #endif
2858 #endif
2859 
2860 /* vec_cpsgn */
2861 
2862 #ifdef __VSX__
2863 static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,
2864  vector float __b) {
2865  return __builtin_vsx_xvcpsgnsp(__a, __b);
2866 }
2867 
2868 static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,
2869  vector double __b) {
2870  return __builtin_vsx_xvcpsgndp(__a, __b);
2871 }
2872 #endif
2873 
2874 /* vec_ctf */
2875 
2876 #ifdef __VSX__
2877 #define vec_ctf(__a, __b) \
2878  _Generic((__a), vector int \
2879  : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2880  vector unsigned int \
2881  : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)), \
2882  vector unsigned long long \
2883  : (__builtin_convertvector((vector unsigned long long)(__a), \
2884  vector double) * \
2885  (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2886  << 52)), \
2887  vector signed long long \
2888  : (__builtin_convertvector((vector signed long long)(__a), \
2889  vector double) * \
2890  (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2891  << 52)))
2892 #else
2893 #define vec_ctf(__a, __b) \
2894  _Generic((__a), vector int \
2895  : (vector float)__builtin_altivec_vcfsx((__a), (__b)), \
2896  vector unsigned int \
2897  : (vector float)__builtin_altivec_vcfux((vector int)(__a), (__b)))
2898 #endif
2899 
2900 /* vec_vcfsx */
2901 
2902 #define vec_vcfux __builtin_altivec_vcfux
2903 
2904 /* vec_vcfux */
2905 
2906 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2907 
2908 /* vec_cts */
2909 
2910 #ifdef __VSX__
2911 #define vec_cts(__a, __b) \
2912  _Generic((__a), vector float \
2913  : __builtin_altivec_vctsxs((__a), (__b)), vector double \
2914  : __extension__({ \
2915  vector double __ret = \
2916  (__a) * \
2917  (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2918  << 52); \
2919  __builtin_convertvector(__ret, vector signed long long); \
2920  }))
2921 #else
2922 #define vec_cts __builtin_altivec_vctsxs
2923 #endif
2924 
2925 /* vec_vctsxs */
2926 
2927 #define vec_vctsxs __builtin_altivec_vctsxs
2928 
2929 /* vec_ctu */
2930 
2931 #ifdef __VSX__
2932 #define vec_ctu(__a, __b) \
2933  _Generic((__a), vector float \
2934  : __builtin_altivec_vctuxs((__a), (__b)), vector double \
2935  : __extension__({ \
2936  vector double __ret = \
2937  (__a) * \
2938  (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2939  << 52); \
2940  __builtin_convertvector(__ret, vector unsigned long long); \
2941  }))
2942 #else
2943 #define vec_ctu __builtin_altivec_vctuxs
2944 #endif
2945 
2946 /* vec_vctuxs */
2947 
2948 #define vec_vctuxs __builtin_altivec_vctuxs
2949 
2950 /* vec_signed */
2951 
2952 static __inline__ vector signed int __ATTRS_o_ai
2953 vec_sld(vector signed int, vector signed int, unsigned const int __c);
2954 
2955 static __inline__ vector signed int __ATTRS_o_ai
2956 vec_signed(vector float __a) {
2957  return __builtin_convertvector(__a, vector signed int);
2958 }
2959 
2960 #ifdef __VSX__
2961 static __inline__ vector signed long long __ATTRS_o_ai
2962 vec_signed(vector double __a) {
2963  return __builtin_convertvector(__a, vector signed long long);
2964 }
2965 
2966 static __inline__ vector signed int __attribute__((__always_inline__))
2967 vec_signed2(vector double __a, vector double __b) {
2968  return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
2969 }
2970 
2971 static __inline__ vector signed int __ATTRS_o_ai
2972 vec_signede(vector double __a) {
2973 #ifdef __LITTLE_ENDIAN__
2974  vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2975  return vec_sld(__ret, __ret, 12);
2976 #else
2977  return __builtin_vsx_xvcvdpsxws(__a);
2978 #endif
2979 }
2980 
2981 static __inline__ vector signed int __ATTRS_o_ai
2982 vec_signedo(vector double __a) {
2983 #ifdef __LITTLE_ENDIAN__
2984  return __builtin_vsx_xvcvdpsxws(__a);
2985 #else
2986  vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2987  return vec_sld(__ret, __ret, 12);
2988 #endif
2989 }
2990 #endif
2991 
2992 /* vec_unsigned */
2993 
2994 static __inline__ vector unsigned int __ATTRS_o_ai
2995 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
2996 
2997 static __inline__ vector unsigned int __ATTRS_o_ai
2998 vec_unsigned(vector float __a) {
2999  return __builtin_convertvector(__a, vector unsigned int);
3000 }
3001 
3002 #ifdef __VSX__
3003 static __inline__ vector unsigned long long __ATTRS_o_ai
3004 vec_unsigned(vector double __a) {
3005  return __builtin_convertvector(__a, vector unsigned long long);
3006 }
3007 
3008 static __inline__ vector unsigned int __attribute__((__always_inline__))
3009 vec_unsigned2(vector double __a, vector double __b) {
3010  return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3011 }
3012 
3013 static __inline__ vector unsigned int __ATTRS_o_ai
3014 vec_unsignede(vector double __a) {
3015 #ifdef __LITTLE_ENDIAN__
3016  vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3017  return vec_sld(__ret, __ret, 12);
3018 #else
3019  return __builtin_vsx_xvcvdpuxws(__a);
3020 #endif
3021 }
3022 
3023 static __inline__ vector unsigned int __ATTRS_o_ai
3024 vec_unsignedo(vector double __a) {
3025 #ifdef __LITTLE_ENDIAN__
3026  return __builtin_vsx_xvcvdpuxws(__a);
3027 #else
3028  vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3029  return vec_sld(__ret, __ret, 12);
3030 #endif
3031 }
3032 #endif
3033 
3034 /* vec_float */
3035 
3036 static __inline__ vector float __ATTRS_o_ai
3037 vec_sld(vector float, vector float, unsigned const int __c);
3038 
3039 static __inline__ vector float __ATTRS_o_ai
3040 vec_float(vector signed int __a) {
3041  return __builtin_convertvector(__a, vector float);
3042 }
3043 
3044 static __inline__ vector float __ATTRS_o_ai
3045 vec_float(vector unsigned int __a) {
3046  return __builtin_convertvector(__a, vector float);
3047 }
3048 
3049 #ifdef __VSX__
3050 static __inline__ vector float __ATTRS_o_ai
3051 vec_float2(vector signed long long __a, vector signed long long __b) {
3052  return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3053 }
3054 
3055 static __inline__ vector float __ATTRS_o_ai
3056 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3057  return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3058 }
3059 
3060 static __inline__ vector float __ATTRS_o_ai
3061 vec_float2(vector double __a, vector double __b) {
3062  return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3063 }
3064 
3065 static __inline__ vector float __ATTRS_o_ai
3066 vec_floate(vector signed long long __a) {
3067 #ifdef __LITTLE_ENDIAN__
3068  vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3069  return vec_sld(__ret, __ret, 12);
3070 #else
3071  return __builtin_vsx_xvcvsxdsp(__a);
3072 #endif
3073 }
3074 
3075 static __inline__ vector float __ATTRS_o_ai
3076 vec_floate(vector unsigned long long __a) {
3077 #ifdef __LITTLE_ENDIAN__
3078  vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3079  return vec_sld(__ret, __ret, 12);
3080 #else
3081  return __builtin_vsx_xvcvuxdsp(__a);
3082 #endif
3083 }
3084 
3085 static __inline__ vector float __ATTRS_o_ai
3086 vec_floate(vector double __a) {
3087 #ifdef __LITTLE_ENDIAN__
3088  vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3089  return vec_sld(__ret, __ret, 12);
3090 #else
3091  return __builtin_vsx_xvcvdpsp(__a);
3092 #endif
3093 }
3094 
3095 static __inline__ vector float __ATTRS_o_ai
3096 vec_floato(vector signed long long __a) {
3097 #ifdef __LITTLE_ENDIAN__
3098  return __builtin_vsx_xvcvsxdsp(__a);
3099 #else
3100  vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3101  return vec_sld(__ret, __ret, 12);
3102 #endif
3103 }
3104 
3105 static __inline__ vector float __ATTRS_o_ai
3106 vec_floato(vector unsigned long long __a) {
3107 #ifdef __LITTLE_ENDIAN__
3108  return __builtin_vsx_xvcvuxdsp(__a);
3109 #else
3110  vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3111  return vec_sld(__ret, __ret, 12);
3112 #endif
3113 }
3114 
3115 static __inline__ vector float __ATTRS_o_ai
3116 vec_floato(vector double __a) {
3117 #ifdef __LITTLE_ENDIAN__
3118  return __builtin_vsx_xvcvdpsp(__a);
3119 #else
3120  vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3121  return vec_sld(__ret, __ret, 12);
3122 #endif
3123 }
3124 #endif
3125 
3126 /* vec_double */
3127 
3128 #ifdef __VSX__
3129 static __inline__ vector double __ATTRS_o_ai
3130 vec_double(vector signed long long __a) {
3131  return __builtin_convertvector(__a, vector double);
3132 }
3133 
3134 static __inline__ vector double __ATTRS_o_ai
3135 vec_double(vector unsigned long long __a) {
3136  return __builtin_convertvector(__a, vector double);
3137 }
3138 
3139 static __inline__ vector double __ATTRS_o_ai
3140 vec_doublee(vector signed int __a) {
3141 #ifdef __LITTLE_ENDIAN__
3142  return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3143 #else
3144  return __builtin_vsx_xvcvsxwdp(__a);
3145 #endif
3146 }
3147 
3148 static __inline__ vector double __ATTRS_o_ai
3149 vec_doublee(vector unsigned int __a) {
3150 #ifdef __LITTLE_ENDIAN__
3151  return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3152 #else
3153  return __builtin_vsx_xvcvuxwdp(__a);
3154 #endif
3155 }
3156 
3157 static __inline__ vector double __ATTRS_o_ai
3158 vec_doublee(vector float __a) {
3159 #ifdef __LITTLE_ENDIAN__
3160  return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3161 #else
3162  return __builtin_vsx_xvcvspdp(__a);
3163 #endif
3164 }
3165 
3166 static __inline__ vector double __ATTRS_o_ai
3167 vec_doubleh(vector signed int __a) {
3168  vector double __ret = {__a[0], __a[1]};
3169  return __ret;
3170 }
3171 
3172 static __inline__ vector double __ATTRS_o_ai
3173 vec_doubleh(vector unsigned int __a) {
3174  vector double __ret = {__a[0], __a[1]};
3175  return __ret;
3176 }
3177 
3178 static __inline__ vector double __ATTRS_o_ai
3179 vec_doubleh(vector float __a) {
3180  vector double __ret = {__a[0], __a[1]};
3181  return __ret;
3182 }
3183 
3184 static __inline__ vector double __ATTRS_o_ai
3185 vec_doublel(vector signed int __a) {
3186  vector double __ret = {__a[2], __a[3]};
3187  return __ret;
3188 }
3189 
3190 static __inline__ vector double __ATTRS_o_ai
3191 vec_doublel(vector unsigned int __a) {
3192  vector double __ret = {__a[2], __a[3]};
3193  return __ret;
3194 }
3195 
3196 static __inline__ vector double __ATTRS_o_ai
3197 vec_doublel(vector float __a) {
3198  vector double __ret = {__a[2], __a[3]};
3199  return __ret;
3200 }
3201 
3202 static __inline__ vector double __ATTRS_o_ai
3203 vec_doubleo(vector signed int __a) {
3204 #ifdef __LITTLE_ENDIAN__
3205  return __builtin_vsx_xvcvsxwdp(__a);
3206 #else
3207  return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3208 #endif
3209 }
3210 
3211 static __inline__ vector double __ATTRS_o_ai
3212 vec_doubleo(vector unsigned int __a) {
3213 #ifdef __LITTLE_ENDIAN__
3214  return __builtin_vsx_xvcvuxwdp(__a);
3215 #else
3216  return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3217 #endif
3218 }
3219 
3220 static __inline__ vector double __ATTRS_o_ai
3221 vec_doubleo(vector float __a) {
3222 #ifdef __LITTLE_ENDIAN__
3223  return __builtin_vsx_xvcvspdp(__a);
3224 #else
3225  return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3226 #endif
3227 }
3228 #endif
3229 
3230 /* vec_div */
3231 
3232 /* Integer vector divides (vectors are scalarized, elements divided
3233  and the vectors reassembled).
3234 */
3235 static __inline__ vector signed char __ATTRS_o_ai
3236 vec_div(vector signed char __a, vector signed char __b) {
3237  return __a / __b;
3238 }
3239 
3240 static __inline__ vector unsigned char __ATTRS_o_ai
3241 vec_div(vector unsigned char __a, vector unsigned char __b) {
3242  return __a / __b;
3243 }
3244 
3245 static __inline__ vector signed short __ATTRS_o_ai
3246 vec_div(vector signed short __a, vector signed short __b) {
3247  return __a / __b;
3248 }
3249 
3250 static __inline__ vector unsigned short __ATTRS_o_ai
3251 vec_div(vector unsigned short __a, vector unsigned short __b) {
3252  return __a / __b;
3253 }
3254 
3255 static __inline__ vector signed int __ATTRS_o_ai
3256 vec_div(vector signed int __a, vector signed int __b) {
3257  return __a / __b;
3258 }
3259 
3260 static __inline__ vector unsigned int __ATTRS_o_ai
3261 vec_div(vector unsigned int __a, vector unsigned int __b) {
3262  return __a / __b;
3263 }
3264 
3265 #ifdef __VSX__
3266 static __inline__ vector signed long long __ATTRS_o_ai
3267 vec_div(vector signed long long __a, vector signed long long __b) {
3268  return __a / __b;
3269 }
3270 
3271 static __inline__ vector unsigned long long __ATTRS_o_ai
3272 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3273  return __a / __b;
3274 }
3275 
3276 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3277  vector float __b) {
3278  return __a / __b;
3279 }
3280 
3281 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3282  vector double __b) {
3283  return __a / __b;
3284 }
3285 #endif
3286 
3287 /* vec_dss */
3288 
3289 static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {
3290  __builtin_altivec_dss(__a);
3291 }
3292 
3293 /* vec_dssall */
3294 
3295 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3296  __builtin_altivec_dssall();
3297 }
3298 
3299 /* vec_dst */
3300 #define vec_dst(__PTR, __CW, __STR) \
3301  __extension__( \
3302  { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3303 
3304 /* vec_dstst */
3305 #define vec_dstst(__PTR, __CW, __STR) \
3306  __extension__( \
3307  { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3308 
3309 /* vec_dststt */
3310 #define vec_dststt(__PTR, __CW, __STR) \
3311  __extension__( \
3312  { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3313 
3314 /* vec_dstt */
3315 #define vec_dstt(__PTR, __CW, __STR) \
3316  __extension__( \
3317  { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3318 
3319 /* vec_eqv */
3320 
3321 #ifdef __POWER8_VECTOR__
3322 static __inline__ vector signed char __ATTRS_o_ai
3323 vec_eqv(vector signed char __a, vector signed char __b) {
3324  return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3325  (vector unsigned int)__b);
3326 }
3327 
3328 static __inline__ vector unsigned char __ATTRS_o_ai
3329 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3330  return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3331  (vector unsigned int)__b);
3332 }
3333 
3334 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3335  vector bool char __b) {
3336  return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3337  (vector unsigned int)__b);
3338 }
3339 
3340 static __inline__ vector signed short __ATTRS_o_ai
3341 vec_eqv(vector signed short __a, vector signed short __b) {
3342  return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3343  (vector unsigned int)__b);
3344 }
3345 
3346 static __inline__ vector unsigned short __ATTRS_o_ai
3347 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3348  return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3349  (vector unsigned int)__b);
3350 }
3351 
3352 static __inline__ vector bool short __ATTRS_o_ai
3353 vec_eqv(vector bool short __a, vector bool short __b) {
3354  return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3355  (vector unsigned int)__b);
3356 }
3357 
3358 static __inline__ vector signed int __ATTRS_o_ai
3359 vec_eqv(vector signed int __a, vector signed int __b) {
3360  return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3361  (vector unsigned int)__b);
3362 }
3363 
3364 static __inline__ vector unsigned int __ATTRS_o_ai
3365 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3366  return __builtin_vsx_xxleqv(__a, __b);
3367 }
3368 
3369 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3370  vector bool int __b) {
3371  return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3372  (vector unsigned int)__b);
3373 }
3374 
3375 static __inline__ vector signed long long __ATTRS_o_ai
3376 vec_eqv(vector signed long long __a, vector signed long long __b) {
3377  return (vector signed long long)__builtin_vsx_xxleqv(
3378  (vector unsigned int)__a, (vector unsigned int)__b);
3379 }
3380 
3381 static __inline__ vector unsigned long long __ATTRS_o_ai
3382 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3383  return (vector unsigned long long)__builtin_vsx_xxleqv(
3384  (vector unsigned int)__a, (vector unsigned int)__b);
3385 }
3386 
3387 static __inline__ vector bool long long __ATTRS_o_ai
3388 vec_eqv(vector bool long long __a, vector bool long long __b) {
3389  return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3390  (vector unsigned int)__b);
3391 }
3392 
3393 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3394  vector float __b) {
3395  return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3396  (vector unsigned int)__b);
3397 }
3398 
3399 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3400  vector double __b) {
3401  return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3402  (vector unsigned int)__b);
3403 }
3404 #endif
3405 
3406 /* vec_expte */
3407 
3408 static __inline__ vector float __attribute__((__always_inline__))
3409 vec_expte(vector float __a) {
3410  return __builtin_altivec_vexptefp(__a);
3411 }
3412 
3413 /* vec_vexptefp */
3414 
3415 static __inline__ vector float __attribute__((__always_inline__))
3416 vec_vexptefp(vector float __a) {
3417  return __builtin_altivec_vexptefp(__a);
3418 }
3419 
3420 /* vec_floor */
3421 
3422 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3423 #ifdef __VSX__
3424  return __builtin_vsx_xvrspim(__a);
3425 #else
3426  return __builtin_altivec_vrfim(__a);
3427 #endif
3428 }
3429 
3430 #ifdef __VSX__
3431 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3432  return __builtin_vsx_xvrdpim(__a);
3433 }
3434 #endif
3435 
3436 /* vec_vrfim */
3437 
3438 static __inline__ vector float __attribute__((__always_inline__))
3439 vec_vrfim(vector float __a) {
3440  return __builtin_altivec_vrfim(__a);
3441 }
3442 
3443 /* vec_ld */
3444 
3445 static __inline__ vector signed char __ATTRS_o_ai
3446 vec_ld(int __a, const vector signed char *__b) {
3447  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3448 }
3449 
3450 static __inline__ vector signed char __ATTRS_o_ai
3451 vec_ld(int __a, const signed char *__b) {
3452  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3453 }
3454 
3455 static __inline__ vector unsigned char __ATTRS_o_ai
3456 vec_ld(int __a, const vector unsigned char *__b) {
3457  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3458 }
3459 
3460 static __inline__ vector unsigned char __ATTRS_o_ai
3461 vec_ld(int __a, const unsigned char *__b) {
3462  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3463 }
3464 
3465 static __inline__ vector bool char __ATTRS_o_ai
3466 vec_ld(int __a, const vector bool char *__b) {
3467  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3468 }
3469 
3470 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3471  const vector short *__b) {
3472  return (vector short)__builtin_altivec_lvx(__a, __b);
3473 }
3474 
3475 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3476  return (vector short)__builtin_altivec_lvx(__a, __b);
3477 }
3478 
3479 static __inline__ vector unsigned short __ATTRS_o_ai
3480 vec_ld(int __a, const vector unsigned short *__b) {
3481  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3482 }
3483 
3484 static __inline__ vector unsigned short __ATTRS_o_ai
3485 vec_ld(int __a, const unsigned short *__b) {
3486  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3487 }
3488 
3489 static __inline__ vector bool short __ATTRS_o_ai
3490 vec_ld(int __a, const vector bool short *__b) {
3491  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3492 }
3493 
3494 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3495  const vector pixel *__b) {
3496  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3497 }
3498 
3499 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3500  const vector int *__b) {
3501  return (vector int)__builtin_altivec_lvx(__a, __b);
3502 }
3503 
3504 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3505  return (vector int)__builtin_altivec_lvx(__a, __b);
3506 }
3507 
3508 static __inline__ vector unsigned int __ATTRS_o_ai
3509 vec_ld(int __a, const vector unsigned int *__b) {
3510  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3511 }
3512 
3513 static __inline__ vector unsigned int __ATTRS_o_ai
3514 vec_ld(int __a, const unsigned int *__b) {
3515  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3516 }
3517 
3518 static __inline__ vector bool int __ATTRS_o_ai
3519 vec_ld(int __a, const vector bool int *__b) {
3520  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3521 }
3522 
3523 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3524  const vector float *__b) {
3525  return (vector float)__builtin_altivec_lvx(__a, __b);
3526 }
3527 
3528 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3529  return (vector float)__builtin_altivec_lvx(__a, __b);
3530 }
3531 
3532 /* vec_lvx */
3533 
3534 static __inline__ vector signed char __ATTRS_o_ai
3535 vec_lvx(int __a, const vector signed char *__b) {
3536  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3537 }
3538 
3539 static __inline__ vector signed char __ATTRS_o_ai
3540 vec_lvx(int __a, const signed char *__b) {
3541  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3542 }
3543 
3544 static __inline__ vector unsigned char __ATTRS_o_ai
3545 vec_lvx(int __a, const vector unsigned char *__b) {
3546  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3547 }
3548 
3549 static __inline__ vector unsigned char __ATTRS_o_ai
3550 vec_lvx(int __a, const unsigned char *__b) {
3551  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3552 }
3553 
3554 static __inline__ vector bool char __ATTRS_o_ai
3555 vec_lvx(int __a, const vector bool char *__b) {
3556  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3557 }
3558 
3559 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3560  const vector short *__b) {
3561  return (vector short)__builtin_altivec_lvx(__a, __b);
3562 }
3563 
3564 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3565  return (vector short)__builtin_altivec_lvx(__a, __b);
3566 }
3567 
3568 static __inline__ vector unsigned short __ATTRS_o_ai
3569 vec_lvx(int __a, const vector unsigned short *__b) {
3570  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3571 }
3572 
3573 static __inline__ vector unsigned short __ATTRS_o_ai
3574 vec_lvx(int __a, const unsigned short *__b) {
3575  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3576 }
3577 
3578 static __inline__ vector bool short __ATTRS_o_ai
3579 vec_lvx(int __a, const vector bool short *__b) {
3580  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3581 }
3582 
3583 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3584  const vector pixel *__b) {
3585  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3586 }
3587 
3588 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3589  const vector int *__b) {
3590  return (vector int)__builtin_altivec_lvx(__a, __b);
3591 }
3592 
3593 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3594  return (vector int)__builtin_altivec_lvx(__a, __b);
3595 }
3596 
3597 static __inline__ vector unsigned int __ATTRS_o_ai
3598 vec_lvx(int __a, const vector unsigned int *__b) {
3599  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3600 }
3601 
3602 static __inline__ vector unsigned int __ATTRS_o_ai
3603 vec_lvx(int __a, const unsigned int *__b) {
3604  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3605 }
3606 
3607 static __inline__ vector bool int __ATTRS_o_ai
3608 vec_lvx(int __a, const vector bool int *__b) {
3609  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3610 }
3611 
3612 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3613  const vector float *__b) {
3614  return (vector float)__builtin_altivec_lvx(__a, __b);
3615 }
3616 
3617 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3618  return (vector float)__builtin_altivec_lvx(__a, __b);
3619 }
3620 
3621 /* vec_lde */
3622 
3623 static __inline__ vector signed char __ATTRS_o_ai
3624 vec_lde(int __a, const signed char *__b) {
3625  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3626 }
3627 
3628 static __inline__ vector unsigned char __ATTRS_o_ai
3629 vec_lde(int __a, const unsigned char *__b) {
3630  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3631 }
3632 
3633 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3634  return (vector short)__builtin_altivec_lvehx(__a, __b);
3635 }
3636 
3637 static __inline__ vector unsigned short __ATTRS_o_ai
3638 vec_lde(int __a, const unsigned short *__b) {
3639  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3640 }
3641 
3642 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3643  return (vector int)__builtin_altivec_lvewx(__a, __b);
3644 }
3645 
3646 static __inline__ vector unsigned int __ATTRS_o_ai
3647 vec_lde(int __a, const unsigned int *__b) {
3648  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3649 }
3650 
3651 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3652  return (vector float)__builtin_altivec_lvewx(__a, __b);
3653 }
3654 
3655 /* vec_lvebx */
3656 
3657 static __inline__ vector signed char __ATTRS_o_ai
3658 vec_lvebx(int __a, const signed char *__b) {
3659  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3660 }
3661 
3662 static __inline__ vector unsigned char __ATTRS_o_ai
3663 vec_lvebx(int __a, const unsigned char *__b) {
3664  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3665 }
3666 
3667 /* vec_lvehx */
3668 
3669 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3670  const short *__b) {
3671  return (vector short)__builtin_altivec_lvehx(__a, __b);
3672 }
3673 
3674 static __inline__ vector unsigned short __ATTRS_o_ai
3675 vec_lvehx(int __a, const unsigned short *__b) {
3676  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3677 }
3678 
3679 /* vec_lvewx */
3680 
3681 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3682  return (vector int)__builtin_altivec_lvewx(__a, __b);
3683 }
3684 
3685 static __inline__ vector unsigned int __ATTRS_o_ai
3686 vec_lvewx(int __a, const unsigned int *__b) {
3687  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3688 }
3689 
3690 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3691  const float *__b) {
3692  return (vector float)__builtin_altivec_lvewx(__a, __b);
3693 }
3694 
3695 /* vec_ldl */
3696 
3697 static __inline__ vector signed char __ATTRS_o_ai
3698 vec_ldl(int __a, const vector signed char *__b) {
3699  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3700 }
3701 
3702 static __inline__ vector signed char __ATTRS_o_ai
3703 vec_ldl(int __a, const signed char *__b) {
3704  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3705 }
3706 
3707 static __inline__ vector unsigned char __ATTRS_o_ai
3708 vec_ldl(int __a, const vector unsigned char *__b) {
3709  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3710 }
3711 
3712 static __inline__ vector unsigned char __ATTRS_o_ai
3713 vec_ldl(int __a, const unsigned char *__b) {
3714  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3715 }
3716 
3717 static __inline__ vector bool char __ATTRS_o_ai
3718 vec_ldl(int __a, const vector bool char *__b) {
3719  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3720 }
3721 
3722 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3723  const vector short *__b) {
3724  return (vector short)__builtin_altivec_lvxl(__a, __b);
3725 }
3726 
3727 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3728  return (vector short)__builtin_altivec_lvxl(__a, __b);
3729 }
3730 
3731 static __inline__ vector unsigned short __ATTRS_o_ai
3732 vec_ldl(int __a, const vector unsigned short *__b) {
3733  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3734 }
3735 
3736 static __inline__ vector unsigned short __ATTRS_o_ai
3737 vec_ldl(int __a, const unsigned short *__b) {
3738  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3739 }
3740 
3741 static __inline__ vector bool short __ATTRS_o_ai
3742 vec_ldl(int __a, const vector bool short *__b) {
3743  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3744 }
3745 
3746 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3747  const vector pixel *__b) {
3748  return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3749 }
3750 
3751 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3752  const vector int *__b) {
3753  return (vector int)__builtin_altivec_lvxl(__a, __b);
3754 }
3755 
3756 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3757  return (vector int)__builtin_altivec_lvxl(__a, __b);
3758 }
3759 
3760 static __inline__ vector unsigned int __ATTRS_o_ai
3761 vec_ldl(int __a, const vector unsigned int *__b) {
3762  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3763 }
3764 
3765 static __inline__ vector unsigned int __ATTRS_o_ai
3766 vec_ldl(int __a, const unsigned int *__b) {
3767  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3768 }
3769 
3770 static __inline__ vector bool int __ATTRS_o_ai
3771 vec_ldl(int __a, const vector bool int *__b) {
3772  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3773 }
3774 
3775 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3776  const vector float *__b) {
3777  return (vector float)__builtin_altivec_lvxl(__a, __b);
3778 }
3779 
3780 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3781  return (vector float)__builtin_altivec_lvxl(__a, __b);
3782 }
3783 
3784 /* vec_lvxl */
3785 
3786 static __inline__ vector signed char __ATTRS_o_ai
3787 vec_lvxl(int __a, const vector signed char *__b) {
3788  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3789 }
3790 
3791 static __inline__ vector signed char __ATTRS_o_ai
3792 vec_lvxl(int __a, const signed char *__b) {
3793  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3794 }
3795 
3796 static __inline__ vector unsigned char __ATTRS_o_ai
3797 vec_lvxl(int __a, const vector unsigned char *__b) {
3798  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3799 }
3800 
3801 static __inline__ vector unsigned char __ATTRS_o_ai
3802 vec_lvxl(int __a, const unsigned char *__b) {
3803  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3804 }
3805 
3806 static __inline__ vector bool char __ATTRS_o_ai
3807 vec_lvxl(int __a, const vector bool char *__b) {
3808  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3809 }
3810 
3811 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3812  const vector short *__b) {
3813  return (vector short)__builtin_altivec_lvxl(__a, __b);
3814 }
3815 
3816 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3817  const short *__b) {
3818  return (vector short)__builtin_altivec_lvxl(__a, __b);
3819 }
3820 
3821 static __inline__ vector unsigned short __ATTRS_o_ai
3822 vec_lvxl(int __a, const vector unsigned short *__b) {
3823  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3824 }
3825 
3826 static __inline__ vector unsigned short __ATTRS_o_ai
3827 vec_lvxl(int __a, const unsigned short *__b) {
3828  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3829 }
3830 
3831 static __inline__ vector bool short __ATTRS_o_ai
3832 vec_lvxl(int __a, const vector bool short *__b) {
3833  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3834 }
3835 
3836 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3837  const vector pixel *__b) {
3838  return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3839 }
3840 
3841 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3842  const vector int *__b) {
3843  return (vector int)__builtin_altivec_lvxl(__a, __b);
3844 }
3845 
3846 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3847  return (vector int)__builtin_altivec_lvxl(__a, __b);
3848 }
3849 
3850 static __inline__ vector unsigned int __ATTRS_o_ai
3851 vec_lvxl(int __a, const vector unsigned int *__b) {
3852  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3853 }
3854 
3855 static __inline__ vector unsigned int __ATTRS_o_ai
3856 vec_lvxl(int __a, const unsigned int *__b) {
3857  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3858 }
3859 
3860 static __inline__ vector bool int __ATTRS_o_ai
3861 vec_lvxl(int __a, const vector bool int *__b) {
3862  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3863 }
3864 
3865 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3866  const vector float *__b) {
3867  return (vector float)__builtin_altivec_lvxl(__a, __b);
3868 }
3869 
3870 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3871  const float *__b) {
3872  return (vector float)__builtin_altivec_lvxl(__a, __b);
3873 }
3874 
3875 /* vec_loge */
3876 
3877 static __inline__ vector float __attribute__((__always_inline__))
3878 vec_loge(vector float __a) {
3879  return __builtin_altivec_vlogefp(__a);
3880 }
3881 
3882 /* vec_vlogefp */
3883 
3884 static __inline__ vector float __attribute__((__always_inline__))
3885 vec_vlogefp(vector float __a) {
3886  return __builtin_altivec_vlogefp(__a);
3887 }
3888 
3889 /* vec_lvsl */
3890 
3891 #ifdef __LITTLE_ENDIAN__
3892 static __inline__ vector unsigned char __ATTRS_o_ai
3893  __attribute__((__deprecated__("use assignment for unaligned little endian \
3894 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3895  vector unsigned char mask =
3896  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3897  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3898  7, 6, 5, 4, 3, 2, 1, 0};
3899  return vec_perm(mask, mask, reverse);
3900 }
3901 #else
3902 static __inline__ vector unsigned char __ATTRS_o_ai
3903 vec_lvsl(int __a, const signed char *__b) {
3904  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3905 }
3906 #endif
3907 
3908 #ifdef __LITTLE_ENDIAN__
3909 static __inline__ vector unsigned char __ATTRS_o_ai
3910  __attribute__((__deprecated__("use assignment for unaligned little endian \
3911 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3912  vector unsigned char mask =
3913  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3914  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3915  7, 6, 5, 4, 3, 2, 1, 0};
3916  return vec_perm(mask, mask, reverse);
3917 }
3918 #else
3919 static __inline__ vector unsigned char __ATTRS_o_ai
3920 vec_lvsl(int __a, const unsigned char *__b) {
3921  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3922 }
3923 #endif
3924 
3925 #ifdef __LITTLE_ENDIAN__
3926 static __inline__ vector unsigned char __ATTRS_o_ai
3927  __attribute__((__deprecated__("use assignment for unaligned little endian \
3928 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3929  vector unsigned char mask =
3930  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3931  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3932  7, 6, 5, 4, 3, 2, 1, 0};
3933  return vec_perm(mask, mask, reverse);
3934 }
3935 #else
3936 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3937  const short *__b) {
3938  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3939 }
3940 #endif
3941 
3942 #ifdef __LITTLE_ENDIAN__
3943 static __inline__ vector unsigned char __ATTRS_o_ai
3944  __attribute__((__deprecated__("use assignment for unaligned little endian \
3945 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
3946  vector unsigned char mask =
3947  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3948  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3949  7, 6, 5, 4, 3, 2, 1, 0};
3950  return vec_perm(mask, mask, reverse);
3951 }
3952 #else
3953 static __inline__ vector unsigned char __ATTRS_o_ai
3954 vec_lvsl(int __a, const unsigned short *__b) {
3955  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3956 }
3957 #endif
3958 
3959 #ifdef __LITTLE_ENDIAN__
3960 static __inline__ vector unsigned char __ATTRS_o_ai
3961  __attribute__((__deprecated__("use assignment for unaligned little endian \
3962 loads/stores"))) vec_lvsl(int __a, const int *__b) {
3963  vector unsigned char mask =
3964  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3965  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3966  7, 6, 5, 4, 3, 2, 1, 0};
3967  return vec_perm(mask, mask, reverse);
3968 }
3969 #else
3970 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3971  const int *__b) {
3972  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3973 }
3974 #endif
3975 
3976 #ifdef __LITTLE_ENDIAN__
3977 static __inline__ vector unsigned char __ATTRS_o_ai
3978  __attribute__((__deprecated__("use assignment for unaligned little endian \
3979 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
3980  vector unsigned char mask =
3981  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3982  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3983  7, 6, 5, 4, 3, 2, 1, 0};
3984  return vec_perm(mask, mask, reverse);
3985 }
3986 #else
3987 static __inline__ vector unsigned char __ATTRS_o_ai
3988 vec_lvsl(int __a, const unsigned int *__b) {
3989  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3990 }
3991 #endif
3992 
3993 #ifdef __LITTLE_ENDIAN__
3994 static __inline__ vector unsigned char __ATTRS_o_ai
3995  __attribute__((__deprecated__("use assignment for unaligned little endian \
3996 loads/stores"))) vec_lvsl(int __a, const float *__b) {
3997  vector unsigned char mask =
3998  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3999  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4000  7, 6, 5, 4, 3, 2, 1, 0};
4001  return vec_perm(mask, mask, reverse);
4002 }
4003 #else
4004 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4005  const float *__b) {
4006  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4007 }
4008 #endif
4009 
4010 /* vec_lvsr */
4011 
4012 #ifdef __LITTLE_ENDIAN__
4013 static __inline__ vector unsigned char __ATTRS_o_ai
4014  __attribute__((__deprecated__("use assignment for unaligned little endian \
4015 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4016  vector unsigned char mask =
4017  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4018  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4019  7, 6, 5, 4, 3, 2, 1, 0};
4020  return vec_perm(mask, mask, reverse);
4021 }
4022 #else
4023 static __inline__ vector unsigned char __ATTRS_o_ai
4024 vec_lvsr(int __a, const signed char *__b) {
4025  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4026 }
4027 #endif
4028 
4029 #ifdef __LITTLE_ENDIAN__
4030 static __inline__ vector unsigned char __ATTRS_o_ai
4031  __attribute__((__deprecated__("use assignment for unaligned little endian \
4032 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4033  vector unsigned char mask =
4034  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4035  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4036  7, 6, 5, 4, 3, 2, 1, 0};
4037  return vec_perm(mask, mask, reverse);
4038 }
4039 #else
4040 static __inline__ vector unsigned char __ATTRS_o_ai
4041 vec_lvsr(int __a, const unsigned char *__b) {
4042  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4043 }
4044 #endif
4045 
4046 #ifdef __LITTLE_ENDIAN__
4047 static __inline__ vector unsigned char __ATTRS_o_ai
4048  __attribute__((__deprecated__("use assignment for unaligned little endian \
4049 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4050  vector unsigned char mask =
4051  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4052  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4053  7, 6, 5, 4, 3, 2, 1, 0};
4054  return vec_perm(mask, mask, reverse);
4055 }
4056 #else
4057 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4058  const short *__b) {
4059  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4060 }
4061 #endif
4062 
4063 #ifdef __LITTLE_ENDIAN__
4064 static __inline__ vector unsigned char __ATTRS_o_ai
4065  __attribute__((__deprecated__("use assignment for unaligned little endian \
4066 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4067  vector unsigned char mask =
4068  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4069  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4070  7, 6, 5, 4, 3, 2, 1, 0};
4071  return vec_perm(mask, mask, reverse);
4072 }
4073 #else
4074 static __inline__ vector unsigned char __ATTRS_o_ai
4075 vec_lvsr(int __a, const unsigned short *__b) {
4076  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4077 }
4078 #endif
4079 
4080 #ifdef __LITTLE_ENDIAN__
4081 static __inline__ vector unsigned char __ATTRS_o_ai
4082  __attribute__((__deprecated__("use assignment for unaligned little endian \
4083 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4084  vector unsigned char mask =
4085  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4086  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4087  7, 6, 5, 4, 3, 2, 1, 0};
4088  return vec_perm(mask, mask, reverse);
4089 }
4090 #else
4091 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4092  const int *__b) {
4093  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4094 }
4095 #endif
4096 
4097 #ifdef __LITTLE_ENDIAN__
4098 static __inline__ vector unsigned char __ATTRS_o_ai
4099  __attribute__((__deprecated__("use assignment for unaligned little endian \
4100 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4101  vector unsigned char mask =
4102  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4103  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4104  7, 6, 5, 4, 3, 2, 1, 0};
4105  return vec_perm(mask, mask, reverse);
4106 }
4107 #else
4108 static __inline__ vector unsigned char __ATTRS_o_ai
4109 vec_lvsr(int __a, const unsigned int *__b) {
4110  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4111 }
4112 #endif
4113 
4114 #ifdef __LITTLE_ENDIAN__
4115 static __inline__ vector unsigned char __ATTRS_o_ai
4116  __attribute__((__deprecated__("use assignment for unaligned little endian \
4117 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4118  vector unsigned char mask =
4119  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4120  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4121  7, 6, 5, 4, 3, 2, 1, 0};
4122  return vec_perm(mask, mask, reverse);
4123 }
4124 #else
4125 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4126  const float *__b) {
4127  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4128 }
4129 #endif
4130 
4131 /* vec_madd */
4132 static __inline__ vector signed short __ATTRS_o_ai
4133 vec_mladd(vector signed short, vector signed short, vector signed short);
4134 static __inline__ vector signed short __ATTRS_o_ai
4135 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4136 static __inline__ vector signed short __ATTRS_o_ai
4137 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4138 static __inline__ vector unsigned short __ATTRS_o_ai
4139 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4140 
4141 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4142  vector signed short __a, vector signed short __b, vector signed short __c) {
4143  return vec_mladd(__a, __b, __c);
4144 }
4145 
4146 static __inline__ vector signed short __ATTRS_o_ai
4147 vec_madd(vector signed short __a, vector unsigned short __b,
4148  vector unsigned short __c) {
4149  return vec_mladd(__a, __b, __c);
4150 }
4151 
4152 static __inline__ vector signed short __ATTRS_o_ai
4153 vec_madd(vector unsigned short __a, vector signed short __b,
4154  vector signed short __c) {
4155  return vec_mladd(__a, __b, __c);
4156 }
4157 
4158 static __inline__ vector unsigned short __ATTRS_o_ai
4159 vec_madd(vector unsigned short __a, vector unsigned short __b,
4160  vector unsigned short __c) {
4161  return vec_mladd(__a, __b, __c);
4162 }
4163 
4164 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4165  vector float __b,
4166  vector float __c) {
4167 #ifdef __VSX__
4168  return __builtin_vsx_xvmaddasp(__a, __b, __c);
4169 #else
4170  return __builtin_altivec_vmaddfp(__a, __b, __c);
4171 #endif
4172 }
4173 
4174 #ifdef __VSX__
4175 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4176  vector double __b,
4177  vector double __c) {
4178  return __builtin_vsx_xvmaddadp(__a, __b, __c);
4179 }
4180 #endif
4181 
4182 /* vec_vmaddfp */
4183 
4184 static __inline__ vector float __attribute__((__always_inline__))
4185 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4186  return __builtin_altivec_vmaddfp(__a, __b, __c);
4187 }
4188 
4189 /* vec_madds */
4190 
4191 static __inline__ vector signed short __attribute__((__always_inline__))
4192 vec_madds(vector signed short __a, vector signed short __b,
4193  vector signed short __c) {
4194  return __builtin_altivec_vmhaddshs(__a, __b, __c);
4195 }
4196 
4197 /* vec_vmhaddshs */
4198 static __inline__ vector signed short __attribute__((__always_inline__))
4199 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4200  vector signed short __c) {
4201  return __builtin_altivec_vmhaddshs(__a, __b, __c);
4202 }
4203 
4204 /* vec_msub */
4205 
4206 #ifdef __VSX__
4207 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4208  vector float __b,
4209  vector float __c) {
4210  return __builtin_vsx_xvmsubasp(__a, __b, __c);
4211 }
4212 
4213 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4214  vector double __b,
4215  vector double __c) {
4216  return __builtin_vsx_xvmsubadp(__a, __b, __c);
4217 }
4218 #endif
4219 
4220 /* vec_max */
4221 
4222 static __inline__ vector signed char __ATTRS_o_ai
4223 vec_max(vector signed char __a, vector signed char __b) {
4224  return __builtin_altivec_vmaxsb(__a, __b);
4225 }
4226 
4227 static __inline__ vector signed char __ATTRS_o_ai
4228 vec_max(vector bool char __a, vector signed char __b) {
4229  return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4230 }
4231 
4232 static __inline__ vector signed char __ATTRS_o_ai
4233 vec_max(vector signed char __a, vector bool char __b) {
4234  return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4235 }
4236 
4237 static __inline__ vector unsigned char __ATTRS_o_ai
4238 vec_max(vector unsigned char __a, vector unsigned char __b) {
4239  return __builtin_altivec_vmaxub(__a, __b);
4240 }
4241 
4242 static __inline__ vector unsigned char __ATTRS_o_ai
4243 vec_max(vector bool char __a, vector unsigned char __b) {
4244  return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4245 }
4246 
4247 static __inline__ vector unsigned char __ATTRS_o_ai
4248 vec_max(vector unsigned char __a, vector bool char __b) {
4249  return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4250 }
4251 
4252 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4253  vector short __b) {
4254  return __builtin_altivec_vmaxsh(__a, __b);
4255 }
4256 
4257 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4258  vector short __b) {
4259  return __builtin_altivec_vmaxsh((vector short)__a, __b);
4260 }
4261 
4262 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4263  vector bool short __b) {
4264  return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4265 }
4266 
4267 static __inline__ vector unsigned short __ATTRS_o_ai
4268 vec_max(vector unsigned short __a, vector unsigned short __b) {
4269  return __builtin_altivec_vmaxuh(__a, __b);
4270 }
4271 
4272 static __inline__ vector unsigned short __ATTRS_o_ai
4273 vec_max(vector bool short __a, vector unsigned short __b) {
4274  return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4275 }
4276 
4277 static __inline__ vector unsigned short __ATTRS_o_ai
4278 vec_max(vector unsigned short __a, vector bool short __b) {
4279  return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4280 }
4281 
4282 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4283  vector int __b) {
4284  return __builtin_altivec_vmaxsw(__a, __b);
4285 }
4286 
4287 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4288  vector int __b) {
4289  return __builtin_altivec_vmaxsw((vector int)__a, __b);
4290 }
4291 
4292 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4293  vector bool int __b) {
4294  return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4295 }
4296 
4297 static __inline__ vector unsigned int __ATTRS_o_ai
4298 vec_max(vector unsigned int __a, vector unsigned int __b) {
4299  return __builtin_altivec_vmaxuw(__a, __b);
4300 }
4301 
4302 static __inline__ vector unsigned int __ATTRS_o_ai
4303 vec_max(vector bool int __a, vector unsigned int __b) {
4304  return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4305 }
4306 
4307 static __inline__ vector unsigned int __ATTRS_o_ai
4308 vec_max(vector unsigned int __a, vector bool int __b) {
4309  return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4310 }
4311 
4312 #ifdef __POWER8_VECTOR__
4313 static __inline__ vector signed long long __ATTRS_o_ai
4314 vec_max(vector signed long long __a, vector signed long long __b) {
4315  return __builtin_altivec_vmaxsd(__a, __b);
4316 }
4317 
4318 static __inline__ vector signed long long __ATTRS_o_ai
4319 vec_max(vector bool long long __a, vector signed long long __b) {
4320  return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4321 }
4322 
4323 static __inline__ vector signed long long __ATTRS_o_ai
4324 vec_max(vector signed long long __a, vector bool long long __b) {
4325  return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4326 }
4327 
4328 static __inline__ vector unsigned long long __ATTRS_o_ai
4329 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4330  return __builtin_altivec_vmaxud(__a, __b);
4331 }
4332 
4333 static __inline__ vector unsigned long long __ATTRS_o_ai
4334 vec_max(vector bool long long __a, vector unsigned long long __b) {
4335  return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4336 }
4337 
4338 static __inline__ vector unsigned long long __ATTRS_o_ai
4339 vec_max(vector unsigned long long __a, vector bool long long __b) {
4340  return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4341 }
4342 #endif
4343 
4344 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4345  vector float __b) {
4346 #ifdef __VSX__
4347  return __builtin_vsx_xvmaxsp(__a, __b);
4348 #else
4349  return __builtin_altivec_vmaxfp(__a, __b);
4350 #endif
4351 }
4352 
4353 #ifdef __VSX__
4354 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4355  vector double __b) {
4356  return __builtin_vsx_xvmaxdp(__a, __b);
4357 }
4358 #endif
4359 
4360 /* vec_vmaxsb */
4361 
4362 static __inline__ vector signed char __ATTRS_o_ai
4363 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4364  return __builtin_altivec_vmaxsb(__a, __b);
4365 }
4366 
4367 static __inline__ vector signed char __ATTRS_o_ai
4368 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4369  return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4370 }
4371 
4372 static __inline__ vector signed char __ATTRS_o_ai
4373 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4374  return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4375 }
4376 
4377 /* vec_vmaxub */
4378 
4379 static __inline__ vector unsigned char __ATTRS_o_ai
4380 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4381  return __builtin_altivec_vmaxub(__a, __b);
4382 }
4383 
4384 static __inline__ vector unsigned char __ATTRS_o_ai
4385 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4386  return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4387 }
4388 
4389 static __inline__ vector unsigned char __ATTRS_o_ai
4390 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4391  return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4392 }
4393 
4394 /* vec_vmaxsh */
4395 
4396 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4397  vector short __b) {
4398  return __builtin_altivec_vmaxsh(__a, __b);
4399 }
4400 
4401 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4402  vector short __b) {
4403  return __builtin_altivec_vmaxsh((vector short)__a, __b);
4404 }
4405 
4406 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4407  vector bool short __b) {
4408  return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4409 }
4410 
4411 /* vec_vmaxuh */
4412 
4413 static __inline__ vector unsigned short __ATTRS_o_ai
4414 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4415  return __builtin_altivec_vmaxuh(__a, __b);
4416 }
4417 
4418 static __inline__ vector unsigned short __ATTRS_o_ai
4419 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4420  return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4421 }
4422 
4423 static __inline__ vector unsigned short __ATTRS_o_ai
4424 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4425  return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4426 }
4427 
4428 /* vec_vmaxsw */
4429 
4430 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4431  vector int __b) {
4432  return __builtin_altivec_vmaxsw(__a, __b);
4433 }
4434 
4435 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4436  vector int __b) {
4437  return __builtin_altivec_vmaxsw((vector int)__a, __b);
4438 }
4439 
4440 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4441  vector bool int __b) {
4442  return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4443 }
4444 
4445 /* vec_vmaxuw */
4446 
4447 static __inline__ vector unsigned int __ATTRS_o_ai
4448 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4449  return __builtin_altivec_vmaxuw(__a, __b);
4450 }
4451 
4452 static __inline__ vector unsigned int __ATTRS_o_ai
4453 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4454  return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4455 }
4456 
4457 static __inline__ vector unsigned int __ATTRS_o_ai
4458 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4459  return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4460 }
4461 
4462 /* vec_vmaxfp */
4463 
4464 static __inline__ vector float __attribute__((__always_inline__))
4465 vec_vmaxfp(vector float __a, vector float __b) {
4466 #ifdef __VSX__
4467  return __builtin_vsx_xvmaxsp(__a, __b);
4468 #else
4469  return __builtin_altivec_vmaxfp(__a, __b);
4470 #endif
4471 }
4472 
4473 /* vec_mergeh */
4474 
4475 static __inline__ vector signed char __ATTRS_o_ai
4476 vec_mergeh(vector signed char __a, vector signed char __b) {
4477  return vec_perm(__a, __b,
4478  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4479  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4480  0x06, 0x16, 0x07, 0x17));
4481 }
4482 
4483 static __inline__ vector unsigned char __ATTRS_o_ai
4484 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4485  return vec_perm(__a, __b,
4486  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4487  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4488  0x06, 0x16, 0x07, 0x17));
4489 }
4490 
4491 static __inline__ vector bool char __ATTRS_o_ai
4492 vec_mergeh(vector bool char __a, vector bool char __b) {
4493  return vec_perm(__a, __b,
4494  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4495  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4496  0x06, 0x16, 0x07, 0x17));
4497 }
4498 
4499 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4500  vector short __b) {
4501  return vec_perm(__a, __b,
4502  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4503  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4504  0x06, 0x07, 0x16, 0x17));
4505 }
4506 
4507 static __inline__ vector unsigned short __ATTRS_o_ai
4508 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4509  return vec_perm(__a, __b,
4510  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4511  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4512  0x06, 0x07, 0x16, 0x17));
4513 }
4514 
4515 static __inline__ vector bool short __ATTRS_o_ai
4516 vec_mergeh(vector bool short __a, vector bool short __b) {
4517  return vec_perm(__a, __b,
4518  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4519  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4520  0x06, 0x07, 0x16, 0x17));
4521 }
4522 
4523 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4524  vector pixel __b) {
4525  return vec_perm(__a, __b,
4526  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4527  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4528  0x06, 0x07, 0x16, 0x17));
4529 }
4530 
4531 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4532  vector int __b) {
4533  return vec_perm(__a, __b,
4534  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4535  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4536  0x14, 0x15, 0x16, 0x17));
4537 }
4538 
4539 static __inline__ vector unsigned int __ATTRS_o_ai
4540 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4541  return vec_perm(__a, __b,
4542  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4543  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4544  0x14, 0x15, 0x16, 0x17));
4545 }
4546 
4547 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4548  vector bool int __b) {
4549  return vec_perm(__a, __b,
4550  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4551  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4552  0x14, 0x15, 0x16, 0x17));
4553 }
4554 
4555 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4556  vector float __b) {
4557  return vec_perm(__a, __b,
4558  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4559  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4560  0x14, 0x15, 0x16, 0x17));
4561 }
4562 
4563 #ifdef __VSX__
4564 static __inline__ vector signed long long __ATTRS_o_ai
4565 vec_mergeh(vector signed long long __a, vector signed long long __b) {
4566  return vec_perm(__a, __b,
4567  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4568  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4569  0x14, 0x15, 0x16, 0x17));
4570 }
4571 
4572 static __inline__ vector signed long long __ATTRS_o_ai
4573 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4574  return vec_perm(__a, (vector signed long long)__b,
4575  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4576  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4577  0x14, 0x15, 0x16, 0x17));
4578 }
4579 
4580 static __inline__ vector signed long long __ATTRS_o_ai
4581 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4582  return vec_perm((vector signed long long)__a, __b,
4583  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4584  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4585  0x14, 0x15, 0x16, 0x17));
4586 }
4587 
4588 static __inline__ vector unsigned long long __ATTRS_o_ai
4589 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4590  return vec_perm(__a, __b,
4591  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4592  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4593  0x14, 0x15, 0x16, 0x17));
4594 }
4595 
4596 static __inline__ vector unsigned long long __ATTRS_o_ai
4597 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4598  return vec_perm(__a, (vector unsigned long long)__b,
4599  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4600  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4601  0x14, 0x15, 0x16, 0x17));
4602 }
4603 
4604 static __inline__ vector unsigned long long __ATTRS_o_ai
4605 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4606  return vec_perm((vector unsigned long long)__a, __b,
4607  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4608  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4609  0x14, 0x15, 0x16, 0x17));
4610 }
4611 
4612 static __inline__ vector bool long long __ATTRS_o_ai
4613 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4614  return vec_perm(__a, __b,
4615  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4616  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4617  0x14, 0x15, 0x16, 0x17));
4618 }
4619 
4620 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4621  vector double __b) {
4622  return vec_perm(__a, __b,
4623  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4624  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4625  0x14, 0x15, 0x16, 0x17));
4626 }
4627 static __inline__ vector double __ATTRS_o_ai
4628 vec_mergeh(vector double __a, vector bool long long __b) {
4629  return vec_perm(__a, (vector double)__b,
4630  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4631  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4632  0x14, 0x15, 0x16, 0x17));
4633 }
4634 static __inline__ vector double __ATTRS_o_ai
4635 vec_mergeh(vector bool long long __a, vector double __b) {
4636  return vec_perm((vector double)__a, __b,
4637  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4638  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4639  0x14, 0x15, 0x16, 0x17));
4640 }
4641 #endif
4642 
4643 /* vec_vmrghb */
4644 
4645 #define __builtin_altivec_vmrghb vec_vmrghb
4646 
4647 static __inline__ vector signed char __ATTRS_o_ai
4648 vec_vmrghb(vector signed char __a, vector signed char __b) {
4649  return vec_perm(__a, __b,
4650  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4651  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4652  0x06, 0x16, 0x07, 0x17));
4653 }
4654 
4655 static __inline__ vector unsigned char __ATTRS_o_ai
4656 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4657  return vec_perm(__a, __b,
4658  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4659  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4660  0x06, 0x16, 0x07, 0x17));
4661 }
4662 
4663 static __inline__ vector bool char __ATTRS_o_ai
4664 vec_vmrghb(vector bool char __a, vector bool char __b) {
4665  return vec_perm(__a, __b,
4666  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4667  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4668  0x06, 0x16, 0x07, 0x17));
4669 }
4670 
4671 /* vec_vmrghh */
4672 
4673 #define __builtin_altivec_vmrghh vec_vmrghh
4674 
4675 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4676  vector short __b) {
4677  return vec_perm(__a, __b,
4678  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4679  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4680  0x06, 0x07, 0x16, 0x17));
4681 }
4682 
4683 static __inline__ vector unsigned short __ATTRS_o_ai
4684 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4685  return vec_perm(__a, __b,
4686  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4687  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4688  0x06, 0x07, 0x16, 0x17));
4689 }
4690 
4691 static __inline__ vector bool short __ATTRS_o_ai
4692 vec_vmrghh(vector bool short __a, vector bool short __b) {
4693  return vec_perm(__a, __b,
4694  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4695  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4696  0x06, 0x07, 0x16, 0x17));
4697 }
4698 
4699 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4700  vector pixel __b) {
4701  return vec_perm(__a, __b,
4702  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4703  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4704  0x06, 0x07, 0x16, 0x17));
4705 }
4706 
4707 /* vec_vmrghw */
4708 
4709 #define __builtin_altivec_vmrghw vec_vmrghw
4710 
4711 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4712  vector int __b) {
4713  return vec_perm(__a, __b,
4714  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4715  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4716  0x14, 0x15, 0x16, 0x17));
4717 }
4718 
4719 static __inline__ vector unsigned int __ATTRS_o_ai
4720 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4721  return vec_perm(__a, __b,
4722  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4723  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4724  0x14, 0x15, 0x16, 0x17));
4725 }
4726 
4727 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4728  vector bool int __b) {
4729  return vec_perm(__a, __b,
4730  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4731  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4732  0x14, 0x15, 0x16, 0x17));
4733 }
4734 
4735 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4736  vector float __b) {
4737  return vec_perm(__a, __b,
4738  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4739  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4740  0x14, 0x15, 0x16, 0x17));
4741 }
4742 
4743 /* vec_mergel */
4744 
4745 static __inline__ vector signed char __ATTRS_o_ai
4746 vec_mergel(vector signed char __a, vector signed char __b) {
4747  return vec_perm(__a, __b,
4748  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4749  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4750  0x0E, 0x1E, 0x0F, 0x1F));
4751 }
4752 
4753 static __inline__ vector unsigned char __ATTRS_o_ai
4754 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4755  return vec_perm(__a, __b,
4756  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4757  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4758  0x0E, 0x1E, 0x0F, 0x1F));
4759 }
4760 
4761 static __inline__ vector bool char __ATTRS_o_ai
4762 vec_mergel(vector bool char __a, vector bool char __b) {
4763  return vec_perm(__a, __b,
4764  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4765  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4766  0x0E, 0x1E, 0x0F, 0x1F));
4767 }
4768 
4769 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4770  vector short __b) {
4771  return vec_perm(__a, __b,
4772  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4773  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4774  0x0E, 0x0F, 0x1E, 0x1F));
4775 }
4776 
4777 static __inline__ vector unsigned short __ATTRS_o_ai
4778 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4779  return vec_perm(__a, __b,
4780  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4781  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4782  0x0E, 0x0F, 0x1E, 0x1F));
4783 }
4784 
4785 static __inline__ vector bool short __ATTRS_o_ai
4786 vec_mergel(vector bool short __a, vector bool short __b) {
4787  return vec_perm(__a, __b,
4788  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4789  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4790  0x0E, 0x0F, 0x1E, 0x1F));
4791 }
4792 
4793 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4794  vector pixel __b) {
4795  return vec_perm(__a, __b,
4796  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4797  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4798  0x0E, 0x0F, 0x1E, 0x1F));
4799 }
4800 
4801 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4802  vector int __b) {
4803  return vec_perm(__a, __b,
4804  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4805  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4806  0x1C, 0x1D, 0x1E, 0x1F));
4807 }
4808 
4809 static __inline__ vector unsigned int __ATTRS_o_ai
4810 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4811  return vec_perm(__a, __b,
4812  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4813  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4814  0x1C, 0x1D, 0x1E, 0x1F));
4815 }
4816 
4817 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4818  vector bool int __b) {
4819  return vec_perm(__a, __b,
4820  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4821  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4822  0x1C, 0x1D, 0x1E, 0x1F));
4823 }
4824 
4825 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4826  vector float __b) {
4827  return vec_perm(__a, __b,
4828  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4829  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4830  0x1C, 0x1D, 0x1E, 0x1F));
4831 }
4832 
4833 #ifdef __VSX__
4834 static __inline__ vector signed long long __ATTRS_o_ai
4835 vec_mergel(vector signed long long __a, vector signed long long __b) {
4836  return vec_perm(__a, __b,
4837  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4838  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4839  0x1C, 0x1D, 0x1E, 0x1F));
4840 }
4841 static __inline__ vector signed long long __ATTRS_o_ai
4842 vec_mergel(vector signed long long __a, vector bool long long __b) {
4843  return vec_perm(__a, (vector signed long long)__b,
4844  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4845  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4846  0x1C, 0x1D, 0x1E, 0x1F));
4847 }
4848 static __inline__ vector signed long long __ATTRS_o_ai
4849 vec_mergel(vector bool long long __a, vector signed long long __b) {
4850  return vec_perm((vector signed long long)__a, __b,
4851  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4852  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4853  0x1C, 0x1D, 0x1E, 0x1F));
4854 }
4855 static __inline__ vector unsigned long long __ATTRS_o_ai
4856 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4857  return vec_perm(__a, __b,
4858  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4859  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4860  0x1C, 0x1D, 0x1E, 0x1F));
4861 }
4862 static __inline__ vector unsigned long long __ATTRS_o_ai
4863 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4864  return vec_perm(__a, (vector unsigned long long)__b,
4865  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4866  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4867  0x1C, 0x1D, 0x1E, 0x1F));
4868 }
4869 static __inline__ vector unsigned long long __ATTRS_o_ai
4870 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4871  return vec_perm((vector unsigned long long)__a, __b,
4872  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4873  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4874  0x1C, 0x1D, 0x1E, 0x1F));
4875 }
4876 static __inline__ vector bool long long __ATTRS_o_ai
4877 vec_mergel(vector bool long long __a, vector bool long long __b) {
4878  return vec_perm(__a, __b,
4879  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4880  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4881  0x1C, 0x1D, 0x1E, 0x1F));
4882 }
4883 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4884  vector double __b) {
4885  return vec_perm(__a, __b,
4886  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4887  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4888  0x1C, 0x1D, 0x1E, 0x1F));
4889 }
4890 static __inline__ vector double __ATTRS_o_ai
4891 vec_mergel(vector double __a, vector bool long long __b) {
4892  return vec_perm(__a, (vector double)__b,
4893  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4894  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4895  0x1C, 0x1D, 0x1E, 0x1F));
4896 }
4897 static __inline__ vector double __ATTRS_o_ai
4898 vec_mergel(vector bool long long __a, vector double __b) {
4899  return vec_perm((vector double)__a, __b,
4900  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4901  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4902  0x1C, 0x1D, 0x1E, 0x1F));
4903 }
4904 #endif
4905 
4906 /* vec_vmrglb */
4907 
4908 #define __builtin_altivec_vmrglb vec_vmrglb
4909 
4910 static __inline__ vector signed char __ATTRS_o_ai
4911 vec_vmrglb(vector signed char __a, vector signed char __b) {
4912  return vec_perm(__a, __b,
4913  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4914  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4915  0x0E, 0x1E, 0x0F, 0x1F));
4916 }
4917 
4918 static __inline__ vector unsigned char __ATTRS_o_ai
4919 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4920  return vec_perm(__a, __b,
4921  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4922  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4923  0x0E, 0x1E, 0x0F, 0x1F));
4924 }
4925 
4926 static __inline__ vector bool char __ATTRS_o_ai
4927 vec_vmrglb(vector bool char __a, vector bool char __b) {
4928  return vec_perm(__a, __b,
4929  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4930  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4931  0x0E, 0x1E, 0x0F, 0x1F));
4932 }
4933 
4934 /* vec_vmrglh */
4935 
4936 #define __builtin_altivec_vmrglh vec_vmrglh
4937 
4938 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4939  vector short __b) {
4940  return vec_perm(__a, __b,
4941  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4942  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4943  0x0E, 0x0F, 0x1E, 0x1F));
4944 }
4945 
4946 static __inline__ vector unsigned short __ATTRS_o_ai
4947 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
4948  return vec_perm(__a, __b,
4949  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4950  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4951  0x0E, 0x0F, 0x1E, 0x1F));
4952 }
4953 
4954 static __inline__ vector bool short __ATTRS_o_ai
4955 vec_vmrglh(vector bool short __a, vector bool short __b) {
4956  return vec_perm(__a, __b,
4957  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4958  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4959  0x0E, 0x0F, 0x1E, 0x1F));
4960 }
4961 
4962 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
4963  vector pixel __b) {
4964  return vec_perm(__a, __b,
4965  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4966  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4967  0x0E, 0x0F, 0x1E, 0x1F));
4968 }
4969 
4970 /* vec_vmrglw */
4971 
4972 #define __builtin_altivec_vmrglw vec_vmrglw
4973 
4974 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
4975  vector int __b) {
4976  return vec_perm(__a, __b,
4977  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4978  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4979  0x1C, 0x1D, 0x1E, 0x1F));
4980 }
4981 
4982 static __inline__ vector unsigned int __ATTRS_o_ai
4983 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
4984  return vec_perm(__a, __b,
4985  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4986  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4987  0x1C, 0x1D, 0x1E, 0x1F));
4988 }
4989 
4990 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
4991  vector bool int __b) {
4992  return vec_perm(__a, __b,
4993  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4994  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4995  0x1C, 0x1D, 0x1E, 0x1F));
4996 }
4997 
4998 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
4999  vector float __b) {
5000  return vec_perm(__a, __b,
5001  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5002  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5003  0x1C, 0x1D, 0x1E, 0x1F));
5004 }
5005 
5006 #ifdef __POWER8_VECTOR__
5007 /* vec_mergee */
5008 
5009 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5010  vector bool int __b) {
5011  return vec_perm(__a, __b,
5012  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5013  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5014  0x18, 0x19, 0x1A, 0x1B));
5015 }
5016 
5017 static __inline__ vector signed int __ATTRS_o_ai
5018 vec_mergee(vector signed int __a, vector signed int __b) {
5019  return vec_perm(__a, __b,
5020  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5021  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5022  0x18, 0x19, 0x1A, 0x1B));
5023 }
5024 
5025 static __inline__ vector unsigned int __ATTRS_o_ai
5026 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5027  return vec_perm(__a, __b,
5028  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5029  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5030  0x18, 0x19, 0x1A, 0x1B));
5031 }
5032 
5033 static __inline__ vector bool long long __ATTRS_o_ai
5034 vec_mergee(vector bool long long __a, vector bool long long __b) {
5035  return vec_mergeh(__a, __b);
5036 }
5037 
5038 static __inline__ vector signed long long __ATTRS_o_ai
5039 vec_mergee(vector signed long long __a, vector signed long long __b) {
5040  return vec_mergeh(__a, __b);
5041 }
5042 
5043 static __inline__ vector unsigned long long __ATTRS_o_ai
5044 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5045  return vec_mergeh(__a, __b);
5046 }
5047 
5048 static __inline__ vector float __ATTRS_o_ai
5049 vec_mergee(vector float __a, vector float __b) {
5050  return vec_perm(__a, __b,
5051  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5052  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5053  0x18, 0x19, 0x1A, 0x1B));
5054 }
5055 
5056 static __inline__ vector double __ATTRS_o_ai
5057 vec_mergee(vector double __a, vector double __b) {
5058  return vec_mergeh(__a, __b);
5059 }
5060 
5061 /* vec_mergeo */
5062 
5063 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5064  vector bool int __b) {
5065  return vec_perm(__a, __b,
5066  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5067  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5068  0x1C, 0x1D, 0x1E, 0x1F));
5069 }
5070 
5071 static __inline__ vector signed int __ATTRS_o_ai
5072 vec_mergeo(vector signed int __a, vector signed int __b) {
5073  return vec_perm(__a, __b,
5074  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5075  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5076  0x1C, 0x1D, 0x1E, 0x1F));
5077 }
5078 
5079 static __inline__ vector unsigned int __ATTRS_o_ai
5080 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5081  return vec_perm(__a, __b,
5082  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5083  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5084  0x1C, 0x1D, 0x1E, 0x1F));
5085 }
5086 
5087 static __inline__ vector bool long long __ATTRS_o_ai
5088 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5089  return vec_mergel(__a, __b);
5090 }
5091 
5092 static __inline__ vector signed long long __ATTRS_o_ai
5093 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5094  return vec_mergel(__a, __b);
5095 }
5096 
5097 static __inline__ vector unsigned long long __ATTRS_o_ai
5098 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5099  return vec_mergel(__a, __b);
5100 }
5101 
5102 static __inline__ vector float __ATTRS_o_ai
5103 vec_mergeo(vector float __a, vector float __b) {
5104  return vec_perm(__a, __b,
5105  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5106  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5107  0x1C, 0x1D, 0x1E, 0x1F));
5108 }
5109 
5110 static __inline__ vector double __ATTRS_o_ai
5111 vec_mergeo(vector double __a, vector double __b) {
5112  return vec_mergel(__a, __b);
5113 }
5114 
5115 #endif
5116 
5117 /* vec_mfvscr */
5118 
5119 static __inline__ vector unsigned short __attribute__((__always_inline__))
5120 vec_mfvscr(void) {
5121  return __builtin_altivec_mfvscr();
5122 }
5123 
5124 /* vec_min */
5125 
5126 static __inline__ vector signed char __ATTRS_o_ai
5127 vec_min(vector signed char __a, vector signed char __b) {
5128  return __builtin_altivec_vminsb(__a, __b);
5129 }
5130 
5131 static __inline__ vector signed char __ATTRS_o_ai
5132 vec_min(vector bool char __a, vector signed char __b) {
5133  return __builtin_altivec_vminsb((vector signed char)__a, __b);
5134 }
5135 
5136 static __inline__ vector signed char __ATTRS_o_ai
5137 vec_min(vector signed char __a, vector bool char __b) {
5138  return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5139 }
5140 
5141 static __inline__ vector unsigned char __ATTRS_o_ai
5142 vec_min(vector unsigned char __a, vector unsigned char __b) {
5143  return __builtin_altivec_vminub(__a, __b);
5144 }
5145 
5146 static __inline__ vector unsigned char __ATTRS_o_ai
5147 vec_min(vector bool char __a, vector unsigned char __b) {
5148  return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5149 }
5150 
5151 static __inline__ vector unsigned char __ATTRS_o_ai
5152 vec_min(vector unsigned char __a, vector bool char __b) {
5153  return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5154 }
5155 
5156 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5157  vector short __b) {
5158  return __builtin_altivec_vminsh(__a, __b);
5159 }
5160 
5161 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5162  vector short __b) {
5163  return __builtin_altivec_vminsh((vector short)__a, __b);
5164 }
5165 
5166 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5167  vector bool short __b) {
5168  return __builtin_altivec_vminsh(__a, (vector short)__b);
5169 }
5170 
5171 static __inline__ vector unsigned short __ATTRS_o_ai
5172 vec_min(vector unsigned short __a, vector unsigned