Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1 | /*===---- altivec.h - Standard header for type generic math ---------------===*\ |
| 2 | * |
| 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | * of this software and associated documentation files (the "Software"), to deal |
| 5 | * in the Software without restriction, including without limitation the rights |
| 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | * copies of the Software, and to permit persons to whom the Software is |
| 8 | * furnished to do so, subject to the following conditions: |
| 9 | * |
| 10 | * The above copyright notice and this permission notice shall be included in |
| 11 | * all copies or substantial portions of the Software. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 19 | * THE SOFTWARE. |
| 20 | * |
| 21 | \*===----------------------------------------------------------------------===*/ |
| 22 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 23 | // TODO: add functions for 'vector bool ..' and 'vector pixel' argument types according to |
| 24 | // the 'AltiVec Technology Programming Interface Manual' |
| 25 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 26 | #ifndef __ALTIVEC_H |
| 27 | #define __ALTIVEC_H |
| 28 | |
| 29 | #ifndef __ALTIVEC__ |
| 30 | #error "AltiVec support not enabled" |
| 31 | #endif |
| 32 | |
| 33 | /* constants for mapping CR6 bits to predicate result. */ |
| 34 | |
| 35 | #define __CR6_EQ 0 |
| 36 | #define __CR6_EQ_REV 1 |
| 37 | #define __CR6_LT 2 |
| 38 | #define __CR6_LT_REV 3 |
| 39 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 40 | #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__)) |
| 41 | |
| 42 | static vector signed char __ATTRS_o_ai |
| 43 | vec_perm(vector signed char a, vector signed char b, vector unsigned char c); |
| 44 | |
| 45 | static vector unsigned char __ATTRS_o_ai |
| 46 | vec_perm(vector unsigned char a, vector unsigned char b, vector unsigned char c); |
| 47 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 48 | static vector bool char __ATTRS_o_ai |
| 49 | vec_perm(vector bool char a, vector bool char b, vector unsigned char c); |
| 50 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 51 | static vector short __ATTRS_o_ai |
| 52 | vec_perm(vector short a, vector short b, vector unsigned char c); |
| 53 | |
| 54 | static vector unsigned short __ATTRS_o_ai |
| 55 | vec_perm(vector unsigned short a, vector unsigned short b, vector unsigned char c); |
| 56 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 57 | static vector bool short __ATTRS_o_ai |
| 58 | vec_perm(vector bool short a, vector bool short b, vector unsigned char c); |
| 59 | |
| 60 | static vector pixel __ATTRS_o_ai |
| 61 | vec_perm(vector pixel a, vector pixel b, vector unsigned char c); |
| 62 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 63 | static vector int __ATTRS_o_ai |
| 64 | vec_perm(vector int a, vector int b, vector unsigned char c); |
| 65 | |
| 66 | static vector unsigned int __ATTRS_o_ai |
| 67 | vec_perm(vector unsigned int a, vector unsigned int b, vector unsigned char c); |
| 68 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 69 | static vector bool int __ATTRS_o_ai |
| 70 | vec_perm(vector bool int a, vector bool int b, vector unsigned char c); |
| 71 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 72 | static vector float __ATTRS_o_ai |
| 73 | vec_perm(vector float a, vector float b, vector unsigned char c); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 74 | |
| 75 | /* vec_abs */ |
| 76 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 77 | #define __builtin_altivec_abs_v16qi vec_abs |
| 78 | #define __builtin_altivec_abs_v8hi vec_abs |
| 79 | #define __builtin_altivec_abs_v4si vec_abs |
| 80 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 81 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 82 | vec_abs(vector signed char a) |
| 83 | { |
| 84 | return __builtin_altivec_vmaxsb(a, -a); |
| 85 | } |
| 86 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 87 | static vector signed short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 88 | vec_abs(vector signed short a) |
| 89 | { |
| 90 | return __builtin_altivec_vmaxsh(a, -a); |
| 91 | } |
| 92 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 93 | static vector signed int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 94 | vec_abs(vector signed int a) |
| 95 | { |
| 96 | return __builtin_altivec_vmaxsw(a, -a); |
| 97 | } |
| 98 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 99 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 100 | vec_abs(vector float a) |
| 101 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 102 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)(0x7FFFFFFF); |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 103 | return (vector float)res; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | /* vec_abss */ |
| 107 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 108 | #define __builtin_altivec_abss_v16qi vec_abss |
| 109 | #define __builtin_altivec_abss_v8hi vec_abss |
| 110 | #define __builtin_altivec_abss_v4si vec_abss |
| 111 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 112 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 113 | vec_abss(vector signed char a) |
| 114 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 115 | return __builtin_altivec_vmaxsb(a, __builtin_altivec_vsubsbs((vector signed char)(0), a)); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 116 | } |
| 117 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 118 | static vector signed short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 119 | vec_abss(vector signed short a) |
| 120 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 121 | return __builtin_altivec_vmaxsh(a, __builtin_altivec_vsubshs((vector signed short)(0), a)); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 122 | } |
| 123 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 124 | static vector signed int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 125 | vec_abss(vector signed int a) |
| 126 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 127 | return __builtin_altivec_vmaxsw(a, __builtin_altivec_vsubsws((vector signed int)(0), a)); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | /* vec_add */ |
| 131 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 132 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 133 | vec_add(vector signed char a, vector signed char b) |
| 134 | { |
| 135 | return a + b; |
| 136 | } |
| 137 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 138 | static vector signed char __ATTRS_o_ai |
| 139 | vec_add(vector bool char a, vector signed char b) |
| 140 | { |
| 141 | return (vector signed char)a + b; |
| 142 | } |
| 143 | |
| 144 | static vector signed char __ATTRS_o_ai |
| 145 | vec_add(vector signed char a, vector bool char b) |
| 146 | { |
| 147 | return a + (vector signed char)b; |
| 148 | } |
| 149 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 150 | static vector unsigned char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 151 | vec_add(vector unsigned char a, vector unsigned char b) |
| 152 | { |
| 153 | return a + b; |
| 154 | } |
| 155 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 156 | static vector unsigned char __ATTRS_o_ai |
| 157 | vec_add(vector bool char a, vector unsigned char b) |
| 158 | { |
| 159 | return (vector unsigned char)a + b; |
| 160 | } |
| 161 | |
| 162 | static vector unsigned char __ATTRS_o_ai |
| 163 | vec_add(vector unsigned char a, vector bool char b) |
| 164 | { |
| 165 | return a + (vector unsigned char)b; |
| 166 | } |
| 167 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 168 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 169 | vec_add(vector short a, vector short b) |
| 170 | { |
| 171 | return a + b; |
| 172 | } |
| 173 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 174 | static vector short __ATTRS_o_ai |
| 175 | vec_add(vector bool short a, vector short b) |
| 176 | { |
| 177 | return (vector short)a + b; |
| 178 | } |
| 179 | |
| 180 | static vector short __ATTRS_o_ai |
| 181 | vec_add(vector short a, vector bool short b) |
| 182 | { |
| 183 | return a + (vector short)b; |
| 184 | } |
| 185 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 186 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 187 | vec_add(vector unsigned short a, vector unsigned short b) |
| 188 | { |
| 189 | return a + b; |
| 190 | } |
| 191 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 192 | static vector unsigned short __ATTRS_o_ai |
| 193 | vec_add(vector bool short a, vector unsigned short b) |
| 194 | { |
| 195 | return (vector unsigned short)a + b; |
| 196 | } |
| 197 | |
| 198 | static vector unsigned short __ATTRS_o_ai |
| 199 | vec_add(vector unsigned short a, vector bool short b) |
| 200 | { |
| 201 | return a + (vector unsigned short)b; |
| 202 | } |
| 203 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 204 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 205 | vec_add(vector int a, vector int b) |
| 206 | { |
| 207 | return a + b; |
| 208 | } |
| 209 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 210 | static vector int __ATTRS_o_ai |
| 211 | vec_add(vector bool int a, vector int b) |
| 212 | { |
| 213 | return (vector int)a + b; |
| 214 | } |
| 215 | |
| 216 | static vector int __ATTRS_o_ai |
| 217 | vec_add(vector int a, vector bool int b) |
| 218 | { |
| 219 | return a + (vector int)b; |
| 220 | } |
| 221 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 222 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 223 | vec_add(vector unsigned int a, vector unsigned int b) |
| 224 | { |
| 225 | return a + b; |
| 226 | } |
| 227 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 228 | static vector unsigned int __ATTRS_o_ai |
| 229 | vec_add(vector bool int a, vector unsigned int b) |
| 230 | { |
| 231 | return (vector unsigned int)a + b; |
| 232 | } |
| 233 | |
| 234 | static vector unsigned int __ATTRS_o_ai |
| 235 | vec_add(vector unsigned int a, vector bool int b) |
| 236 | { |
| 237 | return a + (vector unsigned int)b; |
| 238 | } |
| 239 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 240 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 241 | vec_add(vector float a, vector float b) |
| 242 | { |
| 243 | return a + b; |
| 244 | } |
| 245 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 246 | /* vec_vaddubm */ |
| 247 | |
| 248 | #define __builtin_altivec_vaddubm vec_vaddubm |
| 249 | |
| 250 | static vector signed char __ATTRS_o_ai |
| 251 | vec_vaddubm(vector signed char a, vector signed char b) |
| 252 | { |
| 253 | return a + b; |
| 254 | } |
| 255 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 256 | static vector signed char __ATTRS_o_ai |
| 257 | vec_vaddubm(vector bool char a, vector signed char b) |
| 258 | { |
| 259 | return (vector signed char)a + b; |
| 260 | } |
| 261 | |
| 262 | static vector signed char __ATTRS_o_ai |
| 263 | vec_vaddubm(vector signed char a, vector bool char b) |
| 264 | { |
| 265 | return a + (vector signed char)b; |
| 266 | } |
| 267 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 268 | static vector unsigned char __ATTRS_o_ai |
| 269 | vec_vaddubm(vector unsigned char a, vector unsigned char b) |
| 270 | { |
| 271 | return a + b; |
| 272 | } |
| 273 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 274 | static vector unsigned char __ATTRS_o_ai |
| 275 | vec_vaddubm(vector bool char a, vector unsigned char b) |
| 276 | { |
| 277 | return (vector unsigned char)a + b; |
| 278 | } |
| 279 | |
| 280 | static vector unsigned char __ATTRS_o_ai |
| 281 | vec_vaddubm(vector unsigned char a, vector bool char b) |
| 282 | { |
| 283 | return a + (vector unsigned char)b; |
| 284 | } |
| 285 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 286 | /* vec_vadduhm */ |
| 287 | |
| 288 | #define __builtin_altivec_vadduhm vec_vadduhm |
| 289 | |
| 290 | static vector short __ATTRS_o_ai |
| 291 | vec_vadduhm(vector short a, vector short b) |
| 292 | { |
| 293 | return a + b; |
| 294 | } |
| 295 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 296 | static vector short __ATTRS_o_ai |
| 297 | vec_vadduhm(vector bool short a, vector short b) |
| 298 | { |
| 299 | return (vector short)a + b; |
| 300 | } |
| 301 | |
| 302 | static vector short __ATTRS_o_ai |
| 303 | vec_vadduhm(vector short a, vector bool short b) |
| 304 | { |
| 305 | return a + (vector short)b; |
| 306 | } |
| 307 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 308 | static vector unsigned short __ATTRS_o_ai |
| 309 | vec_vadduhm(vector unsigned short a, vector unsigned short b) |
| 310 | { |
| 311 | return a + b; |
| 312 | } |
| 313 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 314 | static vector unsigned short __ATTRS_o_ai |
| 315 | vec_vadduhm(vector bool short a, vector unsigned short b) |
| 316 | { |
| 317 | return (vector unsigned short)a + b; |
| 318 | } |
| 319 | |
| 320 | static vector unsigned short __ATTRS_o_ai |
| 321 | vec_vadduhm(vector unsigned short a, vector bool short b) |
| 322 | { |
| 323 | return a + (vector unsigned short)b; |
| 324 | } |
| 325 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 326 | /* vec_vadduwm */ |
| 327 | |
| 328 | #define __builtin_altivec_vadduwm vec_vadduwm |
| 329 | |
| 330 | static vector int __ATTRS_o_ai |
| 331 | vec_vadduwm(vector int a, vector int b) |
| 332 | { |
| 333 | return a + b; |
| 334 | } |
| 335 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 336 | static vector int __ATTRS_o_ai |
| 337 | vec_vadduwm(vector bool int a, vector int b) |
| 338 | { |
| 339 | return (vector int)a + b; |
| 340 | } |
| 341 | |
| 342 | static vector int __ATTRS_o_ai |
| 343 | vec_vadduwm(vector int a, vector bool int b) |
| 344 | { |
| 345 | return a + (vector int)b; |
| 346 | } |
| 347 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 348 | static vector unsigned int __ATTRS_o_ai |
| 349 | vec_vadduwm(vector unsigned int a, vector unsigned int b) |
| 350 | { |
| 351 | return a + b; |
| 352 | } |
| 353 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 354 | static vector unsigned int __ATTRS_o_ai |
| 355 | vec_vadduwm(vector bool int a, vector unsigned int b) |
| 356 | { |
| 357 | return (vector unsigned int)a + b; |
| 358 | } |
| 359 | |
| 360 | static vector unsigned int __ATTRS_o_ai |
| 361 | vec_vadduwm(vector unsigned int a, vector bool int b) |
| 362 | { |
| 363 | return a + (vector unsigned int)b; |
| 364 | } |
| 365 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 366 | /* vec_vaddfp */ |
| 367 | |
| 368 | #define __builtin_altivec_vaddfp vec_vaddfp |
| 369 | |
| 370 | static vector float __attribute__((__always_inline__)) |
| 371 | vec_vaddfp(vector float a, vector float b) |
| 372 | { |
| 373 | return a + b; |
| 374 | } |
| 375 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 376 | /* vec_addc */ |
| 377 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 378 | static vector unsigned int __attribute__((__always_inline__)) |
| 379 | vec_addc(vector unsigned int a, vector unsigned int b) |
| 380 | { |
| 381 | return __builtin_altivec_vaddcuw(a, b); |
| 382 | } |
| 383 | |
| 384 | /* vec_vaddcuw */ |
| 385 | |
| 386 | static vector unsigned int __attribute__((__always_inline__)) |
| 387 | vec_vaddcuw(vector unsigned int a, vector unsigned int b) |
| 388 | { |
| 389 | return __builtin_altivec_vaddcuw(a, b); |
| 390 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 391 | |
| 392 | /* vec_adds */ |
| 393 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 394 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 395 | vec_adds(vector signed char a, vector signed char b) |
| 396 | { |
| 397 | return __builtin_altivec_vaddsbs(a, b); |
| 398 | } |
| 399 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 400 | static vector signed char __ATTRS_o_ai |
| 401 | vec_adds(vector bool char a, vector signed char b) |
| 402 | { |
| 403 | return __builtin_altivec_vaddsbs((vector signed char)a, b); |
| 404 | } |
| 405 | |
| 406 | static vector signed char __ATTRS_o_ai |
| 407 | vec_adds(vector signed char a, vector bool char b) |
| 408 | { |
| 409 | return __builtin_altivec_vaddsbs(a, (vector signed char)b); |
| 410 | } |
| 411 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 412 | static vector unsigned char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 413 | vec_adds(vector unsigned char a, vector unsigned char b) |
| 414 | { |
| 415 | return __builtin_altivec_vaddubs(a, b); |
| 416 | } |
| 417 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 418 | static vector unsigned char __ATTRS_o_ai |
| 419 | vec_adds(vector bool char a, vector unsigned char b) |
| 420 | { |
| 421 | return __builtin_altivec_vaddubs((vector unsigned char)a, b); |
| 422 | } |
| 423 | |
| 424 | static vector unsigned char __ATTRS_o_ai |
| 425 | vec_adds(vector unsigned char a, vector bool char b) |
| 426 | { |
| 427 | return __builtin_altivec_vaddubs(a, (vector unsigned char)b); |
| 428 | } |
| 429 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 430 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 431 | vec_adds(vector short a, vector short b) |
| 432 | { |
| 433 | return __builtin_altivec_vaddshs(a, b); |
| 434 | } |
| 435 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 436 | static vector short __ATTRS_o_ai |
| 437 | vec_adds(vector bool short a, vector short b) |
| 438 | { |
| 439 | return __builtin_altivec_vaddshs((vector short)a, b); |
| 440 | } |
| 441 | |
| 442 | static vector short __ATTRS_o_ai |
| 443 | vec_adds(vector short a, vector bool short b) |
| 444 | { |
| 445 | return __builtin_altivec_vaddshs(a, (vector short)b); |
| 446 | } |
| 447 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 448 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 449 | vec_adds(vector unsigned short a, vector unsigned short b) |
| 450 | { |
| 451 | return __builtin_altivec_vadduhs(a, b); |
| 452 | } |
| 453 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 454 | static vector unsigned short __ATTRS_o_ai |
| 455 | vec_adds(vector bool short a, vector unsigned short b) |
| 456 | { |
| 457 | return __builtin_altivec_vadduhs((vector unsigned short)a, b); |
| 458 | } |
| 459 | |
| 460 | static vector unsigned short __ATTRS_o_ai |
| 461 | vec_adds(vector unsigned short a, vector bool short b) |
| 462 | { |
| 463 | return __builtin_altivec_vadduhs(a, (vector unsigned short)b); |
| 464 | } |
| 465 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 466 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 467 | vec_adds(vector int a, vector int b) |
| 468 | { |
| 469 | return __builtin_altivec_vaddsws(a, b); |
| 470 | } |
| 471 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 472 | static vector int __ATTRS_o_ai |
| 473 | vec_adds(vector bool int a, vector int b) |
| 474 | { |
| 475 | return __builtin_altivec_vaddsws((vector int)a, b); |
| 476 | } |
| 477 | |
| 478 | static vector int __ATTRS_o_ai |
| 479 | vec_adds(vector int a, vector bool int b) |
| 480 | { |
| 481 | return __builtin_altivec_vaddsws(a, (vector int)b); |
| 482 | } |
| 483 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 484 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 485 | vec_adds(vector unsigned int a, vector unsigned int b) |
| 486 | { |
| 487 | return __builtin_altivec_vadduws(a, b); |
| 488 | } |
| 489 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 490 | static vector unsigned int __ATTRS_o_ai |
| 491 | vec_adds(vector bool int a, vector unsigned int b) |
| 492 | { |
| 493 | return __builtin_altivec_vadduws((vector unsigned int)a, b); |
| 494 | } |
| 495 | |
| 496 | static vector unsigned int __ATTRS_o_ai |
| 497 | vec_adds(vector unsigned int a, vector bool int b) |
| 498 | { |
| 499 | return __builtin_altivec_vadduws(a, (vector unsigned int)b); |
| 500 | } |
| 501 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 502 | /* vec_vaddsbs */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 503 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 504 | static vector signed char __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 505 | vec_vaddsbs(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 506 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 507 | return __builtin_altivec_vaddsbs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 508 | } |
| 509 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 510 | static vector signed char __ATTRS_o_ai |
| 511 | vec_vaddsbs(vector bool char a, vector signed char b) |
| 512 | { |
| 513 | return __builtin_altivec_vaddsbs((vector signed char)a, b); |
| 514 | } |
| 515 | |
| 516 | static vector signed char __ATTRS_o_ai |
| 517 | vec_vaddsbs(vector signed char a, vector bool char b) |
| 518 | { |
| 519 | return __builtin_altivec_vaddsbs(a, (vector signed char)b); |
| 520 | } |
| 521 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 522 | /* vec_vaddubs */ |
| 523 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 524 | static vector unsigned char __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 525 | vec_vaddubs(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 526 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 527 | return __builtin_altivec_vaddubs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 528 | } |
| 529 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 530 | static vector unsigned char __ATTRS_o_ai |
| 531 | vec_vaddubs(vector bool char a, vector unsigned char b) |
| 532 | { |
| 533 | return __builtin_altivec_vaddubs((vector unsigned char)a, b); |
| 534 | } |
| 535 | |
| 536 | static vector unsigned char __ATTRS_o_ai |
| 537 | vec_vaddubs(vector unsigned char a, vector bool char b) |
| 538 | { |
| 539 | return __builtin_altivec_vaddubs(a, (vector unsigned char)b); |
| 540 | } |
| 541 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 542 | /* vec_vaddshs */ |
| 543 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 544 | static vector short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 545 | vec_vaddshs(vector short a, vector short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 546 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 547 | return __builtin_altivec_vaddshs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 548 | } |
| 549 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 550 | static vector short __ATTRS_o_ai |
| 551 | vec_vaddshs(vector bool short a, vector short b) |
| 552 | { |
| 553 | return __builtin_altivec_vaddshs((vector short)a, b); |
| 554 | } |
| 555 | |
| 556 | static vector short __ATTRS_o_ai |
| 557 | vec_vaddshs(vector short a, vector bool short b) |
| 558 | { |
| 559 | return __builtin_altivec_vaddshs(a, (vector short)b); |
| 560 | } |
| 561 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 562 | /* vec_vadduhs */ |
| 563 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 564 | static vector unsigned short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 565 | vec_vadduhs(vector unsigned short a, vector unsigned short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 566 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 567 | return __builtin_altivec_vadduhs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 568 | } |
| 569 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 570 | static vector unsigned short __ATTRS_o_ai |
| 571 | vec_vadduhs(vector bool short a, vector unsigned short b) |
| 572 | { |
| 573 | return __builtin_altivec_vadduhs((vector unsigned short)a, b); |
| 574 | } |
| 575 | |
| 576 | static vector unsigned short __ATTRS_o_ai |
| 577 | vec_vadduhs(vector unsigned short a, vector bool short b) |
| 578 | { |
| 579 | return __builtin_altivec_vadduhs(a, (vector unsigned short)b); |
| 580 | } |
| 581 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 582 | /* vec_vaddsws */ |
| 583 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 584 | static vector int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 585 | vec_vaddsws(vector int a, vector int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 586 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 587 | return __builtin_altivec_vaddsws(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 588 | } |
| 589 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 590 | static vector int __ATTRS_o_ai |
| 591 | vec_vaddsws(vector bool int a, vector int b) |
| 592 | { |
| 593 | return __builtin_altivec_vaddsws((vector int)a, b); |
| 594 | } |
| 595 | |
| 596 | static vector int __ATTRS_o_ai |
| 597 | vec_vaddsws(vector int a, vector bool int b) |
| 598 | { |
| 599 | return __builtin_altivec_vaddsws(a, (vector int)b); |
| 600 | } |
| 601 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 602 | /* vec_vadduws */ |
| 603 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 604 | static vector unsigned int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 605 | vec_vadduws(vector unsigned int a, vector unsigned int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 606 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 607 | return __builtin_altivec_vadduws(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 608 | } |
| 609 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 610 | static vector unsigned int __ATTRS_o_ai |
| 611 | vec_vadduws(vector bool int a, vector unsigned int b) |
| 612 | { |
| 613 | return __builtin_altivec_vadduws((vector unsigned int)a, b); |
| 614 | } |
| 615 | |
| 616 | static vector unsigned int __ATTRS_o_ai |
| 617 | vec_vadduws(vector unsigned int a, vector bool int b) |
| 618 | { |
| 619 | return __builtin_altivec_vadduws(a, (vector unsigned int)b); |
| 620 | } |
| 621 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 622 | /* vec_and */ |
| 623 | |
| 624 | #define __builtin_altivec_vand vec_and |
| 625 | |
| 626 | static vector signed char __ATTRS_o_ai |
| 627 | vec_and(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 628 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 629 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 630 | } |
| 631 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 632 | static vector signed char __ATTRS_o_ai |
| 633 | vec_and(vector bool char a, vector signed char b) |
| 634 | { |
| 635 | return (vector signed char)a & b; |
| 636 | } |
| 637 | |
| 638 | static vector signed char __ATTRS_o_ai |
| 639 | vec_and(vector signed char a, vector bool char b) |
| 640 | { |
| 641 | return a & (vector signed char)b; |
| 642 | } |
| 643 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 644 | static vector unsigned char __ATTRS_o_ai |
| 645 | vec_and(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 646 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 647 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 648 | } |
| 649 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 650 | static vector unsigned char __ATTRS_o_ai |
| 651 | vec_and(vector bool char a, vector unsigned char b) |
| 652 | { |
| 653 | return (vector unsigned char)a & b; |
| 654 | } |
| 655 | |
| 656 | static vector unsigned char __ATTRS_o_ai |
| 657 | vec_and(vector unsigned char a, vector bool char b) |
| 658 | { |
| 659 | return a & (vector unsigned char)b; |
| 660 | } |
| 661 | |
| 662 | static vector bool char __ATTRS_o_ai |
| 663 | vec_and(vector bool char a, vector bool char b) |
| 664 | { |
| 665 | return a & b; |
| 666 | } |
| 667 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 668 | static vector short __ATTRS_o_ai |
| 669 | vec_and(vector short a, vector short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 670 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 671 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 672 | } |
| 673 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 674 | static vector short __ATTRS_o_ai |
| 675 | vec_and(vector bool short a, vector short b) |
| 676 | { |
| 677 | return (vector short)a & b; |
| 678 | } |
| 679 | |
| 680 | static vector short __ATTRS_o_ai |
| 681 | vec_and(vector short a, vector bool short b) |
| 682 | { |
| 683 | return a & (vector short)b; |
| 684 | } |
| 685 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 686 | static vector unsigned short __ATTRS_o_ai |
| 687 | vec_and(vector unsigned short a, vector unsigned short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 688 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 689 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 690 | } |
| 691 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 692 | static vector unsigned short __ATTRS_o_ai |
| 693 | vec_and(vector bool short a, vector unsigned short b) |
| 694 | { |
| 695 | return (vector unsigned short)a & b; |
| 696 | } |
| 697 | |
| 698 | static vector unsigned short __ATTRS_o_ai |
| 699 | vec_and(vector unsigned short a, vector bool short b) |
| 700 | { |
| 701 | return a & (vector unsigned short)b; |
| 702 | } |
| 703 | |
| 704 | static vector bool short __ATTRS_o_ai |
| 705 | vec_and(vector bool short a, vector bool short b) |
| 706 | { |
| 707 | return a & b; |
| 708 | } |
| 709 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 710 | static vector int __ATTRS_o_ai |
| 711 | vec_and(vector int a, vector int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 712 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 713 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 714 | } |
| 715 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 716 | static vector int __ATTRS_o_ai |
| 717 | vec_and(vector bool int a, vector int b) |
| 718 | { |
| 719 | return (vector int)a & b; |
| 720 | } |
| 721 | |
| 722 | static vector int __ATTRS_o_ai |
| 723 | vec_and(vector int a, vector bool int b) |
| 724 | { |
| 725 | return a & (vector int)b; |
| 726 | } |
| 727 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 728 | static vector unsigned int __ATTRS_o_ai |
| 729 | vec_and(vector unsigned int a, vector unsigned int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 730 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 731 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 732 | } |
| 733 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 734 | static vector unsigned int __ATTRS_o_ai |
| 735 | vec_and(vector bool int a, vector unsigned int b) |
| 736 | { |
| 737 | return (vector unsigned int)a & b; |
| 738 | } |
| 739 | |
| 740 | static vector unsigned int __ATTRS_o_ai |
| 741 | vec_and(vector unsigned int a, vector bool int b) |
| 742 | { |
| 743 | return a & (vector unsigned int)b; |
| 744 | } |
| 745 | |
| 746 | static vector bool int __ATTRS_o_ai |
| 747 | vec_and(vector bool int a, vector bool int b) |
| 748 | { |
| 749 | return a & b; |
| 750 | } |
| 751 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 752 | static vector float __ATTRS_o_ai |
| 753 | vec_and(vector float a, vector float b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 754 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 755 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 756 | return (vector float)res; |
| 757 | } |
| 758 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 759 | static vector float __ATTRS_o_ai |
| 760 | vec_and(vector bool int a, vector float b) |
| 761 | { |
| 762 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 763 | return (vector float)res; |
| 764 | } |
| 765 | |
| 766 | static vector float __ATTRS_o_ai |
| 767 | vec_and(vector float a, vector bool int b) |
| 768 | { |
| 769 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 770 | return (vector float)res; |
| 771 | } |
| 772 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 773 | /* vec_vand */ |
| 774 | |
| 775 | static vector signed char __ATTRS_o_ai |
| 776 | vec_vand(vector signed char a, vector signed char b) |
| 777 | { |
| 778 | return a & b; |
| 779 | } |
| 780 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 781 | static vector signed char __ATTRS_o_ai |
| 782 | vec_vand(vector bool char a, vector signed char b) |
| 783 | { |
| 784 | return (vector signed char)a & b; |
| 785 | } |
| 786 | |
| 787 | static vector signed char __ATTRS_o_ai |
| 788 | vec_vand(vector signed char a, vector bool char b) |
| 789 | { |
| 790 | return a & (vector signed char)b; |
| 791 | } |
| 792 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 793 | static vector unsigned char __ATTRS_o_ai |
| 794 | vec_vand(vector unsigned char a, vector unsigned char b) |
| 795 | { |
| 796 | return a & b; |
| 797 | } |
| 798 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 799 | static vector unsigned char __ATTRS_o_ai |
| 800 | vec_vand(vector bool char a, vector unsigned char b) |
| 801 | { |
| 802 | return (vector unsigned char)a & b; |
| 803 | } |
| 804 | |
| 805 | static vector unsigned char __ATTRS_o_ai |
| 806 | vec_vand(vector unsigned char a, vector bool char b) |
| 807 | { |
| 808 | return a & (vector unsigned char)b; |
| 809 | } |
| 810 | |
| 811 | static vector bool char __ATTRS_o_ai |
| 812 | vec_vand(vector bool char a, vector bool char b) |
| 813 | { |
| 814 | return a & b; |
| 815 | } |
| 816 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 817 | static vector short __ATTRS_o_ai |
| 818 | vec_vand(vector short a, vector short b) |
| 819 | { |
| 820 | return a & b; |
| 821 | } |
| 822 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 823 | static vector short __ATTRS_o_ai |
| 824 | vec_vand(vector bool short a, vector short b) |
| 825 | { |
| 826 | return (vector short)a & b; |
| 827 | } |
| 828 | |
| 829 | static vector short __ATTRS_o_ai |
| 830 | vec_vand(vector short a, vector bool short b) |
| 831 | { |
| 832 | return a & (vector short)b; |
| 833 | } |
| 834 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 835 | static vector unsigned short __ATTRS_o_ai |
| 836 | vec_vand(vector unsigned short a, vector unsigned short b) |
| 837 | { |
| 838 | return a & b; |
| 839 | } |
| 840 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 841 | static vector unsigned short __ATTRS_o_ai |
| 842 | vec_vand(vector bool short a, vector unsigned short b) |
| 843 | { |
| 844 | return (vector unsigned short)a & b; |
| 845 | } |
| 846 | |
| 847 | static vector unsigned short __ATTRS_o_ai |
| 848 | vec_vand(vector unsigned short a, vector bool short b) |
| 849 | { |
| 850 | return a & (vector unsigned short)b; |
| 851 | } |
| 852 | |
| 853 | static vector bool short __ATTRS_o_ai |
| 854 | vec_vand(vector bool short a, vector bool short b) |
| 855 | { |
| 856 | return a & b; |
| 857 | } |
| 858 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 859 | static vector int __ATTRS_o_ai |
| 860 | vec_vand(vector int a, vector int b) |
| 861 | { |
| 862 | return a & b; |
| 863 | } |
| 864 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 865 | static vector int __ATTRS_o_ai |
| 866 | vec_vand(vector bool int a, vector int b) |
| 867 | { |
| 868 | return (vector int)a & b; |
| 869 | } |
| 870 | |
| 871 | static vector int __ATTRS_o_ai |
| 872 | vec_vand(vector int a, vector bool int b) |
| 873 | { |
| 874 | return a & (vector int)b; |
| 875 | } |
| 876 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 877 | static vector unsigned int __ATTRS_o_ai |
| 878 | vec_vand(vector unsigned int a, vector unsigned int b) |
| 879 | { |
| 880 | return a & b; |
| 881 | } |
| 882 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 883 | static vector unsigned int __ATTRS_o_ai |
| 884 | vec_vand(vector bool int a, vector unsigned int b) |
| 885 | { |
| 886 | return (vector unsigned int)a & b; |
| 887 | } |
| 888 | |
| 889 | static vector unsigned int __ATTRS_o_ai |
| 890 | vec_vand(vector unsigned int a, vector bool int b) |
| 891 | { |
| 892 | return a & (vector unsigned int)b; |
| 893 | } |
| 894 | |
| 895 | static vector bool int __ATTRS_o_ai |
| 896 | vec_vand(vector bool int a, vector bool int b) |
| 897 | { |
| 898 | return a & b; |
| 899 | } |
| 900 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 901 | static vector float __ATTRS_o_ai |
| 902 | vec_vand(vector float a, vector float b) |
| 903 | { |
| 904 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 905 | return (vector float)res; |
| 906 | } |
| 907 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 908 | static vector float __ATTRS_o_ai |
| 909 | vec_vand(vector bool int a, vector float b) |
| 910 | { |
| 911 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 912 | return (vector float)res; |
| 913 | } |
| 914 | |
| 915 | static vector float __ATTRS_o_ai |
| 916 | vec_vand(vector float a, vector bool int b) |
| 917 | { |
| 918 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 919 | return (vector float)res; |
| 920 | } |
| 921 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 922 | /* vec_andc */ |
| 923 | |
| 924 | #define __builtin_altivec_vandc vec_andc |
| 925 | |
| 926 | static vector signed char __ATTRS_o_ai |
| 927 | vec_andc(vector signed char a, vector signed char b) |
| 928 | { |
| 929 | return a & ~b; |
| 930 | } |
| 931 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 932 | static vector signed char __ATTRS_o_ai |
| 933 | vec_andc(vector bool char a, vector signed char b) |
| 934 | { |
| 935 | return (vector signed char)a & ~b; |
| 936 | } |
| 937 | |
| 938 | static vector signed char __ATTRS_o_ai |
| 939 | vec_andc(vector signed char a, vector bool char b) |
| 940 | { |
| 941 | return a & ~(vector signed char)b; |
| 942 | } |
| 943 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 944 | static vector unsigned char __ATTRS_o_ai |
| 945 | vec_andc(vector unsigned char a, vector unsigned char b) |
| 946 | { |
| 947 | return a & ~b; |
| 948 | } |
| 949 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 950 | static vector unsigned char __ATTRS_o_ai |
| 951 | vec_andc(vector bool char a, vector unsigned char b) |
| 952 | { |
| 953 | return (vector unsigned char)a & ~b; |
| 954 | } |
| 955 | |
| 956 | static vector unsigned char __ATTRS_o_ai |
| 957 | vec_andc(vector unsigned char a, vector bool char b) |
| 958 | { |
| 959 | return a & ~(vector unsigned char)b; |
| 960 | } |
| 961 | |
| 962 | static vector bool char __ATTRS_o_ai |
| 963 | vec_andc(vector bool char a, vector bool char b) |
| 964 | { |
| 965 | return a & ~b; |
| 966 | } |
| 967 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 968 | static vector short __ATTRS_o_ai |
| 969 | vec_andc(vector short a, vector short b) |
| 970 | { |
| 971 | return a & ~b; |
| 972 | } |
| 973 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 974 | static vector short __ATTRS_o_ai |
| 975 | vec_andc(vector bool short a, vector short b) |
| 976 | { |
| 977 | return (vector short)a & ~b; |
| 978 | } |
| 979 | |
| 980 | static vector short __ATTRS_o_ai |
| 981 | vec_andc(vector short a, vector bool short b) |
| 982 | { |
| 983 | return a & ~(vector short)b; |
| 984 | } |
| 985 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 986 | static vector unsigned short __ATTRS_o_ai |
| 987 | vec_andc(vector unsigned short a, vector unsigned short b) |
| 988 | { |
| 989 | return a & ~b; |
| 990 | } |
| 991 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 992 | static vector unsigned short __ATTRS_o_ai |
| 993 | vec_andc(vector bool short a, vector unsigned short b) |
| 994 | { |
| 995 | return (vector unsigned short)a & ~b; |
| 996 | } |
| 997 | |
| 998 | static vector unsigned short __ATTRS_o_ai |
| 999 | vec_andc(vector unsigned short a, vector bool short b) |
| 1000 | { |
| 1001 | return a & ~(vector unsigned short)b; |
| 1002 | } |
| 1003 | |
| 1004 | static vector bool short __ATTRS_o_ai |
| 1005 | vec_andc(vector bool short a, vector bool short b) |
| 1006 | { |
| 1007 | return a & ~b; |
| 1008 | } |
| 1009 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1010 | static vector int __ATTRS_o_ai |
| 1011 | vec_andc(vector int a, vector int b) |
| 1012 | { |
| 1013 | return a & ~b; |
| 1014 | } |
| 1015 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1016 | static vector int __ATTRS_o_ai |
| 1017 | vec_andc(vector bool int a, vector int b) |
| 1018 | { |
| 1019 | return (vector int)a & ~b; |
| 1020 | } |
| 1021 | |
| 1022 | static vector int __ATTRS_o_ai |
| 1023 | vec_andc(vector int a, vector bool int b) |
| 1024 | { |
| 1025 | return a & ~(vector int)b; |
| 1026 | } |
| 1027 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1028 | static vector unsigned int __ATTRS_o_ai |
| 1029 | vec_andc(vector unsigned int a, vector unsigned int b) |
| 1030 | { |
| 1031 | return a & ~b; |
| 1032 | } |
| 1033 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1034 | static vector unsigned int __ATTRS_o_ai |
| 1035 | vec_andc(vector bool int a, vector unsigned int b) |
| 1036 | { |
| 1037 | return (vector unsigned int)a & ~b; |
| 1038 | } |
| 1039 | |
| 1040 | static vector unsigned int __ATTRS_o_ai |
| 1041 | vec_andc(vector unsigned int a, vector bool int b) |
| 1042 | { |
| 1043 | return a & ~(vector unsigned int)b; |
| 1044 | } |
| 1045 | |
| 1046 | static vector bool int __ATTRS_o_ai |
| 1047 | vec_andc(vector bool int a, vector bool int b) |
| 1048 | { |
| 1049 | return a & ~b; |
| 1050 | } |
| 1051 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1052 | static vector float __ATTRS_o_ai |
| 1053 | vec_andc(vector float a, vector float b) |
| 1054 | { |
| 1055 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 1056 | return (vector float)res; |
| 1057 | } |
| 1058 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1059 | static vector float __ATTRS_o_ai |
| 1060 | vec_andc(vector bool int a, vector float b) |
| 1061 | { |
| 1062 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 1063 | return (vector float)res; |
| 1064 | } |
| 1065 | |
| 1066 | static vector float __ATTRS_o_ai |
| 1067 | vec_andc(vector float a, vector bool int b) |
| 1068 | { |
| 1069 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 1070 | return (vector float)res; |
| 1071 | } |
| 1072 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1073 | /* vec_vandc */ |
| 1074 | |
| 1075 | static vector signed char __ATTRS_o_ai |
| 1076 | vec_vandc(vector signed char a, vector signed char b) |
| 1077 | { |
| 1078 | return a & ~b; |
| 1079 | } |
| 1080 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1081 | static vector signed char __ATTRS_o_ai |
| 1082 | vec_vandc(vector bool char a, vector signed char b) |
| 1083 | { |
| 1084 | return (vector signed char)a & ~b; |
| 1085 | } |
| 1086 | |
| 1087 | static vector signed char __ATTRS_o_ai |
| 1088 | vec_vandc(vector signed char a, vector bool char b) |
| 1089 | { |
| 1090 | return a & ~(vector signed char)b; |
| 1091 | } |
| 1092 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1093 | static vector unsigned char __ATTRS_o_ai |
| 1094 | vec_vandc(vector unsigned char a, vector unsigned char b) |
| 1095 | { |
| 1096 | return a & ~b; |
| 1097 | } |
| 1098 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1099 | static vector unsigned char __ATTRS_o_ai |
| 1100 | vec_vandc(vector bool char a, vector unsigned char b) |
| 1101 | { |
| 1102 | return (vector unsigned char)a & ~b; |
| 1103 | } |
| 1104 | |
| 1105 | static vector unsigned char __ATTRS_o_ai |
| 1106 | vec_vandc(vector unsigned char a, vector bool char b) |
| 1107 | { |
| 1108 | return a & ~(vector unsigned char)b; |
| 1109 | } |
| 1110 | |
| 1111 | static vector bool char __ATTRS_o_ai |
| 1112 | vec_vandc(vector bool char a, vector bool char b) |
| 1113 | { |
| 1114 | return a & ~b; |
| 1115 | } |
| 1116 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1117 | static vector short __ATTRS_o_ai |
| 1118 | vec_vandc(vector short a, vector short b) |
| 1119 | { |
| 1120 | return a & ~b; |
| 1121 | } |
| 1122 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1123 | static vector short __ATTRS_o_ai |
| 1124 | vec_vandc(vector bool short a, vector short b) |
| 1125 | { |
| 1126 | return (vector short)a & ~b; |
| 1127 | } |
| 1128 | |
| 1129 | static vector short __ATTRS_o_ai |
| 1130 | vec_vandc(vector short a, vector bool short b) |
| 1131 | { |
| 1132 | return a & ~(vector short)b; |
| 1133 | } |
| 1134 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1135 | static vector unsigned short __ATTRS_o_ai |
| 1136 | vec_vandc(vector unsigned short a, vector unsigned short b) |
| 1137 | { |
| 1138 | return a & ~b; |
| 1139 | } |
| 1140 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1141 | static vector unsigned short __ATTRS_o_ai |
| 1142 | vec_vandc(vector bool short a, vector unsigned short b) |
| 1143 | { |
| 1144 | return (vector unsigned short)a & ~b; |
| 1145 | } |
| 1146 | |
| 1147 | static vector unsigned short __ATTRS_o_ai |
| 1148 | vec_vandc(vector unsigned short a, vector bool short b) |
| 1149 | { |
| 1150 | return a & ~(vector unsigned short)b; |
| 1151 | } |
| 1152 | |
| 1153 | static vector bool short __ATTRS_o_ai |
| 1154 | vec_vandc(vector bool short a, vector bool short b) |
| 1155 | { |
| 1156 | return a & ~b; |
| 1157 | } |
| 1158 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1159 | static vector int __ATTRS_o_ai |
| 1160 | vec_vandc(vector int a, vector int b) |
| 1161 | { |
| 1162 | return a & ~b; |
| 1163 | } |
| 1164 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1165 | static vector int __ATTRS_o_ai |
| 1166 | vec_vandc(vector bool int a, vector int b) |
| 1167 | { |
| 1168 | return (vector int)a & ~b; |
| 1169 | } |
| 1170 | |
| 1171 | static vector int __ATTRS_o_ai |
| 1172 | vec_vandc(vector int a, vector bool int b) |
| 1173 | { |
| 1174 | return a & ~(vector int)b; |
| 1175 | } |
| 1176 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1177 | static vector unsigned int __ATTRS_o_ai |
| 1178 | vec_vandc(vector unsigned int a, vector unsigned int b) |
| 1179 | { |
| 1180 | return a & ~b; |
| 1181 | } |
| 1182 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1183 | static vector unsigned int __ATTRS_o_ai |
| 1184 | vec_vandc(vector bool int a, vector unsigned int b) |
| 1185 | { |
| 1186 | return (vector unsigned int)a & ~b; |
| 1187 | } |
| 1188 | |
| 1189 | static vector unsigned int __ATTRS_o_ai |
| 1190 | vec_vandc(vector unsigned int a, vector bool int b) |
| 1191 | { |
| 1192 | return a & ~(vector unsigned int)b; |
| 1193 | } |
| 1194 | |
| 1195 | static vector bool int __ATTRS_o_ai |
| 1196 | vec_vandc(vector bool int a, vector bool int b) |
| 1197 | { |
| 1198 | return a & ~b; |
| 1199 | } |
| 1200 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1201 | static vector float __ATTRS_o_ai |
| 1202 | vec_vandc(vector float a, vector float b) |
| 1203 | { |
| 1204 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 1205 | return (vector float)res; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1206 | } |
| 1207 | |
Anton Yartsev | 05e3555 | 2010-08-16 16:22:12 +0000 | [diff] [blame] | 1208 | static vector float __ATTRS_o_ai |
| 1209 | vec_vandc(vector bool int a, vector float b) |
| 1210 | { |
| 1211 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 1212 | return (vector float)res; |
| 1213 | } |
| 1214 | |
| 1215 | static vector float __ATTRS_o_ai |
| 1216 | vec_vandc(vector float a, vector bool int b) |
| 1217 | { |
| 1218 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 1219 | return (vector float)res; |
| 1220 | } |
| 1221 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1222 | /* vec_avg */ |
| 1223 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1224 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1225 | vec_avg(vector signed char a, vector signed char b) |
| 1226 | { |
| 1227 | return __builtin_altivec_vavgsb(a, b); |
| 1228 | } |
| 1229 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1230 | static vector unsigned char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1231 | vec_avg(vector unsigned char a, vector unsigned char b) |
| 1232 | { |
| 1233 | return __builtin_altivec_vavgub(a, b); |
| 1234 | } |
| 1235 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1236 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1237 | vec_avg(vector short a, vector short b) |
| 1238 | { |
| 1239 | return __builtin_altivec_vavgsh(a, b); |
| 1240 | } |
| 1241 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1242 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1243 | vec_avg(vector unsigned short a, vector unsigned short b) |
| 1244 | { |
| 1245 | return __builtin_altivec_vavguh(a, b); |
| 1246 | } |
| 1247 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1248 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1249 | vec_avg(vector int a, vector int b) |
| 1250 | { |
| 1251 | return __builtin_altivec_vavgsw(a, b); |
| 1252 | } |
| 1253 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1254 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1255 | vec_avg(vector unsigned int a, vector unsigned int b) |
| 1256 | { |
| 1257 | return __builtin_altivec_vavguw(a, b); |
| 1258 | } |
| 1259 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1260 | /* vec_vavgsb */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1261 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1262 | static vector signed char __attribute__((__always_inline__)) |
| 1263 | vec_vavgsb(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1264 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1265 | return __builtin_altivec_vavgsb(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1266 | } |
| 1267 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1268 | /* vec_vavgub */ |
| 1269 | |
| 1270 | static vector unsigned char __attribute__((__always_inline__)) |
| 1271 | vec_vavgub(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1272 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1273 | return __builtin_altivec_vavgub(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1274 | } |
| 1275 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1276 | /* vec_vavgsh */ |
| 1277 | |
| 1278 | static vector short __attribute__((__always_inline__)) |
| 1279 | vec_vavgsh(vector short a, vector short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1280 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1281 | return __builtin_altivec_vavgsh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1282 | } |
| 1283 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1284 | /* vec_vavguh */ |
| 1285 | |
| 1286 | static vector unsigned short __attribute__((__always_inline__)) |
| 1287 | vec_vavguh(vector unsigned short a, vector unsigned short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1288 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1289 | return __builtin_altivec_vavguh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1290 | } |
| 1291 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1292 | /* vec_vavgsw */ |
| 1293 | |
| 1294 | static vector int __attribute__((__always_inline__)) |
| 1295 | vec_vavgsw(vector int a, vector int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1296 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1297 | return __builtin_altivec_vavgsw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1298 | } |
| 1299 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1300 | /* vec_vavguw */ |
| 1301 | |
| 1302 | static vector unsigned int __attribute__((__always_inline__)) |
| 1303 | vec_vavguw(vector unsigned int a, vector unsigned int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1304 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1305 | return __builtin_altivec_vavguw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1306 | } |
| 1307 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1308 | /* vec_ceil */ |
| 1309 | |
| 1310 | static vector float __attribute__((__always_inline__)) |
| 1311 | vec_ceil(vector float a) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1312 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1313 | return __builtin_altivec_vrfip(a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1314 | } |
| 1315 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1316 | /* vec_vrfip */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1317 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1318 | static vector float __attribute__((__always_inline__)) |
| 1319 | vec_vrfip(vector float a) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1320 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1321 | return __builtin_altivec_vrfip(a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1322 | } |
| 1323 | |
| 1324 | /* vec_cmpb */ |
| 1325 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1326 | static vector int __attribute__((__always_inline__)) |
| 1327 | vec_cmpb(vector float a, vector float b) |
| 1328 | { |
| 1329 | return __builtin_altivec_vcmpbfp(a, b); |
| 1330 | } |
| 1331 | |
| 1332 | /* vec_vcmpbfp */ |
| 1333 | |
| 1334 | static vector int __attribute__((__always_inline__)) |
| 1335 | vec_vcmpbfp(vector float a, vector float b) |
| 1336 | { |
| 1337 | return __builtin_altivec_vcmpbfp(a, b); |
| 1338 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1339 | |
| 1340 | /* vec_cmpeq */ |
| 1341 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1342 | static vector bool char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1343 | vec_cmpeq(vector signed char a, vector signed char b) |
| 1344 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1345 | return (vector bool char) |
| 1346 | __builtin_altivec_vcmpequb((vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1347 | } |
| 1348 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1349 | static vector bool char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1350 | vec_cmpeq(vector unsigned char a, vector unsigned char b) |
| 1351 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1352 | return (vector bool char) |
| 1353 | __builtin_altivec_vcmpequb((vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1354 | } |
| 1355 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1356 | static vector bool short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1357 | vec_cmpeq(vector short a, vector short b) |
| 1358 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1359 | return (vector bool short)__builtin_altivec_vcmpequh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1360 | } |
| 1361 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1362 | static vector bool short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1363 | vec_cmpeq(vector unsigned short a, vector unsigned short b) |
| 1364 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1365 | return (vector bool short) |
| 1366 | __builtin_altivec_vcmpequh((vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1367 | } |
| 1368 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1369 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1370 | vec_cmpeq(vector int a, vector int b) |
| 1371 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1372 | return (vector bool int)__builtin_altivec_vcmpequw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1373 | } |
| 1374 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1375 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1376 | vec_cmpeq(vector unsigned int a, vector unsigned int b) |
| 1377 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1378 | return (vector bool int) |
| 1379 | __builtin_altivec_vcmpequw((vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1380 | } |
| 1381 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1382 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1383 | vec_cmpeq(vector float a, vector float b) |
| 1384 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1385 | return (vector bool int)__builtin_altivec_vcmpeqfp(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1386 | } |
| 1387 | |
| 1388 | /* vec_cmpge */ |
| 1389 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1390 | static vector bool int __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1391 | vec_cmpge(vector float a, vector float b) |
| 1392 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1393 | return (vector bool int)__builtin_altivec_vcmpgefp(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1394 | } |
| 1395 | |
| 1396 | /* vec_vcmpgefp */ |
| 1397 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1398 | static vector bool int __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1399 | vec_vcmpgefp(vector float a, vector float b) |
| 1400 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1401 | return (vector bool int)__builtin_altivec_vcmpgefp(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1402 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1403 | |
| 1404 | /* vec_cmpgt */ |
| 1405 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1406 | static vector bool char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1407 | vec_cmpgt(vector signed char a, vector signed char b) |
| 1408 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1409 | return (vector bool char)__builtin_altivec_vcmpgtsb(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1410 | } |
| 1411 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1412 | static vector bool char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1413 | vec_cmpgt(vector unsigned char a, vector unsigned char b) |
| 1414 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1415 | return (vector bool char)__builtin_altivec_vcmpgtub(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1416 | } |
| 1417 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1418 | static vector bool short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1419 | vec_cmpgt(vector short a, vector short b) |
| 1420 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1421 | return (vector bool short)__builtin_altivec_vcmpgtsh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1422 | } |
| 1423 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1424 | static vector bool short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1425 | vec_cmpgt(vector unsigned short a, vector unsigned short b) |
| 1426 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1427 | return (vector bool short)__builtin_altivec_vcmpgtuh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1428 | } |
| 1429 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1430 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1431 | vec_cmpgt(vector int a, vector int b) |
| 1432 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1433 | return (vector bool int)__builtin_altivec_vcmpgtsw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1434 | } |
| 1435 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1436 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1437 | vec_cmpgt(vector unsigned int a, vector unsigned int b) |
| 1438 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1439 | return (vector bool int)__builtin_altivec_vcmpgtuw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1440 | } |
| 1441 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1442 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1443 | vec_cmpgt(vector float a, vector float b) |
| 1444 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1445 | return (vector bool int)__builtin_altivec_vcmpgtfp(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1446 | } |
| 1447 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1448 | /* vec_vcmpgtsb */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1449 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1450 | static vector bool char __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1451 | vec_vcmpgtsb(vector signed char a, vector signed char b) |
| 1452 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1453 | return (vector bool char)__builtin_altivec_vcmpgtsb(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1454 | } |
| 1455 | |
| 1456 | /* vec_vcmpgtub */ |
| 1457 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1458 | static vector bool char __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1459 | vec_vcmpgtub(vector unsigned char a, vector unsigned char b) |
| 1460 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1461 | return (vector bool char)__builtin_altivec_vcmpgtub(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1462 | } |
| 1463 | |
| 1464 | /* vec_vcmpgtsh */ |
| 1465 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1466 | static vector bool short __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1467 | vec_vcmpgtsh(vector short a, vector short b) |
| 1468 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1469 | return (vector bool short)__builtin_altivec_vcmpgtsh(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1470 | } |
| 1471 | |
| 1472 | /* vec_vcmpgtuh */ |
| 1473 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1474 | static vector bool short __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1475 | vec_vcmpgtuh(vector unsigned short a, vector unsigned short b) |
| 1476 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1477 | return (vector bool short)__builtin_altivec_vcmpgtuh(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1478 | } |
| 1479 | |
| 1480 | /* vec_vcmpgtsw */ |
| 1481 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1482 | static vector bool int __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1483 | vec_vcmpgtsw(vector int a, vector int b) |
| 1484 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1485 | return (vector bool int)__builtin_altivec_vcmpgtsw(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1486 | } |
| 1487 | |
| 1488 | /* vec_vcmpgtuw */ |
| 1489 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1490 | static vector bool int __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1491 | vec_vcmpgtuw(vector unsigned int a, vector unsigned int b) |
| 1492 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1493 | return (vector bool int)__builtin_altivec_vcmpgtuw(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1494 | } |
| 1495 | |
| 1496 | /* vec_vcmpgtfp */ |
| 1497 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1498 | static vector bool int __attribute__((__always_inline__)) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1499 | vec_vcmpgtfp(vector float a, vector float b) |
| 1500 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1501 | return (vector bool int)__builtin_altivec_vcmpgtfp(a, b); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1502 | } |
| 1503 | |
| 1504 | /* vec_cmple */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1505 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1506 | static vector bool int __attribute__((__always_inline__)) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1507 | vec_cmple(vector float a, vector float b) |
| 1508 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1509 | return (vector bool int)__builtin_altivec_vcmpgefp(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1510 | } |
| 1511 | |
| 1512 | /* vec_cmplt */ |
| 1513 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1514 | static vector bool char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1515 | vec_cmplt(vector signed char a, vector signed char b) |
| 1516 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1517 | return (vector bool char)__builtin_altivec_vcmpgtsb(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1518 | } |
| 1519 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1520 | static vector bool char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1521 | vec_cmplt(vector unsigned char a, vector unsigned char b) |
| 1522 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1523 | return (vector bool char)__builtin_altivec_vcmpgtub(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1524 | } |
| 1525 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1526 | static vector bool short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1527 | vec_cmplt(vector short a, vector short b) |
| 1528 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1529 | return (vector bool short)__builtin_altivec_vcmpgtsh(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1530 | } |
| 1531 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1532 | static vector bool short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1533 | vec_cmplt(vector unsigned short a, vector unsigned short b) |
| 1534 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1535 | return (vector bool short)__builtin_altivec_vcmpgtuh(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1536 | } |
| 1537 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1538 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1539 | vec_cmplt(vector int a, vector int b) |
| 1540 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1541 | return (vector bool int)__builtin_altivec_vcmpgtsw(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1542 | } |
| 1543 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1544 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1545 | vec_cmplt(vector unsigned int a, vector unsigned int b) |
| 1546 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1547 | return (vector bool int)__builtin_altivec_vcmpgtuw(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1548 | } |
| 1549 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1550 | static vector bool int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1551 | vec_cmplt(vector float a, vector float b) |
| 1552 | { |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1553 | return (vector bool int)__builtin_altivec_vcmpgtfp(b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1554 | } |
| 1555 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1556 | /* vec_ctf */ |
| 1557 | |
| 1558 | static vector float __ATTRS_o_ai |
| 1559 | vec_ctf(vector int a, int b) |
| 1560 | { |
| 1561 | return __builtin_altivec_vcfsx(a, b); |
| 1562 | } |
| 1563 | |
| 1564 | static vector float __ATTRS_o_ai |
| 1565 | vec_ctf(vector unsigned int a, int b) |
| 1566 | { |
| 1567 | return __builtin_altivec_vcfux((vector int)a, b); |
| 1568 | } |
| 1569 | |
| 1570 | /* vec_vcfsx */ |
| 1571 | |
| 1572 | static vector float __attribute__((__always_inline__)) |
| 1573 | vec_vcfsx(vector int a, int b) |
| 1574 | { |
| 1575 | return __builtin_altivec_vcfsx(a, b); |
| 1576 | } |
| 1577 | |
| 1578 | /* vec_vcfux */ |
| 1579 | |
| 1580 | static vector float __attribute__((__always_inline__)) |
| 1581 | vec_vcfux(vector unsigned int a, int b) |
| 1582 | { |
| 1583 | return __builtin_altivec_vcfux((vector int)a, b); |
| 1584 | } |
| 1585 | |
| 1586 | /* vec_cts */ |
| 1587 | |
| 1588 | static vector int __attribute__((__always_inline__)) |
| 1589 | vec_cts(vector float a, int b) |
| 1590 | { |
| 1591 | return __builtin_altivec_vctsxs(a, b); |
| 1592 | } |
| 1593 | |
| 1594 | /* vec_vctsxs */ |
| 1595 | |
| 1596 | static vector int __attribute__((__always_inline__)) |
| 1597 | vec_vctsxs(vector float a, int b) |
| 1598 | { |
| 1599 | return __builtin_altivec_vctsxs(a, b); |
| 1600 | } |
| 1601 | |
| 1602 | /* vec_ctu */ |
| 1603 | |
| 1604 | static vector unsigned int __attribute__((__always_inline__)) |
| 1605 | vec_ctu(vector float a, int b) |
| 1606 | { |
| 1607 | return __builtin_altivec_vctuxs(a, b); |
| 1608 | } |
| 1609 | |
| 1610 | /* vec_vctuxs */ |
| 1611 | |
| 1612 | static vector unsigned int __attribute__((__always_inline__)) |
| 1613 | vec_vctuxs(vector float a, int b) |
| 1614 | { |
| 1615 | return __builtin_altivec_vctuxs(a, b); |
| 1616 | } |
| 1617 | |
| 1618 | /* vec_dss */ |
| 1619 | |
| 1620 | static void __attribute__((__always_inline__)) |
| 1621 | vec_dss(int a) |
| 1622 | { |
| 1623 | __builtin_altivec_dss(a); |
| 1624 | } |
| 1625 | |
| 1626 | /* vec_dssall */ |
| 1627 | |
| 1628 | static void __attribute__((__always_inline__)) |
| 1629 | vec_dssall(void) |
| 1630 | { |
| 1631 | __builtin_altivec_dssall(); |
| 1632 | } |
| 1633 | |
| 1634 | /* vec_dst */ |
| 1635 | |
| 1636 | static void __attribute__((__always_inline__)) |
| 1637 | vec_dst(void *a, int b, int c) |
| 1638 | { |
| 1639 | __builtin_altivec_dst(a, b, c); |
| 1640 | } |
| 1641 | |
| 1642 | /* vec_dstst */ |
| 1643 | |
| 1644 | static void __attribute__((__always_inline__)) |
| 1645 | vec_dstst(void *a, int b, int c) |
| 1646 | { |
| 1647 | __builtin_altivec_dstst(a, b, c); |
| 1648 | } |
| 1649 | |
| 1650 | /* vec_dststt */ |
| 1651 | |
| 1652 | static void __attribute__((__always_inline__)) |
| 1653 | vec_dststt(void *a, int b, int c) |
| 1654 | { |
| 1655 | __builtin_altivec_dststt(a, b, c); |
| 1656 | } |
| 1657 | |
| 1658 | /* vec_dstt */ |
| 1659 | |
| 1660 | static void __attribute__((__always_inline__)) |
| 1661 | vec_dstt(void *a, int b, int c) |
| 1662 | { |
| 1663 | __builtin_altivec_dstt(a, b, c); |
| 1664 | } |
| 1665 | |
| 1666 | /* vec_expte */ |
| 1667 | |
| 1668 | static vector float __attribute__((__always_inline__)) |
| 1669 | vec_expte(vector float a) |
| 1670 | { |
| 1671 | return __builtin_altivec_vexptefp(a); |
| 1672 | } |
| 1673 | |
| 1674 | /* vec_vexptefp */ |
| 1675 | |
| 1676 | static vector float __attribute__((__always_inline__)) |
| 1677 | vec_vexptefp(vector float a) |
| 1678 | { |
| 1679 | return __builtin_altivec_vexptefp(a); |
| 1680 | } |
| 1681 | |
| 1682 | /* vec_floor */ |
| 1683 | |
| 1684 | static vector float __attribute__((__always_inline__)) |
| 1685 | vec_floor(vector float a) |
| 1686 | { |
| 1687 | return __builtin_altivec_vrfim(a); |
| 1688 | } |
| 1689 | |
| 1690 | /* vec_vrfim */ |
| 1691 | |
| 1692 | static vector float __attribute__((__always_inline__)) |
| 1693 | vec_vrfim(vector float a) |
| 1694 | { |
| 1695 | return __builtin_altivec_vrfim(a); |
| 1696 | } |
| 1697 | |
| 1698 | /* vec_ld */ |
| 1699 | |
| 1700 | static vector signed char __ATTRS_o_ai |
| 1701 | vec_ld(int a, vector signed char *b) |
| 1702 | { |
| 1703 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 1704 | } |
| 1705 | |
| 1706 | static vector signed char __ATTRS_o_ai |
| 1707 | vec_ld(int a, signed char *b) |
| 1708 | { |
| 1709 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 1710 | } |
| 1711 | |
| 1712 | static vector unsigned char __ATTRS_o_ai |
| 1713 | vec_ld(int a, vector unsigned char *b) |
| 1714 | { |
| 1715 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1716 | } |
| 1717 | |
| 1718 | static vector unsigned char __ATTRS_o_ai |
| 1719 | vec_ld(int a, unsigned char *b) |
| 1720 | { |
| 1721 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1722 | } |
| 1723 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1724 | static vector bool char __ATTRS_o_ai |
| 1725 | vec_ld(int a, vector bool char *b) |
| 1726 | { |
| 1727 | return (vector bool char)__builtin_altivec_lvx(a, b); |
| 1728 | } |
| 1729 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1730 | static vector short __ATTRS_o_ai |
| 1731 | vec_ld(int a, vector short *b) |
| 1732 | { |
| 1733 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1734 | } |
| 1735 | |
| 1736 | static vector short __ATTRS_o_ai |
| 1737 | vec_ld(int a, short *b) |
| 1738 | { |
| 1739 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1740 | } |
| 1741 | |
| 1742 | static vector unsigned short __ATTRS_o_ai |
| 1743 | vec_ld(int a, vector unsigned short *b) |
| 1744 | { |
| 1745 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1746 | } |
| 1747 | |
| 1748 | static vector unsigned short __ATTRS_o_ai |
| 1749 | vec_ld(int a, unsigned short *b) |
| 1750 | { |
| 1751 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1752 | } |
| 1753 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1754 | static vector bool short __ATTRS_o_ai |
| 1755 | vec_ld(int a, vector bool short *b) |
| 1756 | { |
| 1757 | return (vector bool short)__builtin_altivec_lvx(a, b); |
| 1758 | } |
| 1759 | |
| 1760 | static vector pixel __ATTRS_o_ai |
| 1761 | vec_ld(int a, vector pixel *b) |
| 1762 | { |
| 1763 | return (vector pixel)__builtin_altivec_lvx(a, b); |
| 1764 | } |
| 1765 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1766 | static vector int __ATTRS_o_ai |
| 1767 | vec_ld(int a, vector int *b) |
| 1768 | { |
| 1769 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1770 | } |
| 1771 | |
| 1772 | static vector int __ATTRS_o_ai |
| 1773 | vec_ld(int a, int *b) |
| 1774 | { |
| 1775 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1776 | } |
| 1777 | |
| 1778 | static vector unsigned int __ATTRS_o_ai |
| 1779 | vec_ld(int a, vector unsigned int *b) |
| 1780 | { |
| 1781 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1782 | } |
| 1783 | |
| 1784 | static vector unsigned int __ATTRS_o_ai |
| 1785 | vec_ld(int a, unsigned int *b) |
| 1786 | { |
| 1787 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1788 | } |
| 1789 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1790 | static vector bool int __ATTRS_o_ai |
| 1791 | vec_ld(int a, vector bool int *b) |
| 1792 | { |
| 1793 | return (vector bool int)__builtin_altivec_lvx(a, b); |
| 1794 | } |
| 1795 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1796 | static vector float __ATTRS_o_ai |
| 1797 | vec_ld(int a, vector float *b) |
| 1798 | { |
| 1799 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1800 | } |
| 1801 | |
| 1802 | static vector float __ATTRS_o_ai |
| 1803 | vec_ld(int a, float *b) |
| 1804 | { |
| 1805 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1806 | } |
| 1807 | |
| 1808 | /* vec_lvx */ |
| 1809 | |
| 1810 | static vector signed char __ATTRS_o_ai |
| 1811 | vec_lvx(int a, vector signed char *b) |
| 1812 | { |
| 1813 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 1814 | } |
| 1815 | |
| 1816 | static vector signed char __ATTRS_o_ai |
| 1817 | vec_lvx(int a, signed char *b) |
| 1818 | { |
| 1819 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 1820 | } |
| 1821 | |
| 1822 | static vector unsigned char __ATTRS_o_ai |
| 1823 | vec_lvx(int a, vector unsigned char *b) |
| 1824 | { |
| 1825 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1826 | } |
| 1827 | |
| 1828 | static vector unsigned char __ATTRS_o_ai |
| 1829 | vec_lvx(int a, unsigned char *b) |
| 1830 | { |
| 1831 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1832 | } |
| 1833 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1834 | static vector bool char __ATTRS_o_ai |
| 1835 | vec_lvx(int a, vector bool char *b) |
| 1836 | { |
| 1837 | return (vector bool char)__builtin_altivec_lvx(a, b); |
| 1838 | } |
| 1839 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1840 | static vector short __ATTRS_o_ai |
| 1841 | vec_lvx(int a, vector short *b) |
| 1842 | { |
| 1843 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1844 | } |
| 1845 | |
| 1846 | static vector short __ATTRS_o_ai |
| 1847 | vec_lvx(int a, short *b) |
| 1848 | { |
| 1849 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1850 | } |
| 1851 | |
| 1852 | static vector unsigned short __ATTRS_o_ai |
| 1853 | vec_lvx(int a, vector unsigned short *b) |
| 1854 | { |
| 1855 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1856 | } |
| 1857 | |
| 1858 | static vector unsigned short __ATTRS_o_ai |
| 1859 | vec_lvx(int a, unsigned short *b) |
| 1860 | { |
| 1861 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1862 | } |
| 1863 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1864 | static vector bool short __ATTRS_o_ai |
| 1865 | vec_lvx(int a, vector bool short *b) |
| 1866 | { |
| 1867 | return (vector bool short)__builtin_altivec_lvx(a, b); |
| 1868 | } |
| 1869 | |
| 1870 | static vector pixel __ATTRS_o_ai |
| 1871 | vec_lvx(int a, vector pixel *b) |
| 1872 | { |
| 1873 | return (vector pixel)__builtin_altivec_lvx(a, b); |
| 1874 | } |
| 1875 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1876 | static vector int __ATTRS_o_ai |
| 1877 | vec_lvx(int a, vector int *b) |
| 1878 | { |
| 1879 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1880 | } |
| 1881 | |
| 1882 | static vector int __ATTRS_o_ai |
| 1883 | vec_lvx(int a, int *b) |
| 1884 | { |
| 1885 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1886 | } |
| 1887 | |
| 1888 | static vector unsigned int __ATTRS_o_ai |
| 1889 | vec_lvx(int a, vector unsigned int *b) |
| 1890 | { |
| 1891 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1892 | } |
| 1893 | |
| 1894 | static vector unsigned int __ATTRS_o_ai |
| 1895 | vec_lvx(int a, unsigned int *b) |
| 1896 | { |
| 1897 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1898 | } |
| 1899 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 1900 | static vector bool int __ATTRS_o_ai |
| 1901 | vec_lvx(int a, vector bool int *b) |
| 1902 | { |
| 1903 | return (vector bool int)__builtin_altivec_lvx(a, b); |
| 1904 | } |
| 1905 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1906 | static vector float __ATTRS_o_ai |
| 1907 | vec_lvx(int a, vector float *b) |
| 1908 | { |
| 1909 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1910 | } |
| 1911 | |
| 1912 | static vector float __ATTRS_o_ai |
| 1913 | vec_lvx(int a, float *b) |
| 1914 | { |
| 1915 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1916 | } |
| 1917 | |
| 1918 | /* vec_lde */ |
| 1919 | |
| 1920 | static vector signed char __ATTRS_o_ai |
| 1921 | vec_lde(int a, vector signed char *b) |
| 1922 | { |
| 1923 | return (vector signed char)__builtin_altivec_lvebx(a, b); |
| 1924 | } |
| 1925 | |
| 1926 | static vector unsigned char __ATTRS_o_ai |
| 1927 | vec_lde(int a, vector unsigned char *b) |
| 1928 | { |
| 1929 | return (vector unsigned char)__builtin_altivec_lvebx(a, b); |
| 1930 | } |
| 1931 | |
| 1932 | static vector short __ATTRS_o_ai |
| 1933 | vec_lde(int a, vector short *b) |
| 1934 | { |
| 1935 | return (vector short)__builtin_altivec_lvehx(a, b); |
| 1936 | } |
| 1937 | |
| 1938 | static vector unsigned short __ATTRS_o_ai |
| 1939 | vec_lde(int a, vector unsigned short *b) |
| 1940 | { |
| 1941 | return (vector unsigned short)__builtin_altivec_lvehx(a, b); |
| 1942 | } |
| 1943 | |
| 1944 | static vector int __ATTRS_o_ai |
| 1945 | vec_lde(int a, vector int *b) |
| 1946 | { |
| 1947 | return (vector int)__builtin_altivec_lvewx(a, b); |
| 1948 | } |
| 1949 | |
| 1950 | static vector unsigned int __ATTRS_o_ai |
| 1951 | vec_lde(int a, vector unsigned int *b) |
| 1952 | { |
| 1953 | return (vector unsigned int)__builtin_altivec_lvewx(a, b); |
| 1954 | } |
| 1955 | |
| 1956 | static vector float __ATTRS_o_ai |
| 1957 | vec_lde(int a, vector float *b) |
| 1958 | { |
| 1959 | return (vector float)__builtin_altivec_lvewx(a, b); |
| 1960 | } |
| 1961 | |
| 1962 | /* vec_lvebx */ |
| 1963 | |
| 1964 | static vector signed char __ATTRS_o_ai |
| 1965 | vec_lvebx(int a, vector signed char *b) |
| 1966 | { |
| 1967 | return (vector signed char)__builtin_altivec_lvebx(a, b); |
| 1968 | } |
| 1969 | |
| 1970 | static vector unsigned char __ATTRS_o_ai |
| 1971 | vec_lvebx(int a, vector unsigned char *b) |
| 1972 | { |
| 1973 | return (vector unsigned char)__builtin_altivec_lvebx(a, b); |
| 1974 | } |
| 1975 | |
| 1976 | /* vec_lvehx */ |
| 1977 | |
| 1978 | static vector short __ATTRS_o_ai |
| 1979 | vec_lvehx(int a, vector short *b) |
| 1980 | { |
| 1981 | return (vector short)__builtin_altivec_lvehx(a, b); |
| 1982 | } |
| 1983 | |
| 1984 | static vector unsigned short __ATTRS_o_ai |
| 1985 | vec_lvehx(int a, vector unsigned short *b) |
| 1986 | { |
| 1987 | return (vector unsigned short)__builtin_altivec_lvehx(a, b); |
| 1988 | } |
| 1989 | |
| 1990 | /* vec_lvewx */ |
| 1991 | |
| 1992 | static vector int __ATTRS_o_ai |
| 1993 | vec_lvewx(int a, vector int *b) |
| 1994 | { |
| 1995 | return (vector int)__builtin_altivec_lvewx(a, b); |
| 1996 | } |
| 1997 | |
| 1998 | static vector unsigned int __ATTRS_o_ai |
| 1999 | vec_lvewx(int a, vector unsigned int *b) |
| 2000 | { |
| 2001 | return (vector unsigned int)__builtin_altivec_lvewx(a, b); |
| 2002 | } |
| 2003 | |
| 2004 | static vector float __ATTRS_o_ai |
| 2005 | vec_lvewx(int a, vector float *b) |
| 2006 | { |
| 2007 | return (vector float)__builtin_altivec_lvewx(a, b); |
| 2008 | } |
| 2009 | |
| 2010 | /* vec_ldl */ |
| 2011 | |
| 2012 | static vector signed char __ATTRS_o_ai |
| 2013 | vec_ldl(int a, vector signed char *b) |
| 2014 | { |
| 2015 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 2016 | } |
| 2017 | |
| 2018 | static vector signed char __ATTRS_o_ai |
| 2019 | vec_ldl(int a, signed char *b) |
| 2020 | { |
| 2021 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 2022 | } |
| 2023 | |
| 2024 | static vector unsigned char __ATTRS_o_ai |
| 2025 | vec_ldl(int a, vector unsigned char *b) |
| 2026 | { |
| 2027 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 2028 | } |
| 2029 | |
| 2030 | static vector unsigned char __ATTRS_o_ai |
| 2031 | vec_ldl(int a, unsigned char *b) |
| 2032 | { |
| 2033 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 2034 | } |
| 2035 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2036 | static vector bool char __ATTRS_o_ai |
| 2037 | vec_ldl(int a, vector bool char *b) |
| 2038 | { |
| 2039 | return (vector bool char)__builtin_altivec_lvxl(a, b); |
| 2040 | } |
| 2041 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2042 | static vector short __ATTRS_o_ai |
| 2043 | vec_ldl(int a, vector short *b) |
| 2044 | { |
| 2045 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 2046 | } |
| 2047 | |
| 2048 | static vector short __ATTRS_o_ai |
| 2049 | vec_ldl(int a, short *b) |
| 2050 | { |
| 2051 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 2052 | } |
| 2053 | |
| 2054 | static vector unsigned short __ATTRS_o_ai |
| 2055 | vec_ldl(int a, vector unsigned short *b) |
| 2056 | { |
| 2057 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 2058 | } |
| 2059 | |
| 2060 | static vector unsigned short __ATTRS_o_ai |
| 2061 | vec_ldl(int a, unsigned short *b) |
| 2062 | { |
| 2063 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 2064 | } |
| 2065 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2066 | static vector bool short __ATTRS_o_ai |
| 2067 | vec_ldl(int a, vector bool short *b) |
| 2068 | { |
| 2069 | return (vector bool short)__builtin_altivec_lvxl(a, b); |
| 2070 | } |
| 2071 | |
| 2072 | static vector pixel __ATTRS_o_ai |
| 2073 | vec_ldl(int a, vector pixel *b) |
| 2074 | { |
| 2075 | return (vector pixel short)__builtin_altivec_lvxl(a, b); |
| 2076 | } |
| 2077 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2078 | static vector int __ATTRS_o_ai |
| 2079 | vec_ldl(int a, vector int *b) |
| 2080 | { |
| 2081 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 2082 | } |
| 2083 | |
| 2084 | static vector int __ATTRS_o_ai |
| 2085 | vec_ldl(int a, int *b) |
| 2086 | { |
| 2087 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 2088 | } |
| 2089 | |
| 2090 | static vector unsigned int __ATTRS_o_ai |
| 2091 | vec_ldl(int a, vector unsigned int *b) |
| 2092 | { |
| 2093 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 2094 | } |
| 2095 | |
| 2096 | static vector unsigned int __ATTRS_o_ai |
| 2097 | vec_ldl(int a, unsigned int *b) |
| 2098 | { |
| 2099 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 2100 | } |
| 2101 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2102 | static vector bool int __ATTRS_o_ai |
| 2103 | vec_ldl(int a, vector bool int *b) |
| 2104 | { |
| 2105 | return (vector bool int)__builtin_altivec_lvxl(a, b); |
| 2106 | } |
| 2107 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2108 | static vector float __ATTRS_o_ai |
| 2109 | vec_ldl(int a, vector float *b) |
| 2110 | { |
| 2111 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 2112 | } |
| 2113 | |
| 2114 | static vector float __ATTRS_o_ai |
| 2115 | vec_ldl(int a, float *b) |
| 2116 | { |
| 2117 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 2118 | } |
| 2119 | |
| 2120 | /* vec_lvxl */ |
| 2121 | |
| 2122 | static vector signed char __ATTRS_o_ai |
| 2123 | vec_lvxl(int a, vector signed char *b) |
| 2124 | { |
| 2125 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 2126 | } |
| 2127 | |
| 2128 | static vector signed char __ATTRS_o_ai |
| 2129 | vec_lvxl(int a, signed char *b) |
| 2130 | { |
| 2131 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 2132 | } |
| 2133 | |
| 2134 | static vector unsigned char __ATTRS_o_ai |
| 2135 | vec_lvxl(int a, vector unsigned char *b) |
| 2136 | { |
| 2137 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 2138 | } |
| 2139 | |
| 2140 | static vector unsigned char __ATTRS_o_ai |
| 2141 | vec_lvxl(int a, unsigned char *b) |
| 2142 | { |
| 2143 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 2144 | } |
| 2145 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2146 | static vector bool char __ATTRS_o_ai |
| 2147 | vec_lvxl(int a, vector bool char *b) |
| 2148 | { |
| 2149 | return (vector bool char)__builtin_altivec_lvxl(a, b); |
| 2150 | } |
| 2151 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2152 | static vector short __ATTRS_o_ai |
| 2153 | vec_lvxl(int a, vector short *b) |
| 2154 | { |
| 2155 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 2156 | } |
| 2157 | |
| 2158 | static vector short __ATTRS_o_ai |
| 2159 | vec_lvxl(int a, short *b) |
| 2160 | { |
| 2161 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 2162 | } |
| 2163 | |
| 2164 | static vector unsigned short __ATTRS_o_ai |
| 2165 | vec_lvxl(int a, vector unsigned short *b) |
| 2166 | { |
| 2167 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 2168 | } |
| 2169 | |
| 2170 | static vector unsigned short __ATTRS_o_ai |
| 2171 | vec_lvxl(int a, unsigned short *b) |
| 2172 | { |
| 2173 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 2174 | } |
| 2175 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2176 | static vector bool short __ATTRS_o_ai |
| 2177 | vec_lvxl(int a, vector bool short *b) |
| 2178 | { |
| 2179 | return (vector bool short)__builtin_altivec_lvxl(a, b); |
| 2180 | } |
| 2181 | |
| 2182 | static vector pixel __ATTRS_o_ai |
| 2183 | vec_lvxl(int a, vector pixel *b) |
| 2184 | { |
| 2185 | return (vector pixel)__builtin_altivec_lvxl(a, b); |
| 2186 | } |
| 2187 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2188 | static vector int __ATTRS_o_ai |
| 2189 | vec_lvxl(int a, vector int *b) |
| 2190 | { |
| 2191 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 2192 | } |
| 2193 | |
| 2194 | static vector int __ATTRS_o_ai |
| 2195 | vec_lvxl(int a, int *b) |
| 2196 | { |
| 2197 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 2198 | } |
| 2199 | |
| 2200 | static vector unsigned int __ATTRS_o_ai |
| 2201 | vec_lvxl(int a, vector unsigned int *b) |
| 2202 | { |
| 2203 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 2204 | } |
| 2205 | |
| 2206 | static vector unsigned int __ATTRS_o_ai |
| 2207 | vec_lvxl(int a, unsigned int *b) |
| 2208 | { |
| 2209 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 2210 | } |
| 2211 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2212 | static vector bool int __ATTRS_o_ai |
| 2213 | vec_lvxl(int a, vector bool int *b) |
| 2214 | { |
| 2215 | return (vector bool int)__builtin_altivec_lvxl(a, b); |
| 2216 | } |
| 2217 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2218 | static vector float __ATTRS_o_ai |
| 2219 | vec_lvxl(int a, vector float *b) |
| 2220 | { |
| 2221 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 2222 | } |
| 2223 | |
| 2224 | static vector float __ATTRS_o_ai |
| 2225 | vec_lvxl(int a, float *b) |
| 2226 | { |
| 2227 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 2228 | } |
| 2229 | |
| 2230 | /* vec_loge */ |
| 2231 | |
| 2232 | static vector float __attribute__((__always_inline__)) |
| 2233 | vec_loge(vector float a) |
| 2234 | { |
| 2235 | return __builtin_altivec_vlogefp(a); |
| 2236 | } |
| 2237 | |
| 2238 | /* vec_vlogefp */ |
| 2239 | |
| 2240 | static vector float __attribute__((__always_inline__)) |
| 2241 | vec_vlogefp(vector float a) |
| 2242 | { |
| 2243 | return __builtin_altivec_vlogefp(a); |
| 2244 | } |
| 2245 | |
| 2246 | /* vec_lvsl */ |
| 2247 | |
| 2248 | static vector unsigned char __ATTRS_o_ai |
| 2249 | vec_lvsl(int a, signed char *b) |
| 2250 | { |
| 2251 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2252 | } |
| 2253 | |
| 2254 | static vector unsigned char __ATTRS_o_ai |
| 2255 | vec_lvsl(int a, unsigned char *b) |
| 2256 | { |
| 2257 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2258 | } |
| 2259 | |
| 2260 | static vector unsigned char __ATTRS_o_ai |
| 2261 | vec_lvsl(int a, short *b) |
| 2262 | { |
| 2263 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2264 | } |
| 2265 | |
| 2266 | static vector unsigned char __ATTRS_o_ai |
| 2267 | vec_lvsl(int a, unsigned short *b) |
| 2268 | { |
| 2269 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2270 | } |
| 2271 | |
| 2272 | static vector unsigned char __ATTRS_o_ai |
| 2273 | vec_lvsl(int a, int *b) |
| 2274 | { |
| 2275 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2276 | } |
| 2277 | |
| 2278 | static vector unsigned char __ATTRS_o_ai |
| 2279 | vec_lvsl(int a, unsigned int *b) |
| 2280 | { |
| 2281 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2282 | } |
| 2283 | |
| 2284 | static vector unsigned char __ATTRS_o_ai |
| 2285 | vec_lvsl(int a, float *b) |
| 2286 | { |
| 2287 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 2288 | } |
| 2289 | |
| 2290 | /* vec_lvsr */ |
| 2291 | |
| 2292 | static vector unsigned char __ATTRS_o_ai |
| 2293 | vec_lvsr(int a, signed char *b) |
| 2294 | { |
| 2295 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2296 | } |
| 2297 | |
| 2298 | static vector unsigned char __ATTRS_o_ai |
| 2299 | vec_lvsr(int a, unsigned char *b) |
| 2300 | { |
| 2301 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2302 | } |
| 2303 | |
| 2304 | static vector unsigned char __ATTRS_o_ai |
| 2305 | vec_lvsr(int a, short *b) |
| 2306 | { |
| 2307 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2308 | } |
| 2309 | |
| 2310 | static vector unsigned char __ATTRS_o_ai |
| 2311 | vec_lvsr(int a, unsigned short *b) |
| 2312 | { |
| 2313 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2314 | } |
| 2315 | |
| 2316 | static vector unsigned char __ATTRS_o_ai |
| 2317 | vec_lvsr(int a, int *b) |
| 2318 | { |
| 2319 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2320 | } |
| 2321 | |
| 2322 | static vector unsigned char __ATTRS_o_ai |
| 2323 | vec_lvsr(int a, unsigned int *b) |
| 2324 | { |
| 2325 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2326 | } |
| 2327 | |
| 2328 | static vector unsigned char __ATTRS_o_ai |
| 2329 | vec_lvsr(int a, float *b) |
| 2330 | { |
| 2331 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 2332 | } |
| 2333 | |
| 2334 | /* vec_madd */ |
| 2335 | |
| 2336 | static vector float __attribute__((__always_inline__)) |
| 2337 | vec_madd(vector float a, vector float b, vector float c) |
| 2338 | { |
| 2339 | return __builtin_altivec_vmaddfp(a, b, c); |
| 2340 | } |
| 2341 | |
| 2342 | /* vec_vmaddfp */ |
| 2343 | |
| 2344 | static vector float __attribute__((__always_inline__)) |
| 2345 | vec_vmaddfp(vector float a, vector float b, vector float c) |
| 2346 | { |
| 2347 | return __builtin_altivec_vmaddfp(a, b, c); |
| 2348 | } |
| 2349 | |
| 2350 | /* vec_madds */ |
| 2351 | |
| 2352 | static vector signed short __attribute__((__always_inline__)) |
| 2353 | vec_madds(vector signed short a, vector signed short b, vector signed short c) |
| 2354 | { |
| 2355 | return __builtin_altivec_vmhaddshs(a, b, c); |
| 2356 | } |
| 2357 | |
| 2358 | /* vec_vmhaddshs */ |
| 2359 | static vector signed short __attribute__((__always_inline__)) |
| 2360 | vec_vmhaddshs(vector signed short a, vector signed short b, vector signed short c) |
| 2361 | { |
| 2362 | return __builtin_altivec_vmhaddshs(a, b, c); |
| 2363 | } |
| 2364 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2365 | /* vec_max */ |
| 2366 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2367 | static vector signed char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 2368 | vec_max(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2369 | { |
| 2370 | return __builtin_altivec_vmaxsb(a, b); |
| 2371 | } |
| 2372 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2373 | static vector signed char __ATTRS_o_ai |
| 2374 | vec_max(vector bool char a, vector signed char b) |
| 2375 | { |
| 2376 | return __builtin_altivec_vmaxsb((vector signed char)a, b); |
| 2377 | } |
| 2378 | |
| 2379 | static vector signed char __ATTRS_o_ai |
| 2380 | vec_max(vector signed char a, vector bool char b) |
| 2381 | { |
| 2382 | return __builtin_altivec_vmaxsb(a, (vector signed char)b); |
| 2383 | } |
| 2384 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2385 | static vector unsigned char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 2386 | vec_max(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2387 | { |
| 2388 | return __builtin_altivec_vmaxub(a, b); |
| 2389 | } |
| 2390 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2391 | static vector unsigned char __ATTRS_o_ai |
| 2392 | vec_max(vector bool char a, vector unsigned char b) |
| 2393 | { |
| 2394 | return __builtin_altivec_vmaxub((vector unsigned char)a, b); |
| 2395 | } |
| 2396 | |
| 2397 | static vector unsigned char __ATTRS_o_ai |
| 2398 | vec_max(vector unsigned char a, vector bool char b) |
| 2399 | { |
| 2400 | return __builtin_altivec_vmaxub(a, (vector unsigned char)b); |
| 2401 | } |
| 2402 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2403 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2404 | vec_max(vector short a, vector short b) |
| 2405 | { |
| 2406 | return __builtin_altivec_vmaxsh(a, b); |
| 2407 | } |
| 2408 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2409 | static vector short __ATTRS_o_ai |
| 2410 | vec_max(vector bool short a, vector short b) |
| 2411 | { |
| 2412 | return __builtin_altivec_vmaxsh((vector short)a, b); |
| 2413 | } |
| 2414 | |
| 2415 | static vector short __ATTRS_o_ai |
| 2416 | vec_max(vector short a, vector bool short b) |
| 2417 | { |
| 2418 | return __builtin_altivec_vmaxsh(a, (vector short)b); |
| 2419 | } |
| 2420 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2421 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2422 | vec_max(vector unsigned short a, vector unsigned short b) |
| 2423 | { |
| 2424 | return __builtin_altivec_vmaxuh(a, b); |
| 2425 | } |
| 2426 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2427 | static vector unsigned short __ATTRS_o_ai |
| 2428 | vec_max(vector bool short a, vector unsigned short b) |
| 2429 | { |
| 2430 | return __builtin_altivec_vmaxuh((vector unsigned short)a, b); |
| 2431 | } |
| 2432 | |
| 2433 | static vector unsigned short __ATTRS_o_ai |
| 2434 | vec_max(vector unsigned short a, vector bool short b) |
| 2435 | { |
| 2436 | return __builtin_altivec_vmaxuh(a, (vector unsigned short)b); |
| 2437 | } |
| 2438 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2439 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2440 | vec_max(vector int a, vector int b) |
| 2441 | { |
| 2442 | return __builtin_altivec_vmaxsw(a, b); |
| 2443 | } |
| 2444 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2445 | static vector int __ATTRS_o_ai |
| 2446 | vec_max(vector bool int a, vector int b) |
| 2447 | { |
| 2448 | return __builtin_altivec_vmaxsw((vector int)a, b); |
| 2449 | } |
| 2450 | |
| 2451 | static vector int __ATTRS_o_ai |
| 2452 | vec_max(vector int a, vector bool int b) |
| 2453 | { |
| 2454 | return __builtin_altivec_vmaxsw(a, (vector int)b); |
| 2455 | } |
| 2456 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2457 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2458 | vec_max(vector unsigned int a, vector unsigned int b) |
| 2459 | { |
| 2460 | return __builtin_altivec_vmaxuw(a, b); |
| 2461 | } |
| 2462 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2463 | static vector unsigned int __ATTRS_o_ai |
| 2464 | vec_max(vector bool int a, vector unsigned int b) |
| 2465 | { |
| 2466 | return __builtin_altivec_vmaxuw((vector unsigned int)a, b); |
| 2467 | } |
| 2468 | |
| 2469 | static vector unsigned int __ATTRS_o_ai |
| 2470 | vec_max(vector unsigned int a, vector bool int b) |
| 2471 | { |
| 2472 | return __builtin_altivec_vmaxuw(a, (vector unsigned int)b); |
| 2473 | } |
| 2474 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2475 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2476 | vec_max(vector float a, vector float b) |
| 2477 | { |
| 2478 | return __builtin_altivec_vmaxfp(a, b); |
| 2479 | } |
| 2480 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2481 | /* vec_vmaxsb */ |
| 2482 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2483 | static vector signed char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 2484 | vec_vmaxsb(vector signed char a, vector signed char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2485 | { |
| 2486 | return __builtin_altivec_vmaxsb(a, b); |
| 2487 | } |
| 2488 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2489 | static vector signed char __ATTRS_o_ai |
| 2490 | vec_vmaxsb(vector bool char a, vector signed char b) |
| 2491 | { |
| 2492 | return __builtin_altivec_vmaxsb((vector signed char)a, b); |
| 2493 | } |
| 2494 | |
| 2495 | static vector signed char __ATTRS_o_ai |
| 2496 | vec_vmaxsb(vector signed char a, vector bool char b) |
| 2497 | { |
| 2498 | return __builtin_altivec_vmaxsb(a, (vector signed char)b); |
| 2499 | } |
| 2500 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2501 | /* vec_vmaxub */ |
| 2502 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2503 | static vector unsigned char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 2504 | vec_vmaxub(vector unsigned char a, vector unsigned char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2505 | { |
| 2506 | return __builtin_altivec_vmaxub(a, b); |
| 2507 | } |
| 2508 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2509 | static vector unsigned char __ATTRS_o_ai |
| 2510 | vec_vmaxub(vector bool char a, vector unsigned char b) |
| 2511 | { |
| 2512 | return __builtin_altivec_vmaxub((vector unsigned char)a, b); |
| 2513 | } |
| 2514 | |
| 2515 | static vector unsigned char __ATTRS_o_ai |
| 2516 | vec_vmaxub(vector unsigned char a, vector bool char b) |
| 2517 | { |
| 2518 | return __builtin_altivec_vmaxub(a, (vector unsigned char)b); |
| 2519 | } |
| 2520 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2521 | /* vec_vmaxsh */ |
| 2522 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2523 | static vector short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2524 | vec_vmaxsh(vector short a, vector short b) |
| 2525 | { |
| 2526 | return __builtin_altivec_vmaxsh(a, b); |
| 2527 | } |
| 2528 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2529 | static vector short __ATTRS_o_ai |
| 2530 | vec_vmaxsh(vector bool short a, vector short b) |
| 2531 | { |
| 2532 | return __builtin_altivec_vmaxsh((vector short)a, b); |
| 2533 | } |
| 2534 | |
| 2535 | static vector short __ATTRS_o_ai |
| 2536 | vec_vmaxsh(vector short a, vector bool short b) |
| 2537 | { |
| 2538 | return __builtin_altivec_vmaxsh(a, (vector short)b); |
| 2539 | } |
| 2540 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2541 | /* vec_vmaxuh */ |
| 2542 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2543 | static vector unsigned short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2544 | vec_vmaxuh(vector unsigned short a, vector unsigned short b) |
| 2545 | { |
| 2546 | return __builtin_altivec_vmaxuh(a, b); |
| 2547 | } |
| 2548 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2549 | static vector unsigned short __ATTRS_o_ai |
| 2550 | vec_vmaxuh(vector bool short a, vector unsigned short b) |
| 2551 | { |
| 2552 | return __builtin_altivec_vmaxuh((vector unsigned short)a, b); |
| 2553 | } |
| 2554 | |
| 2555 | static vector unsigned short __ATTRS_o_ai |
| 2556 | vec_vmaxuh(vector unsigned short a, vector bool short b) |
| 2557 | { |
| 2558 | return __builtin_altivec_vmaxuh(a, (vector unsigned short)b); |
| 2559 | } |
| 2560 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2561 | /* vec_vmaxsw */ |
| 2562 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2563 | static vector int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2564 | vec_vmaxsw(vector int a, vector int b) |
| 2565 | { |
| 2566 | return __builtin_altivec_vmaxsw(a, b); |
| 2567 | } |
| 2568 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2569 | static vector int __ATTRS_o_ai |
| 2570 | vec_vmaxsw(vector bool int a, vector int b) |
| 2571 | { |
| 2572 | return __builtin_altivec_vmaxsw((vector int)a, b); |
| 2573 | } |
| 2574 | |
| 2575 | static vector int __ATTRS_o_ai |
| 2576 | vec_vmaxsw(vector int a, vector bool int b) |
| 2577 | { |
| 2578 | return __builtin_altivec_vmaxsw(a, (vector int)b); |
| 2579 | } |
| 2580 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2581 | /* vec_vmaxuw */ |
| 2582 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2583 | static vector unsigned int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2584 | vec_vmaxuw(vector unsigned int a, vector unsigned int b) |
| 2585 | { |
| 2586 | return __builtin_altivec_vmaxuw(a, b); |
| 2587 | } |
| 2588 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 2589 | static vector unsigned int __ATTRS_o_ai |
| 2590 | vec_vmaxuw(vector bool int a, vector unsigned int b) |
| 2591 | { |
| 2592 | return __builtin_altivec_vmaxuw((vector unsigned int)a, b); |
| 2593 | } |
| 2594 | |
| 2595 | static vector unsigned int __ATTRS_o_ai |
| 2596 | vec_vmaxuw(vector unsigned int a, vector bool int b) |
| 2597 | { |
| 2598 | return __builtin_altivec_vmaxuw(a, (vector unsigned int)b); |
| 2599 | } |
| 2600 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2601 | /* vec_vmaxfp */ |
| 2602 | |
| 2603 | static vector float __attribute__((__always_inline__)) |
| 2604 | vec_vmaxfp(vector float a, vector float b) |
| 2605 | { |
| 2606 | return __builtin_altivec_vmaxfp(a, b); |
| 2607 | } |
| 2608 | |
| 2609 | /* vec_mergeh */ |
| 2610 | |
| 2611 | static vector signed char __ATTRS_o_ai |
| 2612 | vec_mergeh(vector signed char a, vector signed char b) |
| 2613 | { |
| 2614 | return vec_perm(a, b, (vector unsigned char) |
| 2615 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2616 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2617 | } |
| 2618 | |
| 2619 | static vector unsigned char __ATTRS_o_ai |
| 2620 | vec_mergeh(vector unsigned char a, vector unsigned char b) |
| 2621 | { |
| 2622 | return vec_perm(a, b, (vector unsigned char) |
| 2623 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2624 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2625 | } |
| 2626 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2627 | static vector bool char __ATTRS_o_ai |
| 2628 | vec_mergeh(vector bool char a, vector bool char b) |
| 2629 | { |
| 2630 | return vec_perm(a, b, (vector unsigned char) |
| 2631 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2632 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2633 | } |
| 2634 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2635 | static vector short __ATTRS_o_ai |
| 2636 | vec_mergeh(vector short a, vector short b) |
| 2637 | { |
| 2638 | return vec_perm(a, b, (vector unsigned char) |
| 2639 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2640 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2641 | } |
| 2642 | |
| 2643 | static vector unsigned short __ATTRS_o_ai |
| 2644 | vec_mergeh(vector unsigned short a, vector unsigned short b) |
| 2645 | { |
| 2646 | return vec_perm(a, b, (vector unsigned char) |
| 2647 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2648 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2649 | } |
| 2650 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2651 | static vector bool short __ATTRS_o_ai |
| 2652 | vec_mergeh(vector bool short a, vector bool short b) |
| 2653 | { |
| 2654 | return vec_perm(a, b, (vector unsigned char) |
| 2655 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2656 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2657 | } |
| 2658 | |
| 2659 | static vector pixel __ATTRS_o_ai |
| 2660 | vec_mergeh(vector pixel a, vector pixel b) |
| 2661 | { |
| 2662 | return vec_perm(a, b, (vector unsigned char) |
| 2663 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2664 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2665 | } |
| 2666 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2667 | static vector int __ATTRS_o_ai |
| 2668 | vec_mergeh(vector int a, vector int b) |
| 2669 | { |
| 2670 | return vec_perm(a, b, (vector unsigned char) |
| 2671 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2672 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2673 | } |
| 2674 | |
| 2675 | static vector unsigned int __ATTRS_o_ai |
| 2676 | vec_mergeh(vector unsigned int a, vector unsigned int b) |
| 2677 | { |
| 2678 | return vec_perm(a, b, (vector unsigned char) |
| 2679 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2680 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2681 | } |
| 2682 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2683 | static vector bool int __ATTRS_o_ai |
| 2684 | vec_mergeh(vector bool int a, vector bool int b) |
| 2685 | { |
| 2686 | return vec_perm(a, b, (vector unsigned char) |
| 2687 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2688 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2689 | } |
| 2690 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2691 | static vector float __ATTRS_o_ai |
| 2692 | vec_mergeh(vector float a, vector float b) |
| 2693 | { |
| 2694 | return vec_perm(a, b, (vector unsigned char) |
| 2695 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2696 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2697 | } |
| 2698 | |
| 2699 | /* vec_vmrghb */ |
| 2700 | |
| 2701 | #define __builtin_altivec_vmrghb vec_vmrghb |
| 2702 | |
| 2703 | static vector signed char __ATTRS_o_ai |
| 2704 | vec_vmrghb(vector signed char a, vector signed char b) |
| 2705 | { |
| 2706 | return vec_perm(a, b, (vector unsigned char) |
| 2707 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2708 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2709 | } |
| 2710 | |
| 2711 | static vector unsigned char __ATTRS_o_ai |
| 2712 | vec_vmrghb(vector unsigned char a, vector unsigned char b) |
| 2713 | { |
| 2714 | return vec_perm(a, b, (vector unsigned char) |
| 2715 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2716 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2717 | } |
| 2718 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2719 | static vector bool char __ATTRS_o_ai |
| 2720 | vec_vmrghb(vector bool char a, vector bool char b) |
| 2721 | { |
| 2722 | return vec_perm(a, b, (vector unsigned char) |
| 2723 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2724 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2725 | } |
| 2726 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2727 | /* vec_vmrghh */ |
| 2728 | |
| 2729 | #define __builtin_altivec_vmrghh vec_vmrghh |
| 2730 | |
| 2731 | static vector short __ATTRS_o_ai |
| 2732 | vec_vmrghh(vector short a, vector short b) |
| 2733 | { |
| 2734 | return vec_perm(a, b, (vector unsigned char) |
| 2735 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2736 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2737 | } |
| 2738 | |
| 2739 | static vector unsigned short __ATTRS_o_ai |
| 2740 | vec_vmrghh(vector unsigned short a, vector unsigned short b) |
| 2741 | { |
| 2742 | return vec_perm(a, b, (vector unsigned char) |
| 2743 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2744 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2745 | } |
| 2746 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2747 | static vector bool short __ATTRS_o_ai |
| 2748 | vec_vmrghh(vector bool short a, vector bool short b) |
| 2749 | { |
| 2750 | return vec_perm(a, b, (vector unsigned char) |
| 2751 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2752 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2753 | } |
| 2754 | |
| 2755 | static vector pixel __ATTRS_o_ai |
| 2756 | vec_vmrghh(vector pixel a, vector pixel b) |
| 2757 | { |
| 2758 | return vec_perm(a, b, (vector unsigned char) |
| 2759 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2760 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2761 | } |
| 2762 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2763 | /* vec_vmrghw */ |
| 2764 | |
| 2765 | #define __builtin_altivec_vmrghw vec_vmrghw |
| 2766 | |
| 2767 | static vector int __ATTRS_o_ai |
| 2768 | vec_vmrghw(vector int a, vector int b) |
| 2769 | { |
| 2770 | return vec_perm(a, b, (vector unsigned char) |
| 2771 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2772 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2773 | } |
| 2774 | |
| 2775 | static vector unsigned int __ATTRS_o_ai |
| 2776 | vec_vmrghw(vector unsigned int a, vector unsigned int b) |
| 2777 | { |
| 2778 | return vec_perm(a, b, (vector unsigned char) |
| 2779 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2780 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2781 | } |
| 2782 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2783 | static vector bool int __ATTRS_o_ai |
| 2784 | vec_vmrghw(vector bool int a, vector bool int b) |
| 2785 | { |
| 2786 | return vec_perm(a, b, (vector unsigned char) |
| 2787 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2788 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2789 | } |
| 2790 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2791 | static vector float __ATTRS_o_ai |
| 2792 | vec_vmrghw(vector float a, vector float b) |
| 2793 | { |
| 2794 | return vec_perm(a, b, (vector unsigned char) |
| 2795 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2796 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2797 | } |
| 2798 | |
| 2799 | /* vec_mergel */ |
| 2800 | |
| 2801 | static vector signed char __ATTRS_o_ai |
| 2802 | vec_mergel(vector signed char a, vector signed char b) |
| 2803 | { |
| 2804 | return vec_perm(a, b, (vector unsigned char) |
| 2805 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 2806 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 2807 | } |
| 2808 | |
| 2809 | static vector unsigned char __ATTRS_o_ai |
| 2810 | vec_mergel(vector unsigned char a, vector unsigned char b) |
| 2811 | { |
| 2812 | return vec_perm(a, b, (vector unsigned char) |
| 2813 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 2814 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 2815 | } |
| 2816 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2817 | static vector bool char __ATTRS_o_ai |
| 2818 | vec_mergel(vector bool char a, vector bool char b) |
| 2819 | { |
| 2820 | return vec_perm(a, b, (vector unsigned char) |
| 2821 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 2822 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 2823 | } |
| 2824 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2825 | static vector short __ATTRS_o_ai |
| 2826 | vec_mergel(vector short a, vector short b) |
| 2827 | { |
| 2828 | return vec_perm(a, b, (vector unsigned char) |
| 2829 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2830 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2831 | } |
| 2832 | |
| 2833 | static vector unsigned short __ATTRS_o_ai |
| 2834 | vec_mergel(vector unsigned short a, vector unsigned short b) |
| 2835 | { |
| 2836 | return vec_perm(a, b, (vector unsigned char) |
| 2837 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2838 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2839 | } |
| 2840 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2841 | static vector bool short __ATTRS_o_ai |
| 2842 | vec_mergel(vector bool short a, vector bool short b) |
| 2843 | { |
| 2844 | return vec_perm(a, b, (vector unsigned char) |
| 2845 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2846 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2847 | } |
| 2848 | |
| 2849 | static vector pixel __ATTRS_o_ai |
| 2850 | vec_mergel(vector pixel a, vector pixel b) |
| 2851 | { |
| 2852 | return vec_perm(a, b, (vector unsigned char) |
| 2853 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2854 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2855 | } |
| 2856 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2857 | static vector int __ATTRS_o_ai |
| 2858 | vec_mergel(vector int a, vector int b) |
| 2859 | { |
| 2860 | return vec_perm(a, b, (vector unsigned char) |
| 2861 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2862 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2863 | } |
| 2864 | |
| 2865 | static vector unsigned int __ATTRS_o_ai |
| 2866 | vec_mergel(vector unsigned int a, vector unsigned int b) |
| 2867 | { |
| 2868 | return vec_perm(a, b, (vector unsigned char) |
| 2869 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2870 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2871 | } |
| 2872 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2873 | static vector bool int __ATTRS_o_ai |
| 2874 | vec_mergel(vector bool int a, vector bool int b) |
| 2875 | { |
| 2876 | return vec_perm(a, b, (vector unsigned char) |
| 2877 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2878 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2879 | } |
| 2880 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2881 | static vector float __ATTRS_o_ai |
| 2882 | vec_mergel(vector float a, vector float b) |
| 2883 | { |
| 2884 | return vec_perm(a, b, (vector unsigned char) |
| 2885 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2886 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2887 | } |
| 2888 | |
| 2889 | /* vec_vmrglb */ |
| 2890 | |
| 2891 | #define __builtin_altivec_vmrglb vec_vmrglb |
| 2892 | |
| 2893 | static vector signed char __ATTRS_o_ai |
| 2894 | vec_vmrglb(vector signed char a, vector signed char b) |
| 2895 | { |
| 2896 | return vec_perm(a, b, (vector unsigned char) |
| 2897 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 2898 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 2899 | } |
| 2900 | |
| 2901 | static vector unsigned char __ATTRS_o_ai |
| 2902 | vec_vmrglb(vector unsigned char a, vector unsigned char b) |
| 2903 | { |
| 2904 | return vec_perm(a, b, (vector unsigned char) |
| 2905 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 2906 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 2907 | } |
| 2908 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2909 | static vector bool char __ATTRS_o_ai |
| 2910 | vec_vmrglb(vector bool char a, vector bool char b) |
| 2911 | { |
| 2912 | return vec_perm(a, b, (vector unsigned char) |
| 2913 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 2914 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 2915 | } |
| 2916 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2917 | /* vec_vmrglh */ |
| 2918 | |
| 2919 | #define __builtin_altivec_vmrglh vec_vmrglh |
| 2920 | |
| 2921 | static vector short __ATTRS_o_ai |
| 2922 | vec_vmrglh(vector short a, vector short b) |
| 2923 | { |
| 2924 | return vec_perm(a, b, (vector unsigned char) |
| 2925 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2926 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2927 | } |
| 2928 | |
| 2929 | static vector unsigned short __ATTRS_o_ai |
| 2930 | vec_vmrglh(vector unsigned short a, vector unsigned short b) |
| 2931 | { |
| 2932 | return vec_perm(a, b, (vector unsigned char) |
| 2933 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2934 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2935 | } |
| 2936 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2937 | static vector bool short __ATTRS_o_ai |
| 2938 | vec_vmrglh(vector bool short a, vector bool short b) |
| 2939 | { |
| 2940 | return vec_perm(a, b, (vector unsigned char) |
| 2941 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2942 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2943 | } |
| 2944 | |
| 2945 | static vector pixel __ATTRS_o_ai |
| 2946 | vec_vmrglh(vector pixel a, vector pixel b) |
| 2947 | { |
| 2948 | return vec_perm(a, b, (vector unsigned char) |
| 2949 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 2950 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 2951 | } |
| 2952 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2953 | /* vec_vmrglw */ |
| 2954 | |
| 2955 | #define __builtin_altivec_vmrglw vec_vmrglw |
| 2956 | |
| 2957 | static vector int __ATTRS_o_ai |
| 2958 | vec_vmrglw(vector int a, vector int b) |
| 2959 | { |
| 2960 | return vec_perm(a, b, (vector unsigned char) |
| 2961 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2962 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2963 | } |
| 2964 | |
| 2965 | static vector unsigned int __ATTRS_o_ai |
| 2966 | vec_vmrglw(vector unsigned int a, vector unsigned int b) |
| 2967 | { |
| 2968 | return vec_perm(a, b, (vector unsigned char) |
| 2969 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2970 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2971 | } |
| 2972 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 2973 | static vector bool int __ATTRS_o_ai |
| 2974 | vec_vmrglw(vector bool int a, vector bool int b) |
| 2975 | { |
| 2976 | return vec_perm(a, b, (vector unsigned char) |
| 2977 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2978 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2979 | } |
| 2980 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2981 | static vector float __ATTRS_o_ai |
| 2982 | vec_vmrglw(vector float a, vector float b) |
| 2983 | { |
| 2984 | return vec_perm(a, b, (vector unsigned char) |
| 2985 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 2986 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 2987 | } |
| 2988 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2989 | /* vec_mfvscr */ |
| 2990 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2991 | static vector unsigned short __attribute__((__always_inline__)) |
| 2992 | vec_mfvscr(void) |
| 2993 | { |
| 2994 | return __builtin_altivec_mfvscr(); |
| 2995 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2996 | |
| 2997 | /* vec_min */ |
| 2998 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2999 | static vector signed char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 3000 | vec_min(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3001 | { |
| 3002 | return __builtin_altivec_vminsb(a, b); |
| 3003 | } |
| 3004 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3005 | static vector signed char __ATTRS_o_ai |
| 3006 | vec_min(vector bool char a, vector signed char b) |
| 3007 | { |
| 3008 | return __builtin_altivec_vminsb((vector signed char)a, b); |
| 3009 | } |
| 3010 | |
| 3011 | static vector signed char __ATTRS_o_ai |
| 3012 | vec_min(vector signed char a, vector bool char b) |
| 3013 | { |
| 3014 | return __builtin_altivec_vminsb(a, (vector signed char)b); |
| 3015 | } |
| 3016 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3017 | static vector unsigned char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 3018 | vec_min(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3019 | { |
| 3020 | return __builtin_altivec_vminub(a, b); |
| 3021 | } |
| 3022 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3023 | static vector unsigned char __ATTRS_o_ai |
| 3024 | vec_min(vector bool char a, vector unsigned char b) |
| 3025 | { |
| 3026 | return __builtin_altivec_vminub((vector unsigned char)a, b); |
| 3027 | } |
| 3028 | |
| 3029 | static vector unsigned char __ATTRS_o_ai |
| 3030 | vec_min(vector unsigned char a, vector bool char b) |
| 3031 | { |
| 3032 | return __builtin_altivec_vminub(a, (vector unsigned char)b); |
| 3033 | } |
| 3034 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3035 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3036 | vec_min(vector short a, vector short b) |
| 3037 | { |
| 3038 | return __builtin_altivec_vminsh(a, b); |
| 3039 | } |
| 3040 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3041 | static vector short __ATTRS_o_ai |
| 3042 | vec_min(vector bool short a, vector short b) |
| 3043 | { |
| 3044 | return __builtin_altivec_vminsh((vector short)a, b); |
| 3045 | } |
| 3046 | |
| 3047 | static vector short __ATTRS_o_ai |
| 3048 | vec_min(vector short a, vector bool short b) |
| 3049 | { |
| 3050 | return __builtin_altivec_vminsh(a, (vector short)b); |
| 3051 | } |
| 3052 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3053 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3054 | vec_min(vector unsigned short a, vector unsigned short b) |
| 3055 | { |
| 3056 | return __builtin_altivec_vminuh(a, b); |
| 3057 | } |
| 3058 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3059 | static vector unsigned short __ATTRS_o_ai |
| 3060 | vec_min(vector bool short a, vector unsigned short b) |
| 3061 | { |
| 3062 | return __builtin_altivec_vminuh((vector unsigned short)a, b); |
| 3063 | } |
| 3064 | |
| 3065 | static vector unsigned short __ATTRS_o_ai |
| 3066 | vec_min(vector unsigned short a, vector bool short b) |
| 3067 | { |
| 3068 | return __builtin_altivec_vminuh(a, (vector unsigned short)b); |
| 3069 | } |
| 3070 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3071 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3072 | vec_min(vector int a, vector int b) |
| 3073 | { |
| 3074 | return __builtin_altivec_vminsw(a, b); |
| 3075 | } |
| 3076 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3077 | static vector int __ATTRS_o_ai |
| 3078 | vec_min(vector bool int a, vector int b) |
| 3079 | { |
| 3080 | return __builtin_altivec_vminsw((vector int)a, b); |
| 3081 | } |
| 3082 | |
| 3083 | static vector int __ATTRS_o_ai |
| 3084 | vec_min(vector int a, vector bool int b) |
| 3085 | { |
| 3086 | return __builtin_altivec_vminsw(a, (vector int)b); |
| 3087 | } |
| 3088 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3089 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3090 | vec_min(vector unsigned int a, vector unsigned int b) |
| 3091 | { |
| 3092 | return __builtin_altivec_vminuw(a, b); |
| 3093 | } |
| 3094 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3095 | static vector unsigned int __ATTRS_o_ai |
| 3096 | vec_min(vector bool int a, vector unsigned int b) |
| 3097 | { |
| 3098 | return __builtin_altivec_vminuw((vector unsigned int)a, b); |
| 3099 | } |
| 3100 | |
| 3101 | static vector unsigned int __ATTRS_o_ai |
| 3102 | vec_min(vector unsigned int a, vector bool int b) |
| 3103 | { |
| 3104 | return __builtin_altivec_vminuw(a, (vector unsigned int)b); |
| 3105 | } |
| 3106 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3107 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3108 | vec_min(vector float a, vector float b) |
| 3109 | { |
| 3110 | return __builtin_altivec_vminfp(a, b); |
| 3111 | } |
| 3112 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3113 | /* vec_vminsb */ |
| 3114 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3115 | static vector signed char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 3116 | vec_vminsb(vector signed char a, vector signed char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3117 | { |
| 3118 | return __builtin_altivec_vminsb(a, b); |
| 3119 | } |
| 3120 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3121 | static vector signed char __ATTRS_o_ai |
| 3122 | vec_vminsb(vector bool char a, vector signed char b) |
| 3123 | { |
| 3124 | return __builtin_altivec_vminsb((vector signed char)a, b); |
| 3125 | } |
| 3126 | |
| 3127 | static vector signed char __ATTRS_o_ai |
| 3128 | vec_vminsb(vector signed char a, vector bool char b) |
| 3129 | { |
| 3130 | return __builtin_altivec_vminsb(a, (vector signed char)b); |
| 3131 | } |
| 3132 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3133 | /* vec_vminub */ |
| 3134 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3135 | static vector unsigned char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 3136 | vec_vminub(vector unsigned char a, vector unsigned char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3137 | { |
| 3138 | return __builtin_altivec_vminub(a, b); |
| 3139 | } |
| 3140 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3141 | static vector unsigned char __ATTRS_o_ai |
| 3142 | vec_vminub(vector bool char a, vector unsigned char b) |
| 3143 | { |
| 3144 | return __builtin_altivec_vminub((vector unsigned char)a, b); |
| 3145 | } |
| 3146 | |
| 3147 | static vector unsigned char __ATTRS_o_ai |
| 3148 | vec_vminub(vector unsigned char a, vector bool char b) |
| 3149 | { |
| 3150 | return __builtin_altivec_vminub(a, (vector unsigned char)b); |
| 3151 | } |
| 3152 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3153 | /* vec_vminsh */ |
| 3154 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3155 | static vector short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3156 | vec_vminsh(vector short a, vector short b) |
| 3157 | { |
| 3158 | return __builtin_altivec_vminsh(a, b); |
| 3159 | } |
| 3160 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3161 | static vector short __ATTRS_o_ai |
| 3162 | vec_vminsh(vector bool short a, vector short b) |
| 3163 | { |
| 3164 | return __builtin_altivec_vminsh((vector short)a, b); |
| 3165 | } |
| 3166 | |
| 3167 | static vector short __ATTRS_o_ai |
| 3168 | vec_vminsh(vector short a, vector bool short b) |
| 3169 | { |
| 3170 | return __builtin_altivec_vminsh(a, (vector short)b); |
| 3171 | } |
| 3172 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3173 | /* vec_vminuh */ |
| 3174 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3175 | static vector unsigned short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3176 | vec_vminuh(vector unsigned short a, vector unsigned short b) |
| 3177 | { |
| 3178 | return __builtin_altivec_vminuh(a, b); |
| 3179 | } |
| 3180 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3181 | static vector unsigned short __ATTRS_o_ai |
| 3182 | vec_vminuh(vector bool short a, vector unsigned short b) |
| 3183 | { |
| 3184 | return __builtin_altivec_vminuh((vector unsigned short)a, b); |
| 3185 | } |
| 3186 | |
| 3187 | static vector unsigned short __ATTRS_o_ai |
| 3188 | vec_vminuh(vector unsigned short a, vector bool short b) |
| 3189 | { |
| 3190 | return __builtin_altivec_vminuh(a, (vector unsigned short)b); |
| 3191 | } |
| 3192 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3193 | /* vec_vminsw */ |
| 3194 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3195 | static vector int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3196 | vec_vminsw(vector int a, vector int b) |
| 3197 | { |
| 3198 | return __builtin_altivec_vminsw(a, b); |
| 3199 | } |
| 3200 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3201 | static vector int __ATTRS_o_ai |
| 3202 | vec_vminsw(vector bool int a, vector int b) |
| 3203 | { |
| 3204 | return __builtin_altivec_vminsw((vector int)a, b); |
| 3205 | } |
| 3206 | |
| 3207 | static vector int __ATTRS_o_ai |
| 3208 | vec_vminsw(vector int a, vector bool int b) |
| 3209 | { |
| 3210 | return __builtin_altivec_vminsw(a, (vector int)b); |
| 3211 | } |
| 3212 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3213 | /* vec_vminuw */ |
| 3214 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3215 | static vector unsigned int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3216 | vec_vminuw(vector unsigned int a, vector unsigned int b) |
| 3217 | { |
| 3218 | return __builtin_altivec_vminuw(a, b); |
| 3219 | } |
| 3220 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3221 | static vector unsigned int __ATTRS_o_ai |
| 3222 | vec_vminuw(vector bool int a, vector unsigned int b) |
| 3223 | { |
| 3224 | return __builtin_altivec_vminuw((vector unsigned int)a, b); |
| 3225 | } |
| 3226 | |
| 3227 | static vector unsigned int __ATTRS_o_ai |
| 3228 | vec_vminuw(vector unsigned int a, vector bool int b) |
| 3229 | { |
| 3230 | return __builtin_altivec_vminuw(a, (vector unsigned int)b); |
| 3231 | } |
| 3232 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3233 | /* vec_vminfp */ |
| 3234 | |
| 3235 | static vector float __attribute__((__always_inline__)) |
| 3236 | vec_vminfp(vector float a, vector float b) |
| 3237 | { |
| 3238 | return __builtin_altivec_vminfp(a, b); |
| 3239 | } |
| 3240 | |
| 3241 | /* vec_mladd */ |
| 3242 | |
| 3243 | #define __builtin_altivec_vmladduhm vec_mladd |
| 3244 | |
| 3245 | static vector short __ATTRS_o_ai |
| 3246 | vec_mladd(vector short a, vector short b, vector short c) |
| 3247 | { |
| 3248 | return a * b + c; |
| 3249 | } |
| 3250 | |
| 3251 | static vector short __ATTRS_o_ai |
| 3252 | vec_mladd(vector short a, vector unsigned short b, vector unsigned short c) |
| 3253 | { |
| 3254 | return a * (vector short)b + (vector short)c; |
| 3255 | } |
| 3256 | |
| 3257 | static vector short __ATTRS_o_ai |
| 3258 | vec_mladd(vector unsigned short a, vector short b, vector short c) |
| 3259 | { |
| 3260 | return (vector short)a * b + c; |
| 3261 | } |
| 3262 | |
| 3263 | static vector unsigned short __ATTRS_o_ai |
| 3264 | vec_mladd(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 3265 | { |
| 3266 | return a * b + c; |
| 3267 | } |
| 3268 | |
| 3269 | /* vec_vmladduhm */ |
| 3270 | |
| 3271 | static vector short __ATTRS_o_ai |
| 3272 | vec_vmladduhm(vector short a, vector short b, vector short c) |
| 3273 | { |
| 3274 | return a * b + c; |
| 3275 | } |
| 3276 | |
| 3277 | static vector short __ATTRS_o_ai |
| 3278 | vec_vmladduhm(vector short a, vector unsigned short b, vector unsigned short c) |
| 3279 | { |
| 3280 | return a * (vector short)b + (vector short)c; |
| 3281 | } |
| 3282 | |
| 3283 | static vector short __ATTRS_o_ai |
| 3284 | vec_vmladduhm(vector unsigned short a, vector short b, vector short c) |
| 3285 | { |
| 3286 | return (vector short)a * b + c; |
| 3287 | } |
| 3288 | |
| 3289 | static vector unsigned short __ATTRS_o_ai |
| 3290 | vec_vmladduhm(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 3291 | { |
| 3292 | return a * b + c; |
| 3293 | } |
| 3294 | |
| 3295 | /* vec_mradds */ |
| 3296 | |
| 3297 | static vector short __attribute__((__always_inline__)) |
| 3298 | vec_mradds(vector short a, vector short b, vector short c) |
| 3299 | { |
| 3300 | return __builtin_altivec_vmhraddshs(a, b, c); |
| 3301 | } |
| 3302 | |
| 3303 | /* vec_vmhraddshs */ |
| 3304 | |
| 3305 | static vector short __attribute__((__always_inline__)) |
| 3306 | vec_vmhraddshs(vector short a, vector short b, vector short c) |
| 3307 | { |
| 3308 | return __builtin_altivec_vmhraddshs(a, b, c); |
| 3309 | } |
| 3310 | |
| 3311 | /* vec_msum */ |
| 3312 | |
| 3313 | static vector int __ATTRS_o_ai |
| 3314 | vec_msum(vector signed char a, vector unsigned char b, vector int c) |
| 3315 | { |
| 3316 | return __builtin_altivec_vmsummbm(a, b, c); |
| 3317 | } |
| 3318 | |
| 3319 | static vector unsigned int __ATTRS_o_ai |
| 3320 | vec_msum(vector unsigned char a, vector unsigned char b, vector unsigned int c) |
| 3321 | { |
| 3322 | return __builtin_altivec_vmsumubm(a, b, c); |
| 3323 | } |
| 3324 | |
| 3325 | static vector int __ATTRS_o_ai |
| 3326 | vec_msum(vector short a, vector short b, vector int c) |
| 3327 | { |
| 3328 | return __builtin_altivec_vmsumshm(a, b, c); |
| 3329 | } |
| 3330 | |
| 3331 | static vector unsigned int __ATTRS_o_ai |
| 3332 | vec_msum(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 3333 | { |
| 3334 | return __builtin_altivec_vmsumuhm(a, b, c); |
| 3335 | } |
| 3336 | |
| 3337 | /* vec_vmsummbm */ |
| 3338 | |
| 3339 | static vector int __attribute__((__always_inline__)) |
| 3340 | vec_vmsummbm(vector signed char a, vector unsigned char b, vector int c) |
| 3341 | { |
| 3342 | return __builtin_altivec_vmsummbm(a, b, c); |
| 3343 | } |
| 3344 | |
| 3345 | /* vec_vmsumubm */ |
| 3346 | |
| 3347 | static vector unsigned int __attribute__((__always_inline__)) |
| 3348 | vec_vmsumubm(vector unsigned char a, vector unsigned char b, vector unsigned int c) |
| 3349 | { |
| 3350 | return __builtin_altivec_vmsumubm(a, b, c); |
| 3351 | } |
| 3352 | |
| 3353 | /* vec_vmsumshm */ |
| 3354 | |
| 3355 | static vector int __attribute__((__always_inline__)) |
| 3356 | vec_vmsumshm(vector short a, vector short b, vector int c) |
| 3357 | { |
| 3358 | return __builtin_altivec_vmsumshm(a, b, c); |
| 3359 | } |
| 3360 | |
| 3361 | /* vec_vmsumuhm */ |
| 3362 | |
| 3363 | static vector unsigned int __attribute__((__always_inline__)) |
| 3364 | vec_vmsumuhm(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 3365 | { |
| 3366 | return __builtin_altivec_vmsumuhm(a, b, c); |
| 3367 | } |
| 3368 | |
| 3369 | /* vec_msums */ |
| 3370 | |
| 3371 | static vector int __ATTRS_o_ai |
| 3372 | vec_msums(vector short a, vector short b, vector int c) |
| 3373 | { |
| 3374 | return __builtin_altivec_vmsumshs(a, b, c); |
| 3375 | } |
| 3376 | |
| 3377 | static vector unsigned int __ATTRS_o_ai |
| 3378 | vec_msums(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 3379 | { |
| 3380 | return __builtin_altivec_vmsumuhs(a, b, c); |
| 3381 | } |
| 3382 | |
| 3383 | /* vec_vmsumshs */ |
| 3384 | |
| 3385 | static vector int __attribute__((__always_inline__)) |
| 3386 | vec_vmsumshs(vector short a, vector short b, vector int c) |
| 3387 | { |
| 3388 | return __builtin_altivec_vmsumshs(a, b, c); |
| 3389 | } |
| 3390 | |
| 3391 | /* vec_vmsumuhs */ |
| 3392 | |
| 3393 | static vector unsigned int __attribute__((__always_inline__)) |
| 3394 | vec_vmsumuhs(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 3395 | { |
| 3396 | return __builtin_altivec_vmsumuhs(a, b, c); |
| 3397 | } |
| 3398 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 3399 | /* vec_mtvscr */ |
| 3400 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3401 | static void __ATTRS_o_ai |
| 3402 | vec_mtvscr(vector signed char a) |
| 3403 | { |
| 3404 | __builtin_altivec_mtvscr((vector int)a); |
| 3405 | } |
| 3406 | |
| 3407 | static void __ATTRS_o_ai |
| 3408 | vec_mtvscr(vector unsigned char a) |
| 3409 | { |
| 3410 | __builtin_altivec_mtvscr((vector int)a); |
| 3411 | } |
| 3412 | |
| 3413 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3414 | vec_mtvscr(vector bool char a) |
| 3415 | { |
| 3416 | __builtin_altivec_mtvscr((vector int)a); |
| 3417 | } |
| 3418 | |
| 3419 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3420 | vec_mtvscr(vector short a) |
| 3421 | { |
| 3422 | __builtin_altivec_mtvscr((vector int)a); |
| 3423 | } |
| 3424 | |
| 3425 | static void __ATTRS_o_ai |
| 3426 | vec_mtvscr(vector unsigned short a) |
| 3427 | { |
| 3428 | __builtin_altivec_mtvscr((vector int)a); |
| 3429 | } |
| 3430 | |
| 3431 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3432 | vec_mtvscr(vector bool short a) |
| 3433 | { |
| 3434 | __builtin_altivec_mtvscr((vector int)a); |
| 3435 | } |
| 3436 | |
| 3437 | static void __ATTRS_o_ai |
| 3438 | vec_mtvscr(vector pixel a) |
| 3439 | { |
| 3440 | __builtin_altivec_mtvscr((vector int)a); |
| 3441 | } |
| 3442 | |
| 3443 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3444 | vec_mtvscr(vector int a) |
| 3445 | { |
| 3446 | __builtin_altivec_mtvscr((vector int)a); |
| 3447 | } |
| 3448 | |
| 3449 | static void __ATTRS_o_ai |
| 3450 | vec_mtvscr(vector unsigned int a) |
| 3451 | { |
| 3452 | __builtin_altivec_mtvscr((vector int)a); |
| 3453 | } |
| 3454 | |
| 3455 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3456 | vec_mtvscr(vector bool int a) |
| 3457 | { |
| 3458 | __builtin_altivec_mtvscr((vector int)a); |
| 3459 | } |
| 3460 | |
| 3461 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3462 | vec_mtvscr(vector float a) |
| 3463 | { |
| 3464 | __builtin_altivec_mtvscr((vector int)a); |
| 3465 | } |
| 3466 | |
| 3467 | /* vec_mule */ |
| 3468 | |
| 3469 | static vector short __ATTRS_o_ai |
| 3470 | vec_mule(vector signed char a, vector signed char b) |
| 3471 | { |
| 3472 | return __builtin_altivec_vmulesb(a, b); |
| 3473 | } |
| 3474 | |
| 3475 | static vector unsigned short __ATTRS_o_ai |
| 3476 | vec_mule(vector unsigned char a, vector unsigned char b) |
| 3477 | { |
| 3478 | return __builtin_altivec_vmuleub(a, b); |
| 3479 | } |
| 3480 | |
| 3481 | static vector int __ATTRS_o_ai |
| 3482 | vec_mule(vector short a, vector short b) |
| 3483 | { |
| 3484 | return __builtin_altivec_vmulesh(a, b); |
| 3485 | } |
| 3486 | |
| 3487 | static vector unsigned int __ATTRS_o_ai |
| 3488 | vec_mule(vector unsigned short a, vector unsigned short b) |
| 3489 | { |
| 3490 | return __builtin_altivec_vmuleuh(a, b); |
| 3491 | } |
| 3492 | |
| 3493 | /* vec_vmulesb */ |
| 3494 | |
| 3495 | static vector short __attribute__((__always_inline__)) |
| 3496 | vec_vmulesb(vector signed char a, vector signed char b) |
| 3497 | { |
| 3498 | return __builtin_altivec_vmulesb(a, b); |
| 3499 | } |
| 3500 | |
| 3501 | /* vec_vmuleub */ |
| 3502 | |
| 3503 | static vector unsigned short __attribute__((__always_inline__)) |
| 3504 | vec_vmuleub(vector unsigned char a, vector unsigned char b) |
| 3505 | { |
| 3506 | return __builtin_altivec_vmuleub(a, b); |
| 3507 | } |
| 3508 | |
| 3509 | /* vec_vmulesh */ |
| 3510 | |
| 3511 | static vector int __attribute__((__always_inline__)) |
| 3512 | vec_vmulesh(vector short a, vector short b) |
| 3513 | { |
| 3514 | return __builtin_altivec_vmulesh(a, b); |
| 3515 | } |
| 3516 | |
| 3517 | /* vec_vmuleuh */ |
| 3518 | |
| 3519 | static vector unsigned int __attribute__((__always_inline__)) |
| 3520 | vec_vmuleuh(vector unsigned short a, vector unsigned short b) |
| 3521 | { |
| 3522 | return __builtin_altivec_vmuleuh(a, b); |
| 3523 | } |
| 3524 | |
| 3525 | /* vec_mulo */ |
| 3526 | |
| 3527 | static vector short __ATTRS_o_ai |
| 3528 | vec_mulo(vector signed char a, vector signed char b) |
| 3529 | { |
| 3530 | return __builtin_altivec_vmulosb(a, b); |
| 3531 | } |
| 3532 | |
| 3533 | static vector unsigned short __ATTRS_o_ai |
| 3534 | vec_mulo(vector unsigned char a, vector unsigned char b) |
| 3535 | { |
| 3536 | return __builtin_altivec_vmuloub(a, b); |
| 3537 | } |
| 3538 | |
| 3539 | static vector int __ATTRS_o_ai |
| 3540 | vec_mulo(vector short a, vector short b) |
| 3541 | { |
| 3542 | return __builtin_altivec_vmulosh(a, b); |
| 3543 | } |
| 3544 | |
| 3545 | static vector unsigned int __ATTRS_o_ai |
| 3546 | vec_mulo(vector unsigned short a, vector unsigned short b) |
| 3547 | { |
| 3548 | return __builtin_altivec_vmulouh(a, b); |
| 3549 | } |
| 3550 | |
| 3551 | /* vec_vmulosb */ |
| 3552 | |
| 3553 | static vector short __attribute__((__always_inline__)) |
| 3554 | vec_vmulosb(vector signed char a, vector signed char b) |
| 3555 | { |
| 3556 | return __builtin_altivec_vmulosb(a, b); |
| 3557 | } |
| 3558 | |
| 3559 | /* vec_vmuloub */ |
| 3560 | |
| 3561 | static vector unsigned short __attribute__((__always_inline__)) |
| 3562 | vec_vmuloub(vector unsigned char a, vector unsigned char b) |
| 3563 | { |
| 3564 | return __builtin_altivec_vmuloub(a, b); |
| 3565 | } |
| 3566 | |
| 3567 | /* vec_vmulosh */ |
| 3568 | |
| 3569 | static vector int __attribute__((__always_inline__)) |
| 3570 | vec_vmulosh(vector short a, vector short b) |
| 3571 | { |
| 3572 | return __builtin_altivec_vmulosh(a, b); |
| 3573 | } |
| 3574 | |
| 3575 | /* vec_vmulouh */ |
| 3576 | |
| 3577 | static vector unsigned int __attribute__((__always_inline__)) |
| 3578 | vec_vmulouh(vector unsigned short a, vector unsigned short b) |
| 3579 | { |
| 3580 | return __builtin_altivec_vmulouh(a, b); |
| 3581 | } |
| 3582 | |
| 3583 | /* vec_nmsub */ |
| 3584 | |
| 3585 | static vector float __attribute__((__always_inline__)) |
| 3586 | vec_nmsub(vector float a, vector float b, vector float c) |
| 3587 | { |
| 3588 | return __builtin_altivec_vnmsubfp(a, b, c); |
| 3589 | } |
| 3590 | |
| 3591 | /* vec_vnmsubfp */ |
| 3592 | |
| 3593 | static vector float __attribute__((__always_inline__)) |
| 3594 | vec_vnmsubfp(vector float a, vector float b, vector float c) |
| 3595 | { |
| 3596 | return __builtin_altivec_vnmsubfp(a, b, c); |
| 3597 | } |
| 3598 | |
| 3599 | /* vec_nor */ |
| 3600 | |
| 3601 | #define __builtin_altivec_vnor vec_nor |
| 3602 | |
| 3603 | static vector signed char __ATTRS_o_ai |
| 3604 | vec_nor(vector signed char a, vector signed char b) |
| 3605 | { |
| 3606 | return ~(a | b); |
| 3607 | } |
| 3608 | |
| 3609 | static vector unsigned char __ATTRS_o_ai |
| 3610 | vec_nor(vector unsigned char a, vector unsigned char b) |
| 3611 | { |
| 3612 | return ~(a | b); |
| 3613 | } |
| 3614 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3615 | static vector bool char __ATTRS_o_ai |
| 3616 | vec_nor(vector bool char a, vector bool char b) |
| 3617 | { |
| 3618 | return ~(a | b); |
| 3619 | } |
| 3620 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3621 | static vector short __ATTRS_o_ai |
| 3622 | vec_nor(vector short a, vector short b) |
| 3623 | { |
| 3624 | return ~(a | b); |
| 3625 | } |
| 3626 | |
| 3627 | static vector unsigned short __ATTRS_o_ai |
| 3628 | vec_nor(vector unsigned short a, vector unsigned short b) |
| 3629 | { |
| 3630 | return ~(a | b); |
| 3631 | } |
| 3632 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3633 | static vector bool short __ATTRS_o_ai |
| 3634 | vec_nor(vector bool short a, vector bool short b) |
| 3635 | { |
| 3636 | return ~(a | b); |
| 3637 | } |
| 3638 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3639 | static vector int __ATTRS_o_ai |
| 3640 | vec_nor(vector int a, vector int b) |
| 3641 | { |
| 3642 | return ~(a | b); |
| 3643 | } |
| 3644 | |
| 3645 | static vector unsigned int __ATTRS_o_ai |
| 3646 | vec_nor(vector unsigned int a, vector unsigned int b) |
| 3647 | { |
| 3648 | return ~(a | b); |
| 3649 | } |
| 3650 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3651 | static vector bool int __ATTRS_o_ai |
| 3652 | vec_nor(vector bool int a, vector bool int b) |
| 3653 | { |
| 3654 | return ~(a | b); |
| 3655 | } |
| 3656 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3657 | static vector float __ATTRS_o_ai |
| 3658 | vec_nor(vector float a, vector float b) |
| 3659 | { |
| 3660 | vector unsigned int res = ~((vector unsigned int)a | (vector unsigned int)b); |
| 3661 | return (vector float)res; |
| 3662 | } |
| 3663 | |
| 3664 | /* vec_vnor */ |
| 3665 | |
| 3666 | static vector signed char __ATTRS_o_ai |
| 3667 | vec_vnor(vector signed char a, vector signed char b) |
| 3668 | { |
| 3669 | return ~(a | b); |
| 3670 | } |
| 3671 | |
| 3672 | static vector unsigned char __ATTRS_o_ai |
| 3673 | vec_vnor(vector unsigned char a, vector unsigned char b) |
| 3674 | { |
| 3675 | return ~(a | b); |
| 3676 | } |
| 3677 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3678 | static vector bool char __ATTRS_o_ai |
| 3679 | vec_vnor(vector bool char a, vector bool char b) |
| 3680 | { |
| 3681 | return ~(a | b); |
| 3682 | } |
| 3683 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3684 | static vector short __ATTRS_o_ai |
| 3685 | vec_vnor(vector short a, vector short b) |
| 3686 | { |
| 3687 | return ~(a | b); |
| 3688 | } |
| 3689 | |
| 3690 | static vector unsigned short __ATTRS_o_ai |
| 3691 | vec_vnor(vector unsigned short a, vector unsigned short b) |
| 3692 | { |
| 3693 | return ~(a | b); |
| 3694 | } |
| 3695 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3696 | static vector bool short __ATTRS_o_ai |
| 3697 | vec_vnor(vector bool short a, vector bool short b) |
| 3698 | { |
| 3699 | return ~(a | b); |
| 3700 | } |
| 3701 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3702 | static vector int __ATTRS_o_ai |
| 3703 | vec_vnor(vector int a, vector int b) |
| 3704 | { |
| 3705 | return ~(a | b); |
| 3706 | } |
| 3707 | |
| 3708 | static vector unsigned int __ATTRS_o_ai |
| 3709 | vec_vnor(vector unsigned int a, vector unsigned int b) |
| 3710 | { |
| 3711 | return ~(a | b); |
| 3712 | } |
| 3713 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3714 | static vector bool int __ATTRS_o_ai |
| 3715 | vec_vnor(vector bool int a, vector bool int b) |
| 3716 | { |
| 3717 | return ~(a | b); |
| 3718 | } |
| 3719 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3720 | static vector float __ATTRS_o_ai |
| 3721 | vec_vnor(vector float a, vector float b) |
| 3722 | { |
| 3723 | vector unsigned int res = ~((vector unsigned int)a | (vector unsigned int)b); |
| 3724 | return (vector float)res; |
| 3725 | } |
| 3726 | |
| 3727 | /* vec_or */ |
| 3728 | |
| 3729 | #define __builtin_altivec_vor vec_or |
| 3730 | |
| 3731 | static vector signed char __ATTRS_o_ai |
| 3732 | vec_or(vector signed char a, vector signed char b) |
| 3733 | { |
| 3734 | return a | b; |
| 3735 | } |
| 3736 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3737 | static vector signed char __ATTRS_o_ai |
| 3738 | vec_or(vector bool char a, vector signed char b) |
| 3739 | { |
| 3740 | return (vector signed char)a | b; |
| 3741 | } |
| 3742 | |
| 3743 | static vector signed char __ATTRS_o_ai |
| 3744 | vec_or(vector signed char a, vector bool char b) |
| 3745 | { |
| 3746 | return a | (vector signed char)b; |
| 3747 | } |
| 3748 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3749 | static vector unsigned char __ATTRS_o_ai |
| 3750 | vec_or(vector unsigned char a, vector unsigned char b) |
| 3751 | { |
| 3752 | return a | b; |
| 3753 | } |
| 3754 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3755 | static vector unsigned char __ATTRS_o_ai |
| 3756 | vec_or(vector bool char a, vector unsigned char b) |
| 3757 | { |
| 3758 | return (vector unsigned char)a | b; |
| 3759 | } |
| 3760 | |
| 3761 | static vector unsigned char __ATTRS_o_ai |
| 3762 | vec_or(vector unsigned char a, vector bool char b) |
| 3763 | { |
| 3764 | return a | (vector unsigned char)b; |
| 3765 | } |
| 3766 | |
| 3767 | static vector bool char __ATTRS_o_ai |
| 3768 | vec_or(vector bool char a, vector bool char b) |
| 3769 | { |
| 3770 | return a | b; |
| 3771 | } |
| 3772 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3773 | static vector short __ATTRS_o_ai |
| 3774 | vec_or(vector short a, vector short b) |
| 3775 | { |
| 3776 | return a | b; |
| 3777 | } |
| 3778 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3779 | static vector short __ATTRS_o_ai |
| 3780 | vec_or(vector bool short a, vector short b) |
| 3781 | { |
| 3782 | return (vector short)a | b; |
| 3783 | } |
| 3784 | |
| 3785 | static vector short __ATTRS_o_ai |
| 3786 | vec_or(vector short a, vector bool short b) |
| 3787 | { |
| 3788 | return a | (vector short)b; |
| 3789 | } |
| 3790 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3791 | static vector unsigned short __ATTRS_o_ai |
| 3792 | vec_or(vector unsigned short a, vector unsigned short b) |
| 3793 | { |
| 3794 | return a | b; |
| 3795 | } |
| 3796 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3797 | static vector unsigned short __ATTRS_o_ai |
| 3798 | vec_or(vector bool short a, vector unsigned short b) |
| 3799 | { |
| 3800 | return (vector unsigned short)a | b; |
| 3801 | } |
| 3802 | |
| 3803 | static vector unsigned short __ATTRS_o_ai |
| 3804 | vec_or(vector unsigned short a, vector bool short b) |
| 3805 | { |
| 3806 | return a | (vector unsigned short)b; |
| 3807 | } |
| 3808 | |
| 3809 | static vector bool short __ATTRS_o_ai |
| 3810 | vec_or(vector bool short a, vector bool short b) |
| 3811 | { |
| 3812 | return a | b; |
| 3813 | } |
| 3814 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3815 | static vector int __ATTRS_o_ai |
| 3816 | vec_or(vector int a, vector int b) |
| 3817 | { |
| 3818 | return a | b; |
| 3819 | } |
| 3820 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3821 | static vector int __ATTRS_o_ai |
| 3822 | vec_or(vector bool int a, vector int b) |
| 3823 | { |
| 3824 | return (vector int)a | b; |
| 3825 | } |
| 3826 | |
| 3827 | static vector int __ATTRS_o_ai |
| 3828 | vec_or(vector int a, vector bool int b) |
| 3829 | { |
| 3830 | return a | (vector int)b; |
| 3831 | } |
| 3832 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3833 | static vector unsigned int __ATTRS_o_ai |
| 3834 | vec_or(vector unsigned int a, vector unsigned int b) |
| 3835 | { |
| 3836 | return a | b; |
| 3837 | } |
| 3838 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3839 | static vector unsigned int __ATTRS_o_ai |
| 3840 | vec_or(vector bool int a, vector unsigned int b) |
| 3841 | { |
| 3842 | return (vector unsigned int)a | b; |
| 3843 | } |
| 3844 | |
| 3845 | static vector unsigned int __ATTRS_o_ai |
| 3846 | vec_or(vector unsigned int a, vector bool int b) |
| 3847 | { |
| 3848 | return a | (vector unsigned int)b; |
| 3849 | } |
| 3850 | |
| 3851 | static vector bool int __ATTRS_o_ai |
| 3852 | vec_or(vector bool int a, vector bool int b) |
| 3853 | { |
| 3854 | return a | b; |
| 3855 | } |
| 3856 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3857 | static vector float __ATTRS_o_ai |
| 3858 | vec_or(vector float a, vector float b) |
| 3859 | { |
| 3860 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 3861 | return (vector float)res; |
| 3862 | } |
| 3863 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3864 | static vector float __ATTRS_o_ai |
| 3865 | vec_or(vector bool int a, vector float b) |
| 3866 | { |
| 3867 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 3868 | return (vector float)res; |
| 3869 | } |
| 3870 | |
| 3871 | static vector float __ATTRS_o_ai |
| 3872 | vec_or(vector float a, vector bool int b) |
| 3873 | { |
| 3874 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 3875 | return (vector float)res; |
| 3876 | } |
| 3877 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3878 | /* vec_vor */ |
| 3879 | |
| 3880 | static vector signed char __ATTRS_o_ai |
| 3881 | vec_vor(vector signed char a, vector signed char b) |
| 3882 | { |
| 3883 | return a | b; |
| 3884 | } |
| 3885 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3886 | static vector signed char __ATTRS_o_ai |
| 3887 | vec_vor(vector bool char a, vector signed char b) |
| 3888 | { |
| 3889 | return (vector signed char)a | b; |
| 3890 | } |
| 3891 | |
| 3892 | static vector signed char __ATTRS_o_ai |
| 3893 | vec_vor(vector signed char a, vector bool char b) |
| 3894 | { |
| 3895 | return a | (vector signed char)b; |
| 3896 | } |
| 3897 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3898 | static vector unsigned char __ATTRS_o_ai |
| 3899 | vec_vor(vector unsigned char a, vector unsigned char b) |
| 3900 | { |
| 3901 | return a | b; |
| 3902 | } |
| 3903 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3904 | static vector unsigned char __ATTRS_o_ai |
| 3905 | vec_vor(vector bool char a, vector unsigned char b) |
| 3906 | { |
| 3907 | return (vector unsigned char)a | b; |
| 3908 | } |
| 3909 | |
| 3910 | static vector unsigned char __ATTRS_o_ai |
| 3911 | vec_vor(vector unsigned char a, vector bool char b) |
| 3912 | { |
| 3913 | return a | (vector unsigned char)b; |
| 3914 | } |
| 3915 | |
| 3916 | static vector bool char __ATTRS_o_ai |
| 3917 | vec_vor(vector bool char a, vector bool char b) |
| 3918 | { |
| 3919 | return a | b; |
| 3920 | } |
| 3921 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3922 | static vector short __ATTRS_o_ai |
| 3923 | vec_vor(vector short a, vector short b) |
| 3924 | { |
| 3925 | return a | b; |
| 3926 | } |
| 3927 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3928 | static vector short __ATTRS_o_ai |
| 3929 | vec_vor(vector bool short a, vector short b) |
| 3930 | { |
| 3931 | return (vector short)a | b; |
| 3932 | } |
| 3933 | |
| 3934 | static vector short __ATTRS_o_ai |
| 3935 | vec_vor(vector short a, vector bool short b) |
| 3936 | { |
| 3937 | return a | (vector short)b; |
| 3938 | } |
| 3939 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3940 | static vector unsigned short __ATTRS_o_ai |
| 3941 | vec_vor(vector unsigned short a, vector unsigned short b) |
| 3942 | { |
| 3943 | return a | b; |
| 3944 | } |
| 3945 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3946 | static vector unsigned short __ATTRS_o_ai |
| 3947 | vec_vor(vector bool short a, vector unsigned short b) |
| 3948 | { |
| 3949 | return (vector unsigned short)a | b; |
| 3950 | } |
| 3951 | |
| 3952 | static vector unsigned short __ATTRS_o_ai |
| 3953 | vec_vor(vector unsigned short a, vector bool short b) |
| 3954 | { |
| 3955 | return a | (vector unsigned short)b; |
| 3956 | } |
| 3957 | |
| 3958 | static vector bool short __ATTRS_o_ai |
| 3959 | vec_vor(vector bool short a, vector bool short b) |
| 3960 | { |
| 3961 | return a | b; |
| 3962 | } |
| 3963 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3964 | static vector int __ATTRS_o_ai |
| 3965 | vec_vor(vector int a, vector int b) |
| 3966 | { |
| 3967 | return a | b; |
| 3968 | } |
| 3969 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3970 | static vector int __ATTRS_o_ai |
| 3971 | vec_vor(vector bool int a, vector int b) |
| 3972 | { |
| 3973 | return (vector int)a | b; |
| 3974 | } |
| 3975 | |
| 3976 | static vector int __ATTRS_o_ai |
| 3977 | vec_vor(vector int a, vector bool int b) |
| 3978 | { |
| 3979 | return a | (vector int)b; |
| 3980 | } |
| 3981 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 3982 | static vector unsigned int __ATTRS_o_ai |
| 3983 | vec_vor(vector unsigned int a, vector unsigned int b) |
| 3984 | { |
| 3985 | return a | b; |
| 3986 | } |
| 3987 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 3988 | static vector unsigned int __ATTRS_o_ai |
| 3989 | vec_vor(vector bool int a, vector unsigned int b) |
| 3990 | { |
| 3991 | return (vector unsigned int)a | b; |
| 3992 | } |
| 3993 | |
| 3994 | static vector unsigned int __ATTRS_o_ai |
| 3995 | vec_vor(vector unsigned int a, vector bool int b) |
| 3996 | { |
| 3997 | return a | (vector unsigned int)b; |
| 3998 | } |
| 3999 | |
| 4000 | static vector bool int __ATTRS_o_ai |
| 4001 | vec_vor(vector bool int a, vector bool int b) |
| 4002 | { |
| 4003 | return a | b; |
| 4004 | } |
| 4005 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4006 | static vector float __ATTRS_o_ai |
| 4007 | vec_vor(vector float a, vector float b) |
| 4008 | { |
| 4009 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 4010 | return (vector float)res; |
| 4011 | } |
| 4012 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4013 | static vector float __ATTRS_o_ai |
| 4014 | vec_vor(vector bool int a, vector float b) |
| 4015 | { |
| 4016 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 4017 | return (vector float)res; |
| 4018 | } |
| 4019 | |
| 4020 | static vector float __ATTRS_o_ai |
| 4021 | vec_vor(vector float a, vector bool int b) |
| 4022 | { |
| 4023 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 4024 | return (vector float)res; |
| 4025 | } |
| 4026 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4027 | /* vec_pack */ |
| 4028 | |
| 4029 | static vector signed char __ATTRS_o_ai |
| 4030 | vec_pack(vector signed short a, vector signed short b) |
| 4031 | { |
| 4032 | return (vector signed char)vec_perm(a, b, (vector unsigned char) |
| 4033 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4034 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 4035 | } |
| 4036 | |
| 4037 | static vector unsigned char __ATTRS_o_ai |
| 4038 | vec_pack(vector unsigned short a, vector unsigned short b) |
| 4039 | { |
| 4040 | return (vector unsigned char)vec_perm(a, b, (vector unsigned char) |
| 4041 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4042 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 4043 | } |
| 4044 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4045 | static vector bool char __ATTRS_o_ai |
| 4046 | vec_pack(vector bool short a, vector bool short b) |
| 4047 | { |
| 4048 | return (vector bool char)vec_perm(a, b, (vector unsigned char) |
| 4049 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4050 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 4051 | } |
| 4052 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4053 | static vector short __ATTRS_o_ai |
| 4054 | vec_pack(vector int a, vector int b) |
| 4055 | { |
| 4056 | return (vector short)vec_perm(a, b, (vector unsigned char) |
| 4057 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4058 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 4059 | } |
| 4060 | |
| 4061 | static vector unsigned short __ATTRS_o_ai |
| 4062 | vec_pack(vector unsigned int a, vector unsigned int b) |
| 4063 | { |
| 4064 | return (vector unsigned short)vec_perm(a, b, (vector unsigned char) |
| 4065 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4066 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 4067 | } |
| 4068 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4069 | static vector bool short __ATTRS_o_ai |
| 4070 | vec_pack(vector bool int a, vector bool int b) |
| 4071 | { |
| 4072 | return (vector bool short)vec_perm(a, b, (vector unsigned char) |
| 4073 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4074 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 4075 | } |
| 4076 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4077 | /* vec_vpkuhum */ |
| 4078 | |
| 4079 | #define __builtin_altivec_vpkuhum vec_vpkuhum |
| 4080 | |
| 4081 | static vector signed char __ATTRS_o_ai |
| 4082 | vec_vpkuhum(vector signed short a, vector signed short b) |
| 4083 | { |
| 4084 | return (vector signed char)vec_perm(a, b, (vector unsigned char) |
| 4085 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4086 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 4087 | } |
| 4088 | |
| 4089 | static vector unsigned char __ATTRS_o_ai |
| 4090 | vec_vpkuhum(vector unsigned short a, vector unsigned short b) |
| 4091 | { |
| 4092 | return (vector unsigned char)vec_perm(a, b, (vector unsigned char) |
| 4093 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4094 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 4095 | } |
| 4096 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4097 | static vector bool char __ATTRS_o_ai |
| 4098 | vec_vpkuhum(vector bool short a, vector bool short b) |
| 4099 | { |
| 4100 | return (vector bool char)vec_perm(a, b, (vector unsigned char) |
| 4101 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4102 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 4103 | } |
| 4104 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4105 | /* vec_vpkuwum */ |
| 4106 | |
| 4107 | #define __builtin_altivec_vpkuwum vec_vpkuwum |
| 4108 | |
| 4109 | static vector short __ATTRS_o_ai |
| 4110 | vec_vpkuwum(vector int a, vector int b) |
| 4111 | { |
| 4112 | return (vector short)vec_perm(a, b, (vector unsigned char) |
| 4113 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4114 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 4115 | } |
| 4116 | |
| 4117 | static vector unsigned short __ATTRS_o_ai |
| 4118 | vec_vpkuwum(vector unsigned int a, vector unsigned int b) |
| 4119 | { |
| 4120 | return (vector unsigned short)vec_perm(a, b, (vector unsigned char) |
| 4121 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4122 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 4123 | } |
| 4124 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4125 | static vector bool short __ATTRS_o_ai |
| 4126 | vec_vpkuwum(vector bool int a, vector bool int b) |
| 4127 | { |
| 4128 | return (vector bool short)vec_perm(a, b, (vector unsigned char) |
| 4129 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4130 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 4131 | } |
| 4132 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4133 | /* vec_packpx */ |
| 4134 | |
| 4135 | static vector pixel __attribute__((__always_inline__)) |
| 4136 | vec_packpx(vector unsigned int a, vector unsigned int b) |
| 4137 | { |
| 4138 | return (vector pixel)__builtin_altivec_vpkpx(a, b); |
| 4139 | } |
| 4140 | |
| 4141 | /* vec_vpkpx */ |
| 4142 | |
| 4143 | static vector pixel __attribute__((__always_inline__)) |
| 4144 | vec_vpkpx(vector unsigned int a, vector unsigned int b) |
| 4145 | { |
| 4146 | return (vector pixel)__builtin_altivec_vpkpx(a, b); |
| 4147 | } |
| 4148 | |
| 4149 | /* vec_packs */ |
| 4150 | |
| 4151 | static vector signed char __ATTRS_o_ai |
| 4152 | vec_packs(vector short a, vector short b) |
| 4153 | { |
| 4154 | return __builtin_altivec_vpkshss(a, b); |
| 4155 | } |
| 4156 | |
| 4157 | static vector unsigned char __ATTRS_o_ai |
| 4158 | vec_packs(vector unsigned short a, vector unsigned short b) |
| 4159 | { |
| 4160 | return __builtin_altivec_vpkuhus(a, b); |
| 4161 | } |
| 4162 | |
| 4163 | static vector signed short __ATTRS_o_ai |
| 4164 | vec_packs(vector int a, vector int b) |
| 4165 | { |
| 4166 | return __builtin_altivec_vpkswss(a, b); |
| 4167 | } |
| 4168 | |
| 4169 | static vector unsigned short __ATTRS_o_ai |
| 4170 | vec_packs(vector unsigned int a, vector unsigned int b) |
| 4171 | { |
| 4172 | return __builtin_altivec_vpkuwus(a, b); |
| 4173 | } |
| 4174 | |
| 4175 | /* vec_vpkshss */ |
| 4176 | |
| 4177 | static vector signed char __attribute__((__always_inline__)) |
| 4178 | vec_vpkshss(vector short a, vector short b) |
| 4179 | { |
| 4180 | return __builtin_altivec_vpkshss(a, b); |
| 4181 | } |
| 4182 | |
| 4183 | /* vec_vpkuhus */ |
| 4184 | |
| 4185 | static vector unsigned char __attribute__((__always_inline__)) |
| 4186 | vec_vpkuhus(vector unsigned short a, vector unsigned short b) |
| 4187 | { |
| 4188 | return __builtin_altivec_vpkuhus(a, b); |
| 4189 | } |
| 4190 | |
| 4191 | /* vec_vpkswss */ |
| 4192 | |
| 4193 | static vector signed short __attribute__((__always_inline__)) |
| 4194 | vec_vpkswss(vector int a, vector int b) |
| 4195 | { |
| 4196 | return __builtin_altivec_vpkswss(a, b); |
| 4197 | } |
| 4198 | |
| 4199 | /* vec_vpkuwus */ |
| 4200 | |
| 4201 | static vector unsigned short __attribute__((__always_inline__)) |
| 4202 | vec_vpkuwus(vector unsigned int a, vector unsigned int b) |
| 4203 | { |
| 4204 | return __builtin_altivec_vpkuwus(a, b); |
| 4205 | } |
| 4206 | |
| 4207 | /* vec_packsu */ |
| 4208 | |
| 4209 | static vector unsigned char __ATTRS_o_ai |
| 4210 | vec_packsu(vector short a, vector short b) |
| 4211 | { |
| 4212 | return __builtin_altivec_vpkshus(a, b); |
| 4213 | } |
| 4214 | |
| 4215 | static vector unsigned char __ATTRS_o_ai |
| 4216 | vec_packsu(vector unsigned short a, vector unsigned short b) |
| 4217 | { |
| 4218 | return __builtin_altivec_vpkuhus(a, b); |
| 4219 | } |
| 4220 | |
| 4221 | static vector unsigned short __ATTRS_o_ai |
| 4222 | vec_packsu(vector int a, vector int b) |
| 4223 | { |
| 4224 | return __builtin_altivec_vpkswus(a, b); |
| 4225 | } |
| 4226 | |
| 4227 | static vector unsigned short __ATTRS_o_ai |
| 4228 | vec_packsu(vector unsigned int a, vector unsigned int b) |
| 4229 | { |
| 4230 | return __builtin_altivec_vpkuwus(a, b); |
| 4231 | } |
| 4232 | |
| 4233 | /* vec_vpkshus */ |
| 4234 | |
| 4235 | static vector unsigned char __ATTRS_o_ai |
| 4236 | vec_vpkshus(vector short a, vector short b) |
| 4237 | { |
| 4238 | return __builtin_altivec_vpkshus(a, b); |
| 4239 | } |
| 4240 | |
| 4241 | static vector unsigned char __ATTRS_o_ai |
| 4242 | vec_vpkshus(vector unsigned short a, vector unsigned short b) |
| 4243 | { |
| 4244 | return __builtin_altivec_vpkuhus(a, b); |
| 4245 | } |
| 4246 | |
| 4247 | /* vec_vpkswus */ |
| 4248 | |
| 4249 | static vector unsigned short __ATTRS_o_ai |
| 4250 | vec_vpkswus(vector int a, vector int b) |
| 4251 | { |
| 4252 | return __builtin_altivec_vpkswus(a, b); |
| 4253 | } |
| 4254 | |
| 4255 | static vector unsigned short __ATTRS_o_ai |
| 4256 | vec_vpkswus(vector unsigned int a, vector unsigned int b) |
| 4257 | { |
| 4258 | return __builtin_altivec_vpkuwus(a, b); |
| 4259 | } |
| 4260 | |
| 4261 | /* vec_perm */ |
| 4262 | |
| 4263 | vector signed char __ATTRS_o_ai |
| 4264 | vec_perm(vector signed char a, vector signed char b, vector unsigned char c) |
| 4265 | { |
| 4266 | return (vector signed char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4267 | } |
| 4268 | |
| 4269 | vector unsigned char __ATTRS_o_ai |
| 4270 | vec_perm(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 4271 | { |
| 4272 | return (vector unsigned char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4273 | } |
| 4274 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4275 | vector bool char __ATTRS_o_ai |
| 4276 | vec_perm(vector bool char a, vector bool char b, vector unsigned char c) |
| 4277 | { |
| 4278 | return (vector bool char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4279 | } |
| 4280 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4281 | vector short __ATTRS_o_ai |
| 4282 | vec_perm(vector short a, vector short b, vector unsigned char c) |
| 4283 | { |
| 4284 | return (vector short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4285 | } |
| 4286 | |
| 4287 | vector unsigned short __ATTRS_o_ai |
| 4288 | vec_perm(vector unsigned short a, vector unsigned short b, vector unsigned char c) |
| 4289 | { |
| 4290 | return (vector unsigned short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4291 | } |
| 4292 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4293 | vector bool short __ATTRS_o_ai |
| 4294 | vec_perm(vector bool short a, vector bool short b, vector unsigned char c) |
| 4295 | { |
| 4296 | return (vector bool short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4297 | } |
| 4298 | |
| 4299 | vector pixel __ATTRS_o_ai |
| 4300 | vec_perm(vector pixel a, vector pixel b, vector unsigned char c) |
| 4301 | { |
| 4302 | return (vector pixel)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4303 | } |
| 4304 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4305 | vector int __ATTRS_o_ai |
| 4306 | vec_perm(vector int a, vector int b, vector unsigned char c) |
| 4307 | { |
| 4308 | return (vector int)__builtin_altivec_vperm_4si(a, b, c); |
| 4309 | } |
| 4310 | |
| 4311 | vector unsigned int __ATTRS_o_ai |
| 4312 | vec_perm(vector unsigned int a, vector unsigned int b, vector unsigned char c) |
| 4313 | { |
| 4314 | return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4315 | } |
| 4316 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4317 | vector bool int __ATTRS_o_ai |
| 4318 | vec_perm(vector bool int a, vector bool int b, vector unsigned char c) |
| 4319 | { |
| 4320 | return (vector bool int)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4321 | } |
| 4322 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4323 | vector float __ATTRS_o_ai |
| 4324 | vec_perm(vector float a, vector float b, vector unsigned char c) |
| 4325 | { |
| 4326 | return (vector float)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4327 | } |
| 4328 | |
| 4329 | /* vec_vperm */ |
| 4330 | |
| 4331 | vector signed char __ATTRS_o_ai |
| 4332 | vec_vperm(vector signed char a, vector signed char b, vector unsigned char c) |
| 4333 | { |
| 4334 | return (vector signed char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4335 | } |
| 4336 | |
| 4337 | vector unsigned char __ATTRS_o_ai |
| 4338 | vec_vperm(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 4339 | { |
| 4340 | return (vector unsigned char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4341 | } |
| 4342 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4343 | vector bool char __ATTRS_o_ai |
| 4344 | vec_vperm(vector bool char a, vector bool char b, vector unsigned char c) |
| 4345 | { |
| 4346 | return (vector bool char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4347 | } |
| 4348 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4349 | vector short __ATTRS_o_ai |
| 4350 | vec_vperm(vector short a, vector short b, vector unsigned char c) |
| 4351 | { |
| 4352 | return (vector short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4353 | } |
| 4354 | |
| 4355 | vector unsigned short __ATTRS_o_ai |
| 4356 | vec_vperm(vector unsigned short a, vector unsigned short b, vector unsigned char c) |
| 4357 | { |
| 4358 | return (vector unsigned short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4359 | } |
| 4360 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4361 | vector bool short __ATTRS_o_ai |
| 4362 | vec_vperm(vector bool short a, vector bool short b, vector unsigned char c) |
| 4363 | { |
| 4364 | return (vector bool short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4365 | } |
| 4366 | |
| 4367 | vector pixel __ATTRS_o_ai |
| 4368 | vec_vperm(vector pixel a, vector pixel b, vector unsigned char c) |
| 4369 | { |
| 4370 | return (vector pixel)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4371 | } |
| 4372 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4373 | vector int __ATTRS_o_ai |
| 4374 | vec_vperm(vector int a, vector int b, vector unsigned char c) |
| 4375 | { |
| 4376 | return (vector int)__builtin_altivec_vperm_4si(a, b, c); |
| 4377 | } |
| 4378 | |
| 4379 | vector unsigned int __ATTRS_o_ai |
| 4380 | vec_vperm(vector unsigned int a, vector unsigned int b, vector unsigned char c) |
| 4381 | { |
| 4382 | return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4383 | } |
| 4384 | |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4385 | vector bool int __ATTRS_o_ai |
| 4386 | vec_vperm(vector bool int a, vector bool int b, vector unsigned char c) |
| 4387 | { |
| 4388 | return (vector bool int)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4389 | } |
| 4390 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4391 | vector float __ATTRS_o_ai |
| 4392 | vec_vperm(vector float a, vector float b, vector unsigned char c) |
| 4393 | { |
| 4394 | return (vector float)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 4395 | } |
| 4396 | |
| 4397 | /* vec_re */ |
| 4398 | |
| 4399 | vector float __attribute__((__always_inline__)) |
| 4400 | vec_re(vector float a) |
| 4401 | { |
| 4402 | return __builtin_altivec_vrefp(a); |
| 4403 | } |
| 4404 | |
| 4405 | /* vec_vrefp */ |
| 4406 | |
| 4407 | vector float __attribute__((__always_inline__)) |
| 4408 | vec_vrefp(vector float a) |
| 4409 | { |
| 4410 | return __builtin_altivec_vrefp(a); |
| 4411 | } |
| 4412 | |
| 4413 | /* vec_rl */ |
| 4414 | |
| 4415 | static vector signed char __ATTRS_o_ai |
| 4416 | vec_rl(vector signed char a, vector unsigned char b) |
| 4417 | { |
| 4418 | return (vector signed char)__builtin_altivec_vrlb((vector char)a, b); |
| 4419 | } |
| 4420 | |
| 4421 | static vector unsigned char __ATTRS_o_ai |
| 4422 | vec_rl(vector unsigned char a, vector unsigned char b) |
| 4423 | { |
| 4424 | return (vector unsigned char)__builtin_altivec_vrlb((vector char)a, b); |
| 4425 | } |
| 4426 | |
| 4427 | static vector short __ATTRS_o_ai |
| 4428 | vec_rl(vector short a, vector unsigned short b) |
| 4429 | { |
| 4430 | return __builtin_altivec_vrlh(a, b); |
| 4431 | } |
| 4432 | |
| 4433 | static vector unsigned short __ATTRS_o_ai |
| 4434 | vec_rl(vector unsigned short a, vector unsigned short b) |
| 4435 | { |
| 4436 | return (vector unsigned short)__builtin_altivec_vrlh((vector short)a, b); |
| 4437 | } |
| 4438 | |
| 4439 | static vector int __ATTRS_o_ai |
| 4440 | vec_rl(vector int a, vector unsigned int b) |
| 4441 | { |
| 4442 | return __builtin_altivec_vrlw(a, b); |
| 4443 | } |
| 4444 | |
| 4445 | static vector unsigned int __ATTRS_o_ai |
| 4446 | vec_rl(vector unsigned int a, vector unsigned int b) |
| 4447 | { |
| 4448 | return (vector unsigned int)__builtin_altivec_vrlw((vector int)a, b); |
| 4449 | } |
| 4450 | |
| 4451 | /* vec_vrlb */ |
| 4452 | |
| 4453 | static vector signed char __ATTRS_o_ai |
| 4454 | vec_vrlb(vector signed char a, vector unsigned char b) |
| 4455 | { |
| 4456 | return (vector signed char)__builtin_altivec_vrlb((vector char)a, b); |
| 4457 | } |
| 4458 | |
| 4459 | static vector unsigned char __ATTRS_o_ai |
| 4460 | vec_vrlb(vector unsigned char a, vector unsigned char b) |
| 4461 | { |
| 4462 | return (vector unsigned char)__builtin_altivec_vrlb((vector char)a, b); |
| 4463 | } |
| 4464 | |
| 4465 | /* vec_vrlh */ |
| 4466 | |
| 4467 | static vector short __ATTRS_o_ai |
| 4468 | vec_vrlh(vector short a, vector unsigned short b) |
| 4469 | { |
| 4470 | return __builtin_altivec_vrlh(a, b); |
| 4471 | } |
| 4472 | |
| 4473 | static vector unsigned short __ATTRS_o_ai |
| 4474 | vec_vrlh(vector unsigned short a, vector unsigned short b) |
| 4475 | { |
| 4476 | return (vector unsigned short)__builtin_altivec_vrlh((vector short)a, b); |
| 4477 | } |
| 4478 | |
| 4479 | /* vec_vrlw */ |
| 4480 | |
| 4481 | static vector int __ATTRS_o_ai |
| 4482 | vec_vrlw(vector int a, vector unsigned int b) |
| 4483 | { |
| 4484 | return __builtin_altivec_vrlw(a, b); |
| 4485 | } |
| 4486 | |
| 4487 | static vector unsigned int __ATTRS_o_ai |
| 4488 | vec_vrlw(vector unsigned int a, vector unsigned int b) |
| 4489 | { |
| 4490 | return (vector unsigned int)__builtin_altivec_vrlw((vector int)a, b); |
| 4491 | } |
| 4492 | |
| 4493 | /* vec_round */ |
| 4494 | |
| 4495 | static vector float __attribute__((__always_inline__)) |
| 4496 | vec_round(vector float a) |
| 4497 | { |
| 4498 | return __builtin_altivec_vrfin(a); |
| 4499 | } |
| 4500 | |
| 4501 | /* vec_vrfin */ |
| 4502 | |
| 4503 | static vector float __attribute__((__always_inline__)) |
| 4504 | vec_vrfin(vector float a) |
| 4505 | { |
| 4506 | return __builtin_altivec_vrfin(a); |
| 4507 | } |
| 4508 | |
| 4509 | /* vec_rsqrte */ |
| 4510 | |
| 4511 | static __vector float __attribute__((__always_inline__)) |
| 4512 | vec_rsqrte(vector float a) |
| 4513 | { |
| 4514 | return __builtin_altivec_vrsqrtefp(a); |
| 4515 | } |
| 4516 | |
| 4517 | /* vec_vrsqrtefp */ |
| 4518 | |
| 4519 | static __vector float __attribute__((__always_inline__)) |
| 4520 | vec_vrsqrtefp(vector float a) |
| 4521 | { |
| 4522 | return __builtin_altivec_vrsqrtefp(a); |
| 4523 | } |
| 4524 | |
| 4525 | /* vec_sel */ |
| 4526 | |
| 4527 | #define __builtin_altivec_vsel_4si vec_sel |
| 4528 | |
| 4529 | static vector signed char __ATTRS_o_ai |
| 4530 | vec_sel(vector signed char a, vector signed char b, vector unsigned char c) |
| 4531 | { |
| 4532 | return (a & ~(vector signed char)c) | (b & (vector signed char)c); |
| 4533 | } |
| 4534 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4535 | static vector signed char __ATTRS_o_ai |
| 4536 | vec_sel(vector signed char a, vector signed char b, vector bool char c) |
| 4537 | { |
| 4538 | return (a & ~(vector signed char)c) | (b & (vector signed char)c); |
| 4539 | } |
| 4540 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4541 | static vector unsigned char __ATTRS_o_ai |
| 4542 | vec_sel(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 4543 | { |
| 4544 | return (a & ~c) | (b & c); |
| 4545 | } |
| 4546 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4547 | static vector unsigned char __ATTRS_o_ai |
| 4548 | vec_sel(vector unsigned char a, vector unsigned char b, vector bool char c) |
| 4549 | { |
| 4550 | return (a & ~(vector unsigned char)c) | (b & (vector unsigned char)c); |
| 4551 | } |
| 4552 | |
| 4553 | static vector bool char __ATTRS_o_ai |
| 4554 | vec_sel(vector bool char a, vector bool char b, vector unsigned char c) |
| 4555 | { |
| 4556 | return (a & ~(vector bool char)c) | (b & (vector bool char)c); |
| 4557 | } |
| 4558 | |
| 4559 | static vector bool char __ATTRS_o_ai |
| 4560 | vec_sel(vector bool char a, vector bool char b, vector bool char c) |
| 4561 | { |
| 4562 | return (a & ~c) | (b & c); |
| 4563 | } |
| 4564 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4565 | static vector short __ATTRS_o_ai |
| 4566 | vec_sel(vector short a, vector short b, vector unsigned short c) |
| 4567 | { |
| 4568 | return (a & ~(vector short)c) | (b & (vector short)c); |
| 4569 | } |
| 4570 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4571 | static vector short __ATTRS_o_ai |
| 4572 | vec_sel(vector short a, vector short b, vector bool short c) |
| 4573 | { |
| 4574 | return (a & ~(vector short)c) | (b & (vector short)c); |
| 4575 | } |
| 4576 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4577 | static vector unsigned short __ATTRS_o_ai |
| 4578 | vec_sel(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 4579 | { |
| 4580 | return (a & ~c) | (b & c); |
| 4581 | } |
| 4582 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4583 | static vector unsigned short __ATTRS_o_ai |
| 4584 | vec_sel(vector unsigned short a, vector unsigned short b, vector bool short c) |
| 4585 | { |
| 4586 | return (a & ~(vector unsigned short)c) | (b & (vector unsigned short)c); |
| 4587 | } |
| 4588 | |
| 4589 | static vector bool short __ATTRS_o_ai |
| 4590 | vec_sel(vector bool short a, vector bool short b, vector unsigned short c) |
| 4591 | { |
| 4592 | return (a & ~(vector bool short)c) | (b & (vector bool short)c); |
| 4593 | } |
| 4594 | |
| 4595 | static vector bool short __ATTRS_o_ai |
| 4596 | vec_sel(vector bool short a, vector bool short b, vector bool short c) |
| 4597 | { |
| 4598 | return (a & ~c) | (b & c); |
| 4599 | } |
| 4600 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4601 | static vector int __ATTRS_o_ai |
| 4602 | vec_sel(vector int a, vector int b, vector unsigned int c) |
| 4603 | { |
| 4604 | return (a & ~(vector int)c) | (b & (vector int)c); |
| 4605 | } |
| 4606 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4607 | static vector int __ATTRS_o_ai |
| 4608 | vec_sel(vector int a, vector int b, vector bool int c) |
| 4609 | { |
| 4610 | return (a & ~(vector int)c) | (b & (vector int)c); |
| 4611 | } |
| 4612 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4613 | static vector unsigned int __ATTRS_o_ai |
| 4614 | vec_sel(vector unsigned int a, vector unsigned int b, vector unsigned int c) |
| 4615 | { |
| 4616 | return (a & ~c) | (b & c); |
| 4617 | } |
| 4618 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4619 | static vector unsigned int __ATTRS_o_ai |
| 4620 | vec_sel(vector unsigned int a, vector unsigned int b, vector bool int c) |
| 4621 | { |
| 4622 | return (a & ~(vector unsigned int)c) | (b & (vector unsigned int)c); |
| 4623 | } |
| 4624 | |
| 4625 | static vector bool int __ATTRS_o_ai |
| 4626 | vec_sel(vector bool int a, vector bool int b, vector unsigned int c) |
| 4627 | { |
| 4628 | return (a & ~(vector bool int)c) | (b & (vector bool int)c); |
| 4629 | } |
| 4630 | |
| 4631 | static vector bool int __ATTRS_o_ai |
| 4632 | vec_sel(vector bool int a, vector bool int b, vector bool int c) |
| 4633 | { |
| 4634 | return (a & ~c) | (b & c); |
| 4635 | } |
| 4636 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4637 | static vector float __ATTRS_o_ai |
| 4638 | vec_sel(vector float a, vector float b, vector unsigned int c) |
| 4639 | { |
| 4640 | vector int res = ((vector int)a & ~(vector int)c) | ((vector int)b & (vector int)c); |
| 4641 | return (vector float)res; |
| 4642 | } |
| 4643 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4644 | static vector float __ATTRS_o_ai |
| 4645 | vec_sel(vector float a, vector float b, vector bool int c) |
| 4646 | { |
| 4647 | vector int res = ((vector int)a & ~(vector int)c) | ((vector int)b & (vector int)c); |
| 4648 | return (vector float)res; |
| 4649 | } |
| 4650 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4651 | /* vec_vsel */ |
| 4652 | |
| 4653 | static vector signed char __ATTRS_o_ai |
| 4654 | vec_vsel(vector signed char a, vector signed char b, vector unsigned char c) |
| 4655 | { |
| 4656 | return (a & ~(vector signed char)c) | (b & (vector signed char)c); |
| 4657 | } |
| 4658 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4659 | static vector signed char __ATTRS_o_ai |
| 4660 | vec_vsel(vector signed char a, vector signed char b, vector bool char c) |
| 4661 | { |
| 4662 | return (a & ~(vector signed char)c) | (b & (vector signed char)c); |
| 4663 | } |
| 4664 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4665 | static vector unsigned char __ATTRS_o_ai |
| 4666 | vec_vsel(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 4667 | { |
| 4668 | return (a & ~c) | (b & c); |
| 4669 | } |
| 4670 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4671 | static vector unsigned char __ATTRS_o_ai |
| 4672 | vec_vsel(vector unsigned char a, vector unsigned char b, vector bool char c) |
| 4673 | { |
| 4674 | return (a & ~(vector unsigned char)c) | (b & (vector unsigned char)c); |
| 4675 | } |
| 4676 | |
| 4677 | static vector bool char __ATTRS_o_ai |
| 4678 | vec_vsel(vector bool char a, vector bool char b, vector unsigned char c) |
| 4679 | { |
| 4680 | return (a & ~(vector bool char)c) | (b & (vector bool char)c); |
| 4681 | } |
| 4682 | |
| 4683 | static vector bool char __ATTRS_o_ai |
| 4684 | vec_vsel(vector bool char a, vector bool char b, vector bool char c) |
| 4685 | { |
| 4686 | return (a & ~c) | (b & c); |
| 4687 | } |
| 4688 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4689 | static vector short __ATTRS_o_ai |
| 4690 | vec_vsel(vector short a, vector short b, vector unsigned short c) |
| 4691 | { |
| 4692 | return (a & ~(vector short)c) | (b & (vector short)c); |
| 4693 | } |
| 4694 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4695 | static vector short __ATTRS_o_ai |
| 4696 | vec_vsel(vector short a, vector short b, vector bool short c) |
| 4697 | { |
| 4698 | return (a & ~(vector short)c) | (b & (vector short)c); |
| 4699 | } |
| 4700 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4701 | static vector unsigned short __ATTRS_o_ai |
| 4702 | vec_vsel(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 4703 | { |
| 4704 | return (a & ~c) | (b & c); |
| 4705 | } |
| 4706 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4707 | static vector unsigned short __ATTRS_o_ai |
| 4708 | vec_vsel(vector unsigned short a, vector unsigned short b, vector bool short c) |
| 4709 | { |
| 4710 | return (a & ~(vector unsigned short)c) | (b & (vector unsigned short)c); |
| 4711 | } |
| 4712 | |
| 4713 | static vector bool short __ATTRS_o_ai |
| 4714 | vec_vsel(vector bool short a, vector bool short b, vector unsigned short c) |
| 4715 | { |
| 4716 | return (a & ~(vector bool short)c) | (b & (vector bool short)c); |
| 4717 | } |
| 4718 | |
| 4719 | static vector bool short __ATTRS_o_ai |
| 4720 | vec_vsel(vector bool short a, vector bool short b, vector bool short c) |
| 4721 | { |
| 4722 | return (a & ~c) | (b & c); |
| 4723 | } |
| 4724 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4725 | static vector int __ATTRS_o_ai |
| 4726 | vec_vsel(vector int a, vector int b, vector unsigned int c) |
| 4727 | { |
| 4728 | return (a & ~(vector int)c) | (b & (vector int)c); |
| 4729 | } |
| 4730 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4731 | static vector int __ATTRS_o_ai |
| 4732 | vec_vsel(vector int a, vector int b, vector bool int c) |
| 4733 | { |
| 4734 | return (a & ~(vector int)c) | (b & (vector int)c); |
| 4735 | } |
| 4736 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4737 | static vector unsigned int __ATTRS_o_ai |
| 4738 | vec_vsel(vector unsigned int a, vector unsigned int b, vector unsigned int c) |
| 4739 | { |
| 4740 | return (a & ~c) | (b & c); |
| 4741 | } |
| 4742 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4743 | static vector unsigned int __ATTRS_o_ai |
| 4744 | vec_vsel(vector unsigned int a, vector unsigned int b, vector bool int c) |
| 4745 | { |
| 4746 | return (a & ~(vector unsigned int)c) | (b & (vector unsigned int)c); |
| 4747 | } |
| 4748 | |
| 4749 | static vector bool int __ATTRS_o_ai |
| 4750 | vec_vsel(vector bool int a, vector bool int b, vector unsigned int c) |
| 4751 | { |
| 4752 | return (a & ~(vector bool int)c) | (b & (vector bool int)c); |
| 4753 | } |
| 4754 | |
| 4755 | static vector bool int __ATTRS_o_ai |
| 4756 | vec_vsel(vector bool int a, vector bool int b, vector bool int c) |
| 4757 | { |
| 4758 | return (a & ~c) | (b & c); |
| 4759 | } |
| 4760 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4761 | static vector float __ATTRS_o_ai |
| 4762 | vec_vsel(vector float a, vector float b, vector unsigned int c) |
| 4763 | { |
| 4764 | vector int res = ((vector int)a & ~(vector int)c) | ((vector int)b & (vector int)c); |
| 4765 | return (vector float)res; |
| 4766 | } |
| 4767 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 4768 | static vector float __ATTRS_o_ai |
| 4769 | vec_vsel(vector float a, vector float b, vector bool int c) |
| 4770 | { |
| 4771 | vector int res = ((vector int)a & ~(vector int)c) | ((vector int)b & (vector int)c); |
| 4772 | return (vector float)res; |
| 4773 | } |
| 4774 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4775 | /* vec_sl */ |
| 4776 | |
| 4777 | static vector signed char __ATTRS_o_ai |
| 4778 | vec_sl(vector signed char a, vector unsigned char b) |
| 4779 | { |
| 4780 | return a << (vector signed char)b; |
| 4781 | } |
| 4782 | |
| 4783 | static vector unsigned char __ATTRS_o_ai |
| 4784 | vec_sl(vector unsigned char a, vector unsigned char b) |
| 4785 | { |
| 4786 | return a << b; |
| 4787 | } |
| 4788 | |
| 4789 | static vector short __ATTRS_o_ai |
| 4790 | vec_sl(vector short a, vector unsigned short b) |
| 4791 | { |
| 4792 | return a << (vector short)b; |
| 4793 | } |
| 4794 | |
| 4795 | static vector unsigned short __ATTRS_o_ai |
| 4796 | vec_sl(vector unsigned short a, vector unsigned short b) |
| 4797 | { |
| 4798 | return a << b; |
| 4799 | } |
| 4800 | |
| 4801 | static vector int __ATTRS_o_ai |
| 4802 | vec_sl(vector int a, vector unsigned int b) |
| 4803 | { |
| 4804 | return a << (vector int)b; |
| 4805 | } |
| 4806 | |
| 4807 | static vector unsigned int __ATTRS_o_ai |
| 4808 | vec_sl(vector unsigned int a, vector unsigned int b) |
| 4809 | { |
| 4810 | return a << b; |
| 4811 | } |
| 4812 | |
| 4813 | /* vec_vslb */ |
| 4814 | |
| 4815 | #define __builtin_altivec_vslb vec_vslb |
| 4816 | |
| 4817 | static vector signed char __ATTRS_o_ai |
| 4818 | vec_vslb(vector signed char a, vector unsigned char b) |
| 4819 | { |
| 4820 | return vec_sl(a, b); |
| 4821 | } |
| 4822 | |
| 4823 | static vector unsigned char __ATTRS_o_ai |
| 4824 | vec_vslb(vector unsigned char a, vector unsigned char b) |
| 4825 | { |
| 4826 | return vec_sl(a, b); |
| 4827 | } |
| 4828 | |
| 4829 | /* vec_vslh */ |
| 4830 | |
| 4831 | #define __builtin_altivec_vslh vec_vslh |
| 4832 | |
| 4833 | static vector short __ATTRS_o_ai |
| 4834 | vec_vslh(vector short a, vector unsigned short b) |
| 4835 | { |
| 4836 | return vec_sl(a, b); |
| 4837 | } |
| 4838 | |
| 4839 | static vector unsigned short __ATTRS_o_ai |
| 4840 | vec_vslh(vector unsigned short a, vector unsigned short b) |
| 4841 | { |
| 4842 | return vec_sl(a, b); |
| 4843 | } |
| 4844 | |
| 4845 | /* vec_vslw */ |
| 4846 | |
| 4847 | #define __builtin_altivec_vslw vec_vslw |
| 4848 | |
| 4849 | static vector int __ATTRS_o_ai |
| 4850 | vec_vslw(vector int a, vector unsigned int b) |
| 4851 | { |
| 4852 | return vec_sl(a, b); |
| 4853 | } |
| 4854 | |
| 4855 | static vector unsigned int __ATTRS_o_ai |
| 4856 | vec_vslw(vector unsigned int a, vector unsigned int b) |
| 4857 | { |
| 4858 | return vec_sl(a, b); |
| 4859 | } |
| 4860 | |
| 4861 | /* vec_sld */ |
| 4862 | |
| 4863 | #define __builtin_altivec_vsldoi_4si vec_sld |
| 4864 | |
| 4865 | static vector signed char __ATTRS_o_ai |
| 4866 | vec_sld(vector signed char a, vector signed char b, unsigned char c) |
| 4867 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4868 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4869 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4870 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4871 | } |
| 4872 | |
| 4873 | static vector unsigned char __ATTRS_o_ai |
| 4874 | vec_sld(vector unsigned char a, vector unsigned char b, unsigned char c) |
| 4875 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4876 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4877 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4878 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4879 | } |
| 4880 | |
| 4881 | static vector short __ATTRS_o_ai |
| 4882 | vec_sld(vector short a, vector short b, unsigned char c) |
| 4883 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4884 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4885 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4886 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4887 | } |
| 4888 | |
| 4889 | static vector unsigned short __ATTRS_o_ai |
| 4890 | vec_sld(vector unsigned short a, vector unsigned short b, unsigned char c) |
| 4891 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4892 | return vec_perm(a, b, (vector unsigned char) |
| 4893 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4894 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4895 | } |
| 4896 | |
| 4897 | static vector pixel __ATTRS_o_ai |
| 4898 | vec_sld(vector pixel a, vector pixel b, unsigned char c) |
| 4899 | { |
| 4900 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4901 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4902 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4903 | } |
| 4904 | |
| 4905 | static vector int __ATTRS_o_ai |
| 4906 | vec_sld(vector int a, vector int b, unsigned char c) |
| 4907 | { |
| 4908 | return vec_perm(a, b, (vector unsigned char) |
| 4909 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4910 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4911 | } |
| 4912 | |
| 4913 | static vector unsigned int __ATTRS_o_ai |
| 4914 | vec_sld(vector unsigned int a, vector unsigned int b, unsigned char c) |
| 4915 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4916 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4917 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4918 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4919 | } |
| 4920 | |
| 4921 | static vector float __ATTRS_o_ai |
| 4922 | vec_sld(vector float a, vector float b, unsigned char c) |
| 4923 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4924 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4925 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4926 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4927 | } |
| 4928 | |
| 4929 | /* vec_vsldoi */ |
| 4930 | |
| 4931 | static vector signed char __ATTRS_o_ai |
| 4932 | vec_vsldoi(vector signed char a, vector signed char b, unsigned char c) |
| 4933 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4934 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4935 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4936 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4937 | } |
| 4938 | |
| 4939 | static vector unsigned char __ATTRS_o_ai |
| 4940 | vec_vsldoi(vector unsigned char a, vector unsigned char b, unsigned char c) |
| 4941 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4942 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4943 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4944 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4945 | } |
| 4946 | |
| 4947 | static vector short __ATTRS_o_ai |
| 4948 | vec_vsldoi(vector short a, vector short b, unsigned char c) |
| 4949 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4950 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4951 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4952 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4953 | } |
| 4954 | |
| 4955 | static vector unsigned short __ATTRS_o_ai |
| 4956 | vec_vsldoi(vector unsigned short a, vector unsigned short b, unsigned char c) |
| 4957 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4958 | return vec_perm(a, b, (vector unsigned char) |
| 4959 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4960 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4961 | } |
| 4962 | |
| 4963 | static vector pixel __ATTRS_o_ai |
| 4964 | vec_vsldoi(vector pixel a, vector pixel b, unsigned char c) |
| 4965 | { |
| 4966 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4967 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4968 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4969 | } |
| 4970 | |
| 4971 | static vector int __ATTRS_o_ai |
| 4972 | vec_vsldoi(vector int a, vector int b, unsigned char c) |
| 4973 | { |
| 4974 | return vec_perm(a, b, (vector unsigned char) |
| 4975 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4976 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4977 | } |
| 4978 | |
| 4979 | static vector unsigned int __ATTRS_o_ai |
| 4980 | vec_vsldoi(vector unsigned int a, vector unsigned int b, unsigned char c) |
| 4981 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4982 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4983 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4984 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4985 | } |
| 4986 | |
| 4987 | static vector float __ATTRS_o_ai |
| 4988 | vec_vsldoi(vector float a, vector float b, unsigned char c) |
| 4989 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 4990 | return vec_perm(a, b, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 4991 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 4992 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 4993 | } |
| 4994 | |
| 4995 | /* vec_sll */ |
| 4996 | |
| 4997 | static vector signed char __ATTRS_o_ai |
| 4998 | vec_sll(vector signed char a, vector unsigned char b) |
| 4999 | { |
| 5000 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5001 | } |
| 5002 | |
| 5003 | static vector signed char __ATTRS_o_ai |
| 5004 | vec_sll(vector signed char a, vector unsigned short b) |
| 5005 | { |
| 5006 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5007 | } |
| 5008 | |
| 5009 | static vector signed char __ATTRS_o_ai |
| 5010 | vec_sll(vector signed char a, vector unsigned int b) |
| 5011 | { |
| 5012 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5013 | } |
| 5014 | |
| 5015 | static vector unsigned char __ATTRS_o_ai |
| 5016 | vec_sll(vector unsigned char a, vector unsigned char b) |
| 5017 | { |
| 5018 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5019 | } |
| 5020 | |
| 5021 | static vector unsigned char __ATTRS_o_ai |
| 5022 | vec_sll(vector unsigned char a, vector unsigned short b) |
| 5023 | { |
| 5024 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5025 | } |
| 5026 | |
| 5027 | static vector unsigned char __ATTRS_o_ai |
| 5028 | vec_sll(vector unsigned char a, vector unsigned int b) |
| 5029 | { |
| 5030 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5031 | } |
| 5032 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5033 | static vector bool char __ATTRS_o_ai |
| 5034 | vec_sll(vector bool char a, vector unsigned char b) |
| 5035 | { |
| 5036 | return (vector bool char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5037 | } |
| 5038 | |
| 5039 | static vector bool char __ATTRS_o_ai |
| 5040 | vec_sll(vector bool char a, vector unsigned short b) |
| 5041 | { |
| 5042 | return (vector bool char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5043 | } |
| 5044 | |
| 5045 | static vector bool char __ATTRS_o_ai |
| 5046 | vec_sll(vector bool char a, vector unsigned int b) |
| 5047 | { |
| 5048 | return (vector bool char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5049 | } |
| 5050 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5051 | static vector short __ATTRS_o_ai |
| 5052 | vec_sll(vector short a, vector unsigned char b) |
| 5053 | { |
| 5054 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5055 | } |
| 5056 | |
| 5057 | static vector short __ATTRS_o_ai |
| 5058 | vec_sll(vector short a, vector unsigned short b) |
| 5059 | { |
| 5060 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5061 | } |
| 5062 | |
| 5063 | static vector short __ATTRS_o_ai |
| 5064 | vec_sll(vector short a, vector unsigned int b) |
| 5065 | { |
| 5066 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5067 | } |
| 5068 | |
| 5069 | static vector unsigned short __ATTRS_o_ai |
| 5070 | vec_sll(vector unsigned short a, vector unsigned char b) |
| 5071 | { |
| 5072 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5073 | } |
| 5074 | |
| 5075 | static vector unsigned short __ATTRS_o_ai |
| 5076 | vec_sll(vector unsigned short a, vector unsigned short b) |
| 5077 | { |
| 5078 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5079 | } |
| 5080 | |
| 5081 | static vector unsigned short __ATTRS_o_ai |
| 5082 | vec_sll(vector unsigned short a, vector unsigned int b) |
| 5083 | { |
| 5084 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5085 | } |
| 5086 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5087 | static vector bool short __ATTRS_o_ai |
| 5088 | vec_sll(vector bool short a, vector unsigned char b) |
| 5089 | { |
| 5090 | return (vector bool short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5091 | } |
| 5092 | |
| 5093 | static vector bool short __ATTRS_o_ai |
| 5094 | vec_sll(vector bool short a, vector unsigned short b) |
| 5095 | { |
| 5096 | return (vector bool short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5097 | } |
| 5098 | |
| 5099 | static vector bool short __ATTRS_o_ai |
| 5100 | vec_sll(vector bool short a, vector unsigned int b) |
| 5101 | { |
| 5102 | return (vector bool short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5103 | } |
| 5104 | |
| 5105 | static vector pixel __ATTRS_o_ai |
| 5106 | vec_sll(vector pixel a, vector unsigned char b) |
| 5107 | { |
| 5108 | return (vector pixel)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5109 | } |
| 5110 | |
| 5111 | static vector pixel __ATTRS_o_ai |
| 5112 | vec_sll(vector pixel a, vector unsigned short b) |
| 5113 | { |
| 5114 | return (vector pixel)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5115 | } |
| 5116 | |
| 5117 | static vector pixel __ATTRS_o_ai |
| 5118 | vec_sll(vector pixel a, vector unsigned int b) |
| 5119 | { |
| 5120 | return (vector pixel)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5121 | } |
| 5122 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5123 | static vector int __ATTRS_o_ai |
| 5124 | vec_sll(vector int a, vector unsigned char b) |
| 5125 | { |
| 5126 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 5127 | } |
| 5128 | |
| 5129 | static vector int __ATTRS_o_ai |
| 5130 | vec_sll(vector int a, vector unsigned short b) |
| 5131 | { |
| 5132 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 5133 | } |
| 5134 | |
| 5135 | static vector int __ATTRS_o_ai |
| 5136 | vec_sll(vector int a, vector unsigned int b) |
| 5137 | { |
| 5138 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 5139 | } |
| 5140 | |
| 5141 | static vector unsigned int __ATTRS_o_ai |
| 5142 | vec_sll(vector unsigned int a, vector unsigned char b) |
| 5143 | { |
| 5144 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5145 | } |
| 5146 | |
| 5147 | static vector unsigned int __ATTRS_o_ai |
| 5148 | vec_sll(vector unsigned int a, vector unsigned short b) |
| 5149 | { |
| 5150 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5151 | } |
| 5152 | |
| 5153 | static vector unsigned int __ATTRS_o_ai |
| 5154 | vec_sll(vector unsigned int a, vector unsigned int b) |
| 5155 | { |
| 5156 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5157 | } |
| 5158 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5159 | static vector bool int __ATTRS_o_ai |
| 5160 | vec_sll(vector bool int a, vector unsigned char b) |
| 5161 | { |
| 5162 | return (vector bool int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5163 | } |
| 5164 | |
| 5165 | static vector bool int __ATTRS_o_ai |
| 5166 | vec_sll(vector bool int a, vector unsigned short b) |
| 5167 | { |
| 5168 | return (vector bool int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5169 | } |
| 5170 | |
| 5171 | static vector bool int __ATTRS_o_ai |
| 5172 | vec_sll(vector bool int a, vector unsigned int b) |
| 5173 | { |
| 5174 | return (vector bool int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5175 | } |
| 5176 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5177 | /* vec_vsl */ |
| 5178 | |
| 5179 | static vector signed char __ATTRS_o_ai |
| 5180 | vec_vsl(vector signed char a, vector unsigned char b) |
| 5181 | { |
| 5182 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5183 | } |
| 5184 | |
| 5185 | static vector signed char __ATTRS_o_ai |
| 5186 | vec_vsl(vector signed char a, vector unsigned short b) |
| 5187 | { |
| 5188 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5189 | } |
| 5190 | |
| 5191 | static vector signed char __ATTRS_o_ai |
| 5192 | vec_vsl(vector signed char a, vector unsigned int b) |
| 5193 | { |
| 5194 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5195 | } |
| 5196 | |
| 5197 | static vector unsigned char __ATTRS_o_ai |
| 5198 | vec_vsl(vector unsigned char a, vector unsigned char b) |
| 5199 | { |
| 5200 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5201 | } |
| 5202 | |
| 5203 | static vector unsigned char __ATTRS_o_ai |
| 5204 | vec_vsl(vector unsigned char a, vector unsigned short b) |
| 5205 | { |
| 5206 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5207 | } |
| 5208 | |
| 5209 | static vector unsigned char __ATTRS_o_ai |
| 5210 | vec_vsl(vector unsigned char a, vector unsigned int b) |
| 5211 | { |
| 5212 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5213 | } |
| 5214 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5215 | static vector bool char __ATTRS_o_ai |
| 5216 | vec_vsl(vector bool char a, vector unsigned char b) |
| 5217 | { |
| 5218 | return (vector bool char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5219 | } |
| 5220 | |
| 5221 | static vector bool char __ATTRS_o_ai |
| 5222 | vec_vsl(vector bool char a, vector unsigned short b) |
| 5223 | { |
| 5224 | return (vector bool char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5225 | } |
| 5226 | |
| 5227 | static vector bool char __ATTRS_o_ai |
| 5228 | vec_vsl(vector bool char a, vector unsigned int b) |
| 5229 | { |
| 5230 | return (vector bool char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5231 | } |
| 5232 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5233 | static vector short __ATTRS_o_ai |
| 5234 | vec_vsl(vector short a, vector unsigned char b) |
| 5235 | { |
| 5236 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5237 | } |
| 5238 | |
| 5239 | static vector short __ATTRS_o_ai |
| 5240 | vec_vsl(vector short a, vector unsigned short b) |
| 5241 | { |
| 5242 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5243 | } |
| 5244 | |
| 5245 | static vector short __ATTRS_o_ai |
| 5246 | vec_vsl(vector short a, vector unsigned int b) |
| 5247 | { |
| 5248 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5249 | } |
| 5250 | |
| 5251 | static vector unsigned short __ATTRS_o_ai |
| 5252 | vec_vsl(vector unsigned short a, vector unsigned char b) |
| 5253 | { |
| 5254 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5255 | } |
| 5256 | |
| 5257 | static vector unsigned short __ATTRS_o_ai |
| 5258 | vec_vsl(vector unsigned short a, vector unsigned short b) |
| 5259 | { |
| 5260 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5261 | } |
| 5262 | |
| 5263 | static vector unsigned short __ATTRS_o_ai |
| 5264 | vec_vsl(vector unsigned short a, vector unsigned int b) |
| 5265 | { |
| 5266 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5267 | } |
| 5268 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5269 | static vector bool short __ATTRS_o_ai |
| 5270 | vec_vsl(vector bool short a, vector unsigned char b) |
| 5271 | { |
| 5272 | return (vector bool short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5273 | } |
| 5274 | |
| 5275 | static vector bool short __ATTRS_o_ai |
| 5276 | vec_vsl(vector bool short a, vector unsigned short b) |
| 5277 | { |
| 5278 | return (vector bool short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5279 | } |
| 5280 | |
| 5281 | static vector bool short __ATTRS_o_ai |
| 5282 | vec_vsl(vector bool short a, vector unsigned int b) |
| 5283 | { |
| 5284 | return (vector bool short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5285 | } |
| 5286 | |
| 5287 | static vector pixel __ATTRS_o_ai |
| 5288 | vec_vsl(vector pixel a, vector unsigned char b) |
| 5289 | { |
| 5290 | return (vector pixel)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5291 | } |
| 5292 | |
| 5293 | static vector pixel __ATTRS_o_ai |
| 5294 | vec_vsl(vector pixel a, vector unsigned short b) |
| 5295 | { |
| 5296 | return (vector pixel)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5297 | } |
| 5298 | |
| 5299 | static vector pixel __ATTRS_o_ai |
| 5300 | vec_vsl(vector pixel a, vector unsigned int b) |
| 5301 | { |
| 5302 | return (vector pixel)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5303 | } |
| 5304 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5305 | static vector int __ATTRS_o_ai |
| 5306 | vec_vsl(vector int a, vector unsigned char b) |
| 5307 | { |
| 5308 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 5309 | } |
| 5310 | |
| 5311 | static vector int __ATTRS_o_ai |
| 5312 | vec_vsl(vector int a, vector unsigned short b) |
| 5313 | { |
| 5314 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 5315 | } |
| 5316 | |
| 5317 | static vector int __ATTRS_o_ai |
| 5318 | vec_vsl(vector int a, vector unsigned int b) |
| 5319 | { |
| 5320 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 5321 | } |
| 5322 | |
| 5323 | static vector unsigned int __ATTRS_o_ai |
| 5324 | vec_vsl(vector unsigned int a, vector unsigned char b) |
| 5325 | { |
| 5326 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5327 | } |
| 5328 | |
| 5329 | static vector unsigned int __ATTRS_o_ai |
| 5330 | vec_vsl(vector unsigned int a, vector unsigned short b) |
| 5331 | { |
| 5332 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5333 | } |
| 5334 | |
| 5335 | static vector unsigned int __ATTRS_o_ai |
| 5336 | vec_vsl(vector unsigned int a, vector unsigned int b) |
| 5337 | { |
| 5338 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5339 | } |
| 5340 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5341 | static vector bool int __ATTRS_o_ai |
| 5342 | vec_vsl(vector bool int a, vector unsigned char b) |
| 5343 | { |
| 5344 | return (vector bool int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5345 | } |
| 5346 | |
| 5347 | static vector bool int __ATTRS_o_ai |
| 5348 | vec_vsl(vector bool int a, vector unsigned short b) |
| 5349 | { |
| 5350 | return (vector bool int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5351 | } |
| 5352 | |
| 5353 | static vector bool int __ATTRS_o_ai |
| 5354 | vec_vsl(vector bool int a, vector unsigned int b) |
| 5355 | { |
| 5356 | return (vector bool int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 5357 | } |
| 5358 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5359 | /* vec_slo */ |
| 5360 | |
| 5361 | static vector signed char __ATTRS_o_ai |
| 5362 | vec_slo(vector signed char a, vector signed char b) |
| 5363 | { |
| 5364 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5365 | } |
| 5366 | |
| 5367 | static vector signed char __ATTRS_o_ai |
| 5368 | vec_slo(vector signed char a, vector unsigned char b) |
| 5369 | { |
| 5370 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5371 | } |
| 5372 | |
| 5373 | static vector unsigned char __ATTRS_o_ai |
| 5374 | vec_slo(vector unsigned char a, vector signed char b) |
| 5375 | { |
| 5376 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5377 | } |
| 5378 | |
| 5379 | static vector unsigned char __ATTRS_o_ai |
| 5380 | vec_slo(vector unsigned char a, vector unsigned char b) |
| 5381 | { |
| 5382 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5383 | } |
| 5384 | |
| 5385 | static vector short __ATTRS_o_ai |
| 5386 | vec_slo(vector short a, vector signed char b) |
| 5387 | { |
| 5388 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5389 | } |
| 5390 | |
| 5391 | static vector short __ATTRS_o_ai |
| 5392 | vec_slo(vector short a, vector unsigned char b) |
| 5393 | { |
| 5394 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5395 | } |
| 5396 | |
| 5397 | static vector unsigned short __ATTRS_o_ai |
| 5398 | vec_slo(vector unsigned short a, vector signed char b) |
| 5399 | { |
| 5400 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5401 | } |
| 5402 | |
| 5403 | static vector unsigned short __ATTRS_o_ai |
| 5404 | vec_slo(vector unsigned short a, vector unsigned char b) |
| 5405 | { |
| 5406 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5407 | } |
| 5408 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5409 | static vector pixel __ATTRS_o_ai |
| 5410 | vec_slo(vector pixel a, vector signed char b) |
| 5411 | { |
| 5412 | return (vector pixel)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5413 | } |
| 5414 | |
| 5415 | static vector pixel __ATTRS_o_ai |
| 5416 | vec_slo(vector pixel a, vector unsigned char b) |
| 5417 | { |
| 5418 | return (vector pixel)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5419 | } |
| 5420 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5421 | static vector int __ATTRS_o_ai |
| 5422 | vec_slo(vector int a, vector signed char b) |
| 5423 | { |
| 5424 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 5425 | } |
| 5426 | |
| 5427 | static vector int __ATTRS_o_ai |
| 5428 | vec_slo(vector int a, vector unsigned char b) |
| 5429 | { |
| 5430 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 5431 | } |
| 5432 | |
| 5433 | static vector unsigned int __ATTRS_o_ai |
| 5434 | vec_slo(vector unsigned int a, vector signed char b) |
| 5435 | { |
| 5436 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5437 | } |
| 5438 | |
| 5439 | static vector unsigned int __ATTRS_o_ai |
| 5440 | vec_slo(vector unsigned int a, vector unsigned char b) |
| 5441 | { |
| 5442 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5443 | } |
| 5444 | |
| 5445 | static vector float __ATTRS_o_ai |
| 5446 | vec_slo(vector float a, vector signed char b) |
| 5447 | { |
| 5448 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5449 | } |
| 5450 | |
| 5451 | static vector float __ATTRS_o_ai |
| 5452 | vec_slo(vector float a, vector unsigned char b) |
| 5453 | { |
| 5454 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5455 | } |
| 5456 | |
| 5457 | /* vec_vslo */ |
| 5458 | |
| 5459 | static vector signed char __ATTRS_o_ai |
| 5460 | vec_vslo(vector signed char a, vector signed char b) |
| 5461 | { |
| 5462 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5463 | } |
| 5464 | |
| 5465 | static vector signed char __ATTRS_o_ai |
| 5466 | vec_vslo(vector signed char a, vector unsigned char b) |
| 5467 | { |
| 5468 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5469 | } |
| 5470 | |
| 5471 | static vector unsigned char __ATTRS_o_ai |
| 5472 | vec_vslo(vector unsigned char a, vector signed char b) |
| 5473 | { |
| 5474 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5475 | } |
| 5476 | |
| 5477 | static vector unsigned char __ATTRS_o_ai |
| 5478 | vec_vslo(vector unsigned char a, vector unsigned char b) |
| 5479 | { |
| 5480 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5481 | } |
| 5482 | |
| 5483 | static vector short __ATTRS_o_ai |
| 5484 | vec_vslo(vector short a, vector signed char b) |
| 5485 | { |
| 5486 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5487 | } |
| 5488 | |
| 5489 | static vector short __ATTRS_o_ai |
| 5490 | vec_vslo(vector short a, vector unsigned char b) |
| 5491 | { |
| 5492 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5493 | } |
| 5494 | |
| 5495 | static vector unsigned short __ATTRS_o_ai |
| 5496 | vec_vslo(vector unsigned short a, vector signed char b) |
| 5497 | { |
| 5498 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5499 | } |
| 5500 | |
| 5501 | static vector unsigned short __ATTRS_o_ai |
| 5502 | vec_vslo(vector unsigned short a, vector unsigned char b) |
| 5503 | { |
| 5504 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5505 | } |
| 5506 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 5507 | static vector pixel __ATTRS_o_ai |
| 5508 | vec_vslo(vector pixel a, vector signed char b) |
| 5509 | { |
| 5510 | return (vector pixel)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5511 | } |
| 5512 | |
| 5513 | static vector pixel __ATTRS_o_ai |
| 5514 | vec_vslo(vector pixel a, vector unsigned char b) |
| 5515 | { |
| 5516 | return (vector pixel)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5517 | } |
| 5518 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5519 | static vector int __ATTRS_o_ai |
| 5520 | vec_vslo(vector int a, vector signed char b) |
| 5521 | { |
| 5522 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 5523 | } |
| 5524 | |
| 5525 | static vector int __ATTRS_o_ai |
| 5526 | vec_vslo(vector int a, vector unsigned char b) |
| 5527 | { |
| 5528 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 5529 | } |
| 5530 | |
| 5531 | static vector unsigned int __ATTRS_o_ai |
| 5532 | vec_vslo(vector unsigned int a, vector signed char b) |
| 5533 | { |
| 5534 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5535 | } |
| 5536 | |
| 5537 | static vector unsigned int __ATTRS_o_ai |
| 5538 | vec_vslo(vector unsigned int a, vector unsigned char b) |
| 5539 | { |
| 5540 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5541 | } |
| 5542 | |
| 5543 | static vector float __ATTRS_o_ai |
| 5544 | vec_vslo(vector float a, vector signed char b) |
| 5545 | { |
| 5546 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5547 | } |
| 5548 | |
| 5549 | static vector float __ATTRS_o_ai |
| 5550 | vec_vslo(vector float a, vector unsigned char b) |
| 5551 | { |
| 5552 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 5553 | } |
| 5554 | |
| 5555 | /* vec_splat */ |
| 5556 | |
| 5557 | static vector signed char __ATTRS_o_ai |
| 5558 | vec_splat(vector signed char a, unsigned char b) |
| 5559 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5560 | return vec_perm(a, a, (vector unsigned char)(b)); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5561 | } |
| 5562 | |
| 5563 | static vector unsigned char __ATTRS_o_ai |
| 5564 | vec_splat(vector unsigned char a, unsigned char b) |
| 5565 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5566 | return vec_perm(a, a, (vector unsigned char)(b)); |
| 5567 | } |
| 5568 | |
| 5569 | static vector bool char __ATTRS_o_ai |
| 5570 | vec_splat(vector bool char a, unsigned char b) |
| 5571 | { |
| 5572 | return vec_perm(a, a, (vector unsigned char)(b)); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5573 | } |
| 5574 | |
| 5575 | static vector short __ATTRS_o_ai |
| 5576 | vec_splat(vector short a, unsigned char b) |
| 5577 | { |
| 5578 | b *= 2; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5579 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5580 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5581 | } |
| 5582 | |
| 5583 | static vector unsigned short __ATTRS_o_ai |
| 5584 | vec_splat(vector unsigned short a, unsigned char b) |
| 5585 | { |
| 5586 | b *= 2; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5587 | return vec_perm(a, a, (vector unsigned char) |
| 5588 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5589 | } |
| 5590 | |
| 5591 | static vector bool short __ATTRS_o_ai |
| 5592 | vec_splat(vector bool short a, unsigned char b) |
| 5593 | { |
| 5594 | b *= 2; |
| 5595 | return vec_perm(a, a, (vector unsigned char) |
| 5596 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5597 | } |
| 5598 | |
| 5599 | static vector pixel __ATTRS_o_ai |
| 5600 | vec_splat(vector pixel a, unsigned char b) |
| 5601 | { |
| 5602 | b *= 2; |
| 5603 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5604 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5605 | } |
| 5606 | |
| 5607 | static vector int __ATTRS_o_ai |
| 5608 | vec_splat(vector int a, unsigned char b) |
| 5609 | { |
| 5610 | b *= 4; |
| 5611 | return vec_perm(a, a, (vector unsigned char) |
| 5612 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5613 | } |
| 5614 | |
| 5615 | static vector unsigned int __ATTRS_o_ai |
| 5616 | vec_splat(vector unsigned int a, unsigned char b) |
| 5617 | { |
| 5618 | b *= 4; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5619 | return vec_perm(a, a, (vector unsigned char) |
| 5620 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5621 | } |
| 5622 | |
| 5623 | static vector bool int __ATTRS_o_ai |
| 5624 | vec_splat(vector bool int a, unsigned char b) |
| 5625 | { |
| 5626 | b *= 4; |
| 5627 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5628 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5629 | } |
| 5630 | |
| 5631 | static vector float __ATTRS_o_ai |
| 5632 | vec_splat(vector float a, unsigned char b) |
| 5633 | { |
| 5634 | b *= 4; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5635 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5636 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5637 | } |
| 5638 | |
| 5639 | /* vec_vspltb */ |
| 5640 | |
| 5641 | #define __builtin_altivec_vspltb vec_vspltb |
| 5642 | |
| 5643 | static vector signed char __ATTRS_o_ai |
| 5644 | vec_vspltb(vector signed char a, unsigned char b) |
| 5645 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5646 | return vec_perm(a, a, (vector unsigned char)(b)); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5647 | } |
| 5648 | |
| 5649 | static vector unsigned char __ATTRS_o_ai |
| 5650 | vec_vspltb(vector unsigned char a, unsigned char b) |
| 5651 | { |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5652 | return vec_perm(a, a, (vector unsigned char)(b)); |
| 5653 | } |
| 5654 | |
| 5655 | static vector bool char __ATTRS_o_ai |
| 5656 | vec_vspltb(vector bool char a, unsigned char b) |
| 5657 | { |
| 5658 | return vec_perm(a, a, (vector unsigned char)(b)); |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5659 | } |
| 5660 | |
| 5661 | /* vec_vsplth */ |
| 5662 | |
| 5663 | #define __builtin_altivec_vsplth vec_vsplth |
| 5664 | |
| 5665 | static vector short __ATTRS_o_ai |
| 5666 | vec_vsplth(vector short a, unsigned char b) |
| 5667 | { |
| 5668 | b *= 2; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5669 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5670 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5671 | } |
| 5672 | |
| 5673 | static vector unsigned short __ATTRS_o_ai |
| 5674 | vec_vsplth(vector unsigned short a, unsigned char b) |
| 5675 | { |
| 5676 | b *= 2; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5677 | return vec_perm(a, a, (vector unsigned char) |
| 5678 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5679 | } |
| 5680 | |
| 5681 | static vector bool short __ATTRS_o_ai |
| 5682 | vec_vsplth(vector bool short a, unsigned char b) |
| 5683 | { |
| 5684 | b *= 2; |
| 5685 | return vec_perm(a, a, (vector unsigned char) |
| 5686 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5687 | } |
| 5688 | |
| 5689 | static vector pixel __ATTRS_o_ai |
| 5690 | vec_vsplth(vector pixel a, unsigned char b) |
| 5691 | { |
| 5692 | b *= 2; |
| 5693 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5694 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 5695 | } |
| 5696 | |
| 5697 | /* vec_vspltw */ |
| 5698 | |
| 5699 | #define __builtin_altivec_vspltw vec_vspltw |
| 5700 | |
| 5701 | static vector int __ATTRS_o_ai |
| 5702 | vec_vspltw(vector int a, unsigned char b) |
| 5703 | { |
| 5704 | b *= 4; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5705 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5706 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5707 | } |
| 5708 | |
| 5709 | static vector unsigned int __ATTRS_o_ai |
| 5710 | vec_vspltw(vector unsigned int a, unsigned char b) |
| 5711 | { |
| 5712 | b *= 4; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5713 | return vec_perm(a, a, (vector unsigned char) |
| 5714 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5715 | } |
| 5716 | |
| 5717 | static vector bool int __ATTRS_o_ai |
| 5718 | vec_vspltw(vector bool int a, unsigned char b) |
| 5719 | { |
| 5720 | b *= 4; |
| 5721 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5722 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5723 | } |
| 5724 | |
| 5725 | static vector float __ATTRS_o_ai |
| 5726 | vec_vspltw(vector float a, unsigned char b) |
| 5727 | { |
| 5728 | b *= 4; |
Anton Yartsev | f54dbfd | 2010-08-19 03:00:09 +0000 | [diff] [blame] | 5729 | return vec_perm(a, a, (vector unsigned char) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5730 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 5731 | } |
| 5732 | |
| 5733 | /* vec_splat_s8 */ |
| 5734 | |
| 5735 | #define __builtin_altivec_vspltisb vec_splat_s8 |
| 5736 | |
| 5737 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5738 | static vector signed char __ATTRS_o_ai |
| 5739 | vec_splat_s8(signed char a) |
| 5740 | { |
| 5741 | return (vector signed char)(a); |
| 5742 | } |
| 5743 | |
| 5744 | /* vec_vspltisb */ |
| 5745 | |
| 5746 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5747 | static vector signed char __ATTRS_o_ai |
| 5748 | vec_vspltisb(signed char a) |
| 5749 | { |
| 5750 | return (vector signed char)(a); |
| 5751 | } |
| 5752 | |
| 5753 | /* vec_splat_s16 */ |
| 5754 | |
| 5755 | #define __builtin_altivec_vspltish vec_splat_s16 |
| 5756 | |
| 5757 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5758 | static vector short __ATTRS_o_ai |
| 5759 | vec_splat_s16(signed char a) |
| 5760 | { |
| 5761 | return (vector short)(a); |
| 5762 | } |
| 5763 | |
| 5764 | /* vec_vspltish */ |
| 5765 | |
| 5766 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5767 | static vector short __ATTRS_o_ai |
| 5768 | vec_vspltish(signed char a) |
| 5769 | { |
| 5770 | return (vector short)(a); |
| 5771 | } |
| 5772 | |
| 5773 | /* vec_splat_s32 */ |
| 5774 | |
| 5775 | #define __builtin_altivec_vspltisw vec_splat_s32 |
| 5776 | |
| 5777 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5778 | static vector int __ATTRS_o_ai |
| 5779 | vec_splat_s32(signed char a) |
| 5780 | { |
| 5781 | return (vector int)(a); |
| 5782 | } |
| 5783 | |
| 5784 | /* vec_vspltisw */ |
| 5785 | |
| 5786 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5787 | static vector int __ATTRS_o_ai |
| 5788 | vec_vspltisw(signed char a) |
| 5789 | { |
| 5790 | return (vector int)(a); |
| 5791 | } |
| 5792 | |
| 5793 | /* vec_splat_u8 */ |
| 5794 | |
| 5795 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5796 | static vector unsigned char __ATTRS_o_ai |
| 5797 | vec_splat_u8(unsigned char a) |
| 5798 | { |
| 5799 | return (vector unsigned char)(a); |
| 5800 | } |
| 5801 | |
| 5802 | /* vec_splat_u16 */ |
| 5803 | |
| 5804 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5805 | static vector unsigned short __ATTRS_o_ai |
| 5806 | vec_splat_u16(signed char a) |
| 5807 | { |
| 5808 | return (vector unsigned short)(a); |
| 5809 | } |
| 5810 | |
| 5811 | /* vec_splat_u32 */ |
| 5812 | |
| 5813 | // FIXME: parameter should be treated as 5-bit signed literal |
| 5814 | static vector unsigned int __ATTRS_o_ai |
| 5815 | vec_splat_u32(signed char a) |
| 5816 | { |
| 5817 | return (vector unsigned int)(a); |
| 5818 | } |
| 5819 | |
| 5820 | /* vec_sr */ |
| 5821 | |
| 5822 | static vector signed char __ATTRS_o_ai |
| 5823 | vec_sr(vector signed char a, vector unsigned char b) |
| 5824 | { |
| 5825 | return a >> (vector signed char)b; |
| 5826 | } |
| 5827 | |
| 5828 | static vector unsigned char __ATTRS_o_ai |
| 5829 | vec_sr(vector unsigned char a, vector unsigned char b) |
| 5830 | { |
| 5831 | return a >> b; |
| 5832 | } |
| 5833 | |
| 5834 | static vector short __ATTRS_o_ai |
| 5835 | vec_sr(vector short a, vector unsigned short b) |
| 5836 | { |
| 5837 | return a >> (vector short)b; |
| 5838 | } |
| 5839 | |
| 5840 | static vector unsigned short __ATTRS_o_ai |
| 5841 | vec_sr(vector unsigned short a, vector unsigned short b) |
| 5842 | { |
| 5843 | return a >> b; |
| 5844 | } |
| 5845 | |
| 5846 | static vector int __ATTRS_o_ai |
| 5847 | vec_sr(vector int a, vector unsigned int b) |
| 5848 | { |
| 5849 | return a >> (vector int)b; |
| 5850 | } |
| 5851 | |
| 5852 | static vector unsigned int __ATTRS_o_ai |
| 5853 | vec_sr(vector unsigned int a, vector unsigned int b) |
| 5854 | { |
| 5855 | return a >> b; |
| 5856 | } |
| 5857 | |
| 5858 | /* vec_vsrb */ |
| 5859 | |
| 5860 | #define __builtin_altivec_vsrb vec_vsrb |
| 5861 | |
| 5862 | static vector signed char __ATTRS_o_ai |
| 5863 | vec_vsrb(vector signed char a, vector unsigned char b) |
| 5864 | { |
| 5865 | return a >> (vector signed char)b; |
| 5866 | } |
| 5867 | |
| 5868 | static vector unsigned char __ATTRS_o_ai |
| 5869 | vec_vsrb(vector unsigned char a, vector unsigned char b) |
| 5870 | { |
| 5871 | return a >> b; |
| 5872 | } |
| 5873 | |
| 5874 | /* vec_vsrh */ |
| 5875 | |
| 5876 | #define __builtin_altivec_vsrh vec_vsrh |
| 5877 | |
| 5878 | static vector short __ATTRS_o_ai |
| 5879 | vec_vsrh(vector short a, vector unsigned short b) |
| 5880 | { |
| 5881 | return a >> (vector short)b; |
| 5882 | } |
| 5883 | |
| 5884 | static vector unsigned short __ATTRS_o_ai |
| 5885 | vec_vsrh(vector unsigned short a, vector unsigned short b) |
| 5886 | { |
| 5887 | return a >> b; |
| 5888 | } |
| 5889 | |
| 5890 | /* vec_vsrw */ |
| 5891 | |
| 5892 | #define __builtin_altivec_vsrw vec_vsrw |
| 5893 | |
| 5894 | static vector int __ATTRS_o_ai |
| 5895 | vec_vsrw(vector int a, vector unsigned int b) |
| 5896 | { |
| 5897 | return a >> (vector int)b; |
| 5898 | } |
| 5899 | |
| 5900 | static vector unsigned int __ATTRS_o_ai |
| 5901 | vec_vsrw(vector unsigned int a, vector unsigned int b) |
| 5902 | { |
| 5903 | return a >> b; |
| 5904 | } |
| 5905 | |
| 5906 | /* vec_sra */ |
| 5907 | |
| 5908 | static vector signed char __ATTRS_o_ai |
| 5909 | vec_sra(vector signed char a, vector unsigned char b) |
| 5910 | { |
| 5911 | return (vector signed char)__builtin_altivec_vsrab((vector char)a, b); |
| 5912 | } |
| 5913 | |
| 5914 | static vector unsigned char __ATTRS_o_ai |
| 5915 | vec_sra(vector unsigned char a, vector unsigned char b) |
| 5916 | { |
| 5917 | return (vector unsigned char)__builtin_altivec_vsrab((vector char)a, b); |
| 5918 | } |
| 5919 | |
| 5920 | static vector short __ATTRS_o_ai |
| 5921 | vec_sra(vector short a, vector unsigned short b) |
| 5922 | { |
| 5923 | return __builtin_altivec_vsrah(a, (vector unsigned short)b); |
| 5924 | } |
| 5925 | |
| 5926 | static vector unsigned short __ATTRS_o_ai |
| 5927 | vec_sra(vector unsigned short a, vector unsigned short b) |
| 5928 | { |
| 5929 | return (vector unsigned short)__builtin_altivec_vsrah((vector short)a, b); |
| 5930 | } |
| 5931 | |
| 5932 | static vector int __ATTRS_o_ai |
| 5933 | vec_sra(vector int a, vector unsigned int b) |
| 5934 | { |
| 5935 | return __builtin_altivec_vsraw(a, b); |
| 5936 | } |
| 5937 | |
| 5938 | static vector unsigned int __ATTRS_o_ai |
| 5939 | vec_sra(vector unsigned int a, vector unsigned int b) |
| 5940 | { |
| 5941 | return (vector unsigned int)__builtin_altivec_vsraw((vector int)a, b); |
| 5942 | } |
| 5943 | |
| 5944 | /* vec_vsrab */ |
| 5945 | |
| 5946 | static vector signed char __ATTRS_o_ai |
| 5947 | vec_vsrab(vector signed char a, vector unsigned char b) |
| 5948 | { |
| 5949 | return (vector signed char)__builtin_altivec_vsrab((vector char)a, b); |
| 5950 | } |
| 5951 | |
| 5952 | static vector unsigned char __ATTRS_o_ai |
| 5953 | vec_vsrab(vector unsigned char a, vector unsigned char b) |
| 5954 | { |
| 5955 | return (vector unsigned char)__builtin_altivec_vsrab((vector char)a, b); |
| 5956 | } |
| 5957 | |
| 5958 | /* vec_vsrah */ |
| 5959 | |
| 5960 | static vector short __ATTRS_o_ai |
| 5961 | vec_vsrah(vector short a, vector unsigned short b) |
| 5962 | { |
| 5963 | return __builtin_altivec_vsrah(a, (vector unsigned short)b); |
| 5964 | } |
| 5965 | |
| 5966 | static vector unsigned short __ATTRS_o_ai |
| 5967 | vec_vsrah(vector unsigned short a, vector unsigned short b) |
| 5968 | { |
| 5969 | return (vector unsigned short)__builtin_altivec_vsrah((vector short)a, b); |
| 5970 | } |
| 5971 | |
| 5972 | /* vec_vsraw */ |
| 5973 | |
| 5974 | static vector int __ATTRS_o_ai |
| 5975 | vec_vsraw(vector int a, vector unsigned int b) |
| 5976 | { |
| 5977 | return __builtin_altivec_vsraw(a, b); |
| 5978 | } |
| 5979 | |
| 5980 | static vector unsigned int __ATTRS_o_ai |
| 5981 | vec_vsraw(vector unsigned int a, vector unsigned int b) |
| 5982 | { |
| 5983 | return (vector unsigned int)__builtin_altivec_vsraw((vector int)a, b); |
| 5984 | } |
| 5985 | |
| 5986 | /* vec_srl */ |
| 5987 | |
| 5988 | static vector signed char __ATTRS_o_ai |
| 5989 | vec_srl(vector signed char a, vector unsigned char b) |
| 5990 | { |
| 5991 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 5992 | } |
| 5993 | |
| 5994 | static vector signed char __ATTRS_o_ai |
| 5995 | vec_srl(vector signed char a, vector unsigned short b) |
| 5996 | { |
| 5997 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 5998 | } |
| 5999 | |
| 6000 | static vector signed char __ATTRS_o_ai |
| 6001 | vec_srl(vector signed char a, vector unsigned int b) |
| 6002 | { |
| 6003 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6004 | } |
| 6005 | |
| 6006 | static vector unsigned char __ATTRS_o_ai |
| 6007 | vec_srl(vector unsigned char a, vector unsigned char b) |
| 6008 | { |
| 6009 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6010 | } |
| 6011 | |
| 6012 | static vector unsigned char __ATTRS_o_ai |
| 6013 | vec_srl(vector unsigned char a, vector unsigned short b) |
| 6014 | { |
| 6015 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6016 | } |
| 6017 | |
| 6018 | static vector unsigned char __ATTRS_o_ai |
| 6019 | vec_srl(vector unsigned char a, vector unsigned int b) |
| 6020 | { |
| 6021 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6022 | } |
| 6023 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6024 | static vector bool char __ATTRS_o_ai |
| 6025 | vec_srl(vector bool char a, vector unsigned char b) |
| 6026 | { |
| 6027 | return (vector bool char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6028 | } |
| 6029 | |
| 6030 | static vector bool char __ATTRS_o_ai |
| 6031 | vec_srl(vector bool char a, vector unsigned short b) |
| 6032 | { |
| 6033 | return (vector bool char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6034 | } |
| 6035 | |
| 6036 | static vector bool char __ATTRS_o_ai |
| 6037 | vec_srl(vector bool char a, vector unsigned int b) |
| 6038 | { |
| 6039 | return (vector bool char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6040 | } |
| 6041 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6042 | static vector short __ATTRS_o_ai |
| 6043 | vec_srl(vector short a, vector unsigned char b) |
| 6044 | { |
| 6045 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6046 | } |
| 6047 | |
| 6048 | static vector short __ATTRS_o_ai |
| 6049 | vec_srl(vector short a, vector unsigned short b) |
| 6050 | { |
| 6051 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6052 | } |
| 6053 | |
| 6054 | static vector short __ATTRS_o_ai |
| 6055 | vec_srl(vector short a, vector unsigned int b) |
| 6056 | { |
| 6057 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6058 | } |
| 6059 | |
| 6060 | static vector unsigned short __ATTRS_o_ai |
| 6061 | vec_srl(vector unsigned short a, vector unsigned char b) |
| 6062 | { |
| 6063 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6064 | } |
| 6065 | |
| 6066 | static vector unsigned short __ATTRS_o_ai |
| 6067 | vec_srl(vector unsigned short a, vector unsigned short b) |
| 6068 | { |
| 6069 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6070 | } |
| 6071 | |
| 6072 | static vector unsigned short __ATTRS_o_ai |
| 6073 | vec_srl(vector unsigned short a, vector unsigned int b) |
| 6074 | { |
| 6075 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6076 | } |
| 6077 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6078 | static vector bool short __ATTRS_o_ai |
| 6079 | vec_srl(vector bool short a, vector unsigned char b) |
| 6080 | { |
| 6081 | return (vector bool short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6082 | } |
| 6083 | |
| 6084 | static vector bool short __ATTRS_o_ai |
| 6085 | vec_srl(vector bool short a, vector unsigned short b) |
| 6086 | { |
| 6087 | return (vector bool short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6088 | } |
| 6089 | |
| 6090 | static vector bool short __ATTRS_o_ai |
| 6091 | vec_srl(vector bool short a, vector unsigned int b) |
| 6092 | { |
| 6093 | return (vector bool short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6094 | } |
| 6095 | |
| 6096 | static vector pixel __ATTRS_o_ai |
| 6097 | vec_srl(vector pixel a, vector unsigned char b) |
| 6098 | { |
| 6099 | return (vector pixel)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6100 | } |
| 6101 | |
| 6102 | static vector pixel __ATTRS_o_ai |
| 6103 | vec_srl(vector pixel a, vector unsigned short b) |
| 6104 | { |
| 6105 | return (vector pixel)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6106 | } |
| 6107 | |
| 6108 | static vector pixel __ATTRS_o_ai |
| 6109 | vec_srl(vector pixel a, vector unsigned int b) |
| 6110 | { |
| 6111 | return (vector pixel)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6112 | } |
| 6113 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6114 | static vector int __ATTRS_o_ai |
| 6115 | vec_srl(vector int a, vector unsigned char b) |
| 6116 | { |
| 6117 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 6118 | } |
| 6119 | |
| 6120 | static vector int __ATTRS_o_ai |
| 6121 | vec_srl(vector int a, vector unsigned short b) |
| 6122 | { |
| 6123 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 6124 | } |
| 6125 | |
| 6126 | static vector int __ATTRS_o_ai |
| 6127 | vec_srl(vector int a, vector unsigned int b) |
| 6128 | { |
| 6129 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 6130 | } |
| 6131 | |
| 6132 | static vector unsigned int __ATTRS_o_ai |
| 6133 | vec_srl(vector unsigned int a, vector unsigned char b) |
| 6134 | { |
| 6135 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6136 | } |
| 6137 | |
| 6138 | static vector unsigned int __ATTRS_o_ai |
| 6139 | vec_srl(vector unsigned int a, vector unsigned short b) |
| 6140 | { |
| 6141 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6142 | } |
| 6143 | |
| 6144 | static vector unsigned int __ATTRS_o_ai |
| 6145 | vec_srl(vector unsigned int a, vector unsigned int b) |
| 6146 | { |
| 6147 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6148 | } |
| 6149 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6150 | static vector bool int __ATTRS_o_ai |
| 6151 | vec_srl(vector bool int a, vector unsigned char b) |
| 6152 | { |
| 6153 | return (vector bool int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6154 | } |
| 6155 | |
| 6156 | static vector bool int __ATTRS_o_ai |
| 6157 | vec_srl(vector bool int a, vector unsigned short b) |
| 6158 | { |
| 6159 | return (vector bool int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6160 | } |
| 6161 | |
| 6162 | static vector bool int __ATTRS_o_ai |
| 6163 | vec_srl(vector bool int a, vector unsigned int b) |
| 6164 | { |
| 6165 | return (vector bool int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6166 | } |
| 6167 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6168 | /* vec_vsr */ |
| 6169 | |
| 6170 | static vector signed char __ATTRS_o_ai |
| 6171 | vec_vsr(vector signed char a, vector unsigned char b) |
| 6172 | { |
| 6173 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6174 | } |
| 6175 | |
| 6176 | static vector signed char __ATTRS_o_ai |
| 6177 | vec_vsr(vector signed char a, vector unsigned short b) |
| 6178 | { |
| 6179 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6180 | } |
| 6181 | |
| 6182 | static vector signed char __ATTRS_o_ai |
| 6183 | vec_vsr(vector signed char a, vector unsigned int b) |
| 6184 | { |
| 6185 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6186 | } |
| 6187 | |
| 6188 | static vector unsigned char __ATTRS_o_ai |
| 6189 | vec_vsr(vector unsigned char a, vector unsigned char b) |
| 6190 | { |
| 6191 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6192 | } |
| 6193 | |
| 6194 | static vector unsigned char __ATTRS_o_ai |
| 6195 | vec_vsr(vector unsigned char a, vector unsigned short b) |
| 6196 | { |
| 6197 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6198 | } |
| 6199 | |
| 6200 | static vector unsigned char __ATTRS_o_ai |
| 6201 | vec_vsr(vector unsigned char a, vector unsigned int b) |
| 6202 | { |
| 6203 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6204 | } |
| 6205 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6206 | static vector bool char __ATTRS_o_ai |
| 6207 | vec_vsr(vector bool char a, vector unsigned char b) |
| 6208 | { |
| 6209 | return (vector bool char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6210 | } |
| 6211 | |
| 6212 | static vector bool char __ATTRS_o_ai |
| 6213 | vec_vsr(vector bool char a, vector unsigned short b) |
| 6214 | { |
| 6215 | return (vector bool char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6216 | } |
| 6217 | |
| 6218 | static vector bool char __ATTRS_o_ai |
| 6219 | vec_vsr(vector bool char a, vector unsigned int b) |
| 6220 | { |
| 6221 | return (vector bool char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6222 | } |
| 6223 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6224 | static vector short __ATTRS_o_ai |
| 6225 | vec_vsr(vector short a, vector unsigned char b) |
| 6226 | { |
| 6227 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6228 | } |
| 6229 | |
| 6230 | static vector short __ATTRS_o_ai |
| 6231 | vec_vsr(vector short a, vector unsigned short b) |
| 6232 | { |
| 6233 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6234 | } |
| 6235 | |
| 6236 | static vector short __ATTRS_o_ai |
| 6237 | vec_vsr(vector short a, vector unsigned int b) |
| 6238 | { |
| 6239 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6240 | } |
| 6241 | |
| 6242 | static vector unsigned short __ATTRS_o_ai |
| 6243 | vec_vsr(vector unsigned short a, vector unsigned char b) |
| 6244 | { |
| 6245 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6246 | } |
| 6247 | |
| 6248 | static vector unsigned short __ATTRS_o_ai |
| 6249 | vec_vsr(vector unsigned short a, vector unsigned short b) |
| 6250 | { |
| 6251 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6252 | } |
| 6253 | |
| 6254 | static vector unsigned short __ATTRS_o_ai |
| 6255 | vec_vsr(vector unsigned short a, vector unsigned int b) |
| 6256 | { |
| 6257 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6258 | } |
| 6259 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6260 | static vector bool short __ATTRS_o_ai |
| 6261 | vec_vsr(vector bool short a, vector unsigned char b) |
| 6262 | { |
| 6263 | return (vector bool short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6264 | } |
| 6265 | |
| 6266 | static vector bool short __ATTRS_o_ai |
| 6267 | vec_vsr(vector bool short a, vector unsigned short b) |
| 6268 | { |
| 6269 | return (vector bool short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6270 | } |
| 6271 | |
| 6272 | static vector bool short __ATTRS_o_ai |
| 6273 | vec_vsr(vector bool short a, vector unsigned int b) |
| 6274 | { |
| 6275 | return (vector bool short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6276 | } |
| 6277 | |
| 6278 | static vector pixel __ATTRS_o_ai |
| 6279 | vec_vsr(vector pixel a, vector unsigned char b) |
| 6280 | { |
| 6281 | return (vector pixel)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6282 | } |
| 6283 | |
| 6284 | static vector pixel __ATTRS_o_ai |
| 6285 | vec_vsr(vector pixel a, vector unsigned short b) |
| 6286 | { |
| 6287 | return (vector pixel)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6288 | } |
| 6289 | |
| 6290 | static vector pixel __ATTRS_o_ai |
| 6291 | vec_vsr(vector pixel a, vector unsigned int b) |
| 6292 | { |
| 6293 | return (vector pixel)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6294 | } |
| 6295 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6296 | static vector int __ATTRS_o_ai |
| 6297 | vec_vsr(vector int a, vector unsigned char b) |
| 6298 | { |
| 6299 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 6300 | } |
| 6301 | |
| 6302 | static vector int __ATTRS_o_ai |
| 6303 | vec_vsr(vector int a, vector unsigned short b) |
| 6304 | { |
| 6305 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 6306 | } |
| 6307 | |
| 6308 | static vector int __ATTRS_o_ai |
| 6309 | vec_vsr(vector int a, vector unsigned int b) |
| 6310 | { |
| 6311 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 6312 | } |
| 6313 | |
| 6314 | static vector unsigned int __ATTRS_o_ai |
| 6315 | vec_vsr(vector unsigned int a, vector unsigned char b) |
| 6316 | { |
| 6317 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6318 | } |
| 6319 | |
| 6320 | static vector unsigned int __ATTRS_o_ai |
| 6321 | vec_vsr(vector unsigned int a, vector unsigned short b) |
| 6322 | { |
| 6323 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6324 | } |
| 6325 | |
| 6326 | static vector unsigned int __ATTRS_o_ai |
| 6327 | vec_vsr(vector unsigned int a, vector unsigned int b) |
| 6328 | { |
| 6329 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6330 | } |
| 6331 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6332 | static vector bool int __ATTRS_o_ai |
| 6333 | vec_vsr(vector bool int a, vector unsigned char b) |
| 6334 | { |
| 6335 | return (vector bool int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6336 | } |
| 6337 | |
| 6338 | static vector bool int __ATTRS_o_ai |
| 6339 | vec_vsr(vector bool int a, vector unsigned short b) |
| 6340 | { |
| 6341 | return (vector bool int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6342 | } |
| 6343 | |
| 6344 | static vector bool int __ATTRS_o_ai |
| 6345 | vec_vsr(vector bool int a, vector unsigned int b) |
| 6346 | { |
| 6347 | return (vector bool int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 6348 | } |
| 6349 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6350 | /* vec_sro */ |
| 6351 | |
| 6352 | static vector signed char __ATTRS_o_ai |
| 6353 | vec_sro(vector signed char a, vector signed char b) |
| 6354 | { |
| 6355 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6356 | } |
| 6357 | |
| 6358 | static vector signed char __ATTRS_o_ai |
| 6359 | vec_sro(vector signed char a, vector unsigned char b) |
| 6360 | { |
| 6361 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6362 | } |
| 6363 | |
| 6364 | static vector unsigned char __ATTRS_o_ai |
| 6365 | vec_sro(vector unsigned char a, vector signed char b) |
| 6366 | { |
| 6367 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6368 | } |
| 6369 | |
| 6370 | static vector unsigned char __ATTRS_o_ai |
| 6371 | vec_sro(vector unsigned char a, vector unsigned char b) |
| 6372 | { |
| 6373 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6374 | } |
| 6375 | |
| 6376 | static vector short __ATTRS_o_ai |
| 6377 | vec_sro(vector short a, vector signed char b) |
| 6378 | { |
| 6379 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6380 | } |
| 6381 | |
| 6382 | static vector short __ATTRS_o_ai |
| 6383 | vec_sro(vector short a, vector unsigned char b) |
| 6384 | { |
| 6385 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6386 | } |
| 6387 | |
| 6388 | static vector unsigned short __ATTRS_o_ai |
| 6389 | vec_sro(vector unsigned short a, vector signed char b) |
| 6390 | { |
| 6391 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6392 | } |
| 6393 | |
| 6394 | static vector unsigned short __ATTRS_o_ai |
| 6395 | vec_sro(vector unsigned short a, vector unsigned char b) |
| 6396 | { |
| 6397 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6398 | } |
| 6399 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6400 | static vector pixel __ATTRS_o_ai |
| 6401 | vec_sro(vector pixel a, vector signed char b) |
| 6402 | { |
| 6403 | return (vector pixel)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6404 | } |
| 6405 | |
| 6406 | static vector pixel __ATTRS_o_ai |
| 6407 | vec_sro(vector pixel a, vector unsigned char b) |
| 6408 | { |
| 6409 | return (vector pixel)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6410 | } |
| 6411 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6412 | static vector int __ATTRS_o_ai |
| 6413 | vec_sro(vector int a, vector signed char b) |
| 6414 | { |
| 6415 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 6416 | } |
| 6417 | |
| 6418 | static vector int __ATTRS_o_ai |
| 6419 | vec_sro(vector int a, vector unsigned char b) |
| 6420 | { |
| 6421 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 6422 | } |
| 6423 | |
| 6424 | static vector unsigned int __ATTRS_o_ai |
| 6425 | vec_sro(vector unsigned int a, vector signed char b) |
| 6426 | { |
| 6427 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6428 | } |
| 6429 | |
| 6430 | static vector unsigned int __ATTRS_o_ai |
| 6431 | vec_sro(vector unsigned int a, vector unsigned char b) |
| 6432 | { |
| 6433 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6434 | } |
| 6435 | |
| 6436 | static vector float __ATTRS_o_ai |
| 6437 | vec_sro(vector float a, vector signed char b) |
| 6438 | { |
| 6439 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6440 | } |
| 6441 | |
| 6442 | static vector float __ATTRS_o_ai |
| 6443 | vec_sro(vector float a, vector unsigned char b) |
| 6444 | { |
| 6445 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6446 | } |
| 6447 | |
| 6448 | /* vec_vsro */ |
| 6449 | |
| 6450 | static vector signed char __ATTRS_o_ai |
| 6451 | vec_vsro(vector signed char a, vector signed char b) |
| 6452 | { |
| 6453 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6454 | } |
| 6455 | |
| 6456 | static vector signed char __ATTRS_o_ai |
| 6457 | vec_vsro(vector signed char a, vector unsigned char b) |
| 6458 | { |
| 6459 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6460 | } |
| 6461 | |
| 6462 | static vector unsigned char __ATTRS_o_ai |
| 6463 | vec_vsro(vector unsigned char a, vector signed char b) |
| 6464 | { |
| 6465 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6466 | } |
| 6467 | |
| 6468 | static vector unsigned char __ATTRS_o_ai |
| 6469 | vec_vsro(vector unsigned char a, vector unsigned char b) |
| 6470 | { |
| 6471 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6472 | } |
| 6473 | |
| 6474 | static vector short __ATTRS_o_ai |
| 6475 | vec_vsro(vector short a, vector signed char b) |
| 6476 | { |
| 6477 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6478 | } |
| 6479 | |
| 6480 | static vector short __ATTRS_o_ai |
| 6481 | vec_vsro(vector short a, vector unsigned char b) |
| 6482 | { |
| 6483 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6484 | } |
| 6485 | |
| 6486 | static vector unsigned short __ATTRS_o_ai |
| 6487 | vec_vsro(vector unsigned short a, vector signed char b) |
| 6488 | { |
| 6489 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6490 | } |
| 6491 | |
| 6492 | static vector unsigned short __ATTRS_o_ai |
| 6493 | vec_vsro(vector unsigned short a, vector unsigned char b) |
| 6494 | { |
| 6495 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6496 | } |
| 6497 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6498 | static vector pixel __ATTRS_o_ai |
| 6499 | vec_vsro(vector pixel a, vector signed char b) |
| 6500 | { |
| 6501 | return (vector pixel)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6502 | } |
| 6503 | |
| 6504 | static vector pixel __ATTRS_o_ai |
| 6505 | vec_vsro(vector pixel a, vector unsigned char b) |
| 6506 | { |
| 6507 | return (vector pixel)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6508 | } |
| 6509 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6510 | static vector int __ATTRS_o_ai |
| 6511 | vec_vsro(vector int a, vector signed char b) |
| 6512 | { |
| 6513 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 6514 | } |
| 6515 | |
| 6516 | static vector int __ATTRS_o_ai |
| 6517 | vec_vsro(vector int a, vector unsigned char b) |
| 6518 | { |
| 6519 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 6520 | } |
| 6521 | |
| 6522 | static vector unsigned int __ATTRS_o_ai |
| 6523 | vec_vsro(vector unsigned int a, vector signed char b) |
| 6524 | { |
| 6525 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6526 | } |
| 6527 | |
| 6528 | static vector unsigned int __ATTRS_o_ai |
| 6529 | vec_vsro(vector unsigned int a, vector unsigned char b) |
| 6530 | { |
| 6531 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6532 | } |
| 6533 | |
| 6534 | static vector float __ATTRS_o_ai |
| 6535 | vec_vsro(vector float a, vector signed char b) |
| 6536 | { |
| 6537 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6538 | } |
| 6539 | |
| 6540 | static vector float __ATTRS_o_ai |
| 6541 | vec_vsro(vector float a, vector unsigned char b) |
| 6542 | { |
| 6543 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 6544 | } |
| 6545 | |
| 6546 | /* vec_st */ |
| 6547 | |
| 6548 | static void __ATTRS_o_ai |
| 6549 | vec_st(vector signed char a, int b, vector signed char *c) |
| 6550 | { |
| 6551 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6552 | } |
| 6553 | |
| 6554 | static void __ATTRS_o_ai |
| 6555 | vec_st(vector signed char a, int b, signed char *c) |
| 6556 | { |
| 6557 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6558 | } |
| 6559 | |
| 6560 | static void __ATTRS_o_ai |
| 6561 | vec_st(vector unsigned char a, int b, vector unsigned char *c) |
| 6562 | { |
| 6563 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6564 | } |
| 6565 | |
| 6566 | static void __ATTRS_o_ai |
| 6567 | vec_st(vector unsigned char a, int b, unsigned char *c) |
| 6568 | { |
| 6569 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6570 | } |
| 6571 | |
| 6572 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6573 | vec_st(vector bool char a, int b, signed char *c) |
| 6574 | { |
| 6575 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6576 | } |
| 6577 | |
| 6578 | static void __ATTRS_o_ai |
| 6579 | vec_st(vector bool char a, int b, unsigned char *c) |
| 6580 | { |
| 6581 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6582 | } |
| 6583 | |
| 6584 | static void __ATTRS_o_ai |
| 6585 | vec_st(vector bool char a, int b, vector bool char *c) |
| 6586 | { |
| 6587 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6588 | } |
| 6589 | |
| 6590 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6591 | vec_st(vector short a, int b, vector short *c) |
| 6592 | { |
| 6593 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6594 | } |
| 6595 | |
| 6596 | static void __ATTRS_o_ai |
| 6597 | vec_st(vector short a, int b, short *c) |
| 6598 | { |
| 6599 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6600 | } |
| 6601 | |
| 6602 | static void __ATTRS_o_ai |
| 6603 | vec_st(vector unsigned short a, int b, vector unsigned short *c) |
| 6604 | { |
| 6605 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6606 | } |
| 6607 | |
| 6608 | static void __ATTRS_o_ai |
| 6609 | vec_st(vector unsigned short a, int b, unsigned short *c) |
| 6610 | { |
| 6611 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6612 | } |
| 6613 | |
| 6614 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6615 | vec_st(vector bool short a, int b, short *c) |
| 6616 | { |
| 6617 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6618 | } |
| 6619 | |
| 6620 | static void __ATTRS_o_ai |
| 6621 | vec_st(vector bool short a, int b, unsigned short *c) |
| 6622 | { |
| 6623 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6624 | } |
| 6625 | |
| 6626 | static void __ATTRS_o_ai |
| 6627 | vec_st(vector bool short a, int b, vector bool short *c) |
| 6628 | { |
| 6629 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6630 | } |
| 6631 | |
| 6632 | static void __ATTRS_o_ai |
| 6633 | vec_st(vector pixel a, int b, short *c) |
| 6634 | { |
| 6635 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6636 | } |
| 6637 | |
| 6638 | static void __ATTRS_o_ai |
| 6639 | vec_st(vector pixel a, int b, unsigned short *c) |
| 6640 | { |
| 6641 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6642 | } |
| 6643 | |
| 6644 | static void __ATTRS_o_ai |
| 6645 | vec_st(vector pixel a, int b, vector pixel *c) |
| 6646 | { |
| 6647 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6648 | } |
| 6649 | |
| 6650 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6651 | vec_st(vector int a, int b, vector int *c) |
| 6652 | { |
| 6653 | __builtin_altivec_stvx(a, b, c); |
| 6654 | } |
| 6655 | |
| 6656 | static void __ATTRS_o_ai |
| 6657 | vec_st(vector int a, int b, int *c) |
| 6658 | { |
| 6659 | __builtin_altivec_stvx(a, b, c); |
| 6660 | } |
| 6661 | |
| 6662 | static void __ATTRS_o_ai |
| 6663 | vec_st(vector unsigned int a, int b, vector unsigned int *c) |
| 6664 | { |
| 6665 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6666 | } |
| 6667 | |
| 6668 | static void __ATTRS_o_ai |
| 6669 | vec_st(vector unsigned int a, int b, unsigned int *c) |
| 6670 | { |
| 6671 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6672 | } |
| 6673 | |
| 6674 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6675 | vec_st(vector bool int a, int b, int *c) |
| 6676 | { |
| 6677 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6678 | } |
| 6679 | |
| 6680 | static void __ATTRS_o_ai |
| 6681 | vec_st(vector bool int a, int b, unsigned int *c) |
| 6682 | { |
| 6683 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6684 | } |
| 6685 | |
| 6686 | static void __ATTRS_o_ai |
| 6687 | vec_st(vector bool int a, int b, vector bool int *c) |
| 6688 | { |
| 6689 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6690 | } |
| 6691 | |
| 6692 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6693 | vec_st(vector float a, int b, vector float *c) |
| 6694 | { |
| 6695 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6696 | } |
| 6697 | |
| 6698 | static void __ATTRS_o_ai |
| 6699 | vec_st(vector float a, int b, float *c) |
| 6700 | { |
| 6701 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6702 | } |
| 6703 | |
| 6704 | /* vec_stvx */ |
| 6705 | |
| 6706 | static void __ATTRS_o_ai |
| 6707 | vec_stvx(vector signed char a, int b, vector signed char *c) |
| 6708 | { |
| 6709 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6710 | } |
| 6711 | |
| 6712 | static void __ATTRS_o_ai |
| 6713 | vec_stvx(vector signed char a, int b, signed char *c) |
| 6714 | { |
| 6715 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6716 | } |
| 6717 | |
| 6718 | static void __ATTRS_o_ai |
| 6719 | vec_stvx(vector unsigned char a, int b, vector unsigned char *c) |
| 6720 | { |
| 6721 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6722 | } |
| 6723 | |
| 6724 | static void __ATTRS_o_ai |
| 6725 | vec_stvx(vector unsigned char a, int b, unsigned char *c) |
| 6726 | { |
| 6727 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6728 | } |
| 6729 | |
| 6730 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6731 | vec_stvx(vector bool char a, int b, signed char *c) |
| 6732 | { |
| 6733 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6734 | } |
| 6735 | |
| 6736 | static void __ATTRS_o_ai |
| 6737 | vec_stvx(vector bool char a, int b, unsigned char *c) |
| 6738 | { |
| 6739 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6740 | } |
| 6741 | |
| 6742 | static void __ATTRS_o_ai |
| 6743 | vec_stvx(vector bool char a, int b, vector bool char *c) |
| 6744 | { |
| 6745 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6746 | } |
| 6747 | |
| 6748 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6749 | vec_stvx(vector short a, int b, vector short *c) |
| 6750 | { |
| 6751 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6752 | } |
| 6753 | |
| 6754 | static void __ATTRS_o_ai |
| 6755 | vec_stvx(vector short a, int b, short *c) |
| 6756 | { |
| 6757 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6758 | } |
| 6759 | |
| 6760 | static void __ATTRS_o_ai |
| 6761 | vec_stvx(vector unsigned short a, int b, vector unsigned short *c) |
| 6762 | { |
| 6763 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6764 | } |
| 6765 | |
| 6766 | static void __ATTRS_o_ai |
| 6767 | vec_stvx(vector unsigned short a, int b, unsigned short *c) |
| 6768 | { |
| 6769 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6770 | } |
| 6771 | |
| 6772 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6773 | vec_stvx(vector bool short a, int b, short *c) |
| 6774 | { |
| 6775 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6776 | } |
| 6777 | |
| 6778 | static void __ATTRS_o_ai |
| 6779 | vec_stvx(vector bool short a, int b, unsigned short *c) |
| 6780 | { |
| 6781 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6782 | } |
| 6783 | |
| 6784 | static void __ATTRS_o_ai |
| 6785 | vec_stvx(vector bool short a, int b, vector bool short *c) |
| 6786 | { |
| 6787 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6788 | } |
| 6789 | |
| 6790 | static void __ATTRS_o_ai |
| 6791 | vec_stvx(vector pixel a, int b, short *c) |
| 6792 | { |
| 6793 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6794 | } |
| 6795 | |
| 6796 | static void __ATTRS_o_ai |
| 6797 | vec_stvx(vector pixel a, int b, unsigned short *c) |
| 6798 | { |
| 6799 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6800 | } |
| 6801 | |
| 6802 | static void __ATTRS_o_ai |
| 6803 | vec_stvx(vector pixel a, int b, vector pixel *c) |
| 6804 | { |
| 6805 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6806 | } |
| 6807 | |
| 6808 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6809 | vec_stvx(vector int a, int b, vector int *c) |
| 6810 | { |
| 6811 | __builtin_altivec_stvx(a, b, c); |
| 6812 | } |
| 6813 | |
| 6814 | static void __ATTRS_o_ai |
| 6815 | vec_stvx(vector int a, int b, int *c) |
| 6816 | { |
| 6817 | __builtin_altivec_stvx(a, b, c); |
| 6818 | } |
| 6819 | |
| 6820 | static void __ATTRS_o_ai |
| 6821 | vec_stvx(vector unsigned int a, int b, vector unsigned int *c) |
| 6822 | { |
| 6823 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6824 | } |
| 6825 | |
| 6826 | static void __ATTRS_o_ai |
| 6827 | vec_stvx(vector unsigned int a, int b, unsigned int *c) |
| 6828 | { |
| 6829 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6830 | } |
| 6831 | |
| 6832 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6833 | vec_stvx(vector bool int a, int b, int *c) |
| 6834 | { |
| 6835 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6836 | } |
| 6837 | |
| 6838 | static void __ATTRS_o_ai |
| 6839 | vec_stvx(vector bool int a, int b, unsigned int *c) |
| 6840 | { |
| 6841 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6842 | } |
| 6843 | |
| 6844 | static void __ATTRS_o_ai |
| 6845 | vec_stvx(vector bool int a, int b, vector bool int *c) |
| 6846 | { |
| 6847 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6848 | } |
| 6849 | |
| 6850 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6851 | vec_stvx(vector float a, int b, vector float *c) |
| 6852 | { |
| 6853 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6854 | } |
| 6855 | |
| 6856 | static void __ATTRS_o_ai |
| 6857 | vec_stvx(vector float a, int b, float *c) |
| 6858 | { |
| 6859 | __builtin_altivec_stvx((vector int)a, b, c); |
| 6860 | } |
| 6861 | |
| 6862 | /* vec_ste */ |
| 6863 | |
| 6864 | static void __ATTRS_o_ai |
| 6865 | vec_ste(vector signed char a, int b, signed char *c) |
| 6866 | { |
| 6867 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6868 | } |
| 6869 | |
| 6870 | static void __ATTRS_o_ai |
| 6871 | vec_ste(vector unsigned char a, int b, unsigned char *c) |
| 6872 | { |
| 6873 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6874 | } |
| 6875 | |
| 6876 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6877 | vec_ste(vector bool char a, int b, signed char *c) |
| 6878 | { |
| 6879 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6880 | } |
| 6881 | |
| 6882 | static void __ATTRS_o_ai |
| 6883 | vec_ste(vector bool char a, int b, unsigned char *c) |
| 6884 | { |
| 6885 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6886 | } |
| 6887 | |
| 6888 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6889 | vec_ste(vector short a, int b, short *c) |
| 6890 | { |
| 6891 | __builtin_altivec_stvehx(a, b, c); |
| 6892 | } |
| 6893 | |
| 6894 | static void __ATTRS_o_ai |
| 6895 | vec_ste(vector unsigned short a, int b, unsigned short *c) |
| 6896 | { |
| 6897 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6898 | } |
| 6899 | |
| 6900 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6901 | vec_ste(vector bool short a, int b, short *c) |
| 6902 | { |
| 6903 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6904 | } |
| 6905 | |
| 6906 | static void __ATTRS_o_ai |
| 6907 | vec_ste(vector bool short a, int b, unsigned short *c) |
| 6908 | { |
| 6909 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6910 | } |
| 6911 | |
| 6912 | static void __ATTRS_o_ai |
| 6913 | vec_ste(vector pixel a, int b, short *c) |
| 6914 | { |
| 6915 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6916 | } |
| 6917 | |
| 6918 | static void __ATTRS_o_ai |
| 6919 | vec_ste(vector pixel a, int b, unsigned short *c) |
| 6920 | { |
| 6921 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6922 | } |
| 6923 | |
| 6924 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6925 | vec_ste(vector int a, int b, int *c) |
| 6926 | { |
| 6927 | __builtin_altivec_stvewx(a, b, c); |
| 6928 | } |
| 6929 | |
| 6930 | static void __ATTRS_o_ai |
| 6931 | vec_ste(vector unsigned int a, int b, unsigned int *c) |
| 6932 | { |
| 6933 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 6934 | } |
| 6935 | |
| 6936 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6937 | vec_ste(vector bool int a, int b, int *c) |
| 6938 | { |
| 6939 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 6940 | } |
| 6941 | |
| 6942 | static void __ATTRS_o_ai |
| 6943 | vec_ste(vector bool int a, int b, unsigned int *c) |
| 6944 | { |
| 6945 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 6946 | } |
| 6947 | |
| 6948 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6949 | vec_ste(vector float a, int b, float *c) |
| 6950 | { |
| 6951 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 6952 | } |
| 6953 | |
| 6954 | /* vec_stvebx */ |
| 6955 | |
| 6956 | static void __ATTRS_o_ai |
| 6957 | vec_stvebx(vector signed char a, int b, signed char *c) |
| 6958 | { |
| 6959 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6960 | } |
| 6961 | |
| 6962 | static void __ATTRS_o_ai |
| 6963 | vec_stvebx(vector unsigned char a, int b, unsigned char *c) |
| 6964 | { |
| 6965 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6966 | } |
| 6967 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6968 | static void __ATTRS_o_ai |
| 6969 | vec_stvebx(vector bool char a, int b, signed char *c) |
| 6970 | { |
| 6971 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6972 | } |
| 6973 | |
| 6974 | static void __ATTRS_o_ai |
| 6975 | vec_stvebx(vector bool char a, int b, unsigned char *c) |
| 6976 | { |
| 6977 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 6978 | } |
| 6979 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 6980 | /* vec_stvehx */ |
| 6981 | |
| 6982 | static void __ATTRS_o_ai |
| 6983 | vec_stvehx(vector short a, int b, short *c) |
| 6984 | { |
| 6985 | __builtin_altivec_stvehx(a, b, c); |
| 6986 | } |
| 6987 | |
| 6988 | static void __ATTRS_o_ai |
| 6989 | vec_stvehx(vector unsigned short a, int b, unsigned short *c) |
| 6990 | { |
| 6991 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6992 | } |
| 6993 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 6994 | static void __ATTRS_o_ai |
| 6995 | vec_stvehx(vector bool short a, int b, short *c) |
| 6996 | { |
| 6997 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 6998 | } |
| 6999 | |
| 7000 | static void __ATTRS_o_ai |
| 7001 | vec_stvehx(vector bool short a, int b, unsigned short *c) |
| 7002 | { |
| 7003 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 7004 | } |
| 7005 | |
| 7006 | static void __ATTRS_o_ai |
| 7007 | vec_stvehx(vector pixel a, int b, short *c) |
| 7008 | { |
| 7009 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 7010 | } |
| 7011 | |
| 7012 | static void __ATTRS_o_ai |
| 7013 | vec_stvehx(vector pixel a, int b, unsigned short *c) |
| 7014 | { |
| 7015 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 7016 | } |
| 7017 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7018 | /* vec_stvewx */ |
| 7019 | |
| 7020 | static void __ATTRS_o_ai |
| 7021 | vec_stvewx(vector int a, int b, int *c) |
| 7022 | { |
| 7023 | __builtin_altivec_stvewx(a, b, c); |
| 7024 | } |
| 7025 | |
| 7026 | static void __ATTRS_o_ai |
| 7027 | vec_stvewx(vector unsigned int a, int b, unsigned int *c) |
| 7028 | { |
| 7029 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 7030 | } |
| 7031 | |
| 7032 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7033 | vec_stvewx(vector bool int a, int b, int *c) |
| 7034 | { |
| 7035 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 7036 | } |
| 7037 | |
| 7038 | static void __ATTRS_o_ai |
| 7039 | vec_stvewx(vector bool int a, int b, unsigned int *c) |
| 7040 | { |
| 7041 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 7042 | } |
| 7043 | |
| 7044 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7045 | vec_stvewx(vector float a, int b, float *c) |
| 7046 | { |
| 7047 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 7048 | } |
| 7049 | |
| 7050 | /* vec_stl */ |
| 7051 | |
| 7052 | static void __ATTRS_o_ai |
| 7053 | vec_stl(vector signed char a, int b, vector signed char *c) |
| 7054 | { |
| 7055 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7056 | } |
| 7057 | |
| 7058 | static void __ATTRS_o_ai |
| 7059 | vec_stl(vector signed char a, int b, signed char *c) |
| 7060 | { |
| 7061 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7062 | } |
| 7063 | |
| 7064 | static void __ATTRS_o_ai |
| 7065 | vec_stl(vector unsigned char a, int b, vector unsigned char *c) |
| 7066 | { |
| 7067 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7068 | } |
| 7069 | |
| 7070 | static void __ATTRS_o_ai |
| 7071 | vec_stl(vector unsigned char a, int b, unsigned char *c) |
| 7072 | { |
| 7073 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7074 | } |
| 7075 | |
| 7076 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7077 | vec_stl(vector bool char a, int b, signed char *c) |
| 7078 | { |
| 7079 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7080 | } |
| 7081 | |
| 7082 | static void __ATTRS_o_ai |
| 7083 | vec_stl(vector bool char a, int b, unsigned char *c) |
| 7084 | { |
| 7085 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7086 | } |
| 7087 | |
| 7088 | static void __ATTRS_o_ai |
| 7089 | vec_stl(vector bool char a, int b, vector bool char *c) |
| 7090 | { |
| 7091 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7092 | } |
| 7093 | |
| 7094 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7095 | vec_stl(vector short a, int b, vector short *c) |
| 7096 | { |
| 7097 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7098 | } |
| 7099 | |
| 7100 | static void __ATTRS_o_ai |
| 7101 | vec_stl(vector short a, int b, short *c) |
| 7102 | { |
| 7103 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7104 | } |
| 7105 | |
| 7106 | static void __ATTRS_o_ai |
| 7107 | vec_stl(vector unsigned short a, int b, vector unsigned short *c) |
| 7108 | { |
| 7109 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7110 | } |
| 7111 | |
| 7112 | static void __ATTRS_o_ai |
| 7113 | vec_stl(vector unsigned short a, int b, unsigned short *c) |
| 7114 | { |
| 7115 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7116 | } |
| 7117 | |
| 7118 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7119 | vec_stl(vector bool short a, int b, short *c) |
| 7120 | { |
| 7121 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7122 | } |
| 7123 | |
| 7124 | static void __ATTRS_o_ai |
| 7125 | vec_stl(vector bool short a, int b, unsigned short *c) |
| 7126 | { |
| 7127 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7128 | } |
| 7129 | |
| 7130 | static void __ATTRS_o_ai |
| 7131 | vec_stl(vector bool short a, int b, vector bool short *c) |
| 7132 | { |
| 7133 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7134 | } |
| 7135 | |
| 7136 | static void __ATTRS_o_ai |
| 7137 | vec_stl(vector pixel a, int b, short *c) |
| 7138 | { |
| 7139 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7140 | } |
| 7141 | |
| 7142 | static void __ATTRS_o_ai |
| 7143 | vec_stl(vector pixel a, int b, unsigned short *c) |
| 7144 | { |
| 7145 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7146 | } |
| 7147 | |
| 7148 | static void __ATTRS_o_ai |
| 7149 | vec_stl(vector pixel a, int b, vector pixel *c) |
| 7150 | { |
| 7151 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7152 | } |
| 7153 | |
| 7154 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7155 | vec_stl(vector int a, int b, vector int *c) |
| 7156 | { |
| 7157 | __builtin_altivec_stvxl(a, b, c); |
| 7158 | } |
| 7159 | |
| 7160 | static void __ATTRS_o_ai |
| 7161 | vec_stl(vector int a, int b, int *c) |
| 7162 | { |
| 7163 | __builtin_altivec_stvxl(a, b, c); |
| 7164 | } |
| 7165 | |
| 7166 | static void __ATTRS_o_ai |
| 7167 | vec_stl(vector unsigned int a, int b, vector unsigned int *c) |
| 7168 | { |
| 7169 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7170 | } |
| 7171 | |
| 7172 | static void __ATTRS_o_ai |
| 7173 | vec_stl(vector unsigned int a, int b, unsigned int *c) |
| 7174 | { |
| 7175 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7176 | } |
| 7177 | |
| 7178 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7179 | vec_stl(vector bool int a, int b, int *c) |
| 7180 | { |
| 7181 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7182 | } |
| 7183 | |
| 7184 | static void __ATTRS_o_ai |
| 7185 | vec_stl(vector bool int a, int b, unsigned int *c) |
| 7186 | { |
| 7187 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7188 | } |
| 7189 | |
| 7190 | static void __ATTRS_o_ai |
| 7191 | vec_stl(vector bool int a, int b, vector bool int *c) |
| 7192 | { |
| 7193 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7194 | } |
| 7195 | |
| 7196 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7197 | vec_stl(vector float a, int b, vector float *c) |
| 7198 | { |
| 7199 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7200 | } |
| 7201 | |
| 7202 | static void __ATTRS_o_ai |
| 7203 | vec_stl(vector float a, int b, float *c) |
| 7204 | { |
| 7205 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7206 | } |
| 7207 | |
| 7208 | /* vec_stvxl */ |
| 7209 | |
| 7210 | static void __ATTRS_o_ai |
| 7211 | vec_stvxl(vector signed char a, int b, vector signed char *c) |
| 7212 | { |
| 7213 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7214 | } |
| 7215 | |
| 7216 | static void __ATTRS_o_ai |
| 7217 | vec_stvxl(vector signed char a, int b, signed char *c) |
| 7218 | { |
| 7219 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7220 | } |
| 7221 | |
| 7222 | static void __ATTRS_o_ai |
| 7223 | vec_stvxl(vector unsigned char a, int b, vector unsigned char *c) |
| 7224 | { |
| 7225 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7226 | } |
| 7227 | |
| 7228 | static void __ATTRS_o_ai |
| 7229 | vec_stvxl(vector unsigned char a, int b, unsigned char *c) |
| 7230 | { |
| 7231 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7232 | } |
| 7233 | |
| 7234 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7235 | vec_stvxl(vector bool char a, int b, signed char *c) |
| 7236 | { |
| 7237 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7238 | } |
| 7239 | |
| 7240 | static void __ATTRS_o_ai |
| 7241 | vec_stvxl(vector bool char a, int b, unsigned char *c) |
| 7242 | { |
| 7243 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7244 | } |
| 7245 | |
| 7246 | static void __ATTRS_o_ai |
| 7247 | vec_stvxl(vector bool char a, int b, vector bool char *c) |
| 7248 | { |
| 7249 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7250 | } |
| 7251 | |
| 7252 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7253 | vec_stvxl(vector short a, int b, vector short *c) |
| 7254 | { |
| 7255 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7256 | } |
| 7257 | |
| 7258 | static void __ATTRS_o_ai |
| 7259 | vec_stvxl(vector short a, int b, short *c) |
| 7260 | { |
| 7261 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7262 | } |
| 7263 | |
| 7264 | static void __ATTRS_o_ai |
| 7265 | vec_stvxl(vector unsigned short a, int b, vector unsigned short *c) |
| 7266 | { |
| 7267 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7268 | } |
| 7269 | |
| 7270 | static void __ATTRS_o_ai |
| 7271 | vec_stvxl(vector unsigned short a, int b, unsigned short *c) |
| 7272 | { |
| 7273 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7274 | } |
| 7275 | |
| 7276 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7277 | vec_stvxl(vector bool short a, int b, short *c) |
| 7278 | { |
| 7279 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7280 | } |
| 7281 | |
| 7282 | static void __ATTRS_o_ai |
| 7283 | vec_stvxl(vector bool short a, int b, unsigned short *c) |
| 7284 | { |
| 7285 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7286 | } |
| 7287 | |
| 7288 | static void __ATTRS_o_ai |
| 7289 | vec_stvxl(vector bool short a, int b, vector bool short *c) |
| 7290 | { |
| 7291 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7292 | } |
| 7293 | |
| 7294 | static void __ATTRS_o_ai |
| 7295 | vec_stvxl(vector pixel a, int b, short *c) |
| 7296 | { |
| 7297 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7298 | } |
| 7299 | |
| 7300 | static void __ATTRS_o_ai |
| 7301 | vec_stvxl(vector pixel a, int b, unsigned short *c) |
| 7302 | { |
| 7303 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7304 | } |
| 7305 | |
| 7306 | static void __ATTRS_o_ai |
| 7307 | vec_stvxl(vector pixel a, int b, vector pixel *c) |
| 7308 | { |
| 7309 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7310 | } |
| 7311 | |
| 7312 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7313 | vec_stvxl(vector int a, int b, vector int *c) |
| 7314 | { |
| 7315 | __builtin_altivec_stvxl(a, b, c); |
| 7316 | } |
| 7317 | |
| 7318 | static void __ATTRS_o_ai |
| 7319 | vec_stvxl(vector int a, int b, int *c) |
| 7320 | { |
| 7321 | __builtin_altivec_stvxl(a, b, c); |
| 7322 | } |
| 7323 | |
| 7324 | static void __ATTRS_o_ai |
| 7325 | vec_stvxl(vector unsigned int a, int b, vector unsigned int *c) |
| 7326 | { |
| 7327 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7328 | } |
| 7329 | |
| 7330 | static void __ATTRS_o_ai |
| 7331 | vec_stvxl(vector unsigned int a, int b, unsigned int *c) |
| 7332 | { |
| 7333 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7334 | } |
| 7335 | |
| 7336 | static void __ATTRS_o_ai |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7337 | vec_stvxl(vector bool int a, int b, int *c) |
| 7338 | { |
| 7339 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7340 | } |
| 7341 | |
| 7342 | static void __ATTRS_o_ai |
| 7343 | vec_stvxl(vector bool int a, int b, unsigned int *c) |
| 7344 | { |
| 7345 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7346 | } |
| 7347 | |
| 7348 | static void __ATTRS_o_ai |
| 7349 | vec_stvxl(vector bool int a, int b, vector bool int *c) |
| 7350 | { |
| 7351 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7352 | } |
| 7353 | |
| 7354 | static void __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7355 | vec_stvxl(vector float a, int b, vector float *c) |
| 7356 | { |
| 7357 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7358 | } |
| 7359 | |
| 7360 | static void __ATTRS_o_ai |
| 7361 | vec_stvxl(vector float a, int b, float *c) |
| 7362 | { |
| 7363 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 7364 | } |
| 7365 | |
| 7366 | /* vec_sub */ |
| 7367 | |
| 7368 | static vector signed char __ATTRS_o_ai |
| 7369 | vec_sub(vector signed char a, vector signed char b) |
| 7370 | { |
| 7371 | return a - b; |
| 7372 | } |
| 7373 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7374 | static vector signed char __ATTRS_o_ai |
| 7375 | vec_sub(vector bool char a, vector signed char b) |
| 7376 | { |
| 7377 | return (vector signed char)a - b; |
| 7378 | } |
| 7379 | |
| 7380 | static vector signed char __ATTRS_o_ai |
| 7381 | vec_sub(vector signed char a, vector bool char b) |
| 7382 | { |
| 7383 | return a - (vector signed char)b; |
| 7384 | } |
| 7385 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7386 | static vector unsigned char __ATTRS_o_ai |
| 7387 | vec_sub(vector unsigned char a, vector unsigned char b) |
| 7388 | { |
| 7389 | return a - b; |
| 7390 | } |
| 7391 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7392 | static vector unsigned char __ATTRS_o_ai |
| 7393 | vec_sub(vector bool char a, vector unsigned char b) |
| 7394 | { |
| 7395 | return (vector unsigned char)a - b; |
| 7396 | } |
| 7397 | |
| 7398 | static vector unsigned char __ATTRS_o_ai |
| 7399 | vec_sub(vector unsigned char a, vector bool char b) |
| 7400 | { |
| 7401 | return a - (vector unsigned char)b; |
| 7402 | } |
| 7403 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7404 | static vector short __ATTRS_o_ai |
| 7405 | vec_sub(vector short a, vector short b) |
| 7406 | { |
| 7407 | return a - b; |
| 7408 | } |
| 7409 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7410 | static vector short __ATTRS_o_ai |
| 7411 | vec_sub(vector bool short a, vector short b) |
| 7412 | { |
| 7413 | return (vector short)a - b; |
| 7414 | } |
| 7415 | |
| 7416 | static vector short __ATTRS_o_ai |
| 7417 | vec_sub(vector short a, vector bool short b) |
| 7418 | { |
| 7419 | return a - (vector short)b; |
| 7420 | } |
| 7421 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7422 | static vector unsigned short __ATTRS_o_ai |
| 7423 | vec_sub(vector unsigned short a, vector unsigned short b) |
| 7424 | { |
| 7425 | return a - b; |
| 7426 | } |
| 7427 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7428 | static vector unsigned short __ATTRS_o_ai |
| 7429 | vec_sub(vector bool short a, vector unsigned short b) |
| 7430 | { |
| 7431 | return (vector unsigned short)a - b; |
| 7432 | } |
| 7433 | |
| 7434 | static vector unsigned short __ATTRS_o_ai |
| 7435 | vec_sub(vector unsigned short a, vector bool short b) |
| 7436 | { |
| 7437 | return a - (vector unsigned short)b; |
| 7438 | } |
| 7439 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7440 | static vector int __ATTRS_o_ai |
| 7441 | vec_sub(vector int a, vector int b) |
| 7442 | { |
| 7443 | return a - b; |
| 7444 | } |
| 7445 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7446 | static vector int __ATTRS_o_ai |
| 7447 | vec_sub(vector bool int a, vector int b) |
| 7448 | { |
| 7449 | return (vector int)a - b; |
| 7450 | } |
| 7451 | |
| 7452 | static vector int __ATTRS_o_ai |
| 7453 | vec_sub(vector int a, vector bool int b) |
| 7454 | { |
| 7455 | return a - (vector int)b; |
| 7456 | } |
| 7457 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7458 | static vector unsigned int __ATTRS_o_ai |
| 7459 | vec_sub(vector unsigned int a, vector unsigned int b) |
| 7460 | { |
| 7461 | return a - b; |
| 7462 | } |
| 7463 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7464 | static vector unsigned int __ATTRS_o_ai |
| 7465 | vec_sub(vector bool int a, vector unsigned int b) |
| 7466 | { |
| 7467 | return (vector unsigned int)a - b; |
| 7468 | } |
| 7469 | |
| 7470 | static vector unsigned int __ATTRS_o_ai |
| 7471 | vec_sub(vector unsigned int a, vector bool int b) |
| 7472 | { |
| 7473 | return a - (vector unsigned int)b; |
| 7474 | } |
| 7475 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7476 | static vector float __ATTRS_o_ai |
| 7477 | vec_sub(vector float a, vector float b) |
| 7478 | { |
| 7479 | return a - b; |
| 7480 | } |
| 7481 | |
| 7482 | /* vec_vsububm */ |
| 7483 | |
| 7484 | #define __builtin_altivec_vsububm vec_vsububm |
| 7485 | |
| 7486 | static vector signed char __ATTRS_o_ai |
| 7487 | vec_vsububm(vector signed char a, vector signed char b) |
| 7488 | { |
| 7489 | return a - b; |
| 7490 | } |
| 7491 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7492 | static vector signed char __ATTRS_o_ai |
| 7493 | vec_vsububm(vector bool char a, vector signed char b) |
| 7494 | { |
| 7495 | return (vector signed char)a - b; |
| 7496 | } |
| 7497 | |
| 7498 | static vector signed char __ATTRS_o_ai |
| 7499 | vec_vsububm(vector signed char a, vector bool char b) |
| 7500 | { |
| 7501 | return a - (vector signed char)b; |
| 7502 | } |
| 7503 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7504 | static vector unsigned char __ATTRS_o_ai |
| 7505 | vec_vsububm(vector unsigned char a, vector unsigned char b) |
| 7506 | { |
| 7507 | return a - b; |
| 7508 | } |
| 7509 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7510 | static vector unsigned char __ATTRS_o_ai |
| 7511 | vec_vsububm(vector bool char a, vector unsigned char b) |
| 7512 | { |
| 7513 | return (vector unsigned char)a - b; |
| 7514 | } |
| 7515 | |
| 7516 | static vector unsigned char __ATTRS_o_ai |
| 7517 | vec_vsububm(vector unsigned char a, vector bool char b) |
| 7518 | { |
| 7519 | return a - (vector unsigned char)b; |
| 7520 | } |
| 7521 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7522 | /* vec_vsubuhm */ |
| 7523 | |
| 7524 | #define __builtin_altivec_vsubuhm vec_vsubuhm |
| 7525 | |
| 7526 | static vector short __ATTRS_o_ai |
| 7527 | vec_vsubuhm(vector short a, vector short b) |
| 7528 | { |
| 7529 | return a - b; |
| 7530 | } |
| 7531 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7532 | static vector short __ATTRS_o_ai |
| 7533 | vec_vsubuhm(vector bool short a, vector short b) |
| 7534 | { |
| 7535 | return (vector short)a - b; |
| 7536 | } |
| 7537 | |
| 7538 | static vector short __ATTRS_o_ai |
| 7539 | vec_vsubuhm(vector short a, vector bool short b) |
| 7540 | { |
| 7541 | return a - (vector short)b; |
| 7542 | } |
| 7543 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7544 | static vector unsigned short __ATTRS_o_ai |
| 7545 | vec_vsubuhm(vector unsigned short a, vector unsigned short b) |
| 7546 | { |
| 7547 | return a - b; |
| 7548 | } |
| 7549 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7550 | static vector unsigned short __ATTRS_o_ai |
| 7551 | vec_vsubuhm(vector bool short a, vector unsigned short b) |
| 7552 | { |
| 7553 | return (vector unsigned short)a - b; |
| 7554 | } |
| 7555 | |
| 7556 | static vector unsigned short __ATTRS_o_ai |
| 7557 | vec_vsubuhm(vector unsigned short a, vector bool short b) |
| 7558 | { |
| 7559 | return a - (vector unsigned short)b; |
| 7560 | } |
| 7561 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7562 | /* vec_vsubuwm */ |
| 7563 | |
| 7564 | #define __builtin_altivec_vsubuwm vec_vsubuwm |
| 7565 | |
| 7566 | static vector int __ATTRS_o_ai |
| 7567 | vec_vsubuwm(vector int a, vector int b) |
| 7568 | { |
| 7569 | return a - b; |
| 7570 | } |
| 7571 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7572 | static vector int __ATTRS_o_ai |
| 7573 | vec_vsubuwm(vector bool int a, vector int b) |
| 7574 | { |
| 7575 | return (vector int)a - b; |
| 7576 | } |
| 7577 | |
| 7578 | static vector int __ATTRS_o_ai |
| 7579 | vec_vsubuwm(vector int a, vector bool int b) |
| 7580 | { |
| 7581 | return a - (vector int)b; |
| 7582 | } |
| 7583 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7584 | static vector unsigned int __ATTRS_o_ai |
| 7585 | vec_vsubuwm(vector unsigned int a, vector unsigned int b) |
| 7586 | { |
| 7587 | return a - b; |
| 7588 | } |
| 7589 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7590 | static vector unsigned int __ATTRS_o_ai |
| 7591 | vec_vsubuwm(vector bool int a, vector unsigned int b) |
| 7592 | { |
| 7593 | return (vector unsigned int)a - b; |
| 7594 | } |
| 7595 | |
| 7596 | static vector unsigned int __ATTRS_o_ai |
| 7597 | vec_vsubuwm(vector unsigned int a, vector bool int b) |
| 7598 | { |
| 7599 | return a - (vector unsigned int)b; |
| 7600 | } |
| 7601 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7602 | /* vec_vsubfp */ |
| 7603 | |
| 7604 | #define __builtin_altivec_vsubfp vec_vsubfp |
| 7605 | |
| 7606 | static vector float __attribute__((__always_inline__)) |
| 7607 | vec_vsubfp(vector float a, vector float b) |
| 7608 | { |
| 7609 | return a - b; |
| 7610 | } |
| 7611 | |
| 7612 | /* vec_subc */ |
| 7613 | |
| 7614 | static vector unsigned int __attribute__((__always_inline__)) |
| 7615 | vec_subc(vector unsigned int a, vector unsigned int b) |
| 7616 | { |
| 7617 | return __builtin_altivec_vsubcuw(a, b); |
| 7618 | } |
| 7619 | |
| 7620 | /* vec_vsubcuw */ |
| 7621 | |
| 7622 | static vector unsigned int __attribute__((__always_inline__)) |
| 7623 | vec_vsubcuw(vector unsigned int a, vector unsigned int b) |
| 7624 | { |
| 7625 | return __builtin_altivec_vsubcuw(a, b); |
| 7626 | } |
| 7627 | |
| 7628 | /* vec_subs */ |
| 7629 | |
| 7630 | static vector signed char __ATTRS_o_ai |
| 7631 | vec_subs(vector signed char a, vector signed char b) |
| 7632 | { |
| 7633 | return __builtin_altivec_vsubsbs(a, b); |
| 7634 | } |
| 7635 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7636 | static vector signed char __ATTRS_o_ai |
| 7637 | vec_subs(vector bool char a, vector signed char b) |
| 7638 | { |
| 7639 | return __builtin_altivec_vsubsbs((vector signed char)a, b); |
| 7640 | } |
| 7641 | |
| 7642 | static vector signed char __ATTRS_o_ai |
| 7643 | vec_subs(vector signed char a, vector bool char b) |
| 7644 | { |
| 7645 | return __builtin_altivec_vsubsbs(a, (vector signed char)b); |
| 7646 | } |
| 7647 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7648 | static vector unsigned char __ATTRS_o_ai |
| 7649 | vec_subs(vector unsigned char a, vector unsigned char b) |
| 7650 | { |
| 7651 | return __builtin_altivec_vsububs(a, b); |
| 7652 | } |
| 7653 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7654 | static vector unsigned char __ATTRS_o_ai |
| 7655 | vec_subs(vector bool char a, vector unsigned char b) |
| 7656 | { |
| 7657 | return __builtin_altivec_vsububs((vector unsigned char)a, b); |
| 7658 | } |
| 7659 | |
| 7660 | static vector unsigned char __ATTRS_o_ai |
| 7661 | vec_subs(vector unsigned char a, vector bool char b) |
| 7662 | { |
| 7663 | return __builtin_altivec_vsububs(a, (vector unsigned char)b); |
| 7664 | } |
| 7665 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7666 | static vector short __ATTRS_o_ai |
| 7667 | vec_subs(vector short a, vector short b) |
| 7668 | { |
| 7669 | return __builtin_altivec_vsubshs(a, b); |
| 7670 | } |
| 7671 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7672 | static vector short __ATTRS_o_ai |
| 7673 | vec_subs(vector bool short a, vector short b) |
| 7674 | { |
| 7675 | return __builtin_altivec_vsubshs((vector short)a, b); |
| 7676 | } |
| 7677 | |
| 7678 | static vector short __ATTRS_o_ai |
| 7679 | vec_subs(vector short a, vector bool short b) |
| 7680 | { |
| 7681 | return __builtin_altivec_vsubshs(a, (vector short)b); |
| 7682 | } |
| 7683 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7684 | static vector unsigned short __ATTRS_o_ai |
| 7685 | vec_subs(vector unsigned short a, vector unsigned short b) |
| 7686 | { |
| 7687 | return __builtin_altivec_vsubuhs(a, b); |
| 7688 | } |
| 7689 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7690 | static vector unsigned short __ATTRS_o_ai |
| 7691 | vec_subs(vector bool short a, vector unsigned short b) |
| 7692 | { |
| 7693 | return __builtin_altivec_vsubuhs((vector unsigned short)a, b); |
| 7694 | } |
| 7695 | |
| 7696 | static vector unsigned short __ATTRS_o_ai |
| 7697 | vec_subs(vector unsigned short a, vector bool short b) |
| 7698 | { |
| 7699 | return __builtin_altivec_vsubuhs(a, (vector unsigned short)b); |
| 7700 | } |
| 7701 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7702 | static vector int __ATTRS_o_ai |
| 7703 | vec_subs(vector int a, vector int b) |
| 7704 | { |
| 7705 | return __builtin_altivec_vsubsws(a, b); |
| 7706 | } |
| 7707 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7708 | static vector int __ATTRS_o_ai |
| 7709 | vec_subs(vector bool int a, vector int b) |
| 7710 | { |
| 7711 | return __builtin_altivec_vsubsws((vector int)a, b); |
| 7712 | } |
| 7713 | |
| 7714 | static vector int __ATTRS_o_ai |
| 7715 | vec_subs(vector int a, vector bool int b) |
| 7716 | { |
| 7717 | return __builtin_altivec_vsubsws(a, (vector int)b); |
| 7718 | } |
| 7719 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7720 | static vector unsigned int __ATTRS_o_ai |
| 7721 | vec_subs(vector unsigned int a, vector unsigned int b) |
| 7722 | { |
| 7723 | return __builtin_altivec_vsubuws(a, b); |
| 7724 | } |
| 7725 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7726 | static vector unsigned int __ATTRS_o_ai |
| 7727 | vec_subs(vector bool int a, vector unsigned int b) |
| 7728 | { |
| 7729 | return __builtin_altivec_vsubuws((vector unsigned int)a, b); |
| 7730 | } |
| 7731 | |
| 7732 | static vector unsigned int __ATTRS_o_ai |
| 7733 | vec_subs(vector unsigned int a, vector bool int b) |
| 7734 | { |
| 7735 | return __builtin_altivec_vsubuws(a, (vector unsigned int)b); |
| 7736 | } |
| 7737 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7738 | /* vec_vsubsbs */ |
| 7739 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7740 | static vector signed char __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7741 | vec_vsubsbs(vector signed char a, vector signed char b) |
| 7742 | { |
| 7743 | return __builtin_altivec_vsubsbs(a, b); |
| 7744 | } |
| 7745 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7746 | static vector signed char __ATTRS_o_ai |
| 7747 | vec_vsubsbs(vector bool char a, vector signed char b) |
| 7748 | { |
| 7749 | return __builtin_altivec_vsubsbs((vector signed char)a, b); |
| 7750 | } |
| 7751 | |
| 7752 | static vector signed char __ATTRS_o_ai |
| 7753 | vec_vsubsbs(vector signed char a, vector bool char b) |
| 7754 | { |
| 7755 | return __builtin_altivec_vsubsbs(a, (vector signed char)b); |
| 7756 | } |
| 7757 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7758 | /* vec_vsububs */ |
| 7759 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7760 | static vector unsigned char __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7761 | vec_vsububs(vector unsigned char a, vector unsigned char b) |
| 7762 | { |
| 7763 | return __builtin_altivec_vsububs(a, b); |
| 7764 | } |
| 7765 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7766 | static vector unsigned char __ATTRS_o_ai |
| 7767 | vec_vsububs(vector bool char a, vector unsigned char b) |
| 7768 | { |
| 7769 | return __builtin_altivec_vsububs((vector unsigned char)a, b); |
| 7770 | } |
| 7771 | |
| 7772 | static vector unsigned char __ATTRS_o_ai |
| 7773 | vec_vsububs(vector unsigned char a, vector bool char b) |
| 7774 | { |
| 7775 | return __builtin_altivec_vsububs(a, (vector unsigned char)b); |
| 7776 | } |
| 7777 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7778 | /* vec_vsubshs */ |
| 7779 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7780 | static vector short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7781 | vec_vsubshs(vector short a, vector short b) |
| 7782 | { |
| 7783 | return __builtin_altivec_vsubshs(a, b); |
| 7784 | } |
| 7785 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7786 | static vector short __ATTRS_o_ai |
| 7787 | vec_vsubshs(vector bool short a, vector short b) |
| 7788 | { |
| 7789 | return __builtin_altivec_vsubshs((vector short)a, b); |
| 7790 | } |
| 7791 | |
| 7792 | static vector short __ATTRS_o_ai |
| 7793 | vec_vsubshs(vector short a, vector bool short b) |
| 7794 | { |
| 7795 | return __builtin_altivec_vsubshs(a, (vector short)b); |
| 7796 | } |
| 7797 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7798 | /* vec_vsubuhs */ |
| 7799 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7800 | static vector unsigned short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7801 | vec_vsubuhs(vector unsigned short a, vector unsigned short b) |
| 7802 | { |
| 7803 | return __builtin_altivec_vsubuhs(a, b); |
| 7804 | } |
| 7805 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7806 | static vector unsigned short __ATTRS_o_ai |
| 7807 | vec_vsubuhs(vector bool short a, vector unsigned short b) |
| 7808 | { |
| 7809 | return __builtin_altivec_vsubuhs((vector unsigned short)a, b); |
| 7810 | } |
| 7811 | |
| 7812 | static vector unsigned short __ATTRS_o_ai |
| 7813 | vec_vsubuhs(vector unsigned short a, vector bool short b) |
| 7814 | { |
| 7815 | return __builtin_altivec_vsubuhs(a, (vector unsigned short)b); |
| 7816 | } |
| 7817 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7818 | /* vec_vsubsws */ |
| 7819 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7820 | static vector int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7821 | vec_vsubsws(vector int a, vector int b) |
| 7822 | { |
| 7823 | return __builtin_altivec_vsubsws(a, b); |
| 7824 | } |
| 7825 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7826 | static vector int __ATTRS_o_ai |
| 7827 | vec_vsubsws(vector bool int a, vector int b) |
| 7828 | { |
| 7829 | return __builtin_altivec_vsubsws((vector int)a, b); |
| 7830 | } |
| 7831 | |
| 7832 | static vector int __ATTRS_o_ai |
| 7833 | vec_vsubsws(vector int a, vector bool int b) |
| 7834 | { |
| 7835 | return __builtin_altivec_vsubsws(a, (vector int)b); |
| 7836 | } |
| 7837 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7838 | /* vec_vsubuws */ |
| 7839 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7840 | static vector unsigned int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7841 | vec_vsubuws(vector unsigned int a, vector unsigned int b) |
| 7842 | { |
| 7843 | return __builtin_altivec_vsubuws(a, b); |
| 7844 | } |
| 7845 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7846 | static vector unsigned int __ATTRS_o_ai |
| 7847 | vec_vsubuws(vector bool int a, vector unsigned int b) |
| 7848 | { |
| 7849 | return __builtin_altivec_vsubuws((vector unsigned int)a, b); |
| 7850 | } |
| 7851 | |
| 7852 | static vector unsigned int __ATTRS_o_ai |
| 7853 | vec_vsubuws(vector unsigned int a, vector bool int b) |
| 7854 | { |
| 7855 | return __builtin_altivec_vsubuws(a, (vector unsigned int)b); |
| 7856 | } |
| 7857 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7858 | /* vec_sum4s */ |
| 7859 | |
| 7860 | static vector int __ATTRS_o_ai |
| 7861 | vec_sum4s(vector signed char a, vector int b) |
| 7862 | { |
| 7863 | return __builtin_altivec_vsum4sbs(a, b); |
| 7864 | } |
| 7865 | |
| 7866 | static vector unsigned int __ATTRS_o_ai |
| 7867 | vec_sum4s(vector unsigned char a, vector unsigned int b) |
| 7868 | { |
| 7869 | return __builtin_altivec_vsum4ubs(a, b); |
| 7870 | } |
| 7871 | |
| 7872 | static vector int __ATTRS_o_ai |
| 7873 | vec_sum4s(vector signed short a, vector int b) |
| 7874 | { |
| 7875 | return __builtin_altivec_vsum4shs(a, b); |
| 7876 | } |
| 7877 | |
| 7878 | /* vec_vsum4sbs */ |
| 7879 | |
| 7880 | static vector int __attribute__((__always_inline__)) |
| 7881 | vec_vsum4sbs(vector signed char a, vector int b) |
| 7882 | { |
| 7883 | return __builtin_altivec_vsum4sbs(a, b); |
| 7884 | } |
| 7885 | |
| 7886 | /* vec_vsum4ubs */ |
| 7887 | |
| 7888 | static vector unsigned int __attribute__((__always_inline__)) |
| 7889 | vec_vsum4ubs(vector unsigned char a, vector unsigned int b) |
| 7890 | { |
| 7891 | return __builtin_altivec_vsum4ubs(a, b); |
| 7892 | } |
| 7893 | |
| 7894 | /* vec_vsum4shs */ |
| 7895 | |
| 7896 | static vector int __attribute__((__always_inline__)) |
| 7897 | vec_vsum4shs(vector signed short a, vector int b) |
| 7898 | { |
| 7899 | return __builtin_altivec_vsum4shs(a, b); |
| 7900 | } |
| 7901 | |
| 7902 | /* vec_sum2s */ |
| 7903 | |
| 7904 | static vector signed int __attribute__((__always_inline__)) |
| 7905 | vec_sum2s(vector int a, vector int b) |
| 7906 | { |
| 7907 | return __builtin_altivec_vsum2sws(a, b); |
| 7908 | } |
| 7909 | |
| 7910 | /* vec_vsum2sws */ |
| 7911 | |
| 7912 | static vector signed int __attribute__((__always_inline__)) |
| 7913 | vec_vsum2sws(vector int a, vector int b) |
| 7914 | { |
| 7915 | return __builtin_altivec_vsum2sws(a, b); |
| 7916 | } |
| 7917 | |
| 7918 | /* vec_sums */ |
| 7919 | |
| 7920 | static vector signed int __attribute__((__always_inline__)) |
| 7921 | vec_sums(vector signed int a, vector signed int b) |
| 7922 | { |
| 7923 | return __builtin_altivec_vsumsws(a, b); |
| 7924 | } |
| 7925 | |
| 7926 | /* vec_vsumsws */ |
| 7927 | |
| 7928 | static vector signed int __attribute__((__always_inline__)) |
| 7929 | vec_vsumsws(vector signed int a, vector signed int b) |
| 7930 | { |
| 7931 | return __builtin_altivec_vsumsws(a, b); |
| 7932 | } |
| 7933 | |
| 7934 | /* vec_trunc */ |
| 7935 | |
| 7936 | static vector float __attribute__((__always_inline__)) |
| 7937 | vec_trunc(vector float a) |
| 7938 | { |
| 7939 | return __builtin_altivec_vrfiz(a); |
| 7940 | } |
| 7941 | |
| 7942 | /* vec_vrfiz */ |
| 7943 | |
| 7944 | static vector float __attribute__((__always_inline__)) |
| 7945 | vec_vrfiz(vector float a) |
| 7946 | { |
| 7947 | return __builtin_altivec_vrfiz(a); |
| 7948 | } |
| 7949 | |
| 7950 | /* vec_unpackh */ |
| 7951 | |
| 7952 | static vector short __ATTRS_o_ai |
| 7953 | vec_unpackh(vector signed char a) |
| 7954 | { |
| 7955 | return __builtin_altivec_vupkhsb((vector char)a); |
| 7956 | } |
| 7957 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7958 | static vector bool short __ATTRS_o_ai |
| 7959 | vec_unpackh(vector bool char a) |
| 7960 | { |
| 7961 | return (vector bool short)__builtin_altivec_vupkhsb((vector char)a); |
| 7962 | } |
| 7963 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7964 | static vector int __ATTRS_o_ai |
| 7965 | vec_unpackh(vector short a) |
| 7966 | { |
| 7967 | return __builtin_altivec_vupkhsh(a); |
| 7968 | } |
| 7969 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7970 | static vector bool int __ATTRS_o_ai |
| 7971 | vec_unpackh(vector bool short a) |
| 7972 | { |
| 7973 | return (vector bool int)__builtin_altivec_vupkhsh((vector short)a); |
| 7974 | } |
| 7975 | |
| 7976 | static vector unsigned int __ATTRS_o_ai |
| 7977 | vec_unpackh(vector pixel a) |
| 7978 | { |
| 7979 | return (vector unsigned int)__builtin_altivec_vupkhsh((vector short)a); |
| 7980 | } |
| 7981 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7982 | /* vec_vupkhsb */ |
| 7983 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7984 | static vector short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7985 | vec_vupkhsb(vector signed char a) |
| 7986 | { |
| 7987 | return __builtin_altivec_vupkhsb((vector char)a); |
| 7988 | } |
| 7989 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7990 | static vector bool short __ATTRS_o_ai |
| 7991 | vec_vupkhsb(vector bool char a) |
| 7992 | { |
| 7993 | return (vector bool short)__builtin_altivec_vupkhsb((vector char)a); |
| 7994 | } |
| 7995 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7996 | /* vec_vupkhsh */ |
| 7997 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 7998 | static vector int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 7999 | vec_vupkhsh(vector short a) |
| 8000 | { |
| 8001 | return __builtin_altivec_vupkhsh(a); |
| 8002 | } |
| 8003 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8004 | static vector bool int __ATTRS_o_ai |
| 8005 | vec_vupkhsh(vector bool short a) |
| 8006 | { |
| 8007 | return (vector bool int)__builtin_altivec_vupkhsh((vector short)a); |
| 8008 | } |
| 8009 | |
| 8010 | static vector unsigned int __ATTRS_o_ai |
| 8011 | vec_vupkhsh(vector pixel a) |
| 8012 | { |
| 8013 | return (vector unsigned int)__builtin_altivec_vupkhsh((vector short)a); |
| 8014 | } |
| 8015 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8016 | /* vec_unpackl */ |
| 8017 | |
| 8018 | static vector short __ATTRS_o_ai |
| 8019 | vec_unpackl(vector signed char a) |
| 8020 | { |
| 8021 | return __builtin_altivec_vupklsb((vector char)a); |
| 8022 | } |
| 8023 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8024 | static vector bool short __ATTRS_o_ai |
| 8025 | vec_unpackl(vector bool char a) |
| 8026 | { |
| 8027 | return (vector bool short)__builtin_altivec_vupklsb((vector char)a); |
| 8028 | } |
| 8029 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8030 | static vector int __ATTRS_o_ai |
| 8031 | vec_unpackl(vector short a) |
| 8032 | { |
| 8033 | return __builtin_altivec_vupklsh(a); |
| 8034 | } |
| 8035 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8036 | static vector bool int __ATTRS_o_ai |
| 8037 | vec_unpackl(vector bool short a) |
| 8038 | { |
| 8039 | return (vector bool int)__builtin_altivec_vupklsh((vector short)a); |
| 8040 | } |
| 8041 | |
| 8042 | static vector unsigned int __ATTRS_o_ai |
| 8043 | vec_unpackl(vector pixel a) |
| 8044 | { |
| 8045 | return (vector unsigned int)__builtin_altivec_vupklsh((vector short)a); |
| 8046 | } |
| 8047 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8048 | /* vec_vupklsb */ |
| 8049 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8050 | static vector short __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8051 | vec_vupklsb(vector signed char a) |
| 8052 | { |
| 8053 | return __builtin_altivec_vupklsb((vector char)a); |
| 8054 | } |
| 8055 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8056 | static vector bool short __ATTRS_o_ai |
| 8057 | vec_vupklsb(vector bool char a) |
| 8058 | { |
| 8059 | return (vector bool short)__builtin_altivec_vupklsb((vector char)a); |
| 8060 | } |
| 8061 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8062 | /* vec_vupklsh */ |
| 8063 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8064 | static vector int __ATTRS_o_ai |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8065 | vec_vupklsh(vector short a) |
| 8066 | { |
| 8067 | return __builtin_altivec_vupklsh(a); |
| 8068 | } |
| 8069 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8070 | static vector bool int __ATTRS_o_ai |
| 8071 | vec_vupklsh(vector bool short a) |
| 8072 | { |
| 8073 | return (vector bool int)__builtin_altivec_vupklsh((vector short)a); |
| 8074 | } |
| 8075 | |
| 8076 | static vector unsigned int __ATTRS_o_ai |
| 8077 | vec_vupklsh(vector pixel a) |
| 8078 | { |
| 8079 | return (vector unsigned int)__builtin_altivec_vupklsh((vector short)a); |
| 8080 | } |
| 8081 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8082 | /* vec_xor */ |
| 8083 | |
| 8084 | #define __builtin_altivec_vxor vec_xor |
| 8085 | |
| 8086 | static vector signed char __ATTRS_o_ai |
| 8087 | vec_xor(vector signed char a, vector signed char b) |
| 8088 | { |
| 8089 | return a ^ b; |
| 8090 | } |
| 8091 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8092 | static vector signed char __ATTRS_o_ai |
| 8093 | vec_xor(vector bool char a, vector signed char b) |
| 8094 | { |
| 8095 | return (vector signed char)a ^ b; |
| 8096 | } |
| 8097 | |
| 8098 | static vector signed char __ATTRS_o_ai |
| 8099 | vec_xor(vector signed char a, vector bool char b) |
| 8100 | { |
| 8101 | return a ^ (vector signed char)b; |
| 8102 | } |
| 8103 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8104 | static vector unsigned char __ATTRS_o_ai |
| 8105 | vec_xor(vector unsigned char a, vector unsigned char b) |
| 8106 | { |
| 8107 | return a ^ b; |
| 8108 | } |
| 8109 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8110 | static vector unsigned char __ATTRS_o_ai |
| 8111 | vec_xor(vector bool char a, vector unsigned char b) |
| 8112 | { |
| 8113 | return (vector unsigned char)a ^ b; |
| 8114 | } |
| 8115 | |
| 8116 | static vector unsigned char __ATTRS_o_ai |
| 8117 | vec_xor(vector unsigned char a, vector bool char b) |
| 8118 | { |
| 8119 | return a ^ (vector unsigned char)b; |
| 8120 | } |
| 8121 | |
| 8122 | static vector bool char __ATTRS_o_ai |
| 8123 | vec_xor(vector bool char a, vector bool char b) |
| 8124 | { |
| 8125 | return a ^ b; |
| 8126 | } |
| 8127 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8128 | static vector short __ATTRS_o_ai |
| 8129 | vec_xor(vector short a, vector short b) |
| 8130 | { |
| 8131 | return a ^ b; |
| 8132 | } |
| 8133 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8134 | static vector short __ATTRS_o_ai |
| 8135 | vec_xor(vector bool short a, vector short b) |
| 8136 | { |
| 8137 | return (vector short)a ^ b; |
| 8138 | } |
| 8139 | |
| 8140 | static vector short __ATTRS_o_ai |
| 8141 | vec_xor(vector short a, vector bool short b) |
| 8142 | { |
| 8143 | return a ^ (vector short)b; |
| 8144 | } |
| 8145 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8146 | static vector unsigned short __ATTRS_o_ai |
| 8147 | vec_xor(vector unsigned short a, vector unsigned short b) |
| 8148 | { |
| 8149 | return a ^ b; |
| 8150 | } |
| 8151 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8152 | static vector unsigned short __ATTRS_o_ai |
| 8153 | vec_xor(vector bool short a, vector unsigned short b) |
| 8154 | { |
| 8155 | return (vector unsigned short)a ^ b; |
| 8156 | } |
| 8157 | |
| 8158 | static vector unsigned short __ATTRS_o_ai |
| 8159 | vec_xor(vector unsigned short a, vector bool short b) |
| 8160 | { |
| 8161 | return a ^ (vector unsigned short)b; |
| 8162 | } |
| 8163 | |
| 8164 | static vector bool short __ATTRS_o_ai |
| 8165 | vec_xor(vector bool short a, vector bool short b) |
| 8166 | { |
| 8167 | return a ^ b; |
| 8168 | } |
| 8169 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8170 | static vector int __ATTRS_o_ai |
| 8171 | vec_xor(vector int a, vector int b) |
| 8172 | { |
| 8173 | return a ^ b; |
| 8174 | } |
| 8175 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8176 | static vector int __ATTRS_o_ai |
| 8177 | vec_xor(vector bool int a, vector int b) |
| 8178 | { |
| 8179 | return (vector int)a ^ b; |
| 8180 | } |
| 8181 | |
| 8182 | static vector int __ATTRS_o_ai |
| 8183 | vec_xor(vector int a, vector bool int b) |
| 8184 | { |
| 8185 | return a ^ (vector int)b; |
| 8186 | } |
| 8187 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8188 | static vector unsigned int __ATTRS_o_ai |
| 8189 | vec_xor(vector unsigned int a, vector unsigned int b) |
| 8190 | { |
| 8191 | return a ^ b; |
| 8192 | } |
| 8193 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8194 | static vector unsigned int __ATTRS_o_ai |
| 8195 | vec_xor(vector bool int a, vector unsigned int b) |
| 8196 | { |
| 8197 | return (vector unsigned int)a ^ b; |
| 8198 | } |
| 8199 | |
| 8200 | static vector unsigned int __ATTRS_o_ai |
| 8201 | vec_xor(vector unsigned int a, vector bool int b) |
| 8202 | { |
| 8203 | return a ^ (vector unsigned int)b; |
| 8204 | } |
| 8205 | |
| 8206 | static vector bool int __ATTRS_o_ai |
| 8207 | vec_xor(vector bool int a, vector bool int b) |
| 8208 | { |
| 8209 | return a ^ b; |
| 8210 | } |
| 8211 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8212 | static vector float __ATTRS_o_ai |
| 8213 | vec_xor(vector float a, vector float b) |
| 8214 | { |
| 8215 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 8216 | return (vector float)res; |
| 8217 | } |
| 8218 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8219 | static vector float __ATTRS_o_ai |
| 8220 | vec_xor(vector bool int a, vector float b) |
| 8221 | { |
| 8222 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 8223 | return (vector float)res; |
| 8224 | } |
| 8225 | |
| 8226 | static vector float __ATTRS_o_ai |
| 8227 | vec_xor(vector float a, vector bool int b) |
| 8228 | { |
| 8229 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 8230 | return (vector float)res; |
| 8231 | } |
| 8232 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8233 | /* vec_vxor */ |
| 8234 | |
| 8235 | static vector signed char __ATTRS_o_ai |
| 8236 | vec_vxor(vector signed char a, vector signed char b) |
| 8237 | { |
| 8238 | return a ^ b; |
| 8239 | } |
| 8240 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8241 | static vector signed char __ATTRS_o_ai |
| 8242 | vec_vxor(vector bool char a, vector signed char b) |
| 8243 | { |
| 8244 | return (vector signed char)a ^ b; |
| 8245 | } |
| 8246 | |
| 8247 | static vector signed char __ATTRS_o_ai |
| 8248 | vec_vxor(vector signed char a, vector bool char b) |
| 8249 | { |
| 8250 | return a ^ (vector signed char)b; |
| 8251 | } |
| 8252 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8253 | static vector unsigned char __ATTRS_o_ai |
| 8254 | vec_vxor(vector unsigned char a, vector unsigned char b) |
| 8255 | { |
| 8256 | return a ^ b; |
| 8257 | } |
| 8258 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8259 | static vector unsigned char __ATTRS_o_ai |
| 8260 | vec_vxor(vector bool char a, vector unsigned char b) |
| 8261 | { |
| 8262 | return (vector unsigned char)a ^ b; |
| 8263 | } |
| 8264 | |
| 8265 | static vector unsigned char __ATTRS_o_ai |
| 8266 | vec_vxor(vector unsigned char a, vector bool char b) |
| 8267 | { |
| 8268 | return a ^ (vector unsigned char)b; |
| 8269 | } |
| 8270 | |
| 8271 | static vector bool char __ATTRS_o_ai |
| 8272 | vec_vxor(vector bool char a, vector bool char b) |
| 8273 | { |
| 8274 | return a ^ b; |
| 8275 | } |
| 8276 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8277 | static vector short __ATTRS_o_ai |
| 8278 | vec_vxor(vector short a, vector short b) |
| 8279 | { |
| 8280 | return a ^ b; |
| 8281 | } |
| 8282 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8283 | static vector short __ATTRS_o_ai |
| 8284 | vec_vxor(vector bool short a, vector short b) |
| 8285 | { |
| 8286 | return (vector short)a ^ b; |
| 8287 | } |
| 8288 | |
| 8289 | static vector short __ATTRS_o_ai |
| 8290 | vec_vxor(vector short a, vector bool short b) |
| 8291 | { |
| 8292 | return a ^ (vector short)b; |
| 8293 | } |
| 8294 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8295 | static vector unsigned short __ATTRS_o_ai |
| 8296 | vec_vxor(vector unsigned short a, vector unsigned short b) |
| 8297 | { |
| 8298 | return a ^ b; |
| 8299 | } |
| 8300 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8301 | static vector unsigned short __ATTRS_o_ai |
| 8302 | vec_vxor(vector bool short a, vector unsigned short b) |
| 8303 | { |
| 8304 | return (vector unsigned short)a ^ b; |
| 8305 | } |
| 8306 | |
| 8307 | static vector unsigned short __ATTRS_o_ai |
| 8308 | vec_vxor(vector unsigned short a, vector bool short b) |
| 8309 | { |
| 8310 | return a ^ (vector unsigned short)b; |
| 8311 | } |
| 8312 | |
| 8313 | static vector bool short __ATTRS_o_ai |
| 8314 | vec_vxor(vector bool short a, vector bool short b) |
| 8315 | { |
| 8316 | return a ^ b; |
| 8317 | } |
| 8318 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8319 | static vector int __ATTRS_o_ai |
| 8320 | vec_vxor(vector int a, vector int b) |
| 8321 | { |
| 8322 | return a ^ b; |
| 8323 | } |
| 8324 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8325 | static vector int __ATTRS_o_ai |
| 8326 | vec_vxor(vector bool int a, vector int b) |
| 8327 | { |
| 8328 | return (vector int)a ^ b; |
| 8329 | } |
| 8330 | |
| 8331 | static vector int __ATTRS_o_ai |
| 8332 | vec_vxor(vector int a, vector bool int b) |
| 8333 | { |
| 8334 | return a ^ (vector int)b; |
| 8335 | } |
| 8336 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8337 | static vector unsigned int __ATTRS_o_ai |
| 8338 | vec_vxor(vector unsigned int a, vector unsigned int b) |
| 8339 | { |
| 8340 | return a ^ b; |
| 8341 | } |
| 8342 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8343 | static vector unsigned int __ATTRS_o_ai |
| 8344 | vec_vxor(vector bool int a, vector unsigned int b) |
| 8345 | { |
| 8346 | return (vector unsigned int)a ^ b; |
| 8347 | } |
| 8348 | |
| 8349 | static vector unsigned int __ATTRS_o_ai |
| 8350 | vec_vxor(vector unsigned int a, vector bool int b) |
| 8351 | { |
| 8352 | return a ^ (vector unsigned int)b; |
| 8353 | } |
| 8354 | |
| 8355 | static vector bool int __ATTRS_o_ai |
| 8356 | vec_vxor(vector bool int a, vector bool int b) |
| 8357 | { |
| 8358 | return a ^ b; |
| 8359 | } |
| 8360 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8361 | static vector float __ATTRS_o_ai |
| 8362 | vec_vxor(vector float a, vector float b) |
| 8363 | { |
| 8364 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 8365 | return (vector float)res; |
| 8366 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8367 | |
Anton Yartsev | a2fc0f5 | 2010-08-19 03:21:36 +0000 | [diff] [blame] | 8368 | static vector float __ATTRS_o_ai |
| 8369 | vec_vxor(vector bool int a, vector float b) |
| 8370 | { |
| 8371 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 8372 | return (vector float)res; |
| 8373 | } |
| 8374 | |
| 8375 | static vector float __ATTRS_o_ai |
| 8376 | vec_vxor(vector float a, vector bool int b) |
| 8377 | { |
| 8378 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 8379 | return (vector float)res; |
| 8380 | } |
| 8381 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8382 | /* ------------------------------ predicates ------------------------------------ */ |
| 8383 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8384 | /* vec_all_eq */ |
| 8385 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8386 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8387 | vec_all_eq(vector signed char a, vector signed char b) |
| 8388 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 8389 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8390 | } |
| 8391 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8392 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8393 | vec_all_eq(vector signed char a, vector bool char b) |
| 8394 | { |
| 8395 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
| 8396 | } |
| 8397 | |
| 8398 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8399 | vec_all_eq(vector unsigned char a, vector unsigned char b) |
| 8400 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 8401 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8402 | } |
| 8403 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8404 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8405 | vec_all_eq(vector unsigned char a, vector bool char b) |
| 8406 | { |
| 8407 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
| 8408 | } |
| 8409 | |
| 8410 | static int __ATTRS_o_ai |
| 8411 | vec_all_eq(vector bool char a, vector signed char b) |
| 8412 | { |
| 8413 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
| 8414 | } |
| 8415 | |
| 8416 | static int __ATTRS_o_ai |
| 8417 | vec_all_eq(vector bool char a, vector unsigned char b) |
| 8418 | { |
| 8419 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
| 8420 | } |
| 8421 | |
| 8422 | static int __ATTRS_o_ai |
| 8423 | vec_all_eq(vector bool char a, vector bool char b) |
| 8424 | { |
| 8425 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
| 8426 | } |
| 8427 | |
| 8428 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8429 | vec_all_eq(vector short a, vector short b) |
| 8430 | { |
| 8431 | return __builtin_altivec_vcmpequh_p(__CR6_LT, a, b); |
| 8432 | } |
| 8433 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8434 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8435 | vec_all_eq(vector short a, vector bool short b) |
| 8436 | { |
| 8437 | return __builtin_altivec_vcmpequh_p(__CR6_LT, a, (vector short)b); |
| 8438 | } |
| 8439 | |
| 8440 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8441 | vec_all_eq(vector unsigned short a, vector unsigned short b) |
| 8442 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 8443 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8444 | } |
| 8445 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8446 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8447 | vec_all_eq(vector unsigned short a, vector bool short b) |
| 8448 | { |
| 8449 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
| 8450 | } |
| 8451 | |
| 8452 | static int __ATTRS_o_ai |
| 8453 | vec_all_eq(vector bool short a, vector short b) |
| 8454 | { |
| 8455 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
| 8456 | } |
| 8457 | |
| 8458 | static int __ATTRS_o_ai |
| 8459 | vec_all_eq(vector bool short a, vector unsigned short b) |
| 8460 | { |
| 8461 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
| 8462 | } |
| 8463 | |
| 8464 | static int __ATTRS_o_ai |
| 8465 | vec_all_eq(vector bool short a, vector bool short b) |
| 8466 | { |
| 8467 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
| 8468 | } |
| 8469 | |
| 8470 | static int __ATTRS_o_ai |
| 8471 | vec_all_eq(vector pixel a, vector pixel b) |
| 8472 | { |
| 8473 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
| 8474 | } |
| 8475 | |
| 8476 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8477 | vec_all_eq(vector int a, vector int b) |
| 8478 | { |
| 8479 | return __builtin_altivec_vcmpequw_p(__CR6_LT, a, b); |
| 8480 | } |
| 8481 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8482 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8483 | vec_all_eq(vector int a, vector bool int b) |
| 8484 | { |
| 8485 | return __builtin_altivec_vcmpequw_p(__CR6_LT, a, (vector int)b); |
| 8486 | } |
| 8487 | |
| 8488 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8489 | vec_all_eq(vector unsigned int a, vector unsigned int b) |
| 8490 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 8491 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8492 | } |
| 8493 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8494 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8495 | vec_all_eq(vector unsigned int a, vector bool int b) |
| 8496 | { |
| 8497 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)a, (vector int)b); |
| 8498 | } |
| 8499 | |
| 8500 | static int __ATTRS_o_ai |
| 8501 | vec_all_eq(vector bool int a, vector int b) |
| 8502 | { |
| 8503 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)a, (vector int)b); |
| 8504 | } |
| 8505 | |
| 8506 | static int __ATTRS_o_ai |
| 8507 | vec_all_eq(vector bool int a, vector unsigned int b) |
| 8508 | { |
| 8509 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)a, (vector int)b); |
| 8510 | } |
| 8511 | |
| 8512 | static int __ATTRS_o_ai |
| 8513 | vec_all_eq(vector bool int a, vector bool int b) |
| 8514 | { |
| 8515 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)a, (vector int)b); |
| 8516 | } |
| 8517 | |
| 8518 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8519 | vec_all_eq(vector float a, vector float b) |
| 8520 | { |
| 8521 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, a, b); |
| 8522 | } |
| 8523 | |
| 8524 | /* vec_all_ge */ |
| 8525 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8526 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8527 | vec_all_ge(vector signed char a, vector signed char b) |
| 8528 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8529 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8530 | } |
| 8531 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8532 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8533 | vec_all_ge(vector signed char a, vector bool char b) |
| 8534 | { |
| 8535 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)b, a); |
| 8536 | } |
| 8537 | |
| 8538 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8539 | vec_all_ge(vector unsigned char a, vector unsigned char b) |
| 8540 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8541 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8542 | } |
| 8543 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8544 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8545 | vec_all_ge(vector unsigned char a, vector bool char b) |
| 8546 | { |
| 8547 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)b, a); |
| 8548 | } |
| 8549 | |
| 8550 | static int __ATTRS_o_ai |
| 8551 | vec_all_ge(vector bool char a, vector signed char b) |
| 8552 | { |
| 8553 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)b, |
| 8554 | (vector unsigned char)a); |
| 8555 | } |
| 8556 | |
| 8557 | static int __ATTRS_o_ai |
| 8558 | vec_all_ge(vector bool char a, vector unsigned char b) |
| 8559 | { |
| 8560 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, b, (vector unsigned char)a); |
| 8561 | } |
| 8562 | |
| 8563 | static int __ATTRS_o_ai |
| 8564 | vec_all_ge(vector bool char a, vector bool char b) |
| 8565 | { |
| 8566 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)b, |
| 8567 | (vector unsigned char)a); |
| 8568 | } |
| 8569 | |
| 8570 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8571 | vec_all_ge(vector short a, vector short b) |
| 8572 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8573 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8574 | } |
| 8575 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8576 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8577 | vec_all_ge(vector short a, vector bool short b) |
| 8578 | { |
| 8579 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)b, a); |
| 8580 | } |
| 8581 | |
| 8582 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8583 | vec_all_ge(vector unsigned short a, vector unsigned short b) |
| 8584 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8585 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8586 | } |
| 8587 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8588 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8589 | vec_all_ge(vector unsigned short a, vector bool short b) |
| 8590 | { |
| 8591 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)b, a); |
| 8592 | } |
| 8593 | |
| 8594 | static int __ATTRS_o_ai |
| 8595 | vec_all_ge(vector bool short a, vector short b) |
| 8596 | { |
| 8597 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)b, |
| 8598 | (vector unsigned short)a); |
| 8599 | } |
| 8600 | |
| 8601 | static int __ATTRS_o_ai |
| 8602 | vec_all_ge(vector bool short a, vector unsigned short b) |
| 8603 | { |
| 8604 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, b, (vector unsigned short)a); |
| 8605 | } |
| 8606 | |
| 8607 | static int __ATTRS_o_ai |
| 8608 | vec_all_ge(vector bool short a, vector bool short b) |
| 8609 | { |
| 8610 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)b, |
| 8611 | (vector unsigned short)a); |
| 8612 | } |
| 8613 | |
| 8614 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8615 | vec_all_ge(vector int a, vector int b) |
| 8616 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8617 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8618 | } |
| 8619 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8620 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8621 | vec_all_ge(vector int a, vector bool int b) |
| 8622 | { |
| 8623 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)b, a); |
| 8624 | } |
| 8625 | |
| 8626 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8627 | vec_all_ge(vector unsigned int a, vector unsigned int b) |
| 8628 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8629 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8630 | } |
| 8631 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8632 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8633 | vec_all_ge(vector unsigned int a, vector bool int b) |
| 8634 | { |
| 8635 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)b, a); |
| 8636 | } |
| 8637 | |
| 8638 | static int __ATTRS_o_ai |
| 8639 | vec_all_ge(vector bool int a, vector int b) |
| 8640 | { |
| 8641 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)b, |
| 8642 | (vector unsigned int)a); |
| 8643 | } |
| 8644 | |
| 8645 | static int __ATTRS_o_ai |
| 8646 | vec_all_ge(vector bool int a, vector unsigned int b) |
| 8647 | { |
| 8648 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, b, (vector unsigned int)a); |
| 8649 | } |
| 8650 | |
| 8651 | static int __ATTRS_o_ai |
| 8652 | vec_all_ge(vector bool int a, vector bool int b) |
| 8653 | { |
| 8654 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)b, |
| 8655 | (vector unsigned int)a); |
| 8656 | } |
| 8657 | |
| 8658 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8659 | vec_all_ge(vector float a, vector float b) |
| 8660 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8661 | return __builtin_altivec_vcmpgefp_p(__CR6_LT, a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8662 | } |
| 8663 | |
| 8664 | /* vec_all_gt */ |
| 8665 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8666 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8667 | vec_all_gt(vector signed char a, vector signed char b) |
| 8668 | { |
| 8669 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, a, b); |
| 8670 | } |
| 8671 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8672 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8673 | vec_all_gt(vector signed char a, vector bool char b) |
| 8674 | { |
| 8675 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, a, (vector signed char)b); |
| 8676 | } |
| 8677 | |
| 8678 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8679 | vec_all_gt(vector unsigned char a, vector unsigned char b) |
| 8680 | { |
| 8681 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, a, b); |
| 8682 | } |
| 8683 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8684 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8685 | vec_all_gt(vector unsigned char a, vector bool char b) |
| 8686 | { |
| 8687 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, a, (vector unsigned char)b); |
| 8688 | } |
| 8689 | |
| 8690 | static int __ATTRS_o_ai |
| 8691 | vec_all_gt(vector bool char a, vector signed char b) |
| 8692 | { |
| 8693 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)a, |
| 8694 | (vector unsigned char)b); |
| 8695 | } |
| 8696 | |
| 8697 | static int __ATTRS_o_ai |
| 8698 | vec_all_gt(vector bool char a, vector unsigned char b) |
| 8699 | { |
| 8700 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)a, b); |
| 8701 | } |
| 8702 | |
| 8703 | static int __ATTRS_o_ai |
| 8704 | vec_all_gt(vector bool char a, vector bool char b) |
| 8705 | { |
| 8706 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)a, |
| 8707 | (vector unsigned char)b); |
| 8708 | } |
| 8709 | |
| 8710 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8711 | vec_all_gt(vector short a, vector short b) |
| 8712 | { |
| 8713 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, a, b); |
| 8714 | } |
| 8715 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8716 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8717 | vec_all_gt(vector short a, vector bool short b) |
| 8718 | { |
| 8719 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, a, (vector short)b); |
| 8720 | } |
| 8721 | |
| 8722 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8723 | vec_all_gt(vector unsigned short a, vector unsigned short b) |
| 8724 | { |
| 8725 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, a, b); |
| 8726 | } |
| 8727 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8728 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8729 | vec_all_gt(vector unsigned short a, vector bool short b) |
| 8730 | { |
| 8731 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, a, (vector unsigned short)b); |
| 8732 | } |
| 8733 | |
| 8734 | static int __ATTRS_o_ai |
| 8735 | vec_all_gt(vector bool short a, vector short b) |
| 8736 | { |
| 8737 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)a, |
| 8738 | (vector unsigned short)b); |
| 8739 | } |
| 8740 | |
| 8741 | static int __ATTRS_o_ai |
| 8742 | vec_all_gt(vector bool short a, vector unsigned short b) |
| 8743 | { |
| 8744 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)a, b); |
| 8745 | } |
| 8746 | |
| 8747 | static int __ATTRS_o_ai |
| 8748 | vec_all_gt(vector bool short a, vector bool short b) |
| 8749 | { |
| 8750 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)a, |
| 8751 | (vector unsigned short)b); |
| 8752 | } |
| 8753 | |
| 8754 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8755 | vec_all_gt(vector int a, vector int b) |
| 8756 | { |
| 8757 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, a, b); |
| 8758 | } |
| 8759 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8760 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8761 | vec_all_gt(vector int a, vector bool int b) |
| 8762 | { |
| 8763 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, a, (vector int)b); |
| 8764 | } |
| 8765 | |
| 8766 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8767 | vec_all_gt(vector unsigned int a, vector unsigned int b) |
| 8768 | { |
| 8769 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, a, b); |
| 8770 | } |
| 8771 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8772 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8773 | vec_all_gt(vector unsigned int a, vector bool int b) |
| 8774 | { |
| 8775 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, a, (vector unsigned int)b); |
| 8776 | } |
| 8777 | |
| 8778 | static int __ATTRS_o_ai |
| 8779 | vec_all_gt(vector bool int a, vector int b) |
| 8780 | { |
| 8781 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)a, |
| 8782 | (vector unsigned int)b); |
| 8783 | } |
| 8784 | |
| 8785 | static int __ATTRS_o_ai |
| 8786 | vec_all_gt(vector bool int a, vector unsigned int b) |
| 8787 | { |
| 8788 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)a, b); |
| 8789 | } |
| 8790 | |
| 8791 | static int __ATTRS_o_ai |
| 8792 | vec_all_gt(vector bool int a, vector bool int b) |
| 8793 | { |
| 8794 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)a, |
| 8795 | (vector unsigned int)b); |
| 8796 | } |
| 8797 | |
| 8798 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8799 | vec_all_gt(vector float a, vector float b) |
| 8800 | { |
| 8801 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, a, b); |
| 8802 | } |
| 8803 | |
| 8804 | /* vec_all_in */ |
| 8805 | |
| 8806 | static int __attribute__((__always_inline__)) |
| 8807 | vec_all_in(vector float a, vector float b) |
| 8808 | { |
| 8809 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ, a, b); |
| 8810 | } |
| 8811 | |
| 8812 | /* vec_all_le */ |
| 8813 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8814 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8815 | vec_all_le(vector signed char a, vector signed char b) |
| 8816 | { |
| 8817 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, a, b); |
| 8818 | } |
| 8819 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8820 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8821 | vec_all_le(vector signed char a, vector bool char b) |
| 8822 | { |
| 8823 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, a, (vector signed char)b); |
| 8824 | } |
| 8825 | |
| 8826 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8827 | vec_all_le(vector unsigned char a, vector unsigned char b) |
| 8828 | { |
| 8829 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, a, b); |
| 8830 | } |
| 8831 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8832 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8833 | vec_all_le(vector unsigned char a, vector bool char b) |
| 8834 | { |
| 8835 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, a, (vector unsigned char)b); |
| 8836 | } |
| 8837 | |
| 8838 | static int __ATTRS_o_ai |
| 8839 | vec_all_le(vector bool char a, vector signed char b) |
| 8840 | { |
| 8841 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)a, |
| 8842 | (vector unsigned char)b); |
| 8843 | } |
| 8844 | |
| 8845 | static int __ATTRS_o_ai |
| 8846 | vec_all_le(vector bool char a, vector unsigned char b) |
| 8847 | { |
| 8848 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)a, b); |
| 8849 | } |
| 8850 | |
| 8851 | static int __ATTRS_o_ai |
| 8852 | vec_all_le(vector bool char a, vector bool char b) |
| 8853 | { |
| 8854 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)a, |
| 8855 | (vector unsigned char)b); |
| 8856 | } |
| 8857 | |
| 8858 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8859 | vec_all_le(vector short a, vector short b) |
| 8860 | { |
| 8861 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, a, b); |
| 8862 | } |
| 8863 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8864 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8865 | vec_all_le(vector short a, vector bool short b) |
| 8866 | { |
| 8867 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, a, (vector short)b); |
| 8868 | } |
| 8869 | |
| 8870 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8871 | vec_all_le(vector unsigned short a, vector unsigned short b) |
| 8872 | { |
| 8873 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, a, b); |
| 8874 | } |
| 8875 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8876 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8877 | vec_all_le(vector unsigned short a, vector bool short b) |
| 8878 | { |
| 8879 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, a, (vector unsigned short)b); |
| 8880 | } |
| 8881 | |
| 8882 | static int __ATTRS_o_ai |
| 8883 | vec_all_le(vector bool short a, vector short b) |
| 8884 | { |
| 8885 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)a, |
| 8886 | (vector unsigned short)b); |
| 8887 | } |
| 8888 | |
| 8889 | static int __ATTRS_o_ai |
| 8890 | vec_all_le(vector bool short a, vector unsigned short b) |
| 8891 | { |
| 8892 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)a, b); |
| 8893 | } |
| 8894 | |
| 8895 | static int __ATTRS_o_ai |
| 8896 | vec_all_le(vector bool short a, vector bool short b) |
| 8897 | { |
| 8898 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)a, |
| 8899 | (vector unsigned short)b); |
| 8900 | } |
| 8901 | |
| 8902 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8903 | vec_all_le(vector int a, vector int b) |
| 8904 | { |
| 8905 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, a, b); |
| 8906 | } |
| 8907 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8908 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8909 | vec_all_le(vector int a, vector bool int b) |
| 8910 | { |
| 8911 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, a, (vector int)b); |
| 8912 | } |
| 8913 | |
| 8914 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8915 | vec_all_le(vector unsigned int a, vector unsigned int b) |
| 8916 | { |
| 8917 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, a, b); |
| 8918 | } |
| 8919 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8920 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8921 | vec_all_le(vector unsigned int a, vector bool int b) |
| 8922 | { |
| 8923 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, a, (vector unsigned int)b); |
| 8924 | } |
| 8925 | |
| 8926 | static int __ATTRS_o_ai |
| 8927 | vec_all_le(vector bool int a, vector int b) |
| 8928 | { |
| 8929 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)a, |
| 8930 | (vector unsigned int)b); |
| 8931 | } |
| 8932 | |
| 8933 | static int __ATTRS_o_ai |
| 8934 | vec_all_le(vector bool int a, vector unsigned int b) |
| 8935 | { |
| 8936 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)a, b); |
| 8937 | } |
| 8938 | |
| 8939 | static int __ATTRS_o_ai |
| 8940 | vec_all_le(vector bool int a, vector bool int b) |
| 8941 | { |
| 8942 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)a, |
| 8943 | (vector unsigned int)b); |
| 8944 | } |
| 8945 | |
| 8946 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8947 | vec_all_le(vector float a, vector float b) |
| 8948 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8949 | return __builtin_altivec_vcmpgefp_p(__CR6_LT, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8950 | } |
| 8951 | |
| 8952 | /* vec_all_lt */ |
| 8953 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8954 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8955 | vec_all_lt(vector signed char a, vector signed char b) |
| 8956 | { |
| 8957 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, b, a); |
| 8958 | } |
| 8959 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8960 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8961 | vec_all_lt(vector signed char a, vector bool char b) |
| 8962 | { |
| 8963 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)b, a); |
| 8964 | } |
| 8965 | |
| 8966 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8967 | vec_all_lt(vector unsigned char a, vector unsigned char b) |
| 8968 | { |
| 8969 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, b, a); |
| 8970 | } |
| 8971 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 8972 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 8973 | vec_all_lt(vector unsigned char a, vector bool char b) |
| 8974 | { |
| 8975 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)b, a); |
| 8976 | } |
| 8977 | |
| 8978 | static int __ATTRS_o_ai |
| 8979 | vec_all_lt(vector bool char a, vector signed char b) |
| 8980 | { |
| 8981 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)b, |
| 8982 | (vector unsigned char)a); |
| 8983 | } |
| 8984 | |
| 8985 | static int __ATTRS_o_ai |
| 8986 | vec_all_lt(vector bool char a, vector unsigned char b) |
| 8987 | { |
| 8988 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, b, (vector unsigned char)a); |
| 8989 | } |
| 8990 | |
| 8991 | static int __ATTRS_o_ai |
| 8992 | vec_all_lt(vector bool char a, vector bool char b) |
| 8993 | { |
| 8994 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)b, |
| 8995 | (vector unsigned char)a); |
| 8996 | } |
| 8997 | |
| 8998 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 8999 | vec_all_lt(vector short a, vector short b) |
| 9000 | { |
| 9001 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, b, a); |
| 9002 | } |
| 9003 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9004 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9005 | vec_all_lt(vector short a, vector bool short b) |
| 9006 | { |
| 9007 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)b, a); |
| 9008 | } |
| 9009 | |
| 9010 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9011 | vec_all_lt(vector unsigned short a, vector unsigned short b) |
| 9012 | { |
| 9013 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, b, a); |
| 9014 | } |
| 9015 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9016 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9017 | vec_all_lt(vector unsigned short a, vector bool short b) |
| 9018 | { |
| 9019 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)b, a); |
| 9020 | } |
| 9021 | |
| 9022 | static int __ATTRS_o_ai |
| 9023 | vec_all_lt(vector bool short a, vector short b) |
| 9024 | { |
| 9025 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)b, |
| 9026 | (vector unsigned short)a); |
| 9027 | } |
| 9028 | |
| 9029 | static int __ATTRS_o_ai |
| 9030 | vec_all_lt(vector bool short a, vector unsigned short b) |
| 9031 | { |
| 9032 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, b, (vector unsigned short)a); |
| 9033 | } |
| 9034 | |
| 9035 | static int __ATTRS_o_ai |
| 9036 | vec_all_lt(vector bool short a, vector bool short b) |
| 9037 | { |
| 9038 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)b, |
| 9039 | (vector unsigned short)a); |
| 9040 | } |
| 9041 | |
| 9042 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9043 | vec_all_lt(vector int a, vector int b) |
| 9044 | { |
| 9045 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, b, a); |
| 9046 | } |
| 9047 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9048 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9049 | vec_all_lt(vector int a, vector bool int b) |
| 9050 | { |
| 9051 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)b, a); |
| 9052 | } |
| 9053 | |
| 9054 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9055 | vec_all_lt(vector unsigned int a, vector unsigned int b) |
| 9056 | { |
| 9057 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, b, a); |
| 9058 | } |
| 9059 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9060 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9061 | vec_all_lt(vector unsigned int a, vector bool int b) |
| 9062 | { |
| 9063 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)b, a); |
| 9064 | } |
| 9065 | |
| 9066 | static int __ATTRS_o_ai |
| 9067 | vec_all_lt(vector bool int a, vector int b) |
| 9068 | { |
| 9069 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)b, |
| 9070 | (vector unsigned int)a); |
| 9071 | } |
| 9072 | |
| 9073 | static int __ATTRS_o_ai |
| 9074 | vec_all_lt(vector bool int a, vector unsigned int b) |
| 9075 | { |
| 9076 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, b, (vector unsigned int)a); |
| 9077 | } |
| 9078 | |
| 9079 | static int __ATTRS_o_ai |
| 9080 | vec_all_lt(vector bool int a, vector bool int b) |
| 9081 | { |
| 9082 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)b, |
| 9083 | (vector unsigned int)a); |
| 9084 | } |
| 9085 | |
| 9086 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9087 | vec_all_lt(vector float a, vector float b) |
| 9088 | { |
| 9089 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, b, a); |
| 9090 | } |
| 9091 | |
| 9092 | /* vec_all_nan */ |
| 9093 | |
| 9094 | static int __attribute__((__always_inline__)) |
| 9095 | vec_all_nan(vector float a) |
| 9096 | { |
| 9097 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, a, a); |
| 9098 | } |
| 9099 | |
| 9100 | /* vec_all_ne */ |
| 9101 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9102 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9103 | vec_all_ne(vector signed char a, vector signed char b) |
| 9104 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9105 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9106 | } |
| 9107 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9108 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9109 | vec_all_ne(vector signed char a, vector bool char b) |
| 9110 | { |
| 9111 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
| 9112 | } |
| 9113 | |
| 9114 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9115 | vec_all_ne(vector unsigned char a, vector unsigned char b) |
| 9116 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9117 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9118 | } |
| 9119 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9120 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9121 | vec_all_ne(vector unsigned char a, vector bool char b) |
| 9122 | { |
| 9123 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
| 9124 | } |
| 9125 | |
| 9126 | static int __ATTRS_o_ai |
| 9127 | vec_all_ne(vector bool char a, vector signed char b) |
| 9128 | { |
| 9129 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
| 9130 | } |
| 9131 | |
| 9132 | static int __ATTRS_o_ai |
| 9133 | vec_all_ne(vector bool char a, vector unsigned char b) |
| 9134 | { |
| 9135 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
| 9136 | } |
| 9137 | |
| 9138 | static int __ATTRS_o_ai |
| 9139 | vec_all_ne(vector bool char a, vector bool char b) |
| 9140 | { |
| 9141 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
| 9142 | } |
| 9143 | |
| 9144 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9145 | vec_all_ne(vector short a, vector short b) |
| 9146 | { |
| 9147 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, a, b); |
| 9148 | } |
| 9149 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9150 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9151 | vec_all_ne(vector short a, vector bool short b) |
| 9152 | { |
| 9153 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, a, (vector short)b); |
| 9154 | } |
| 9155 | |
| 9156 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9157 | vec_all_ne(vector unsigned short a, vector unsigned short b) |
| 9158 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9159 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9160 | } |
| 9161 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9162 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9163 | vec_all_ne(vector unsigned short a, vector bool short b) |
| 9164 | { |
| 9165 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
| 9166 | } |
| 9167 | |
| 9168 | static int __ATTRS_o_ai |
| 9169 | vec_all_ne(vector bool short a, vector short b) |
| 9170 | { |
| 9171 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
| 9172 | } |
| 9173 | |
| 9174 | static int __ATTRS_o_ai |
| 9175 | vec_all_ne(vector bool short a, vector unsigned short b) |
| 9176 | { |
| 9177 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
| 9178 | } |
| 9179 | |
| 9180 | static int __ATTRS_o_ai |
| 9181 | vec_all_ne(vector bool short a, vector bool short b) |
| 9182 | { |
| 9183 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
| 9184 | } |
| 9185 | |
| 9186 | static int __ATTRS_o_ai |
| 9187 | vec_all_ne(vector pixel a, vector pixel b) |
| 9188 | { |
| 9189 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
| 9190 | } |
| 9191 | |
| 9192 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9193 | vec_all_ne(vector int a, vector int b) |
| 9194 | { |
| 9195 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, a, b); |
| 9196 | } |
| 9197 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9198 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9199 | vec_all_ne(vector int a, vector bool int b) |
| 9200 | { |
| 9201 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, a, (vector int)b); |
| 9202 | } |
| 9203 | |
| 9204 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9205 | vec_all_ne(vector unsigned int a, vector unsigned int b) |
| 9206 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9207 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9208 | } |
| 9209 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9210 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9211 | vec_all_ne(vector unsigned int a, vector bool int b) |
| 9212 | { |
| 9213 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)a, (vector int)b); |
| 9214 | } |
| 9215 | |
| 9216 | static int __ATTRS_o_ai |
| 9217 | vec_all_ne(vector bool int a, vector int b) |
| 9218 | { |
| 9219 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)a, (vector int)b); |
| 9220 | } |
| 9221 | |
| 9222 | static int __ATTRS_o_ai |
| 9223 | vec_all_ne(vector bool int a, vector unsigned int b) |
| 9224 | { |
| 9225 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)a, (vector int)b); |
| 9226 | } |
| 9227 | |
| 9228 | static int __ATTRS_o_ai |
| 9229 | vec_all_ne(vector bool int a, vector bool int b) |
| 9230 | { |
| 9231 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)a, (vector int)b); |
| 9232 | } |
| 9233 | |
| 9234 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9235 | vec_all_ne(vector float a, vector float b) |
| 9236 | { |
| 9237 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, a, b); |
| 9238 | } |
| 9239 | |
| 9240 | /* vec_all_nge */ |
| 9241 | |
| 9242 | static int __attribute__((__always_inline__)) |
| 9243 | vec_all_nge(vector float a, vector float b) |
| 9244 | { |
| 9245 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, a, b); |
| 9246 | } |
| 9247 | |
| 9248 | /* vec_all_ngt */ |
| 9249 | |
| 9250 | static int __attribute__((__always_inline__)) |
| 9251 | vec_all_ngt(vector float a, vector float b) |
| 9252 | { |
| 9253 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, a, b); |
| 9254 | } |
| 9255 | |
| 9256 | /* vec_all_nle */ |
| 9257 | |
| 9258 | static int __attribute__((__always_inline__)) |
| 9259 | vec_all_nle(vector float a, vector float b) |
| 9260 | { |
| 9261 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, b, a); |
| 9262 | } |
| 9263 | |
| 9264 | /* vec_all_nlt */ |
| 9265 | |
| 9266 | static int __attribute__((__always_inline__)) |
| 9267 | vec_all_nlt(vector float a, vector float b) |
| 9268 | { |
| 9269 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, b, a); |
| 9270 | } |
| 9271 | |
| 9272 | /* vec_all_numeric */ |
| 9273 | |
| 9274 | static int __attribute__((__always_inline__)) |
| 9275 | vec_all_numeric(vector float a) |
| 9276 | { |
| 9277 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, a, a); |
| 9278 | } |
| 9279 | |
| 9280 | /* vec_any_eq */ |
| 9281 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9282 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9283 | vec_any_eq(vector signed char a, vector signed char b) |
| 9284 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9285 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9286 | } |
| 9287 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9288 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9289 | vec_any_eq(vector signed char a, vector bool char b) |
| 9290 | { |
| 9291 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
| 9292 | } |
| 9293 | |
| 9294 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9295 | vec_any_eq(vector unsigned char a, vector unsigned char b) |
| 9296 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9297 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9298 | } |
| 9299 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9300 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9301 | vec_any_eq(vector unsigned char a, vector bool char b) |
| 9302 | { |
| 9303 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
| 9304 | } |
| 9305 | |
| 9306 | static int __ATTRS_o_ai |
| 9307 | vec_any_eq(vector bool char a, vector signed char b) |
| 9308 | { |
| 9309 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
| 9310 | } |
| 9311 | |
| 9312 | static int __ATTRS_o_ai |
| 9313 | vec_any_eq(vector bool char a, vector unsigned char b) |
| 9314 | { |
| 9315 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
| 9316 | } |
| 9317 | |
| 9318 | static int __ATTRS_o_ai |
| 9319 | vec_any_eq(vector bool char a, vector bool char b) |
| 9320 | { |
| 9321 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
| 9322 | } |
| 9323 | |
| 9324 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9325 | vec_any_eq(vector short a, vector short b) |
| 9326 | { |
| 9327 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, a, b); |
| 9328 | } |
| 9329 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9330 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9331 | vec_any_eq(vector short a, vector bool short b) |
| 9332 | { |
| 9333 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, a, (vector short)b); |
| 9334 | } |
| 9335 | |
| 9336 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9337 | vec_any_eq(vector unsigned short a, vector unsigned short b) |
| 9338 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9339 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9340 | } |
| 9341 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9342 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9343 | vec_any_eq(vector unsigned short a, vector bool short b) |
| 9344 | { |
| 9345 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
| 9346 | } |
| 9347 | |
| 9348 | static int __ATTRS_o_ai |
| 9349 | vec_any_eq(vector bool short a, vector short b) |
| 9350 | { |
| 9351 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
| 9352 | } |
| 9353 | |
| 9354 | static int __ATTRS_o_ai |
| 9355 | vec_any_eq(vector bool short a, vector unsigned short b) |
| 9356 | { |
| 9357 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
| 9358 | } |
| 9359 | |
| 9360 | static int __ATTRS_o_ai |
| 9361 | vec_any_eq(vector bool short a, vector bool short b) |
| 9362 | { |
| 9363 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
| 9364 | } |
| 9365 | |
| 9366 | static int __ATTRS_o_ai |
| 9367 | vec_any_eq(vector pixel a, vector pixel b) |
| 9368 | { |
| 9369 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
| 9370 | } |
| 9371 | |
| 9372 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9373 | vec_any_eq(vector int a, vector int b) |
| 9374 | { |
| 9375 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, a, b); |
| 9376 | } |
| 9377 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9378 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9379 | vec_any_eq(vector int a, vector bool int b) |
| 9380 | { |
| 9381 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, a, (vector int)b); |
| 9382 | } |
| 9383 | |
| 9384 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9385 | vec_any_eq(vector unsigned int a, vector unsigned int b) |
| 9386 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 9387 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9388 | } |
| 9389 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9390 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9391 | vec_any_eq(vector unsigned int a, vector bool int b) |
| 9392 | { |
| 9393 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)a, (vector int)b); |
| 9394 | } |
| 9395 | |
| 9396 | static int __ATTRS_o_ai |
| 9397 | vec_any_eq(vector bool int a, vector int b) |
| 9398 | { |
| 9399 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)a, (vector int)b); |
| 9400 | } |
| 9401 | |
| 9402 | static int __ATTRS_o_ai |
| 9403 | vec_any_eq(vector bool int a, vector unsigned int b) |
| 9404 | { |
| 9405 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)a, (vector int)b); |
| 9406 | } |
| 9407 | |
| 9408 | static int __ATTRS_o_ai |
| 9409 | vec_any_eq(vector bool int a, vector bool int b) |
| 9410 | { |
| 9411 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)a, (vector int)b); |
| 9412 | } |
| 9413 | |
| 9414 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9415 | vec_any_eq(vector float a, vector float b) |
| 9416 | { |
| 9417 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, a, b); |
| 9418 | } |
| 9419 | |
| 9420 | /* vec_any_ge */ |
| 9421 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9422 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9423 | vec_any_ge(vector signed char a, vector signed char b) |
| 9424 | { |
| 9425 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, b, a); |
| 9426 | } |
| 9427 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9428 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9429 | vec_any_ge(vector signed char a, vector bool char b) |
| 9430 | { |
| 9431 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)b, a); |
| 9432 | } |
| 9433 | |
| 9434 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9435 | vec_any_ge(vector unsigned char a, vector unsigned char b) |
| 9436 | { |
| 9437 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, b, a); |
| 9438 | } |
| 9439 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9440 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9441 | vec_any_ge(vector unsigned char a, vector bool char b) |
| 9442 | { |
| 9443 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)b, a); |
| 9444 | } |
| 9445 | |
| 9446 | static int __ATTRS_o_ai |
| 9447 | vec_any_ge(vector bool char a, vector signed char b) |
| 9448 | { |
| 9449 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)b, |
| 9450 | (vector unsigned char)a); |
| 9451 | } |
| 9452 | |
| 9453 | static int __ATTRS_o_ai |
| 9454 | vec_any_ge(vector bool char a, vector unsigned char b) |
| 9455 | { |
| 9456 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, b, (vector unsigned char)a); |
| 9457 | } |
| 9458 | |
| 9459 | static int __ATTRS_o_ai |
| 9460 | vec_any_ge(vector bool char a, vector bool char b) |
| 9461 | { |
| 9462 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)b, |
| 9463 | (vector unsigned char)a); |
| 9464 | } |
| 9465 | |
| 9466 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9467 | vec_any_ge(vector short a, vector short b) |
| 9468 | { |
| 9469 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, b, a); |
| 9470 | } |
| 9471 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9472 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9473 | vec_any_ge(vector short a, vector bool short b) |
| 9474 | { |
| 9475 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)b, a); |
| 9476 | } |
| 9477 | |
| 9478 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9479 | vec_any_ge(vector unsigned short a, vector unsigned short b) |
| 9480 | { |
| 9481 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, b, a); |
| 9482 | } |
| 9483 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9484 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9485 | vec_any_ge(vector unsigned short a, vector bool short b) |
| 9486 | { |
| 9487 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)b, a); |
| 9488 | } |
| 9489 | |
| 9490 | static int __ATTRS_o_ai |
| 9491 | vec_any_ge(vector bool short a, vector short b) |
| 9492 | { |
| 9493 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)b, |
| 9494 | (vector unsigned short)a); |
| 9495 | } |
| 9496 | |
| 9497 | static int __ATTRS_o_ai |
| 9498 | vec_any_ge(vector bool short a, vector unsigned short b) |
| 9499 | { |
| 9500 | return |
| 9501 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, b, (vector unsigned short)a); |
| 9502 | } |
| 9503 | |
| 9504 | static int __ATTRS_o_ai |
| 9505 | vec_any_ge(vector bool short a, vector bool short b) |
| 9506 | { |
| 9507 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)b, |
| 9508 | (vector unsigned short)a); |
| 9509 | } |
| 9510 | |
| 9511 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9512 | vec_any_ge(vector int a, vector int b) |
| 9513 | { |
| 9514 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, b, a); |
| 9515 | } |
| 9516 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9517 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9518 | vec_any_ge(vector int a, vector bool int b) |
| 9519 | { |
| 9520 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)b, a); |
| 9521 | } |
| 9522 | |
| 9523 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9524 | vec_any_ge(vector unsigned int a, vector unsigned int b) |
| 9525 | { |
| 9526 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, b, a); |
| 9527 | } |
| 9528 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9529 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9530 | vec_any_ge(vector unsigned int a, vector bool int b) |
| 9531 | { |
| 9532 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)b, a); |
| 9533 | } |
| 9534 | |
| 9535 | static int __ATTRS_o_ai |
| 9536 | vec_any_ge(vector bool int a, vector int b) |
| 9537 | { |
| 9538 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)b, |
| 9539 | (vector unsigned int)a); |
| 9540 | } |
| 9541 | |
| 9542 | static int __ATTRS_o_ai |
| 9543 | vec_any_ge(vector bool int a, vector unsigned int b) |
| 9544 | { |
| 9545 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, b, (vector unsigned int)a); |
| 9546 | } |
| 9547 | |
| 9548 | static int __ATTRS_o_ai |
| 9549 | vec_any_ge(vector bool int a, vector bool int b) |
| 9550 | { |
| 9551 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)b, |
| 9552 | (vector unsigned int)a); |
| 9553 | } |
| 9554 | |
| 9555 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9556 | vec_any_ge(vector float a, vector float b) |
| 9557 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9558 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9559 | } |
| 9560 | |
| 9561 | /* vec_any_gt */ |
| 9562 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9563 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9564 | vec_any_gt(vector signed char a, vector signed char b) |
| 9565 | { |
| 9566 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, a, b); |
| 9567 | } |
| 9568 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9569 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9570 | vec_any_gt(vector signed char a, vector bool char b) |
| 9571 | { |
| 9572 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, a, (vector signed char)b); |
| 9573 | } |
| 9574 | |
| 9575 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9576 | vec_any_gt(vector unsigned char a, vector unsigned char b) |
| 9577 | { |
| 9578 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, a, b); |
| 9579 | } |
| 9580 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9581 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9582 | vec_any_gt(vector unsigned char a, vector bool char b) |
| 9583 | { |
| 9584 | return |
| 9585 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, a, (vector unsigned char)b); |
| 9586 | } |
| 9587 | |
| 9588 | static int __ATTRS_o_ai |
| 9589 | vec_any_gt(vector bool char a, vector signed char b) |
| 9590 | { |
| 9591 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)a, |
| 9592 | (vector unsigned char)b); |
| 9593 | } |
| 9594 | |
| 9595 | static int __ATTRS_o_ai |
| 9596 | vec_any_gt(vector bool char a, vector unsigned char b) |
| 9597 | { |
| 9598 | return |
| 9599 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)a, b); |
| 9600 | } |
| 9601 | |
| 9602 | static int __ATTRS_o_ai |
| 9603 | vec_any_gt(vector bool char a, vector bool char b) |
| 9604 | { |
| 9605 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)a, |
| 9606 | (vector unsigned char)b); |
| 9607 | } |
| 9608 | |
| 9609 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9610 | vec_any_gt(vector short a, vector short b) |
| 9611 | { |
| 9612 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, a, b); |
| 9613 | } |
| 9614 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9615 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9616 | vec_any_gt(vector short a, vector bool short b) |
| 9617 | { |
| 9618 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, a, (vector short)b); |
| 9619 | } |
| 9620 | |
| 9621 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9622 | vec_any_gt(vector unsigned short a, vector unsigned short b) |
| 9623 | { |
| 9624 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, a, b); |
| 9625 | } |
| 9626 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9627 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9628 | vec_any_gt(vector unsigned short a, vector bool short b) |
| 9629 | { |
| 9630 | return |
| 9631 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, a, (vector unsigned short)b); |
| 9632 | } |
| 9633 | |
| 9634 | static int __ATTRS_o_ai |
| 9635 | vec_any_gt(vector bool short a, vector short b) |
| 9636 | { |
| 9637 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)a, |
| 9638 | (vector unsigned short)b); |
| 9639 | } |
| 9640 | |
| 9641 | static int __ATTRS_o_ai |
| 9642 | vec_any_gt(vector bool short a, vector unsigned short b) |
| 9643 | { |
| 9644 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)a, b); |
| 9645 | } |
| 9646 | |
| 9647 | static int __ATTRS_o_ai |
| 9648 | vec_any_gt(vector bool short a, vector bool short b) |
| 9649 | { |
| 9650 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)a, |
| 9651 | (vector unsigned short)b); |
| 9652 | } |
| 9653 | |
| 9654 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9655 | vec_any_gt(vector int a, vector int b) |
| 9656 | { |
| 9657 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, a, b); |
| 9658 | } |
| 9659 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9660 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9661 | vec_any_gt(vector int a, vector bool int b) |
| 9662 | { |
| 9663 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, a, (vector int)b); |
| 9664 | } |
| 9665 | |
| 9666 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9667 | vec_any_gt(vector unsigned int a, vector unsigned int b) |
| 9668 | { |
| 9669 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, a, b); |
| 9670 | } |
| 9671 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9672 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9673 | vec_any_gt(vector unsigned int a, vector bool int b) |
| 9674 | { |
| 9675 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, a, (vector unsigned int)b); |
| 9676 | } |
| 9677 | |
| 9678 | static int __ATTRS_o_ai |
| 9679 | vec_any_gt(vector bool int a, vector int b) |
| 9680 | { |
| 9681 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)a, |
| 9682 | (vector unsigned int)b); |
| 9683 | } |
| 9684 | |
| 9685 | static int __ATTRS_o_ai |
| 9686 | vec_any_gt(vector bool int a, vector unsigned int b) |
| 9687 | { |
| 9688 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)a, b); |
| 9689 | } |
| 9690 | |
| 9691 | static int __ATTRS_o_ai |
| 9692 | vec_any_gt(vector bool int a, vector bool int b) |
| 9693 | { |
| 9694 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)a, |
| 9695 | (vector unsigned int)b); |
| 9696 | } |
| 9697 | |
| 9698 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9699 | vec_any_gt(vector float a, vector float b) |
| 9700 | { |
| 9701 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, a, b); |
| 9702 | } |
| 9703 | |
| 9704 | /* vec_any_le */ |
| 9705 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9706 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9707 | vec_any_le(vector signed char a, vector signed char b) |
| 9708 | { |
| 9709 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, a, b); |
| 9710 | } |
| 9711 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9712 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9713 | vec_any_le(vector signed char a, vector bool char b) |
| 9714 | { |
| 9715 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, a, (vector signed char)b); |
| 9716 | } |
| 9717 | |
| 9718 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9719 | vec_any_le(vector unsigned char a, vector unsigned char b) |
| 9720 | { |
| 9721 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, a, b); |
| 9722 | } |
| 9723 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9724 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9725 | vec_any_le(vector unsigned char a, vector bool char b) |
| 9726 | { |
| 9727 | return |
| 9728 | __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, a, (vector unsigned char)b); |
| 9729 | } |
| 9730 | |
| 9731 | static int __ATTRS_o_ai |
| 9732 | vec_any_le(vector bool char a, vector signed char b) |
| 9733 | { |
| 9734 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)a, |
| 9735 | (vector unsigned char)b); |
| 9736 | } |
| 9737 | |
| 9738 | static int __ATTRS_o_ai |
| 9739 | vec_any_le(vector bool char a, vector unsigned char b) |
| 9740 | { |
| 9741 | return |
| 9742 | __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)a, b); |
| 9743 | } |
| 9744 | |
| 9745 | static int __ATTRS_o_ai |
| 9746 | vec_any_le(vector bool char a, vector bool char b) |
| 9747 | { |
| 9748 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)a, |
| 9749 | (vector unsigned char)b); |
| 9750 | } |
| 9751 | |
| 9752 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9753 | vec_any_le(vector short a, vector short b) |
| 9754 | { |
| 9755 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, a, b); |
| 9756 | } |
| 9757 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9758 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9759 | vec_any_le(vector short a, vector bool short b) |
| 9760 | { |
| 9761 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, a, (vector short)b); |
| 9762 | } |
| 9763 | |
| 9764 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9765 | vec_any_le(vector unsigned short a, vector unsigned short b) |
| 9766 | { |
| 9767 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, a, b); |
| 9768 | } |
| 9769 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9770 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9771 | vec_any_le(vector unsigned short a, vector bool short b) |
| 9772 | { |
| 9773 | return |
| 9774 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, a, (vector unsigned short)b); |
| 9775 | } |
| 9776 | |
| 9777 | static int __ATTRS_o_ai |
| 9778 | vec_any_le(vector bool short a, vector short b) |
| 9779 | { |
| 9780 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)a, |
| 9781 | (vector unsigned short)b); |
| 9782 | } |
| 9783 | |
| 9784 | static int __ATTRS_o_ai |
| 9785 | vec_any_le(vector bool short a, vector unsigned short b) |
| 9786 | { |
| 9787 | return |
| 9788 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)a, b); |
| 9789 | } |
| 9790 | |
| 9791 | static int __ATTRS_o_ai |
| 9792 | vec_any_le(vector bool short a, vector bool short b) |
| 9793 | { |
| 9794 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)a, |
| 9795 | (vector unsigned short)b); |
| 9796 | } |
| 9797 | |
| 9798 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9799 | vec_any_le(vector int a, vector int b) |
| 9800 | { |
| 9801 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, a, b); |
| 9802 | } |
| 9803 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9804 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9805 | vec_any_le(vector int a, vector bool int b) |
| 9806 | { |
| 9807 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, a, (vector int)b); |
| 9808 | } |
| 9809 | |
| 9810 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9811 | vec_any_le(vector unsigned int a, vector unsigned int b) |
| 9812 | { |
| 9813 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, a, b); |
| 9814 | } |
| 9815 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9816 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9817 | vec_any_le(vector unsigned int a, vector bool int b) |
| 9818 | { |
| 9819 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, a, (vector unsigned int)b); |
| 9820 | } |
| 9821 | |
| 9822 | static int __ATTRS_o_ai |
| 9823 | vec_any_le(vector bool int a, vector int b) |
| 9824 | { |
| 9825 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)a, |
| 9826 | (vector unsigned int)b); |
| 9827 | } |
| 9828 | |
| 9829 | static int __ATTRS_o_ai |
| 9830 | vec_any_le(vector bool int a, vector unsigned int b) |
| 9831 | { |
| 9832 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)a, b); |
| 9833 | } |
| 9834 | |
| 9835 | static int __ATTRS_o_ai |
| 9836 | vec_any_le(vector bool int a, vector bool int b) |
| 9837 | { |
| 9838 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)a, |
| 9839 | (vector unsigned int)b); |
| 9840 | } |
| 9841 | |
| 9842 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9843 | vec_any_le(vector float a, vector float b) |
| 9844 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9845 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9846 | } |
| 9847 | |
| 9848 | /* vec_any_lt */ |
| 9849 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9850 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9851 | vec_any_lt(vector signed char a, vector signed char b) |
| 9852 | { |
| 9853 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, b, a); |
| 9854 | } |
| 9855 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9856 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9857 | vec_any_lt(vector signed char a, vector bool char b) |
| 9858 | { |
| 9859 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)b, a); |
| 9860 | } |
| 9861 | |
| 9862 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9863 | vec_any_lt(vector unsigned char a, vector unsigned char b) |
| 9864 | { |
| 9865 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, b, a); |
| 9866 | } |
| 9867 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9868 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9869 | vec_any_lt(vector unsigned char a, vector bool char b) |
| 9870 | { |
| 9871 | return |
| 9872 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)b, a); |
| 9873 | } |
| 9874 | |
| 9875 | static int __ATTRS_o_ai |
| 9876 | vec_any_lt(vector bool char a, vector signed char b) |
| 9877 | { |
| 9878 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)b, |
| 9879 | (vector unsigned char)a); |
| 9880 | } |
| 9881 | |
| 9882 | static int __ATTRS_o_ai |
| 9883 | vec_any_lt(vector bool char a, vector unsigned char b) |
| 9884 | { |
| 9885 | return |
| 9886 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, b, (vector unsigned char)a); |
| 9887 | } |
| 9888 | |
| 9889 | static int __ATTRS_o_ai |
| 9890 | vec_any_lt(vector bool char a, vector bool char b) |
| 9891 | { |
| 9892 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)b, |
| 9893 | (vector unsigned char)a); |
| 9894 | } |
| 9895 | |
| 9896 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9897 | vec_any_lt(vector short a, vector short b) |
| 9898 | { |
| 9899 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, b, a); |
| 9900 | } |
| 9901 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9902 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9903 | vec_any_lt(vector short a, vector bool short b) |
| 9904 | { |
| 9905 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)b, a); |
| 9906 | } |
| 9907 | |
| 9908 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9909 | vec_any_lt(vector unsigned short a, vector unsigned short b) |
| 9910 | { |
| 9911 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, b, a); |
| 9912 | } |
| 9913 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9914 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9915 | vec_any_lt(vector unsigned short a, vector bool short b) |
| 9916 | { |
| 9917 | return |
| 9918 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)b, a); |
| 9919 | } |
| 9920 | |
| 9921 | static int __ATTRS_o_ai |
| 9922 | vec_any_lt(vector bool short a, vector short b) |
| 9923 | { |
| 9924 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)b, |
| 9925 | (vector unsigned short)a); |
| 9926 | } |
| 9927 | |
| 9928 | static int __ATTRS_o_ai |
| 9929 | vec_any_lt(vector bool short a, vector unsigned short b) |
| 9930 | { |
| 9931 | return |
| 9932 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, b, (vector unsigned short)a); |
| 9933 | } |
| 9934 | |
| 9935 | static int __ATTRS_o_ai |
| 9936 | vec_any_lt(vector bool short a, vector bool short b) |
| 9937 | { |
| 9938 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)b, |
| 9939 | (vector unsigned short)a); |
| 9940 | } |
| 9941 | |
| 9942 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9943 | vec_any_lt(vector int a, vector int b) |
| 9944 | { |
| 9945 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, b, a); |
| 9946 | } |
| 9947 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9948 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9949 | vec_any_lt(vector int a, vector bool int b) |
| 9950 | { |
| 9951 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)b, a); |
| 9952 | } |
| 9953 | |
| 9954 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9955 | vec_any_lt(vector unsigned int a, vector unsigned int b) |
| 9956 | { |
| 9957 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, b, a); |
| 9958 | } |
| 9959 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 9960 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 9961 | vec_any_lt(vector unsigned int a, vector bool int b) |
| 9962 | { |
| 9963 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)b, a); |
| 9964 | } |
| 9965 | |
| 9966 | static int __ATTRS_o_ai |
| 9967 | vec_any_lt(vector bool int a, vector int b) |
| 9968 | { |
| 9969 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)b, |
| 9970 | (vector unsigned int)a); |
| 9971 | } |
| 9972 | |
| 9973 | static int __ATTRS_o_ai |
| 9974 | vec_any_lt(vector bool int a, vector unsigned int b) |
| 9975 | { |
| 9976 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, b, (vector unsigned int)a); |
| 9977 | } |
| 9978 | |
| 9979 | static int __ATTRS_o_ai |
| 9980 | vec_any_lt(vector bool int a, vector bool int b) |
| 9981 | { |
| 9982 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)b, |
| 9983 | (vector unsigned int)a); |
| 9984 | } |
| 9985 | |
| 9986 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 9987 | vec_any_lt(vector float a, vector float b) |
| 9988 | { |
| 9989 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, b, a); |
| 9990 | } |
| 9991 | |
| 9992 | /* vec_any_nan */ |
| 9993 | |
| 9994 | static int __attribute__((__always_inline__)) |
| 9995 | vec_any_nan(vector float a) |
| 9996 | { |
| 9997 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, a, a); |
| 9998 | } |
| 9999 | |
| 10000 | /* vec_any_ne */ |
| 10001 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10002 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10003 | vec_any_ne(vector signed char a, vector signed char b) |
| 10004 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 10005 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10006 | } |
| 10007 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10008 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 10009 | vec_any_ne(vector signed char a, vector bool char b) |
| 10010 | { |
| 10011 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
| 10012 | } |
| 10013 | |
| 10014 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10015 | vec_any_ne(vector unsigned char a, vector unsigned char b) |
| 10016 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 10017 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10018 | } |
| 10019 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10020 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 10021 | vec_any_ne(vector unsigned char a, vector bool char b) |
| 10022 | { |
| 10023 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
| 10024 | } |
| 10025 | |
| 10026 | static int __ATTRS_o_ai |
| 10027 | vec_any_ne(vector bool char a, vector signed char b) |
| 10028 | { |
| 10029 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
| 10030 | } |
| 10031 | |
| 10032 | static int __ATTRS_o_ai |
| 10033 | vec_any_ne(vector bool char a, vector unsigned char b) |
| 10034 | { |
| 10035 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
| 10036 | } |
| 10037 | |
| 10038 | static int __ATTRS_o_ai |
| 10039 | vec_any_ne(vector bool char a, vector bool char b) |
| 10040 | { |
| 10041 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
| 10042 | } |
| 10043 | |
| 10044 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10045 | vec_any_ne(vector short a, vector short b) |
| 10046 | { |
| 10047 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, a, b); |
| 10048 | } |
| 10049 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10050 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 10051 | vec_any_ne(vector short a, vector bool short b) |
| 10052 | { |
| 10053 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, a, (vector short)b); |
| 10054 | } |
| 10055 | |
| 10056 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10057 | vec_any_ne(vector unsigned short a, vector unsigned short b) |
| 10058 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 10059 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10060 | } |
| 10061 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10062 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 10063 | vec_any_ne(vector unsigned short a, vector bool short b) |
| 10064 | { |
| 10065 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
| 10066 | } |
| 10067 | |
| 10068 | static int __ATTRS_o_ai |
| 10069 | vec_any_ne(vector bool short a, vector short b) |
| 10070 | { |
| 10071 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
| 10072 | } |
| 10073 | |
| 10074 | static int __ATTRS_o_ai |
| 10075 | vec_any_ne(vector bool short a, vector unsigned short b) |
| 10076 | { |
| 10077 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
| 10078 | } |
| 10079 | |
| 10080 | static int __ATTRS_o_ai |
| 10081 | vec_any_ne(vector bool short a, vector bool short b) |
| 10082 | { |
| 10083 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
| 10084 | } |
| 10085 | |
| 10086 | static int __ATTRS_o_ai |
| 10087 | vec_any_ne(vector pixel a, vector pixel b) |
| 10088 | { |
| 10089 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
| 10090 | } |
| 10091 | |
| 10092 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10093 | vec_any_ne(vector int a, vector int b) |
| 10094 | { |
| 10095 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, a, b); |
| 10096 | } |
| 10097 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10098 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 10099 | vec_any_ne(vector int a, vector bool int b) |
| 10100 | { |
| 10101 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, a, (vector int)b); |
| 10102 | } |
| 10103 | |
| 10104 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10105 | vec_any_ne(vector unsigned int a, vector unsigned int b) |
| 10106 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 10107 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10108 | } |
| 10109 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10110 | static int __ATTRS_o_ai |
Anton Yartsev | a4f235b | 2010-08-19 11:57:49 +0000 | [diff] [blame^] | 10111 | vec_any_ne(vector unsigned int a, vector bool int b) |
| 10112 | { |
| 10113 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)a, (vector int)b); |
| 10114 | } |
| 10115 | |
| 10116 | static int __ATTRS_o_ai |
| 10117 | vec_any_ne(vector bool int a, vector int b) |
| 10118 | { |
| 10119 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)a, (vector int)b); |
| 10120 | } |
| 10121 | |
| 10122 | static int __ATTRS_o_ai |
| 10123 | vec_any_ne(vector bool int a, vector unsigned int b) |
| 10124 | { |
| 10125 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)a, (vector int)b); |
| 10126 | } |
| 10127 | |
| 10128 | static int __ATTRS_o_ai |
| 10129 | vec_any_ne(vector bool int a, vector bool int b) |
| 10130 | { |
| 10131 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)a, (vector int)b); |
| 10132 | } |
| 10133 | |
| 10134 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10135 | vec_any_ne(vector float a, vector float b) |
| 10136 | { |
| 10137 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, a, b); |
| 10138 | } |
| 10139 | |
| 10140 | /* vec_any_nge */ |
| 10141 | |
| 10142 | static int __attribute__((__always_inline__)) |
| 10143 | vec_any_nge(vector float a, vector float b) |
| 10144 | { |
| 10145 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, a, b); |
| 10146 | } |
| 10147 | |
| 10148 | /* vec_any_ngt */ |
| 10149 | |
| 10150 | static int __attribute__((__always_inline__)) |
| 10151 | vec_any_ngt(vector float a, vector float b) |
| 10152 | { |
| 10153 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, a, b); |
| 10154 | } |
| 10155 | |
| 10156 | /* vec_any_nle */ |
| 10157 | |
| 10158 | static int __attribute__((__always_inline__)) |
| 10159 | vec_any_nle(vector float a, vector float b) |
| 10160 | { |
| 10161 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, b, a); |
| 10162 | } |
| 10163 | |
| 10164 | /* vec_any_nlt */ |
| 10165 | |
| 10166 | static int __attribute__((__always_inline__)) |
| 10167 | vec_any_nlt(vector float a, vector float b) |
| 10168 | { |
| 10169 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, b, a); |
| 10170 | } |
| 10171 | |
| 10172 | /* vec_any_numeric */ |
| 10173 | |
| 10174 | static int __attribute__((__always_inline__)) |
| 10175 | vec_any_numeric(vector float a) |
| 10176 | { |
| 10177 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, a, a); |
| 10178 | } |
| 10179 | |
| 10180 | /* vec_any_out */ |
| 10181 | |
| 10182 | static int __attribute__((__always_inline__)) |
| 10183 | vec_any_out(vector float a, vector float b) |
| 10184 | { |
| 10185 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, a, b); |
| 10186 | } |
| 10187 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 10188 | #undef __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 10189 | |
| 10190 | #endif /* __ALTIVEC_H */ |