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