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