blob: 9995415c010e2a28fde6a3c1252108f2e69b9aac [file] [log] [blame]
Chris Lattnerdad40622010-04-14 03:54:58 +00001/*===---- 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
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000037#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
38
39static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000040vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000041
42static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000043vec_perm(vector unsigned char __a,
44 vector unsigned char __b,
45 vector unsigned char __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000046
Anton Yartsev9e968982010-08-19 03:00:09 +000047static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000048vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);
Anton Yartsev9e968982010-08-19 03:00:09 +000049
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000050static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000051vec_perm(vector short __a, vector short __b, vector unsigned char __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000052
53static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000054vec_perm(vector unsigned short __a,
55 vector unsigned short __b,
56 vector unsigned char __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000057
Anton Yartsev9e968982010-08-19 03:00:09 +000058static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000059vec_perm(vector bool short __a, vector bool short __b, vector unsigned char __c);
Anton Yartsev9e968982010-08-19 03:00:09 +000060
61static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000062vec_perm(vector pixel __a, vector pixel __b, vector unsigned char __c);
Anton Yartsev9e968982010-08-19 03:00:09 +000063
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000064static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000065vec_perm(vector int __a, vector int __b, vector unsigned char __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000066
67static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000068vec_perm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000069
Anton Yartsev9e968982010-08-19 03:00:09 +000070static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000071vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);
Anton Yartsev9e968982010-08-19 03:00:09 +000072
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000073static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000074vec_perm(vector float __a, vector float __b, vector unsigned char __c);
Chris Lattnerdad40622010-04-14 03:54:58 +000075
Bill Schmidtf7e289c2014-06-05 19:07:40 +000076static vector unsigned char __ATTRS_o_ai
77vec_xor(vector unsigned char __a, vector unsigned char __b);
78
Chris Lattnerdad40622010-04-14 03:54:58 +000079/* vec_abs */
80
Chris Lattnerdad40622010-04-14 03:54:58 +000081#define __builtin_altivec_abs_v16qi vec_abs
82#define __builtin_altivec_abs_v8hi vec_abs
83#define __builtin_altivec_abs_v4si vec_abs
84
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000085static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000086vec_abs(vector signed char __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000087{
David Blaikie3302f2b2013-01-16 23:08:36 +000088 return __builtin_altivec_vmaxsb(__a, -__a);
Chris Lattnerdad40622010-04-14 03:54:58 +000089}
90
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000091static vector signed short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000092vec_abs(vector signed short __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000093{
David Blaikie3302f2b2013-01-16 23:08:36 +000094 return __builtin_altivec_vmaxsh(__a, -__a);
Chris Lattnerdad40622010-04-14 03:54:58 +000095}
96
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000097static vector signed int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000098vec_abs(vector signed int __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000099{
David Blaikie3302f2b2013-01-16 23:08:36 +0000100 return __builtin_altivec_vmaxsw(__a, -__a);
Chris Lattnerdad40622010-04-14 03:54:58 +0000101}
102
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000103static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000104vec_abs(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +0000105{
David Blaikie3302f2b2013-01-16 23:08:36 +0000106 vector unsigned int __res = (vector unsigned int)__a
Anton Yartsev79d6af32010-09-18 00:39:16 +0000107 & (vector unsigned int)(0x7FFFFFFF);
David Blaikie3302f2b2013-01-16 23:08:36 +0000108 return (vector float)__res;
Chris Lattnerdad40622010-04-14 03:54:58 +0000109}
110
111/* vec_abss */
112
Chris Lattnerdad40622010-04-14 03:54:58 +0000113#define __builtin_altivec_abss_v16qi vec_abss
114#define __builtin_altivec_abss_v8hi vec_abss
115#define __builtin_altivec_abss_v4si vec_abss
116
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000117static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000118vec_abss(vector signed char __a)
Chris Lattnerdad40622010-04-14 03:54:58 +0000119{
Anton Yartsev79d6af32010-09-18 00:39:16 +0000120 return __builtin_altivec_vmaxsb
David Blaikie3302f2b2013-01-16 23:08:36 +0000121 (__a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));
Chris Lattnerdad40622010-04-14 03:54:58 +0000122}
123
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000124static vector signed short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000125vec_abss(vector signed short __a)
Chris Lattnerdad40622010-04-14 03:54:58 +0000126{
Anton Yartsev79d6af32010-09-18 00:39:16 +0000127 return __builtin_altivec_vmaxsh
David Blaikie3302f2b2013-01-16 23:08:36 +0000128 (__a, __builtin_altivec_vsubshs((vector signed short)(0), __a));
Chris Lattnerdad40622010-04-14 03:54:58 +0000129}
130
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000131static vector signed int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000132vec_abss(vector signed int __a)
Chris Lattnerdad40622010-04-14 03:54:58 +0000133{
Anton Yartsev79d6af32010-09-18 00:39:16 +0000134 return __builtin_altivec_vmaxsw
David Blaikie3302f2b2013-01-16 23:08:36 +0000135 (__a, __builtin_altivec_vsubsws((vector signed int)(0), __a));
Chris Lattnerdad40622010-04-14 03:54:58 +0000136}
137
138/* vec_add */
139
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000140static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000141vec_add(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000142{
David Blaikie3302f2b2013-01-16 23:08:36 +0000143 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000144}
145
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000146static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000147vec_add(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000148{
David Blaikie3302f2b2013-01-16 23:08:36 +0000149 return (vector signed char)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000150}
151
152static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000153vec_add(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000154{
David Blaikie3302f2b2013-01-16 23:08:36 +0000155 return __a + (vector signed char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000156}
157
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000158static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000159vec_add(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000160{
David Blaikie3302f2b2013-01-16 23:08:36 +0000161 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000162}
163
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000164static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000165vec_add(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000166{
David Blaikie3302f2b2013-01-16 23:08:36 +0000167 return (vector unsigned char)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000168}
169
170static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000171vec_add(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000172{
David Blaikie3302f2b2013-01-16 23:08:36 +0000173 return __a + (vector unsigned char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000174}
175
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000176static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000177vec_add(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000178{
David Blaikie3302f2b2013-01-16 23:08:36 +0000179 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000180}
181
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000182static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000183vec_add(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000184{
David Blaikie3302f2b2013-01-16 23:08:36 +0000185 return (vector short)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000186}
187
188static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000189vec_add(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000190{
David Blaikie3302f2b2013-01-16 23:08:36 +0000191 return __a + (vector short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000192}
193
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000194static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000195vec_add(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000196{
David Blaikie3302f2b2013-01-16 23:08:36 +0000197 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000198}
199
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000200static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000201vec_add(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000202{
David Blaikie3302f2b2013-01-16 23:08:36 +0000203 return (vector unsigned short)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000204}
205
206static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000207vec_add(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000208{
David Blaikie3302f2b2013-01-16 23:08:36 +0000209 return __a + (vector unsigned short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000210}
211
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000212static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000213vec_add(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000214{
David Blaikie3302f2b2013-01-16 23:08:36 +0000215 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000216}
217
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000218static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000219vec_add(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000220{
David Blaikie3302f2b2013-01-16 23:08:36 +0000221 return (vector int)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000222}
223
224static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000225vec_add(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000226{
David Blaikie3302f2b2013-01-16 23:08:36 +0000227 return __a + (vector int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000228}
229
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000230static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000231vec_add(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000232{
David Blaikie3302f2b2013-01-16 23:08:36 +0000233 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000234}
235
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000236static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000237vec_add(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000238{
David Blaikie3302f2b2013-01-16 23:08:36 +0000239 return (vector unsigned int)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000240}
241
242static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000243vec_add(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000244{
David Blaikie3302f2b2013-01-16 23:08:36 +0000245 return __a + (vector unsigned int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000246}
247
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000248static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000249vec_add(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000250{
David Blaikie3302f2b2013-01-16 23:08:36 +0000251 return __a + __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000252}
253
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000254/* vec_vaddubm */
255
256#define __builtin_altivec_vaddubm vec_vaddubm
257
258static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000259vec_vaddubm(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000260{
David Blaikie3302f2b2013-01-16 23:08:36 +0000261 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000262}
263
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000264static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000265vec_vaddubm(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000266{
David Blaikie3302f2b2013-01-16 23:08:36 +0000267 return (vector signed char)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000268}
269
270static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000271vec_vaddubm(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000272{
David Blaikie3302f2b2013-01-16 23:08:36 +0000273 return __a + (vector signed char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000274}
275
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000276static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000277vec_vaddubm(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000278{
David Blaikie3302f2b2013-01-16 23:08:36 +0000279 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000280}
281
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000282static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000283vec_vaddubm(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000284{
David Blaikie3302f2b2013-01-16 23:08:36 +0000285 return (vector unsigned char)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000286}
287
288static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000289vec_vaddubm(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000290{
David Blaikie3302f2b2013-01-16 23:08:36 +0000291 return __a + (vector unsigned char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000292}
293
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000294/* vec_vadduhm */
295
296#define __builtin_altivec_vadduhm vec_vadduhm
297
298static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000299vec_vadduhm(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000300{
David Blaikie3302f2b2013-01-16 23:08:36 +0000301 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000302}
303
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000304static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000305vec_vadduhm(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000306{
David Blaikie3302f2b2013-01-16 23:08:36 +0000307 return (vector short)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000308}
309
310static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000311vec_vadduhm(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000312{
David Blaikie3302f2b2013-01-16 23:08:36 +0000313 return __a + (vector short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000314}
315
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000316static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000317vec_vadduhm(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000318{
David Blaikie3302f2b2013-01-16 23:08:36 +0000319 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000320}
321
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000322static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000323vec_vadduhm(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000324{
David Blaikie3302f2b2013-01-16 23:08:36 +0000325 return (vector unsigned short)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000326}
327
328static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000329vec_vadduhm(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000330{
David Blaikie3302f2b2013-01-16 23:08:36 +0000331 return __a + (vector unsigned short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000332}
333
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000334/* vec_vadduwm */
335
336#define __builtin_altivec_vadduwm vec_vadduwm
337
338static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000339vec_vadduwm(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000340{
David Blaikie3302f2b2013-01-16 23:08:36 +0000341 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000342}
343
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000344static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000345vec_vadduwm(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000346{
David Blaikie3302f2b2013-01-16 23:08:36 +0000347 return (vector int)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000348}
349
350static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000351vec_vadduwm(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000352{
David Blaikie3302f2b2013-01-16 23:08:36 +0000353 return __a + (vector int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000354}
355
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000356static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000357vec_vadduwm(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000358{
David Blaikie3302f2b2013-01-16 23:08:36 +0000359 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000360}
361
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000362static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000363vec_vadduwm(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000364{
David Blaikie3302f2b2013-01-16 23:08:36 +0000365 return (vector unsigned int)__a + __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000366}
367
368static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000369vec_vadduwm(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000370{
David Blaikie3302f2b2013-01-16 23:08:36 +0000371 return __a + (vector unsigned int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000372}
373
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000374/* vec_vaddfp */
375
376#define __builtin_altivec_vaddfp vec_vaddfp
377
378static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +0000379vec_vaddfp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000380{
David Blaikie3302f2b2013-01-16 23:08:36 +0000381 return __a + __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000382}
383
Chris Lattnerdad40622010-04-14 03:54:58 +0000384/* vec_addc */
385
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000386static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +0000387vec_addc(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000388{
David Blaikie3302f2b2013-01-16 23:08:36 +0000389 return __builtin_altivec_vaddcuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000390}
391
392/* vec_vaddcuw */
393
394static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +0000395vec_vaddcuw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000396{
David Blaikie3302f2b2013-01-16 23:08:36 +0000397 return __builtin_altivec_vaddcuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000398}
Chris Lattnerdad40622010-04-14 03:54:58 +0000399
400/* vec_adds */
401
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000402static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000403vec_adds(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000404{
David Blaikie3302f2b2013-01-16 23:08:36 +0000405 return __builtin_altivec_vaddsbs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000406}
407
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000408static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000409vec_adds(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000410{
David Blaikie3302f2b2013-01-16 23:08:36 +0000411 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000412}
413
414static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000415vec_adds(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000416{
David Blaikie3302f2b2013-01-16 23:08:36 +0000417 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000418}
419
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000420static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000421vec_adds(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000422{
David Blaikie3302f2b2013-01-16 23:08:36 +0000423 return __builtin_altivec_vaddubs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000424}
425
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000426static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000427vec_adds(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000428{
David Blaikie3302f2b2013-01-16 23:08:36 +0000429 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000430}
431
432static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000433vec_adds(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000434{
David Blaikie3302f2b2013-01-16 23:08:36 +0000435 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000436}
437
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000438static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000439vec_adds(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000440{
David Blaikie3302f2b2013-01-16 23:08:36 +0000441 return __builtin_altivec_vaddshs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000442}
443
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000444static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000445vec_adds(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000446{
David Blaikie3302f2b2013-01-16 23:08:36 +0000447 return __builtin_altivec_vaddshs((vector short)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000448}
449
450static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000451vec_adds(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000452{
David Blaikie3302f2b2013-01-16 23:08:36 +0000453 return __builtin_altivec_vaddshs(__a, (vector short)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000454}
455
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000456static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000457vec_adds(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000458{
David Blaikie3302f2b2013-01-16 23:08:36 +0000459 return __builtin_altivec_vadduhs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000460}
461
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000462static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000463vec_adds(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000464{
David Blaikie3302f2b2013-01-16 23:08:36 +0000465 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000466}
467
468static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000469vec_adds(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000470{
David Blaikie3302f2b2013-01-16 23:08:36 +0000471 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000472}
473
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000474static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000475vec_adds(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000476{
David Blaikie3302f2b2013-01-16 23:08:36 +0000477 return __builtin_altivec_vaddsws(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000478}
479
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000480static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000481vec_adds(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000482{
David Blaikie3302f2b2013-01-16 23:08:36 +0000483 return __builtin_altivec_vaddsws((vector int)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000484}
485
486static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000487vec_adds(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000488{
David Blaikie3302f2b2013-01-16 23:08:36 +0000489 return __builtin_altivec_vaddsws(__a, (vector int)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000490}
491
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000492static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000493vec_adds(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000494{
David Blaikie3302f2b2013-01-16 23:08:36 +0000495 return __builtin_altivec_vadduws(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000496}
497
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000498static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000499vec_adds(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000500{
David Blaikie3302f2b2013-01-16 23:08:36 +0000501 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000502}
503
504static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000505vec_adds(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000506{
David Blaikie3302f2b2013-01-16 23:08:36 +0000507 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000508}
509
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000510/* vec_vaddsbs */
Chris Lattnerdad40622010-04-14 03:54:58 +0000511
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000512static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000513vec_vaddsbs(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000514{
David Blaikie3302f2b2013-01-16 23:08:36 +0000515 return __builtin_altivec_vaddsbs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000516}
517
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000518static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000519vec_vaddsbs(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000520{
David Blaikie3302f2b2013-01-16 23:08:36 +0000521 return __builtin_altivec_vaddsbs((vector signed char)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000522}
523
524static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000525vec_vaddsbs(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000526{
David Blaikie3302f2b2013-01-16 23:08:36 +0000527 return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000528}
529
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000530/* vec_vaddubs */
531
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000532static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000533vec_vaddubs(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000534{
David Blaikie3302f2b2013-01-16 23:08:36 +0000535 return __builtin_altivec_vaddubs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000536}
537
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000538static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000539vec_vaddubs(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000540{
David Blaikie3302f2b2013-01-16 23:08:36 +0000541 return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000542}
543
544static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000545vec_vaddubs(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000546{
David Blaikie3302f2b2013-01-16 23:08:36 +0000547 return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000548}
549
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000550/* vec_vaddshs */
551
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000552static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000553vec_vaddshs(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000554{
David Blaikie3302f2b2013-01-16 23:08:36 +0000555 return __builtin_altivec_vaddshs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000556}
557
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000558static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000559vec_vaddshs(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000560{
David Blaikie3302f2b2013-01-16 23:08:36 +0000561 return __builtin_altivec_vaddshs((vector short)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000562}
563
564static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000565vec_vaddshs(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000566{
David Blaikie3302f2b2013-01-16 23:08:36 +0000567 return __builtin_altivec_vaddshs(__a, (vector short)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000568}
569
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000570/* vec_vadduhs */
571
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000572static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000573vec_vadduhs(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000574{
David Blaikie3302f2b2013-01-16 23:08:36 +0000575 return __builtin_altivec_vadduhs(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000576}
577
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000578static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000579vec_vadduhs(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000580{
David Blaikie3302f2b2013-01-16 23:08:36 +0000581 return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000582}
583
584static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000585vec_vadduhs(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000586{
David Blaikie3302f2b2013-01-16 23:08:36 +0000587 return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000588}
589
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000590/* vec_vaddsws */
591
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000592static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000593vec_vaddsws(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000594{
David Blaikie3302f2b2013-01-16 23:08:36 +0000595 return __builtin_altivec_vaddsws(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000596}
597
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000598static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000599vec_vaddsws(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000600{
David Blaikie3302f2b2013-01-16 23:08:36 +0000601 return __builtin_altivec_vaddsws((vector int)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000602}
603
604static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000605vec_vaddsws(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000606{
David Blaikie3302f2b2013-01-16 23:08:36 +0000607 return __builtin_altivec_vaddsws(__a, (vector int)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000608}
609
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000610/* vec_vadduws */
611
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000612static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000613vec_vadduws(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000614{
David Blaikie3302f2b2013-01-16 23:08:36 +0000615 return __builtin_altivec_vadduws(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +0000616}
617
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000618static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000619vec_vadduws(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000620{
David Blaikie3302f2b2013-01-16 23:08:36 +0000621 return __builtin_altivec_vadduws((vector unsigned int)__a, __b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000622}
623
624static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000625vec_vadduws(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000626{
David Blaikie3302f2b2013-01-16 23:08:36 +0000627 return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000628}
629
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000630/* vec_and */
631
632#define __builtin_altivec_vand vec_and
633
634static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000635vec_and(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000636{
David Blaikie3302f2b2013-01-16 23:08:36 +0000637 return __a & __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000638}
639
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000640static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000641vec_and(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000642{
David Blaikie3302f2b2013-01-16 23:08:36 +0000643 return (vector signed char)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000644}
645
646static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000647vec_and(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000648{
David Blaikie3302f2b2013-01-16 23:08:36 +0000649 return __a & (vector signed char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000650}
651
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000652static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000653vec_and(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000654{
David Blaikie3302f2b2013-01-16 23:08:36 +0000655 return __a & __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000656}
657
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000658static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000659vec_and(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000660{
David Blaikie3302f2b2013-01-16 23:08:36 +0000661 return (vector unsigned char)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000662}
663
664static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000665vec_and(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000666{
David Blaikie3302f2b2013-01-16 23:08:36 +0000667 return __a & (vector unsigned char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000668}
669
670static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000671vec_and(vector bool char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000672{
David Blaikie3302f2b2013-01-16 23:08:36 +0000673 return __a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000674}
675
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000676static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000677vec_and(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000678{
David Blaikie3302f2b2013-01-16 23:08:36 +0000679 return __a & __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000680}
681
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000682static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000683vec_and(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000684{
David Blaikie3302f2b2013-01-16 23:08:36 +0000685 return (vector short)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000686}
687
688static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000689vec_and(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000690{
David Blaikie3302f2b2013-01-16 23:08:36 +0000691 return __a & (vector short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000692}
693
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000694static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000695vec_and(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000696{
David Blaikie3302f2b2013-01-16 23:08:36 +0000697 return __a & __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000698}
699
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000700static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000701vec_and(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000702{
David Blaikie3302f2b2013-01-16 23:08:36 +0000703 return (vector unsigned short)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000704}
705
706static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000707vec_and(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000708{
David Blaikie3302f2b2013-01-16 23:08:36 +0000709 return __a & (vector unsigned short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000710}
711
712static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000713vec_and(vector bool short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000714{
David Blaikie3302f2b2013-01-16 23:08:36 +0000715 return __a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000716}
717
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000718static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000719vec_and(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000720{
David Blaikie3302f2b2013-01-16 23:08:36 +0000721 return __a & __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000722}
723
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000724static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000725vec_and(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000726{
David Blaikie3302f2b2013-01-16 23:08:36 +0000727 return (vector int)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000728}
729
730static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000731vec_and(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000732{
David Blaikie3302f2b2013-01-16 23:08:36 +0000733 return __a & (vector int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000734}
735
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000736static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000737vec_and(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000738{
David Blaikie3302f2b2013-01-16 23:08:36 +0000739 return __a & __b;
Chris Lattnerdad40622010-04-14 03:54:58 +0000740}
741
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000742static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000743vec_and(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000744{
David Blaikie3302f2b2013-01-16 23:08:36 +0000745 return (vector unsigned int)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000746}
747
748static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000749vec_and(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000750{
David Blaikie3302f2b2013-01-16 23:08:36 +0000751 return __a & (vector unsigned int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000752}
753
754static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000755vec_and(vector bool int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000756{
David Blaikie3302f2b2013-01-16 23:08:36 +0000757 return __a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000758}
759
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000760static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000761vec_and(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +0000762{
David Blaikie3302f2b2013-01-16 23:08:36 +0000763 vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
764 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000765}
766
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000767static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000768vec_and(vector bool int __a, vector float __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000769{
David Blaikie3302f2b2013-01-16 23:08:36 +0000770 vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
771 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000772}
773
774static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000775vec_and(vector float __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000776{
David Blaikie3302f2b2013-01-16 23:08:36 +0000777 vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
778 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000779}
780
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000781/* vec_vand */
782
783static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000784vec_vand(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000785{
David Blaikie3302f2b2013-01-16 23:08:36 +0000786 return __a & __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000787}
788
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000789static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000790vec_vand(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000791{
David Blaikie3302f2b2013-01-16 23:08:36 +0000792 return (vector signed char)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000793}
794
795static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000796vec_vand(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000797{
David Blaikie3302f2b2013-01-16 23:08:36 +0000798 return __a & (vector signed char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000799}
800
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000801static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000802vec_vand(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000803{
David Blaikie3302f2b2013-01-16 23:08:36 +0000804 return __a & __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000805}
806
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000807static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000808vec_vand(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000809{
David Blaikie3302f2b2013-01-16 23:08:36 +0000810 return (vector unsigned char)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000811}
812
813static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000814vec_vand(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000815{
David Blaikie3302f2b2013-01-16 23:08:36 +0000816 return __a & (vector unsigned char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000817}
818
819static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000820vec_vand(vector bool char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000821{
David Blaikie3302f2b2013-01-16 23:08:36 +0000822 return __a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000823}
824
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000825static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000826vec_vand(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000827{
David Blaikie3302f2b2013-01-16 23:08:36 +0000828 return __a & __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000829}
830
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000831static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000832vec_vand(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000833{
David Blaikie3302f2b2013-01-16 23:08:36 +0000834 return (vector short)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000835}
836
837static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000838vec_vand(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000839{
David Blaikie3302f2b2013-01-16 23:08:36 +0000840 return __a & (vector short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000841}
842
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000843static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000844vec_vand(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000845{
David Blaikie3302f2b2013-01-16 23:08:36 +0000846 return __a & __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000847}
848
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000849static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000850vec_vand(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000851{
David Blaikie3302f2b2013-01-16 23:08:36 +0000852 return (vector unsigned short)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000853}
854
855static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000856vec_vand(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000857{
David Blaikie3302f2b2013-01-16 23:08:36 +0000858 return __a & (vector unsigned short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000859}
860
861static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000862vec_vand(vector bool short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000863{
David Blaikie3302f2b2013-01-16 23:08:36 +0000864 return __a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000865}
866
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000867static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000868vec_vand(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000869{
David Blaikie3302f2b2013-01-16 23:08:36 +0000870 return __a & __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000871}
872
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000873static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000874vec_vand(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000875{
David Blaikie3302f2b2013-01-16 23:08:36 +0000876 return (vector int)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000877}
878
879static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000880vec_vand(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000881{
David Blaikie3302f2b2013-01-16 23:08:36 +0000882 return __a & (vector int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000883}
884
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000885static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000886vec_vand(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000887{
David Blaikie3302f2b2013-01-16 23:08:36 +0000888 return __a & __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000889}
890
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000891static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000892vec_vand(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000893{
David Blaikie3302f2b2013-01-16 23:08:36 +0000894 return (vector unsigned int)__a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000895}
896
897static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000898vec_vand(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000899{
David Blaikie3302f2b2013-01-16 23:08:36 +0000900 return __a & (vector unsigned int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000901}
902
903static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000904vec_vand(vector bool int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000905{
David Blaikie3302f2b2013-01-16 23:08:36 +0000906 return __a & __b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000907}
908
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000909static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000910vec_vand(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000911{
David Blaikie3302f2b2013-01-16 23:08:36 +0000912 vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
913 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000914}
915
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000916static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000917vec_vand(vector bool int __a, vector float __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000918{
David Blaikie3302f2b2013-01-16 23:08:36 +0000919 vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
920 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000921}
922
923static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000924vec_vand(vector float __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000925{
David Blaikie3302f2b2013-01-16 23:08:36 +0000926 vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b;
927 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000928}
929
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000930/* vec_andc */
931
932#define __builtin_altivec_vandc vec_andc
933
934static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000935vec_andc(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000936{
David Blaikie3302f2b2013-01-16 23:08:36 +0000937 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000938}
939
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000940static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000941vec_andc(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000942{
David Blaikie3302f2b2013-01-16 23:08:36 +0000943 return (vector signed char)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000944}
945
946static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000947vec_andc(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000948{
David Blaikie3302f2b2013-01-16 23:08:36 +0000949 return __a & ~(vector signed char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000950}
951
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000952static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000953vec_andc(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000954{
David Blaikie3302f2b2013-01-16 23:08:36 +0000955 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000956}
957
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000958static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000959vec_andc(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000960{
David Blaikie3302f2b2013-01-16 23:08:36 +0000961 return (vector unsigned char)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000962}
963
964static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000965vec_andc(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000966{
David Blaikie3302f2b2013-01-16 23:08:36 +0000967 return __a & ~(vector unsigned char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000968}
969
970static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000971vec_andc(vector bool char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000972{
David Blaikie3302f2b2013-01-16 23:08:36 +0000973 return __a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000974}
975
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000976static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000977vec_andc(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000978{
David Blaikie3302f2b2013-01-16 23:08:36 +0000979 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000980}
981
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000982static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000983vec_andc(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000984{
David Blaikie3302f2b2013-01-16 23:08:36 +0000985 return (vector short)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000986}
987
988static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000989vec_andc(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000990{
David Blaikie3302f2b2013-01-16 23:08:36 +0000991 return __a & ~(vector short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +0000992}
993
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000994static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +0000995vec_andc(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000996{
David Blaikie3302f2b2013-01-16 23:08:36 +0000997 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +0000998}
999
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001000static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001001vec_andc(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001002{
David Blaikie3302f2b2013-01-16 23:08:36 +00001003 return (vector unsigned short)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001004}
1005
1006static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001007vec_andc(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001008{
David Blaikie3302f2b2013-01-16 23:08:36 +00001009 return __a & ~(vector unsigned short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001010}
1011
1012static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001013vec_andc(vector bool short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001014{
David Blaikie3302f2b2013-01-16 23:08:36 +00001015 return __a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001016}
1017
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001018static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001019vec_andc(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001020{
David Blaikie3302f2b2013-01-16 23:08:36 +00001021 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001022}
1023
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001024static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001025vec_andc(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001026{
David Blaikie3302f2b2013-01-16 23:08:36 +00001027 return (vector int)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001028}
1029
1030static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001031vec_andc(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001032{
David Blaikie3302f2b2013-01-16 23:08:36 +00001033 return __a & ~(vector int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001034}
1035
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001036static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001037vec_andc(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001038{
David Blaikie3302f2b2013-01-16 23:08:36 +00001039 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001040}
1041
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001042static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001043vec_andc(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001044{
David Blaikie3302f2b2013-01-16 23:08:36 +00001045 return (vector unsigned int)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001046}
1047
1048static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001049vec_andc(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001050{
David Blaikie3302f2b2013-01-16 23:08:36 +00001051 return __a & ~(vector unsigned int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001052}
1053
1054static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001055vec_andc(vector bool int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001056{
David Blaikie3302f2b2013-01-16 23:08:36 +00001057 return __a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001058}
1059
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001060static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001061vec_andc(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001062{
David Blaikie3302f2b2013-01-16 23:08:36 +00001063 vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1064 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001065}
1066
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001067static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001068vec_andc(vector bool int __a, vector float __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001069{
David Blaikie3302f2b2013-01-16 23:08:36 +00001070 vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1071 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001072}
1073
1074static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001075vec_andc(vector float __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001076{
David Blaikie3302f2b2013-01-16 23:08:36 +00001077 vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1078 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001079}
1080
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001081/* vec_vandc */
1082
1083static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001084vec_vandc(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001085{
David Blaikie3302f2b2013-01-16 23:08:36 +00001086 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001087}
1088
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001089static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001090vec_vandc(vector bool char __a, vector signed char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001091{
David Blaikie3302f2b2013-01-16 23:08:36 +00001092 return (vector signed char)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001093}
1094
1095static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001096vec_vandc(vector signed char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001097{
David Blaikie3302f2b2013-01-16 23:08:36 +00001098 return __a & ~(vector signed char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001099}
1100
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001101static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001102vec_vandc(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001103{
David Blaikie3302f2b2013-01-16 23:08:36 +00001104 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001105}
1106
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001107static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001108vec_vandc(vector bool char __a, vector unsigned char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001109{
David Blaikie3302f2b2013-01-16 23:08:36 +00001110 return (vector unsigned char)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001111}
1112
1113static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001114vec_vandc(vector unsigned char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001115{
David Blaikie3302f2b2013-01-16 23:08:36 +00001116 return __a & ~(vector unsigned char)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001117}
1118
1119static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001120vec_vandc(vector bool char __a, vector bool char __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001121{
David Blaikie3302f2b2013-01-16 23:08:36 +00001122 return __a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001123}
1124
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001125static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001126vec_vandc(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001127{
David Blaikie3302f2b2013-01-16 23:08:36 +00001128 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001129}
1130
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001131static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001132vec_vandc(vector bool short __a, vector short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001133{
David Blaikie3302f2b2013-01-16 23:08:36 +00001134 return (vector short)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001135}
1136
1137static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001138vec_vandc(vector short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001139{
David Blaikie3302f2b2013-01-16 23:08:36 +00001140 return __a & ~(vector short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001141}
1142
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001143static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001144vec_vandc(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001145{
David Blaikie3302f2b2013-01-16 23:08:36 +00001146 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001147}
1148
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001149static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001150vec_vandc(vector bool short __a, vector unsigned short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001151{
David Blaikie3302f2b2013-01-16 23:08:36 +00001152 return (vector unsigned short)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001153}
1154
1155static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001156vec_vandc(vector unsigned short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001157{
David Blaikie3302f2b2013-01-16 23:08:36 +00001158 return __a & ~(vector unsigned short)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001159}
1160
1161static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001162vec_vandc(vector bool short __a, vector bool short __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001163{
David Blaikie3302f2b2013-01-16 23:08:36 +00001164 return __a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001165}
1166
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001167static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001168vec_vandc(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001169{
David Blaikie3302f2b2013-01-16 23:08:36 +00001170 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001171}
1172
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001173static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001174vec_vandc(vector bool int __a, vector int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001175{
David Blaikie3302f2b2013-01-16 23:08:36 +00001176 return (vector int)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001177}
1178
1179static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001180vec_vandc(vector int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001181{
David Blaikie3302f2b2013-01-16 23:08:36 +00001182 return __a & ~(vector int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001183}
1184
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001185static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001186vec_vandc(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001187{
David Blaikie3302f2b2013-01-16 23:08:36 +00001188 return __a & ~__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001189}
1190
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001191static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001192vec_vandc(vector bool int __a, vector unsigned int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001193{
David Blaikie3302f2b2013-01-16 23:08:36 +00001194 return (vector unsigned int)__a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001195}
1196
1197static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001198vec_vandc(vector unsigned int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001199{
David Blaikie3302f2b2013-01-16 23:08:36 +00001200 return __a & ~(vector unsigned int)__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001201}
1202
1203static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001204vec_vandc(vector bool int __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001205{
David Blaikie3302f2b2013-01-16 23:08:36 +00001206 return __a & ~__b;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001207}
1208
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001209static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001210vec_vandc(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001211{
David Blaikie3302f2b2013-01-16 23:08:36 +00001212 vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1213 return (vector float)__res;
Chris Lattnerdad40622010-04-14 03:54:58 +00001214}
1215
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001216static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001217vec_vandc(vector bool int __a, vector float __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001218{
David Blaikie3302f2b2013-01-16 23:08:36 +00001219 vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1220 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001221}
1222
1223static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001224vec_vandc(vector float __a, vector bool int __b)
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001225{
David Blaikie3302f2b2013-01-16 23:08:36 +00001226 vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b;
1227 return (vector float)__res;
Anton Yartsev2cc136d2010-08-16 16:22:12 +00001228}
1229
Chris Lattnerdad40622010-04-14 03:54:58 +00001230/* vec_avg */
1231
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001232static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001233vec_avg(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001234{
David Blaikie3302f2b2013-01-16 23:08:36 +00001235 return __builtin_altivec_vavgsb(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001236}
1237
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001238static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001239vec_avg(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001240{
David Blaikie3302f2b2013-01-16 23:08:36 +00001241 return __builtin_altivec_vavgub(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001242}
1243
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001244static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001245vec_avg(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001246{
David Blaikie3302f2b2013-01-16 23:08:36 +00001247 return __builtin_altivec_vavgsh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001248}
1249
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001250static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001251vec_avg(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001252{
David Blaikie3302f2b2013-01-16 23:08:36 +00001253 return __builtin_altivec_vavguh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001254}
1255
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001256static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001257vec_avg(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001258{
David Blaikie3302f2b2013-01-16 23:08:36 +00001259 return __builtin_altivec_vavgsw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001260}
1261
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001262static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001263vec_avg(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001264{
David Blaikie3302f2b2013-01-16 23:08:36 +00001265 return __builtin_altivec_vavguw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001266}
1267
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001268/* vec_vavgsb */
Chris Lattnerdad40622010-04-14 03:54:58 +00001269
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001270static vector signed char __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001271vec_vavgsb(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001272{
David Blaikie3302f2b2013-01-16 23:08:36 +00001273 return __builtin_altivec_vavgsb(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001274}
1275
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001276/* vec_vavgub */
1277
1278static vector unsigned char __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001279vec_vavgub(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001280{
David Blaikie3302f2b2013-01-16 23:08:36 +00001281 return __builtin_altivec_vavgub(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001282}
1283
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001284/* vec_vavgsh */
1285
1286static vector short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001287vec_vavgsh(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001288{
David Blaikie3302f2b2013-01-16 23:08:36 +00001289 return __builtin_altivec_vavgsh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001290}
1291
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001292/* vec_vavguh */
1293
1294static vector unsigned short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001295vec_vavguh(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001296{
David Blaikie3302f2b2013-01-16 23:08:36 +00001297 return __builtin_altivec_vavguh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001298}
1299
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001300/* vec_vavgsw */
1301
1302static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001303vec_vavgsw(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001304{
David Blaikie3302f2b2013-01-16 23:08:36 +00001305 return __builtin_altivec_vavgsw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001306}
1307
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001308/* vec_vavguw */
1309
1310static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001311vec_vavguw(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001312{
David Blaikie3302f2b2013-01-16 23:08:36 +00001313 return __builtin_altivec_vavguw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001314}
1315
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001316/* vec_ceil */
1317
1318static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001319vec_ceil(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +00001320{
David Blaikie3302f2b2013-01-16 23:08:36 +00001321 return __builtin_altivec_vrfip(__a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001322}
1323
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001324/* vec_vrfip */
Chris Lattnerdad40622010-04-14 03:54:58 +00001325
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001326static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001327vec_vrfip(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +00001328{
David Blaikie3302f2b2013-01-16 23:08:36 +00001329 return __builtin_altivec_vrfip(__a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001330}
1331
1332/* vec_cmpb */
1333
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001334static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001335vec_cmpb(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001336{
David Blaikie3302f2b2013-01-16 23:08:36 +00001337 return __builtin_altivec_vcmpbfp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001338}
1339
1340/* vec_vcmpbfp */
1341
1342static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001343vec_vcmpbfp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001344{
David Blaikie3302f2b2013-01-16 23:08:36 +00001345 return __builtin_altivec_vcmpbfp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001346}
Chris Lattnerdad40622010-04-14 03:54:58 +00001347
1348/* vec_cmpeq */
1349
Anton Yartsevfc83c602010-08-19 03:21:36 +00001350static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001351vec_cmpeq(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001352{
Anton Yartsevfc83c602010-08-19 03:21:36 +00001353 return (vector bool char)
David Blaikie3302f2b2013-01-16 23:08:36 +00001354 __builtin_altivec_vcmpequb((vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001355}
1356
Anton Yartsevfc83c602010-08-19 03:21:36 +00001357static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001358vec_cmpeq(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001359{
Anton Yartsevfc83c602010-08-19 03:21:36 +00001360 return (vector bool char)
David Blaikie3302f2b2013-01-16 23:08:36 +00001361 __builtin_altivec_vcmpequb((vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001362}
1363
Anton Yartsevfc83c602010-08-19 03:21:36 +00001364static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001365vec_cmpeq(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001366{
David Blaikie3302f2b2013-01-16 23:08:36 +00001367 return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001368}
1369
Anton Yartsevfc83c602010-08-19 03:21:36 +00001370static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001371vec_cmpeq(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001372{
Anton Yartsevfc83c602010-08-19 03:21:36 +00001373 return (vector bool short)
David Blaikie3302f2b2013-01-16 23:08:36 +00001374 __builtin_altivec_vcmpequh((vector short)__a, (vector short)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001375}
1376
Anton Yartsevfc83c602010-08-19 03:21:36 +00001377static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001378vec_cmpeq(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001379{
David Blaikie3302f2b2013-01-16 23:08:36 +00001380 return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001381}
1382
Anton Yartsevfc83c602010-08-19 03:21:36 +00001383static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001384vec_cmpeq(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001385{
Anton Yartsevfc83c602010-08-19 03:21:36 +00001386 return (vector bool int)
David Blaikie3302f2b2013-01-16 23:08:36 +00001387 __builtin_altivec_vcmpequw((vector int)__a, (vector int)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001388}
1389
Anton Yartsevfc83c602010-08-19 03:21:36 +00001390static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001391vec_cmpeq(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001392{
David Blaikie3302f2b2013-01-16 23:08:36 +00001393 return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001394}
1395
1396/* vec_cmpge */
1397
Anton Yartsevfc83c602010-08-19 03:21:36 +00001398static vector bool int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001399vec_cmpge(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001400{
David Blaikie3302f2b2013-01-16 23:08:36 +00001401 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001402}
1403
1404/* vec_vcmpgefp */
1405
Anton Yartsevfc83c602010-08-19 03:21:36 +00001406static vector bool int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001407vec_vcmpgefp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001408{
David Blaikie3302f2b2013-01-16 23:08:36 +00001409 return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001410}
Chris Lattnerdad40622010-04-14 03:54:58 +00001411
1412/* vec_cmpgt */
1413
Anton Yartsevfc83c602010-08-19 03:21:36 +00001414static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001415vec_cmpgt(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001416{
David Blaikie3302f2b2013-01-16 23:08:36 +00001417 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001418}
1419
Anton Yartsevfc83c602010-08-19 03:21:36 +00001420static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001421vec_cmpgt(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001422{
David Blaikie3302f2b2013-01-16 23:08:36 +00001423 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001424}
1425
Anton Yartsevfc83c602010-08-19 03:21:36 +00001426static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001427vec_cmpgt(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001428{
David Blaikie3302f2b2013-01-16 23:08:36 +00001429 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001430}
1431
Anton Yartsevfc83c602010-08-19 03:21:36 +00001432static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001433vec_cmpgt(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001434{
David Blaikie3302f2b2013-01-16 23:08:36 +00001435 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001436}
1437
Anton Yartsevfc83c602010-08-19 03:21:36 +00001438static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001439vec_cmpgt(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001440{
David Blaikie3302f2b2013-01-16 23:08:36 +00001441 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001442}
1443
Anton Yartsevfc83c602010-08-19 03:21:36 +00001444static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001445vec_cmpgt(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001446{
David Blaikie3302f2b2013-01-16 23:08:36 +00001447 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001448}
1449
Anton Yartsevfc83c602010-08-19 03:21:36 +00001450static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001451vec_cmpgt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001452{
David Blaikie3302f2b2013-01-16 23:08:36 +00001453 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00001454}
1455
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001456/* vec_vcmpgtsb */
Chris Lattnerdad40622010-04-14 03:54:58 +00001457
Anton Yartsevfc83c602010-08-19 03:21:36 +00001458static vector bool char __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001459vec_vcmpgtsb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001460{
David Blaikie3302f2b2013-01-16 23:08:36 +00001461 return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001462}
1463
1464/* vec_vcmpgtub */
1465
Anton Yartsevfc83c602010-08-19 03:21:36 +00001466static vector bool char __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001467vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001468{
David Blaikie3302f2b2013-01-16 23:08:36 +00001469 return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001470}
1471
1472/* vec_vcmpgtsh */
1473
Anton Yartsevfc83c602010-08-19 03:21:36 +00001474static vector bool short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001475vec_vcmpgtsh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001476{
David Blaikie3302f2b2013-01-16 23:08:36 +00001477 return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001478}
1479
1480/* vec_vcmpgtuh */
1481
Anton Yartsevfc83c602010-08-19 03:21:36 +00001482static vector bool short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001483vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001484{
David Blaikie3302f2b2013-01-16 23:08:36 +00001485 return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001486}
1487
1488/* vec_vcmpgtsw */
1489
Anton Yartsevfc83c602010-08-19 03:21:36 +00001490static vector bool int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001491vec_vcmpgtsw(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001492{
David Blaikie3302f2b2013-01-16 23:08:36 +00001493 return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001494}
1495
1496/* vec_vcmpgtuw */
1497
Anton Yartsevfc83c602010-08-19 03:21:36 +00001498static vector bool int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001499vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001500{
David Blaikie3302f2b2013-01-16 23:08:36 +00001501 return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001502}
1503
1504/* vec_vcmpgtfp */
1505
Anton Yartsevfc83c602010-08-19 03:21:36 +00001506static vector bool int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001507vec_vcmpgtfp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001508{
David Blaikie3302f2b2013-01-16 23:08:36 +00001509 return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001510}
1511
1512/* vec_cmple */
Chris Lattnerdad40622010-04-14 03:54:58 +00001513
Anton Yartsevfc83c602010-08-19 03:21:36 +00001514static vector bool int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001515vec_cmple(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001516{
David Blaikie3302f2b2013-01-16 23:08:36 +00001517 return (vector bool int)__builtin_altivec_vcmpgefp(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001518}
1519
1520/* vec_cmplt */
1521
Anton Yartsevfc83c602010-08-19 03:21:36 +00001522static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001523vec_cmplt(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001524{
David Blaikie3302f2b2013-01-16 23:08:36 +00001525 return (vector bool char)__builtin_altivec_vcmpgtsb(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001526}
1527
Anton Yartsevfc83c602010-08-19 03:21:36 +00001528static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001529vec_cmplt(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001530{
David Blaikie3302f2b2013-01-16 23:08:36 +00001531 return (vector bool char)__builtin_altivec_vcmpgtub(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001532}
1533
Anton Yartsevfc83c602010-08-19 03:21:36 +00001534static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001535vec_cmplt(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001536{
David Blaikie3302f2b2013-01-16 23:08:36 +00001537 return (vector bool short)__builtin_altivec_vcmpgtsh(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001538}
1539
Anton Yartsevfc83c602010-08-19 03:21:36 +00001540static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001541vec_cmplt(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001542{
David Blaikie3302f2b2013-01-16 23:08:36 +00001543 return (vector bool short)__builtin_altivec_vcmpgtuh(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001544}
1545
Anton Yartsevfc83c602010-08-19 03:21:36 +00001546static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001547vec_cmplt(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001548{
David Blaikie3302f2b2013-01-16 23:08:36 +00001549 return (vector bool int)__builtin_altivec_vcmpgtsw(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001550}
1551
Anton Yartsevfc83c602010-08-19 03:21:36 +00001552static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001553vec_cmplt(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001554{
David Blaikie3302f2b2013-01-16 23:08:36 +00001555 return (vector bool int)__builtin_altivec_vcmpgtuw(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001556}
1557
Anton Yartsevfc83c602010-08-19 03:21:36 +00001558static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001559vec_cmplt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00001560{
David Blaikie3302f2b2013-01-16 23:08:36 +00001561 return (vector bool int)__builtin_altivec_vcmpgtfp(__b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +00001562}
1563
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001564/* vec_ctf */
1565
1566static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001567vec_ctf(vector int __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001568{
David Blaikie3302f2b2013-01-16 23:08:36 +00001569 return __builtin_altivec_vcfsx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001570}
1571
1572static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001573vec_ctf(vector unsigned int __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001574{
David Blaikie3302f2b2013-01-16 23:08:36 +00001575 return __builtin_altivec_vcfux((vector int)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001576}
1577
1578/* vec_vcfsx */
1579
1580static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001581vec_vcfsx(vector int __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001582{
David Blaikie3302f2b2013-01-16 23:08:36 +00001583 return __builtin_altivec_vcfsx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001584}
1585
1586/* vec_vcfux */
1587
1588static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001589vec_vcfux(vector unsigned int __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001590{
David Blaikie3302f2b2013-01-16 23:08:36 +00001591 return __builtin_altivec_vcfux((vector int)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001592}
1593
1594/* vec_cts */
1595
1596static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001597vec_cts(vector float __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001598{
David Blaikie3302f2b2013-01-16 23:08:36 +00001599 return __builtin_altivec_vctsxs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001600}
1601
1602/* vec_vctsxs */
1603
1604static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001605vec_vctsxs(vector float __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001606{
David Blaikie3302f2b2013-01-16 23:08:36 +00001607 return __builtin_altivec_vctsxs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001608}
1609
1610/* vec_ctu */
1611
1612static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001613vec_ctu(vector float __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001614{
David Blaikie3302f2b2013-01-16 23:08:36 +00001615 return __builtin_altivec_vctuxs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001616}
1617
1618/* vec_vctuxs */
1619
1620static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001621vec_vctuxs(vector float __a, int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001622{
David Blaikie3302f2b2013-01-16 23:08:36 +00001623 return __builtin_altivec_vctuxs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001624}
1625
1626/* vec_dss */
1627
1628static void __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001629vec_dss(int __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001630{
David Blaikie3302f2b2013-01-16 23:08:36 +00001631 __builtin_altivec_dss(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001632}
1633
1634/* vec_dssall */
1635
1636static void __attribute__((__always_inline__))
1637vec_dssall(void)
1638{
1639 __builtin_altivec_dssall();
1640}
1641
1642/* vec_dst */
1643
1644static void __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001645vec_dst(const void *__a, int __b, int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001646{
David Blaikie3302f2b2013-01-16 23:08:36 +00001647 __builtin_altivec_dst(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001648}
1649
1650/* vec_dstst */
1651
1652static void __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001653vec_dstst(const void *__a, int __b, int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001654{
David Blaikie3302f2b2013-01-16 23:08:36 +00001655 __builtin_altivec_dstst(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001656}
1657
1658/* vec_dststt */
1659
1660static void __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001661vec_dststt(const void *__a, int __b, int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001662{
David Blaikie3302f2b2013-01-16 23:08:36 +00001663 __builtin_altivec_dststt(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001664}
1665
1666/* vec_dstt */
1667
1668static void __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001669vec_dstt(const void *__a, int __b, int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001670{
David Blaikie3302f2b2013-01-16 23:08:36 +00001671 __builtin_altivec_dstt(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001672}
1673
1674/* vec_expte */
1675
1676static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001677vec_expte(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001678{
David Blaikie3302f2b2013-01-16 23:08:36 +00001679 return __builtin_altivec_vexptefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001680}
1681
1682/* vec_vexptefp */
1683
1684static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001685vec_vexptefp(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001686{
David Blaikie3302f2b2013-01-16 23:08:36 +00001687 return __builtin_altivec_vexptefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001688}
1689
1690/* vec_floor */
1691
1692static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001693vec_floor(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001694{
David Blaikie3302f2b2013-01-16 23:08:36 +00001695 return __builtin_altivec_vrfim(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001696}
1697
1698/* vec_vrfim */
1699
1700static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00001701vec_vrfim(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001702{
David Blaikie3302f2b2013-01-16 23:08:36 +00001703 return __builtin_altivec_vrfim(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001704}
1705
1706/* vec_ld */
1707
1708static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001709vec_ld(int __a, const vector signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001710{
David Blaikie3302f2b2013-01-16 23:08:36 +00001711 return (vector signed char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001712}
1713
1714static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001715vec_ld(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001716{
David Blaikie3302f2b2013-01-16 23:08:36 +00001717 return (vector signed char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001718}
1719
1720static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001721vec_ld(int __a, const vector unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001722{
David Blaikie3302f2b2013-01-16 23:08:36 +00001723 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001724}
1725
1726static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001727vec_ld(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001728{
David Blaikie3302f2b2013-01-16 23:08:36 +00001729 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001730}
1731
Anton Yartsevfc83c602010-08-19 03:21:36 +00001732static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001733vec_ld(int __a, const vector bool char *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001734{
David Blaikie3302f2b2013-01-16 23:08:36 +00001735 return (vector bool char)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001736}
1737
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001738static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001739vec_ld(int __a, const vector short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001740{
David Blaikie3302f2b2013-01-16 23:08:36 +00001741 return (vector short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001742}
1743
1744static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001745vec_ld(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001746{
David Blaikie3302f2b2013-01-16 23:08:36 +00001747 return (vector short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001748}
1749
1750static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001751vec_ld(int __a, const vector unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001752{
David Blaikie3302f2b2013-01-16 23:08:36 +00001753 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001754}
1755
1756static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001757vec_ld(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001758{
David Blaikie3302f2b2013-01-16 23:08:36 +00001759 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001760}
1761
Anton Yartsevfc83c602010-08-19 03:21:36 +00001762static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001763vec_ld(int __a, const vector bool short *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001764{
David Blaikie3302f2b2013-01-16 23:08:36 +00001765 return (vector bool short)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001766}
1767
1768static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001769vec_ld(int __a, const vector pixel *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001770{
David Blaikie3302f2b2013-01-16 23:08:36 +00001771 return (vector pixel)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001772}
1773
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001774static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001775vec_ld(int __a, const vector int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001776{
David Blaikie3302f2b2013-01-16 23:08:36 +00001777 return (vector int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001778}
1779
1780static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001781vec_ld(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001782{
David Blaikie3302f2b2013-01-16 23:08:36 +00001783 return (vector int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001784}
1785
1786static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001787vec_ld(int __a, const vector unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001788{
David Blaikie3302f2b2013-01-16 23:08:36 +00001789 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001790}
1791
1792static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001793vec_ld(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001794{
David Blaikie3302f2b2013-01-16 23:08:36 +00001795 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001796}
1797
Anton Yartsevfc83c602010-08-19 03:21:36 +00001798static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001799vec_ld(int __a, const vector bool int *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001800{
David Blaikie3302f2b2013-01-16 23:08:36 +00001801 return (vector bool int)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001802}
1803
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001804static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001805vec_ld(int __a, const vector float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001806{
David Blaikie3302f2b2013-01-16 23:08:36 +00001807 return (vector float)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001808}
1809
1810static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001811vec_ld(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001812{
David Blaikie3302f2b2013-01-16 23:08:36 +00001813 return (vector float)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001814}
1815
1816/* vec_lvx */
1817
1818static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001819vec_lvx(int __a, const vector signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001820{
David Blaikie3302f2b2013-01-16 23:08:36 +00001821 return (vector signed char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001822}
1823
1824static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001825vec_lvx(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001826{
David Blaikie3302f2b2013-01-16 23:08:36 +00001827 return (vector signed char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001828}
1829
1830static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001831vec_lvx(int __a, const vector unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001832{
David Blaikie3302f2b2013-01-16 23:08:36 +00001833 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001834}
1835
1836static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001837vec_lvx(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001838{
David Blaikie3302f2b2013-01-16 23:08:36 +00001839 return (vector unsigned char)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001840}
1841
Anton Yartsevfc83c602010-08-19 03:21:36 +00001842static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001843vec_lvx(int __a, const vector bool char *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001844{
David Blaikie3302f2b2013-01-16 23:08:36 +00001845 return (vector bool char)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001846}
1847
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001848static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001849vec_lvx(int __a, const vector short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001850{
David Blaikie3302f2b2013-01-16 23:08:36 +00001851 return (vector short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001852}
1853
1854static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001855vec_lvx(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001856{
David Blaikie3302f2b2013-01-16 23:08:36 +00001857 return (vector short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001858}
1859
1860static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001861vec_lvx(int __a, const vector unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001862{
David Blaikie3302f2b2013-01-16 23:08:36 +00001863 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001864}
1865
1866static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001867vec_lvx(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001868{
David Blaikie3302f2b2013-01-16 23:08:36 +00001869 return (vector unsigned short)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001870}
1871
Anton Yartsevfc83c602010-08-19 03:21:36 +00001872static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001873vec_lvx(int __a, const vector bool short *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001874{
David Blaikie3302f2b2013-01-16 23:08:36 +00001875 return (vector bool short)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001876}
1877
1878static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001879vec_lvx(int __a, const vector pixel *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001880{
David Blaikie3302f2b2013-01-16 23:08:36 +00001881 return (vector pixel)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001882}
1883
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001884static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001885vec_lvx(int __a, const vector int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001886{
David Blaikie3302f2b2013-01-16 23:08:36 +00001887 return (vector int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001888}
1889
1890static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001891vec_lvx(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001892{
David Blaikie3302f2b2013-01-16 23:08:36 +00001893 return (vector int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001894}
1895
1896static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001897vec_lvx(int __a, const vector unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001898{
David Blaikie3302f2b2013-01-16 23:08:36 +00001899 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001900}
1901
1902static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001903vec_lvx(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001904{
David Blaikie3302f2b2013-01-16 23:08:36 +00001905 return (vector unsigned int)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001906}
1907
Anton Yartsevfc83c602010-08-19 03:21:36 +00001908static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001909vec_lvx(int __a, const vector bool int *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00001910{
David Blaikie3302f2b2013-01-16 23:08:36 +00001911 return (vector bool int)__builtin_altivec_lvx(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00001912}
1913
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001914static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001915vec_lvx(int __a, const vector float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001916{
David Blaikie3302f2b2013-01-16 23:08:36 +00001917 return (vector float)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001918}
1919
1920static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00001921vec_lvx(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001922{
David Blaikie3302f2b2013-01-16 23:08:36 +00001923 return (vector float)__builtin_altivec_lvx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001924}
1925
1926/* vec_lde */
1927
1928static vector signed char __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001929vec_lde(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001930{
David Blaikie3302f2b2013-01-16 23:08:36 +00001931 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001932}
1933
1934static vector unsigned char __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001935vec_lde(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001936{
David Blaikie3302f2b2013-01-16 23:08:36 +00001937 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001938}
1939
1940static vector short __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001941vec_lde(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001942{
David Blaikie3302f2b2013-01-16 23:08:36 +00001943 return (vector short)__builtin_altivec_lvehx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001944}
1945
1946static vector unsigned short __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001947vec_lde(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001948{
David Blaikie3302f2b2013-01-16 23:08:36 +00001949 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001950}
1951
1952static vector int __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001953vec_lde(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001954{
David Blaikie3302f2b2013-01-16 23:08:36 +00001955 return (vector int)__builtin_altivec_lvewx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001956}
1957
1958static vector unsigned int __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001959vec_lde(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001960{
David Blaikie3302f2b2013-01-16 23:08:36 +00001961 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001962}
1963
1964static vector float __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001965vec_lde(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001966{
David Blaikie3302f2b2013-01-16 23:08:36 +00001967 return (vector float)__builtin_altivec_lvewx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001968}
1969
1970/* vec_lvebx */
1971
1972static vector signed char __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001973vec_lvebx(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001974{
David Blaikie3302f2b2013-01-16 23:08:36 +00001975 return (vector signed char)__builtin_altivec_lvebx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001976}
1977
1978static vector unsigned char __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001979vec_lvebx(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001980{
David Blaikie3302f2b2013-01-16 23:08:36 +00001981 return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001982}
1983
1984/* vec_lvehx */
1985
1986static vector short __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001987vec_lvehx(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001988{
David Blaikie3302f2b2013-01-16 23:08:36 +00001989 return (vector short)__builtin_altivec_lvehx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001990}
1991
1992static vector unsigned short __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00001993vec_lvehx(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001994{
David Blaikie3302f2b2013-01-16 23:08:36 +00001995 return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00001996}
1997
1998/* vec_lvewx */
1999
2000static vector int __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00002001vec_lvewx(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002002{
David Blaikie3302f2b2013-01-16 23:08:36 +00002003 return (vector int)__builtin_altivec_lvewx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002004}
2005
2006static vector unsigned int __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00002007vec_lvewx(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002008{
David Blaikie3302f2b2013-01-16 23:08:36 +00002009 return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002010}
2011
2012static vector float __ATTRS_o_ai
Anton Yartseva3c9ba32013-03-10 16:25:43 +00002013vec_lvewx(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002014{
David Blaikie3302f2b2013-01-16 23:08:36 +00002015 return (vector float)__builtin_altivec_lvewx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002016}
2017
2018/* vec_ldl */
2019
2020static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002021vec_ldl(int __a, const vector signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002022{
David Blaikie3302f2b2013-01-16 23:08:36 +00002023 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002024}
2025
2026static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002027vec_ldl(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002028{
David Blaikie3302f2b2013-01-16 23:08:36 +00002029 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002030}
2031
2032static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002033vec_ldl(int __a, const vector unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002034{
David Blaikie3302f2b2013-01-16 23:08:36 +00002035 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002036}
2037
2038static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002039vec_ldl(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002040{
David Blaikie3302f2b2013-01-16 23:08:36 +00002041 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002042}
2043
Anton Yartsevfc83c602010-08-19 03:21:36 +00002044static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002045vec_ldl(int __a, const vector bool char *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002046{
David Blaikie3302f2b2013-01-16 23:08:36 +00002047 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002048}
2049
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002050static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002051vec_ldl(int __a, const vector short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002052{
David Blaikie3302f2b2013-01-16 23:08:36 +00002053 return (vector short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002054}
2055
2056static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002057vec_ldl(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002058{
David Blaikie3302f2b2013-01-16 23:08:36 +00002059 return (vector short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002060}
2061
2062static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002063vec_ldl(int __a, const vector unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002064{
David Blaikie3302f2b2013-01-16 23:08:36 +00002065 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002066}
2067
2068static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002069vec_ldl(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002070{
David Blaikie3302f2b2013-01-16 23:08:36 +00002071 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002072}
2073
Anton Yartsevfc83c602010-08-19 03:21:36 +00002074static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002075vec_ldl(int __a, const vector bool short *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002076{
David Blaikie3302f2b2013-01-16 23:08:36 +00002077 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002078}
2079
2080static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002081vec_ldl(int __a, const vector pixel *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002082{
David Blaikie3302f2b2013-01-16 23:08:36 +00002083 return (vector pixel short)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002084}
2085
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002086static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002087vec_ldl(int __a, const vector int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002088{
David Blaikie3302f2b2013-01-16 23:08:36 +00002089 return (vector int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002090}
2091
2092static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002093vec_ldl(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002094{
David Blaikie3302f2b2013-01-16 23:08:36 +00002095 return (vector int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002096}
2097
2098static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002099vec_ldl(int __a, const vector unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002100{
David Blaikie3302f2b2013-01-16 23:08:36 +00002101 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002102}
2103
2104static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002105vec_ldl(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002106{
David Blaikie3302f2b2013-01-16 23:08:36 +00002107 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002108}
2109
Anton Yartsevfc83c602010-08-19 03:21:36 +00002110static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002111vec_ldl(int __a, const vector bool int *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002112{
David Blaikie3302f2b2013-01-16 23:08:36 +00002113 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002114}
2115
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002116static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002117vec_ldl(int __a, const vector float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002118{
David Blaikie3302f2b2013-01-16 23:08:36 +00002119 return (vector float)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002120}
2121
2122static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002123vec_ldl(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002124{
David Blaikie3302f2b2013-01-16 23:08:36 +00002125 return (vector float)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002126}
2127
2128/* vec_lvxl */
2129
2130static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002131vec_lvxl(int __a, const vector signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002132{
David Blaikie3302f2b2013-01-16 23:08:36 +00002133 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002134}
2135
2136static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002137vec_lvxl(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002138{
David Blaikie3302f2b2013-01-16 23:08:36 +00002139 return (vector signed char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002140}
2141
2142static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002143vec_lvxl(int __a, const vector unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002144{
David Blaikie3302f2b2013-01-16 23:08:36 +00002145 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002146}
2147
2148static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002149vec_lvxl(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002150{
David Blaikie3302f2b2013-01-16 23:08:36 +00002151 return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002152}
2153
Anton Yartsevfc83c602010-08-19 03:21:36 +00002154static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002155vec_lvxl(int __a, const vector bool char *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002156{
David Blaikie3302f2b2013-01-16 23:08:36 +00002157 return (vector bool char)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002158}
2159
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002160static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002161vec_lvxl(int __a, const vector short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002162{
David Blaikie3302f2b2013-01-16 23:08:36 +00002163 return (vector short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002164}
2165
2166static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002167vec_lvxl(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002168{
David Blaikie3302f2b2013-01-16 23:08:36 +00002169 return (vector short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002170}
2171
2172static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002173vec_lvxl(int __a, const vector unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002174{
David Blaikie3302f2b2013-01-16 23:08:36 +00002175 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002176}
2177
2178static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002179vec_lvxl(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002180{
David Blaikie3302f2b2013-01-16 23:08:36 +00002181 return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002182}
2183
Anton Yartsevfc83c602010-08-19 03:21:36 +00002184static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002185vec_lvxl(int __a, const vector bool short *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002186{
David Blaikie3302f2b2013-01-16 23:08:36 +00002187 return (vector bool short)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002188}
2189
2190static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002191vec_lvxl(int __a, const vector pixel *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002192{
David Blaikie3302f2b2013-01-16 23:08:36 +00002193 return (vector pixel)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002194}
2195
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002196static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002197vec_lvxl(int __a, const vector int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002198{
David Blaikie3302f2b2013-01-16 23:08:36 +00002199 return (vector int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002200}
2201
2202static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002203vec_lvxl(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002204{
David Blaikie3302f2b2013-01-16 23:08:36 +00002205 return (vector int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002206}
2207
2208static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002209vec_lvxl(int __a, const vector unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002210{
David Blaikie3302f2b2013-01-16 23:08:36 +00002211 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002212}
2213
2214static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002215vec_lvxl(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002216{
David Blaikie3302f2b2013-01-16 23:08:36 +00002217 return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002218}
2219
Anton Yartsevfc83c602010-08-19 03:21:36 +00002220static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002221vec_lvxl(int __a, const vector bool int *__b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002222{
David Blaikie3302f2b2013-01-16 23:08:36 +00002223 return (vector bool int)__builtin_altivec_lvxl(__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002224}
2225
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002226static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002227vec_lvxl(int __a, const vector float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002228{
David Blaikie3302f2b2013-01-16 23:08:36 +00002229 return (vector float)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002230}
2231
2232static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002233vec_lvxl(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002234{
David Blaikie3302f2b2013-01-16 23:08:36 +00002235 return (vector float)__builtin_altivec_lvxl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002236}
2237
2238/* vec_loge */
2239
2240static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002241vec_loge(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002242{
David Blaikie3302f2b2013-01-16 23:08:36 +00002243 return __builtin_altivec_vlogefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002244}
2245
2246/* vec_vlogefp */
2247
2248static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002249vec_vlogefp(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002250{
David Blaikie3302f2b2013-01-16 23:08:36 +00002251 return __builtin_altivec_vlogefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002252}
2253
2254/* vec_lvsl */
2255
2256static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002257vec_lvsl(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002258{
David Blaikie3302f2b2013-01-16 23:08:36 +00002259 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002260}
2261
2262static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002263vec_lvsl(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002264{
David Blaikie3302f2b2013-01-16 23:08:36 +00002265 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002266}
2267
2268static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002269vec_lvsl(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002270{
David Blaikie3302f2b2013-01-16 23:08:36 +00002271 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002272}
2273
2274static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002275vec_lvsl(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002276{
David Blaikie3302f2b2013-01-16 23:08:36 +00002277 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002278}
2279
2280static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002281vec_lvsl(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002282{
David Blaikie3302f2b2013-01-16 23:08:36 +00002283 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002284}
2285
2286static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002287vec_lvsl(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002288{
David Blaikie3302f2b2013-01-16 23:08:36 +00002289 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002290}
2291
2292static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002293vec_lvsl(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002294{
David Blaikie3302f2b2013-01-16 23:08:36 +00002295 return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002296}
2297
2298/* vec_lvsr */
2299
2300static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002301vec_lvsr(int __a, const signed char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002302{
David Blaikie3302f2b2013-01-16 23:08:36 +00002303 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002304}
2305
2306static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002307vec_lvsr(int __a, const unsigned char *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002308{
David Blaikie3302f2b2013-01-16 23:08:36 +00002309 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002310}
2311
2312static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002313vec_lvsr(int __a, const short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002314{
David Blaikie3302f2b2013-01-16 23:08:36 +00002315 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002316}
2317
2318static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002319vec_lvsr(int __a, const unsigned short *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002320{
David Blaikie3302f2b2013-01-16 23:08:36 +00002321 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002322}
2323
2324static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002325vec_lvsr(int __a, const int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002326{
David Blaikie3302f2b2013-01-16 23:08:36 +00002327 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002328}
2329
2330static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002331vec_lvsr(int __a, const unsigned int *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002332{
David Blaikie3302f2b2013-01-16 23:08:36 +00002333 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002334}
2335
2336static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002337vec_lvsr(int __a, const float *__b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002338{
David Blaikie3302f2b2013-01-16 23:08:36 +00002339 return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002340}
2341
2342/* vec_madd */
2343
2344static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002345vec_madd(vector float __a, vector float __b, vector float __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002346{
David Blaikie3302f2b2013-01-16 23:08:36 +00002347 return __builtin_altivec_vmaddfp(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002348}
2349
2350/* vec_vmaddfp */
2351
2352static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002353vec_vmaddfp(vector float __a, vector float __b, vector float __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002354{
David Blaikie3302f2b2013-01-16 23:08:36 +00002355 return __builtin_altivec_vmaddfp(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002356}
2357
2358/* vec_madds */
2359
2360static vector signed short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002361vec_madds(vector signed short __a, vector signed short __b, vector signed short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002362{
David Blaikie3302f2b2013-01-16 23:08:36 +00002363 return __builtin_altivec_vmhaddshs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002364}
2365
2366/* vec_vmhaddshs */
2367static vector signed short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002368vec_vmhaddshs(vector signed short __a,
2369 vector signed short __b,
2370 vector signed short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002371{
David Blaikie3302f2b2013-01-16 23:08:36 +00002372 return __builtin_altivec_vmhaddshs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002373}
2374
Chris Lattnerdad40622010-04-14 03:54:58 +00002375/* vec_max */
2376
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002377static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002378vec_max(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002379{
David Blaikie3302f2b2013-01-16 23:08:36 +00002380 return __builtin_altivec_vmaxsb(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002381}
2382
Anton Yartsevfc83c602010-08-19 03:21:36 +00002383static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002384vec_max(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002385{
David Blaikie3302f2b2013-01-16 23:08:36 +00002386 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002387}
2388
2389static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002390vec_max(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002391{
David Blaikie3302f2b2013-01-16 23:08:36 +00002392 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002393}
2394
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002395static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002396vec_max(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002397{
David Blaikie3302f2b2013-01-16 23:08:36 +00002398 return __builtin_altivec_vmaxub(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002399}
2400
Anton Yartsevfc83c602010-08-19 03:21:36 +00002401static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002402vec_max(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002403{
David Blaikie3302f2b2013-01-16 23:08:36 +00002404 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002405}
2406
2407static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002408vec_max(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002409{
David Blaikie3302f2b2013-01-16 23:08:36 +00002410 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002411}
2412
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002413static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002414vec_max(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002415{
David Blaikie3302f2b2013-01-16 23:08:36 +00002416 return __builtin_altivec_vmaxsh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002417}
2418
Anton Yartsevfc83c602010-08-19 03:21:36 +00002419static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002420vec_max(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002421{
David Blaikie3302f2b2013-01-16 23:08:36 +00002422 return __builtin_altivec_vmaxsh((vector short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002423}
2424
2425static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002426vec_max(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002427{
David Blaikie3302f2b2013-01-16 23:08:36 +00002428 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002429}
2430
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002431static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002432vec_max(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002433{
David Blaikie3302f2b2013-01-16 23:08:36 +00002434 return __builtin_altivec_vmaxuh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002435}
2436
Anton Yartsevfc83c602010-08-19 03:21:36 +00002437static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002438vec_max(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002439{
David Blaikie3302f2b2013-01-16 23:08:36 +00002440 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002441}
2442
2443static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002444vec_max(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002445{
David Blaikie3302f2b2013-01-16 23:08:36 +00002446 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002447}
2448
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002449static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002450vec_max(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002451{
David Blaikie3302f2b2013-01-16 23:08:36 +00002452 return __builtin_altivec_vmaxsw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002453}
2454
Anton Yartsevfc83c602010-08-19 03:21:36 +00002455static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002456vec_max(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002457{
David Blaikie3302f2b2013-01-16 23:08:36 +00002458 return __builtin_altivec_vmaxsw((vector int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002459}
2460
2461static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002462vec_max(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002463{
David Blaikie3302f2b2013-01-16 23:08:36 +00002464 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002465}
2466
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002467static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002468vec_max(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002469{
David Blaikie3302f2b2013-01-16 23:08:36 +00002470 return __builtin_altivec_vmaxuw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002471}
2472
Anton Yartsevfc83c602010-08-19 03:21:36 +00002473static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002474vec_max(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002475{
David Blaikie3302f2b2013-01-16 23:08:36 +00002476 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002477}
2478
2479static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002480vec_max(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002481{
David Blaikie3302f2b2013-01-16 23:08:36 +00002482 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002483}
2484
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002485static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002486vec_max(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00002487{
David Blaikie3302f2b2013-01-16 23:08:36 +00002488 return __builtin_altivec_vmaxfp(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00002489}
2490
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002491/* vec_vmaxsb */
2492
Anton Yartsevfc83c602010-08-19 03:21:36 +00002493static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002494vec_vmaxsb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002495{
David Blaikie3302f2b2013-01-16 23:08:36 +00002496 return __builtin_altivec_vmaxsb(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002497}
2498
Anton Yartsevfc83c602010-08-19 03:21:36 +00002499static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002500vec_vmaxsb(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002501{
David Blaikie3302f2b2013-01-16 23:08:36 +00002502 return __builtin_altivec_vmaxsb((vector signed char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002503}
2504
2505static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002506vec_vmaxsb(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002507{
David Blaikie3302f2b2013-01-16 23:08:36 +00002508 return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002509}
2510
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002511/* vec_vmaxub */
2512
Anton Yartsevfc83c602010-08-19 03:21:36 +00002513static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002514vec_vmaxub(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002515{
David Blaikie3302f2b2013-01-16 23:08:36 +00002516 return __builtin_altivec_vmaxub(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002517}
2518
Anton Yartsevfc83c602010-08-19 03:21:36 +00002519static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002520vec_vmaxub(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002521{
David Blaikie3302f2b2013-01-16 23:08:36 +00002522 return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002523}
2524
2525static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002526vec_vmaxub(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002527{
David Blaikie3302f2b2013-01-16 23:08:36 +00002528 return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002529}
2530
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002531/* vec_vmaxsh */
2532
Anton Yartsevfc83c602010-08-19 03:21:36 +00002533static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002534vec_vmaxsh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002535{
David Blaikie3302f2b2013-01-16 23:08:36 +00002536 return __builtin_altivec_vmaxsh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002537}
2538
Anton Yartsevfc83c602010-08-19 03:21:36 +00002539static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002540vec_vmaxsh(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002541{
David Blaikie3302f2b2013-01-16 23:08:36 +00002542 return __builtin_altivec_vmaxsh((vector short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002543}
2544
2545static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002546vec_vmaxsh(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002547{
David Blaikie3302f2b2013-01-16 23:08:36 +00002548 return __builtin_altivec_vmaxsh(__a, (vector short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002549}
2550
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002551/* vec_vmaxuh */
2552
Anton Yartsevfc83c602010-08-19 03:21:36 +00002553static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002554vec_vmaxuh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002555{
David Blaikie3302f2b2013-01-16 23:08:36 +00002556 return __builtin_altivec_vmaxuh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002557}
2558
Anton Yartsevfc83c602010-08-19 03:21:36 +00002559static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002560vec_vmaxuh(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002561{
David Blaikie3302f2b2013-01-16 23:08:36 +00002562 return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002563}
2564
2565static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002566vec_vmaxuh(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002567{
David Blaikie3302f2b2013-01-16 23:08:36 +00002568 return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002569}
2570
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002571/* vec_vmaxsw */
2572
Anton Yartsevfc83c602010-08-19 03:21:36 +00002573static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002574vec_vmaxsw(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002575{
David Blaikie3302f2b2013-01-16 23:08:36 +00002576 return __builtin_altivec_vmaxsw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002577}
2578
Anton Yartsevfc83c602010-08-19 03:21:36 +00002579static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002580vec_vmaxsw(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002581{
David Blaikie3302f2b2013-01-16 23:08:36 +00002582 return __builtin_altivec_vmaxsw((vector int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002583}
2584
2585static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002586vec_vmaxsw(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002587{
David Blaikie3302f2b2013-01-16 23:08:36 +00002588 return __builtin_altivec_vmaxsw(__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002589}
2590
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002591/* vec_vmaxuw */
2592
Anton Yartsevfc83c602010-08-19 03:21:36 +00002593static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002594vec_vmaxuw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002595{
David Blaikie3302f2b2013-01-16 23:08:36 +00002596 return __builtin_altivec_vmaxuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002597}
2598
Anton Yartsevfc83c602010-08-19 03:21:36 +00002599static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002600vec_vmaxuw(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002601{
David Blaikie3302f2b2013-01-16 23:08:36 +00002602 return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002603}
2604
2605static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002606vec_vmaxuw(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00002607{
David Blaikie3302f2b2013-01-16 23:08:36 +00002608 return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00002609}
2610
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002611/* vec_vmaxfp */
2612
2613static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00002614vec_vmaxfp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002615{
David Blaikie3302f2b2013-01-16 23:08:36 +00002616 return __builtin_altivec_vmaxfp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002617}
2618
2619/* vec_mergeh */
2620
2621static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002622vec_mergeh(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002623{
David Blaikie3302f2b2013-01-16 23:08:36 +00002624 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002625 (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13,
2626 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2627}
2628
2629static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002630vec_mergeh(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002631{
David Blaikie3302f2b2013-01-16 23:08:36 +00002632 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002633 (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13,
2634 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2635}
2636
Anton Yartsev9e968982010-08-19 03:00:09 +00002637static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002638vec_mergeh(vector bool char __a, vector bool char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002639{
David Blaikie3302f2b2013-01-16 23:08:36 +00002640 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002641 (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13,
2642 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2643}
2644
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002645static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002646vec_mergeh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002647{
David Blaikie3302f2b2013-01-16 23:08:36 +00002648 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002649 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2650 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2651}
2652
2653static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002654vec_mergeh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002655{
David Blaikie3302f2b2013-01-16 23:08:36 +00002656 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002657 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2658 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2659}
2660
Anton Yartsev9e968982010-08-19 03:00:09 +00002661static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002662vec_mergeh(vector bool short __a, vector bool short __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002663{
David Blaikie3302f2b2013-01-16 23:08:36 +00002664 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002665 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2666 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2667}
2668
2669static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002670vec_mergeh(vector pixel __a, vector pixel __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002671{
David Blaikie3302f2b2013-01-16 23:08:36 +00002672 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002673 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2674 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2675}
2676
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002677static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002678vec_mergeh(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002679{
David Blaikie3302f2b2013-01-16 23:08:36 +00002680 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002681 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2682 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2683}
2684
2685static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002686vec_mergeh(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002687{
David Blaikie3302f2b2013-01-16 23:08:36 +00002688 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002689 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2690 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2691}
2692
Anton Yartsev9e968982010-08-19 03:00:09 +00002693static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002694vec_mergeh(vector bool int __a, vector bool int __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002695{
David Blaikie3302f2b2013-01-16 23:08:36 +00002696 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002697 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2698 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2699}
2700
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002701static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002702vec_mergeh(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002703{
David Blaikie3302f2b2013-01-16 23:08:36 +00002704 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002705 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2706 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2707}
2708
2709/* vec_vmrghb */
2710
2711#define __builtin_altivec_vmrghb vec_vmrghb
2712
2713static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002714vec_vmrghb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002715{
David Blaikie3302f2b2013-01-16 23:08:36 +00002716 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002717 (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13,
2718 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2719}
2720
2721static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002722vec_vmrghb(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002723{
David Blaikie3302f2b2013-01-16 23:08:36 +00002724 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002725 (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13,
2726 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2727}
2728
Anton Yartsev9e968982010-08-19 03:00:09 +00002729static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002730vec_vmrghb(vector bool char __a, vector bool char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002731{
David Blaikie3302f2b2013-01-16 23:08:36 +00002732 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002733 (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13,
2734 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17));
2735}
2736
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002737/* vec_vmrghh */
2738
2739#define __builtin_altivec_vmrghh vec_vmrghh
2740
2741static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002742vec_vmrghh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002743{
David Blaikie3302f2b2013-01-16 23:08:36 +00002744 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002745 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2746 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2747}
2748
2749static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002750vec_vmrghh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002751{
David Blaikie3302f2b2013-01-16 23:08:36 +00002752 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002753 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2754 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2755}
2756
Anton Yartsev9e968982010-08-19 03:00:09 +00002757static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002758vec_vmrghh(vector bool short __a, vector bool short __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002759{
David Blaikie3302f2b2013-01-16 23:08:36 +00002760 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002761 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2762 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2763}
2764
2765static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002766vec_vmrghh(vector pixel __a, vector pixel __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002767{
David Blaikie3302f2b2013-01-16 23:08:36 +00002768 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002769 (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13,
2770 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17));
2771}
2772
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002773/* vec_vmrghw */
2774
2775#define __builtin_altivec_vmrghw vec_vmrghw
2776
2777static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002778vec_vmrghw(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002779{
David Blaikie3302f2b2013-01-16 23:08:36 +00002780 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002781 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2782 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2783}
2784
2785static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002786vec_vmrghw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002787{
David Blaikie3302f2b2013-01-16 23:08:36 +00002788 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002789 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2790 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2791}
2792
Anton Yartsev9e968982010-08-19 03:00:09 +00002793static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002794vec_vmrghw(vector bool int __a, vector bool int __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002795{
David Blaikie3302f2b2013-01-16 23:08:36 +00002796 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002797 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2798 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2799}
2800
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002801static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002802vec_vmrghw(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002803{
David Blaikie3302f2b2013-01-16 23:08:36 +00002804 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002805 (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13,
2806 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17));
2807}
2808
2809/* vec_mergel */
2810
2811static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002812vec_mergel(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002813{
David Blaikie3302f2b2013-01-16 23:08:36 +00002814 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002815 (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B,
2816 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
2817}
2818
2819static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002820vec_mergel(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002821{
David Blaikie3302f2b2013-01-16 23:08:36 +00002822 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002823 (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B,
2824 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
2825}
2826
Anton Yartsev9e968982010-08-19 03:00:09 +00002827static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002828vec_mergel(vector bool char __a, vector bool char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002829{
David Blaikie3302f2b2013-01-16 23:08:36 +00002830 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002831 (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B,
2832 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
2833}
2834
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002835static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002836vec_mergel(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002837{
David Blaikie3302f2b2013-01-16 23:08:36 +00002838 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002839 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2840 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2841}
2842
2843static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002844vec_mergel(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002845{
David Blaikie3302f2b2013-01-16 23:08:36 +00002846 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002847 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2848 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2849}
2850
Anton Yartsev9e968982010-08-19 03:00:09 +00002851static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002852vec_mergel(vector bool short __a, vector bool short __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002853{
David Blaikie3302f2b2013-01-16 23:08:36 +00002854 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002855 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2856 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2857}
2858
2859static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002860vec_mergel(vector pixel __a, vector pixel __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002861{
David Blaikie3302f2b2013-01-16 23:08:36 +00002862 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002863 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2864 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2865}
2866
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002867static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002868vec_mergel(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002869{
David Blaikie3302f2b2013-01-16 23:08:36 +00002870 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002871 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2872 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2873}
2874
2875static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002876vec_mergel(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002877{
David Blaikie3302f2b2013-01-16 23:08:36 +00002878 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002879 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2880 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2881}
2882
Anton Yartsev9e968982010-08-19 03:00:09 +00002883static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002884vec_mergel(vector bool int __a, vector bool int __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002885{
David Blaikie3302f2b2013-01-16 23:08:36 +00002886 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002887 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2888 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2889}
2890
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002891static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002892vec_mergel(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002893{
David Blaikie3302f2b2013-01-16 23:08:36 +00002894 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002895 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2896 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2897}
2898
2899/* vec_vmrglb */
2900
2901#define __builtin_altivec_vmrglb vec_vmrglb
2902
2903static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002904vec_vmrglb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002905{
David Blaikie3302f2b2013-01-16 23:08:36 +00002906 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002907 (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B,
2908 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
2909}
2910
2911static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002912vec_vmrglb(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002913{
David Blaikie3302f2b2013-01-16 23:08:36 +00002914 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002915 (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B,
2916 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
2917}
2918
Anton Yartsev9e968982010-08-19 03:00:09 +00002919static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002920vec_vmrglb(vector bool char __a, vector bool char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002921{
David Blaikie3302f2b2013-01-16 23:08:36 +00002922 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002923 (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B,
2924 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F));
2925}
2926
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002927/* vec_vmrglh */
2928
2929#define __builtin_altivec_vmrglh vec_vmrglh
2930
2931static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002932vec_vmrglh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002933{
David Blaikie3302f2b2013-01-16 23:08:36 +00002934 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002935 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2936 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2937}
2938
2939static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002940vec_vmrglh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002941{
David Blaikie3302f2b2013-01-16 23:08:36 +00002942 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002943 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2944 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2945}
2946
Anton Yartsev9e968982010-08-19 03:00:09 +00002947static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002948vec_vmrglh(vector bool short __a, vector bool short __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002949{
David Blaikie3302f2b2013-01-16 23:08:36 +00002950 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002951 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2952 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2953}
2954
2955static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002956vec_vmrglh(vector pixel __a, vector pixel __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002957{
David Blaikie3302f2b2013-01-16 23:08:36 +00002958 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002959 (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B,
2960 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F));
2961}
2962
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002963/* vec_vmrglw */
2964
2965#define __builtin_altivec_vmrglw vec_vmrglw
2966
2967static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002968vec_vmrglw(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002969{
David Blaikie3302f2b2013-01-16 23:08:36 +00002970 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002971 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2972 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2973}
2974
2975static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002976vec_vmrglw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002977{
David Blaikie3302f2b2013-01-16 23:08:36 +00002978 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002979 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2980 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2981}
2982
Anton Yartsev9e968982010-08-19 03:00:09 +00002983static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002984vec_vmrglw(vector bool int __a, vector bool int __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00002985{
David Blaikie3302f2b2013-01-16 23:08:36 +00002986 return vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00002987 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2988 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2989}
2990
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002991static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00002992vec_vmrglw(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002993{
David Blaikie3302f2b2013-01-16 23:08:36 +00002994 return vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00002995 (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B,
2996 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F));
2997}
2998
Chris Lattnerdad40622010-04-14 03:54:58 +00002999/* vec_mfvscr */
3000
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003001static vector unsigned short __attribute__((__always_inline__))
3002vec_mfvscr(void)
3003{
3004 return __builtin_altivec_mfvscr();
3005}
Chris Lattnerdad40622010-04-14 03:54:58 +00003006
3007/* vec_min */
3008
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003009static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003010vec_min(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003011{
David Blaikie3302f2b2013-01-16 23:08:36 +00003012 return __builtin_altivec_vminsb(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003013}
3014
Anton Yartsevfc83c602010-08-19 03:21:36 +00003015static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003016vec_min(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003017{
David Blaikie3302f2b2013-01-16 23:08:36 +00003018 return __builtin_altivec_vminsb((vector signed char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003019}
3020
3021static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003022vec_min(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003023{
David Blaikie3302f2b2013-01-16 23:08:36 +00003024 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003025}
3026
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003027static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003028vec_min(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003029{
David Blaikie3302f2b2013-01-16 23:08:36 +00003030 return __builtin_altivec_vminub(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003031}
3032
Anton Yartsevfc83c602010-08-19 03:21:36 +00003033static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003034vec_min(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003035{
David Blaikie3302f2b2013-01-16 23:08:36 +00003036 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003037}
3038
3039static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003040vec_min(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003041{
David Blaikie3302f2b2013-01-16 23:08:36 +00003042 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003043}
3044
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003045static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003046vec_min(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003047{
David Blaikie3302f2b2013-01-16 23:08:36 +00003048 return __builtin_altivec_vminsh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003049}
3050
Anton Yartsevfc83c602010-08-19 03:21:36 +00003051static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003052vec_min(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003053{
David Blaikie3302f2b2013-01-16 23:08:36 +00003054 return __builtin_altivec_vminsh((vector short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003055}
3056
3057static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003058vec_min(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003059{
David Blaikie3302f2b2013-01-16 23:08:36 +00003060 return __builtin_altivec_vminsh(__a, (vector short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003061}
3062
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003063static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003064vec_min(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003065{
David Blaikie3302f2b2013-01-16 23:08:36 +00003066 return __builtin_altivec_vminuh(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003067}
3068
Anton Yartsevfc83c602010-08-19 03:21:36 +00003069static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003070vec_min(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003071{
David Blaikie3302f2b2013-01-16 23:08:36 +00003072 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003073}
3074
3075static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003076vec_min(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003077{
David Blaikie3302f2b2013-01-16 23:08:36 +00003078 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003079}
3080
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003081static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003082vec_min(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003083{
David Blaikie3302f2b2013-01-16 23:08:36 +00003084 return __builtin_altivec_vminsw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003085}
3086
Anton Yartsevfc83c602010-08-19 03:21:36 +00003087static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003088vec_min(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003089{
David Blaikie3302f2b2013-01-16 23:08:36 +00003090 return __builtin_altivec_vminsw((vector int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003091}
3092
3093static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003094vec_min(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003095{
David Blaikie3302f2b2013-01-16 23:08:36 +00003096 return __builtin_altivec_vminsw(__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003097}
3098
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003099static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003100vec_min(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003101{
David Blaikie3302f2b2013-01-16 23:08:36 +00003102 return __builtin_altivec_vminuw(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003103}
3104
Anton Yartsevfc83c602010-08-19 03:21:36 +00003105static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003106vec_min(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003107{
David Blaikie3302f2b2013-01-16 23:08:36 +00003108 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003109}
3110
3111static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003112vec_min(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003113{
David Blaikie3302f2b2013-01-16 23:08:36 +00003114 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003115}
3116
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003117static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003118vec_min(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +00003119{
David Blaikie3302f2b2013-01-16 23:08:36 +00003120 return __builtin_altivec_vminfp(__a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +00003121}
3122
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003123/* vec_vminsb */
3124
Anton Yartsevfc83c602010-08-19 03:21:36 +00003125static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003126vec_vminsb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003127{
David Blaikie3302f2b2013-01-16 23:08:36 +00003128 return __builtin_altivec_vminsb(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003129}
3130
Anton Yartsevfc83c602010-08-19 03:21:36 +00003131static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003132vec_vminsb(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003133{
David Blaikie3302f2b2013-01-16 23:08:36 +00003134 return __builtin_altivec_vminsb((vector signed char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003135}
3136
3137static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003138vec_vminsb(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003139{
David Blaikie3302f2b2013-01-16 23:08:36 +00003140 return __builtin_altivec_vminsb(__a, (vector signed char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003141}
3142
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003143/* vec_vminub */
3144
Anton Yartsevfc83c602010-08-19 03:21:36 +00003145static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003146vec_vminub(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003147{
David Blaikie3302f2b2013-01-16 23:08:36 +00003148 return __builtin_altivec_vminub(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003149}
3150
Anton Yartsevfc83c602010-08-19 03:21:36 +00003151static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003152vec_vminub(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003153{
David Blaikie3302f2b2013-01-16 23:08:36 +00003154 return __builtin_altivec_vminub((vector unsigned char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003155}
3156
3157static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003158vec_vminub(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003159{
David Blaikie3302f2b2013-01-16 23:08:36 +00003160 return __builtin_altivec_vminub(__a, (vector unsigned char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003161}
3162
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003163/* vec_vminsh */
3164
Anton Yartsevfc83c602010-08-19 03:21:36 +00003165static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003166vec_vminsh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003167{
David Blaikie3302f2b2013-01-16 23:08:36 +00003168 return __builtin_altivec_vminsh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003169}
3170
Anton Yartsevfc83c602010-08-19 03:21:36 +00003171static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003172vec_vminsh(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003173{
David Blaikie3302f2b2013-01-16 23:08:36 +00003174 return __builtin_altivec_vminsh((vector short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003175}
3176
3177static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003178vec_vminsh(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003179{
David Blaikie3302f2b2013-01-16 23:08:36 +00003180 return __builtin_altivec_vminsh(__a, (vector short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003181}
3182
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003183/* vec_vminuh */
3184
Anton Yartsevfc83c602010-08-19 03:21:36 +00003185static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003186vec_vminuh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003187{
David Blaikie3302f2b2013-01-16 23:08:36 +00003188 return __builtin_altivec_vminuh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003189}
3190
Anton Yartsevfc83c602010-08-19 03:21:36 +00003191static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003192vec_vminuh(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003193{
David Blaikie3302f2b2013-01-16 23:08:36 +00003194 return __builtin_altivec_vminuh((vector unsigned short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003195}
3196
3197static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003198vec_vminuh(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003199{
David Blaikie3302f2b2013-01-16 23:08:36 +00003200 return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003201}
3202
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003203/* vec_vminsw */
3204
Anton Yartsevfc83c602010-08-19 03:21:36 +00003205static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003206vec_vminsw(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003207{
David Blaikie3302f2b2013-01-16 23:08:36 +00003208 return __builtin_altivec_vminsw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003209}
3210
Anton Yartsevfc83c602010-08-19 03:21:36 +00003211static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003212vec_vminsw(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003213{
David Blaikie3302f2b2013-01-16 23:08:36 +00003214 return __builtin_altivec_vminsw((vector int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003215}
3216
3217static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003218vec_vminsw(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003219{
David Blaikie3302f2b2013-01-16 23:08:36 +00003220 return __builtin_altivec_vminsw(__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003221}
3222
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003223/* vec_vminuw */
3224
Anton Yartsevfc83c602010-08-19 03:21:36 +00003225static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003226vec_vminuw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003227{
David Blaikie3302f2b2013-01-16 23:08:36 +00003228 return __builtin_altivec_vminuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003229}
3230
Anton Yartsevfc83c602010-08-19 03:21:36 +00003231static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003232vec_vminuw(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003233{
David Blaikie3302f2b2013-01-16 23:08:36 +00003234 return __builtin_altivec_vminuw((vector unsigned int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003235}
3236
3237static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003238vec_vminuw(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003239{
David Blaikie3302f2b2013-01-16 23:08:36 +00003240 return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003241}
3242
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003243/* vec_vminfp */
3244
3245static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003246vec_vminfp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003247{
David Blaikie3302f2b2013-01-16 23:08:36 +00003248 return __builtin_altivec_vminfp(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003249}
3250
3251/* vec_mladd */
3252
3253#define __builtin_altivec_vmladduhm vec_mladd
3254
3255static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003256vec_mladd(vector short __a, vector short __b, vector short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003257{
David Blaikie3302f2b2013-01-16 23:08:36 +00003258 return __a * __b + __c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003259}
3260
3261static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003262vec_mladd(vector short __a, vector unsigned short __b, vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003263{
David Blaikie3302f2b2013-01-16 23:08:36 +00003264 return __a * (vector short)__b + (vector short)__c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003265}
3266
3267static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003268vec_mladd(vector unsigned short __a, vector short __b, vector short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003269{
David Blaikie3302f2b2013-01-16 23:08:36 +00003270 return (vector short)__a * __b + __c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003271}
3272
3273static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003274vec_mladd(vector unsigned short __a,
3275 vector unsigned short __b,
3276 vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003277{
David Blaikie3302f2b2013-01-16 23:08:36 +00003278 return __a * __b + __c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003279}
3280
3281/* vec_vmladduhm */
3282
3283static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003284vec_vmladduhm(vector short __a, vector short __b, vector short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003285{
David Blaikie3302f2b2013-01-16 23:08:36 +00003286 return __a * __b + __c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003287}
3288
3289static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003290vec_vmladduhm(vector short __a, vector unsigned short __b, vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003291{
David Blaikie3302f2b2013-01-16 23:08:36 +00003292 return __a * (vector short)__b + (vector short)__c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003293}
3294
3295static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003296vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003297{
David Blaikie3302f2b2013-01-16 23:08:36 +00003298 return (vector short)__a * __b + __c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003299}
3300
3301static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003302vec_vmladduhm(vector unsigned short __a,
3303 vector unsigned short __b,
3304 vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003305{
David Blaikie3302f2b2013-01-16 23:08:36 +00003306 return __a * __b + __c;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003307}
3308
3309/* vec_mradds */
3310
3311static vector short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003312vec_mradds(vector short __a, vector short __b, vector short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003313{
David Blaikie3302f2b2013-01-16 23:08:36 +00003314 return __builtin_altivec_vmhraddshs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003315}
3316
3317/* vec_vmhraddshs */
3318
3319static vector short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003320vec_vmhraddshs(vector short __a, vector short __b, vector short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003321{
David Blaikie3302f2b2013-01-16 23:08:36 +00003322 return __builtin_altivec_vmhraddshs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003323}
3324
3325/* vec_msum */
3326
3327static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003328vec_msum(vector signed char __a, vector unsigned char __b, vector int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003329{
David Blaikie3302f2b2013-01-16 23:08:36 +00003330 return __builtin_altivec_vmsummbm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003331}
3332
3333static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003334vec_msum(vector unsigned char __a, vector unsigned char __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003335{
David Blaikie3302f2b2013-01-16 23:08:36 +00003336 return __builtin_altivec_vmsumubm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003337}
3338
3339static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003340vec_msum(vector short __a, vector short __b, vector int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003341{
David Blaikie3302f2b2013-01-16 23:08:36 +00003342 return __builtin_altivec_vmsumshm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003343}
3344
3345static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003346vec_msum(vector unsigned short __a,
3347 vector unsigned short __b,
3348 vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003349{
David Blaikie3302f2b2013-01-16 23:08:36 +00003350 return __builtin_altivec_vmsumuhm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003351}
3352
3353/* vec_vmsummbm */
3354
3355static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003356vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003357{
David Blaikie3302f2b2013-01-16 23:08:36 +00003358 return __builtin_altivec_vmsummbm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003359}
3360
3361/* vec_vmsumubm */
3362
3363static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003364vec_vmsumubm(vector unsigned char __a,
3365 vector unsigned char __b,
3366 vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003367{
David Blaikie3302f2b2013-01-16 23:08:36 +00003368 return __builtin_altivec_vmsumubm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003369}
3370
3371/* vec_vmsumshm */
3372
3373static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003374vec_vmsumshm(vector short __a, vector short __b, vector int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003375{
David Blaikie3302f2b2013-01-16 23:08:36 +00003376 return __builtin_altivec_vmsumshm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003377}
3378
3379/* vec_vmsumuhm */
3380
3381static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003382vec_vmsumuhm(vector unsigned short __a,
3383 vector unsigned short __b,
3384 vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003385{
David Blaikie3302f2b2013-01-16 23:08:36 +00003386 return __builtin_altivec_vmsumuhm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003387}
3388
3389/* vec_msums */
3390
3391static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003392vec_msums(vector short __a, vector short __b, vector int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003393{
David Blaikie3302f2b2013-01-16 23:08:36 +00003394 return __builtin_altivec_vmsumshs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003395}
3396
3397static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003398vec_msums(vector unsigned short __a,
3399 vector unsigned short __b,
3400 vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003401{
David Blaikie3302f2b2013-01-16 23:08:36 +00003402 return __builtin_altivec_vmsumuhs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003403}
3404
3405/* vec_vmsumshs */
3406
3407static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003408vec_vmsumshs(vector short __a, vector short __b, vector int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003409{
David Blaikie3302f2b2013-01-16 23:08:36 +00003410 return __builtin_altivec_vmsumshs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003411}
3412
3413/* vec_vmsumuhs */
3414
3415static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003416vec_vmsumuhs(vector unsigned short __a,
3417 vector unsigned short __b,
3418 vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003419{
David Blaikie3302f2b2013-01-16 23:08:36 +00003420 return __builtin_altivec_vmsumuhs(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003421}
3422
Chris Lattnerdad40622010-04-14 03:54:58 +00003423/* vec_mtvscr */
3424
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003425static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003426vec_mtvscr(vector signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003427{
David Blaikie3302f2b2013-01-16 23:08:36 +00003428 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003429}
3430
3431static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003432vec_mtvscr(vector unsigned char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003433{
David Blaikie3302f2b2013-01-16 23:08:36 +00003434 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003435}
3436
3437static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003438vec_mtvscr(vector bool char __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003439{
David Blaikie3302f2b2013-01-16 23:08:36 +00003440 __builtin_altivec_mtvscr((vector int)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003441}
3442
3443static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003444vec_mtvscr(vector short __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003445{
David Blaikie3302f2b2013-01-16 23:08:36 +00003446 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003447}
3448
3449static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003450vec_mtvscr(vector unsigned short __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003451{
David Blaikie3302f2b2013-01-16 23:08:36 +00003452 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003453}
3454
3455static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003456vec_mtvscr(vector bool short __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003457{
David Blaikie3302f2b2013-01-16 23:08:36 +00003458 __builtin_altivec_mtvscr((vector int)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003459}
3460
3461static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003462vec_mtvscr(vector pixel __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003463{
David Blaikie3302f2b2013-01-16 23:08:36 +00003464 __builtin_altivec_mtvscr((vector int)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003465}
3466
3467static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003468vec_mtvscr(vector int __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003469{
David Blaikie3302f2b2013-01-16 23:08:36 +00003470 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003471}
3472
3473static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003474vec_mtvscr(vector unsigned int __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003475{
David Blaikie3302f2b2013-01-16 23:08:36 +00003476 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003477}
3478
3479static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003480vec_mtvscr(vector bool int __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003481{
David Blaikie3302f2b2013-01-16 23:08:36 +00003482 __builtin_altivec_mtvscr((vector int)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003483}
3484
3485static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003486vec_mtvscr(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003487{
David Blaikie3302f2b2013-01-16 23:08:36 +00003488 __builtin_altivec_mtvscr((vector int)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003489}
3490
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003491/* The vmulos* and vmules* instructions have a big endian bias, so
3492 we must reverse the meaning of "even" and "odd" for little endian. */
3493
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003494/* vec_mule */
3495
3496static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003497vec_mule(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003498{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003499#ifdef __LITTLE_ENDIAN__
3500 return __builtin_altivec_vmulosb(__a, __b);
3501#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003502 return __builtin_altivec_vmulesb(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003503#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003504}
3505
3506static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003507vec_mule(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003508{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003509#ifdef __LITTLE_ENDIAN__
3510 return __builtin_altivec_vmuloub(__a, __b);
3511#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003512 return __builtin_altivec_vmuleub(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003513#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003514}
3515
3516static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003517vec_mule(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003518{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003519#ifdef __LITTLE_ENDIAN__
3520 return __builtin_altivec_vmulosh(__a, __b);
3521#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003522 return __builtin_altivec_vmulesh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003523#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003524}
3525
3526static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003527vec_mule(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003528{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003529#ifdef __LITTLE_ENDIAN__
3530 return __builtin_altivec_vmulouh(__a, __b);
3531#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003532 return __builtin_altivec_vmuleuh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003533#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003534}
3535
3536/* vec_vmulesb */
3537
3538static vector short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003539vec_vmulesb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003540{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003541#ifdef __LITTLE_ENDIAN__
3542 return __builtin_altivec_vmulosb(__a, __b);
3543#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003544 return __builtin_altivec_vmulesb(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003545#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003546}
3547
3548/* vec_vmuleub */
3549
3550static vector unsigned short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003551vec_vmuleub(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003552{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003553#ifdef __LITTLE_ENDIAN__
3554 return __builtin_altivec_vmuloub(__a, __b);
3555#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003556 return __builtin_altivec_vmuleub(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003557#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003558}
3559
3560/* vec_vmulesh */
3561
3562static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003563vec_vmulesh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003564{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003565#ifdef __LITTLE_ENDIAN__
3566 return __builtin_altivec_vmulosh(__a, __b);
3567#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003568 return __builtin_altivec_vmulesh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003569#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003570}
3571
3572/* vec_vmuleuh */
3573
3574static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003575vec_vmuleuh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003576{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003577#ifdef __LITTLE_ENDIAN__
3578 return __builtin_altivec_vmulouh(__a, __b);
3579#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003580 return __builtin_altivec_vmuleuh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003581#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003582}
3583
3584/* vec_mulo */
3585
3586static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003587vec_mulo(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003588{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003589#ifdef __LITTLE_ENDIAN__
3590 return __builtin_altivec_vmulesb(__a, __b);
3591#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003592 return __builtin_altivec_vmulosb(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003593#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003594}
3595
3596static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003597vec_mulo(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003598{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003599#ifdef __LITTLE_ENDIAN__
3600 return __builtin_altivec_vmuleub(__a, __b);
3601#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003602 return __builtin_altivec_vmuloub(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003603#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003604}
3605
3606static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003607vec_mulo(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003608{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003609#ifdef __LITTLE_ENDIAN__
3610 return __builtin_altivec_vmulesh(__a, __b);
3611#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003612 return __builtin_altivec_vmulosh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003613#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003614}
3615
3616static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003617vec_mulo(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003618{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003619#ifdef __LITTLE_ENDIAN__
3620 return __builtin_altivec_vmuleuh(__a, __b);
3621#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003622 return __builtin_altivec_vmulouh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003623#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003624}
3625
3626/* vec_vmulosb */
3627
3628static vector short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003629vec_vmulosb(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003630{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003631#ifdef __LITTLE_ENDIAN__
3632 return __builtin_altivec_vmulesb(__a, __b);
3633#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003634 return __builtin_altivec_vmulosb(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003635#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003636}
3637
3638/* vec_vmuloub */
3639
3640static vector unsigned short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003641vec_vmuloub(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003642{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003643#ifdef __LITTLE_ENDIAN__
3644 return __builtin_altivec_vmuleub(__a, __b);
3645#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003646 return __builtin_altivec_vmuloub(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003647#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003648}
3649
3650/* vec_vmulosh */
3651
3652static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003653vec_vmulosh(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003654{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003655#ifdef __LITTLE_ENDIAN__
3656 return __builtin_altivec_vmulesh(__a, __b);
3657#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003658 return __builtin_altivec_vmulosh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003659#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003660}
3661
3662/* vec_vmulouh */
3663
3664static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003665vec_vmulouh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003666{
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003667#ifdef __LITTLE_ENDIAN__
3668 return __builtin_altivec_vmuleuh(__a, __b);
3669#else
David Blaikie3302f2b2013-01-16 23:08:36 +00003670 return __builtin_altivec_vmulouh(__a, __b);
Bill Schmidt7c0114f2014-06-06 14:45:06 +00003671#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003672}
3673
3674/* vec_nmsub */
3675
3676static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003677vec_nmsub(vector float __a, vector float __b, vector float __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003678{
David Blaikie3302f2b2013-01-16 23:08:36 +00003679 return __builtin_altivec_vnmsubfp(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003680}
3681
3682/* vec_vnmsubfp */
3683
3684static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00003685vec_vnmsubfp(vector float __a, vector float __b, vector float __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003686{
David Blaikie3302f2b2013-01-16 23:08:36 +00003687 return __builtin_altivec_vnmsubfp(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003688}
3689
3690/* vec_nor */
3691
3692#define __builtin_altivec_vnor vec_nor
3693
3694static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003695vec_nor(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003696{
David Blaikie3302f2b2013-01-16 23:08:36 +00003697 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003698}
3699
3700static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003701vec_nor(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003702{
David Blaikie3302f2b2013-01-16 23:08:36 +00003703 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003704}
3705
Anton Yartsevfc83c602010-08-19 03:21:36 +00003706static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003707vec_nor(vector bool char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003708{
David Blaikie3302f2b2013-01-16 23:08:36 +00003709 return ~(__a | __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003710}
3711
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003712static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003713vec_nor(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003714{
David Blaikie3302f2b2013-01-16 23:08:36 +00003715 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003716}
3717
3718static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003719vec_nor(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003720{
David Blaikie3302f2b2013-01-16 23:08:36 +00003721 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003722}
3723
Anton Yartsevfc83c602010-08-19 03:21:36 +00003724static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003725vec_nor(vector bool short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003726{
David Blaikie3302f2b2013-01-16 23:08:36 +00003727 return ~(__a | __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003728}
3729
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003730static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003731vec_nor(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003732{
David Blaikie3302f2b2013-01-16 23:08:36 +00003733 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003734}
3735
3736static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003737vec_nor(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003738{
David Blaikie3302f2b2013-01-16 23:08:36 +00003739 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003740}
3741
Anton Yartsevfc83c602010-08-19 03:21:36 +00003742static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003743vec_nor(vector bool int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003744{
David Blaikie3302f2b2013-01-16 23:08:36 +00003745 return ~(__a | __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003746}
3747
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003748static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003749vec_nor(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003750{
David Blaikie3302f2b2013-01-16 23:08:36 +00003751 vector unsigned int __res = ~((vector unsigned int)__a | (vector unsigned int)__b);
3752 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003753}
3754
3755/* vec_vnor */
3756
3757static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003758vec_vnor(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003759{
David Blaikie3302f2b2013-01-16 23:08:36 +00003760 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003761}
3762
3763static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003764vec_vnor(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003765{
David Blaikie3302f2b2013-01-16 23:08:36 +00003766 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003767}
3768
Anton Yartsevfc83c602010-08-19 03:21:36 +00003769static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003770vec_vnor(vector bool char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003771{
David Blaikie3302f2b2013-01-16 23:08:36 +00003772 return ~(__a | __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003773}
3774
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003775static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003776vec_vnor(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003777{
David Blaikie3302f2b2013-01-16 23:08:36 +00003778 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003779}
3780
3781static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003782vec_vnor(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003783{
David Blaikie3302f2b2013-01-16 23:08:36 +00003784 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003785}
3786
Anton Yartsevfc83c602010-08-19 03:21:36 +00003787static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003788vec_vnor(vector bool short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003789{
David Blaikie3302f2b2013-01-16 23:08:36 +00003790 return ~(__a | __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003791}
3792
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003793static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003794vec_vnor(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003795{
David Blaikie3302f2b2013-01-16 23:08:36 +00003796 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003797}
3798
3799static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003800vec_vnor(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003801{
David Blaikie3302f2b2013-01-16 23:08:36 +00003802 return ~(__a | __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003803}
3804
Anton Yartsevfc83c602010-08-19 03:21:36 +00003805static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003806vec_vnor(vector bool int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003807{
David Blaikie3302f2b2013-01-16 23:08:36 +00003808 return ~(__a | __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00003809}
3810
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003811static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003812vec_vnor(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003813{
David Blaikie3302f2b2013-01-16 23:08:36 +00003814 vector unsigned int __res = ~((vector unsigned int)__a | (vector unsigned int)__b);
3815 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003816}
3817
3818/* vec_or */
3819
3820#define __builtin_altivec_vor vec_or
3821
3822static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003823vec_or(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003824{
David Blaikie3302f2b2013-01-16 23:08:36 +00003825 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003826}
3827
Anton Yartsevfc83c602010-08-19 03:21:36 +00003828static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003829vec_or(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003830{
David Blaikie3302f2b2013-01-16 23:08:36 +00003831 return (vector signed char)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003832}
3833
3834static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003835vec_or(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003836{
David Blaikie3302f2b2013-01-16 23:08:36 +00003837 return __a | (vector signed char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003838}
3839
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003840static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003841vec_or(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003842{
David Blaikie3302f2b2013-01-16 23:08:36 +00003843 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003844}
3845
Anton Yartsevfc83c602010-08-19 03:21:36 +00003846static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003847vec_or(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003848{
David Blaikie3302f2b2013-01-16 23:08:36 +00003849 return (vector unsigned char)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003850}
3851
3852static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003853vec_or(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003854{
David Blaikie3302f2b2013-01-16 23:08:36 +00003855 return __a | (vector unsigned char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003856}
3857
3858static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003859vec_or(vector bool char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003860{
David Blaikie3302f2b2013-01-16 23:08:36 +00003861 return __a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003862}
3863
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003864static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003865vec_or(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003866{
David Blaikie3302f2b2013-01-16 23:08:36 +00003867 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003868}
3869
Anton Yartsevfc83c602010-08-19 03:21:36 +00003870static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003871vec_or(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003872{
David Blaikie3302f2b2013-01-16 23:08:36 +00003873 return (vector short)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003874}
3875
3876static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003877vec_or(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003878{
David Blaikie3302f2b2013-01-16 23:08:36 +00003879 return __a | (vector short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003880}
3881
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003882static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003883vec_or(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003884{
David Blaikie3302f2b2013-01-16 23:08:36 +00003885 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003886}
3887
Anton Yartsevfc83c602010-08-19 03:21:36 +00003888static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003889vec_or(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003890{
David Blaikie3302f2b2013-01-16 23:08:36 +00003891 return (vector unsigned short)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003892}
3893
3894static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003895vec_or(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003896{
David Blaikie3302f2b2013-01-16 23:08:36 +00003897 return __a | (vector unsigned short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003898}
3899
3900static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003901vec_or(vector bool short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003902{
David Blaikie3302f2b2013-01-16 23:08:36 +00003903 return __a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003904}
3905
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003906static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003907vec_or(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003908{
David Blaikie3302f2b2013-01-16 23:08:36 +00003909 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003910}
3911
Anton Yartsevfc83c602010-08-19 03:21:36 +00003912static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003913vec_or(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003914{
David Blaikie3302f2b2013-01-16 23:08:36 +00003915 return (vector int)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003916}
3917
3918static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003919vec_or(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003920{
David Blaikie3302f2b2013-01-16 23:08:36 +00003921 return __a | (vector int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003922}
3923
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003924static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003925vec_or(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003926{
David Blaikie3302f2b2013-01-16 23:08:36 +00003927 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003928}
3929
Anton Yartsevfc83c602010-08-19 03:21:36 +00003930static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003931vec_or(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003932{
David Blaikie3302f2b2013-01-16 23:08:36 +00003933 return (vector unsigned int)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003934}
3935
3936static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003937vec_or(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003938{
David Blaikie3302f2b2013-01-16 23:08:36 +00003939 return __a | (vector unsigned int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003940}
3941
3942static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003943vec_or(vector bool int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003944{
David Blaikie3302f2b2013-01-16 23:08:36 +00003945 return __a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003946}
3947
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003948static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003949vec_or(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003950{
David Blaikie3302f2b2013-01-16 23:08:36 +00003951 vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
3952 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003953}
3954
Anton Yartsevfc83c602010-08-19 03:21:36 +00003955static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003956vec_or(vector bool int __a, vector float __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003957{
David Blaikie3302f2b2013-01-16 23:08:36 +00003958 vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
3959 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003960}
3961
3962static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003963vec_or(vector float __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003964{
David Blaikie3302f2b2013-01-16 23:08:36 +00003965 vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
3966 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003967}
3968
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003969/* vec_vor */
3970
3971static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003972vec_vor(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003973{
David Blaikie3302f2b2013-01-16 23:08:36 +00003974 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003975}
3976
Anton Yartsevfc83c602010-08-19 03:21:36 +00003977static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003978vec_vor(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003979{
David Blaikie3302f2b2013-01-16 23:08:36 +00003980 return (vector signed char)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003981}
3982
3983static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003984vec_vor(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003985{
David Blaikie3302f2b2013-01-16 23:08:36 +00003986 return __a | (vector signed char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003987}
3988
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003989static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003990vec_vor(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003991{
David Blaikie3302f2b2013-01-16 23:08:36 +00003992 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00003993}
3994
Anton Yartsevfc83c602010-08-19 03:21:36 +00003995static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00003996vec_vor(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00003997{
David Blaikie3302f2b2013-01-16 23:08:36 +00003998 return (vector unsigned char)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00003999}
4000
4001static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004002vec_vor(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004003{
David Blaikie3302f2b2013-01-16 23:08:36 +00004004 return __a | (vector unsigned char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004005}
4006
4007static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004008vec_vor(vector bool char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004009{
David Blaikie3302f2b2013-01-16 23:08:36 +00004010 return __a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004011}
4012
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004013static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004014vec_vor(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004015{
David Blaikie3302f2b2013-01-16 23:08:36 +00004016 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004017}
4018
Anton Yartsevfc83c602010-08-19 03:21:36 +00004019static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004020vec_vor(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004021{
David Blaikie3302f2b2013-01-16 23:08:36 +00004022 return (vector short)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004023}
4024
4025static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004026vec_vor(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004027{
David Blaikie3302f2b2013-01-16 23:08:36 +00004028 return __a | (vector short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004029}
4030
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004031static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004032vec_vor(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004033{
David Blaikie3302f2b2013-01-16 23:08:36 +00004034 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004035}
4036
Anton Yartsevfc83c602010-08-19 03:21:36 +00004037static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004038vec_vor(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004039{
David Blaikie3302f2b2013-01-16 23:08:36 +00004040 return (vector unsigned short)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004041}
4042
4043static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004044vec_vor(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004045{
David Blaikie3302f2b2013-01-16 23:08:36 +00004046 return __a | (vector unsigned short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004047}
4048
4049static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004050vec_vor(vector bool short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004051{
David Blaikie3302f2b2013-01-16 23:08:36 +00004052 return __a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004053}
4054
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004055static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004056vec_vor(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004057{
David Blaikie3302f2b2013-01-16 23:08:36 +00004058 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004059}
4060
Anton Yartsevfc83c602010-08-19 03:21:36 +00004061static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004062vec_vor(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004063{
David Blaikie3302f2b2013-01-16 23:08:36 +00004064 return (vector int)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004065}
4066
4067static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004068vec_vor(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004069{
David Blaikie3302f2b2013-01-16 23:08:36 +00004070 return __a | (vector int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004071}
4072
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004073static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004074vec_vor(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004075{
David Blaikie3302f2b2013-01-16 23:08:36 +00004076 return __a | __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004077}
4078
Anton Yartsevfc83c602010-08-19 03:21:36 +00004079static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004080vec_vor(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004081{
David Blaikie3302f2b2013-01-16 23:08:36 +00004082 return (vector unsigned int)__a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004083}
4084
4085static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004086vec_vor(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004087{
David Blaikie3302f2b2013-01-16 23:08:36 +00004088 return __a | (vector unsigned int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004089}
4090
4091static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004092vec_vor(vector bool int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004093{
David Blaikie3302f2b2013-01-16 23:08:36 +00004094 return __a | __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004095}
4096
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004097static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004098vec_vor(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004099{
David Blaikie3302f2b2013-01-16 23:08:36 +00004100 vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4101 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004102}
4103
Anton Yartsevfc83c602010-08-19 03:21:36 +00004104static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004105vec_vor(vector bool int __a, vector float __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004106{
David Blaikie3302f2b2013-01-16 23:08:36 +00004107 vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4108 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004109}
4110
4111static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004112vec_vor(vector float __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004113{
David Blaikie3302f2b2013-01-16 23:08:36 +00004114 vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b;
4115 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004116}
4117
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004118/* vec_pack */
4119
4120static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004121vec_pack(vector signed short __a, vector signed short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004122{
David Blaikie3302f2b2013-01-16 23:08:36 +00004123 return (vector signed char)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004124 (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4125 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4126}
4127
4128static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004129vec_pack(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004130{
David Blaikie3302f2b2013-01-16 23:08:36 +00004131 return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004132 (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4133 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4134}
4135
Anton Yartsev9e968982010-08-19 03:00:09 +00004136static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004137vec_pack(vector bool short __a, vector bool short __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00004138{
David Blaikie3302f2b2013-01-16 23:08:36 +00004139 return (vector bool char)vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00004140 (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4141 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4142}
4143
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004144static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004145vec_pack(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004146{
David Blaikie3302f2b2013-01-16 23:08:36 +00004147 return (vector short)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004148 (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4149 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4150}
4151
4152static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004153vec_pack(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004154{
David Blaikie3302f2b2013-01-16 23:08:36 +00004155 return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004156 (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4157 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4158}
4159
Anton Yartsev9e968982010-08-19 03:00:09 +00004160static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004161vec_pack(vector bool int __a, vector bool int __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00004162{
David Blaikie3302f2b2013-01-16 23:08:36 +00004163 return (vector bool short)vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00004164 (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4165 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4166}
4167
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004168/* vec_vpkuhum */
4169
4170#define __builtin_altivec_vpkuhum vec_vpkuhum
4171
4172static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004173vec_vpkuhum(vector signed short __a, vector signed short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004174{
David Blaikie3302f2b2013-01-16 23:08:36 +00004175 return (vector signed char)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004176 (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4177 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4178}
4179
4180static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004181vec_vpkuhum(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004182{
David Blaikie3302f2b2013-01-16 23:08:36 +00004183 return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004184 (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4185 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4186}
4187
Anton Yartsev9e968982010-08-19 03:00:09 +00004188static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004189vec_vpkuhum(vector bool short __a, vector bool short __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00004190{
David Blaikie3302f2b2013-01-16 23:08:36 +00004191 return (vector bool char)vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00004192 (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
4193 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));
4194}
4195
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004196/* vec_vpkuwum */
4197
4198#define __builtin_altivec_vpkuwum vec_vpkuwum
4199
4200static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004201vec_vpkuwum(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004202{
David Blaikie3302f2b2013-01-16 23:08:36 +00004203 return (vector short)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004204 (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4205 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4206}
4207
4208static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004209vec_vpkuwum(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004210{
David Blaikie3302f2b2013-01-16 23:08:36 +00004211 return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004212 (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4213 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4214}
4215
Anton Yartsev9e968982010-08-19 03:00:09 +00004216static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004217vec_vpkuwum(vector bool int __a, vector bool int __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00004218{
David Blaikie3302f2b2013-01-16 23:08:36 +00004219 return (vector bool short)vec_perm(__a, __b, (vector unsigned char)
Anton Yartsev9e968982010-08-19 03:00:09 +00004220 (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
4221 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));
4222}
4223
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004224/* vec_packpx */
4225
4226static vector pixel __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004227vec_packpx(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004228{
David Blaikie3302f2b2013-01-16 23:08:36 +00004229 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004230}
4231
4232/* vec_vpkpx */
4233
4234static vector pixel __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004235vec_vpkpx(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004236{
David Blaikie3302f2b2013-01-16 23:08:36 +00004237 return (vector pixel)__builtin_altivec_vpkpx(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004238}
4239
4240/* vec_packs */
4241
4242static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004243vec_packs(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004244{
David Blaikie3302f2b2013-01-16 23:08:36 +00004245 return __builtin_altivec_vpkshss(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004246}
4247
4248static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004249vec_packs(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004250{
David Blaikie3302f2b2013-01-16 23:08:36 +00004251 return __builtin_altivec_vpkuhus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004252}
4253
4254static vector signed short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004255vec_packs(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004256{
David Blaikie3302f2b2013-01-16 23:08:36 +00004257 return __builtin_altivec_vpkswss(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004258}
4259
4260static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004261vec_packs(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004262{
David Blaikie3302f2b2013-01-16 23:08:36 +00004263 return __builtin_altivec_vpkuwus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004264}
4265
4266/* vec_vpkshss */
4267
4268static vector signed char __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004269vec_vpkshss(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004270{
David Blaikie3302f2b2013-01-16 23:08:36 +00004271 return __builtin_altivec_vpkshss(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004272}
4273
4274/* vec_vpkuhus */
4275
4276static vector unsigned char __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004277vec_vpkuhus(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004278{
David Blaikie3302f2b2013-01-16 23:08:36 +00004279 return __builtin_altivec_vpkuhus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004280}
4281
4282/* vec_vpkswss */
4283
4284static vector signed short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004285vec_vpkswss(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004286{
David Blaikie3302f2b2013-01-16 23:08:36 +00004287 return __builtin_altivec_vpkswss(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004288}
4289
4290/* vec_vpkuwus */
4291
4292static vector unsigned short __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004293vec_vpkuwus(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004294{
David Blaikie3302f2b2013-01-16 23:08:36 +00004295 return __builtin_altivec_vpkuwus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004296}
4297
4298/* vec_packsu */
4299
4300static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004301vec_packsu(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004302{
David Blaikie3302f2b2013-01-16 23:08:36 +00004303 return __builtin_altivec_vpkshus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004304}
4305
4306static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004307vec_packsu(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004308{
David Blaikie3302f2b2013-01-16 23:08:36 +00004309 return __builtin_altivec_vpkuhus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004310}
4311
4312static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004313vec_packsu(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004314{
David Blaikie3302f2b2013-01-16 23:08:36 +00004315 return __builtin_altivec_vpkswus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004316}
4317
4318static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004319vec_packsu(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004320{
David Blaikie3302f2b2013-01-16 23:08:36 +00004321 return __builtin_altivec_vpkuwus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004322}
4323
4324/* vec_vpkshus */
4325
4326static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004327vec_vpkshus(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004328{
David Blaikie3302f2b2013-01-16 23:08:36 +00004329 return __builtin_altivec_vpkshus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004330}
4331
4332static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004333vec_vpkshus(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004334{
David Blaikie3302f2b2013-01-16 23:08:36 +00004335 return __builtin_altivec_vpkuhus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004336}
4337
4338/* vec_vpkswus */
4339
4340static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004341vec_vpkswus(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004342{
David Blaikie3302f2b2013-01-16 23:08:36 +00004343 return __builtin_altivec_vpkswus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004344}
4345
4346static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004347vec_vpkswus(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004348{
David Blaikie3302f2b2013-01-16 23:08:36 +00004349 return __builtin_altivec_vpkuwus(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004350}
4351
4352/* vec_perm */
4353
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004354// The vperm instruction is defined architecturally with a big-endian bias.
4355// For little endian, we swap the input operands and invert the permute
4356// control vector. Only the rightmost 5 bits matter, so we could use
4357// a vector of all 31s instead of all 255s to perform the inversion.
4358// However, when the PCV is not a constant, using 255 has an advantage
4359// in that the vec_xor can be recognized as a vec_nor (and for P8 and
4360// later, possibly a vec_nand).
4361
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004362vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004363vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004364{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004365#ifdef __LITTLE_ENDIAN__
4366 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4367 255,255,255,255,255,255,255,255};
4368 __d = vec_xor(__c, __d);
4369 return (vector signed char)
4370 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4371#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004372 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00004373 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004374#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004375}
4376
4377vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004378vec_perm(vector unsigned char __a,
4379 vector unsigned char __b,
4380 vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004381{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004382#ifdef __LITTLE_ENDIAN__
4383 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4384 255,255,255,255,255,255,255,255};
4385 __d = vec_xor(__c, __d);
4386 return (vector unsigned char)
4387 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4388#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004389 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00004390 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004391#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004392}
4393
Anton Yartsev9e968982010-08-19 03:00:09 +00004394vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004395vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004396{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004397#ifdef __LITTLE_ENDIAN__
4398 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4399 255,255,255,255,255,255,255,255};
4400 __d = vec_xor(__c, __d);
4401 return (vector bool char)
4402 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4403#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004404 return (vector bool char)
David Blaikie3302f2b2013-01-16 23:08:36 +00004405 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004406#endif
Anton Yartsev9e968982010-08-19 03:00:09 +00004407}
4408
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004409vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004410vec_perm(vector short __a, vector short __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004411{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004412#ifdef __LITTLE_ENDIAN__
4413 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4414 255,255,255,255,255,255,255,255};
4415 __d = vec_xor(__c, __d);
4416 return (vector short)
4417 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4418#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004419 return (vector short)
David Blaikie3302f2b2013-01-16 23:08:36 +00004420 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004421#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004422}
4423
4424vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004425vec_perm(vector unsigned short __a,
4426 vector unsigned short __b,
4427 vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004428{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004429#ifdef __LITTLE_ENDIAN__
4430 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4431 255,255,255,255,255,255,255,255};
4432 __d = vec_xor(__c, __d);
4433 return (vector unsigned short)
4434 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4435#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004436 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00004437 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004438#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004439}
4440
Anton Yartsev9e968982010-08-19 03:00:09 +00004441vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004442vec_perm(vector bool short __a, vector bool short __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004443{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004444#ifdef __LITTLE_ENDIAN__
4445 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4446 255,255,255,255,255,255,255,255};
4447 __d = vec_xor(__c, __d);
4448 return (vector bool short)
4449 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4450#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004451 return (vector bool short)
David Blaikie3302f2b2013-01-16 23:08:36 +00004452 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004453#endif
Anton Yartsev9e968982010-08-19 03:00:09 +00004454}
4455
4456vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004457vec_perm(vector pixel __a, vector pixel __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004458{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004459#ifdef __LITTLE_ENDIAN__
4460 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4461 255,255,255,255,255,255,255,255};
4462 __d = vec_xor(__c, __d);
4463 return (vector pixel)
4464 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4465#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004466 return (vector pixel)
David Blaikie3302f2b2013-01-16 23:08:36 +00004467 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004468#endif
Anton Yartsev9e968982010-08-19 03:00:09 +00004469}
4470
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004471vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004472vec_perm(vector int __a, vector int __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004473{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004474#ifdef __LITTLE_ENDIAN__
4475 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4476 255,255,255,255,255,255,255,255};
4477 __d = vec_xor(__c, __d);
4478 return (vector int)__builtin_altivec_vperm_4si(__b, __a, __d);
4479#else
David Blaikie3302f2b2013-01-16 23:08:36 +00004480 return (vector int)__builtin_altivec_vperm_4si(__a, __b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004481#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004482}
4483
4484vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004485vec_perm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004486{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004487#ifdef __LITTLE_ENDIAN__
4488 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4489 255,255,255,255,255,255,255,255};
4490 __d = vec_xor(__c, __d);
4491 return (vector unsigned int)
4492 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4493#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004494 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00004495 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004496#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004497}
4498
Anton Yartsev9e968982010-08-19 03:00:09 +00004499vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004500vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004501{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004502#ifdef __LITTLE_ENDIAN__
4503 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4504 255,255,255,255,255,255,255,255};
4505 __d = vec_xor(__c, __d);
4506 return (vector bool int)
4507 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4508#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004509 return (vector bool int)
David Blaikie3302f2b2013-01-16 23:08:36 +00004510 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004511#endif
Anton Yartsev9e968982010-08-19 03:00:09 +00004512}
4513
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004514vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004515vec_perm(vector float __a, vector float __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004516{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004517#ifdef __LITTLE_ENDIAN__
4518 vector unsigned char __d = {255,255,255,255,255,255,255,255,
4519 255,255,255,255,255,255,255,255};
4520 __d = vec_xor(__c, __d);
4521 return (vector float)
4522 __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d);
4523#else
Anton Yartsev79d6af32010-09-18 00:39:16 +00004524 return (vector float)
David Blaikie3302f2b2013-01-16 23:08:36 +00004525 __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c);
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004526#endif
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004527}
4528
4529/* vec_vperm */
4530
Ulrich Weigand9936f132012-10-31 18:17:07 +00004531static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004532vec_vperm(vector signed char __a, vector signed char __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004533{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004534 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004535}
4536
Ulrich Weigand9936f132012-10-31 18:17:07 +00004537static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004538vec_vperm(vector unsigned char __a,
4539 vector unsigned char __b,
4540 vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004541{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004542 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004543}
4544
Ulrich Weigand9936f132012-10-31 18:17:07 +00004545static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004546vec_vperm(vector bool char __a, vector bool char __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004547{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004548 return vec_perm(__a, __b, __c);
Anton Yartsev9e968982010-08-19 03:00:09 +00004549}
4550
Ulrich Weigand9936f132012-10-31 18:17:07 +00004551static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004552vec_vperm(vector short __a, vector short __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004553{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004554 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004555}
4556
Ulrich Weigand9936f132012-10-31 18:17:07 +00004557static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004558vec_vperm(vector unsigned short __a,
4559 vector unsigned short __b,
4560 vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004561{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004562 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004563}
4564
Ulrich Weigand9936f132012-10-31 18:17:07 +00004565static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004566vec_vperm(vector bool short __a, vector bool short __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004567{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004568 return vec_perm(__a, __b, __c);
Anton Yartsev9e968982010-08-19 03:00:09 +00004569}
4570
Ulrich Weigand9936f132012-10-31 18:17:07 +00004571static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004572vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004573{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004574 return vec_perm(__a, __b, __c);
Anton Yartsev9e968982010-08-19 03:00:09 +00004575}
4576
Ulrich Weigand9936f132012-10-31 18:17:07 +00004577static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004578vec_vperm(vector int __a, vector int __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004579{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004580 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004581}
4582
Ulrich Weigand9936f132012-10-31 18:17:07 +00004583static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004584vec_vperm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004585{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004586 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004587}
4588
Ulrich Weigand9936f132012-10-31 18:17:07 +00004589static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004590vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00004591{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004592 return vec_perm(__a, __b, __c);
Anton Yartsev9e968982010-08-19 03:00:09 +00004593}
4594
Ulrich Weigand9936f132012-10-31 18:17:07 +00004595static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004596vec_vperm(vector float __a, vector float __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004597{
Bill Schmidtf7e289c2014-06-05 19:07:40 +00004598 return vec_perm(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004599}
4600
4601/* vec_re */
4602
Ulrich Weigand9936f132012-10-31 18:17:07 +00004603static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004604vec_re(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004605{
David Blaikie3302f2b2013-01-16 23:08:36 +00004606 return __builtin_altivec_vrefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004607}
4608
4609/* vec_vrefp */
4610
Ulrich Weigand9936f132012-10-31 18:17:07 +00004611static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004612vec_vrefp(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004613{
David Blaikie3302f2b2013-01-16 23:08:36 +00004614 return __builtin_altivec_vrefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004615}
4616
4617/* vec_rl */
4618
4619static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004620vec_rl(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004621{
David Blaikie3302f2b2013-01-16 23:08:36 +00004622 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004623}
4624
4625static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004626vec_rl(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004627{
David Blaikie3302f2b2013-01-16 23:08:36 +00004628 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004629}
4630
4631static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004632vec_rl(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004633{
David Blaikie3302f2b2013-01-16 23:08:36 +00004634 return __builtin_altivec_vrlh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004635}
4636
4637static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004638vec_rl(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004639{
David Blaikie3302f2b2013-01-16 23:08:36 +00004640 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004641}
4642
4643static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004644vec_rl(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004645{
David Blaikie3302f2b2013-01-16 23:08:36 +00004646 return __builtin_altivec_vrlw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004647}
4648
4649static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004650vec_rl(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004651{
David Blaikie3302f2b2013-01-16 23:08:36 +00004652 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004653}
4654
4655/* vec_vrlb */
4656
4657static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004658vec_vrlb(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004659{
David Blaikie3302f2b2013-01-16 23:08:36 +00004660 return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004661}
4662
4663static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004664vec_vrlb(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004665{
David Blaikie3302f2b2013-01-16 23:08:36 +00004666 return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004667}
4668
4669/* vec_vrlh */
4670
4671static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004672vec_vrlh(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004673{
David Blaikie3302f2b2013-01-16 23:08:36 +00004674 return __builtin_altivec_vrlh(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004675}
4676
4677static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004678vec_vrlh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004679{
David Blaikie3302f2b2013-01-16 23:08:36 +00004680 return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004681}
4682
4683/* vec_vrlw */
4684
4685static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004686vec_vrlw(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004687{
David Blaikie3302f2b2013-01-16 23:08:36 +00004688 return __builtin_altivec_vrlw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004689}
4690
4691static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004692vec_vrlw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004693{
David Blaikie3302f2b2013-01-16 23:08:36 +00004694 return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004695}
4696
4697/* vec_round */
4698
4699static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004700vec_round(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004701{
David Blaikie3302f2b2013-01-16 23:08:36 +00004702 return __builtin_altivec_vrfin(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004703}
4704
4705/* vec_vrfin */
4706
4707static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004708vec_vrfin(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004709{
David Blaikie3302f2b2013-01-16 23:08:36 +00004710 return __builtin_altivec_vrfin(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004711}
4712
4713/* vec_rsqrte */
4714
4715static __vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004716vec_rsqrte(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004717{
David Blaikie3302f2b2013-01-16 23:08:36 +00004718 return __builtin_altivec_vrsqrtefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004719}
4720
4721/* vec_vrsqrtefp */
4722
4723static __vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00004724vec_vrsqrtefp(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004725{
David Blaikie3302f2b2013-01-16 23:08:36 +00004726 return __builtin_altivec_vrsqrtefp(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004727}
4728
4729/* vec_sel */
4730
4731#define __builtin_altivec_vsel_4si vec_sel
4732
4733static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004734vec_sel(vector signed char __a, vector signed char __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004735{
David Blaikie3302f2b2013-01-16 23:08:36 +00004736 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004737}
4738
Anton Yartsevfc83c602010-08-19 03:21:36 +00004739static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004740vec_sel(vector signed char __a, vector signed char __b, vector bool char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004741{
David Blaikie3302f2b2013-01-16 23:08:36 +00004742 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004743}
4744
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004745static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004746vec_sel(vector unsigned char __a, vector unsigned char __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004747{
David Blaikie3302f2b2013-01-16 23:08:36 +00004748 return (__a & ~__c) | (__b & __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004749}
4750
Anton Yartsevfc83c602010-08-19 03:21:36 +00004751static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004752vec_sel(vector unsigned char __a, vector unsigned char __b, vector bool char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004753{
David Blaikie3302f2b2013-01-16 23:08:36 +00004754 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004755}
4756
4757static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004758vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004759{
David Blaikie3302f2b2013-01-16 23:08:36 +00004760 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004761}
4762
4763static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004764vec_sel(vector bool char __a, vector bool char __b, vector bool char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004765{
David Blaikie3302f2b2013-01-16 23:08:36 +00004766 return (__a & ~__c) | (__b & __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004767}
4768
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004769static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004770vec_sel(vector short __a, vector short __b, vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004771{
David Blaikie3302f2b2013-01-16 23:08:36 +00004772 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004773}
4774
Anton Yartsevfc83c602010-08-19 03:21:36 +00004775static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004776vec_sel(vector short __a, vector short __b, vector bool short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004777{
David Blaikie3302f2b2013-01-16 23:08:36 +00004778 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004779}
4780
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004781static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004782vec_sel(vector unsigned short __a,
4783 vector unsigned short __b,
4784 vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004785{
David Blaikie3302f2b2013-01-16 23:08:36 +00004786 return (__a & ~__c) | (__b & __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004787}
4788
Anton Yartsevfc83c602010-08-19 03:21:36 +00004789static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004790vec_sel(vector unsigned short __a, vector unsigned short __b, vector bool short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004791{
David Blaikie3302f2b2013-01-16 23:08:36 +00004792 return (__a & ~(vector unsigned short)__c) | (__b & (vector unsigned short)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004793}
4794
4795static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004796vec_sel(vector bool short __a, vector bool short __b, vector unsigned short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004797{
David Blaikie3302f2b2013-01-16 23:08:36 +00004798 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004799}
4800
4801static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004802vec_sel(vector bool short __a, vector bool short __b, vector bool short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004803{
David Blaikie3302f2b2013-01-16 23:08:36 +00004804 return (__a & ~__c) | (__b & __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004805}
4806
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004807static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004808vec_sel(vector int __a, vector int __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004809{
David Blaikie3302f2b2013-01-16 23:08:36 +00004810 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004811}
4812
Anton Yartsevfc83c602010-08-19 03:21:36 +00004813static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004814vec_sel(vector int __a, vector int __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004815{
David Blaikie3302f2b2013-01-16 23:08:36 +00004816 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004817}
4818
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004819static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004820vec_sel(vector unsigned int __a, vector unsigned int __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004821{
David Blaikie3302f2b2013-01-16 23:08:36 +00004822 return (__a & ~__c) | (__b & __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004823}
4824
Anton Yartsevfc83c602010-08-19 03:21:36 +00004825static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004826vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004827{
David Blaikie3302f2b2013-01-16 23:08:36 +00004828 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004829}
4830
4831static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004832vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004833{
David Blaikie3302f2b2013-01-16 23:08:36 +00004834 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004835}
4836
4837static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004838vec_sel(vector bool int __a, vector bool int __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004839{
David Blaikie3302f2b2013-01-16 23:08:36 +00004840 return (__a & ~__c) | (__b & __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004841}
4842
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004843static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004844vec_sel(vector float __a, vector float __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004845{
David Blaikie3302f2b2013-01-16 23:08:36 +00004846 vector int __res = ((vector int)__a & ~(vector int)__c)
4847 | ((vector int)__b & (vector int)__c);
4848 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004849}
4850
Anton Yartsevfc83c602010-08-19 03:21:36 +00004851static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004852vec_sel(vector float __a, vector float __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004853{
David Blaikie3302f2b2013-01-16 23:08:36 +00004854 vector int __res = ((vector int)__a & ~(vector int)__c)
4855 | ((vector int)__b & (vector int)__c);
4856 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004857}
4858
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004859/* vec_vsel */
4860
4861static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004862vec_vsel(vector signed char __a, vector signed char __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004863{
David Blaikie3302f2b2013-01-16 23:08:36 +00004864 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004865}
4866
Anton Yartsevfc83c602010-08-19 03:21:36 +00004867static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004868vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004869{
David Blaikie3302f2b2013-01-16 23:08:36 +00004870 return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004871}
4872
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004873static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004874vec_vsel(vector unsigned char __a, vector unsigned char __b, vector unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004875{
David Blaikie3302f2b2013-01-16 23:08:36 +00004876 return (__a & ~__c) | (__b & __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004877}
4878
Anton Yartsevfc83c602010-08-19 03:21:36 +00004879static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004880vec_vsel(vector unsigned char __a, vector unsigned char __b, vector bool char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004881{
David Blaikie3302f2b2013-01-16 23:08:36 +00004882 return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004883}
4884
4885static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004886vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004887{
David Blaikie3302f2b2013-01-16 23:08:36 +00004888 return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004889}
4890
4891static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004892vec_vsel(vector bool char __a, vector bool char __b, vector bool char __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004893{
David Blaikie3302f2b2013-01-16 23:08:36 +00004894 return (__a & ~__c) | (__b & __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004895}
4896
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004897static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004898vec_vsel(vector short __a, vector short __b, vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004899{
David Blaikie3302f2b2013-01-16 23:08:36 +00004900 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004901}
4902
Anton Yartsevfc83c602010-08-19 03:21:36 +00004903static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004904vec_vsel(vector short __a, vector short __b, vector bool short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004905{
David Blaikie3302f2b2013-01-16 23:08:36 +00004906 return (__a & ~(vector short)__c) | (__b & (vector short)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004907}
4908
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004909static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004910vec_vsel(vector unsigned short __a,
4911 vector unsigned short __b,
4912 vector unsigned short __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004913{
David Blaikie3302f2b2013-01-16 23:08:36 +00004914 return (__a & ~__c) | (__b & __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004915}
4916
Anton Yartsevfc83c602010-08-19 03:21:36 +00004917static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004918vec_vsel(vector unsigned short __a, vector unsigned short __b, vector bool short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004919{
David Blaikie3302f2b2013-01-16 23:08:36 +00004920 return (__a & ~(vector unsigned short)__c) | (__b & (vector unsigned short)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004921}
4922
4923static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004924vec_vsel(vector bool short __a, vector bool short __b, vector unsigned short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004925{
David Blaikie3302f2b2013-01-16 23:08:36 +00004926 return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004927}
4928
4929static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004930vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004931{
David Blaikie3302f2b2013-01-16 23:08:36 +00004932 return (__a & ~__c) | (__b & __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004933}
4934
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004935static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004936vec_vsel(vector int __a, vector int __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004937{
David Blaikie3302f2b2013-01-16 23:08:36 +00004938 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004939}
4940
Anton Yartsevfc83c602010-08-19 03:21:36 +00004941static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004942vec_vsel(vector int __a, vector int __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004943{
David Blaikie3302f2b2013-01-16 23:08:36 +00004944 return (__a & ~(vector int)__c) | (__b & (vector int)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004945}
4946
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004947static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004948vec_vsel(vector unsigned int __a, vector unsigned int __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004949{
David Blaikie3302f2b2013-01-16 23:08:36 +00004950 return (__a & ~__c) | (__b & __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004951}
4952
Anton Yartsevfc83c602010-08-19 03:21:36 +00004953static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004954vec_vsel(vector unsigned int __a, vector unsigned int __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004955{
David Blaikie3302f2b2013-01-16 23:08:36 +00004956 return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004957}
4958
4959static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004960vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004961{
David Blaikie3302f2b2013-01-16 23:08:36 +00004962 return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004963}
4964
4965static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004966vec_vsel(vector bool int __a, vector bool int __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004967{
David Blaikie3302f2b2013-01-16 23:08:36 +00004968 return (__a & ~__c) | (__b & __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00004969}
4970
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004971static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004972vec_vsel(vector float __a, vector float __b, vector unsigned int __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004973{
David Blaikie3302f2b2013-01-16 23:08:36 +00004974 vector int __res = ((vector int)__a & ~(vector int)__c)
4975 | ((vector int)__b & (vector int)__c);
4976 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004977}
4978
Anton Yartsevfc83c602010-08-19 03:21:36 +00004979static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004980vec_vsel(vector float __a, vector float __b, vector bool int __c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00004981{
David Blaikie3302f2b2013-01-16 23:08:36 +00004982 vector int __res = ((vector int)__a & ~(vector int)__c)
4983 | ((vector int)__b & (vector int)__c);
4984 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00004985}
4986
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004987/* vec_sl */
4988
4989static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004990vec_sl(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004991{
David Blaikie3302f2b2013-01-16 23:08:36 +00004992 return __a << (vector signed char)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004993}
4994
4995static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00004996vec_sl(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004997{
David Blaikie3302f2b2013-01-16 23:08:36 +00004998 return __a << __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00004999}
5000
5001static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005002vec_sl(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005003{
David Blaikie3302f2b2013-01-16 23:08:36 +00005004 return __a << (vector short)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005005}
5006
5007static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005008vec_sl(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005009{
David Blaikie3302f2b2013-01-16 23:08:36 +00005010 return __a << __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005011}
5012
5013static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005014vec_sl(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005015{
David Blaikie3302f2b2013-01-16 23:08:36 +00005016 return __a << (vector int)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005017}
5018
5019static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005020vec_sl(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005021{
David Blaikie3302f2b2013-01-16 23:08:36 +00005022 return __a << __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005023}
5024
5025/* vec_vslb */
5026
5027#define __builtin_altivec_vslb vec_vslb
5028
5029static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005030vec_vslb(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005031{
David Blaikie3302f2b2013-01-16 23:08:36 +00005032 return vec_sl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005033}
5034
5035static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005036vec_vslb(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005037{
David Blaikie3302f2b2013-01-16 23:08:36 +00005038 return vec_sl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005039}
5040
5041/* vec_vslh */
5042
5043#define __builtin_altivec_vslh vec_vslh
5044
5045static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005046vec_vslh(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005047{
David Blaikie3302f2b2013-01-16 23:08:36 +00005048 return vec_sl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005049}
5050
5051static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005052vec_vslh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005053{
David Blaikie3302f2b2013-01-16 23:08:36 +00005054 return vec_sl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005055}
5056
5057/* vec_vslw */
5058
5059#define __builtin_altivec_vslw vec_vslw
5060
5061static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005062vec_vslw(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005063{
David Blaikie3302f2b2013-01-16 23:08:36 +00005064 return vec_sl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005065}
5066
5067static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005068vec_vslw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005069{
David Blaikie3302f2b2013-01-16 23:08:36 +00005070 return vec_sl(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005071}
5072
5073/* vec_sld */
5074
5075#define __builtin_altivec_vsldoi_4si vec_sld
5076
5077static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005078vec_sld(vector signed char __a, vector signed char __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005079{
David Blaikie3302f2b2013-01-16 23:08:36 +00005080 return vec_perm(__a, __b, (vector unsigned char)
5081 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5082 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005083}
5084
5085static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005086vec_sld(vector unsigned char __a, vector unsigned char __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005087{
David Blaikie3302f2b2013-01-16 23:08:36 +00005088 return vec_perm(__a, __b, (vector unsigned char)
5089 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5090 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005091}
5092
5093static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005094vec_sld(vector short __a, vector short __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005095{
David Blaikie3302f2b2013-01-16 23:08:36 +00005096 return vec_perm(__a, __b, (vector unsigned char)
5097 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5098 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005099}
5100
5101static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005102vec_sld(vector unsigned short __a, vector unsigned short __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005103{
David Blaikie3302f2b2013-01-16 23:08:36 +00005104 return vec_perm(__a, __b, (vector unsigned char)
5105 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5106 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Yartsev9e968982010-08-19 03:00:09 +00005107}
5108
5109static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005110vec_sld(vector pixel __a, vector pixel __b, unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00005111{
David Blaikie3302f2b2013-01-16 23:08:36 +00005112 return vec_perm(__a, __b, (vector unsigned char)
5113 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5114 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005115}
5116
5117static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005118vec_sld(vector int __a, vector int __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005119{
David Blaikie3302f2b2013-01-16 23:08:36 +00005120 return vec_perm(__a, __b, (vector unsigned char)
5121 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5122 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005123}
5124
5125static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005126vec_sld(vector unsigned int __a, vector unsigned int __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005127{
David Blaikie3302f2b2013-01-16 23:08:36 +00005128 return vec_perm(__a, __b, (vector unsigned char)
5129 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5130 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005131}
5132
5133static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005134vec_sld(vector float __a, vector float __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005135{
David Blaikie3302f2b2013-01-16 23:08:36 +00005136 return vec_perm(__a, __b, (vector unsigned char)
5137 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5138 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005139}
5140
5141/* vec_vsldoi */
5142
5143static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005144vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005145{
David Blaikie3302f2b2013-01-16 23:08:36 +00005146 return vec_perm(__a, __b, (vector unsigned char)
5147 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5148 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005149}
5150
5151static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005152vec_vsldoi(vector unsigned char __a, vector unsigned char __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005153{
David Blaikie3302f2b2013-01-16 23:08:36 +00005154 return vec_perm(__a, __b, (vector unsigned char)
5155 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5156 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005157}
5158
5159static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005160vec_vsldoi(vector short __a, vector short __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005161{
David Blaikie3302f2b2013-01-16 23:08:36 +00005162 return vec_perm(__a, __b, (vector unsigned char)
5163 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5164 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005165}
5166
5167static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005168vec_vsldoi(vector unsigned short __a, vector unsigned short __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005169{
David Blaikie3302f2b2013-01-16 23:08:36 +00005170 return vec_perm(__a, __b, (vector unsigned char)
5171 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5172 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Yartsev9e968982010-08-19 03:00:09 +00005173}
5174
5175static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005176vec_vsldoi(vector pixel __a, vector pixel __b, unsigned char __c)
Anton Yartsev9e968982010-08-19 03:00:09 +00005177{
David Blaikie3302f2b2013-01-16 23:08:36 +00005178 return vec_perm(__a, __b, (vector unsigned char)
5179 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5180 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005181}
5182
5183static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005184vec_vsldoi(vector int __a, vector int __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005185{
David Blaikie3302f2b2013-01-16 23:08:36 +00005186 return vec_perm(__a, __b, (vector unsigned char)
5187 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5188 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005189}
5190
5191static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005192vec_vsldoi(vector unsigned int __a, vector unsigned int __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005193{
David Blaikie3302f2b2013-01-16 23:08:36 +00005194 return vec_perm(__a, __b, (vector unsigned char)
5195 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5196 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005197}
5198
5199static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005200vec_vsldoi(vector float __a, vector float __b, unsigned char __c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005201{
David Blaikie3302f2b2013-01-16 23:08:36 +00005202 return vec_perm(__a, __b, (vector unsigned char)
5203 (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7,
5204 __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005205}
5206
5207/* vec_sll */
5208
5209static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005210vec_sll(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005211{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005212 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005213 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005214}
5215
5216static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005217vec_sll(vector signed char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005218{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005219 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005220 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005221}
5222
5223static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005224vec_sll(vector signed char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005225{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005226 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005227 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005228}
5229
5230static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005231vec_sll(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005232{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005233 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005234 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005235}
5236
5237static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005238vec_sll(vector unsigned char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005239{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005240 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005241 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005242}
5243
5244static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005245vec_sll(vector unsigned char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005246{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005247 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005248 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005249}
5250
Anton Yartsevfc83c602010-08-19 03:21:36 +00005251static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005252vec_sll(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005253{
David Blaikie3302f2b2013-01-16 23:08:36 +00005254 return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005255}
5256
5257static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005258vec_sll(vector bool char __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005259{
David Blaikie3302f2b2013-01-16 23:08:36 +00005260 return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005261}
5262
5263static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005264vec_sll(vector bool char __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005265{
David Blaikie3302f2b2013-01-16 23:08:36 +00005266 return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005267}
5268
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005269static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005270vec_sll(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005271{
David Blaikie3302f2b2013-01-16 23:08:36 +00005272 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005273}
5274
5275static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005276vec_sll(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005277{
David Blaikie3302f2b2013-01-16 23:08:36 +00005278 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005279}
5280
5281static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005282vec_sll(vector short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005283{
David Blaikie3302f2b2013-01-16 23:08:36 +00005284 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005285}
5286
5287static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005288vec_sll(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005289{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005290 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005291 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005292}
5293
5294static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005295vec_sll(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005296{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005297 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005298 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005299}
5300
5301static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005302vec_sll(vector unsigned short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005303{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005304 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005305 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005306}
5307
Anton Yartsevfc83c602010-08-19 03:21:36 +00005308static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005309vec_sll(vector bool short __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005310{
David Blaikie3302f2b2013-01-16 23:08:36 +00005311 return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005312}
5313
5314static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005315vec_sll(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005316{
David Blaikie3302f2b2013-01-16 23:08:36 +00005317 return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005318}
5319
5320static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005321vec_sll(vector bool short __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005322{
David Blaikie3302f2b2013-01-16 23:08:36 +00005323 return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005324}
5325
5326static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005327vec_sll(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005328{
David Blaikie3302f2b2013-01-16 23:08:36 +00005329 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005330}
5331
5332static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005333vec_sll(vector pixel __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005334{
David Blaikie3302f2b2013-01-16 23:08:36 +00005335 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005336}
5337
5338static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005339vec_sll(vector pixel __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005340{
David Blaikie3302f2b2013-01-16 23:08:36 +00005341 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005342}
5343
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005344static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005345vec_sll(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005346{
David Blaikie3302f2b2013-01-16 23:08:36 +00005347 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005348}
5349
5350static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005351vec_sll(vector int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005352{
David Blaikie3302f2b2013-01-16 23:08:36 +00005353 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005354}
5355
5356static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005357vec_sll(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005358{
David Blaikie3302f2b2013-01-16 23:08:36 +00005359 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005360}
5361
5362static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005363vec_sll(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005364{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005365 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005366 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005367}
5368
5369static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005370vec_sll(vector unsigned int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005371{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005372 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005373 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005374}
5375
5376static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005377vec_sll(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005378{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005379 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005380 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005381}
5382
Anton Yartsevfc83c602010-08-19 03:21:36 +00005383static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005384vec_sll(vector bool int __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005385{
David Blaikie3302f2b2013-01-16 23:08:36 +00005386 return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005387}
5388
5389static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005390vec_sll(vector bool int __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005391{
David Blaikie3302f2b2013-01-16 23:08:36 +00005392 return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005393}
5394
5395static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005396vec_sll(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005397{
David Blaikie3302f2b2013-01-16 23:08:36 +00005398 return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005399}
5400
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005401/* vec_vsl */
5402
5403static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005404vec_vsl(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005405{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005406 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005407 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005408}
5409
5410static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005411vec_vsl(vector signed char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005412{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005413 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005414 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005415}
5416
5417static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005418vec_vsl(vector signed char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005419{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005420 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005421 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005422}
5423
5424static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005425vec_vsl(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005426{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005427 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005428 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005429}
5430
5431static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005432vec_vsl(vector unsigned char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005433{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005434 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005435 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005436}
5437
5438static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005439vec_vsl(vector unsigned char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005440{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005441 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005442 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005443}
5444
Anton Yartsevfc83c602010-08-19 03:21:36 +00005445static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005446vec_vsl(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005447{
David Blaikie3302f2b2013-01-16 23:08:36 +00005448 return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005449}
5450
5451static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005452vec_vsl(vector bool char __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005453{
David Blaikie3302f2b2013-01-16 23:08:36 +00005454 return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005455}
5456
5457static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005458vec_vsl(vector bool char __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005459{
David Blaikie3302f2b2013-01-16 23:08:36 +00005460 return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005461}
5462
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005463static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005464vec_vsl(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005465{
David Blaikie3302f2b2013-01-16 23:08:36 +00005466 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005467}
5468
5469static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005470vec_vsl(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005471{
David Blaikie3302f2b2013-01-16 23:08:36 +00005472 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005473}
5474
5475static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005476vec_vsl(vector short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005477{
David Blaikie3302f2b2013-01-16 23:08:36 +00005478 return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005479}
5480
5481static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005482vec_vsl(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005483{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005484 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005485 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005486}
5487
5488static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005489vec_vsl(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005490{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005491 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005492 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005493}
5494
5495static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005496vec_vsl(vector unsigned short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005497{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005498 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005499 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005500}
5501
Anton Yartsevfc83c602010-08-19 03:21:36 +00005502static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005503vec_vsl(vector bool short __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005504{
David Blaikie3302f2b2013-01-16 23:08:36 +00005505 return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005506}
5507
5508static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005509vec_vsl(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005510{
David Blaikie3302f2b2013-01-16 23:08:36 +00005511 return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005512}
5513
5514static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005515vec_vsl(vector bool short __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005516{
David Blaikie3302f2b2013-01-16 23:08:36 +00005517 return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005518}
5519
5520static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005521vec_vsl(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005522{
David Blaikie3302f2b2013-01-16 23:08:36 +00005523 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005524}
5525
5526static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005527vec_vsl(vector pixel __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005528{
David Blaikie3302f2b2013-01-16 23:08:36 +00005529 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005530}
5531
5532static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005533vec_vsl(vector pixel __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005534{
David Blaikie3302f2b2013-01-16 23:08:36 +00005535 return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005536}
5537
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005538static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005539vec_vsl(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005540{
David Blaikie3302f2b2013-01-16 23:08:36 +00005541 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005542}
5543
5544static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005545vec_vsl(vector int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005546{
David Blaikie3302f2b2013-01-16 23:08:36 +00005547 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005548}
5549
5550static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005551vec_vsl(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005552{
David Blaikie3302f2b2013-01-16 23:08:36 +00005553 return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005554}
5555
5556static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005557vec_vsl(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005558{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005559 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005560 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005561}
5562
5563static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005564vec_vsl(vector unsigned int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005565{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005566 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005567 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005568}
5569
5570static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005571vec_vsl(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005572{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005573 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005574 __builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005575}
5576
Anton Yartsevfc83c602010-08-19 03:21:36 +00005577static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005578vec_vsl(vector bool int __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005579{
David Blaikie3302f2b2013-01-16 23:08:36 +00005580 return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005581}
5582
5583static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005584vec_vsl(vector bool int __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005585{
David Blaikie3302f2b2013-01-16 23:08:36 +00005586 return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005587}
5588
5589static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005590vec_vsl(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005591{
David Blaikie3302f2b2013-01-16 23:08:36 +00005592 return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005593}
5594
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005595/* vec_slo */
5596
5597static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005598vec_slo(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005599{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005600 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005601 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005602}
5603
5604static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005605vec_slo(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005606{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005607 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005608 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005609}
5610
5611static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005612vec_slo(vector unsigned char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005613{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005614 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005615 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005616}
5617
5618static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005619vec_slo(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005620{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005621 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005622 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005623}
5624
5625static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005626vec_slo(vector short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005627{
David Blaikie3302f2b2013-01-16 23:08:36 +00005628 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005629}
5630
5631static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005632vec_slo(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005633{
David Blaikie3302f2b2013-01-16 23:08:36 +00005634 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005635}
5636
5637static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005638vec_slo(vector unsigned short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005639{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005640 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005641 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005642}
5643
5644static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005645vec_slo(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005646{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005647 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005648 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005649}
5650
Anton Yartsevfc83c602010-08-19 03:21:36 +00005651static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005652vec_slo(vector pixel __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005653{
David Blaikie3302f2b2013-01-16 23:08:36 +00005654 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005655}
5656
5657static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005658vec_slo(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005659{
David Blaikie3302f2b2013-01-16 23:08:36 +00005660 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005661}
5662
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005663static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005664vec_slo(vector int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005665{
David Blaikie3302f2b2013-01-16 23:08:36 +00005666 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005667}
5668
5669static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005670vec_slo(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005671{
David Blaikie3302f2b2013-01-16 23:08:36 +00005672 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005673}
5674
5675static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005676vec_slo(vector unsigned int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005677{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005678 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005679 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005680}
5681
5682static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005683vec_slo(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005684{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005685 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005686 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005687}
5688
5689static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005690vec_slo(vector float __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005691{
David Blaikie3302f2b2013-01-16 23:08:36 +00005692 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005693}
5694
5695static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005696vec_slo(vector float __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005697{
David Blaikie3302f2b2013-01-16 23:08:36 +00005698 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005699}
5700
5701/* vec_vslo */
5702
5703static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005704vec_vslo(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005705{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005706 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005707 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005708}
5709
5710static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005711vec_vslo(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005712{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005713 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005714 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005715}
5716
5717static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005718vec_vslo(vector unsigned char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005719{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005720 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005721 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005722}
5723
5724static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005725vec_vslo(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005726{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005727 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00005728 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005729}
5730
5731static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005732vec_vslo(vector short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005733{
David Blaikie3302f2b2013-01-16 23:08:36 +00005734 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005735}
5736
5737static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005738vec_vslo(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005739{
David Blaikie3302f2b2013-01-16 23:08:36 +00005740 return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005741}
5742
5743static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005744vec_vslo(vector unsigned short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005745{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005746 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005747 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005748}
5749
5750static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005751vec_vslo(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005752{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005753 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00005754 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005755}
5756
Anton Yartsevfc83c602010-08-19 03:21:36 +00005757static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005758vec_vslo(vector pixel __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005759{
David Blaikie3302f2b2013-01-16 23:08:36 +00005760 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005761}
5762
5763static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005764vec_vslo(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00005765{
David Blaikie3302f2b2013-01-16 23:08:36 +00005766 return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00005767}
5768
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005769static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005770vec_vslo(vector int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005771{
David Blaikie3302f2b2013-01-16 23:08:36 +00005772 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005773}
5774
5775static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005776vec_vslo(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005777{
David Blaikie3302f2b2013-01-16 23:08:36 +00005778 return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005779}
5780
5781static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005782vec_vslo(vector unsigned int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005783{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005784 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005785 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005786}
5787
5788static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005789vec_vslo(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005790{
Anton Yartsev79d6af32010-09-18 00:39:16 +00005791 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00005792 __builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005793}
5794
5795static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005796vec_vslo(vector float __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005797{
David Blaikie3302f2b2013-01-16 23:08:36 +00005798 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005799}
5800
5801static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005802vec_vslo(vector float __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005803{
David Blaikie3302f2b2013-01-16 23:08:36 +00005804 return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005805}
5806
5807/* vec_splat */
5808
5809static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005810vec_splat(vector signed char __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005811{
David Blaikie3302f2b2013-01-16 23:08:36 +00005812 return vec_perm(__a, __a, (vector unsigned char)(__b));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005813}
5814
5815static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005816vec_splat(vector unsigned char __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005817{
David Blaikie3302f2b2013-01-16 23:08:36 +00005818 return vec_perm(__a, __a, (vector unsigned char)(__b));
Anton Yartsev9e968982010-08-19 03:00:09 +00005819}
5820
5821static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005822vec_splat(vector bool char __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005823{
David Blaikie3302f2b2013-01-16 23:08:36 +00005824 return vec_perm(__a, __a, (vector unsigned char)(__b));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005825}
5826
5827static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005828vec_splat(vector short __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005829{
David Blaikie3302f2b2013-01-16 23:08:36 +00005830 __b *= 2;
5831 unsigned char b1=__b+1;
5832 return vec_perm(__a, __a, (vector unsigned char)
5833 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005834}
5835
5836static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005837vec_splat(vector unsigned short __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005838{
David Blaikie3302f2b2013-01-16 23:08:36 +00005839 __b *= 2;
5840 unsigned char b1=__b+1;
5841 return vec_perm(__a, __a, (vector unsigned char)
5842 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Yartsev9e968982010-08-19 03:00:09 +00005843}
5844
5845static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005846vec_splat(vector bool short __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005847{
David Blaikie3302f2b2013-01-16 23:08:36 +00005848 __b *= 2;
5849 unsigned char b1=__b+1;
5850 return vec_perm(__a, __a, (vector unsigned char)
5851 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Yartsev9e968982010-08-19 03:00:09 +00005852}
5853
5854static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005855vec_splat(vector pixel __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005856{
David Blaikie3302f2b2013-01-16 23:08:36 +00005857 __b *= 2;
5858 unsigned char b1=__b+1;
5859 return vec_perm(__a, __a, (vector unsigned char)
5860 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005861}
5862
5863static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005864vec_splat(vector int __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005865{
David Blaikie3302f2b2013-01-16 23:08:36 +00005866 __b *= 4;
5867 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5868 return vec_perm(__a, __a, (vector unsigned char)
5869 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005870}
5871
5872static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005873vec_splat(vector unsigned int __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005874{
David Blaikie3302f2b2013-01-16 23:08:36 +00005875 __b *= 4;
5876 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5877 return vec_perm(__a, __a, (vector unsigned char)
5878 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Yartsev9e968982010-08-19 03:00:09 +00005879}
5880
5881static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005882vec_splat(vector bool int __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005883{
David Blaikie3302f2b2013-01-16 23:08:36 +00005884 __b *= 4;
5885 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5886 return vec_perm(__a, __a, (vector unsigned char)
5887 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005888}
5889
5890static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005891vec_splat(vector float __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005892{
David Blaikie3302f2b2013-01-16 23:08:36 +00005893 __b *= 4;
5894 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5895 return vec_perm(__a, __a, (vector unsigned char)
5896 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005897}
5898
5899/* vec_vspltb */
5900
5901#define __builtin_altivec_vspltb vec_vspltb
5902
5903static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005904vec_vspltb(vector signed char __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005905{
David Blaikie3302f2b2013-01-16 23:08:36 +00005906 return vec_perm(__a, __a, (vector unsigned char)(__b));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005907}
5908
5909static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005910vec_vspltb(vector unsigned char __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005911{
David Blaikie3302f2b2013-01-16 23:08:36 +00005912 return vec_perm(__a, __a, (vector unsigned char)(__b));
Anton Yartsev9e968982010-08-19 03:00:09 +00005913}
5914
5915static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005916vec_vspltb(vector bool char __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005917{
David Blaikie3302f2b2013-01-16 23:08:36 +00005918 return vec_perm(__a, __a, (vector unsigned char)(__b));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005919}
5920
5921/* vec_vsplth */
5922
5923#define __builtin_altivec_vsplth vec_vsplth
5924
5925static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005926vec_vsplth(vector short __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005927{
David Blaikie3302f2b2013-01-16 23:08:36 +00005928 __b *= 2;
5929 unsigned char b1=__b+1;
5930 return vec_perm(__a, __a, (vector unsigned char)
5931 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005932}
5933
5934static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005935vec_vsplth(vector unsigned short __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005936{
David Blaikie3302f2b2013-01-16 23:08:36 +00005937 __b *= 2;
5938 unsigned char b1=__b+1;
5939 return vec_perm(__a, __a, (vector unsigned char)
5940 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Yartsev9e968982010-08-19 03:00:09 +00005941}
5942
5943static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005944vec_vsplth(vector bool short __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005945{
David Blaikie3302f2b2013-01-16 23:08:36 +00005946 __b *= 2;
5947 unsigned char b1=__b+1;
5948 return vec_perm(__a, __a, (vector unsigned char)
5949 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Yartsev9e968982010-08-19 03:00:09 +00005950}
5951
5952static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005953vec_vsplth(vector pixel __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005954{
David Blaikie3302f2b2013-01-16 23:08:36 +00005955 __b *= 2;
5956 unsigned char b1=__b+1;
5957 return vec_perm(__a, __a, (vector unsigned char)
5958 (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005959}
5960
5961/* vec_vspltw */
5962
5963#define __builtin_altivec_vspltw vec_vspltw
5964
5965static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005966vec_vspltw(vector int __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005967{
David Blaikie3302f2b2013-01-16 23:08:36 +00005968 __b *= 4;
5969 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5970 return vec_perm(__a, __a, (vector unsigned char)
5971 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005972}
5973
5974static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005975vec_vspltw(vector unsigned int __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005976{
David Blaikie3302f2b2013-01-16 23:08:36 +00005977 __b *= 4;
5978 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5979 return vec_perm(__a, __a, (vector unsigned char)
5980 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Yartsev9e968982010-08-19 03:00:09 +00005981}
5982
5983static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005984vec_vspltw(vector bool int __a, unsigned char __b)
Anton Yartsev9e968982010-08-19 03:00:09 +00005985{
David Blaikie3302f2b2013-01-16 23:08:36 +00005986 __b *= 4;
5987 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5988 return vec_perm(__a, __a, (vector unsigned char)
5989 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005990}
5991
5992static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00005993vec_vspltw(vector float __a, unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005994{
David Blaikie3302f2b2013-01-16 23:08:36 +00005995 __b *= 4;
5996 unsigned char b1=__b+1, b2=__b+2, b3=__b+3;
5997 return vec_perm(__a, __a, (vector unsigned char)
5998 (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3));
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00005999}
6000
6001/* vec_splat_s8 */
6002
6003#define __builtin_altivec_vspltisb vec_splat_s8
6004
6005// FIXME: parameter should be treated as 5-bit signed literal
6006static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006007vec_splat_s8(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006008{
David Blaikie3302f2b2013-01-16 23:08:36 +00006009 return (vector signed char)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006010}
6011
6012/* vec_vspltisb */
6013
6014// FIXME: parameter should be treated as 5-bit signed literal
6015static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006016vec_vspltisb(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006017{
David Blaikie3302f2b2013-01-16 23:08:36 +00006018 return (vector signed char)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006019}
6020
6021/* vec_splat_s16 */
6022
6023#define __builtin_altivec_vspltish vec_splat_s16
6024
6025// FIXME: parameter should be treated as 5-bit signed literal
6026static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006027vec_splat_s16(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006028{
David Blaikie3302f2b2013-01-16 23:08:36 +00006029 return (vector short)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006030}
6031
6032/* vec_vspltish */
6033
6034// FIXME: parameter should be treated as 5-bit signed literal
6035static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006036vec_vspltish(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006037{
David Blaikie3302f2b2013-01-16 23:08:36 +00006038 return (vector short)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006039}
6040
6041/* vec_splat_s32 */
6042
6043#define __builtin_altivec_vspltisw vec_splat_s32
6044
6045// FIXME: parameter should be treated as 5-bit signed literal
6046static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006047vec_splat_s32(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006048{
David Blaikie3302f2b2013-01-16 23:08:36 +00006049 return (vector int)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006050}
6051
6052/* vec_vspltisw */
6053
6054// FIXME: parameter should be treated as 5-bit signed literal
6055static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006056vec_vspltisw(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006057{
David Blaikie3302f2b2013-01-16 23:08:36 +00006058 return (vector int)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006059}
6060
6061/* vec_splat_u8 */
6062
6063// FIXME: parameter should be treated as 5-bit signed literal
6064static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006065vec_splat_u8(unsigned char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006066{
David Blaikie3302f2b2013-01-16 23:08:36 +00006067 return (vector unsigned char)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006068}
6069
6070/* vec_splat_u16 */
6071
6072// FIXME: parameter should be treated as 5-bit signed literal
6073static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006074vec_splat_u16(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006075{
David Blaikie3302f2b2013-01-16 23:08:36 +00006076 return (vector unsigned short)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006077}
6078
6079/* vec_splat_u32 */
6080
6081// FIXME: parameter should be treated as 5-bit signed literal
6082static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006083vec_splat_u32(signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006084{
David Blaikie3302f2b2013-01-16 23:08:36 +00006085 return (vector unsigned int)(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006086}
6087
6088/* vec_sr */
6089
6090static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006091vec_sr(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006092{
David Blaikie3302f2b2013-01-16 23:08:36 +00006093 return __a >> (vector signed char)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006094}
6095
6096static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006097vec_sr(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006098{
David Blaikie3302f2b2013-01-16 23:08:36 +00006099 return __a >> __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006100}
6101
6102static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006103vec_sr(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006104{
David Blaikie3302f2b2013-01-16 23:08:36 +00006105 return __a >> (vector short)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006106}
6107
6108static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006109vec_sr(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006110{
David Blaikie3302f2b2013-01-16 23:08:36 +00006111 return __a >> __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006112}
6113
6114static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006115vec_sr(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006116{
David Blaikie3302f2b2013-01-16 23:08:36 +00006117 return __a >> (vector int)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006118}
6119
6120static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006121vec_sr(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006122{
David Blaikie3302f2b2013-01-16 23:08:36 +00006123 return __a >> __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006124}
6125
6126/* vec_vsrb */
6127
6128#define __builtin_altivec_vsrb vec_vsrb
6129
6130static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006131vec_vsrb(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006132{
David Blaikie3302f2b2013-01-16 23:08:36 +00006133 return __a >> (vector signed char)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006134}
6135
6136static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006137vec_vsrb(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006138{
David Blaikie3302f2b2013-01-16 23:08:36 +00006139 return __a >> __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006140}
6141
6142/* vec_vsrh */
6143
6144#define __builtin_altivec_vsrh vec_vsrh
6145
6146static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006147vec_vsrh(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006148{
David Blaikie3302f2b2013-01-16 23:08:36 +00006149 return __a >> (vector short)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006150}
6151
6152static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006153vec_vsrh(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006154{
David Blaikie3302f2b2013-01-16 23:08:36 +00006155 return __a >> __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006156}
6157
6158/* vec_vsrw */
6159
6160#define __builtin_altivec_vsrw vec_vsrw
6161
6162static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006163vec_vsrw(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006164{
David Blaikie3302f2b2013-01-16 23:08:36 +00006165 return __a >> (vector int)__b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006166}
6167
6168static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006169vec_vsrw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006170{
David Blaikie3302f2b2013-01-16 23:08:36 +00006171 return __a >> __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006172}
6173
6174/* vec_sra */
6175
6176static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006177vec_sra(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006178{
David Blaikie3302f2b2013-01-16 23:08:36 +00006179 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006180}
6181
6182static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006183vec_sra(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006184{
David Blaikie3302f2b2013-01-16 23:08:36 +00006185 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006186}
6187
6188static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006189vec_sra(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006190{
David Blaikie3302f2b2013-01-16 23:08:36 +00006191 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006192}
6193
6194static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006195vec_sra(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006196{
David Blaikie3302f2b2013-01-16 23:08:36 +00006197 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006198}
6199
6200static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006201vec_sra(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006202{
David Blaikie3302f2b2013-01-16 23:08:36 +00006203 return __builtin_altivec_vsraw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006204}
6205
6206static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006207vec_sra(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006208{
David Blaikie3302f2b2013-01-16 23:08:36 +00006209 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006210}
6211
6212/* vec_vsrab */
6213
6214static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006215vec_vsrab(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006216{
David Blaikie3302f2b2013-01-16 23:08:36 +00006217 return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006218}
6219
6220static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006221vec_vsrab(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006222{
David Blaikie3302f2b2013-01-16 23:08:36 +00006223 return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006224}
6225
6226/* vec_vsrah */
6227
6228static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006229vec_vsrah(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006230{
David Blaikie3302f2b2013-01-16 23:08:36 +00006231 return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006232}
6233
6234static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006235vec_vsrah(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006236{
David Blaikie3302f2b2013-01-16 23:08:36 +00006237 return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006238}
6239
6240/* vec_vsraw */
6241
6242static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006243vec_vsraw(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006244{
David Blaikie3302f2b2013-01-16 23:08:36 +00006245 return __builtin_altivec_vsraw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006246}
6247
6248static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006249vec_vsraw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006250{
David Blaikie3302f2b2013-01-16 23:08:36 +00006251 return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006252}
6253
6254/* vec_srl */
6255
6256static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006257vec_srl(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006258{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006259 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006260 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006261}
6262
6263static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006264vec_srl(vector signed char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006265{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006266 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006267 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006268}
6269
6270static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006271vec_srl(vector signed char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006272{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006273 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006274 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006275}
6276
6277static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006278vec_srl(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006279{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006280 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006281 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006282}
6283
6284static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006285vec_srl(vector unsigned char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006286{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006287 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006288 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006289}
6290
6291static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006292vec_srl(vector unsigned char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006293{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006294 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006295 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006296}
6297
Anton Yartsevfc83c602010-08-19 03:21:36 +00006298static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006299vec_srl(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006300{
David Blaikie3302f2b2013-01-16 23:08:36 +00006301 return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006302}
6303
6304static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006305vec_srl(vector bool char __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006306{
David Blaikie3302f2b2013-01-16 23:08:36 +00006307 return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006308}
6309
6310static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006311vec_srl(vector bool char __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006312{
David Blaikie3302f2b2013-01-16 23:08:36 +00006313 return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006314}
6315
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006316static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006317vec_srl(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006318{
David Blaikie3302f2b2013-01-16 23:08:36 +00006319 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006320}
6321
6322static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006323vec_srl(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006324{
David Blaikie3302f2b2013-01-16 23:08:36 +00006325 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006326}
6327
6328static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006329vec_srl(vector short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006330{
David Blaikie3302f2b2013-01-16 23:08:36 +00006331 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006332}
6333
6334static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006335vec_srl(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006336{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006337 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006338 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006339}
6340
6341static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006342vec_srl(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006343{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006344 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006345 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006346}
6347
6348static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006349vec_srl(vector unsigned short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006350{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006351 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006352 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006353}
6354
Anton Yartsevfc83c602010-08-19 03:21:36 +00006355static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006356vec_srl(vector bool short __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006357{
David Blaikie3302f2b2013-01-16 23:08:36 +00006358 return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006359}
6360
6361static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006362vec_srl(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006363{
David Blaikie3302f2b2013-01-16 23:08:36 +00006364 return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006365}
6366
6367static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006368vec_srl(vector bool short __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006369{
David Blaikie3302f2b2013-01-16 23:08:36 +00006370 return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006371}
6372
6373static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006374vec_srl(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006375{
David Blaikie3302f2b2013-01-16 23:08:36 +00006376 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006377}
6378
6379static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006380vec_srl(vector pixel __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006381{
David Blaikie3302f2b2013-01-16 23:08:36 +00006382 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006383}
6384
6385static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006386vec_srl(vector pixel __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006387{
David Blaikie3302f2b2013-01-16 23:08:36 +00006388 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006389}
6390
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006391static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006392vec_srl(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006393{
David Blaikie3302f2b2013-01-16 23:08:36 +00006394 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006395}
6396
6397static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006398vec_srl(vector int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006399{
David Blaikie3302f2b2013-01-16 23:08:36 +00006400 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006401}
6402
6403static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006404vec_srl(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006405{
David Blaikie3302f2b2013-01-16 23:08:36 +00006406 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006407}
6408
6409static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006410vec_srl(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006411{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006412 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006413 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006414}
6415
6416static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006417vec_srl(vector unsigned int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006418{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006419 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006420 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006421}
6422
6423static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006424vec_srl(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006425{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006426 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006427 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006428}
6429
Anton Yartsevfc83c602010-08-19 03:21:36 +00006430static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006431vec_srl(vector bool int __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006432{
David Blaikie3302f2b2013-01-16 23:08:36 +00006433 return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006434}
6435
6436static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006437vec_srl(vector bool int __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006438{
David Blaikie3302f2b2013-01-16 23:08:36 +00006439 return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006440}
6441
6442static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006443vec_srl(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006444{
David Blaikie3302f2b2013-01-16 23:08:36 +00006445 return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006446}
6447
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006448/* vec_vsr */
6449
6450static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006451vec_vsr(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006452{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006453 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006454 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006455}
6456
6457static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006458vec_vsr(vector signed char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006459{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006460 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006461 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006462}
6463
6464static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006465vec_vsr(vector signed char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006466{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006467 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006468 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006469}
6470
6471static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006472vec_vsr(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006473{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006474 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006475 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006476}
6477
6478static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006479vec_vsr(vector unsigned char __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006480{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006481 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006482 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006483}
6484
6485static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006486vec_vsr(vector unsigned char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006487{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006488 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006489 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006490}
6491
Anton Yartsevfc83c602010-08-19 03:21:36 +00006492static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006493vec_vsr(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006494{
David Blaikie3302f2b2013-01-16 23:08:36 +00006495 return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006496}
6497
6498static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006499vec_vsr(vector bool char __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006500{
David Blaikie3302f2b2013-01-16 23:08:36 +00006501 return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006502}
6503
6504static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006505vec_vsr(vector bool char __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006506{
David Blaikie3302f2b2013-01-16 23:08:36 +00006507 return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006508}
6509
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006510static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006511vec_vsr(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006512{
David Blaikie3302f2b2013-01-16 23:08:36 +00006513 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006514}
6515
6516static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006517vec_vsr(vector short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006518{
David Blaikie3302f2b2013-01-16 23:08:36 +00006519 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006520}
6521
6522static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006523vec_vsr(vector short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006524{
David Blaikie3302f2b2013-01-16 23:08:36 +00006525 return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006526}
6527
6528static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006529vec_vsr(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006530{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006531 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006532 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006533}
6534
6535static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006536vec_vsr(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006537{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006538 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006539 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006540}
6541
6542static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006543vec_vsr(vector unsigned short __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006544{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006545 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006546 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006547}
6548
Anton Yartsevfc83c602010-08-19 03:21:36 +00006549static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006550vec_vsr(vector bool short __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006551{
David Blaikie3302f2b2013-01-16 23:08:36 +00006552 return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006553}
6554
6555static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006556vec_vsr(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006557{
David Blaikie3302f2b2013-01-16 23:08:36 +00006558 return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006559}
6560
6561static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006562vec_vsr(vector bool short __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006563{
David Blaikie3302f2b2013-01-16 23:08:36 +00006564 return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006565}
6566
6567static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006568vec_vsr(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006569{
David Blaikie3302f2b2013-01-16 23:08:36 +00006570 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006571}
6572
6573static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006574vec_vsr(vector pixel __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006575{
David Blaikie3302f2b2013-01-16 23:08:36 +00006576 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006577}
6578
6579static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006580vec_vsr(vector pixel __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006581{
David Blaikie3302f2b2013-01-16 23:08:36 +00006582 return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006583}
6584
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006585static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006586vec_vsr(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006587{
David Blaikie3302f2b2013-01-16 23:08:36 +00006588 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006589}
6590
6591static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006592vec_vsr(vector int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006593{
David Blaikie3302f2b2013-01-16 23:08:36 +00006594 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006595}
6596
6597static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006598vec_vsr(vector int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006599{
David Blaikie3302f2b2013-01-16 23:08:36 +00006600 return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006601}
6602
6603static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006604vec_vsr(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006605{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006606 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006607 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006608}
6609
6610static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006611vec_vsr(vector unsigned int __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006612{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006613 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006614 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006615}
6616
6617static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006618vec_vsr(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006619{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006620 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006621 __builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006622}
6623
Anton Yartsevfc83c602010-08-19 03:21:36 +00006624static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006625vec_vsr(vector bool int __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006626{
David Blaikie3302f2b2013-01-16 23:08:36 +00006627 return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006628}
6629
6630static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006631vec_vsr(vector bool int __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006632{
David Blaikie3302f2b2013-01-16 23:08:36 +00006633 return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006634}
6635
6636static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006637vec_vsr(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006638{
David Blaikie3302f2b2013-01-16 23:08:36 +00006639 return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006640}
6641
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006642/* vec_sro */
6643
6644static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006645vec_sro(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006646{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006647 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006648 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006649}
6650
6651static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006652vec_sro(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006653{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006654 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006655 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006656}
6657
6658static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006659vec_sro(vector unsigned char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006660{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006661 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006662 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006663}
6664
6665static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006666vec_sro(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006667{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006668 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006669 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006670}
6671
6672static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006673vec_sro(vector short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006674{
David Blaikie3302f2b2013-01-16 23:08:36 +00006675 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006676}
6677
6678static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006679vec_sro(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006680{
David Blaikie3302f2b2013-01-16 23:08:36 +00006681 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006682}
6683
6684static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006685vec_sro(vector unsigned short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006686{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006687 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006688 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006689}
6690
6691static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006692vec_sro(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006693{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006694 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006695 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006696}
6697
Anton Yartsevfc83c602010-08-19 03:21:36 +00006698static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006699vec_sro(vector pixel __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006700{
David Blaikie3302f2b2013-01-16 23:08:36 +00006701 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006702}
6703
6704static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006705vec_sro(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006706{
David Blaikie3302f2b2013-01-16 23:08:36 +00006707 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006708}
6709
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006710static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006711vec_sro(vector int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006712{
David Blaikie3302f2b2013-01-16 23:08:36 +00006713 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006714}
6715
6716static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006717vec_sro(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006718{
David Blaikie3302f2b2013-01-16 23:08:36 +00006719 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006720}
6721
6722static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006723vec_sro(vector unsigned int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006724{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006725 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006726 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006727}
6728
6729static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006730vec_sro(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006731{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006732 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006733 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006734}
6735
6736static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006737vec_sro(vector float __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006738{
David Blaikie3302f2b2013-01-16 23:08:36 +00006739 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006740}
6741
6742static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006743vec_sro(vector float __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006744{
David Blaikie3302f2b2013-01-16 23:08:36 +00006745 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006746}
6747
6748/* vec_vsro */
6749
6750static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006751vec_vsro(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006752{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006753 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006754 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006755}
6756
6757static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006758vec_vsro(vector signed char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006759{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006760 return (vector signed char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006761 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006762}
6763
6764static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006765vec_vsro(vector unsigned char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006766{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006767 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006768 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006769}
6770
6771static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006772vec_vsro(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006773{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006774 return (vector unsigned char)
David Blaikie3302f2b2013-01-16 23:08:36 +00006775 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006776}
6777
6778static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006779vec_vsro(vector short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006780{
David Blaikie3302f2b2013-01-16 23:08:36 +00006781 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006782}
6783
6784static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006785vec_vsro(vector short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006786{
David Blaikie3302f2b2013-01-16 23:08:36 +00006787 return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006788}
6789
6790static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006791vec_vsro(vector unsigned short __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006792{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006793 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006794 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006795}
6796
6797static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006798vec_vsro(vector unsigned short __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006799{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006800 return (vector unsigned short)
David Blaikie3302f2b2013-01-16 23:08:36 +00006801 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006802}
6803
Anton Yartsevfc83c602010-08-19 03:21:36 +00006804static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006805vec_vsro(vector pixel __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006806{
David Blaikie3302f2b2013-01-16 23:08:36 +00006807 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006808}
6809
6810static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006811vec_vsro(vector pixel __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006812{
David Blaikie3302f2b2013-01-16 23:08:36 +00006813 return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006814}
6815
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006816static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006817vec_vsro(vector int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006818{
David Blaikie3302f2b2013-01-16 23:08:36 +00006819 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006820}
6821
6822static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006823vec_vsro(vector int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006824{
David Blaikie3302f2b2013-01-16 23:08:36 +00006825 return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006826}
6827
6828static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006829vec_vsro(vector unsigned int __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006830{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006831 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006832 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006833}
6834
6835static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006836vec_vsro(vector unsigned int __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006837{
Anton Yartsev79d6af32010-09-18 00:39:16 +00006838 return (vector unsigned int)
David Blaikie3302f2b2013-01-16 23:08:36 +00006839 __builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006840}
6841
6842static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006843vec_vsro(vector float __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006844{
David Blaikie3302f2b2013-01-16 23:08:36 +00006845 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006846}
6847
6848static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006849vec_vsro(vector float __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006850{
David Blaikie3302f2b2013-01-16 23:08:36 +00006851 return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006852}
6853
6854/* vec_st */
6855
6856static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006857vec_st(vector signed char __a, int __b, vector signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006858{
David Blaikie3302f2b2013-01-16 23:08:36 +00006859 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006860}
6861
6862static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006863vec_st(vector signed char __a, int __b, signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006864{
David Blaikie3302f2b2013-01-16 23:08:36 +00006865 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006866}
6867
6868static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006869vec_st(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006870{
David Blaikie3302f2b2013-01-16 23:08:36 +00006871 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006872}
6873
6874static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006875vec_st(vector unsigned char __a, int __b, unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006876{
David Blaikie3302f2b2013-01-16 23:08:36 +00006877 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006878}
6879
6880static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006881vec_st(vector bool char __a, int __b, signed char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006882{
David Blaikie3302f2b2013-01-16 23:08:36 +00006883 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006884}
6885
6886static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006887vec_st(vector bool char __a, int __b, unsigned char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006888{
David Blaikie3302f2b2013-01-16 23:08:36 +00006889 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006890}
6891
6892static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006893vec_st(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006894{
David Blaikie3302f2b2013-01-16 23:08:36 +00006895 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006896}
6897
6898static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006899vec_st(vector short __a, int __b, vector short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006900{
David Blaikie3302f2b2013-01-16 23:08:36 +00006901 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006902}
6903
6904static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006905vec_st(vector short __a, int __b, short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006906{
David Blaikie3302f2b2013-01-16 23:08:36 +00006907 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006908}
6909
6910static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006911vec_st(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006912{
David Blaikie3302f2b2013-01-16 23:08:36 +00006913 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006914}
6915
6916static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006917vec_st(vector unsigned short __a, int __b, unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006918{
David Blaikie3302f2b2013-01-16 23:08:36 +00006919 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006920}
6921
6922static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006923vec_st(vector bool short __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006924{
David Blaikie3302f2b2013-01-16 23:08:36 +00006925 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006926}
6927
6928static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006929vec_st(vector bool short __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006930{
David Blaikie3302f2b2013-01-16 23:08:36 +00006931 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006932}
6933
6934static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006935vec_st(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006936{
David Blaikie3302f2b2013-01-16 23:08:36 +00006937 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006938}
6939
6940static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006941vec_st(vector pixel __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006942{
David Blaikie3302f2b2013-01-16 23:08:36 +00006943 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006944}
6945
6946static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006947vec_st(vector pixel __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006948{
David Blaikie3302f2b2013-01-16 23:08:36 +00006949 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006950}
6951
6952static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006953vec_st(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006954{
David Blaikie3302f2b2013-01-16 23:08:36 +00006955 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006956}
6957
6958static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006959vec_st(vector int __a, int __b, vector int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006960{
David Blaikie3302f2b2013-01-16 23:08:36 +00006961 __builtin_altivec_stvx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006962}
6963
6964static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006965vec_st(vector int __a, int __b, int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006966{
David Blaikie3302f2b2013-01-16 23:08:36 +00006967 __builtin_altivec_stvx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006968}
6969
6970static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006971vec_st(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006972{
David Blaikie3302f2b2013-01-16 23:08:36 +00006973 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006974}
6975
6976static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006977vec_st(vector unsigned int __a, int __b, unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006978{
David Blaikie3302f2b2013-01-16 23:08:36 +00006979 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00006980}
6981
6982static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006983vec_st(vector bool int __a, int __b, int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006984{
David Blaikie3302f2b2013-01-16 23:08:36 +00006985 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006986}
6987
6988static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006989vec_st(vector bool int __a, int __b, unsigned int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006990{
David Blaikie3302f2b2013-01-16 23:08:36 +00006991 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006992}
6993
6994static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00006995vec_st(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00006996{
David Blaikie3302f2b2013-01-16 23:08:36 +00006997 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00006998}
6999
7000static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007001vec_st(vector float __a, int __b, vector float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007002{
David Blaikie3302f2b2013-01-16 23:08:36 +00007003 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007004}
7005
7006static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007007vec_st(vector float __a, int __b, float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007008{
David Blaikie3302f2b2013-01-16 23:08:36 +00007009 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007010}
7011
7012/* vec_stvx */
7013
7014static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007015vec_stvx(vector signed char __a, int __b, vector signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007016{
David Blaikie3302f2b2013-01-16 23:08:36 +00007017 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007018}
7019
7020static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007021vec_stvx(vector signed char __a, int __b, signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007022{
David Blaikie3302f2b2013-01-16 23:08:36 +00007023 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007024}
7025
7026static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007027vec_stvx(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007028{
David Blaikie3302f2b2013-01-16 23:08:36 +00007029 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007030}
7031
7032static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007033vec_stvx(vector unsigned char __a, int __b, unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007034{
David Blaikie3302f2b2013-01-16 23:08:36 +00007035 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007036}
7037
7038static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007039vec_stvx(vector bool char __a, int __b, signed char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007040{
David Blaikie3302f2b2013-01-16 23:08:36 +00007041 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007042}
7043
7044static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007045vec_stvx(vector bool char __a, int __b, unsigned char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007046{
David Blaikie3302f2b2013-01-16 23:08:36 +00007047 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007048}
7049
7050static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007051vec_stvx(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007052{
David Blaikie3302f2b2013-01-16 23:08:36 +00007053 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007054}
7055
7056static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007057vec_stvx(vector short __a, int __b, vector short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007058{
David Blaikie3302f2b2013-01-16 23:08:36 +00007059 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007060}
7061
7062static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007063vec_stvx(vector short __a, int __b, short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007064{
David Blaikie3302f2b2013-01-16 23:08:36 +00007065 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007066}
7067
7068static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007069vec_stvx(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007070{
David Blaikie3302f2b2013-01-16 23:08:36 +00007071 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007072}
7073
7074static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007075vec_stvx(vector unsigned short __a, int __b, unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007076{
David Blaikie3302f2b2013-01-16 23:08:36 +00007077 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007078}
7079
7080static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007081vec_stvx(vector bool short __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007082{
David Blaikie3302f2b2013-01-16 23:08:36 +00007083 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007084}
7085
7086static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007087vec_stvx(vector bool short __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007088{
David Blaikie3302f2b2013-01-16 23:08:36 +00007089 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007090}
7091
7092static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007093vec_stvx(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007094{
David Blaikie3302f2b2013-01-16 23:08:36 +00007095 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007096}
7097
7098static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007099vec_stvx(vector pixel __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007100{
David Blaikie3302f2b2013-01-16 23:08:36 +00007101 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007102}
7103
7104static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007105vec_stvx(vector pixel __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007106{
David Blaikie3302f2b2013-01-16 23:08:36 +00007107 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007108}
7109
7110static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007111vec_stvx(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007112{
David Blaikie3302f2b2013-01-16 23:08:36 +00007113 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007114}
7115
7116static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007117vec_stvx(vector int __a, int __b, vector int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007118{
David Blaikie3302f2b2013-01-16 23:08:36 +00007119 __builtin_altivec_stvx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007120}
7121
7122static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007123vec_stvx(vector int __a, int __b, int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007124{
David Blaikie3302f2b2013-01-16 23:08:36 +00007125 __builtin_altivec_stvx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007126}
7127
7128static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007129vec_stvx(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007130{
David Blaikie3302f2b2013-01-16 23:08:36 +00007131 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007132}
7133
7134static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007135vec_stvx(vector unsigned int __a, int __b, unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007136{
David Blaikie3302f2b2013-01-16 23:08:36 +00007137 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007138}
7139
7140static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007141vec_stvx(vector bool int __a, int __b, int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007142{
David Blaikie3302f2b2013-01-16 23:08:36 +00007143 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007144}
7145
7146static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007147vec_stvx(vector bool int __a, int __b, unsigned int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007148{
David Blaikie3302f2b2013-01-16 23:08:36 +00007149 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007150}
7151
7152static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007153vec_stvx(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007154{
David Blaikie3302f2b2013-01-16 23:08:36 +00007155 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007156}
7157
7158static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007159vec_stvx(vector float __a, int __b, vector float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007160{
David Blaikie3302f2b2013-01-16 23:08:36 +00007161 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007162}
7163
7164static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007165vec_stvx(vector float __a, int __b, float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007166{
David Blaikie3302f2b2013-01-16 23:08:36 +00007167 __builtin_altivec_stvx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007168}
7169
7170/* vec_ste */
7171
7172static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007173vec_ste(vector signed char __a, int __b, signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007174{
David Blaikie3302f2b2013-01-16 23:08:36 +00007175 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007176}
7177
7178static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007179vec_ste(vector unsigned char __a, int __b, unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007180{
David Blaikie3302f2b2013-01-16 23:08:36 +00007181 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007182}
7183
7184static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007185vec_ste(vector bool char __a, int __b, signed char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007186{
David Blaikie3302f2b2013-01-16 23:08:36 +00007187 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007188}
7189
7190static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007191vec_ste(vector bool char __a, int __b, unsigned char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007192{
David Blaikie3302f2b2013-01-16 23:08:36 +00007193 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007194}
7195
7196static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007197vec_ste(vector short __a, int __b, short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007198{
David Blaikie3302f2b2013-01-16 23:08:36 +00007199 __builtin_altivec_stvehx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007200}
7201
7202static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007203vec_ste(vector unsigned short __a, int __b, unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007204{
David Blaikie3302f2b2013-01-16 23:08:36 +00007205 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007206}
7207
7208static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007209vec_ste(vector bool short __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007210{
David Blaikie3302f2b2013-01-16 23:08:36 +00007211 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007212}
7213
7214static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007215vec_ste(vector bool short __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007216{
David Blaikie3302f2b2013-01-16 23:08:36 +00007217 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007218}
7219
7220static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007221vec_ste(vector pixel __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007222{
David Blaikie3302f2b2013-01-16 23:08:36 +00007223 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007224}
7225
7226static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007227vec_ste(vector pixel __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007228{
David Blaikie3302f2b2013-01-16 23:08:36 +00007229 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007230}
7231
7232static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007233vec_ste(vector int __a, int __b, int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007234{
David Blaikie3302f2b2013-01-16 23:08:36 +00007235 __builtin_altivec_stvewx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007236}
7237
7238static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007239vec_ste(vector unsigned int __a, int __b, unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007240{
David Blaikie3302f2b2013-01-16 23:08:36 +00007241 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007242}
7243
7244static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007245vec_ste(vector bool int __a, int __b, int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007246{
David Blaikie3302f2b2013-01-16 23:08:36 +00007247 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007248}
7249
7250static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007251vec_ste(vector bool int __a, int __b, unsigned int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007252{
David Blaikie3302f2b2013-01-16 23:08:36 +00007253 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007254}
7255
7256static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007257vec_ste(vector float __a, int __b, float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007258{
David Blaikie3302f2b2013-01-16 23:08:36 +00007259 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007260}
7261
7262/* vec_stvebx */
7263
7264static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007265vec_stvebx(vector signed char __a, int __b, signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007266{
David Blaikie3302f2b2013-01-16 23:08:36 +00007267 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007268}
7269
7270static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007271vec_stvebx(vector unsigned char __a, int __b, unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007272{
David Blaikie3302f2b2013-01-16 23:08:36 +00007273 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007274}
7275
Anton Yartsevfc83c602010-08-19 03:21:36 +00007276static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007277vec_stvebx(vector bool char __a, int __b, signed char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007278{
David Blaikie3302f2b2013-01-16 23:08:36 +00007279 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007280}
7281
7282static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007283vec_stvebx(vector bool char __a, int __b, unsigned char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007284{
David Blaikie3302f2b2013-01-16 23:08:36 +00007285 __builtin_altivec_stvebx((vector char)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007286}
7287
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007288/* vec_stvehx */
7289
7290static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007291vec_stvehx(vector short __a, int __b, short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007292{
David Blaikie3302f2b2013-01-16 23:08:36 +00007293 __builtin_altivec_stvehx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007294}
7295
7296static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007297vec_stvehx(vector unsigned short __a, int __b, unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007298{
David Blaikie3302f2b2013-01-16 23:08:36 +00007299 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007300}
7301
Anton Yartsevfc83c602010-08-19 03:21:36 +00007302static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007303vec_stvehx(vector bool short __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007304{
David Blaikie3302f2b2013-01-16 23:08:36 +00007305 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007306}
7307
7308static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007309vec_stvehx(vector bool short __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007310{
David Blaikie3302f2b2013-01-16 23:08:36 +00007311 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007312}
7313
7314static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007315vec_stvehx(vector pixel __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007316{
David Blaikie3302f2b2013-01-16 23:08:36 +00007317 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007318}
7319
7320static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007321vec_stvehx(vector pixel __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007322{
David Blaikie3302f2b2013-01-16 23:08:36 +00007323 __builtin_altivec_stvehx((vector short)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007324}
7325
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007326/* vec_stvewx */
7327
7328static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007329vec_stvewx(vector int __a, int __b, int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007330{
David Blaikie3302f2b2013-01-16 23:08:36 +00007331 __builtin_altivec_stvewx(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007332}
7333
7334static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007335vec_stvewx(vector unsigned int __a, int __b, unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007336{
David Blaikie3302f2b2013-01-16 23:08:36 +00007337 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007338}
7339
7340static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007341vec_stvewx(vector bool int __a, int __b, int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007342{
David Blaikie3302f2b2013-01-16 23:08:36 +00007343 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007344}
7345
7346static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007347vec_stvewx(vector bool int __a, int __b, unsigned int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007348{
David Blaikie3302f2b2013-01-16 23:08:36 +00007349 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007350}
7351
7352static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007353vec_stvewx(vector float __a, int __b, float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007354{
David Blaikie3302f2b2013-01-16 23:08:36 +00007355 __builtin_altivec_stvewx((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007356}
7357
7358/* vec_stl */
7359
7360static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007361vec_stl(vector signed char __a, int __b, vector signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007362{
David Blaikie3302f2b2013-01-16 23:08:36 +00007363 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007364}
7365
7366static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007367vec_stl(vector signed char __a, int __b, signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007368{
David Blaikie3302f2b2013-01-16 23:08:36 +00007369 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007370}
7371
7372static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007373vec_stl(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007374{
David Blaikie3302f2b2013-01-16 23:08:36 +00007375 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007376}
7377
7378static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007379vec_stl(vector unsigned char __a, int __b, unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007380{
David Blaikie3302f2b2013-01-16 23:08:36 +00007381 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007382}
7383
7384static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007385vec_stl(vector bool char __a, int __b, signed char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007386{
David Blaikie3302f2b2013-01-16 23:08:36 +00007387 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007388}
7389
7390static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007391vec_stl(vector bool char __a, int __b, unsigned char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007392{
David Blaikie3302f2b2013-01-16 23:08:36 +00007393 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007394}
7395
7396static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007397vec_stl(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007398{
David Blaikie3302f2b2013-01-16 23:08:36 +00007399 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007400}
7401
7402static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007403vec_stl(vector short __a, int __b, vector short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007404{
David Blaikie3302f2b2013-01-16 23:08:36 +00007405 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007406}
7407
7408static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007409vec_stl(vector short __a, int __b, short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007410{
David Blaikie3302f2b2013-01-16 23:08:36 +00007411 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007412}
7413
7414static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007415vec_stl(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007416{
David Blaikie3302f2b2013-01-16 23:08:36 +00007417 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007418}
7419
7420static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007421vec_stl(vector unsigned short __a, int __b, unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007422{
David Blaikie3302f2b2013-01-16 23:08:36 +00007423 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007424}
7425
7426static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007427vec_stl(vector bool short __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007428{
David Blaikie3302f2b2013-01-16 23:08:36 +00007429 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007430}
7431
7432static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007433vec_stl(vector bool short __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007434{
David Blaikie3302f2b2013-01-16 23:08:36 +00007435 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007436}
7437
7438static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007439vec_stl(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007440{
David Blaikie3302f2b2013-01-16 23:08:36 +00007441 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007442}
7443
7444static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007445vec_stl(vector pixel __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007446{
David Blaikie3302f2b2013-01-16 23:08:36 +00007447 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007448}
7449
7450static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007451vec_stl(vector pixel __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007452{
David Blaikie3302f2b2013-01-16 23:08:36 +00007453 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007454}
7455
7456static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007457vec_stl(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007458{
David Blaikie3302f2b2013-01-16 23:08:36 +00007459 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007460}
7461
7462static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007463vec_stl(vector int __a, int __b, vector int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007464{
David Blaikie3302f2b2013-01-16 23:08:36 +00007465 __builtin_altivec_stvxl(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007466}
7467
7468static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007469vec_stl(vector int __a, int __b, int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007470{
David Blaikie3302f2b2013-01-16 23:08:36 +00007471 __builtin_altivec_stvxl(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007472}
7473
7474static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007475vec_stl(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007476{
David Blaikie3302f2b2013-01-16 23:08:36 +00007477 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007478}
7479
7480static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007481vec_stl(vector unsigned int __a, int __b, unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007482{
David Blaikie3302f2b2013-01-16 23:08:36 +00007483 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007484}
7485
7486static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007487vec_stl(vector bool int __a, int __b, int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007488{
David Blaikie3302f2b2013-01-16 23:08:36 +00007489 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007490}
7491
7492static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007493vec_stl(vector bool int __a, int __b, unsigned int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007494{
David Blaikie3302f2b2013-01-16 23:08:36 +00007495 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007496}
7497
7498static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007499vec_stl(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007500{
David Blaikie3302f2b2013-01-16 23:08:36 +00007501 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007502}
7503
7504static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007505vec_stl(vector float __a, int __b, vector float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007506{
David Blaikie3302f2b2013-01-16 23:08:36 +00007507 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007508}
7509
7510static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007511vec_stl(vector float __a, int __b, float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007512{
David Blaikie3302f2b2013-01-16 23:08:36 +00007513 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007514}
7515
7516/* vec_stvxl */
7517
7518static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007519vec_stvxl(vector signed char __a, int __b, vector signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007520{
David Blaikie3302f2b2013-01-16 23:08:36 +00007521 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007522}
7523
7524static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007525vec_stvxl(vector signed char __a, int __b, signed char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007526{
David Blaikie3302f2b2013-01-16 23:08:36 +00007527 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007528}
7529
7530static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007531vec_stvxl(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007532{
David Blaikie3302f2b2013-01-16 23:08:36 +00007533 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007534}
7535
7536static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007537vec_stvxl(vector unsigned char __a, int __b, unsigned char *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007538{
David Blaikie3302f2b2013-01-16 23:08:36 +00007539 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007540}
7541
7542static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007543vec_stvxl(vector bool char __a, int __b, signed char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007544{
David Blaikie3302f2b2013-01-16 23:08:36 +00007545 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007546}
7547
7548static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007549vec_stvxl(vector bool char __a, int __b, unsigned char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007550{
David Blaikie3302f2b2013-01-16 23:08:36 +00007551 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007552}
7553
7554static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007555vec_stvxl(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007556{
David Blaikie3302f2b2013-01-16 23:08:36 +00007557 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007558}
7559
7560static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007561vec_stvxl(vector short __a, int __b, vector short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007562{
David Blaikie3302f2b2013-01-16 23:08:36 +00007563 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007564}
7565
7566static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007567vec_stvxl(vector short __a, int __b, short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007568{
David Blaikie3302f2b2013-01-16 23:08:36 +00007569 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007570}
7571
7572static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007573vec_stvxl(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007574{
David Blaikie3302f2b2013-01-16 23:08:36 +00007575 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007576}
7577
7578static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007579vec_stvxl(vector unsigned short __a, int __b, unsigned short *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007580{
David Blaikie3302f2b2013-01-16 23:08:36 +00007581 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007582}
7583
7584static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007585vec_stvxl(vector bool short __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007586{
David Blaikie3302f2b2013-01-16 23:08:36 +00007587 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007588}
7589
7590static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007591vec_stvxl(vector bool short __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007592{
David Blaikie3302f2b2013-01-16 23:08:36 +00007593 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007594}
7595
7596static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007597vec_stvxl(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007598{
David Blaikie3302f2b2013-01-16 23:08:36 +00007599 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007600}
7601
7602static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007603vec_stvxl(vector pixel __a, int __b, short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007604{
David Blaikie3302f2b2013-01-16 23:08:36 +00007605 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007606}
7607
7608static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007609vec_stvxl(vector pixel __a, int __b, unsigned short *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007610{
David Blaikie3302f2b2013-01-16 23:08:36 +00007611 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007612}
7613
7614static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007615vec_stvxl(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007616{
David Blaikie3302f2b2013-01-16 23:08:36 +00007617 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007618}
7619
7620static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007621vec_stvxl(vector int __a, int __b, vector int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007622{
David Blaikie3302f2b2013-01-16 23:08:36 +00007623 __builtin_altivec_stvxl(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007624}
7625
7626static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007627vec_stvxl(vector int __a, int __b, int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007628{
David Blaikie3302f2b2013-01-16 23:08:36 +00007629 __builtin_altivec_stvxl(__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007630}
7631
7632static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007633vec_stvxl(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007634{
David Blaikie3302f2b2013-01-16 23:08:36 +00007635 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007636}
7637
7638static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007639vec_stvxl(vector unsigned int __a, int __b, unsigned int *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007640{
David Blaikie3302f2b2013-01-16 23:08:36 +00007641 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007642}
7643
7644static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007645vec_stvxl(vector bool int __a, int __b, int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007646{
David Blaikie3302f2b2013-01-16 23:08:36 +00007647 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007648}
7649
7650static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007651vec_stvxl(vector bool int __a, int __b, unsigned int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007652{
David Blaikie3302f2b2013-01-16 23:08:36 +00007653 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007654}
7655
7656static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007657vec_stvxl(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007658{
David Blaikie3302f2b2013-01-16 23:08:36 +00007659 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007660}
7661
7662static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007663vec_stvxl(vector float __a, int __b, vector float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007664{
David Blaikie3302f2b2013-01-16 23:08:36 +00007665 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007666}
7667
7668static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007669vec_stvxl(vector float __a, int __b, float *__c)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007670{
David Blaikie3302f2b2013-01-16 23:08:36 +00007671 __builtin_altivec_stvxl((vector int)__a, __b, __c);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007672}
7673
7674/* vec_sub */
7675
7676static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007677vec_sub(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007678{
David Blaikie3302f2b2013-01-16 23:08:36 +00007679 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007680}
7681
Anton Yartsevfc83c602010-08-19 03:21:36 +00007682static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007683vec_sub(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007684{
David Blaikie3302f2b2013-01-16 23:08:36 +00007685 return (vector signed char)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007686}
7687
7688static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007689vec_sub(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007690{
David Blaikie3302f2b2013-01-16 23:08:36 +00007691 return __a - (vector signed char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007692}
7693
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007694static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007695vec_sub(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007696{
David Blaikie3302f2b2013-01-16 23:08:36 +00007697 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007698}
7699
Anton Yartsevfc83c602010-08-19 03:21:36 +00007700static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007701vec_sub(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007702{
David Blaikie3302f2b2013-01-16 23:08:36 +00007703 return (vector unsigned char)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007704}
7705
7706static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007707vec_sub(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007708{
David Blaikie3302f2b2013-01-16 23:08:36 +00007709 return __a - (vector unsigned char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007710}
7711
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007712static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007713vec_sub(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007714{
David Blaikie3302f2b2013-01-16 23:08:36 +00007715 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007716}
7717
Anton Yartsevfc83c602010-08-19 03:21:36 +00007718static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007719vec_sub(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007720{
David Blaikie3302f2b2013-01-16 23:08:36 +00007721 return (vector short)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007722}
7723
7724static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007725vec_sub(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007726{
David Blaikie3302f2b2013-01-16 23:08:36 +00007727 return __a - (vector short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007728}
7729
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007730static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007731vec_sub(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007732{
David Blaikie3302f2b2013-01-16 23:08:36 +00007733 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007734}
7735
Anton Yartsevfc83c602010-08-19 03:21:36 +00007736static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007737vec_sub(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007738{
David Blaikie3302f2b2013-01-16 23:08:36 +00007739 return (vector unsigned short)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007740}
7741
7742static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007743vec_sub(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007744{
David Blaikie3302f2b2013-01-16 23:08:36 +00007745 return __a - (vector unsigned short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007746}
7747
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007748static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007749vec_sub(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007750{
David Blaikie3302f2b2013-01-16 23:08:36 +00007751 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007752}
7753
Anton Yartsevfc83c602010-08-19 03:21:36 +00007754static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007755vec_sub(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007756{
David Blaikie3302f2b2013-01-16 23:08:36 +00007757 return (vector int)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007758}
7759
7760static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007761vec_sub(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007762{
David Blaikie3302f2b2013-01-16 23:08:36 +00007763 return __a - (vector int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007764}
7765
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007766static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007767vec_sub(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007768{
David Blaikie3302f2b2013-01-16 23:08:36 +00007769 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007770}
7771
Anton Yartsevfc83c602010-08-19 03:21:36 +00007772static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007773vec_sub(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007774{
David Blaikie3302f2b2013-01-16 23:08:36 +00007775 return (vector unsigned int)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007776}
7777
7778static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007779vec_sub(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007780{
David Blaikie3302f2b2013-01-16 23:08:36 +00007781 return __a - (vector unsigned int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007782}
7783
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007784static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007785vec_sub(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007786{
David Blaikie3302f2b2013-01-16 23:08:36 +00007787 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007788}
7789
7790/* vec_vsububm */
7791
7792#define __builtin_altivec_vsububm vec_vsububm
7793
7794static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007795vec_vsububm(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007796{
David Blaikie3302f2b2013-01-16 23:08:36 +00007797 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007798}
7799
Anton Yartsevfc83c602010-08-19 03:21:36 +00007800static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007801vec_vsububm(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007802{
David Blaikie3302f2b2013-01-16 23:08:36 +00007803 return (vector signed char)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007804}
7805
7806static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007807vec_vsububm(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007808{
David Blaikie3302f2b2013-01-16 23:08:36 +00007809 return __a - (vector signed char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007810}
7811
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007812static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007813vec_vsububm(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007814{
David Blaikie3302f2b2013-01-16 23:08:36 +00007815 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007816}
7817
Anton Yartsevfc83c602010-08-19 03:21:36 +00007818static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007819vec_vsububm(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007820{
David Blaikie3302f2b2013-01-16 23:08:36 +00007821 return (vector unsigned char)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007822}
7823
7824static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007825vec_vsububm(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007826{
David Blaikie3302f2b2013-01-16 23:08:36 +00007827 return __a - (vector unsigned char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007828}
7829
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007830/* vec_vsubuhm */
7831
7832#define __builtin_altivec_vsubuhm vec_vsubuhm
7833
7834static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007835vec_vsubuhm(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007836{
David Blaikie3302f2b2013-01-16 23:08:36 +00007837 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007838}
7839
Anton Yartsevfc83c602010-08-19 03:21:36 +00007840static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007841vec_vsubuhm(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007842{
David Blaikie3302f2b2013-01-16 23:08:36 +00007843 return (vector short)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007844}
7845
7846static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007847vec_vsubuhm(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007848{
David Blaikie3302f2b2013-01-16 23:08:36 +00007849 return __a - (vector short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007850}
7851
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007852static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007853vec_vsubuhm(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007854{
David Blaikie3302f2b2013-01-16 23:08:36 +00007855 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007856}
7857
Anton Yartsevfc83c602010-08-19 03:21:36 +00007858static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007859vec_vsubuhm(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007860{
David Blaikie3302f2b2013-01-16 23:08:36 +00007861 return (vector unsigned short)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007862}
7863
7864static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007865vec_vsubuhm(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007866{
David Blaikie3302f2b2013-01-16 23:08:36 +00007867 return __a - (vector unsigned short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007868}
7869
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007870/* vec_vsubuwm */
7871
7872#define __builtin_altivec_vsubuwm vec_vsubuwm
7873
7874static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007875vec_vsubuwm(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007876{
David Blaikie3302f2b2013-01-16 23:08:36 +00007877 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007878}
7879
Anton Yartsevfc83c602010-08-19 03:21:36 +00007880static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007881vec_vsubuwm(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007882{
David Blaikie3302f2b2013-01-16 23:08:36 +00007883 return (vector int)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007884}
7885
7886static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007887vec_vsubuwm(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007888{
David Blaikie3302f2b2013-01-16 23:08:36 +00007889 return __a - (vector int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007890}
7891
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007892static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007893vec_vsubuwm(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007894{
David Blaikie3302f2b2013-01-16 23:08:36 +00007895 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007896}
7897
Anton Yartsevfc83c602010-08-19 03:21:36 +00007898static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007899vec_vsubuwm(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007900{
David Blaikie3302f2b2013-01-16 23:08:36 +00007901 return (vector unsigned int)__a - __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007902}
7903
7904static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007905vec_vsubuwm(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007906{
David Blaikie3302f2b2013-01-16 23:08:36 +00007907 return __a - (vector unsigned int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00007908}
7909
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007910/* vec_vsubfp */
7911
7912#define __builtin_altivec_vsubfp vec_vsubfp
7913
7914static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00007915vec_vsubfp(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007916{
David Blaikie3302f2b2013-01-16 23:08:36 +00007917 return __a - __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007918}
7919
7920/* vec_subc */
7921
7922static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00007923vec_subc(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007924{
David Blaikie3302f2b2013-01-16 23:08:36 +00007925 return __builtin_altivec_vsubcuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007926}
7927
7928/* vec_vsubcuw */
7929
7930static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00007931vec_vsubcuw(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007932{
David Blaikie3302f2b2013-01-16 23:08:36 +00007933 return __builtin_altivec_vsubcuw(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007934}
7935
7936/* vec_subs */
7937
7938static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007939vec_subs(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007940{
David Blaikie3302f2b2013-01-16 23:08:36 +00007941 return __builtin_altivec_vsubsbs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007942}
7943
Anton Yartsevfc83c602010-08-19 03:21:36 +00007944static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007945vec_subs(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007946{
David Blaikie3302f2b2013-01-16 23:08:36 +00007947 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007948}
7949
7950static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007951vec_subs(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007952{
David Blaikie3302f2b2013-01-16 23:08:36 +00007953 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007954}
7955
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007956static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007957vec_subs(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007958{
David Blaikie3302f2b2013-01-16 23:08:36 +00007959 return __builtin_altivec_vsububs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007960}
7961
Anton Yartsevfc83c602010-08-19 03:21:36 +00007962static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007963vec_subs(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007964{
David Blaikie3302f2b2013-01-16 23:08:36 +00007965 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007966}
7967
7968static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007969vec_subs(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007970{
David Blaikie3302f2b2013-01-16 23:08:36 +00007971 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007972}
7973
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007974static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007975vec_subs(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007976{
David Blaikie3302f2b2013-01-16 23:08:36 +00007977 return __builtin_altivec_vsubshs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007978}
7979
Anton Yartsevfc83c602010-08-19 03:21:36 +00007980static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007981vec_subs(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007982{
David Blaikie3302f2b2013-01-16 23:08:36 +00007983 return __builtin_altivec_vsubshs((vector short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007984}
7985
7986static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007987vec_subs(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00007988{
David Blaikie3302f2b2013-01-16 23:08:36 +00007989 return __builtin_altivec_vsubshs(__a, (vector short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00007990}
7991
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007992static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007993vec_subs(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007994{
David Blaikie3302f2b2013-01-16 23:08:36 +00007995 return __builtin_altivec_vsubuhs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00007996}
7997
Anton Yartsevfc83c602010-08-19 03:21:36 +00007998static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00007999vec_subs(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008000{
David Blaikie3302f2b2013-01-16 23:08:36 +00008001 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008002}
8003
8004static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008005vec_subs(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008006{
David Blaikie3302f2b2013-01-16 23:08:36 +00008007 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008008}
8009
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008010static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008011vec_subs(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008012{
David Blaikie3302f2b2013-01-16 23:08:36 +00008013 return __builtin_altivec_vsubsws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008014}
8015
Anton Yartsevfc83c602010-08-19 03:21:36 +00008016static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008017vec_subs(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008018{
David Blaikie3302f2b2013-01-16 23:08:36 +00008019 return __builtin_altivec_vsubsws((vector int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008020}
8021
8022static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008023vec_subs(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008024{
David Blaikie3302f2b2013-01-16 23:08:36 +00008025 return __builtin_altivec_vsubsws(__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008026}
8027
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008028static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008029vec_subs(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008030{
David Blaikie3302f2b2013-01-16 23:08:36 +00008031 return __builtin_altivec_vsubuws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008032}
8033
Anton Yartsevfc83c602010-08-19 03:21:36 +00008034static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008035vec_subs(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008036{
David Blaikie3302f2b2013-01-16 23:08:36 +00008037 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008038}
8039
8040static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008041vec_subs(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008042{
David Blaikie3302f2b2013-01-16 23:08:36 +00008043 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008044}
8045
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008046/* vec_vsubsbs */
8047
Anton Yartsevfc83c602010-08-19 03:21:36 +00008048static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008049vec_vsubsbs(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008050{
David Blaikie3302f2b2013-01-16 23:08:36 +00008051 return __builtin_altivec_vsubsbs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008052}
8053
Anton Yartsevfc83c602010-08-19 03:21:36 +00008054static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008055vec_vsubsbs(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008056{
David Blaikie3302f2b2013-01-16 23:08:36 +00008057 return __builtin_altivec_vsubsbs((vector signed char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008058}
8059
8060static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008061vec_vsubsbs(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008062{
David Blaikie3302f2b2013-01-16 23:08:36 +00008063 return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008064}
8065
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008066/* vec_vsububs */
8067
Anton Yartsevfc83c602010-08-19 03:21:36 +00008068static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008069vec_vsububs(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008070{
David Blaikie3302f2b2013-01-16 23:08:36 +00008071 return __builtin_altivec_vsububs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008072}
8073
Anton Yartsevfc83c602010-08-19 03:21:36 +00008074static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008075vec_vsububs(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008076{
David Blaikie3302f2b2013-01-16 23:08:36 +00008077 return __builtin_altivec_vsububs((vector unsigned char)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008078}
8079
8080static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008081vec_vsububs(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008082{
David Blaikie3302f2b2013-01-16 23:08:36 +00008083 return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008084}
8085
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008086/* vec_vsubshs */
8087
Anton Yartsevfc83c602010-08-19 03:21:36 +00008088static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008089vec_vsubshs(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008090{
David Blaikie3302f2b2013-01-16 23:08:36 +00008091 return __builtin_altivec_vsubshs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008092}
8093
Anton Yartsevfc83c602010-08-19 03:21:36 +00008094static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008095vec_vsubshs(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008096{
David Blaikie3302f2b2013-01-16 23:08:36 +00008097 return __builtin_altivec_vsubshs((vector short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008098}
8099
8100static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008101vec_vsubshs(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008102{
David Blaikie3302f2b2013-01-16 23:08:36 +00008103 return __builtin_altivec_vsubshs(__a, (vector short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008104}
8105
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008106/* vec_vsubuhs */
8107
Anton Yartsevfc83c602010-08-19 03:21:36 +00008108static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008109vec_vsubuhs(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008110{
David Blaikie3302f2b2013-01-16 23:08:36 +00008111 return __builtin_altivec_vsubuhs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008112}
8113
Anton Yartsevfc83c602010-08-19 03:21:36 +00008114static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008115vec_vsubuhs(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008116{
David Blaikie3302f2b2013-01-16 23:08:36 +00008117 return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008118}
8119
8120static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008121vec_vsubuhs(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008122{
David Blaikie3302f2b2013-01-16 23:08:36 +00008123 return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008124}
8125
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008126/* vec_vsubsws */
8127
Anton Yartsevfc83c602010-08-19 03:21:36 +00008128static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008129vec_vsubsws(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008130{
David Blaikie3302f2b2013-01-16 23:08:36 +00008131 return __builtin_altivec_vsubsws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008132}
8133
Anton Yartsevfc83c602010-08-19 03:21:36 +00008134static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008135vec_vsubsws(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008136{
David Blaikie3302f2b2013-01-16 23:08:36 +00008137 return __builtin_altivec_vsubsws((vector int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008138}
8139
8140static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008141vec_vsubsws(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008142{
David Blaikie3302f2b2013-01-16 23:08:36 +00008143 return __builtin_altivec_vsubsws(__a, (vector int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008144}
8145
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008146/* vec_vsubuws */
8147
Anton Yartsevfc83c602010-08-19 03:21:36 +00008148static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008149vec_vsubuws(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008150{
David Blaikie3302f2b2013-01-16 23:08:36 +00008151 return __builtin_altivec_vsubuws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008152}
8153
Anton Yartsevfc83c602010-08-19 03:21:36 +00008154static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008155vec_vsubuws(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008156{
David Blaikie3302f2b2013-01-16 23:08:36 +00008157 return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008158}
8159
8160static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008161vec_vsubuws(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008162{
David Blaikie3302f2b2013-01-16 23:08:36 +00008163 return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008164}
8165
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008166/* vec_sum4s */
8167
8168static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008169vec_sum4s(vector signed char __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008170{
David Blaikie3302f2b2013-01-16 23:08:36 +00008171 return __builtin_altivec_vsum4sbs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008172}
8173
8174static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008175vec_sum4s(vector unsigned char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008176{
David Blaikie3302f2b2013-01-16 23:08:36 +00008177 return __builtin_altivec_vsum4ubs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008178}
8179
8180static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008181vec_sum4s(vector signed short __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008182{
David Blaikie3302f2b2013-01-16 23:08:36 +00008183 return __builtin_altivec_vsum4shs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008184}
8185
8186/* vec_vsum4sbs */
8187
8188static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008189vec_vsum4sbs(vector signed char __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008190{
David Blaikie3302f2b2013-01-16 23:08:36 +00008191 return __builtin_altivec_vsum4sbs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008192}
8193
8194/* vec_vsum4ubs */
8195
8196static vector unsigned int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008197vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008198{
David Blaikie3302f2b2013-01-16 23:08:36 +00008199 return __builtin_altivec_vsum4ubs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008200}
8201
8202/* vec_vsum4shs */
8203
8204static vector int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008205vec_vsum4shs(vector signed short __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008206{
David Blaikie3302f2b2013-01-16 23:08:36 +00008207 return __builtin_altivec_vsum4shs(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008208}
8209
8210/* vec_sum2s */
8211
8212static vector signed int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008213vec_sum2s(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008214{
David Blaikie3302f2b2013-01-16 23:08:36 +00008215 return __builtin_altivec_vsum2sws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008216}
8217
8218/* vec_vsum2sws */
8219
8220static vector signed int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008221vec_vsum2sws(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008222{
David Blaikie3302f2b2013-01-16 23:08:36 +00008223 return __builtin_altivec_vsum2sws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008224}
8225
8226/* vec_sums */
8227
8228static vector signed int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008229vec_sums(vector signed int __a, vector signed int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008230{
David Blaikie3302f2b2013-01-16 23:08:36 +00008231 return __builtin_altivec_vsumsws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008232}
8233
8234/* vec_vsumsws */
8235
8236static vector signed int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008237vec_vsumsws(vector signed int __a, vector signed int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008238{
David Blaikie3302f2b2013-01-16 23:08:36 +00008239 return __builtin_altivec_vsumsws(__a, __b);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008240}
8241
8242/* vec_trunc */
8243
8244static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008245vec_trunc(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008246{
David Blaikie3302f2b2013-01-16 23:08:36 +00008247 return __builtin_altivec_vrfiz(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008248}
8249
8250/* vec_vrfiz */
8251
8252static vector float __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +00008253vec_vrfiz(vector float __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008254{
David Blaikie3302f2b2013-01-16 23:08:36 +00008255 return __builtin_altivec_vrfiz(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008256}
8257
8258/* vec_unpackh */
8259
8260static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008261vec_unpackh(vector signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008262{
David Blaikie3302f2b2013-01-16 23:08:36 +00008263 return __builtin_altivec_vupkhsb((vector char)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008264}
8265
Anton Yartsevfc83c602010-08-19 03:21:36 +00008266static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008267vec_unpackh(vector bool char __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008268{
David Blaikie3302f2b2013-01-16 23:08:36 +00008269 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008270}
8271
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008272static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008273vec_unpackh(vector short __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008274{
David Blaikie3302f2b2013-01-16 23:08:36 +00008275 return __builtin_altivec_vupkhsh(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008276}
8277
Anton Yartsevfc83c602010-08-19 03:21:36 +00008278static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008279vec_unpackh(vector bool short __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008280{
David Blaikie3302f2b2013-01-16 23:08:36 +00008281 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008282}
8283
8284static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008285vec_unpackh(vector pixel __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008286{
David Blaikie3302f2b2013-01-16 23:08:36 +00008287 return (vector unsigned int)__builtin_altivec_vupkhsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008288}
8289
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008290/* vec_vupkhsb */
8291
Anton Yartsevfc83c602010-08-19 03:21:36 +00008292static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008293vec_vupkhsb(vector signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008294{
David Blaikie3302f2b2013-01-16 23:08:36 +00008295 return __builtin_altivec_vupkhsb((vector char)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008296}
8297
Anton Yartsevfc83c602010-08-19 03:21:36 +00008298static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008299vec_vupkhsb(vector bool char __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008300{
David Blaikie3302f2b2013-01-16 23:08:36 +00008301 return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008302}
8303
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008304/* vec_vupkhsh */
8305
Anton Yartsevfc83c602010-08-19 03:21:36 +00008306static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008307vec_vupkhsh(vector short __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008308{
David Blaikie3302f2b2013-01-16 23:08:36 +00008309 return __builtin_altivec_vupkhsh(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008310}
8311
Anton Yartsevfc83c602010-08-19 03:21:36 +00008312static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008313vec_vupkhsh(vector bool short __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008314{
David Blaikie3302f2b2013-01-16 23:08:36 +00008315 return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008316}
8317
8318static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008319vec_vupkhsh(vector pixel __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008320{
David Blaikie3302f2b2013-01-16 23:08:36 +00008321 return (vector unsigned int)__builtin_altivec_vupkhsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008322}
8323
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008324/* vec_unpackl */
8325
8326static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008327vec_unpackl(vector signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008328{
David Blaikie3302f2b2013-01-16 23:08:36 +00008329 return __builtin_altivec_vupklsb((vector char)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008330}
8331
Anton Yartsevfc83c602010-08-19 03:21:36 +00008332static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008333vec_unpackl(vector bool char __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008334{
David Blaikie3302f2b2013-01-16 23:08:36 +00008335 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008336}
8337
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008338static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008339vec_unpackl(vector short __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008340{
David Blaikie3302f2b2013-01-16 23:08:36 +00008341 return __builtin_altivec_vupklsh(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008342}
8343
Anton Yartsevfc83c602010-08-19 03:21:36 +00008344static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008345vec_unpackl(vector bool short __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008346{
David Blaikie3302f2b2013-01-16 23:08:36 +00008347 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008348}
8349
8350static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008351vec_unpackl(vector pixel __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008352{
David Blaikie3302f2b2013-01-16 23:08:36 +00008353 return (vector unsigned int)__builtin_altivec_vupklsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008354}
8355
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008356/* vec_vupklsb */
8357
Anton Yartsevfc83c602010-08-19 03:21:36 +00008358static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008359vec_vupklsb(vector signed char __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008360{
David Blaikie3302f2b2013-01-16 23:08:36 +00008361 return __builtin_altivec_vupklsb((vector char)__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008362}
8363
Anton Yartsevfc83c602010-08-19 03:21:36 +00008364static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008365vec_vupklsb(vector bool char __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008366{
David Blaikie3302f2b2013-01-16 23:08:36 +00008367 return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008368}
8369
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008370/* vec_vupklsh */
8371
Anton Yartsevfc83c602010-08-19 03:21:36 +00008372static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008373vec_vupklsh(vector short __a)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008374{
David Blaikie3302f2b2013-01-16 23:08:36 +00008375 return __builtin_altivec_vupklsh(__a);
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008376}
8377
Anton Yartsevfc83c602010-08-19 03:21:36 +00008378static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008379vec_vupklsh(vector bool short __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008380{
David Blaikie3302f2b2013-01-16 23:08:36 +00008381 return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008382}
8383
8384static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008385vec_vupklsh(vector pixel __a)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008386{
David Blaikie3302f2b2013-01-16 23:08:36 +00008387 return (vector unsigned int)__builtin_altivec_vupklsh((vector short)__a);
Anton Yartsevfc83c602010-08-19 03:21:36 +00008388}
8389
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008390/* vec_xor */
8391
8392#define __builtin_altivec_vxor vec_xor
8393
8394static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008395vec_xor(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008396{
David Blaikie3302f2b2013-01-16 23:08:36 +00008397 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008398}
8399
Anton Yartsevfc83c602010-08-19 03:21:36 +00008400static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008401vec_xor(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008402{
David Blaikie3302f2b2013-01-16 23:08:36 +00008403 return (vector signed char)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008404}
8405
8406static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008407vec_xor(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008408{
David Blaikie3302f2b2013-01-16 23:08:36 +00008409 return __a ^ (vector signed char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008410}
8411
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008412static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008413vec_xor(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008414{
David Blaikie3302f2b2013-01-16 23:08:36 +00008415 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008416}
8417
Anton Yartsevfc83c602010-08-19 03:21:36 +00008418static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008419vec_xor(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008420{
David Blaikie3302f2b2013-01-16 23:08:36 +00008421 return (vector unsigned char)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008422}
8423
8424static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008425vec_xor(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008426{
David Blaikie3302f2b2013-01-16 23:08:36 +00008427 return __a ^ (vector unsigned char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008428}
8429
8430static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008431vec_xor(vector bool char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008432{
David Blaikie3302f2b2013-01-16 23:08:36 +00008433 return __a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008434}
8435
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008436static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008437vec_xor(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008438{
David Blaikie3302f2b2013-01-16 23:08:36 +00008439 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008440}
8441
Anton Yartsevfc83c602010-08-19 03:21:36 +00008442static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008443vec_xor(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008444{
David Blaikie3302f2b2013-01-16 23:08:36 +00008445 return (vector short)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008446}
8447
8448static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008449vec_xor(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008450{
David Blaikie3302f2b2013-01-16 23:08:36 +00008451 return __a ^ (vector short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008452}
8453
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008454static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008455vec_xor(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008456{
David Blaikie3302f2b2013-01-16 23:08:36 +00008457 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008458}
8459
Anton Yartsevfc83c602010-08-19 03:21:36 +00008460static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008461vec_xor(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008462{
David Blaikie3302f2b2013-01-16 23:08:36 +00008463 return (vector unsigned short)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008464}
8465
8466static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008467vec_xor(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008468{
David Blaikie3302f2b2013-01-16 23:08:36 +00008469 return __a ^ (vector unsigned short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008470}
8471
8472static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008473vec_xor(vector bool short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008474{
David Blaikie3302f2b2013-01-16 23:08:36 +00008475 return __a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008476}
8477
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008478static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008479vec_xor(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008480{
David Blaikie3302f2b2013-01-16 23:08:36 +00008481 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008482}
8483
Anton Yartsevfc83c602010-08-19 03:21:36 +00008484static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008485vec_xor(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008486{
David Blaikie3302f2b2013-01-16 23:08:36 +00008487 return (vector int)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008488}
8489
8490static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008491vec_xor(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008492{
David Blaikie3302f2b2013-01-16 23:08:36 +00008493 return __a ^ (vector int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008494}
8495
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008496static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008497vec_xor(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008498{
David Blaikie3302f2b2013-01-16 23:08:36 +00008499 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008500}
8501
Anton Yartsevfc83c602010-08-19 03:21:36 +00008502static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008503vec_xor(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008504{
David Blaikie3302f2b2013-01-16 23:08:36 +00008505 return (vector unsigned int)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008506}
8507
8508static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008509vec_xor(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008510{
David Blaikie3302f2b2013-01-16 23:08:36 +00008511 return __a ^ (vector unsigned int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008512}
8513
8514static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008515vec_xor(vector bool int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008516{
David Blaikie3302f2b2013-01-16 23:08:36 +00008517 return __a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008518}
8519
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008520static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008521vec_xor(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008522{
David Blaikie3302f2b2013-01-16 23:08:36 +00008523 vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
8524 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008525}
8526
Anton Yartsevfc83c602010-08-19 03:21:36 +00008527static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008528vec_xor(vector bool int __a, vector float __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008529{
David Blaikie3302f2b2013-01-16 23:08:36 +00008530 vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
8531 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008532}
8533
8534static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008535vec_xor(vector float __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008536{
David Blaikie3302f2b2013-01-16 23:08:36 +00008537 vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
8538 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008539}
8540
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008541/* vec_vxor */
8542
8543static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008544vec_vxor(vector signed char __a, vector signed char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008545{
David Blaikie3302f2b2013-01-16 23:08:36 +00008546 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008547}
8548
Anton Yartsevfc83c602010-08-19 03:21:36 +00008549static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008550vec_vxor(vector bool char __a, vector signed char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008551{
David Blaikie3302f2b2013-01-16 23:08:36 +00008552 return (vector signed char)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008553}
8554
8555static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008556vec_vxor(vector signed char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008557{
David Blaikie3302f2b2013-01-16 23:08:36 +00008558 return __a ^ (vector signed char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008559}
8560
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008561static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008562vec_vxor(vector unsigned char __a, vector unsigned char __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008563{
David Blaikie3302f2b2013-01-16 23:08:36 +00008564 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008565}
8566
Anton Yartsevfc83c602010-08-19 03:21:36 +00008567static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008568vec_vxor(vector bool char __a, vector unsigned char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008569{
David Blaikie3302f2b2013-01-16 23:08:36 +00008570 return (vector unsigned char)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008571}
8572
8573static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008574vec_vxor(vector unsigned char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008575{
David Blaikie3302f2b2013-01-16 23:08:36 +00008576 return __a ^ (vector unsigned char)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008577}
8578
8579static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008580vec_vxor(vector bool char __a, vector bool char __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008581{
David Blaikie3302f2b2013-01-16 23:08:36 +00008582 return __a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008583}
8584
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008585static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008586vec_vxor(vector short __a, vector short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008587{
David Blaikie3302f2b2013-01-16 23:08:36 +00008588 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008589}
8590
Anton Yartsevfc83c602010-08-19 03:21:36 +00008591static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008592vec_vxor(vector bool short __a, vector short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008593{
David Blaikie3302f2b2013-01-16 23:08:36 +00008594 return (vector short)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008595}
8596
8597static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008598vec_vxor(vector short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008599{
David Blaikie3302f2b2013-01-16 23:08:36 +00008600 return __a ^ (vector short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008601}
8602
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008603static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008604vec_vxor(vector unsigned short __a, vector unsigned short __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008605{
David Blaikie3302f2b2013-01-16 23:08:36 +00008606 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008607}
8608
Anton Yartsevfc83c602010-08-19 03:21:36 +00008609static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008610vec_vxor(vector bool short __a, vector unsigned short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008611{
David Blaikie3302f2b2013-01-16 23:08:36 +00008612 return (vector unsigned short)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008613}
8614
8615static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008616vec_vxor(vector unsigned short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008617{
David Blaikie3302f2b2013-01-16 23:08:36 +00008618 return __a ^ (vector unsigned short)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008619}
8620
8621static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008622vec_vxor(vector bool short __a, vector bool short __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008623{
David Blaikie3302f2b2013-01-16 23:08:36 +00008624 return __a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008625}
8626
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008627static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008628vec_vxor(vector int __a, vector int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008629{
David Blaikie3302f2b2013-01-16 23:08:36 +00008630 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008631}
8632
Anton Yartsevfc83c602010-08-19 03:21:36 +00008633static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008634vec_vxor(vector bool int __a, vector int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008635{
David Blaikie3302f2b2013-01-16 23:08:36 +00008636 return (vector int)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008637}
8638
8639static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008640vec_vxor(vector int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008641{
David Blaikie3302f2b2013-01-16 23:08:36 +00008642 return __a ^ (vector int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008643}
8644
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008645static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008646vec_vxor(vector unsigned int __a, vector unsigned int __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008647{
David Blaikie3302f2b2013-01-16 23:08:36 +00008648 return __a ^ __b;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008649}
8650
Anton Yartsevfc83c602010-08-19 03:21:36 +00008651static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008652vec_vxor(vector bool int __a, vector unsigned int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008653{
David Blaikie3302f2b2013-01-16 23:08:36 +00008654 return (vector unsigned int)__a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008655}
8656
8657static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008658vec_vxor(vector unsigned int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008659{
David Blaikie3302f2b2013-01-16 23:08:36 +00008660 return __a ^ (vector unsigned int)__b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008661}
8662
8663static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008664vec_vxor(vector bool int __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008665{
David Blaikie3302f2b2013-01-16 23:08:36 +00008666 return __a ^ __b;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008667}
8668
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008669static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008670vec_vxor(vector float __a, vector float __b)
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008671{
David Blaikie3302f2b2013-01-16 23:08:36 +00008672 vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
8673 return (vector float)__res;
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +00008674}
Chris Lattnerdad40622010-04-14 03:54:58 +00008675
Anton Yartsevfc83c602010-08-19 03:21:36 +00008676static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008677vec_vxor(vector bool int __a, vector float __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008678{
David Blaikie3302f2b2013-01-16 23:08:36 +00008679 vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
8680 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008681}
8682
8683static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008684vec_vxor(vector float __a, vector bool int __b)
Anton Yartsevfc83c602010-08-19 03:21:36 +00008685{
David Blaikie3302f2b2013-01-16 23:08:36 +00008686 vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b;
8687 return (vector float)__res;
Anton Yartsevfc83c602010-08-19 03:21:36 +00008688}
8689
Anton Yartsev79d6af32010-09-18 00:39:16 +00008690/* ------------------------ extensions for CBEA ----------------------------- */
Anton Yartsev73d40232010-10-14 14:37:46 +00008691
8692/* vec_extract */
8693
8694static signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008695vec_extract(vector signed char __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008696{
David Blaikie3302f2b2013-01-16 23:08:36 +00008697 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008698}
8699
8700static unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008701vec_extract(vector unsigned char __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008702{
David Blaikie3302f2b2013-01-16 23:08:36 +00008703 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008704}
8705
8706static short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008707vec_extract(vector short __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008708{
David Blaikie3302f2b2013-01-16 23:08:36 +00008709 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008710}
8711
8712static unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008713vec_extract(vector unsigned short __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008714{
David Blaikie3302f2b2013-01-16 23:08:36 +00008715 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008716}
8717
8718static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008719vec_extract(vector int __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008720{
David Blaikie3302f2b2013-01-16 23:08:36 +00008721 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008722}
8723
8724static unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008725vec_extract(vector unsigned int __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008726{
David Blaikie3302f2b2013-01-16 23:08:36 +00008727 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008728}
8729
8730static float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008731vec_extract(vector float __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008732{
David Blaikie3302f2b2013-01-16 23:08:36 +00008733 return __a[__b];
Anton Yartsev73d40232010-10-14 14:37:46 +00008734}
8735
8736/* vec_insert */
8737
8738static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008739vec_insert(signed char __a, vector signed char __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008740{
David Blaikie3302f2b2013-01-16 23:08:36 +00008741 __b[__c] = __a;
8742 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008743}
8744
8745static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008746vec_insert(unsigned char __a, vector unsigned char __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008747{
David Blaikie3302f2b2013-01-16 23:08:36 +00008748 __b[__c] = __a;
8749 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008750}
8751
8752static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008753vec_insert(short __a, vector short __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008754{
David Blaikie3302f2b2013-01-16 23:08:36 +00008755 __b[__c] = __a;
8756 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008757}
8758
8759static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008760vec_insert(unsigned short __a, vector unsigned short __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008761{
David Blaikie3302f2b2013-01-16 23:08:36 +00008762 __b[__c] = __a;
8763 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008764}
8765
8766static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008767vec_insert(int __a, vector int __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008768{
David Blaikie3302f2b2013-01-16 23:08:36 +00008769 __b[__c] = __a;
8770 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008771}
8772
8773static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008774vec_insert(unsigned int __a, vector unsigned int __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008775{
David Blaikie3302f2b2013-01-16 23:08:36 +00008776 __b[__c] = __a;
8777 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008778}
8779
8780static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008781vec_insert(float __a, vector float __b, int __c)
Anton Yartsev73d40232010-10-14 14:37:46 +00008782{
David Blaikie3302f2b2013-01-16 23:08:36 +00008783 __b[__c] = __a;
8784 return __b;
Anton Yartsev73d40232010-10-14 14:37:46 +00008785}
8786
8787/* vec_lvlx */
8788
8789static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008790vec_lvlx(int __a, const signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008791{
David Blaikie3302f2b2013-01-16 23:08:36 +00008792 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008793 (vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008794 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008795}
8796
8797static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008798vec_lvlx(int __a, const vector signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008799{
David Blaikie3302f2b2013-01-16 23:08:36 +00008800 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008801 (vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008802 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008803}
8804
8805static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008806vec_lvlx(int __a, const unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008807{
David Blaikie3302f2b2013-01-16 23:08:36 +00008808 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008809 (vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008810 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008811}
8812
8813static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008814vec_lvlx(int __a, const vector unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008815{
David Blaikie3302f2b2013-01-16 23:08:36 +00008816 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008817 (vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008818 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008819}
8820
8821static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008822vec_lvlx(int __a, const vector bool char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008823{
David Blaikie3302f2b2013-01-16 23:08:36 +00008824 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008825 (vector bool char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008826 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008827}
8828
8829static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008830vec_lvlx(int __a, const short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008831{
David Blaikie3302f2b2013-01-16 23:08:36 +00008832 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008833 (vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008834 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008835}
8836
8837static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008838vec_lvlx(int __a, const vector short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008839{
David Blaikie3302f2b2013-01-16 23:08:36 +00008840 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008841 (vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008842 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008843}
8844
8845static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008846vec_lvlx(int __a, const unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008847{
David Blaikie3302f2b2013-01-16 23:08:36 +00008848 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008849 (vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008850 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008851}
8852
8853static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008854vec_lvlx(int __a, const vector unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008855{
David Blaikie3302f2b2013-01-16 23:08:36 +00008856 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008857 (vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008858 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008859}
8860
8861static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008862vec_lvlx(int __a, const vector bool short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008863{
David Blaikie3302f2b2013-01-16 23:08:36 +00008864 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008865 (vector bool short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008866 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008867}
8868
8869static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008870vec_lvlx(int __a, const vector pixel *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008871{
David Blaikie3302f2b2013-01-16 23:08:36 +00008872 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008873 (vector pixel)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008874 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008875}
8876
8877static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008878vec_lvlx(int __a, const int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008879{
David Blaikie3302f2b2013-01-16 23:08:36 +00008880 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008881 (vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008882 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008883}
8884
8885static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008886vec_lvlx(int __a, const vector int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008887{
David Blaikie3302f2b2013-01-16 23:08:36 +00008888 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008889 (vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008890 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008891}
8892
8893static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008894vec_lvlx(int __a, const unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008895{
David Blaikie3302f2b2013-01-16 23:08:36 +00008896 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008897 (vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008898 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008899}
8900
8901static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008902vec_lvlx(int __a, const vector unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008903{
David Blaikie3302f2b2013-01-16 23:08:36 +00008904 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008905 (vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008906 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008907}
8908
8909static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008910vec_lvlx(int __a, const vector bool int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008911{
David Blaikie3302f2b2013-01-16 23:08:36 +00008912 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008913 (vector bool int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008914 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008915}
8916
8917static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008918vec_lvlx(int __a, const float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008919{
David Blaikie3302f2b2013-01-16 23:08:36 +00008920 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008921 (vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008922 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008923}
8924
8925static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008926vec_lvlx(int __a, const vector float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008927{
David Blaikie3302f2b2013-01-16 23:08:36 +00008928 return vec_perm(vec_ld(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008929 (vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008930 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008931}
8932
8933/* vec_lvlxl */
8934
8935static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008936vec_lvlxl(int __a, const signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008937{
David Blaikie3302f2b2013-01-16 23:08:36 +00008938 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008939 (vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008940 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008941}
8942
8943static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008944vec_lvlxl(int __a, const vector signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008945{
David Blaikie3302f2b2013-01-16 23:08:36 +00008946 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008947 (vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008948 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008949}
8950
8951static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008952vec_lvlxl(int __a, const unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008953{
David Blaikie3302f2b2013-01-16 23:08:36 +00008954 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008955 (vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008956 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008957}
8958
8959static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008960vec_lvlxl(int __a, const vector unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008961{
David Blaikie3302f2b2013-01-16 23:08:36 +00008962 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008963 (vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008964 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008965}
8966
8967static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008968vec_lvlxl(int __a, const vector bool char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008969{
David Blaikie3302f2b2013-01-16 23:08:36 +00008970 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008971 (vector bool char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008972 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008973}
8974
8975static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008976vec_lvlxl(int __a, const short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008977{
David Blaikie3302f2b2013-01-16 23:08:36 +00008978 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008979 (vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008980 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008981}
8982
8983static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008984vec_lvlxl(int __a, const vector short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008985{
David Blaikie3302f2b2013-01-16 23:08:36 +00008986 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008987 (vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008988 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008989}
8990
8991static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00008992vec_lvlxl(int __a, const unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00008993{
David Blaikie3302f2b2013-01-16 23:08:36 +00008994 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00008995 (vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00008996 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00008997}
8998
8999static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009000vec_lvlxl(int __a, const vector unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009001{
David Blaikie3302f2b2013-01-16 23:08:36 +00009002 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009003 (vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009004 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009005}
9006
9007static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009008vec_lvlxl(int __a, const vector bool short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009009{
David Blaikie3302f2b2013-01-16 23:08:36 +00009010 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009011 (vector bool short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009012 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009013}
9014
9015static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009016vec_lvlxl(int __a, const vector pixel *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009017{
David Blaikie3302f2b2013-01-16 23:08:36 +00009018 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009019 (vector pixel)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009020 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009021}
9022
9023static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009024vec_lvlxl(int __a, const int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009025{
David Blaikie3302f2b2013-01-16 23:08:36 +00009026 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009027 (vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009028 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009029}
9030
9031static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009032vec_lvlxl(int __a, const vector int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009033{
David Blaikie3302f2b2013-01-16 23:08:36 +00009034 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009035 (vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009036 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009037}
9038
9039static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009040vec_lvlxl(int __a, const unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009041{
David Blaikie3302f2b2013-01-16 23:08:36 +00009042 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009043 (vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009044 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009045}
9046
9047static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009048vec_lvlxl(int __a, const vector unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009049{
David Blaikie3302f2b2013-01-16 23:08:36 +00009050 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009051 (vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009052 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009053}
9054
9055static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009056vec_lvlxl(int __a, const vector bool int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009057{
David Blaikie3302f2b2013-01-16 23:08:36 +00009058 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009059 (vector bool int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009060 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009061}
9062
9063static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009064vec_lvlxl(int __a, const float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009065{
David Blaikie3302f2b2013-01-16 23:08:36 +00009066 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009067 (vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009068 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009069}
9070
9071static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009072vec_lvlxl(int __a, vector float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009073{
David Blaikie3302f2b2013-01-16 23:08:36 +00009074 return vec_perm(vec_ldl(__a, __b),
Anton Yartsev73d40232010-10-14 14:37:46 +00009075 (vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009076 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009077}
9078
9079/* vec_lvrx */
9080
9081static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009082vec_lvrx(int __a, const signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009083{
9084 return vec_perm((vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009085 vec_ld(__a, __b),
9086 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009087}
9088
9089static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009090vec_lvrx(int __a, const vector signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009091{
9092 return vec_perm((vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009093 vec_ld(__a, __b),
9094 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009095}
9096
9097static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009098vec_lvrx(int __a, const unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009099{
9100 return vec_perm((vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009101 vec_ld(__a, __b),
9102 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009103}
9104
9105static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009106vec_lvrx(int __a, const vector unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009107{
9108 return vec_perm((vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009109 vec_ld(__a, __b),
9110 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009111}
9112
9113static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009114vec_lvrx(int __a, const vector bool char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009115{
9116 return vec_perm((vector bool char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009117 vec_ld(__a, __b),
9118 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009119}
9120
9121static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009122vec_lvrx(int __a, const short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009123{
9124 return vec_perm((vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009125 vec_ld(__a, __b),
9126 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009127}
9128
9129static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009130vec_lvrx(int __a, const vector short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009131{
9132 return vec_perm((vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009133 vec_ld(__a, __b),
9134 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009135}
9136
9137static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009138vec_lvrx(int __a, const unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009139{
9140 return vec_perm((vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009141 vec_ld(__a, __b),
9142 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009143}
9144
9145static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009146vec_lvrx(int __a, const vector unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009147{
9148 return vec_perm((vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009149 vec_ld(__a, __b),
9150 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009151}
9152
9153static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009154vec_lvrx(int __a, const vector bool short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009155{
9156 return vec_perm((vector bool short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009157 vec_ld(__a, __b),
9158 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009159}
9160
9161static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009162vec_lvrx(int __a, const vector pixel *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009163{
9164 return vec_perm((vector pixel)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009165 vec_ld(__a, __b),
9166 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009167}
9168
9169static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009170vec_lvrx(int __a, const int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009171{
9172 return vec_perm((vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009173 vec_ld(__a, __b),
9174 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009175}
9176
9177static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009178vec_lvrx(int __a, const vector int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009179{
9180 return vec_perm((vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009181 vec_ld(__a, __b),
9182 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009183}
9184
9185static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009186vec_lvrx(int __a, const unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009187{
9188 return vec_perm((vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009189 vec_ld(__a, __b),
9190 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009191}
9192
9193static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009194vec_lvrx(int __a, const vector unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009195{
9196 return vec_perm((vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009197 vec_ld(__a, __b),
9198 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009199}
9200
9201static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009202vec_lvrx(int __a, const vector bool int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009203{
9204 return vec_perm((vector bool int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009205 vec_ld(__a, __b),
9206 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009207}
9208
9209static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009210vec_lvrx(int __a, const float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009211{
9212 return vec_perm((vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009213 vec_ld(__a, __b),
9214 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009215}
9216
9217static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009218vec_lvrx(int __a, const vector float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009219{
9220 return vec_perm((vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009221 vec_ld(__a, __b),
9222 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009223}
9224
9225/* vec_lvrxl */
9226
9227static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009228vec_lvrxl(int __a, const signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009229{
9230 return vec_perm((vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009231 vec_ldl(__a, __b),
9232 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009233}
9234
9235static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009236vec_lvrxl(int __a, const vector signed char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009237{
9238 return vec_perm((vector signed char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009239 vec_ldl(__a, __b),
9240 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009241}
9242
9243static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009244vec_lvrxl(int __a, const unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009245{
9246 return vec_perm((vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009247 vec_ldl(__a, __b),
9248 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009249}
9250
9251static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009252vec_lvrxl(int __a, const vector unsigned char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009253{
9254 return vec_perm((vector unsigned char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009255 vec_ldl(__a, __b),
9256 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009257}
9258
9259static vector bool char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009260vec_lvrxl(int __a, const vector bool char *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009261{
9262 return vec_perm((vector bool char)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009263 vec_ldl(__a, __b),
9264 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009265}
9266
9267static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009268vec_lvrxl(int __a, const short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009269{
9270 return vec_perm((vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009271 vec_ldl(__a, __b),
9272 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009273}
9274
9275static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009276vec_lvrxl(int __a, const vector short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009277{
9278 return vec_perm((vector short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009279 vec_ldl(__a, __b),
9280 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009281}
9282
9283static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009284vec_lvrxl(int __a, const unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009285{
9286 return vec_perm((vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009287 vec_ldl(__a, __b),
9288 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009289}
9290
9291static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009292vec_lvrxl(int __a, const vector unsigned short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009293{
9294 return vec_perm((vector unsigned short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009295 vec_ldl(__a, __b),
9296 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009297}
9298
9299static vector bool short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009300vec_lvrxl(int __a, const vector bool short *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009301{
9302 return vec_perm((vector bool short)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009303 vec_ldl(__a, __b),
9304 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009305}
9306
9307static vector pixel __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009308vec_lvrxl(int __a, const vector pixel *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009309{
9310 return vec_perm((vector pixel)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009311 vec_ldl(__a, __b),
9312 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009313}
9314
9315static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009316vec_lvrxl(int __a, const int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009317{
9318 return vec_perm((vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009319 vec_ldl(__a, __b),
9320 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009321}
9322
9323static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009324vec_lvrxl(int __a, const vector int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009325{
9326 return vec_perm((vector int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009327 vec_ldl(__a, __b),
9328 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009329}
9330
9331static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009332vec_lvrxl(int __a, const unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009333{
9334 return vec_perm((vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009335 vec_ldl(__a, __b),
9336 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009337}
9338
9339static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009340vec_lvrxl(int __a, const vector unsigned int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009341{
9342 return vec_perm((vector unsigned int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009343 vec_ldl(__a, __b),
9344 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009345}
9346
9347static vector bool int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009348vec_lvrxl(int __a, const vector bool int *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009349{
9350 return vec_perm((vector bool int)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009351 vec_ldl(__a, __b),
9352 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009353}
9354
9355static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009356vec_lvrxl(int __a, const float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009357{
9358 return vec_perm((vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009359 vec_ldl(__a, __b),
9360 vec_lvsl(__a, __b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009361}
9362
9363static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009364vec_lvrxl(int __a, const vector float *__b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009365{
9366 return vec_perm((vector float)(0),
David Blaikie3302f2b2013-01-16 23:08:36 +00009367 vec_ldl(__a, __b),
9368 vec_lvsl(__a, (unsigned char *)__b));
Anton Yartsev73d40232010-10-14 14:37:46 +00009369}
9370
9371/* vec_stvlx */
9372
9373static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009374vec_stvlx(vector signed char __a, int __b, signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009375{
David Blaikie3302f2b2013-01-16 23:08:36 +00009376 return vec_st(vec_perm(vec_lvrx(__b, __c),
9377 __a,
9378 vec_lvsr(__b, __c)),
9379 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009380}
9381
9382static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009383vec_stvlx(vector signed char __a, int __b, vector signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009384{
David Blaikie3302f2b2013-01-16 23:08:36 +00009385 return vec_st(vec_perm(vec_lvrx(__b, __c),
9386 __a,
9387 vec_lvsr(__b, (unsigned char *)__c)),
9388 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009389}
9390
9391static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009392vec_stvlx(vector unsigned char __a, int __b, unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009393{
David Blaikie3302f2b2013-01-16 23:08:36 +00009394 return vec_st(vec_perm(vec_lvrx(__b, __c),
9395 __a,
9396 vec_lvsr(__b, __c)),
9397 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009398}
9399
9400static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009401vec_stvlx(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009402{
David Blaikie3302f2b2013-01-16 23:08:36 +00009403 return vec_st(vec_perm(vec_lvrx(__b, __c),
9404 __a,
9405 vec_lvsr(__b, (unsigned char *)__c)),
9406 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009407}
9408
9409static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009410vec_stvlx(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009411{
David Blaikie3302f2b2013-01-16 23:08:36 +00009412 return vec_st(vec_perm(vec_lvrx(__b, __c),
9413 __a,
9414 vec_lvsr(__b, (unsigned char *)__c)),
9415 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009416}
9417
9418static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009419vec_stvlx(vector short __a, int __b, short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009420{
David Blaikie3302f2b2013-01-16 23:08:36 +00009421 return vec_st(vec_perm(vec_lvrx(__b, __c),
9422 __a,
9423 vec_lvsr(__b, __c)),
9424 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009425}
9426
9427static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009428vec_stvlx(vector short __a, int __b, vector short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009429{
David Blaikie3302f2b2013-01-16 23:08:36 +00009430 return vec_st(vec_perm(vec_lvrx(__b, __c),
9431 __a,
9432 vec_lvsr(__b, (unsigned char *)__c)),
9433 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009434}
9435
9436static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009437vec_stvlx(vector unsigned short __a, int __b, unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009438{
David Blaikie3302f2b2013-01-16 23:08:36 +00009439 return vec_st(vec_perm(vec_lvrx(__b, __c),
9440 __a,
9441 vec_lvsr(__b, __c)),
9442 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009443}
9444
9445static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009446vec_stvlx(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009447{
David Blaikie3302f2b2013-01-16 23:08:36 +00009448 return vec_st(vec_perm(vec_lvrx(__b, __c),
9449 __a,
9450 vec_lvsr(__b, (unsigned char *)__c)),
9451 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009452}
9453
9454static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009455vec_stvlx(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009456{
David Blaikie3302f2b2013-01-16 23:08:36 +00009457 return vec_st(vec_perm(vec_lvrx(__b, __c),
9458 __a,
9459 vec_lvsr(__b, (unsigned char *)__c)),
9460 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009461}
9462
9463static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009464vec_stvlx(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009465{
David Blaikie3302f2b2013-01-16 23:08:36 +00009466 return vec_st(vec_perm(vec_lvrx(__b, __c),
9467 __a,
9468 vec_lvsr(__b, (unsigned char *)__c)),
9469 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009470}
9471
9472static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009473vec_stvlx(vector int __a, int __b, int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009474{
David Blaikie3302f2b2013-01-16 23:08:36 +00009475 return vec_st(vec_perm(vec_lvrx(__b, __c),
9476 __a,
9477 vec_lvsr(__b, __c)),
9478 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009479}
9480
9481static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009482vec_stvlx(vector int __a, int __b, vector int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009483{
David Blaikie3302f2b2013-01-16 23:08:36 +00009484 return vec_st(vec_perm(vec_lvrx(__b, __c),
9485 __a,
9486 vec_lvsr(__b, (unsigned char *)__c)),
9487 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009488}
9489
9490static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009491vec_stvlx(vector unsigned int __a, int __b, unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009492{
David Blaikie3302f2b2013-01-16 23:08:36 +00009493 return vec_st(vec_perm(vec_lvrx(__b, __c),
9494 __a,
9495 vec_lvsr(__b, __c)),
9496 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009497}
9498
9499static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009500vec_stvlx(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009501{
David Blaikie3302f2b2013-01-16 23:08:36 +00009502 return vec_st(vec_perm(vec_lvrx(__b, __c),
9503 __a,
9504 vec_lvsr(__b, (unsigned char *)__c)),
9505 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009506}
9507
9508static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009509vec_stvlx(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009510{
David Blaikie3302f2b2013-01-16 23:08:36 +00009511 return vec_st(vec_perm(vec_lvrx(__b, __c),
9512 __a,
9513 vec_lvsr(__b, (unsigned char *)__c)),
9514 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009515}
9516
9517static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009518vec_stvlx(vector float __a, int __b, vector float *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009519{
David Blaikie3302f2b2013-01-16 23:08:36 +00009520 return vec_st(vec_perm(vec_lvrx(__b, __c),
9521 __a,
9522 vec_lvsr(__b, (unsigned char *)__c)),
9523 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009524}
9525
9526/* vec_stvlxl */
9527
9528static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009529vec_stvlxl(vector signed char __a, int __b, signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009530{
David Blaikie3302f2b2013-01-16 23:08:36 +00009531 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9532 __a,
9533 vec_lvsr(__b, __c)),
9534 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009535}
9536
9537static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009538vec_stvlxl(vector signed char __a, int __b, vector signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009539{
David Blaikie3302f2b2013-01-16 23:08:36 +00009540 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9541 __a,
9542 vec_lvsr(__b, (unsigned char *)__c)),
9543 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009544}
9545
9546static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009547vec_stvlxl(vector unsigned char __a, int __b, unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009548{
David Blaikie3302f2b2013-01-16 23:08:36 +00009549 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9550 __a,
9551 vec_lvsr(__b, __c)),
9552 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009553}
9554
9555static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009556vec_stvlxl(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009557{
David Blaikie3302f2b2013-01-16 23:08:36 +00009558 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9559 __a,
9560 vec_lvsr(__b, (unsigned char *)__c)),
9561 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009562}
9563
9564static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009565vec_stvlxl(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009566{
David Blaikie3302f2b2013-01-16 23:08:36 +00009567 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9568 __a,
9569 vec_lvsr(__b, (unsigned char *)__c)),
9570 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009571}
9572
9573static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009574vec_stvlxl(vector short __a, int __b, short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009575{
David Blaikie3302f2b2013-01-16 23:08:36 +00009576 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9577 __a,
9578 vec_lvsr(__b, __c)),
9579 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009580}
9581
9582static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009583vec_stvlxl(vector short __a, int __b, vector short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009584{
David Blaikie3302f2b2013-01-16 23:08:36 +00009585 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9586 __a,
9587 vec_lvsr(__b, (unsigned char *)__c)),
9588 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009589}
9590
9591static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009592vec_stvlxl(vector unsigned short __a, int __b, unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009593{
David Blaikie3302f2b2013-01-16 23:08:36 +00009594 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9595 __a,
9596 vec_lvsr(__b, __c)),
9597 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009598}
9599
9600static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009601vec_stvlxl(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009602{
David Blaikie3302f2b2013-01-16 23:08:36 +00009603 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9604 __a,
9605 vec_lvsr(__b, (unsigned char *)__c)),
9606 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009607}
9608
9609static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009610vec_stvlxl(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009611{
David Blaikie3302f2b2013-01-16 23:08:36 +00009612 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9613 __a,
9614 vec_lvsr(__b, (unsigned char *)__c)),
9615 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009616}
9617
9618static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009619vec_stvlxl(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009620{
David Blaikie3302f2b2013-01-16 23:08:36 +00009621 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9622 __a,
9623 vec_lvsr(__b, (unsigned char *)__c)),
9624 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009625}
9626
9627static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009628vec_stvlxl(vector int __a, int __b, int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009629{
David Blaikie3302f2b2013-01-16 23:08:36 +00009630 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9631 __a,
9632 vec_lvsr(__b, __c)),
9633 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009634}
9635
9636static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009637vec_stvlxl(vector int __a, int __b, vector int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009638{
David Blaikie3302f2b2013-01-16 23:08:36 +00009639 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9640 __a,
9641 vec_lvsr(__b, (unsigned char *)__c)),
9642 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009643}
9644
9645static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009646vec_stvlxl(vector unsigned int __a, int __b, unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009647{
David Blaikie3302f2b2013-01-16 23:08:36 +00009648 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9649 __a,
9650 vec_lvsr(__b, __c)),
9651 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009652}
9653
9654static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009655vec_stvlxl(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009656{
David Blaikie3302f2b2013-01-16 23:08:36 +00009657 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9658 __a,
9659 vec_lvsr(__b, (unsigned char *)__c)),
9660 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009661}
9662
9663static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009664vec_stvlxl(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009665{
David Blaikie3302f2b2013-01-16 23:08:36 +00009666 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9667 __a,
9668 vec_lvsr(__b, (unsigned char *)__c)),
9669 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009670}
9671
9672static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009673vec_stvlxl(vector float __a, int __b, vector float *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009674{
David Blaikie3302f2b2013-01-16 23:08:36 +00009675 return vec_stl(vec_perm(vec_lvrx(__b, __c),
9676 __a,
9677 vec_lvsr(__b, (unsigned char *)__c)),
9678 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009679}
9680
9681/* vec_stvrx */
9682
9683static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009684vec_stvrx(vector signed char __a, int __b, signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009685{
David Blaikie3302f2b2013-01-16 23:08:36 +00009686 return vec_st(vec_perm(__a,
9687 vec_lvlx(__b, __c),
9688 vec_lvsr(__b, __c)),
9689 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009690}
9691
9692static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009693vec_stvrx(vector signed char __a, int __b, vector signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009694{
David Blaikie3302f2b2013-01-16 23:08:36 +00009695 return vec_st(vec_perm(__a,
9696 vec_lvlx(__b, __c),
9697 vec_lvsr(__b, (unsigned char *)__c)),
9698 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009699}
9700
9701static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009702vec_stvrx(vector unsigned char __a, int __b, unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009703{
David Blaikie3302f2b2013-01-16 23:08:36 +00009704 return vec_st(vec_perm(__a,
9705 vec_lvlx(__b, __c),
9706 vec_lvsr(__b, __c)),
9707 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009708}
9709
9710static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009711vec_stvrx(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009712{
David Blaikie3302f2b2013-01-16 23:08:36 +00009713 return vec_st(vec_perm(__a,
9714 vec_lvlx(__b, __c),
9715 vec_lvsr(__b, (unsigned char *)__c)),
9716 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009717}
9718
9719static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009720vec_stvrx(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009721{
David Blaikie3302f2b2013-01-16 23:08:36 +00009722 return vec_st(vec_perm(__a,
9723 vec_lvlx(__b, __c),
9724 vec_lvsr(__b, (unsigned char *)__c)),
9725 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009726}
9727
9728static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009729vec_stvrx(vector short __a, int __b, short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009730{
David Blaikie3302f2b2013-01-16 23:08:36 +00009731 return vec_st(vec_perm(__a,
9732 vec_lvlx(__b, __c),
9733 vec_lvsr(__b, __c)),
9734 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009735}
9736
9737static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009738vec_stvrx(vector short __a, int __b, vector short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009739{
David Blaikie3302f2b2013-01-16 23:08:36 +00009740 return vec_st(vec_perm(__a,
9741 vec_lvlx(__b, __c),
9742 vec_lvsr(__b, (unsigned char *)__c)),
9743 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009744}
9745
9746static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009747vec_stvrx(vector unsigned short __a, int __b, unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009748{
David Blaikie3302f2b2013-01-16 23:08:36 +00009749 return vec_st(vec_perm(__a,
9750 vec_lvlx(__b, __c),
9751 vec_lvsr(__b, __c)),
9752 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009753}
9754
9755static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009756vec_stvrx(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009757{
David Blaikie3302f2b2013-01-16 23:08:36 +00009758 return vec_st(vec_perm(__a,
9759 vec_lvlx(__b, __c),
9760 vec_lvsr(__b, (unsigned char *)__c)),
9761 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009762}
9763
9764static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009765vec_stvrx(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009766{
David Blaikie3302f2b2013-01-16 23:08:36 +00009767 return vec_st(vec_perm(__a,
9768 vec_lvlx(__b, __c),
9769 vec_lvsr(__b, (unsigned char *)__c)),
9770 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009771}
9772
9773static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009774vec_stvrx(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009775{
David Blaikie3302f2b2013-01-16 23:08:36 +00009776 return vec_st(vec_perm(__a,
9777 vec_lvlx(__b, __c),
9778 vec_lvsr(__b, (unsigned char *)__c)),
9779 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009780}
9781
9782static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009783vec_stvrx(vector int __a, int __b, int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009784{
David Blaikie3302f2b2013-01-16 23:08:36 +00009785 return vec_st(vec_perm(__a,
9786 vec_lvlx(__b, __c),
9787 vec_lvsr(__b, __c)),
9788 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009789}
9790
9791static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009792vec_stvrx(vector int __a, int __b, vector int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009793{
David Blaikie3302f2b2013-01-16 23:08:36 +00009794 return vec_st(vec_perm(__a,
9795 vec_lvlx(__b, __c),
9796 vec_lvsr(__b, (unsigned char *)__c)),
9797 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009798}
9799
9800static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009801vec_stvrx(vector unsigned int __a, int __b, unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009802{
David Blaikie3302f2b2013-01-16 23:08:36 +00009803 return vec_st(vec_perm(__a,
9804 vec_lvlx(__b, __c),
9805 vec_lvsr(__b, __c)),
9806 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009807}
9808
9809static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009810vec_stvrx(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009811{
David Blaikie3302f2b2013-01-16 23:08:36 +00009812 return vec_st(vec_perm(__a,
9813 vec_lvlx(__b, __c),
9814 vec_lvsr(__b, (unsigned char *)__c)),
9815 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009816}
9817
9818static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009819vec_stvrx(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009820{
David Blaikie3302f2b2013-01-16 23:08:36 +00009821 return vec_st(vec_perm(__a,
9822 vec_lvlx(__b, __c),
9823 vec_lvsr(__b, (unsigned char *)__c)),
9824 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009825}
9826
9827static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009828vec_stvrx(vector float __a, int __b, vector float *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009829{
David Blaikie3302f2b2013-01-16 23:08:36 +00009830 return vec_st(vec_perm(__a,
9831 vec_lvlx(__b, __c),
9832 vec_lvsr(__b, (unsigned char *)__c)),
9833 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009834}
9835
9836/* vec_stvrxl */
9837
9838static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009839vec_stvrxl(vector signed char __a, int __b, signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009840{
David Blaikie3302f2b2013-01-16 23:08:36 +00009841 return vec_stl(vec_perm(__a,
9842 vec_lvlx(__b, __c),
9843 vec_lvsr(__b, __c)),
9844 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009845}
9846
9847static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009848vec_stvrxl(vector signed char __a, int __b, vector signed char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009849{
David Blaikie3302f2b2013-01-16 23:08:36 +00009850 return vec_stl(vec_perm(__a,
9851 vec_lvlx(__b, __c),
9852 vec_lvsr(__b, (unsigned char *)__c)),
9853 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009854}
9855
9856static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009857vec_stvrxl(vector unsigned char __a, int __b, unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009858{
David Blaikie3302f2b2013-01-16 23:08:36 +00009859 return vec_stl(vec_perm(__a,
9860 vec_lvlx(__b, __c),
9861 vec_lvsr(__b, __c)),
9862 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009863}
9864
9865static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009866vec_stvrxl(vector unsigned char __a, int __b, vector unsigned char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009867{
David Blaikie3302f2b2013-01-16 23:08:36 +00009868 return vec_stl(vec_perm(__a,
9869 vec_lvlx(__b, __c),
9870 vec_lvsr(__b, (unsigned char *)__c)),
9871 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009872}
9873
9874static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009875vec_stvrxl(vector bool char __a, int __b, vector bool char *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009876{
David Blaikie3302f2b2013-01-16 23:08:36 +00009877 return vec_stl(vec_perm(__a,
9878 vec_lvlx(__b, __c),
9879 vec_lvsr(__b, (unsigned char *)__c)),
9880 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009881}
9882
9883static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009884vec_stvrxl(vector short __a, int __b, short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009885{
David Blaikie3302f2b2013-01-16 23:08:36 +00009886 return vec_stl(vec_perm(__a,
9887 vec_lvlx(__b, __c),
9888 vec_lvsr(__b, __c)),
9889 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009890}
9891
9892static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009893vec_stvrxl(vector short __a, int __b, vector short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009894{
David Blaikie3302f2b2013-01-16 23:08:36 +00009895 return vec_stl(vec_perm(__a,
9896 vec_lvlx(__b, __c),
9897 vec_lvsr(__b, (unsigned char *)__c)),
9898 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009899}
9900
9901static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009902vec_stvrxl(vector unsigned short __a, int __b, unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009903{
David Blaikie3302f2b2013-01-16 23:08:36 +00009904 return vec_stl(vec_perm(__a,
9905 vec_lvlx(__b, __c),
9906 vec_lvsr(__b, __c)),
9907 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009908}
9909
9910static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009911vec_stvrxl(vector unsigned short __a, int __b, vector unsigned short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009912{
David Blaikie3302f2b2013-01-16 23:08:36 +00009913 return vec_stl(vec_perm(__a,
9914 vec_lvlx(__b, __c),
9915 vec_lvsr(__b, (unsigned char *)__c)),
9916 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009917}
9918
9919static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009920vec_stvrxl(vector bool short __a, int __b, vector bool short *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009921{
David Blaikie3302f2b2013-01-16 23:08:36 +00009922 return vec_stl(vec_perm(__a,
9923 vec_lvlx(__b, __c),
9924 vec_lvsr(__b, (unsigned char *)__c)),
9925 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009926}
9927
9928static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009929vec_stvrxl(vector pixel __a, int __b, vector pixel *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009930{
David Blaikie3302f2b2013-01-16 23:08:36 +00009931 return vec_stl(vec_perm(__a,
9932 vec_lvlx(__b, __c),
9933 vec_lvsr(__b, (unsigned char *)__c)),
9934 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009935}
9936
9937static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009938vec_stvrxl(vector int __a, int __b, int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009939{
David Blaikie3302f2b2013-01-16 23:08:36 +00009940 return vec_stl(vec_perm(__a,
9941 vec_lvlx(__b, __c),
9942 vec_lvsr(__b, __c)),
9943 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009944}
9945
9946static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009947vec_stvrxl(vector int __a, int __b, vector int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009948{
David Blaikie3302f2b2013-01-16 23:08:36 +00009949 return vec_stl(vec_perm(__a,
9950 vec_lvlx(__b, __c),
9951 vec_lvsr(__b, (unsigned char *)__c)),
9952 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009953}
9954
9955static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009956vec_stvrxl(vector unsigned int __a, int __b, unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009957{
David Blaikie3302f2b2013-01-16 23:08:36 +00009958 return vec_stl(vec_perm(__a,
9959 vec_lvlx(__b, __c),
9960 vec_lvsr(__b, __c)),
9961 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009962}
9963
9964static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009965vec_stvrxl(vector unsigned int __a, int __b, vector unsigned int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009966{
David Blaikie3302f2b2013-01-16 23:08:36 +00009967 return vec_stl(vec_perm(__a,
9968 vec_lvlx(__b, __c),
9969 vec_lvsr(__b, (unsigned char *)__c)),
9970 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009971}
9972
9973static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009974vec_stvrxl(vector bool int __a, int __b, vector bool int *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009975{
David Blaikie3302f2b2013-01-16 23:08:36 +00009976 return vec_stl(vec_perm(__a,
9977 vec_lvlx(__b, __c),
9978 vec_lvsr(__b, (unsigned char *)__c)),
9979 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009980}
9981
9982static void __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009983vec_stvrxl(vector float __a, int __b, vector float *__c)
Anton Yartsev73d40232010-10-14 14:37:46 +00009984{
David Blaikie3302f2b2013-01-16 23:08:36 +00009985 return vec_stl(vec_perm(__a,
9986 vec_lvlx(__b, __c),
9987 vec_lvsr(__b, (unsigned char *)__c)),
9988 __b, __c);
Anton Yartsev73d40232010-10-14 14:37:46 +00009989}
9990
9991/* vec_promote */
9992
9993static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +00009994vec_promote(signed char __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +00009995{
David Blaikie3302f2b2013-01-16 23:08:36 +00009996 vector signed char __res = (vector signed char)(0);
9997 __res[__b] = __a;
9998 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +00009999}
10000
10001static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010002vec_promote(unsigned char __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +000010003{
David Blaikie3302f2b2013-01-16 23:08:36 +000010004 vector unsigned char __res = (vector unsigned char)(0);
10005 __res[__b] = __a;
10006 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +000010007}
10008
10009static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010010vec_promote(short __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +000010011{
David Blaikie3302f2b2013-01-16 23:08:36 +000010012 vector short __res = (vector short)(0);
10013 __res[__b] = __a;
10014 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +000010015}
10016
10017static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010018vec_promote(unsigned short __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +000010019{
David Blaikie3302f2b2013-01-16 23:08:36 +000010020 vector unsigned short __res = (vector unsigned short)(0);
10021 __res[__b] = __a;
10022 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +000010023}
10024
10025static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010026vec_promote(int __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +000010027{
David Blaikie3302f2b2013-01-16 23:08:36 +000010028 vector int __res = (vector int)(0);
10029 __res[__b] = __a;
10030 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +000010031}
10032
10033static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010034vec_promote(unsigned int __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +000010035{
David Blaikie3302f2b2013-01-16 23:08:36 +000010036 vector unsigned int __res = (vector unsigned int)(0);
10037 __res[__b] = __a;
10038 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +000010039}
10040
10041static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010042vec_promote(float __a, int __b)
Anton Yartsev73d40232010-10-14 14:37:46 +000010043{
David Blaikie3302f2b2013-01-16 23:08:36 +000010044 vector float __res = (vector float)(0);
10045 __res[__b] = __a;
10046 return __res;
Anton Yartsev73d40232010-10-14 14:37:46 +000010047}
10048
10049/* vec_splats */
10050
10051static vector signed char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010052vec_splats(signed char __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010053{
David Blaikie3302f2b2013-01-16 23:08:36 +000010054 return (vector signed char)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010055}
10056
10057static vector unsigned char __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010058vec_splats(unsigned char __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010059{
David Blaikie3302f2b2013-01-16 23:08:36 +000010060 return (vector unsigned char)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010061}
10062
10063static vector short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010064vec_splats(short __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010065{
David Blaikie3302f2b2013-01-16 23:08:36 +000010066 return (vector short)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010067}
10068
10069static vector unsigned short __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010070vec_splats(unsigned short __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010071{
David Blaikie3302f2b2013-01-16 23:08:36 +000010072 return (vector unsigned short)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010073}
10074
10075static vector int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010076vec_splats(int __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010077{
David Blaikie3302f2b2013-01-16 23:08:36 +000010078 return (vector int)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010079}
10080
10081static vector unsigned int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010082vec_splats(unsigned int __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010083{
David Blaikie3302f2b2013-01-16 23:08:36 +000010084 return (vector unsigned int)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010085}
10086
10087static vector float __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010088vec_splats(float __a)
Anton Yartsev73d40232010-10-14 14:37:46 +000010089{
David Blaikie3302f2b2013-01-16 23:08:36 +000010090 return (vector float)(__a);
Anton Yartsev73d40232010-10-14 14:37:46 +000010091}
10092
Anton Yartsev79d6af32010-09-18 00:39:16 +000010093/* ----------------------------- predicates --------------------------------- */
Chris Lattnerdad40622010-04-14 03:54:58 +000010094
Chris Lattnerdad40622010-04-14 03:54:58 +000010095/* vec_all_eq */
10096
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010097static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010098vec_all_eq(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010099{
David Blaikie3302f2b2013-01-16 23:08:36 +000010100 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010101}
10102
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010103static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010104vec_all_eq(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010105{
David Blaikie3302f2b2013-01-16 23:08:36 +000010106 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010107}
10108
10109static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010110vec_all_eq(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010111{
David Blaikie3302f2b2013-01-16 23:08:36 +000010112 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010113}
10114
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010115static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010116vec_all_eq(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010117{
David Blaikie3302f2b2013-01-16 23:08:36 +000010118 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010119}
10120
10121static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010122vec_all_eq(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010123{
David Blaikie3302f2b2013-01-16 23:08:36 +000010124 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010125}
10126
10127static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010128vec_all_eq(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010129{
David Blaikie3302f2b2013-01-16 23:08:36 +000010130 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010131}
10132
10133static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010134vec_all_eq(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010135{
David Blaikie3302f2b2013-01-16 23:08:36 +000010136 return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010137}
10138
10139static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010140vec_all_eq(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010141{
David Blaikie3302f2b2013-01-16 23:08:36 +000010142 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010143}
10144
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010145static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010146vec_all_eq(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010147{
David Blaikie3302f2b2013-01-16 23:08:36 +000010148 return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010149}
10150
10151static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010152vec_all_eq(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010153{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010154 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010155 __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010156}
10157
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010158static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010159vec_all_eq(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010160{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010161 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010162 __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010163}
10164
10165static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010166vec_all_eq(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010167{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010168 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010169 __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010170}
10171
10172static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010173vec_all_eq(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010174{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010175 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010176 __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010177}
10178
10179static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010180vec_all_eq(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010181{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010182 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010183 __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010184}
10185
10186static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010187vec_all_eq(vector pixel __a, vector pixel __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010188{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010189 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010190 __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010191}
10192
10193static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010194vec_all_eq(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010195{
David Blaikie3302f2b2013-01-16 23:08:36 +000010196 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010197}
10198
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010199static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010200vec_all_eq(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010201{
David Blaikie3302f2b2013-01-16 23:08:36 +000010202 return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010203}
10204
10205static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010206vec_all_eq(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010207{
David Blaikie3302f2b2013-01-16 23:08:36 +000010208 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010209}
10210
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010211static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010212vec_all_eq(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010213{
David Blaikie3302f2b2013-01-16 23:08:36 +000010214 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010215}
10216
10217static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010218vec_all_eq(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010219{
David Blaikie3302f2b2013-01-16 23:08:36 +000010220 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010221}
10222
10223static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010224vec_all_eq(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010225{
David Blaikie3302f2b2013-01-16 23:08:36 +000010226 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010227}
10228
10229static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010230vec_all_eq(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010231{
David Blaikie3302f2b2013-01-16 23:08:36 +000010232 return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010233}
10234
10235static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010236vec_all_eq(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010237{
David Blaikie3302f2b2013-01-16 23:08:36 +000010238 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010239}
10240
10241/* vec_all_ge */
10242
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010243static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010244vec_all_ge(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010245{
David Blaikie3302f2b2013-01-16 23:08:36 +000010246 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010247}
10248
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010249static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010250vec_all_ge(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010251{
David Blaikie3302f2b2013-01-16 23:08:36 +000010252 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010253}
10254
10255static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010256vec_all_ge(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010257{
David Blaikie3302f2b2013-01-16 23:08:36 +000010258 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010259}
10260
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010261static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010262vec_all_ge(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010263{
David Blaikie3302f2b2013-01-16 23:08:36 +000010264 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010265}
10266
10267static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010268vec_all_ge(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010269{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010270 return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010271 (vector unsigned char)__b,
10272 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010273}
10274
10275static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010276vec_all_ge(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010277{
David Blaikie3302f2b2013-01-16 23:08:36 +000010278 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010279}
10280
10281static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010282vec_all_ge(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010283{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010284 return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010285 (vector unsigned char)__b,
10286 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010287}
10288
10289static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010290vec_all_ge(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010291{
David Blaikie3302f2b2013-01-16 23:08:36 +000010292 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010293}
10294
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010295static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010296vec_all_ge(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010297{
David Blaikie3302f2b2013-01-16 23:08:36 +000010298 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010299}
10300
10301static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010302vec_all_ge(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010303{
David Blaikie3302f2b2013-01-16 23:08:36 +000010304 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010305}
10306
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010307static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010308vec_all_ge(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010309{
David Blaikie3302f2b2013-01-16 23:08:36 +000010310 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010311}
10312
10313static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010314vec_all_ge(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010315{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010316 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010317 (vector unsigned short)__b,
10318 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010319}
10320
10321static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010322vec_all_ge(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010323{
David Blaikie3302f2b2013-01-16 23:08:36 +000010324 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010325}
10326
10327static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010328vec_all_ge(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010329{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010330 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010331 (vector unsigned short)__b,
10332 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010333}
10334
10335static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010336vec_all_ge(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010337{
David Blaikie3302f2b2013-01-16 23:08:36 +000010338 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010339}
10340
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010341static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010342vec_all_ge(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010343{
David Blaikie3302f2b2013-01-16 23:08:36 +000010344 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010345}
10346
10347static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010348vec_all_ge(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010349{
David Blaikie3302f2b2013-01-16 23:08:36 +000010350 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010351}
10352
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010353static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010354vec_all_ge(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010355{
David Blaikie3302f2b2013-01-16 23:08:36 +000010356 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010357}
10358
10359static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010360vec_all_ge(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010361{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010362 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010363 (vector unsigned int)__b,
10364 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010365}
10366
10367static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010368vec_all_ge(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010369{
David Blaikie3302f2b2013-01-16 23:08:36 +000010370 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010371}
10372
10373static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010374vec_all_ge(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010375{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010376 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010377 (vector unsigned int)__b,
10378 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010379}
10380
10381static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010382vec_all_ge(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010383{
David Blaikie3302f2b2013-01-16 23:08:36 +000010384 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010385}
10386
10387/* vec_all_gt */
10388
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010389static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010390vec_all_gt(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010391{
David Blaikie3302f2b2013-01-16 23:08:36 +000010392 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010393}
10394
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010395static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010396vec_all_gt(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010397{
David Blaikie3302f2b2013-01-16 23:08:36 +000010398 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010399}
10400
10401static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010402vec_all_gt(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010403{
David Blaikie3302f2b2013-01-16 23:08:36 +000010404 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010405}
10406
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010407static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010408vec_all_gt(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010409{
David Blaikie3302f2b2013-01-16 23:08:36 +000010410 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010411}
10412
10413static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010414vec_all_gt(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010415{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010416 return __builtin_altivec_vcmpgtub_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010417 (vector unsigned char)__a,
10418 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010419}
10420
10421static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010422vec_all_gt(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010423{
David Blaikie3302f2b2013-01-16 23:08:36 +000010424 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010425}
10426
10427static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010428vec_all_gt(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010429{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010430 return __builtin_altivec_vcmpgtub_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010431 (vector unsigned char)__a,
10432 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010433}
10434
10435static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010436vec_all_gt(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010437{
David Blaikie3302f2b2013-01-16 23:08:36 +000010438 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010439}
10440
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010441static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010442vec_all_gt(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010443{
David Blaikie3302f2b2013-01-16 23:08:36 +000010444 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010445}
10446
10447static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010448vec_all_gt(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010449{
David Blaikie3302f2b2013-01-16 23:08:36 +000010450 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010451}
10452
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010453static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010454vec_all_gt(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010455{
David Blaikie3302f2b2013-01-16 23:08:36 +000010456 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010457}
10458
10459static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010460vec_all_gt(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010461{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010462 return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010463 (vector unsigned short)__a,
10464 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010465}
10466
10467static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010468vec_all_gt(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010469{
David Blaikie3302f2b2013-01-16 23:08:36 +000010470 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010471}
10472
10473static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010474vec_all_gt(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010475{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010476 return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010477 (vector unsigned short)__a,
10478 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010479}
10480
10481static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010482vec_all_gt(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010483{
David Blaikie3302f2b2013-01-16 23:08:36 +000010484 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010485}
10486
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010487static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010488vec_all_gt(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010489{
David Blaikie3302f2b2013-01-16 23:08:36 +000010490 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010491}
10492
10493static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010494vec_all_gt(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010495{
David Blaikie3302f2b2013-01-16 23:08:36 +000010496 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010497}
10498
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010499static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010500vec_all_gt(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010501{
David Blaikie3302f2b2013-01-16 23:08:36 +000010502 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010503}
10504
10505static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010506vec_all_gt(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010507{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010508 return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010509 (vector unsigned int)__a,
10510 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010511}
10512
10513static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010514vec_all_gt(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010515{
David Blaikie3302f2b2013-01-16 23:08:36 +000010516 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010517}
10518
10519static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010520vec_all_gt(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010521{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010522 return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010523 (vector unsigned int)__a,
10524 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010525}
10526
10527static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010528vec_all_gt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010529{
David Blaikie3302f2b2013-01-16 23:08:36 +000010530 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010531}
10532
10533/* vec_all_in */
10534
10535static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000010536vec_all_in(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010537{
David Blaikie3302f2b2013-01-16 23:08:36 +000010538 return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010539}
10540
10541/* vec_all_le */
10542
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010543static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010544vec_all_le(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010545{
David Blaikie3302f2b2013-01-16 23:08:36 +000010546 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010547}
10548
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010549static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010550vec_all_le(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010551{
David Blaikie3302f2b2013-01-16 23:08:36 +000010552 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010553}
10554
10555static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010556vec_all_le(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010557{
David Blaikie3302f2b2013-01-16 23:08:36 +000010558 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010559}
10560
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010561static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010562vec_all_le(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010563{
David Blaikie3302f2b2013-01-16 23:08:36 +000010564 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010565}
10566
10567static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010568vec_all_le(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010569{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010570 return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010571 (vector unsigned char)__a,
10572 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010573}
10574
10575static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010576vec_all_le(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010577{
David Blaikie3302f2b2013-01-16 23:08:36 +000010578 return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010579}
10580
10581static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010582vec_all_le(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010583{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010584 return __builtin_altivec_vcmpgtub_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010585 (vector unsigned char)__a,
10586 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010587}
10588
10589static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010590vec_all_le(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010591{
David Blaikie3302f2b2013-01-16 23:08:36 +000010592 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010593}
10594
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010595static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010596vec_all_le(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010597{
David Blaikie3302f2b2013-01-16 23:08:36 +000010598 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010599}
10600
10601static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010602vec_all_le(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010603{
David Blaikie3302f2b2013-01-16 23:08:36 +000010604 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010605}
10606
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010607static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010608vec_all_le(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010609{
David Blaikie3302f2b2013-01-16 23:08:36 +000010610 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010611}
10612
10613static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010614vec_all_le(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010615{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010616 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010617 (vector unsigned short)__a,
10618 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010619}
10620
10621static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010622vec_all_le(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010623{
David Blaikie3302f2b2013-01-16 23:08:36 +000010624 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010625}
10626
10627static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010628vec_all_le(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010629{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010630 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010631 (vector unsigned short)__a,
10632 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010633}
10634
10635static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010636vec_all_le(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010637{
David Blaikie3302f2b2013-01-16 23:08:36 +000010638 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010639}
10640
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010641static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010642vec_all_le(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010643{
David Blaikie3302f2b2013-01-16 23:08:36 +000010644 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010645}
10646
10647static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010648vec_all_le(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010649{
David Blaikie3302f2b2013-01-16 23:08:36 +000010650 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010651}
10652
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010653static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010654vec_all_le(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010655{
David Blaikie3302f2b2013-01-16 23:08:36 +000010656 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010657}
10658
10659static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010660vec_all_le(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010661{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010662 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010663 (vector unsigned int)__a,
10664 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010665}
10666
10667static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010668vec_all_le(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010669{
David Blaikie3302f2b2013-01-16 23:08:36 +000010670 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010671}
10672
10673static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010674vec_all_le(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010675{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010676 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ,
David Blaikie3302f2b2013-01-16 23:08:36 +000010677 (vector unsigned int)__a,
10678 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010679}
10680
10681static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010682vec_all_le(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010683{
David Blaikie3302f2b2013-01-16 23:08:36 +000010684 return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010685}
10686
10687/* vec_all_lt */
10688
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010689static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010690vec_all_lt(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010691{
David Blaikie3302f2b2013-01-16 23:08:36 +000010692 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010693}
10694
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010695static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010696vec_all_lt(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010697{
David Blaikie3302f2b2013-01-16 23:08:36 +000010698 return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010699}
10700
10701static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010702vec_all_lt(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010703{
David Blaikie3302f2b2013-01-16 23:08:36 +000010704 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010705}
10706
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010707static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010708vec_all_lt(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010709{
David Blaikie3302f2b2013-01-16 23:08:36 +000010710 return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010711}
10712
10713static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010714vec_all_lt(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010715{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010716 return __builtin_altivec_vcmpgtub_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010717 (vector unsigned char)__b,
10718 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010719}
10720
10721static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010722vec_all_lt(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010723{
David Blaikie3302f2b2013-01-16 23:08:36 +000010724 return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010725}
10726
10727static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010728vec_all_lt(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010729{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010730 return __builtin_altivec_vcmpgtub_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010731 (vector unsigned char)__b,
10732 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010733}
10734
10735static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010736vec_all_lt(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010737{
David Blaikie3302f2b2013-01-16 23:08:36 +000010738 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010739}
10740
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010741static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010742vec_all_lt(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010743{
David Blaikie3302f2b2013-01-16 23:08:36 +000010744 return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010745}
10746
10747static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010748vec_all_lt(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010749{
David Blaikie3302f2b2013-01-16 23:08:36 +000010750 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010751}
10752
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010753static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010754vec_all_lt(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010755{
David Blaikie3302f2b2013-01-16 23:08:36 +000010756 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010757}
10758
10759static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010760vec_all_lt(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010761{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010762 return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010763 (vector unsigned short)__b,
10764 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010765}
10766
10767static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010768vec_all_lt(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010769{
David Blaikie3302f2b2013-01-16 23:08:36 +000010770 return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010771}
10772
10773static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010774vec_all_lt(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010775{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010776 return __builtin_altivec_vcmpgtuh_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010777 (vector unsigned short)__b,
10778 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010779}
10780
10781static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010782vec_all_lt(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010783{
David Blaikie3302f2b2013-01-16 23:08:36 +000010784 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010785}
10786
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010787static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010788vec_all_lt(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010789{
David Blaikie3302f2b2013-01-16 23:08:36 +000010790 return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010791}
10792
10793static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010794vec_all_lt(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010795{
David Blaikie3302f2b2013-01-16 23:08:36 +000010796 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010797}
10798
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010799static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010800vec_all_lt(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010801{
David Blaikie3302f2b2013-01-16 23:08:36 +000010802 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010803}
10804
10805static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010806vec_all_lt(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010807{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010808 return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010809 (vector unsigned int)__b,
10810 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010811}
10812
10813static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010814vec_all_lt(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010815{
David Blaikie3302f2b2013-01-16 23:08:36 +000010816 return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010817}
10818
10819static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010820vec_all_lt(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010821{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010822 return __builtin_altivec_vcmpgtuw_p(__CR6_LT,
David Blaikie3302f2b2013-01-16 23:08:36 +000010823 (vector unsigned int)__b,
10824 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010825}
10826
10827static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010828vec_all_lt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010829{
David Blaikie3302f2b2013-01-16 23:08:36 +000010830 return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010831}
10832
10833/* vec_all_nan */
10834
10835static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000010836vec_all_nan(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000010837{
David Blaikie3302f2b2013-01-16 23:08:36 +000010838 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000010839}
10840
10841/* vec_all_ne */
10842
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010843static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010844vec_all_ne(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010845{
David Blaikie3302f2b2013-01-16 23:08:36 +000010846 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010847}
10848
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010849static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010850vec_all_ne(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010851{
David Blaikie3302f2b2013-01-16 23:08:36 +000010852 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010853}
10854
10855static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010856vec_all_ne(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010857{
David Blaikie3302f2b2013-01-16 23:08:36 +000010858 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010859}
10860
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010861static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010862vec_all_ne(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010863{
David Blaikie3302f2b2013-01-16 23:08:36 +000010864 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010865}
10866
10867static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010868vec_all_ne(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010869{
David Blaikie3302f2b2013-01-16 23:08:36 +000010870 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010871}
10872
10873static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010874vec_all_ne(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010875{
David Blaikie3302f2b2013-01-16 23:08:36 +000010876 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010877}
10878
10879static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010880vec_all_ne(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010881{
David Blaikie3302f2b2013-01-16 23:08:36 +000010882 return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010883}
10884
10885static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010886vec_all_ne(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010887{
David Blaikie3302f2b2013-01-16 23:08:36 +000010888 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010889}
10890
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010891static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010892vec_all_ne(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010893{
David Blaikie3302f2b2013-01-16 23:08:36 +000010894 return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010895}
10896
10897static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010898vec_all_ne(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010899{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010900 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010901 __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010902}
10903
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010904static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010905vec_all_ne(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010906{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010907 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010908 __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010909}
10910
10911static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010912vec_all_ne(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010913{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010914 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010915 __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010916}
10917
10918static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010919vec_all_ne(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010920{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010921 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010922 __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010923}
10924
10925static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010926vec_all_ne(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010927{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010928 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010929 __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010930}
10931
10932static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010933vec_all_ne(vector pixel __a, vector pixel __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010934{
Anton Yartsev79d6af32010-09-18 00:39:16 +000010935 return
David Blaikie3302f2b2013-01-16 23:08:36 +000010936 __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010937}
10938
10939static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010940vec_all_ne(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010941{
David Blaikie3302f2b2013-01-16 23:08:36 +000010942 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010943}
10944
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010945static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010946vec_all_ne(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010947{
David Blaikie3302f2b2013-01-16 23:08:36 +000010948 return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010949}
10950
10951static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010952vec_all_ne(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010953{
David Blaikie3302f2b2013-01-16 23:08:36 +000010954 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010955}
10956
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000010957static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010958vec_all_ne(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010959{
David Blaikie3302f2b2013-01-16 23:08:36 +000010960 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010961}
10962
10963static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010964vec_all_ne(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010965{
David Blaikie3302f2b2013-01-16 23:08:36 +000010966 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010967}
10968
10969static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010970vec_all_ne(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010971{
David Blaikie3302f2b2013-01-16 23:08:36 +000010972 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010973}
10974
10975static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010976vec_all_ne(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010977{
David Blaikie3302f2b2013-01-16 23:08:36 +000010978 return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000010979}
10980
10981static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000010982vec_all_ne(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010983{
David Blaikie3302f2b2013-01-16 23:08:36 +000010984 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010985}
10986
10987/* vec_all_nge */
10988
10989static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000010990vec_all_nge(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010991{
David Blaikie3302f2b2013-01-16 23:08:36 +000010992 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000010993}
10994
10995/* vec_all_ngt */
10996
10997static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000010998vec_all_ngt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000010999{
David Blaikie3302f2b2013-01-16 23:08:36 +000011000 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011001}
11002
11003/* vec_all_nle */
11004
11005static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011006vec_all_nle(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011007{
David Blaikie3302f2b2013-01-16 23:08:36 +000011008 return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011009}
11010
11011/* vec_all_nlt */
11012
11013static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011014vec_all_nlt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011015{
David Blaikie3302f2b2013-01-16 23:08:36 +000011016 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011017}
11018
11019/* vec_all_numeric */
11020
11021static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011022vec_all_numeric(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000011023{
David Blaikie3302f2b2013-01-16 23:08:36 +000011024 return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011025}
11026
11027/* vec_any_eq */
11028
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011029static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011030vec_any_eq(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011031{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011032 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011033 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011034}
11035
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011036static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011037vec_any_eq(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011038{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011039 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011040 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011041}
11042
11043static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011044vec_any_eq(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011045{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011046 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011047 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011048}
11049
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011050static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011051vec_any_eq(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011052{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011053 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011054 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011055}
11056
11057static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011058vec_any_eq(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011059{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011060 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011061 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011062}
11063
11064static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011065vec_any_eq(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011066{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011067 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011068 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011069}
11070
11071static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011072vec_any_eq(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011073{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011074 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011075 __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011076}
11077
11078static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011079vec_any_eq(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011080{
David Blaikie3302f2b2013-01-16 23:08:36 +000011081 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011082}
11083
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011084static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011085vec_any_eq(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011086{
David Blaikie3302f2b2013-01-16 23:08:36 +000011087 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011088}
11089
11090static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011091vec_any_eq(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011092{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011093 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011094 (vector short)__a,
11095 (vector short)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011096}
11097
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011098static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011099vec_any_eq(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011100{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011101 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011102 (vector short)__a,
11103 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011104}
11105
11106static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011107vec_any_eq(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011108{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011109 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011110 (vector short)__a,
11111 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011112}
11113
11114static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011115vec_any_eq(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011116{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011117 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011118 (vector short)__a,
11119 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011120}
11121
11122static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011123vec_any_eq(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011124{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011125 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011126 (vector short)__a,
11127 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011128}
11129
11130static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011131vec_any_eq(vector pixel __a, vector pixel __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011132{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011133 return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011134 (vector short)__a,
11135 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011136}
11137
11138static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011139vec_any_eq(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011140{
David Blaikie3302f2b2013-01-16 23:08:36 +000011141 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011142}
11143
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011144static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011145vec_any_eq(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011146{
David Blaikie3302f2b2013-01-16 23:08:36 +000011147 return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011148}
11149
11150static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011151vec_any_eq(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011152{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011153 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011154 __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011155}
11156
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011157static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011158vec_any_eq(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011159{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011160 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011161 __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011162}
11163
11164static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011165vec_any_eq(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011166{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011167 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011168 __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011169}
11170
11171static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011172vec_any_eq(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011173{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011174 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011175 __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011176}
11177
11178static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011179vec_any_eq(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011180{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011181 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011182 __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011183}
11184
11185static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011186vec_any_eq(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011187{
David Blaikie3302f2b2013-01-16 23:08:36 +000011188 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011189}
11190
11191/* vec_any_ge */
11192
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011193static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011194vec_any_ge(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011195{
David Blaikie3302f2b2013-01-16 23:08:36 +000011196 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011197}
11198
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011199static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011200vec_any_ge(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011201{
David Blaikie3302f2b2013-01-16 23:08:36 +000011202 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011203}
11204
11205static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011206vec_any_ge(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011207{
David Blaikie3302f2b2013-01-16 23:08:36 +000011208 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011209}
11210
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011211static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011212vec_any_ge(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011213{
David Blaikie3302f2b2013-01-16 23:08:36 +000011214 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011215}
11216
11217static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011218vec_any_ge(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011219{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011220 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011221 (vector unsigned char)__b,
11222 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011223}
11224
11225static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011226vec_any_ge(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011227{
David Blaikie3302f2b2013-01-16 23:08:36 +000011228 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011229}
11230
11231static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011232vec_any_ge(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011233{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011234 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011235 (vector unsigned char)__b,
11236 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011237}
11238
11239static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011240vec_any_ge(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011241{
David Blaikie3302f2b2013-01-16 23:08:36 +000011242 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011243}
11244
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011245static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011246vec_any_ge(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011247{
David Blaikie3302f2b2013-01-16 23:08:36 +000011248 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011249}
11250
11251static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011252vec_any_ge(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011253{
David Blaikie3302f2b2013-01-16 23:08:36 +000011254 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011255}
11256
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011257static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011258vec_any_ge(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011259{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011260 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011261 __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011262}
11263
11264static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011265vec_any_ge(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011266{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011267 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011268 (vector unsigned short)__b,
11269 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011270}
11271
11272static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011273vec_any_ge(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011274{
11275 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011276 __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011277}
11278
11279static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011280vec_any_ge(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011281{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011282 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011283 (vector unsigned short)__b,
11284 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011285}
11286
11287static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011288vec_any_ge(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011289{
David Blaikie3302f2b2013-01-16 23:08:36 +000011290 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011291}
11292
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011293static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011294vec_any_ge(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011295{
David Blaikie3302f2b2013-01-16 23:08:36 +000011296 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011297}
11298
11299static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011300vec_any_ge(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011301{
David Blaikie3302f2b2013-01-16 23:08:36 +000011302 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011303}
11304
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011305static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011306vec_any_ge(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011307{
David Blaikie3302f2b2013-01-16 23:08:36 +000011308 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011309}
11310
11311static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011312vec_any_ge(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011313{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011314 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011315 (vector unsigned int)__b,
11316 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011317}
11318
11319static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011320vec_any_ge(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011321{
David Blaikie3302f2b2013-01-16 23:08:36 +000011322 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011323}
11324
11325static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011326vec_any_ge(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011327{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011328 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011329 (vector unsigned int)__b,
11330 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011331}
11332
11333static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011334vec_any_ge(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011335{
David Blaikie3302f2b2013-01-16 23:08:36 +000011336 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011337}
11338
11339/* vec_any_gt */
11340
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011341static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011342vec_any_gt(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011343{
David Blaikie3302f2b2013-01-16 23:08:36 +000011344 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011345}
11346
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011347static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011348vec_any_gt(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011349{
David Blaikie3302f2b2013-01-16 23:08:36 +000011350 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, (vector signed char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011351}
11352
11353static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011354vec_any_gt(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011355{
David Blaikie3302f2b2013-01-16 23:08:36 +000011356 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011357}
11358
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011359static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011360vec_any_gt(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011361{
11362 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011363 __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011364}
11365
11366static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011367vec_any_gt(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011368{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011369 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011370 (vector unsigned char)__a,
11371 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011372}
11373
11374static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011375vec_any_gt(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011376{
11377 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011378 __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011379}
11380
11381static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011382vec_any_gt(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011383{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011384 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011385 (vector unsigned char)__a,
11386 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011387}
11388
11389static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011390vec_any_gt(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011391{
David Blaikie3302f2b2013-01-16 23:08:36 +000011392 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011393}
11394
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011395static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011396vec_any_gt(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011397{
David Blaikie3302f2b2013-01-16 23:08:36 +000011398 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011399}
11400
11401static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011402vec_any_gt(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011403{
David Blaikie3302f2b2013-01-16 23:08:36 +000011404 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011405}
11406
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011407static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011408vec_any_gt(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011409{
11410 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011411 __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011412}
11413
11414static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011415vec_any_gt(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011416{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011417 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011418 (vector unsigned short)__a,
11419 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011420}
11421
11422static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011423vec_any_gt(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011424{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011425 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011426 __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011427}
11428
11429static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011430vec_any_gt(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011431{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011432 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011433 (vector unsigned short)__a,
11434 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011435}
11436
11437static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011438vec_any_gt(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011439{
David Blaikie3302f2b2013-01-16 23:08:36 +000011440 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011441}
11442
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011443static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011444vec_any_gt(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011445{
David Blaikie3302f2b2013-01-16 23:08:36 +000011446 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011447}
11448
11449static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011450vec_any_gt(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011451{
David Blaikie3302f2b2013-01-16 23:08:36 +000011452 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011453}
11454
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011455static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011456vec_any_gt(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011457{
David Blaikie3302f2b2013-01-16 23:08:36 +000011458 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011459}
11460
11461static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011462vec_any_gt(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011463{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011464 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011465 (vector unsigned int)__a,
11466 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011467}
11468
11469static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011470vec_any_gt(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011471{
David Blaikie3302f2b2013-01-16 23:08:36 +000011472 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011473}
11474
11475static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011476vec_any_gt(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011477{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011478 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011479 (vector unsigned int)__a,
11480 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011481}
11482
11483static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011484vec_any_gt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011485{
David Blaikie3302f2b2013-01-16 23:08:36 +000011486 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011487}
11488
11489/* vec_any_le */
11490
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011491static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011492vec_any_le(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011493{
David Blaikie3302f2b2013-01-16 23:08:36 +000011494 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011495}
11496
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011497static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011498vec_any_le(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011499{
David Blaikie3302f2b2013-01-16 23:08:36 +000011500 return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, (vector signed char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011501}
11502
11503static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011504vec_any_le(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011505{
David Blaikie3302f2b2013-01-16 23:08:36 +000011506 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011507}
11508
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011509static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011510vec_any_le(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011511{
11512 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011513 __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011514}
11515
11516static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011517vec_any_le(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011518{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011519 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011520 (vector unsigned char)__a,
11521 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011522}
11523
11524static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011525vec_any_le(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011526{
11527 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011528 __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011529}
11530
11531static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011532vec_any_le(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011533{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011534 return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011535 (vector unsigned char)__a,
11536 (vector unsigned char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011537}
11538
11539static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011540vec_any_le(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011541{
David Blaikie3302f2b2013-01-16 23:08:36 +000011542 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011543}
11544
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011545static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011546vec_any_le(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011547{
David Blaikie3302f2b2013-01-16 23:08:36 +000011548 return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011549}
11550
11551static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011552vec_any_le(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011553{
David Blaikie3302f2b2013-01-16 23:08:36 +000011554 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011555}
11556
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011557static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011558vec_any_le(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011559{
11560 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011561 __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011562}
11563
11564static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011565vec_any_le(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011566{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011567 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011568 (vector unsigned short)__a,
11569 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011570}
11571
11572static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011573vec_any_le(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011574{
11575 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011576 __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011577}
11578
11579static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011580vec_any_le(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011581{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011582 return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011583 (vector unsigned short)__a,
11584 (vector unsigned short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011585}
11586
11587static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011588vec_any_le(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011589{
David Blaikie3302f2b2013-01-16 23:08:36 +000011590 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011591}
11592
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011593static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011594vec_any_le(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011595{
David Blaikie3302f2b2013-01-16 23:08:36 +000011596 return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011597}
11598
11599static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011600vec_any_le(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011601{
David Blaikie3302f2b2013-01-16 23:08:36 +000011602 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011603}
11604
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011605static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011606vec_any_le(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011607{
David Blaikie3302f2b2013-01-16 23:08:36 +000011608 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011609}
11610
11611static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011612vec_any_le(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011613{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011614 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011615 (vector unsigned int)__a,
11616 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011617}
11618
11619static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011620vec_any_le(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011621{
David Blaikie3302f2b2013-01-16 23:08:36 +000011622 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a, __b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011623}
11624
11625static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011626vec_any_le(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011627{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011628 return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011629 (vector unsigned int)__a,
11630 (vector unsigned int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011631}
11632
11633static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011634vec_any_le(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011635{
David Blaikie3302f2b2013-01-16 23:08:36 +000011636 return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011637}
11638
11639/* vec_any_lt */
11640
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011641static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011642vec_any_lt(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011643{
David Blaikie3302f2b2013-01-16 23:08:36 +000011644 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011645}
11646
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011647static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011648vec_any_lt(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011649{
David Blaikie3302f2b2013-01-16 23:08:36 +000011650 return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011651}
11652
11653static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011654vec_any_lt(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011655{
David Blaikie3302f2b2013-01-16 23:08:36 +000011656 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011657}
11658
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011659static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011660vec_any_lt(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011661{
11662 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011663 __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011664}
11665
11666static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011667vec_any_lt(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011668{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011669 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011670 (vector unsigned char)__b,
11671 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011672}
11673
11674static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011675vec_any_lt(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011676{
11677 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011678 __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011679}
11680
11681static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011682vec_any_lt(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011683{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011684 return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011685 (vector unsigned char)__b,
11686 (vector unsigned char)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011687}
11688
11689static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011690vec_any_lt(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011691{
David Blaikie3302f2b2013-01-16 23:08:36 +000011692 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011693}
11694
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011695static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011696vec_any_lt(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011697{
David Blaikie3302f2b2013-01-16 23:08:36 +000011698 return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011699}
11700
11701static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011702vec_any_lt(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011703{
David Blaikie3302f2b2013-01-16 23:08:36 +000011704 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011705}
11706
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011707static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011708vec_any_lt(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011709{
11710 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011711 __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011712}
11713
11714static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011715vec_any_lt(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011716{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011717 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011718 (vector unsigned short)__b,
11719 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011720}
11721
11722static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011723vec_any_lt(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011724{
11725 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011726 __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011727}
11728
11729static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011730vec_any_lt(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011731{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011732 return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011733 (vector unsigned short)__b,
11734 (vector unsigned short)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011735}
11736
11737static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011738vec_any_lt(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011739{
David Blaikie3302f2b2013-01-16 23:08:36 +000011740 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011741}
11742
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011743static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011744vec_any_lt(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011745{
David Blaikie3302f2b2013-01-16 23:08:36 +000011746 return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011747}
11748
11749static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011750vec_any_lt(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011751{
David Blaikie3302f2b2013-01-16 23:08:36 +000011752 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011753}
11754
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011755static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011756vec_any_lt(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011757{
David Blaikie3302f2b2013-01-16 23:08:36 +000011758 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b, __a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011759}
11760
11761static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011762vec_any_lt(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011763{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011764 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011765 (vector unsigned int)__b,
11766 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011767}
11768
11769static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011770vec_any_lt(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011771{
David Blaikie3302f2b2013-01-16 23:08:36 +000011772 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011773}
11774
11775static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011776vec_any_lt(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011777{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011778 return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011779 (vector unsigned int)__b,
11780 (vector unsigned int)__a);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011781}
11782
11783static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011784vec_any_lt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011785{
David Blaikie3302f2b2013-01-16 23:08:36 +000011786 return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011787}
11788
11789/* vec_any_nan */
11790
11791static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011792vec_any_nan(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000011793{
David Blaikie3302f2b2013-01-16 23:08:36 +000011794 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011795}
11796
11797/* vec_any_ne */
11798
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011799static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011800vec_any_ne(vector signed char __a, vector signed char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011801{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011802 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011803 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011804}
11805
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011806static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011807vec_any_ne(vector signed char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011808{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011809 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011810 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011811}
11812
11813static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011814vec_any_ne(vector unsigned char __a, vector unsigned char __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011815{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011816 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011817 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011818}
11819
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011820static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011821vec_any_ne(vector unsigned char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011822{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011823 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011824 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011825}
11826
11827static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011828vec_any_ne(vector bool char __a, vector signed char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011829{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011830 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011831 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011832}
11833
11834static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011835vec_any_ne(vector bool char __a, vector unsigned char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011836{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011837 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011838 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011839}
11840
11841static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011842vec_any_ne(vector bool char __a, vector bool char __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011843{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011844 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011845 __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011846}
11847
11848static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011849vec_any_ne(vector short __a, vector short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011850{
David Blaikie3302f2b2013-01-16 23:08:36 +000011851 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011852}
11853
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011854static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011855vec_any_ne(vector short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011856{
David Blaikie3302f2b2013-01-16 23:08:36 +000011857 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011858}
11859
11860static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011861vec_any_ne(vector unsigned short __a, vector unsigned short __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011862{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011863 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011864 (vector short)__a,
11865 (vector short)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011866}
11867
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011868static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011869vec_any_ne(vector unsigned short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011870{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011871 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011872 (vector short)__a,
11873 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011874}
11875
11876static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011877vec_any_ne(vector bool short __a, vector short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011878{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011879 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011880 (vector short)__a,
11881 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011882}
11883
11884static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011885vec_any_ne(vector bool short __a, vector unsigned short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011886{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011887 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011888 (vector short)__a,
11889 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011890}
11891
11892static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011893vec_any_ne(vector bool short __a, vector bool short __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011894{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011895 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011896 (vector short)__a,
11897 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011898}
11899
11900static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011901vec_any_ne(vector pixel __a, vector pixel __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011902{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011903 return __builtin_altivec_vcmpequh_p(__CR6_LT_REV,
David Blaikie3302f2b2013-01-16 23:08:36 +000011904 (vector short)__a,
11905 (vector short)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011906}
11907
11908static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011909vec_any_ne(vector int __a, vector int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011910{
David Blaikie3302f2b2013-01-16 23:08:36 +000011911 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011912}
11913
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011914static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011915vec_any_ne(vector int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011916{
David Blaikie3302f2b2013-01-16 23:08:36 +000011917 return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011918}
11919
11920static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011921vec_any_ne(vector unsigned int __a, vector unsigned int __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011922{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011923 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011924 __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011925}
11926
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000011927static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011928vec_any_ne(vector unsigned int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011929{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011930 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011931 __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011932}
11933
11934static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011935vec_any_ne(vector bool int __a, vector int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011936{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011937 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011938 __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011939}
11940
11941static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011942vec_any_ne(vector bool int __a, vector unsigned int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011943{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011944 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011945 __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011946}
11947
11948static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011949vec_any_ne(vector bool int __a, vector bool int __b)
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011950{
Anton Yartsev79d6af32010-09-18 00:39:16 +000011951 return
David Blaikie3302f2b2013-01-16 23:08:36 +000011952 __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b);
Anton Yartsev583a1cf2010-08-19 11:57:49 +000011953}
11954
11955static int __ATTRS_o_ai
David Blaikie3302f2b2013-01-16 23:08:36 +000011956vec_any_ne(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011957{
David Blaikie3302f2b2013-01-16 23:08:36 +000011958 return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011959}
11960
11961/* vec_any_nge */
11962
11963static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011964vec_any_nge(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011965{
David Blaikie3302f2b2013-01-16 23:08:36 +000011966 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011967}
11968
11969/* vec_any_ngt */
11970
11971static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011972vec_any_ngt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011973{
David Blaikie3302f2b2013-01-16 23:08:36 +000011974 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000011975}
11976
11977/* vec_any_nle */
11978
11979static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011980vec_any_nle(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011981{
David Blaikie3302f2b2013-01-16 23:08:36 +000011982 return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011983}
11984
11985/* vec_any_nlt */
11986
11987static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011988vec_any_nlt(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000011989{
David Blaikie3302f2b2013-01-16 23:08:36 +000011990 return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011991}
11992
11993/* vec_any_numeric */
11994
11995static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000011996vec_any_numeric(vector float __a)
Chris Lattnerdad40622010-04-14 03:54:58 +000011997{
David Blaikie3302f2b2013-01-16 23:08:36 +000011998 return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);
Chris Lattnerdad40622010-04-14 03:54:58 +000011999}
12000
12001/* vec_any_out */
12002
12003static int __attribute__((__always_inline__))
David Blaikie3302f2b2013-01-16 23:08:36 +000012004vec_any_out(vector float __a, vector float __b)
Chris Lattnerdad40622010-04-14 03:54:58 +000012005{
David Blaikie3302f2b2013-01-16 23:08:36 +000012006 return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);
Chris Lattnerdad40622010-04-14 03:54:58 +000012007}
12008
Anton Korobeynikovcc50b7d2010-06-19 09:47:18 +000012009#undef __ATTRS_o_ai
Chris Lattnerdad40622010-04-14 03:54:58 +000012010
12011#endif /* __ALTIVEC_H */