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 unsigned char __ATTRS_o_ai
2765 vec_xl_len_r(unsigned char *__a, 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((vector int)(__a), (__b)), \
2880  vector unsigned int \
2881  : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2882  (__b)), \
2883  vector unsigned long long \
2884  : (__builtin_convertvector((vector unsigned long long)(__a), \
2885  vector double) * \
2886  (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2887  << 52)), \
2888  vector signed long long \
2889  : (__builtin_convertvector((vector signed long long)(__a), \
2890  vector double) * \
2891  (vector double)(vector unsigned long long)((0x3ffULL - (__b)) \
2892  << 52)))
2893 #else
2894 #define vec_ctf(__a, __b) \
2895  _Generic((__a), vector int \
2896  : (vector float)__builtin_altivec_vcfsx((vector int)(__a), (__b)), \
2897  vector unsigned int \
2898  : (vector float)__builtin_altivec_vcfux((vector unsigned int)(__a), \
2899  (__b)))
2900 #endif
2901 
2902 /* vec_vcfsx */
2903 
2904 #define vec_vcfux __builtin_altivec_vcfux
2905 
2906 /* vec_vcfux */
2907 
2908 #define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))
2909 
2910 /* vec_cts */
2911 
2912 #ifdef __VSX__
2913 #define vec_cts(__a, __b) \
2914  _Generic((__a), vector float \
2915  : __builtin_altivec_vctsxs((vector float)(__a), (__b)), \
2916  vector double \
2917  : __extension__({ \
2918  vector double __ret = \
2919  (vector double)(__a) * \
2920  (vector double)(vector unsigned long long)((0x3ffULL + (__b)) \
2921  << 52); \
2922  __builtin_convertvector(__ret, vector signed long long); \
2923  }))
2924 #else
2925 #define vec_cts __builtin_altivec_vctsxs
2926 #endif
2927 
2928 /* vec_vctsxs */
2929 
2930 #define vec_vctsxs __builtin_altivec_vctsxs
2931 
2932 /* vec_ctu */
2933 
2934 #ifdef __VSX__
2935 #define vec_ctu(__a, __b) \
2936  _Generic((__a), vector float \
2937  : __builtin_altivec_vctuxs((vector float)(__a), (__b)), \
2938  vector double \
2939  : __extension__({ \
2940  vector double __ret = \
2941  (vector double)(__a) * \
2942  (vector double)(vector unsigned long long)((0x3ffULL + __b) \
2943  << 52); \
2944  __builtin_convertvector(__ret, vector unsigned long long); \
2945  }))
2946 #else
2947 #define vec_ctu __builtin_altivec_vctuxs
2948 #endif
2949 
2950 /* vec_vctuxs */
2951 
2952 #define vec_vctuxs __builtin_altivec_vctuxs
2953 
2954 /* vec_signed */
2955 
2956 static __inline__ vector signed int __ATTRS_o_ai
2957 vec_sld(vector signed int, vector signed int, unsigned const int __c);
2958 
2959 static __inline__ vector signed int __ATTRS_o_ai
2960 vec_signed(vector float __a) {
2961  return __builtin_convertvector(__a, vector signed int);
2962 }
2963 
2964 #ifdef __VSX__
2965 static __inline__ vector signed long long __ATTRS_o_ai
2966 vec_signed(vector double __a) {
2967  return __builtin_convertvector(__a, vector signed long long);
2968 }
2969 
2970 static __inline__ vector signed int __attribute__((__always_inline__))
2971 vec_signed2(vector double __a, vector double __b) {
2972  return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };
2973 }
2974 
2975 static __inline__ vector signed int __ATTRS_o_ai
2976 vec_signede(vector double __a) {
2977 #ifdef __LITTLE_ENDIAN__
2978  vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2979  return vec_sld(__ret, __ret, 12);
2980 #else
2981  return __builtin_vsx_xvcvdpsxws(__a);
2982 #endif
2983 }
2984 
2985 static __inline__ vector signed int __ATTRS_o_ai
2986 vec_signedo(vector double __a) {
2987 #ifdef __LITTLE_ENDIAN__
2988  return __builtin_vsx_xvcvdpsxws(__a);
2989 #else
2990  vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);
2991  return vec_sld(__ret, __ret, 12);
2992 #endif
2993 }
2994 #endif
2995 
2996 /* vec_unsigned */
2997 
2998 static __inline__ vector unsigned int __ATTRS_o_ai
2999 vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);
3000 
3001 static __inline__ vector unsigned int __ATTRS_o_ai
3002 vec_unsigned(vector float __a) {
3003  return __builtin_convertvector(__a, vector unsigned int);
3004 }
3005 
3006 #ifdef __VSX__
3007 static __inline__ vector unsigned long long __ATTRS_o_ai
3008 vec_unsigned(vector double __a) {
3009  return __builtin_convertvector(__a, vector unsigned long long);
3010 }
3011 
3012 static __inline__ vector unsigned int __attribute__((__always_inline__))
3013 vec_unsigned2(vector double __a, vector double __b) {
3014  return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };
3015 }
3016 
3017 static __inline__ vector unsigned int __ATTRS_o_ai
3018 vec_unsignede(vector double __a) {
3019 #ifdef __LITTLE_ENDIAN__
3020  vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3021  return vec_sld(__ret, __ret, 12);
3022 #else
3023  return __builtin_vsx_xvcvdpuxws(__a);
3024 #endif
3025 }
3026 
3027 static __inline__ vector unsigned int __ATTRS_o_ai
3028 vec_unsignedo(vector double __a) {
3029 #ifdef __LITTLE_ENDIAN__
3030  return __builtin_vsx_xvcvdpuxws(__a);
3031 #else
3032  vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);
3033  return vec_sld(__ret, __ret, 12);
3034 #endif
3035 }
3036 #endif
3037 
3038 /* vec_float */
3039 
3040 static __inline__ vector float __ATTRS_o_ai
3041 vec_sld(vector float, vector float, unsigned const int __c);
3042 
3043 static __inline__ vector float __ATTRS_o_ai
3044 vec_float(vector signed int __a) {
3045  return __builtin_convertvector(__a, vector float);
3046 }
3047 
3048 static __inline__ vector float __ATTRS_o_ai
3049 vec_float(vector unsigned int __a) {
3050  return __builtin_convertvector(__a, vector float);
3051 }
3052 
3053 #ifdef __VSX__
3054 static __inline__ vector float __ATTRS_o_ai
3055 vec_float2(vector signed long long __a, vector signed long long __b) {
3056  return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3057 }
3058 
3059 static __inline__ vector float __ATTRS_o_ai
3060 vec_float2(vector unsigned long long __a, vector unsigned long long __b) {
3061  return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3062 }
3063 
3064 static __inline__ vector float __ATTRS_o_ai
3065 vec_float2(vector double __a, vector double __b) {
3066  return (vector float) { __a[0], __a[1], __b[0], __b[1] };
3067 }
3068 
3069 static __inline__ vector float __ATTRS_o_ai
3070 vec_floate(vector signed long long __a) {
3071 #ifdef __LITTLE_ENDIAN__
3072  vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3073  return vec_sld(__ret, __ret, 12);
3074 #else
3075  return __builtin_vsx_xvcvsxdsp(__a);
3076 #endif
3077 }
3078 
3079 static __inline__ vector float __ATTRS_o_ai
3080 vec_floate(vector unsigned long long __a) {
3081 #ifdef __LITTLE_ENDIAN__
3082  vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3083  return vec_sld(__ret, __ret, 12);
3084 #else
3085  return __builtin_vsx_xvcvuxdsp(__a);
3086 #endif
3087 }
3088 
3089 static __inline__ vector float __ATTRS_o_ai
3090 vec_floate(vector double __a) {
3091 #ifdef __LITTLE_ENDIAN__
3092  vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3093  return vec_sld(__ret, __ret, 12);
3094 #else
3095  return __builtin_vsx_xvcvdpsp(__a);
3096 #endif
3097 }
3098 
3099 static __inline__ vector float __ATTRS_o_ai
3100 vec_floato(vector signed long long __a) {
3101 #ifdef __LITTLE_ENDIAN__
3102  return __builtin_vsx_xvcvsxdsp(__a);
3103 #else
3104  vector float __ret = __builtin_vsx_xvcvsxdsp(__a);
3105  return vec_sld(__ret, __ret, 12);
3106 #endif
3107 }
3108 
3109 static __inline__ vector float __ATTRS_o_ai
3110 vec_floato(vector unsigned long long __a) {
3111 #ifdef __LITTLE_ENDIAN__
3112  return __builtin_vsx_xvcvuxdsp(__a);
3113 #else
3114  vector float __ret = __builtin_vsx_xvcvuxdsp(__a);
3115  return vec_sld(__ret, __ret, 12);
3116 #endif
3117 }
3118 
3119 static __inline__ vector float __ATTRS_o_ai
3120 vec_floato(vector double __a) {
3121 #ifdef __LITTLE_ENDIAN__
3122  return __builtin_vsx_xvcvdpsp(__a);
3123 #else
3124  vector float __ret = __builtin_vsx_xvcvdpsp(__a);
3125  return vec_sld(__ret, __ret, 12);
3126 #endif
3127 }
3128 #endif
3129 
3130 /* vec_double */
3131 
3132 #ifdef __VSX__
3133 static __inline__ vector double __ATTRS_o_ai
3134 vec_double(vector signed long long __a) {
3135  return __builtin_convertvector(__a, vector double);
3136 }
3137 
3138 static __inline__ vector double __ATTRS_o_ai
3139 vec_double(vector unsigned long long __a) {
3140  return __builtin_convertvector(__a, vector double);
3141 }
3142 
3143 static __inline__ vector double __ATTRS_o_ai
3144 vec_doublee(vector signed int __a) {
3145 #ifdef __LITTLE_ENDIAN__
3146  return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3147 #else
3148  return __builtin_vsx_xvcvsxwdp(__a);
3149 #endif
3150 }
3151 
3152 static __inline__ vector double __ATTRS_o_ai
3153 vec_doublee(vector unsigned int __a) {
3154 #ifdef __LITTLE_ENDIAN__
3155  return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3156 #else
3157  return __builtin_vsx_xvcvuxwdp(__a);
3158 #endif
3159 }
3160 
3161 static __inline__ vector double __ATTRS_o_ai
3162 vec_doublee(vector float __a) {
3163 #ifdef __LITTLE_ENDIAN__
3164  return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3165 #else
3166  return __builtin_vsx_xvcvspdp(__a);
3167 #endif
3168 }
3169 
3170 static __inline__ vector double __ATTRS_o_ai
3171 vec_doubleh(vector signed int __a) {
3172  vector double __ret = {__a[0], __a[1]};
3173  return __ret;
3174 }
3175 
3176 static __inline__ vector double __ATTRS_o_ai
3177 vec_doubleh(vector unsigned int __a) {
3178  vector double __ret = {__a[0], __a[1]};
3179  return __ret;
3180 }
3181 
3182 static __inline__ vector double __ATTRS_o_ai
3183 vec_doubleh(vector float __a) {
3184  vector double __ret = {__a[0], __a[1]};
3185  return __ret;
3186 }
3187 
3188 static __inline__ vector double __ATTRS_o_ai
3189 vec_doublel(vector signed int __a) {
3190  vector double __ret = {__a[2], __a[3]};
3191  return __ret;
3192 }
3193 
3194 static __inline__ vector double __ATTRS_o_ai
3195 vec_doublel(vector unsigned int __a) {
3196  vector double __ret = {__a[2], __a[3]};
3197  return __ret;
3198 }
3199 
3200 static __inline__ vector double __ATTRS_o_ai
3201 vec_doublel(vector float __a) {
3202  vector double __ret = {__a[2], __a[3]};
3203  return __ret;
3204 }
3205 
3206 static __inline__ vector double __ATTRS_o_ai
3207 vec_doubleo(vector signed int __a) {
3208 #ifdef __LITTLE_ENDIAN__
3209  return __builtin_vsx_xvcvsxwdp(__a);
3210 #else
3211  return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));
3212 #endif
3213 }
3214 
3215 static __inline__ vector double __ATTRS_o_ai
3216 vec_doubleo(vector unsigned int __a) {
3217 #ifdef __LITTLE_ENDIAN__
3218  return __builtin_vsx_xvcvuxwdp(__a);
3219 #else
3220  return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));
3221 #endif
3222 }
3223 
3224 static __inline__ vector double __ATTRS_o_ai
3225 vec_doubleo(vector float __a) {
3226 #ifdef __LITTLE_ENDIAN__
3227  return __builtin_vsx_xvcvspdp(__a);
3228 #else
3229  return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));
3230 #endif
3231 }
3232 #endif
3233 
3234 /* vec_div */
3235 
3236 /* Integer vector divides (vectors are scalarized, elements divided
3237  and the vectors reassembled).
3238 */
3239 static __inline__ vector signed char __ATTRS_o_ai
3240 vec_div(vector signed char __a, vector signed char __b) {
3241  return __a / __b;
3242 }
3243 
3244 static __inline__ vector unsigned char __ATTRS_o_ai
3245 vec_div(vector unsigned char __a, vector unsigned char __b) {
3246  return __a / __b;
3247 }
3248 
3249 static __inline__ vector signed short __ATTRS_o_ai
3250 vec_div(vector signed short __a, vector signed short __b) {
3251  return __a / __b;
3252 }
3253 
3254 static __inline__ vector unsigned short __ATTRS_o_ai
3255 vec_div(vector unsigned short __a, vector unsigned short __b) {
3256  return __a / __b;
3257 }
3258 
3259 static __inline__ vector signed int __ATTRS_o_ai
3260 vec_div(vector signed int __a, vector signed int __b) {
3261  return __a / __b;
3262 }
3263 
3264 static __inline__ vector unsigned int __ATTRS_o_ai
3265 vec_div(vector unsigned int __a, vector unsigned int __b) {
3266  return __a / __b;
3267 }
3268 
3269 #ifdef __VSX__
3270 static __inline__ vector signed long long __ATTRS_o_ai
3271 vec_div(vector signed long long __a, vector signed long long __b) {
3272  return __a / __b;
3273 }
3274 
3275 static __inline__ vector unsigned long long __ATTRS_o_ai
3276 vec_div(vector unsigned long long __a, vector unsigned long long __b) {
3277  return __a / __b;
3278 }
3279 
3280 static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,
3281  vector float __b) {
3282  return __a / __b;
3283 }
3284 
3285 static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,
3286  vector double __b) {
3287  return __a / __b;
3288 }
3289 #endif
3290 
3291 /* vec_dss */
3292 
3293 #define vec_dss __builtin_altivec_dss
3294 
3295 /* vec_dssall */
3296 
3297 static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {
3298  __builtin_altivec_dssall();
3299 }
3300 
3301 /* vec_dst */
3302 #define vec_dst(__PTR, __CW, __STR) \
3303  __extension__( \
3304  { __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })
3305 
3306 /* vec_dstst */
3307 #define vec_dstst(__PTR, __CW, __STR) \
3308  __extension__( \
3309  { __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })
3310 
3311 /* vec_dststt */
3312 #define vec_dststt(__PTR, __CW, __STR) \
3313  __extension__( \
3314  { __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })
3315 
3316 /* vec_dstt */
3317 #define vec_dstt(__PTR, __CW, __STR) \
3318  __extension__( \
3319  { __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })
3320 
3321 /* vec_eqv */
3322 
3323 #ifdef __POWER8_VECTOR__
3324 static __inline__ vector signed char __ATTRS_o_ai
3325 vec_eqv(vector signed char __a, vector signed char __b) {
3326  return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3327  (vector unsigned int)__b);
3328 }
3329 
3330 static __inline__ vector unsigned char __ATTRS_o_ai
3331 vec_eqv(vector unsigned char __a, vector unsigned char __b) {
3332  return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3333  (vector unsigned int)__b);
3334 }
3335 
3336 static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,
3337  vector bool char __b) {
3338  return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,
3339  (vector unsigned int)__b);
3340 }
3341 
3342 static __inline__ vector signed short __ATTRS_o_ai
3343 vec_eqv(vector signed short __a, vector signed short __b) {
3344  return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3345  (vector unsigned int)__b);
3346 }
3347 
3348 static __inline__ vector unsigned short __ATTRS_o_ai
3349 vec_eqv(vector unsigned short __a, vector unsigned short __b) {
3350  return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3351  (vector unsigned int)__b);
3352 }
3353 
3354 static __inline__ vector bool short __ATTRS_o_ai
3355 vec_eqv(vector bool short __a, vector bool short __b) {
3356  return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,
3357  (vector unsigned int)__b);
3358 }
3359 
3360 static __inline__ vector signed int __ATTRS_o_ai
3361 vec_eqv(vector signed int __a, vector signed int __b) {
3362  return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3363  (vector unsigned int)__b);
3364 }
3365 
3366 static __inline__ vector unsigned int __ATTRS_o_ai
3367 vec_eqv(vector unsigned int __a, vector unsigned int __b) {
3368  return __builtin_vsx_xxleqv(__a, __b);
3369 }
3370 
3371 static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,
3372  vector bool int __b) {
3373  return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,
3374  (vector unsigned int)__b);
3375 }
3376 
3377 static __inline__ vector signed long long __ATTRS_o_ai
3378 vec_eqv(vector signed long long __a, vector signed long long __b) {
3379  return (vector signed long long)__builtin_vsx_xxleqv(
3380  (vector unsigned int)__a, (vector unsigned int)__b);
3381 }
3382 
3383 static __inline__ vector unsigned long long __ATTRS_o_ai
3384 vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {
3385  return (vector unsigned long long)__builtin_vsx_xxleqv(
3386  (vector unsigned int)__a, (vector unsigned int)__b);
3387 }
3388 
3389 static __inline__ vector bool long long __ATTRS_o_ai
3390 vec_eqv(vector bool long long __a, vector bool long long __b) {
3391  return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,
3392  (vector unsigned int)__b);
3393 }
3394 
3395 static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,
3396  vector float __b) {
3397  return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,
3398  (vector unsigned int)__b);
3399 }
3400 
3401 static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,
3402  vector double __b) {
3403  return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,
3404  (vector unsigned int)__b);
3405 }
3406 #endif
3407 
3408 /* vec_expte */
3409 
3410 static __inline__ vector float __attribute__((__always_inline__))
3411 vec_expte(vector float __a) {
3412  return __builtin_altivec_vexptefp(__a);
3413 }
3414 
3415 /* vec_vexptefp */
3416 
3417 static __inline__ vector float __attribute__((__always_inline__))
3418 vec_vexptefp(vector float __a) {
3419  return __builtin_altivec_vexptefp(__a);
3420 }
3421 
3422 /* vec_floor */
3423 
3424 static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {
3425 #ifdef __VSX__
3426  return __builtin_vsx_xvrspim(__a);
3427 #else
3428  return __builtin_altivec_vrfim(__a);
3429 #endif
3430 }
3431 
3432 #ifdef __VSX__
3433 static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {
3434  return __builtin_vsx_xvrdpim(__a);
3435 }
3436 #endif
3437 
3438 /* vec_vrfim */
3439 
3440 static __inline__ vector float __attribute__((__always_inline__))
3441 vec_vrfim(vector float __a) {
3442  return __builtin_altivec_vrfim(__a);
3443 }
3444 
3445 /* vec_ld */
3446 
3447 static __inline__ vector signed char __ATTRS_o_ai
3448 vec_ld(int __a, const vector signed char *__b) {
3449  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3450 }
3451 
3452 static __inline__ vector signed char __ATTRS_o_ai
3453 vec_ld(int __a, const signed char *__b) {
3454  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3455 }
3456 
3457 static __inline__ vector unsigned char __ATTRS_o_ai
3458 vec_ld(int __a, const vector unsigned char *__b) {
3459  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3460 }
3461 
3462 static __inline__ vector unsigned char __ATTRS_o_ai
3463 vec_ld(int __a, const unsigned char *__b) {
3464  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3465 }
3466 
3467 static __inline__ vector bool char __ATTRS_o_ai
3468 vec_ld(int __a, const vector bool char *__b) {
3469  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3470 }
3471 
3472 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,
3473  const vector short *__b) {
3474  return (vector short)__builtin_altivec_lvx(__a, __b);
3475 }
3476 
3477 static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {
3478  return (vector short)__builtin_altivec_lvx(__a, __b);
3479 }
3480 
3481 static __inline__ vector unsigned short __ATTRS_o_ai
3482 vec_ld(int __a, const vector unsigned short *__b) {
3483  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3484 }
3485 
3486 static __inline__ vector unsigned short __ATTRS_o_ai
3487 vec_ld(int __a, const unsigned short *__b) {
3488  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3489 }
3490 
3491 static __inline__ vector bool short __ATTRS_o_ai
3492 vec_ld(int __a, const vector bool short *__b) {
3493  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3494 }
3495 
3496 static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,
3497  const vector pixel *__b) {
3498  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3499 }
3500 
3501 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,
3502  const vector int *__b) {
3503  return (vector int)__builtin_altivec_lvx(__a, __b);
3504 }
3505 
3506 static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {
3507  return (vector int)__builtin_altivec_lvx(__a, __b);
3508 }
3509 
3510 static __inline__ vector unsigned int __ATTRS_o_ai
3511 vec_ld(int __a, const vector unsigned int *__b) {
3512  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3513 }
3514 
3515 static __inline__ vector unsigned int __ATTRS_o_ai
3516 vec_ld(int __a, const unsigned int *__b) {
3517  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3518 }
3519 
3520 static __inline__ vector bool int __ATTRS_o_ai
3521 vec_ld(int __a, const vector bool int *__b) {
3522  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3523 }
3524 
3525 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,
3526  const vector float *__b) {
3527  return (vector float)__builtin_altivec_lvx(__a, __b);
3528 }
3529 
3530 static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {
3531  return (vector float)__builtin_altivec_lvx(__a, __b);
3532 }
3533 
3534 /* vec_lvx */
3535 
3536 static __inline__ vector signed char __ATTRS_o_ai
3537 vec_lvx(int __a, const vector signed char *__b) {
3538  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3539 }
3540 
3541 static __inline__ vector signed char __ATTRS_o_ai
3542 vec_lvx(int __a, const signed char *__b) {
3543  return (vector signed char)__builtin_altivec_lvx(__a, __b);
3544 }
3545 
3546 static __inline__ vector unsigned char __ATTRS_o_ai
3547 vec_lvx(int __a, const vector unsigned char *__b) {
3548  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3549 }
3550 
3551 static __inline__ vector unsigned char __ATTRS_o_ai
3552 vec_lvx(int __a, const unsigned char *__b) {
3553  return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
3554 }
3555 
3556 static __inline__ vector bool char __ATTRS_o_ai
3557 vec_lvx(int __a, const vector bool char *__b) {
3558  return (vector bool char)__builtin_altivec_lvx(__a, __b);
3559 }
3560 
3561 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,
3562  const vector short *__b) {
3563  return (vector short)__builtin_altivec_lvx(__a, __b);
3564 }
3565 
3566 static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {
3567  return (vector short)__builtin_altivec_lvx(__a, __b);
3568 }
3569 
3570 static __inline__ vector unsigned short __ATTRS_o_ai
3571 vec_lvx(int __a, const vector unsigned short *__b) {
3572  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3573 }
3574 
3575 static __inline__ vector unsigned short __ATTRS_o_ai
3576 vec_lvx(int __a, const unsigned short *__b) {
3577  return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
3578 }
3579 
3580 static __inline__ vector bool short __ATTRS_o_ai
3581 vec_lvx(int __a, const vector bool short *__b) {
3582  return (vector bool short)__builtin_altivec_lvx(__a, __b);
3583 }
3584 
3585 static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,
3586  const vector pixel *__b) {
3587  return (vector pixel)__builtin_altivec_lvx(__a, __b);
3588 }
3589 
3590 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,
3591  const vector int *__b) {
3592  return (vector int)__builtin_altivec_lvx(__a, __b);
3593 }
3594 
3595 static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {
3596  return (vector int)__builtin_altivec_lvx(__a, __b);
3597 }
3598 
3599 static __inline__ vector unsigned int __ATTRS_o_ai
3600 vec_lvx(int __a, const vector unsigned int *__b) {
3601  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3602 }
3603 
3604 static __inline__ vector unsigned int __ATTRS_o_ai
3605 vec_lvx(int __a, const unsigned int *__b) {
3606  return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
3607 }
3608 
3609 static __inline__ vector bool int __ATTRS_o_ai
3610 vec_lvx(int __a, const vector bool int *__b) {
3611  return (vector bool int)__builtin_altivec_lvx(__a, __b);
3612 }
3613 
3614 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,
3615  const vector float *__b) {
3616  return (vector float)__builtin_altivec_lvx(__a, __b);
3617 }
3618 
3619 static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {
3620  return (vector float)__builtin_altivec_lvx(__a, __b);
3621 }
3622 
3623 /* vec_lde */
3624 
3625 static __inline__ vector signed char __ATTRS_o_ai
3626 vec_lde(int __a, const signed char *__b) {
3627  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3628 }
3629 
3630 static __inline__ vector unsigned char __ATTRS_o_ai
3631 vec_lde(int __a, const unsigned char *__b) {
3632  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3633 }
3634 
3635 static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {
3636  return (vector short)__builtin_altivec_lvehx(__a, __b);
3637 }
3638 
3639 static __inline__ vector unsigned short __ATTRS_o_ai
3640 vec_lde(int __a, const unsigned short *__b) {
3641  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3642 }
3643 
3644 static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {
3645  return (vector int)__builtin_altivec_lvewx(__a, __b);
3646 }
3647 
3648 static __inline__ vector unsigned int __ATTRS_o_ai
3649 vec_lde(int __a, const unsigned int *__b) {
3650  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3651 }
3652 
3653 static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {
3654  return (vector float)__builtin_altivec_lvewx(__a, __b);
3655 }
3656 
3657 /* vec_lvebx */
3658 
3659 static __inline__ vector signed char __ATTRS_o_ai
3660 vec_lvebx(int __a, const signed char *__b) {
3661  return (vector signed char)__builtin_altivec_lvebx(__a, __b);
3662 }
3663 
3664 static __inline__ vector unsigned char __ATTRS_o_ai
3665 vec_lvebx(int __a, const unsigned char *__b) {
3666  return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
3667 }
3668 
3669 /* vec_lvehx */
3670 
3671 static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,
3672  const short *__b) {
3673  return (vector short)__builtin_altivec_lvehx(__a, __b);
3674 }
3675 
3676 static __inline__ vector unsigned short __ATTRS_o_ai
3677 vec_lvehx(int __a, const unsigned short *__b) {
3678  return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
3679 }
3680 
3681 /* vec_lvewx */
3682 
3683 static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {
3684  return (vector int)__builtin_altivec_lvewx(__a, __b);
3685 }
3686 
3687 static __inline__ vector unsigned int __ATTRS_o_ai
3688 vec_lvewx(int __a, const unsigned int *__b) {
3689  return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
3690 }
3691 
3692 static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,
3693  const float *__b) {
3694  return (vector float)__builtin_altivec_lvewx(__a, __b);
3695 }
3696 
3697 /* vec_ldl */
3698 
3699 static __inline__ vector signed char __ATTRS_o_ai
3700 vec_ldl(int __a, const vector signed char *__b) {
3701  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3702 }
3703 
3704 static __inline__ vector signed char __ATTRS_o_ai
3705 vec_ldl(int __a, const signed char *__b) {
3706  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3707 }
3708 
3709 static __inline__ vector unsigned char __ATTRS_o_ai
3710 vec_ldl(int __a, const vector unsigned char *__b) {
3711  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3712 }
3713 
3714 static __inline__ vector unsigned char __ATTRS_o_ai
3715 vec_ldl(int __a, const unsigned char *__b) {
3716  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3717 }
3718 
3719 static __inline__ vector bool char __ATTRS_o_ai
3720 vec_ldl(int __a, const vector bool char *__b) {
3721  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3722 }
3723 
3724 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,
3725  const vector short *__b) {
3726  return (vector short)__builtin_altivec_lvxl(__a, __b);
3727 }
3728 
3729 static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {
3730  return (vector short)__builtin_altivec_lvxl(__a, __b);
3731 }
3732 
3733 static __inline__ vector unsigned short __ATTRS_o_ai
3734 vec_ldl(int __a, const vector unsigned short *__b) {
3735  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3736 }
3737 
3738 static __inline__ vector unsigned short __ATTRS_o_ai
3739 vec_ldl(int __a, const unsigned short *__b) {
3740  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3741 }
3742 
3743 static __inline__ vector bool short __ATTRS_o_ai
3744 vec_ldl(int __a, const vector bool short *__b) {
3745  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3746 }
3747 
3748 static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,
3749  const vector pixel *__b) {
3750  return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
3751 }
3752 
3753 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,
3754  const vector int *__b) {
3755  return (vector int)__builtin_altivec_lvxl(__a, __b);
3756 }
3757 
3758 static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {
3759  return (vector int)__builtin_altivec_lvxl(__a, __b);
3760 }
3761 
3762 static __inline__ vector unsigned int __ATTRS_o_ai
3763 vec_ldl(int __a, const vector unsigned int *__b) {
3764  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3765 }
3766 
3767 static __inline__ vector unsigned int __ATTRS_o_ai
3768 vec_ldl(int __a, const unsigned int *__b) {
3769  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3770 }
3771 
3772 static __inline__ vector bool int __ATTRS_o_ai
3773 vec_ldl(int __a, const vector bool int *__b) {
3774  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3775 }
3776 
3777 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,
3778  const vector float *__b) {
3779  return (vector float)__builtin_altivec_lvxl(__a, __b);
3780 }
3781 
3782 static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {
3783  return (vector float)__builtin_altivec_lvxl(__a, __b);
3784 }
3785 
3786 /* vec_lvxl */
3787 
3788 static __inline__ vector signed char __ATTRS_o_ai
3789 vec_lvxl(int __a, const vector signed char *__b) {
3790  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3791 }
3792 
3793 static __inline__ vector signed char __ATTRS_o_ai
3794 vec_lvxl(int __a, const signed char *__b) {
3795  return (vector signed char)__builtin_altivec_lvxl(__a, __b);
3796 }
3797 
3798 static __inline__ vector unsigned char __ATTRS_o_ai
3799 vec_lvxl(int __a, const vector unsigned char *__b) {
3800  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3801 }
3802 
3803 static __inline__ vector unsigned char __ATTRS_o_ai
3804 vec_lvxl(int __a, const unsigned char *__b) {
3805  return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
3806 }
3807 
3808 static __inline__ vector bool char __ATTRS_o_ai
3809 vec_lvxl(int __a, const vector bool char *__b) {
3810  return (vector bool char)__builtin_altivec_lvxl(__a, __b);
3811 }
3812 
3813 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3814  const vector short *__b) {
3815  return (vector short)__builtin_altivec_lvxl(__a, __b);
3816 }
3817 
3818 static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,
3819  const short *__b) {
3820  return (vector short)__builtin_altivec_lvxl(__a, __b);
3821 }
3822 
3823 static __inline__ vector unsigned short __ATTRS_o_ai
3824 vec_lvxl(int __a, const vector unsigned short *__b) {
3825  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3826 }
3827 
3828 static __inline__ vector unsigned short __ATTRS_o_ai
3829 vec_lvxl(int __a, const unsigned short *__b) {
3830  return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
3831 }
3832 
3833 static __inline__ vector bool short __ATTRS_o_ai
3834 vec_lvxl(int __a, const vector bool short *__b) {
3835  return (vector bool short)__builtin_altivec_lvxl(__a, __b);
3836 }
3837 
3838 static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,
3839  const vector pixel *__b) {
3840  return (vector pixel)__builtin_altivec_lvxl(__a, __b);
3841 }
3842 
3843 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,
3844  const vector int *__b) {
3845  return (vector int)__builtin_altivec_lvxl(__a, __b);
3846 }
3847 
3848 static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {
3849  return (vector int)__builtin_altivec_lvxl(__a, __b);
3850 }
3851 
3852 static __inline__ vector unsigned int __ATTRS_o_ai
3853 vec_lvxl(int __a, const vector unsigned int *__b) {
3854  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3855 }
3856 
3857 static __inline__ vector unsigned int __ATTRS_o_ai
3858 vec_lvxl(int __a, const unsigned int *__b) {
3859  return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
3860 }
3861 
3862 static __inline__ vector bool int __ATTRS_o_ai
3863 vec_lvxl(int __a, const vector bool int *__b) {
3864  return (vector bool int)__builtin_altivec_lvxl(__a, __b);
3865 }
3866 
3867 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3868  const vector float *__b) {
3869  return (vector float)__builtin_altivec_lvxl(__a, __b);
3870 }
3871 
3872 static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,
3873  const float *__b) {
3874  return (vector float)__builtin_altivec_lvxl(__a, __b);
3875 }
3876 
3877 /* vec_loge */
3878 
3879 static __inline__ vector float __attribute__((__always_inline__))
3880 vec_loge(vector float __a) {
3881  return __builtin_altivec_vlogefp(__a);
3882 }
3883 
3884 /* vec_vlogefp */
3885 
3886 static __inline__ vector float __attribute__((__always_inline__))
3887 vec_vlogefp(vector float __a) {
3888  return __builtin_altivec_vlogefp(__a);
3889 }
3890 
3891 /* vec_lvsl */
3892 
3893 #ifdef __LITTLE_ENDIAN__
3894 static __inline__ vector unsigned char __ATTRS_o_ai
3895  __attribute__((__deprecated__("use assignment for unaligned little endian \
3896 loads/stores"))) vec_lvsl(int __a, const signed char *__b) {
3897  vector unsigned char mask =
3898  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3899  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3900  7, 6, 5, 4, 3, 2, 1, 0};
3901  return vec_perm(mask, mask, reverse);
3902 }
3903 #else
3904 static __inline__ vector unsigned char __ATTRS_o_ai
3905 vec_lvsl(int __a, const signed char *__b) {
3906  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3907 }
3908 #endif
3909 
3910 #ifdef __LITTLE_ENDIAN__
3911 static __inline__ vector unsigned char __ATTRS_o_ai
3912  __attribute__((__deprecated__("use assignment for unaligned little endian \
3913 loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {
3914  vector unsigned char mask =
3915  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3916  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3917  7, 6, 5, 4, 3, 2, 1, 0};
3918  return vec_perm(mask, mask, reverse);
3919 }
3920 #else
3921 static __inline__ vector unsigned char __ATTRS_o_ai
3922 vec_lvsl(int __a, const unsigned char *__b) {
3923  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3924 }
3925 #endif
3926 
3927 #ifdef __LITTLE_ENDIAN__
3928 static __inline__ vector unsigned char __ATTRS_o_ai
3929  __attribute__((__deprecated__("use assignment for unaligned little endian \
3930 loads/stores"))) vec_lvsl(int __a, const short *__b) {
3931  vector unsigned char mask =
3932  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3933  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3934  7, 6, 5, 4, 3, 2, 1, 0};
3935  return vec_perm(mask, mask, reverse);
3936 }
3937 #else
3938 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3939  const short *__b) {
3940  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3941 }
3942 #endif
3943 
3944 #ifdef __LITTLE_ENDIAN__
3945 static __inline__ vector unsigned char __ATTRS_o_ai
3946  __attribute__((__deprecated__("use assignment for unaligned little endian \
3947 loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {
3948  vector unsigned char mask =
3949  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3950  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3951  7, 6, 5, 4, 3, 2, 1, 0};
3952  return vec_perm(mask, mask, reverse);
3953 }
3954 #else
3955 static __inline__ vector unsigned char __ATTRS_o_ai
3956 vec_lvsl(int __a, const unsigned short *__b) {
3957  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3958 }
3959 #endif
3960 
3961 #ifdef __LITTLE_ENDIAN__
3962 static __inline__ vector unsigned char __ATTRS_o_ai
3963  __attribute__((__deprecated__("use assignment for unaligned little endian \
3964 loads/stores"))) vec_lvsl(int __a, const int *__b) {
3965  vector unsigned char mask =
3966  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3967  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3968  7, 6, 5, 4, 3, 2, 1, 0};
3969  return vec_perm(mask, mask, reverse);
3970 }
3971 #else
3972 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
3973  const int *__b) {
3974  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3975 }
3976 #endif
3977 
3978 #ifdef __LITTLE_ENDIAN__
3979 static __inline__ vector unsigned char __ATTRS_o_ai
3980  __attribute__((__deprecated__("use assignment for unaligned little endian \
3981 loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {
3982  vector unsigned char mask =
3983  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3984  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
3985  7, 6, 5, 4, 3, 2, 1, 0};
3986  return vec_perm(mask, mask, reverse);
3987 }
3988 #else
3989 static __inline__ vector unsigned char __ATTRS_o_ai
3990 vec_lvsl(int __a, const unsigned int *__b) {
3991  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
3992 }
3993 #endif
3994 
3995 #ifdef __LITTLE_ENDIAN__
3996 static __inline__ vector unsigned char __ATTRS_o_ai
3997  __attribute__((__deprecated__("use assignment for unaligned little endian \
3998 loads/stores"))) vec_lvsl(int __a, const float *__b) {
3999  vector unsigned char mask =
4000  (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4001  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4002  7, 6, 5, 4, 3, 2, 1, 0};
4003  return vec_perm(mask, mask, reverse);
4004 }
4005 #else
4006 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,
4007  const float *__b) {
4008  return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
4009 }
4010 #endif
4011 
4012 /* vec_lvsr */
4013 
4014 #ifdef __LITTLE_ENDIAN__
4015 static __inline__ vector unsigned char __ATTRS_o_ai
4016  __attribute__((__deprecated__("use assignment for unaligned little endian \
4017 loads/stores"))) vec_lvsr(int __a, const signed char *__b) {
4018  vector unsigned char mask =
4019  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4020  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4021  7, 6, 5, 4, 3, 2, 1, 0};
4022  return vec_perm(mask, mask, reverse);
4023 }
4024 #else
4025 static __inline__ vector unsigned char __ATTRS_o_ai
4026 vec_lvsr(int __a, const signed char *__b) {
4027  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4028 }
4029 #endif
4030 
4031 #ifdef __LITTLE_ENDIAN__
4032 static __inline__ vector unsigned char __ATTRS_o_ai
4033  __attribute__((__deprecated__("use assignment for unaligned little endian \
4034 loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {
4035  vector unsigned char mask =
4036  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4037  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4038  7, 6, 5, 4, 3, 2, 1, 0};
4039  return vec_perm(mask, mask, reverse);
4040 }
4041 #else
4042 static __inline__ vector unsigned char __ATTRS_o_ai
4043 vec_lvsr(int __a, const unsigned char *__b) {
4044  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4045 }
4046 #endif
4047 
4048 #ifdef __LITTLE_ENDIAN__
4049 static __inline__ vector unsigned char __ATTRS_o_ai
4050  __attribute__((__deprecated__("use assignment for unaligned little endian \
4051 loads/stores"))) vec_lvsr(int __a, const short *__b) {
4052  vector unsigned char mask =
4053  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4054  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4055  7, 6, 5, 4, 3, 2, 1, 0};
4056  return vec_perm(mask, mask, reverse);
4057 }
4058 #else
4059 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4060  const short *__b) {
4061  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4062 }
4063 #endif
4064 
4065 #ifdef __LITTLE_ENDIAN__
4066 static __inline__ vector unsigned char __ATTRS_o_ai
4067  __attribute__((__deprecated__("use assignment for unaligned little endian \
4068 loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {
4069  vector unsigned char mask =
4070  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4071  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4072  7, 6, 5, 4, 3, 2, 1, 0};
4073  return vec_perm(mask, mask, reverse);
4074 }
4075 #else
4076 static __inline__ vector unsigned char __ATTRS_o_ai
4077 vec_lvsr(int __a, const unsigned short *__b) {
4078  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4079 }
4080 #endif
4081 
4082 #ifdef __LITTLE_ENDIAN__
4083 static __inline__ vector unsigned char __ATTRS_o_ai
4084  __attribute__((__deprecated__("use assignment for unaligned little endian \
4085 loads/stores"))) vec_lvsr(int __a, const int *__b) {
4086  vector unsigned char mask =
4087  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4088  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4089  7, 6, 5, 4, 3, 2, 1, 0};
4090  return vec_perm(mask, mask, reverse);
4091 }
4092 #else
4093 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4094  const int *__b) {
4095  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4096 }
4097 #endif
4098 
4099 #ifdef __LITTLE_ENDIAN__
4100 static __inline__ vector unsigned char __ATTRS_o_ai
4101  __attribute__((__deprecated__("use assignment for unaligned little endian \
4102 loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {
4103  vector unsigned char mask =
4104  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4105  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4106  7, 6, 5, 4, 3, 2, 1, 0};
4107  return vec_perm(mask, mask, reverse);
4108 }
4109 #else
4110 static __inline__ vector unsigned char __ATTRS_o_ai
4111 vec_lvsr(int __a, const unsigned int *__b) {
4112  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4113 }
4114 #endif
4115 
4116 #ifdef __LITTLE_ENDIAN__
4117 static __inline__ vector unsigned char __ATTRS_o_ai
4118  __attribute__((__deprecated__("use assignment for unaligned little endian \
4119 loads/stores"))) vec_lvsr(int __a, const float *__b) {
4120  vector unsigned char mask =
4121  (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4122  vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,
4123  7, 6, 5, 4, 3, 2, 1, 0};
4124  return vec_perm(mask, mask, reverse);
4125 }
4126 #else
4127 static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,
4128  const float *__b) {
4129  return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
4130 }
4131 #endif
4132 
4133 /* vec_madd */
4134 static __inline__ vector signed short __ATTRS_o_ai
4135 vec_mladd(vector signed short, vector signed short, vector signed short);
4136 static __inline__ vector signed short __ATTRS_o_ai
4137 vec_mladd(vector signed short, vector unsigned short, vector unsigned short);
4138 static __inline__ vector signed short __ATTRS_o_ai
4139 vec_mladd(vector unsigned short, vector signed short, vector signed short);
4140 static __inline__ vector unsigned short __ATTRS_o_ai
4141 vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);
4142 
4143 static __inline__ vector signed short __ATTRS_o_ai vec_madd(
4144  vector signed short __a, vector signed short __b, vector signed short __c) {
4145  return vec_mladd(__a, __b, __c);
4146 }
4147 
4148 static __inline__ vector signed short __ATTRS_o_ai
4149 vec_madd(vector signed short __a, vector unsigned short __b,
4150  vector unsigned short __c) {
4151  return vec_mladd(__a, __b, __c);
4152 }
4153 
4154 static __inline__ vector signed short __ATTRS_o_ai
4155 vec_madd(vector unsigned short __a, vector signed short __b,
4156  vector signed short __c) {
4157  return vec_mladd(__a, __b, __c);
4158 }
4159 
4160 static __inline__ vector unsigned short __ATTRS_o_ai
4161 vec_madd(vector unsigned short __a, vector unsigned short __b,
4162  vector unsigned short __c) {
4163  return vec_mladd(__a, __b, __c);
4164 }
4165 
4166 static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,
4167  vector float __b,
4168  vector float __c) {
4169 #ifdef __VSX__
4170  return __builtin_vsx_xvmaddasp(__a, __b, __c);
4171 #else
4172  return __builtin_altivec_vmaddfp(__a, __b, __c);
4173 #endif
4174 }
4175 
4176 #ifdef __VSX__
4177 static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,
4178  vector double __b,
4179  vector double __c) {
4180  return __builtin_vsx_xvmaddadp(__a, __b, __c);
4181 }
4182 #endif
4183 
4184 /* vec_vmaddfp */
4185 
4186 static __inline__ vector float __attribute__((__always_inline__))
4187 vec_vmaddfp(vector float __a, vector float __b, vector float __c) {
4188  return __builtin_altivec_vmaddfp(__a, __b, __c);
4189 }
4190 
4191 /* vec_madds */
4192 
4193 static __inline__ vector signed short __attribute__((__always_inline__))
4194 vec_madds(vector signed short __a, vector signed short __b,
4195  vector signed short __c) {
4196  return __builtin_altivec_vmhaddshs(__a, __b, __c);
4197 }
4198 
4199 /* vec_vmhaddshs */
4200 static __inline__ vector signed short __attribute__((__always_inline__))
4201 vec_vmhaddshs(vector signed short __a, vector signed short __b,
4202  vector signed short __c) {
4203  return __builtin_altivec_vmhaddshs(__a, __b, __c);
4204 }
4205 
4206 /* vec_msub */
4207 
4208 #ifdef __VSX__
4209 static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,
4210  vector float __b,
4211  vector float __c) {
4212  return __builtin_vsx_xvmsubasp(__a, __b, __c);
4213 }
4214 
4215 static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,
4216  vector double __b,
4217  vector double __c) {
4218  return __builtin_vsx_xvmsubadp(__a, __b, __c);
4219 }
4220 #endif
4221 
4222 /* vec_max */
4223 
4224 static __inline__ vector signed char __ATTRS_o_ai
4225 vec_max(vector signed char __a, vector signed char __b) {
4226  return __builtin_altivec_vmaxsb(__a, __b);
4227 }
4228 
4229 static __inline__ vector signed char __ATTRS_o_ai
4230 vec_max(vector bool char __a, vector signed char __b) {
4231  return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4232 }
4233 
4234 static __inline__ vector signed char __ATTRS_o_ai
4235 vec_max(vector signed char __a, vector bool char __b) {
4236  return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4237 }
4238 
4239 static __inline__ vector unsigned char __ATTRS_o_ai
4240 vec_max(vector unsigned char __a, vector unsigned char __b) {
4241  return __builtin_altivec_vmaxub(__a, __b);
4242 }
4243 
4244 static __inline__ vector unsigned char __ATTRS_o_ai
4245 vec_max(vector bool char __a, vector unsigned char __b) {
4246  return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4247 }
4248 
4249 static __inline__ vector unsigned char __ATTRS_o_ai
4250 vec_max(vector unsigned char __a, vector bool char __b) {
4251  return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4252 }
4253 
4254 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4255  vector short __b) {
4256  return __builtin_altivec_vmaxsh(__a, __b);
4257 }
4258 
4259 static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,
4260  vector short __b) {
4261  return __builtin_altivec_vmaxsh((vector short)__a, __b);
4262 }
4263 
4264 static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,
4265  vector bool short __b) {
4266  return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4267 }
4268 
4269 static __inline__ vector unsigned short __ATTRS_o_ai
4270 vec_max(vector unsigned short __a, vector unsigned short __b) {
4271  return __builtin_altivec_vmaxuh(__a, __b);
4272 }
4273 
4274 static __inline__ vector unsigned short __ATTRS_o_ai
4275 vec_max(vector bool short __a, vector unsigned short __b) {
4276  return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4277 }
4278 
4279 static __inline__ vector unsigned short __ATTRS_o_ai
4280 vec_max(vector unsigned short __a, vector bool short __b) {
4281  return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4282 }
4283 
4284 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4285  vector int __b) {
4286  return __builtin_altivec_vmaxsw(__a, __b);
4287 }
4288 
4289 static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,
4290  vector int __b) {
4291  return __builtin_altivec_vmaxsw((vector int)__a, __b);
4292 }
4293 
4294 static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,
4295  vector bool int __b) {
4296  return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4297 }
4298 
4299 static __inline__ vector unsigned int __ATTRS_o_ai
4300 vec_max(vector unsigned int __a, vector unsigned int __b) {
4301  return __builtin_altivec_vmaxuw(__a, __b);
4302 }
4303 
4304 static __inline__ vector unsigned int __ATTRS_o_ai
4305 vec_max(vector bool int __a, vector unsigned int __b) {
4306  return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4307 }
4308 
4309 static __inline__ vector unsigned int __ATTRS_o_ai
4310 vec_max(vector unsigned int __a, vector bool int __b) {
4311  return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4312 }
4313 
4314 #ifdef __POWER8_VECTOR__
4315 static __inline__ vector signed long long __ATTRS_o_ai
4316 vec_max(vector signed long long __a, vector signed long long __b) {
4317  return __builtin_altivec_vmaxsd(__a, __b);
4318 }
4319 
4320 static __inline__ vector signed long long __ATTRS_o_ai
4321 vec_max(vector bool long long __a, vector signed long long __b) {
4322  return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);
4323 }
4324 
4325 static __inline__ vector signed long long __ATTRS_o_ai
4326 vec_max(vector signed long long __a, vector bool long long __b) {
4327  return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);
4328 }
4329 
4330 static __inline__ vector unsigned long long __ATTRS_o_ai
4331 vec_max(vector unsigned long long __a, vector unsigned long long __b) {
4332  return __builtin_altivec_vmaxud(__a, __b);
4333 }
4334 
4335 static __inline__ vector unsigned long long __ATTRS_o_ai
4336 vec_max(vector bool long long __a, vector unsigned long long __b) {
4337  return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);
4338 }
4339 
4340 static __inline__ vector unsigned long long __ATTRS_o_ai
4341 vec_max(vector unsigned long long __a, vector bool long long __b) {
4342  return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);
4343 }
4344 #endif
4345 
4346 static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,
4347  vector float __b) {
4348 #ifdef __VSX__
4349  return __builtin_vsx_xvmaxsp(__a, __b);
4350 #else
4351  return __builtin_altivec_vmaxfp(__a, __b);
4352 #endif
4353 }
4354 
4355 #ifdef __VSX__
4356 static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,
4357  vector double __b) {
4358  return __builtin_vsx_xvmaxdp(__a, __b);
4359 }
4360 #endif
4361 
4362 /* vec_vmaxsb */
4363 
4364 static __inline__ vector signed char __ATTRS_o_ai
4365 vec_vmaxsb(vector signed char __a, vector signed char __b) {
4366  return __builtin_altivec_vmaxsb(__a, __b);
4367 }
4368 
4369 static __inline__ vector signed char __ATTRS_o_ai
4370 vec_vmaxsb(vector bool char __a, vector signed char __b) {
4371  return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
4372 }
4373 
4374 static __inline__ vector signed char __ATTRS_o_ai
4375 vec_vmaxsb(vector signed char __a, vector bool char __b) {
4376  return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
4377 }
4378 
4379 /* vec_vmaxub */
4380 
4381 static __inline__ vector unsigned char __ATTRS_o_ai
4382 vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {
4383  return __builtin_altivec_vmaxub(__a, __b);
4384 }
4385 
4386 static __inline__ vector unsigned char __ATTRS_o_ai
4387 vec_vmaxub(vector bool char __a, vector unsigned char __b) {
4388  return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
4389 }
4390 
4391 static __inline__ vector unsigned char __ATTRS_o_ai
4392 vec_vmaxub(vector unsigned char __a, vector bool char __b) {
4393  return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
4394 }
4395 
4396 /* vec_vmaxsh */
4397 
4398 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4399  vector short __b) {
4400  return __builtin_altivec_vmaxsh(__a, __b);
4401 }
4402 
4403 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,
4404  vector short __b) {
4405  return __builtin_altivec_vmaxsh((vector short)__a, __b);
4406 }
4407 
4408 static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,
4409  vector bool short __b) {
4410  return __builtin_altivec_vmaxsh(__a, (vector short)__b);
4411 }
4412 
4413 /* vec_vmaxuh */
4414 
4415 static __inline__ vector unsigned short __ATTRS_o_ai
4416 vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {
4417  return __builtin_altivec_vmaxuh(__a, __b);
4418 }
4419 
4420 static __inline__ vector unsigned short __ATTRS_o_ai
4421 vec_vmaxuh(vector bool short __a, vector unsigned short __b) {
4422  return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
4423 }
4424 
4425 static __inline__ vector unsigned short __ATTRS_o_ai
4426 vec_vmaxuh(vector unsigned short __a, vector bool short __b) {
4427  return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
4428 }
4429 
4430 /* vec_vmaxsw */
4431 
4432 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4433  vector int __b) {
4434  return __builtin_altivec_vmaxsw(__a, __b);
4435 }
4436 
4437 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,
4438  vector int __b) {
4439  return __builtin_altivec_vmaxsw((vector int)__a, __b);
4440 }
4441 
4442 static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,
4443  vector bool int __b) {
4444  return __builtin_altivec_vmaxsw(__a, (vector int)__b);
4445 }
4446 
4447 /* vec_vmaxuw */
4448 
4449 static __inline__ vector unsigned int __ATTRS_o_ai
4450 vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {
4451  return __builtin_altivec_vmaxuw(__a, __b);
4452 }
4453 
4454 static __inline__ vector unsigned int __ATTRS_o_ai
4455 vec_vmaxuw(vector bool int __a, vector unsigned int __b) {
4456  return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
4457 }
4458 
4459 static __inline__ vector unsigned int __ATTRS_o_ai
4460 vec_vmaxuw(vector unsigned int __a, vector bool int __b) {
4461  return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
4462 }
4463 
4464 /* vec_vmaxfp */
4465 
4466 static __inline__ vector float __attribute__((__always_inline__))
4467 vec_vmaxfp(vector float __a, vector float __b) {
4468 #ifdef __VSX__
4469  return __builtin_vsx_xvmaxsp(__a, __b);
4470 #else
4471  return __builtin_altivec_vmaxfp(__a, __b);
4472 #endif
4473 }
4474 
4475 /* vec_mergeh */
4476 
4477 static __inline__ vector signed char __ATTRS_o_ai
4478 vec_mergeh(vector signed char __a, vector signed char __b) {
4479  return vec_perm(__a, __b,
4480  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4481  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4482  0x06, 0x16, 0x07, 0x17));
4483 }
4484 
4485 static __inline__ vector unsigned char __ATTRS_o_ai
4486 vec_mergeh(vector unsigned char __a, vector unsigned char __b) {
4487  return vec_perm(__a, __b,
4488  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4489  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4490  0x06, 0x16, 0x07, 0x17));
4491 }
4492 
4493 static __inline__ vector bool char __ATTRS_o_ai
4494 vec_mergeh(vector bool char __a, vector bool char __b) {
4495  return vec_perm(__a, __b,
4496  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4497  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4498  0x06, 0x16, 0x07, 0x17));
4499 }
4500 
4501 static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,
4502  vector short __b) {
4503  return vec_perm(__a, __b,
4504  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4505  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4506  0x06, 0x07, 0x16, 0x17));
4507 }
4508 
4509 static __inline__ vector unsigned short __ATTRS_o_ai
4510 vec_mergeh(vector unsigned short __a, vector unsigned short __b) {
4511  return vec_perm(__a, __b,
4512  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4513  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4514  0x06, 0x07, 0x16, 0x17));
4515 }
4516 
4517 static __inline__ vector bool short __ATTRS_o_ai
4518 vec_mergeh(vector bool short __a, vector bool short __b) {
4519  return vec_perm(__a, __b,
4520  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4521  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4522  0x06, 0x07, 0x16, 0x17));
4523 }
4524 
4525 static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,
4526  vector pixel __b) {
4527  return vec_perm(__a, __b,
4528  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4529  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4530  0x06, 0x07, 0x16, 0x17));
4531 }
4532 
4533 static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,
4534  vector int __b) {
4535  return vec_perm(__a, __b,
4536  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4537  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4538  0x14, 0x15, 0x16, 0x17));
4539 }
4540 
4541 static __inline__ vector unsigned int __ATTRS_o_ai
4542 vec_mergeh(vector unsigned int __a, vector unsigned int __b) {
4543  return vec_perm(__a, __b,
4544  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4545  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4546  0x14, 0x15, 0x16, 0x17));
4547 }
4548 
4549 static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,
4550  vector bool int __b) {
4551  return vec_perm(__a, __b,
4552  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4553  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4554  0x14, 0x15, 0x16, 0x17));
4555 }
4556 
4557 static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,
4558  vector float __b) {
4559  return vec_perm(__a, __b,
4560  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4561  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4562  0x14, 0x15, 0x16, 0x17));
4563 }
4564 
4565 #ifdef __VSX__
4566 static __inline__ vector signed long long __ATTRS_o_ai
4567 vec_mergeh(vector signed long long __a, vector signed long long __b) {
4568  return vec_perm(__a, __b,
4569  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4570  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4571  0x14, 0x15, 0x16, 0x17));
4572 }
4573 
4574 static __inline__ vector signed long long __ATTRS_o_ai
4575 vec_mergeh(vector signed long long __a, vector bool long long __b) {
4576  return vec_perm(__a, (vector signed long long)__b,
4577  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4578  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4579  0x14, 0x15, 0x16, 0x17));
4580 }
4581 
4582 static __inline__ vector signed long long __ATTRS_o_ai
4583 vec_mergeh(vector bool long long __a, vector signed long long __b) {
4584  return vec_perm((vector signed long long)__a, __b,
4585  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4586  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4587  0x14, 0x15, 0x16, 0x17));
4588 }
4589 
4590 static __inline__ vector unsigned long long __ATTRS_o_ai
4591 vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {
4592  return vec_perm(__a, __b,
4593  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4594  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4595  0x14, 0x15, 0x16, 0x17));
4596 }
4597 
4598 static __inline__ vector unsigned long long __ATTRS_o_ai
4599 vec_mergeh(vector unsigned long long __a, vector bool long long __b) {
4600  return vec_perm(__a, (vector unsigned long long)__b,
4601  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4602  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4603  0x14, 0x15, 0x16, 0x17));
4604 }
4605 
4606 static __inline__ vector unsigned long long __ATTRS_o_ai
4607 vec_mergeh(vector bool long long __a, vector unsigned long long __b) {
4608  return vec_perm((vector unsigned long long)__a, __b,
4609  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4610  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4611  0x14, 0x15, 0x16, 0x17));
4612 }
4613 
4614 static __inline__ vector bool long long __ATTRS_o_ai
4615 vec_mergeh(vector bool long long __a, vector bool long long __b) {
4616  return vec_perm(__a, __b,
4617  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4618  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4619  0x14, 0x15, 0x16, 0x17));
4620 }
4621 
4622 static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,
4623  vector double __b) {
4624  return vec_perm(__a, __b,
4625  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4626  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4627  0x14, 0x15, 0x16, 0x17));
4628 }
4629 static __inline__ vector double __ATTRS_o_ai
4630 vec_mergeh(vector double __a, vector bool long long __b) {
4631  return vec_perm(__a, (vector double)__b,
4632  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4633  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4634  0x14, 0x15, 0x16, 0x17));
4635 }
4636 static __inline__ vector double __ATTRS_o_ai
4637 vec_mergeh(vector bool long long __a, vector double __b) {
4638  return vec_perm((vector double)__a, __b,
4639  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
4640  0x06, 0x07, 0x10, 0x11, 0x12, 0x13,
4641  0x14, 0x15, 0x16, 0x17));
4642 }
4643 #endif
4644 
4645 /* vec_vmrghb */
4646 
4647 #define __builtin_altivec_vmrghb vec_vmrghb
4648 
4649 static __inline__ vector signed char __ATTRS_o_ai
4650 vec_vmrghb(vector signed char __a, vector signed char __b) {
4651  return vec_perm(__a, __b,
4652  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4653  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4654  0x06, 0x16, 0x07, 0x17));
4655 }
4656 
4657 static __inline__ vector unsigned char __ATTRS_o_ai
4658 vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {
4659  return vec_perm(__a, __b,
4660  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4661  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4662  0x06, 0x16, 0x07, 0x17));
4663 }
4664 
4665 static __inline__ vector bool char __ATTRS_o_ai
4666 vec_vmrghb(vector bool char __a, vector bool char __b) {
4667  return vec_perm(__a, __b,
4668  (vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,
4669  0x03, 0x13, 0x04, 0x14, 0x05, 0x15,
4670  0x06, 0x16, 0x07, 0x17));
4671 }
4672 
4673 /* vec_vmrghh */
4674 
4675 #define __builtin_altivec_vmrghh vec_vmrghh
4676 
4677 static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,
4678  vector short __b) {
4679  return vec_perm(__a, __b,
4680  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4681  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4682  0x06, 0x07, 0x16, 0x17));
4683 }
4684 
4685 static __inline__ vector unsigned short __ATTRS_o_ai
4686 vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {
4687  return vec_perm(__a, __b,
4688  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4689  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4690  0x06, 0x07, 0x16, 0x17));
4691 }
4692 
4693 static __inline__ vector bool short __ATTRS_o_ai
4694 vec_vmrghh(vector bool short __a, vector bool short __b) {
4695  return vec_perm(__a, __b,
4696  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4697  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4698  0x06, 0x07, 0x16, 0x17));
4699 }
4700 
4701 static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,
4702  vector pixel __b) {
4703  return vec_perm(__a, __b,
4704  (vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,
4705  0x12, 0x13, 0x04, 0x05, 0x14, 0x15,
4706  0x06, 0x07, 0x16, 0x17));
4707 }
4708 
4709 /* vec_vmrghw */
4710 
4711 #define __builtin_altivec_vmrghw vec_vmrghw
4712 
4713 static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,
4714  vector int __b) {
4715  return vec_perm(__a, __b,
4716  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4717  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4718  0x14, 0x15, 0x16, 0x17));
4719 }
4720 
4721 static __inline__ vector unsigned int __ATTRS_o_ai
4722 vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {
4723  return vec_perm(__a, __b,
4724  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4725  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4726  0x14, 0x15, 0x16, 0x17));
4727 }
4728 
4729 static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,
4730  vector bool int __b) {
4731  return vec_perm(__a, __b,
4732  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4733  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4734  0x14, 0x15, 0x16, 0x17));
4735 }
4736 
4737 static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,
4738  vector float __b) {
4739  return vec_perm(__a, __b,
4740  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
4741  0x12, 0x13, 0x04, 0x05, 0x06, 0x07,
4742  0x14, 0x15, 0x16, 0x17));
4743 }
4744 
4745 /* vec_mergel */
4746 
4747 static __inline__ vector signed char __ATTRS_o_ai
4748 vec_mergel(vector signed char __a, vector signed char __b) {
4749  return vec_perm(__a, __b,
4750  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4751  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4752  0x0E, 0x1E, 0x0F, 0x1F));
4753 }
4754 
4755 static __inline__ vector unsigned char __ATTRS_o_ai
4756 vec_mergel(vector unsigned char __a, vector unsigned char __b) {
4757  return vec_perm(__a, __b,
4758  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4759  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4760  0x0E, 0x1E, 0x0F, 0x1F));
4761 }
4762 
4763 static __inline__ vector bool char __ATTRS_o_ai
4764 vec_mergel(vector bool char __a, vector bool char __b) {
4765  return vec_perm(__a, __b,
4766  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4767  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4768  0x0E, 0x1E, 0x0F, 0x1F));
4769 }
4770 
4771 static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,
4772  vector short __b) {
4773  return vec_perm(__a, __b,
4774  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4775  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4776  0x0E, 0x0F, 0x1E, 0x1F));
4777 }
4778 
4779 static __inline__ vector unsigned short __ATTRS_o_ai
4780 vec_mergel(vector unsigned short __a, vector unsigned short __b) {
4781  return vec_perm(__a, __b,
4782  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4783  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4784  0x0E, 0x0F, 0x1E, 0x1F));
4785 }
4786 
4787 static __inline__ vector bool short __ATTRS_o_ai
4788 vec_mergel(vector bool short __a, vector bool short __b) {
4789  return vec_perm(__a, __b,
4790  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4791  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4792  0x0E, 0x0F, 0x1E, 0x1F));
4793 }
4794 
4795 static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,
4796  vector pixel __b) {
4797  return vec_perm(__a, __b,
4798  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4799  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4800  0x0E, 0x0F, 0x1E, 0x1F));
4801 }
4802 
4803 static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,
4804  vector int __b) {
4805  return vec_perm(__a, __b,
4806  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4807  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4808  0x1C, 0x1D, 0x1E, 0x1F));
4809 }
4810 
4811 static __inline__ vector unsigned int __ATTRS_o_ai
4812 vec_mergel(vector unsigned int __a, vector unsigned int __b) {
4813  return vec_perm(__a, __b,
4814  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4815  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4816  0x1C, 0x1D, 0x1E, 0x1F));
4817 }
4818 
4819 static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,
4820  vector bool int __b) {
4821  return vec_perm(__a, __b,
4822  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4823  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4824  0x1C, 0x1D, 0x1E, 0x1F));
4825 }
4826 
4827 static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,
4828  vector float __b) {
4829  return vec_perm(__a, __b,
4830  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4831  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4832  0x1C, 0x1D, 0x1E, 0x1F));
4833 }
4834 
4835 #ifdef __VSX__
4836 static __inline__ vector signed long long __ATTRS_o_ai
4837 vec_mergel(vector signed long long __a, vector signed long long __b) {
4838  return vec_perm(__a, __b,
4839  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4840  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4841  0x1C, 0x1D, 0x1E, 0x1F));
4842 }
4843 static __inline__ vector signed long long __ATTRS_o_ai
4844 vec_mergel(vector signed long long __a, vector bool long long __b) {
4845  return vec_perm(__a, (vector signed long long)__b,
4846  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4847  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4848  0x1C, 0x1D, 0x1E, 0x1F));
4849 }
4850 static __inline__ vector signed long long __ATTRS_o_ai
4851 vec_mergel(vector bool long long __a, vector signed long long __b) {
4852  return vec_perm((vector signed long long)__a, __b,
4853  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4854  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4855  0x1C, 0x1D, 0x1E, 0x1F));
4856 }
4857 static __inline__ vector unsigned long long __ATTRS_o_ai
4858 vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {
4859  return vec_perm(__a, __b,
4860  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4861  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4862  0x1C, 0x1D, 0x1E, 0x1F));
4863 }
4864 static __inline__ vector unsigned long long __ATTRS_o_ai
4865 vec_mergel(vector unsigned long long __a, vector bool long long __b) {
4866  return vec_perm(__a, (vector unsigned long long)__b,
4867  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4868  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4869  0x1C, 0x1D, 0x1E, 0x1F));
4870 }
4871 static __inline__ vector unsigned long long __ATTRS_o_ai
4872 vec_mergel(vector bool long long __a, vector unsigned long long __b) {
4873  return vec_perm((vector unsigned long long)__a, __b,
4874  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4875  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4876  0x1C, 0x1D, 0x1E, 0x1F));
4877 }
4878 static __inline__ vector bool long long __ATTRS_o_ai
4879 vec_mergel(vector bool long long __a, vector bool long long __b) {
4880  return vec_perm(__a, __b,
4881  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4882  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4883  0x1C, 0x1D, 0x1E, 0x1F));
4884 }
4885 static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,
4886  vector double __b) {
4887  return vec_perm(__a, __b,
4888  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4889  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4890  0x1C, 0x1D, 0x1E, 0x1F));
4891 }
4892 static __inline__ vector double __ATTRS_o_ai
4893 vec_mergel(vector double __a, vector bool long long __b) {
4894  return vec_perm(__a, (vector double)__b,
4895  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4896  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4897  0x1C, 0x1D, 0x1E, 0x1F));
4898 }
4899 static __inline__ vector double __ATTRS_o_ai
4900 vec_mergel(vector bool long long __a, vector double __b) {
4901  return vec_perm((vector double)__a, __b,
4902  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
4903  0x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,
4904  0x1C, 0x1D, 0x1E, 0x1F));
4905 }
4906 #endif
4907 
4908 /* vec_vmrglb */
4909 
4910 #define __builtin_altivec_vmrglb vec_vmrglb
4911 
4912 static __inline__ vector signed char __ATTRS_o_ai
4913 vec_vmrglb(vector signed char __a, vector signed char __b) {
4914  return vec_perm(__a, __b,
4915  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4916  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4917  0x0E, 0x1E, 0x0F, 0x1F));
4918 }
4919 
4920 static __inline__ vector unsigned char __ATTRS_o_ai
4921 vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {
4922  return vec_perm(__a, __b,
4923  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4924  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4925  0x0E, 0x1E, 0x0F, 0x1F));
4926 }
4927 
4928 static __inline__ vector bool char __ATTRS_o_ai
4929 vec_vmrglb(vector bool char __a, vector bool char __b) {
4930  return vec_perm(__a, __b,
4931  (vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,
4932  0x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,
4933  0x0E, 0x1E, 0x0F, 0x1F));
4934 }
4935 
4936 /* vec_vmrglh */
4937 
4938 #define __builtin_altivec_vmrglh vec_vmrglh
4939 
4940 static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,
4941  vector short __b) {
4942  return vec_perm(__a, __b,
4943  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4944  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4945  0x0E, 0x0F, 0x1E, 0x1F));
4946 }
4947 
4948 static __inline__ vector unsigned short __ATTRS_o_ai
4949 vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {
4950  return vec_perm(__a, __b,
4951  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4952  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4953  0x0E, 0x0F, 0x1E, 0x1F));
4954 }
4955 
4956 static __inline__ vector bool short __ATTRS_o_ai
4957 vec_vmrglh(vector bool short __a, vector bool short __b) {
4958  return vec_perm(__a, __b,
4959  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4960  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4961  0x0E, 0x0F, 0x1E, 0x1F));
4962 }
4963 
4964 static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,
4965  vector pixel __b) {
4966  return vec_perm(__a, __b,
4967  (vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,
4968  0x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,
4969  0x0E, 0x0F, 0x1E, 0x1F));
4970 }
4971 
4972 /* vec_vmrglw */
4973 
4974 #define __builtin_altivec_vmrglw vec_vmrglw
4975 
4976 static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,
4977  vector int __b) {
4978  return vec_perm(__a, __b,
4979  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4980  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4981  0x1C, 0x1D, 0x1E, 0x1F));
4982 }
4983 
4984 static __inline__ vector unsigned int __ATTRS_o_ai
4985 vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {
4986  return vec_perm(__a, __b,
4987  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4988  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4989  0x1C, 0x1D, 0x1E, 0x1F));
4990 }
4991 
4992 static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,
4993  vector bool int __b) {
4994  return vec_perm(__a, __b,
4995  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
4996  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
4997  0x1C, 0x1D, 0x1E, 0x1F));
4998 }
4999 
5000 static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,
5001  vector float __b) {
5002  return vec_perm(__a, __b,
5003  (vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,
5004  0x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,
5005  0x1C, 0x1D, 0x1E, 0x1F));
5006 }
5007 
5008 #ifdef __POWER8_VECTOR__
5009 /* vec_mergee */
5010 
5011 static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,
5012  vector bool int __b) {
5013  return vec_perm(__a, __b,
5014  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5015  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5016  0x18, 0x19, 0x1A, 0x1B));
5017 }
5018 
5019 static __inline__ vector signed int __ATTRS_o_ai
5020 vec_mergee(vector signed int __a, vector signed int __b) {
5021  return vec_perm(__a, __b,
5022  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5023  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5024  0x18, 0x19, 0x1A, 0x1B));
5025 }
5026 
5027 static __inline__ vector unsigned int __ATTRS_o_ai
5028 vec_mergee(vector unsigned int __a, vector unsigned int __b) {
5029  return vec_perm(__a, __b,
5030  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5031  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5032  0x18, 0x19, 0x1A, 0x1B));
5033 }
5034 
5035 static __inline__ vector bool long long __ATTRS_o_ai
5036 vec_mergee(vector bool long long __a, vector bool long long __b) {
5037  return vec_mergeh(__a, __b);
5038 }
5039 
5040 static __inline__ vector signed long long __ATTRS_o_ai
5041 vec_mergee(vector signed long long __a, vector signed long long __b) {
5042  return vec_mergeh(__a, __b);
5043 }
5044 
5045 static __inline__ vector unsigned long long __ATTRS_o_ai
5046 vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {
5047  return vec_mergeh(__a, __b);
5048 }
5049 
5050 static __inline__ vector float __ATTRS_o_ai
5051 vec_mergee(vector float __a, vector float __b) {
5052  return vec_perm(__a, __b,
5053  (vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,
5054  0x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,
5055  0x18, 0x19, 0x1A, 0x1B));
5056 }
5057 
5058 static __inline__ vector double __ATTRS_o_ai
5059 vec_mergee(vector double __a, vector double __b) {
5060  return vec_mergeh(__a, __b);
5061 }
5062 
5063 /* vec_mergeo */
5064 
5065 static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,
5066  vector bool int __b) {
5067  return vec_perm(__a, __b,
5068  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5069  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5070  0x1C, 0x1D, 0x1E, 0x1F));
5071 }
5072 
5073 static __inline__ vector signed int __ATTRS_o_ai
5074 vec_mergeo(vector signed int __a, vector signed int __b) {
5075  return vec_perm(__a, __b,
5076  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5077  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5078  0x1C, 0x1D, 0x1E, 0x1F));
5079 }
5080 
5081 static __inline__ vector unsigned int __ATTRS_o_ai
5082 vec_mergeo(vector unsigned int __a, vector unsigned int __b) {
5083  return vec_perm(__a, __b,
5084  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5085  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5086  0x1C, 0x1D, 0x1E, 0x1F));
5087 }
5088 
5089 static __inline__ vector bool long long __ATTRS_o_ai
5090 vec_mergeo(vector bool long long __a, vector bool long long __b) {
5091  return vec_mergel(__a, __b);
5092 }
5093 
5094 static __inline__ vector signed long long __ATTRS_o_ai
5095 vec_mergeo(vector signed long long __a, vector signed long long __b) {
5096  return vec_mergel(__a, __b);
5097 }
5098 
5099 static __inline__ vector unsigned long long __ATTRS_o_ai
5100 vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {
5101  return vec_mergel(__a, __b);
5102 }
5103 
5104 static __inline__ vector float __ATTRS_o_ai
5105 vec_mergeo(vector float __a, vector float __b) {
5106  return vec_perm(__a, __b,
5107  (vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,
5108  0x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,
5109  0x1C, 0x1D, 0x1E, 0x1F));
5110 }
5111 
5112 static __inline__ vector double __ATTRS_o_ai
5113 vec_mergeo(vector double __a, vector double __b) {
5114  return vec_mergel(__a, __b);
5115 }
5116 
5117 #endif
5118 
5119 /* vec_mfvscr */
5120 
5121 static __inline__ vector unsigned short __attribute__((__always_inline__))
5122 vec_mfvscr(void) {
5123  return __builtin_altivec_mfvscr();
5124 }
5125 
5126 /* vec_min */
5127 
5128 static __inline__ vector signed char __ATTRS_o_ai
5129 vec_min(vector signed char __a, vector signed char __b) {
5130  return __builtin_altivec_vminsb(__a, __b);
5131 }
5132 
5133 static __inline__ vector signed char __ATTRS_o_ai
5134 vec_min(vector bool char __a, vector signed char __b) {
5135  return __builtin_altivec_vminsb((vector signed char)__a, __b);
5136 }
5137 
5138 static __inline__ vector signed char __ATTRS_o_ai
5139 vec_min(vector signed char __a, vector bool char __b) {
5140  return __builtin_altivec_vminsb(__a, (vector signed char)__b);
5141 }
5142 
5143 static __inline__ vector unsigned char __ATTRS_o_ai
5144 vec_min(vector unsigned char __a, vector unsigned char __b) {
5145  return __builtin_altivec_vminub(__a, __b);
5146 }
5147 
5148 static __inline__ vector unsigned char __ATTRS_o_ai
5149 vec_min(vector bool char __a, vector unsigned char __b) {
5150  return __builtin_altivec_vminub((vector unsigned char)__a, __b);
5151 }
5152 
5153 static __inline__ vector unsigned char __ATTRS_o_ai
5154 vec_min(vector unsigned char __a, vector bool char __b) {
5155  return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
5156 }
5157 
5158 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5159  vector short __b) {
5160  return __builtin_altivec_vminsh(__a, __b);
5161 }
5162 
5163 static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,
5164  vector short __b) {
5165  return __builtin_altivec_vminsh((vector short)__a, __b);
5166 }
5167 
5168 static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,
5169  vector bool short __b) {
5170  return __builtin_altivec_vminsh(__a, (vector short)__b);
5171 }
5172 
5173 static __inline__ vector unsigned short