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 | |
| 23 | #ifndef __ALTIVEC_H |
| 24 | #define __ALTIVEC_H |
| 25 | |
| 26 | #ifndef __ALTIVEC__ |
| 27 | #error "AltiVec support not enabled" |
| 28 | #endif |
| 29 | |
| 30 | /* constants for mapping CR6 bits to predicate result. */ |
| 31 | |
| 32 | #define __CR6_EQ 0 |
| 33 | #define __CR6_EQ_REV 1 |
| 34 | #define __CR6_LT 2 |
| 35 | #define __CR6_LT_REV 3 |
| 36 | |
| 37 | #define _ATTRS_o_ai __attribute__((__overloadable__, __always_inline__)) |
| 38 | |
| 39 | /* vec_abs */ |
| 40 | |
| 41 | #define __builtin_vec_abs vec_abs |
| 42 | #define __builtin_altivec_abs_v16qi vec_abs |
| 43 | #define __builtin_altivec_abs_v8hi vec_abs |
| 44 | #define __builtin_altivec_abs_v4si vec_abs |
| 45 | |
| 46 | static vector signed char _ATTRS_o_ai |
| 47 | vec_abs(vector signed char a) |
| 48 | { |
| 49 | return __builtin_altivec_vmaxsb(a, -a); |
| 50 | } |
| 51 | |
| 52 | static vector signed short _ATTRS_o_ai |
| 53 | vec_abs(vector signed short a) |
| 54 | { |
| 55 | return __builtin_altivec_vmaxsh(a, -a); |
| 56 | } |
| 57 | |
| 58 | static vector signed int _ATTRS_o_ai |
| 59 | vec_abs(vector signed int a) |
| 60 | { |
| 61 | return __builtin_altivec_vmaxsw(a, -a); |
| 62 | } |
| 63 | |
| 64 | static vector float _ATTRS_o_ai |
| 65 | vec_abs(vector float a) |
| 66 | { |
| 67 | return (vector unsigned int)a & |
| 68 | (vector unsigned int)(0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF); |
| 69 | } |
| 70 | |
| 71 | /* vec_abss */ |
| 72 | |
| 73 | #define __builtin_vec_abss vec_abss |
| 74 | #define __builtin_altivec_abss_v16qi vec_abss |
| 75 | #define __builtin_altivec_abss_v8hi vec_abss |
| 76 | #define __builtin_altivec_abss_v4si vec_abss |
| 77 | |
| 78 | static vector signed char _ATTRS_o_ai |
| 79 | vec_abss(vector signed char a) |
| 80 | { |
| 81 | return __builtin_altivec_vmaxsb(a, __builtin_altivec_vsubsbs( |
| 82 | (vector signed char)(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), a)); |
| 83 | } |
| 84 | |
| 85 | static vector signed short _ATTRS_o_ai |
| 86 | vec_abss(vector signed short a) |
| 87 | { |
| 88 | return __builtin_altivec_vmaxsh(a, __builtin_altivec_vsubshs( |
| 89 | (vector signed short)(0, 0, 0, 0, 0, 0, 0, 0), a)); |
| 90 | } |
| 91 | |
| 92 | static vector signed int _ATTRS_o_ai |
| 93 | vec_abss(vector signed int a) |
| 94 | { |
| 95 | return __builtin_altivec_vmaxsw(a, __builtin_altivec_vsubsws( |
| 96 | (vector signed int)(0, 0, 0, 0), a)); |
| 97 | } |
| 98 | |
| 99 | /* vec_add */ |
| 100 | |
| 101 | #define __builtin_altivec_vaddubm vec_add |
| 102 | #define __builtin_altivec_vadduhm vec_add |
| 103 | #define __builtin_altivec_vadduwm vec_add |
| 104 | #define __builtin_altivec_vaddfp vec_add |
| 105 | #define __builtin_vec_vaddubm vec_add |
| 106 | #define __builtin_vec_vadduhm vec_add |
| 107 | #define __builtin_vec_vadduwm vec_add |
| 108 | #define __builtin_vec_vaddfp vec_add |
| 109 | #define vec_vaddubm vec_add |
| 110 | #define vec_vadduhm vec_add |
| 111 | #define vec_vadduwm vec_add |
| 112 | #define vec_vaddfp vec_add |
| 113 | |
| 114 | static vector char _ATTRS_o_ai |
| 115 | vec_add(vector char a, vector char b) |
| 116 | { |
| 117 | return a + b; |
| 118 | } |
| 119 | |
| 120 | static vector signed char _ATTRS_o_ai |
| 121 | vec_add(vector signed char a, vector signed char b) |
| 122 | { |
| 123 | return a + b; |
| 124 | } |
| 125 | |
| 126 | static vector unsigned char _ATTRS_o_ai |
| 127 | vec_add(vector unsigned char a, vector unsigned char b) |
| 128 | { |
| 129 | return a + b; |
| 130 | } |
| 131 | |
| 132 | static vector short _ATTRS_o_ai |
| 133 | vec_add(vector short a, vector short b) |
| 134 | { |
| 135 | return a + b; |
| 136 | } |
| 137 | |
| 138 | static vector unsigned short _ATTRS_o_ai |
| 139 | vec_add(vector unsigned short a, vector unsigned short b) |
| 140 | { |
| 141 | return a + b; |
| 142 | } |
| 143 | |
| 144 | static vector int _ATTRS_o_ai |
| 145 | vec_add(vector int a, vector int b) |
| 146 | { |
| 147 | return a + b; |
| 148 | } |
| 149 | |
| 150 | static vector unsigned int _ATTRS_o_ai |
| 151 | vec_add(vector unsigned int a, vector unsigned int b) |
| 152 | { |
| 153 | return a + b; |
| 154 | } |
| 155 | |
| 156 | static vector float _ATTRS_o_ai |
| 157 | vec_add(vector float a, vector float b) |
| 158 | { |
| 159 | return a + b; |
| 160 | } |
| 161 | |
| 162 | /* vec_addc */ |
| 163 | |
| 164 | #define __builtin_vec_addc __builtin_altivec_vaddcuw |
| 165 | #define vec_vaddcuw __builtin_altivec_vaddcuw |
| 166 | #define vec_addc __builtin_altivec_vaddcuw |
| 167 | |
| 168 | /* vec_adds */ |
| 169 | |
| 170 | #define __builtin_vec_vaddsbs __builtin_altivec_vaddsbs |
| 171 | #define __builtin_vec_vaddubs __builtin_altivec_vaddubs |
| 172 | #define __builtin_vec_vaddshs __builtin_altivec_vaddshs |
| 173 | #define __builtin_vec_vadduhs __builtin_altivec_vadduhs |
| 174 | #define __builtin_vec_vaddsws __builtin_altivec_vaddsws |
| 175 | #define __builtin_vec_vadduws __builtin_altivec_vadduws |
| 176 | #define vec_vaddsbs __builtin_altivec_vaddsbs |
| 177 | #define vec_vaddubs __builtin_altivec_vaddubs |
| 178 | #define vec_vaddshs __builtin_altivec_vaddshs |
| 179 | #define vec_vadduhs __builtin_altivec_vadduhs |
| 180 | #define vec_vaddsws __builtin_altivec_vaddsws |
| 181 | #define vec_vadduws __builtin_altivec_vadduws |
| 182 | |
| 183 | static vector char _ATTRS_o_ai |
| 184 | vec_adds(vector char a, vector char b) |
| 185 | { |
| 186 | return __builtin_altivec_vaddsbs(a, b); |
| 187 | } |
| 188 | |
| 189 | static vector signed char _ATTRS_o_ai |
| 190 | vec_adds(vector signed char a, vector signed char b) |
| 191 | { |
| 192 | return __builtin_altivec_vaddsbs(a, b); |
| 193 | } |
| 194 | |
| 195 | static vector unsigned char _ATTRS_o_ai |
| 196 | vec_adds(vector unsigned char a, vector unsigned char b) |
| 197 | { |
| 198 | return __builtin_altivec_vaddubs(a, b); |
| 199 | } |
| 200 | |
| 201 | static vector short _ATTRS_o_ai |
| 202 | vec_adds(vector short a, vector short b) |
| 203 | { |
| 204 | return __builtin_altivec_vaddshs(a, b); |
| 205 | } |
| 206 | |
| 207 | static vector unsigned short _ATTRS_o_ai |
| 208 | vec_adds(vector unsigned short a, vector unsigned short b) |
| 209 | { |
| 210 | return __builtin_altivec_vadduhs(a, b); |
| 211 | } |
| 212 | |
| 213 | static vector int _ATTRS_o_ai |
| 214 | vec_adds(vector int a, vector int b) |
| 215 | { |
| 216 | return __builtin_altivec_vaddsws(a, b); |
| 217 | } |
| 218 | |
| 219 | static vector unsigned int _ATTRS_o_ai |
| 220 | vec_adds(vector unsigned int a, vector unsigned int b) |
| 221 | { |
| 222 | return __builtin_altivec_vadduws(a, b); |
| 223 | } |
| 224 | |
| 225 | /* vec_sub */ |
| 226 | |
| 227 | #define __builtin_altivec_vsububm vec_sub |
| 228 | #define __builtin_altivec_vsubuhm vec_sub |
| 229 | #define __builtin_altivec_vsubuwm vec_sub |
| 230 | #define __builtin_altivec_vsubfp vec_sub |
| 231 | #define __builtin_vec_vsububm vec_sub |
| 232 | #define __builtin_vec_vsubuhm vec_sub |
| 233 | #define __builtin_vec_vsubuwm vec_sub |
| 234 | #define __builtin_vec_vsubfp vec_sub |
| 235 | #define vec_vsububm vec_sub |
| 236 | #define vec_vsubuhm vec_sub |
| 237 | #define vec_vsubuwm vec_sub |
| 238 | #define vec_vsubfp vec_sub |
| 239 | |
| 240 | static vector char _ATTRS_o_ai |
| 241 | vec_sub(vector char a, vector char b) |
| 242 | { |
| 243 | return a - b; |
| 244 | } |
| 245 | |
| 246 | static vector signed char _ATTRS_o_ai |
| 247 | vec_sub(vector signed char a, vector signed char b) |
| 248 | { |
| 249 | return a - b; |
| 250 | } |
| 251 | |
| 252 | static vector unsigned char _ATTRS_o_ai |
| 253 | vec_sub(vector unsigned char a, vector unsigned char b) |
| 254 | { |
| 255 | return a - b; |
| 256 | } |
| 257 | |
| 258 | static vector short _ATTRS_o_ai |
| 259 | vec_sub(vector short a, vector short b) |
| 260 | { |
| 261 | return a - b; |
| 262 | } |
| 263 | |
| 264 | static vector unsigned short _ATTRS_o_ai |
| 265 | vec_sub(vector unsigned short a, vector unsigned short b) |
| 266 | { |
| 267 | return a - b; |
| 268 | } |
| 269 | |
| 270 | static vector int _ATTRS_o_ai |
| 271 | vec_sub(vector int a, vector int b) |
| 272 | { |
| 273 | return a - b; |
| 274 | } |
| 275 | |
| 276 | static vector unsigned int _ATTRS_o_ai |
| 277 | vec_sub(vector unsigned int a, vector unsigned int b) |
| 278 | { |
| 279 | return a - b; |
| 280 | } |
| 281 | |
| 282 | static vector float _ATTRS_o_ai |
| 283 | vec_sub(vector float a, vector float b) |
| 284 | { |
| 285 | return a - b; |
| 286 | } |
| 287 | |
| 288 | /* vec_subs */ |
| 289 | |
| 290 | #define __builtin_vec_vsubsbs __builtin_altivec_vsubsbs |
| 291 | #define __builtin_vec_vsububs __builtin_altivec_vsububs |
| 292 | #define __builtin_vec_vsubshs __builtin_altivec_vsubshs |
| 293 | #define __builtin_vec_vsubuhs __builtin_altivec_vsubuhs |
| 294 | #define __builtin_vec_vsubsws __builtin_altivec_vsubsws |
| 295 | #define __builtin_vec_vsubuws __builtin_altivec_vsubuws |
| 296 | #define vec_vsubsbs __builtin_altivec_vsubsbs |
| 297 | #define vec_vsububs __builtin_altivec_vsububs |
| 298 | #define vec_vsubshs __builtin_altivec_vsubshs |
| 299 | #define vec_vsubuhs __builtin_altivec_vsubuhs |
| 300 | #define vec_vsubsws __builtin_altivec_vsubsws |
| 301 | #define vec_vsubuws __builtin_altivec_vsubuws |
| 302 | |
| 303 | static vector char _ATTRS_o_ai |
| 304 | vec_subs(vector char a, vector char b) |
| 305 | { |
| 306 | return __builtin_altivec_vsubsbs(a, b); |
| 307 | } |
| 308 | |
| 309 | static vector signed char _ATTRS_o_ai |
| 310 | vec_subs(vector signed char a, vector signed char b) |
| 311 | { |
| 312 | return __builtin_altivec_vsubsbs(a, b); |
| 313 | } |
| 314 | |
| 315 | static vector unsigned char _ATTRS_o_ai |
| 316 | vec_subs(vector unsigned char a, vector unsigned char b) |
| 317 | { |
| 318 | return __builtin_altivec_vsububs(a, b); |
| 319 | } |
| 320 | |
| 321 | static vector short _ATTRS_o_ai |
| 322 | vec_subs(vector short a, vector short b) |
| 323 | { |
| 324 | return __builtin_altivec_vsubshs(a, b); |
| 325 | } |
| 326 | |
| 327 | static vector unsigned short _ATTRS_o_ai |
| 328 | vec_subs(vector unsigned short a, vector unsigned short b) |
| 329 | { |
| 330 | return __builtin_altivec_vsubuhs(a, b); |
| 331 | } |
| 332 | |
| 333 | static vector int _ATTRS_o_ai |
| 334 | vec_subs(vector int a, vector int b) |
| 335 | { |
| 336 | return __builtin_altivec_vsubsws(a, b); |
| 337 | } |
| 338 | |
| 339 | static vector unsigned int _ATTRS_o_ai |
| 340 | vec_subs(vector unsigned int a, vector unsigned int b) |
| 341 | { |
| 342 | return __builtin_altivec_vsubuws(a, b); |
| 343 | } |
| 344 | |
| 345 | /* vec_avg */ |
| 346 | |
| 347 | #define __builtin_vec_vavgsb __builtin_altivec_vavgsb |
| 348 | #define __builtin_vec_vavgub __builtin_altivec_vavgub |
| 349 | #define __builtin_vec_vavgsh __builtin_altivec_vavgsh |
| 350 | #define __builtin_vec_vavguh __builtin_altivec_vavguh |
| 351 | #define __builtin_vec_vavgsw __builtin_altivec_vavgsw |
| 352 | #define __builtin_vec_vavguw __builtin_altivec_vavguw |
| 353 | #define vec_vavgsb __builtin_altivec_vavgsb |
| 354 | #define vec_vavgub __builtin_altivec_vavgub |
| 355 | #define vec_vavgsh __builtin_altivec_vavgsh |
| 356 | #define vec_vavguh __builtin_altivec_vavguh |
| 357 | #define vec_vavgsw __builtin_altivec_vavgsw |
| 358 | #define vec_vavguw __builtin_altivec_vavguw |
| 359 | |
| 360 | static vector char _ATTRS_o_ai |
| 361 | vec_avg(vector char a, vector char b) |
| 362 | { |
| 363 | return __builtin_altivec_vavgsb(a, b); |
| 364 | } |
| 365 | |
| 366 | static vector signed char _ATTRS_o_ai |
| 367 | vec_avg(vector signed char a, vector signed char b) |
| 368 | { |
| 369 | return __builtin_altivec_vavgsb(a, b); |
| 370 | } |
| 371 | |
| 372 | static vector unsigned char _ATTRS_o_ai |
| 373 | vec_avg(vector unsigned char a, vector unsigned char b) |
| 374 | { |
| 375 | return __builtin_altivec_vavgub(a, b); |
| 376 | } |
| 377 | |
| 378 | static vector short _ATTRS_o_ai |
| 379 | vec_avg(vector short a, vector short b) |
| 380 | { |
| 381 | return __builtin_altivec_vavgsh(a, b); |
| 382 | } |
| 383 | |
| 384 | static vector unsigned short _ATTRS_o_ai |
| 385 | vec_avg(vector unsigned short a, vector unsigned short b) |
| 386 | { |
| 387 | return __builtin_altivec_vavguh(a, b); |
| 388 | } |
| 389 | |
| 390 | static vector int _ATTRS_o_ai |
| 391 | vec_avg(vector int a, vector int b) |
| 392 | { |
| 393 | return __builtin_altivec_vavgsw(a, b); |
| 394 | } |
| 395 | |
| 396 | static vector unsigned int _ATTRS_o_ai |
| 397 | vec_avg(vector unsigned int a, vector unsigned int b) |
| 398 | { |
| 399 | return __builtin_altivec_vavguw(a, b); |
| 400 | } |
| 401 | |
| 402 | /* vec_st */ |
| 403 | |
| 404 | #define __builtin_vec_st vec_st |
| 405 | #define vec_stvx vec_st |
| 406 | |
| 407 | static void _ATTRS_o_ai |
| 408 | vec_st(vector char a, int b, vector char *c) |
| 409 | { |
| 410 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 411 | } |
| 412 | |
| 413 | static void _ATTRS_o_ai |
| 414 | vec_st(vector signed char a, int b, vector signed char *c) |
| 415 | { |
| 416 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 417 | } |
| 418 | |
| 419 | static void _ATTRS_o_ai |
| 420 | vec_st(vector unsigned char a, int b, vector unsigned char *c) |
| 421 | { |
| 422 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 423 | } |
| 424 | |
| 425 | static void _ATTRS_o_ai |
| 426 | vec_st(vector short a, int b, vector short *c) |
| 427 | { |
| 428 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 429 | } |
| 430 | |
| 431 | static void _ATTRS_o_ai |
| 432 | vec_st(vector unsigned short a, int b, vector unsigned short *c) |
| 433 | { |
| 434 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 435 | } |
| 436 | |
| 437 | static void _ATTRS_o_ai |
| 438 | vec_st(vector int a, int b, vector int *c) |
| 439 | { |
| 440 | __builtin_altivec_stvx(a, b, (void *)c); |
| 441 | } |
| 442 | |
| 443 | static void _ATTRS_o_ai |
| 444 | vec_st(vector unsigned int a, int b, vector unsigned int *c) |
| 445 | { |
| 446 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 447 | } |
| 448 | |
| 449 | static void _ATTRS_o_ai |
| 450 | vec_st(vector float a, int b, vector float *c) |
| 451 | { |
| 452 | __builtin_altivec_stvx((vector int)a, b, (void *)c); |
| 453 | } |
| 454 | |
| 455 | /* vec_stl */ |
| 456 | |
| 457 | #define __builtin_vec_stl vec_stl |
| 458 | #define vec_stvxl vec_stl |
| 459 | |
| 460 | static void _ATTRS_o_ai |
| 461 | vec_stl(vector char a, int b, vector char *c) |
| 462 | { |
| 463 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 464 | } |
| 465 | |
| 466 | static void _ATTRS_o_ai |
| 467 | vec_stl(vector signed char a, int b, vector signed char *c) |
| 468 | { |
| 469 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 470 | } |
| 471 | |
| 472 | static void _ATTRS_o_ai |
| 473 | vec_stl(vector unsigned char a, int b, vector unsigned char *c) |
| 474 | { |
| 475 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 476 | } |
| 477 | |
| 478 | static void _ATTRS_o_ai |
| 479 | vec_stl(vector short a, int b, vector short *c) |
| 480 | { |
| 481 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 482 | } |
| 483 | |
| 484 | static void _ATTRS_o_ai |
| 485 | vec_stl(vector unsigned short a, int b, vector unsigned short *c) |
| 486 | { |
| 487 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 488 | } |
| 489 | |
| 490 | static void _ATTRS_o_ai |
| 491 | vec_stl(vector int a, int b, vector int *c) |
| 492 | { |
| 493 | __builtin_altivec_stvxl(a, b, (void *)c); |
| 494 | } |
| 495 | |
| 496 | static void _ATTRS_o_ai |
| 497 | vec_stl(vector unsigned int a, int b, vector unsigned int *c) |
| 498 | { |
| 499 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 500 | } |
| 501 | |
| 502 | static void _ATTRS_o_ai |
| 503 | vec_stl(vector float a, int b, vector float *c) |
| 504 | { |
| 505 | __builtin_altivec_stvxl((vector int)a, b, (void *)c); |
| 506 | } |
| 507 | |
| 508 | /* vec_ste */ |
| 509 | |
| 510 | #define __builtin_vec_stvebx __builtin_altivec_stvebx |
| 511 | #define __builtin_vec_stvehx __builtin_altivec_stvehx |
| 512 | #define __builtin_vec_stvewx __builtin_altivec_stvewx |
| 513 | #define vec_stvebx __builtin_altivec_stvebx |
| 514 | #define vec_stvehx __builtin_altivec_stvehx |
| 515 | #define vec_stvewx __builtin_altivec_stvewx |
| 516 | |
| 517 | static void _ATTRS_o_ai |
| 518 | vec_ste(vector char a, int b, vector char *c) |
| 519 | { |
| 520 | __builtin_altivec_stvebx((vector int)a, b, (void *)c); |
| 521 | } |
| 522 | |
| 523 | static void _ATTRS_o_ai |
| 524 | vec_ste(vector signed char a, int b, vector signed char *c) |
| 525 | { |
| 526 | __builtin_altivec_stvebx((vector int)a, b, (void *)c); |
| 527 | } |
| 528 | |
| 529 | static void _ATTRS_o_ai |
| 530 | vec_ste(vector unsigned char a, int b, vector unsigned char *c) |
| 531 | { |
| 532 | __builtin_altivec_stvebx((vector int)a, b, (void *)c); |
| 533 | } |
| 534 | |
| 535 | static void _ATTRS_o_ai |
| 536 | vec_ste(vector short a, int b, vector short *c) |
| 537 | { |
| 538 | __builtin_altivec_stvehx((vector int)a, b, (void *)c); |
| 539 | } |
| 540 | |
| 541 | static void _ATTRS_o_ai |
| 542 | vec_ste(vector unsigned short a, int b, vector unsigned short *c) |
| 543 | { |
| 544 | __builtin_altivec_stvehx((vector int)a, b, (void *)c); |
| 545 | } |
| 546 | |
| 547 | static void _ATTRS_o_ai |
| 548 | vec_ste(vector int a, int b, vector int *c) |
| 549 | { |
| 550 | __builtin_altivec_stvewx(a, b, (void *)c); |
| 551 | } |
| 552 | |
| 553 | static void _ATTRS_o_ai |
| 554 | vec_ste(vector unsigned int a, int b, vector unsigned int *c) |
| 555 | { |
| 556 | __builtin_altivec_stvewx((vector int)a, b, (void *)c); |
| 557 | } |
| 558 | |
| 559 | static void _ATTRS_o_ai |
| 560 | vec_ste(vector float a, int b, vector float *c) |
| 561 | { |
| 562 | __builtin_altivec_stvewx((vector int)a, b, (void *)c); |
| 563 | } |
| 564 | |
| 565 | /* vec_cmpb */ |
| 566 | |
| 567 | #define vec_cmpb __builtin_altivec_vcmpbfp |
| 568 | #define vec_vcmpbfp __builtin_altivec_vcmpbfp |
| 569 | #define __builtin_vec_cmpb __builtin_altivec_vcmpbfp |
| 570 | |
| 571 | /* vec_cmpeq */ |
| 572 | |
| 573 | #define __builtin_vec_cmpeq vec_cmpeq |
| 574 | |
| 575 | static vector char _ATTRS_o_ai |
| 576 | vec_cmpeq(vector char a, vector char b) |
| 577 | { |
| 578 | return __builtin_altivec_vcmpequb(a, b); |
| 579 | } |
| 580 | |
| 581 | static vector char _ATTRS_o_ai |
| 582 | vec_cmpeq(vector signed char a, vector signed char b) |
| 583 | { |
| 584 | return __builtin_altivec_vcmpequb(a, b); |
| 585 | } |
| 586 | |
| 587 | static vector char _ATTRS_o_ai |
| 588 | vec_cmpeq(vector unsigned char a, vector unsigned char b) |
| 589 | { |
| 590 | return __builtin_altivec_vcmpequb(a, b); |
| 591 | } |
| 592 | |
| 593 | static vector short _ATTRS_o_ai |
| 594 | vec_cmpeq(vector short a, vector short b) |
| 595 | { |
| 596 | return __builtin_altivec_vcmpequh(a, b); |
| 597 | } |
| 598 | |
| 599 | static vector short _ATTRS_o_ai |
| 600 | vec_cmpeq(vector unsigned short a, vector unsigned short b) |
| 601 | { |
| 602 | return __builtin_altivec_vcmpequh(a, b); |
| 603 | } |
| 604 | |
| 605 | static vector int _ATTRS_o_ai |
| 606 | vec_cmpeq(vector int a, vector int b) |
| 607 | { |
| 608 | return __builtin_altivec_vcmpequw(a, b); |
| 609 | } |
| 610 | |
| 611 | static vector int _ATTRS_o_ai |
| 612 | vec_cmpeq(vector unsigned int a, vector unsigned int b) |
| 613 | { |
| 614 | return __builtin_altivec_vcmpequw(a, b); |
| 615 | } |
| 616 | |
| 617 | static vector int _ATTRS_o_ai |
| 618 | vec_cmpeq(vector float a, vector float b) |
| 619 | { |
| 620 | return __builtin_altivec_vcmpeqfp(a, b); |
| 621 | } |
| 622 | |
| 623 | /* vec_cmpge */ |
| 624 | |
| 625 | #define vec_cmpge __builtin_altivec_vcmpgefp |
| 626 | #define vec_vcmpgefp __builtin_altivec_vcmpgefp |
| 627 | #define __builtin_vec_cmpge __builtin_altivec_vcmpgefp |
| 628 | |
| 629 | /* vec_cmpgt */ |
| 630 | |
| 631 | #define vec_vcmpgtsb __builtin_altivec_vcmpgtsb |
| 632 | #define vec_vcmpgtub __builtin_altivec_vcmpgtub |
| 633 | #define vec_vcmpgtsh __builtin_altivec_vcmpgtsh |
| 634 | #define vec_vcmpgtuh __builtin_altivec_vcmpgtuh |
| 635 | #define vec_vcmpgtsw __builtin_altivec_vcmpgtsw |
| 636 | #define vec_vcmpgtuw __builtin_altivec_vcmpgtuw |
| 637 | #define vec_vcmpgtfp __builtin_altivec_vcmpgtfp |
| 638 | #define __builtin_vec_vcmpgtsb __builtin_altivec_vcmpgtsb |
| 639 | #define __builtin_vec_vcmpgtub __builtin_altivec_vcmpgtub |
| 640 | #define __builtin_vec_vcmpgtsh __builtin_altivec_vcmpgtsh |
| 641 | #define __builtin_vec_vcmpgtuh __builtin_altivec_vcmpgtuh |
| 642 | #define __builtin_vec_vcmpgtsw __builtin_altivec_vcmpgtsw |
| 643 | #define __builtin_vec_vcmpgtuw __builtin_altivec_vcmpgtuw |
| 644 | #define __builtin_vec_vcmpgtfp __builtin_altivec_vcmpgtfp |
| 645 | |
| 646 | static vector char _ATTRS_o_ai |
| 647 | vec_cmpgt(vector char a, vector char b) |
| 648 | { |
| 649 | return __builtin_altivec_vcmpgtsb(a, b); |
| 650 | } |
| 651 | |
| 652 | static vector char _ATTRS_o_ai |
| 653 | vec_cmpgt(vector signed char a, vector signed char b) |
| 654 | { |
| 655 | return __builtin_altivec_vcmpgtsb(a, b); |
| 656 | } |
| 657 | |
| 658 | static vector char _ATTRS_o_ai |
| 659 | vec_cmpgt(vector unsigned char a, vector unsigned char b) |
| 660 | { |
| 661 | return __builtin_altivec_vcmpgtub(a, b); |
| 662 | } |
| 663 | |
| 664 | static vector short _ATTRS_o_ai |
| 665 | vec_cmpgt(vector short a, vector short b) |
| 666 | { |
| 667 | return __builtin_altivec_vcmpgtsh(a, b); |
| 668 | } |
| 669 | |
| 670 | static vector short _ATTRS_o_ai |
| 671 | vec_cmpgt(vector unsigned short a, vector unsigned short b) |
| 672 | { |
| 673 | return __builtin_altivec_vcmpgtuh(a, b); |
| 674 | } |
| 675 | |
| 676 | static vector int _ATTRS_o_ai |
| 677 | vec_cmpgt(vector int a, vector int b) |
| 678 | { |
| 679 | return __builtin_altivec_vcmpgtsw(a, b); |
| 680 | } |
| 681 | |
| 682 | static vector int _ATTRS_o_ai |
| 683 | vec_cmpgt(vector unsigned int a, vector unsigned int b) |
| 684 | { |
| 685 | return __builtin_altivec_vcmpgtuw(a, b); |
| 686 | } |
| 687 | |
| 688 | static vector int _ATTRS_o_ai |
| 689 | vec_cmpgt(vector float a, vector float b) |
| 690 | { |
| 691 | return __builtin_altivec_vcmpgtfp(a, b); |
| 692 | } |
| 693 | |
| 694 | /* vec_cmple */ |
| 695 | |
| 696 | #define __builtin_vec_cmple vec_cmple |
| 697 | |
| 698 | static vector int __attribute__((__always_inline__)) |
| 699 | vec_cmple(vector float a, vector float b) |
| 700 | { |
| 701 | return __builtin_altivec_vcmpgefp(b, a); |
| 702 | } |
| 703 | |
| 704 | /* vec_cmplt */ |
| 705 | |
| 706 | #define __builtin_vec_cmplt vec_cmplt |
| 707 | |
| 708 | static vector char _ATTRS_o_ai |
| 709 | vec_cmplt(vector char a, vector char b) |
| 710 | { |
| 711 | return __builtin_altivec_vcmpgtsb(b, a); |
| 712 | } |
| 713 | |
| 714 | static vector char _ATTRS_o_ai |
| 715 | vec_cmplt(vector signed char a, vector signed char b) |
| 716 | { |
| 717 | return __builtin_altivec_vcmpgtsb(b, a); |
| 718 | } |
| 719 | |
| 720 | static vector char _ATTRS_o_ai |
| 721 | vec_cmplt(vector unsigned char a, vector unsigned char b) |
| 722 | { |
| 723 | return __builtin_altivec_vcmpgtub(b, a); |
| 724 | } |
| 725 | |
| 726 | static vector short _ATTRS_o_ai |
| 727 | vec_cmplt(vector short a, vector short b) |
| 728 | { |
| 729 | return __builtin_altivec_vcmpgtsh(b, a); |
| 730 | } |
| 731 | |
| 732 | static vector short _ATTRS_o_ai |
| 733 | vec_cmplt(vector unsigned short a, vector unsigned short b) |
| 734 | { |
| 735 | return __builtin_altivec_vcmpgtuh(b, a); |
| 736 | } |
| 737 | |
| 738 | static vector int _ATTRS_o_ai |
| 739 | vec_cmplt(vector int a, vector int b) |
| 740 | { |
| 741 | return __builtin_altivec_vcmpgtsw(b, a); |
| 742 | } |
| 743 | |
| 744 | static vector int _ATTRS_o_ai |
| 745 | vec_cmplt(vector unsigned int a, vector unsigned int b) |
| 746 | { |
| 747 | return __builtin_altivec_vcmpgtuw(b, a); |
| 748 | } |
| 749 | |
| 750 | static vector int _ATTRS_o_ai |
| 751 | vec_cmplt(vector float a, vector float b) |
| 752 | { |
| 753 | return __builtin_altivec_vcmpgtfp(b, a); |
| 754 | } |
| 755 | |
| 756 | /* vec_max */ |
| 757 | |
| 758 | #define __builtin_vec_vmaxsb __builtin_altivec_vmaxsb |
| 759 | #define __builtin_vec_vmaxub __builtin_altivec_vmaxub |
| 760 | #define __builtin_vec_vmaxsh __builtin_altivec_vmaxsh |
| 761 | #define __builtin_vec_vmaxuh __builtin_altivec_vmaxuh |
| 762 | #define __builtin_vec_vmaxsw __builtin_altivec_vmaxsw |
| 763 | #define __builtin_vec_vmaxuw __builtin_altivec_vmaxuw |
| 764 | #define __builtin_vec_vmaxfp __builtin_altivec_vmaxfp |
| 765 | #define vec_vmaxsb __builtin_altivec_vmaxsb |
| 766 | #define vec_vmaxub __builtin_altivec_vmaxub |
| 767 | #define vec_vmaxsh __builtin_altivec_vmaxsh |
| 768 | #define vec_vmaxuh __builtin_altivec_vmaxuh |
| 769 | #define vec_vmaxsw __builtin_altivec_vmaxsw |
| 770 | #define vec_vmaxuw __builtin_altivec_vmaxuw |
| 771 | #define vec_vmaxfp __builtin_altivec_vmaxfp |
| 772 | #define __builtin_vec_max vec_max |
| 773 | |
| 774 | static vector char _ATTRS_o_ai |
| 775 | vec_max(vector char a, vector char b) |
| 776 | { |
| 777 | return __builtin_altivec_vmaxsb(a, b); |
| 778 | } |
| 779 | |
| 780 | static vector signed char _ATTRS_o_ai |
| 781 | vec_max(vector signed char a, vector signed char b) |
| 782 | { |
| 783 | return __builtin_altivec_vmaxsb(a, b); |
| 784 | } |
| 785 | |
| 786 | static vector unsigned char _ATTRS_o_ai |
| 787 | vec_max(vector unsigned char a, vector unsigned char b) |
| 788 | { |
| 789 | return __builtin_altivec_vmaxub(a, b); |
| 790 | } |
| 791 | |
| 792 | static vector short _ATTRS_o_ai |
| 793 | vec_max(vector short a, vector short b) |
| 794 | { |
| 795 | return __builtin_altivec_vmaxsh(a, b); |
| 796 | } |
| 797 | |
| 798 | static vector unsigned short _ATTRS_o_ai |
| 799 | vec_max(vector unsigned short a, vector unsigned short b) |
| 800 | { |
| 801 | return __builtin_altivec_vmaxuh(a, b); |
| 802 | } |
| 803 | |
| 804 | static vector int _ATTRS_o_ai |
| 805 | vec_max(vector int a, vector int b) |
| 806 | { |
| 807 | return __builtin_altivec_vmaxsw(a, b); |
| 808 | } |
| 809 | |
| 810 | static vector unsigned int _ATTRS_o_ai |
| 811 | vec_max(vector unsigned int a, vector unsigned int b) |
| 812 | { |
| 813 | return __builtin_altivec_vmaxuw(a, b); |
| 814 | } |
| 815 | |
| 816 | static vector float _ATTRS_o_ai |
| 817 | vec_max(vector float a, vector float b) |
| 818 | { |
| 819 | return __builtin_altivec_vmaxfp(a, b); |
| 820 | } |
| 821 | |
| 822 | /* vec_mfvscr */ |
| 823 | |
| 824 | #define __builtin_vec_mfvscr __builtin_altivec_mfvscr |
| 825 | #define vec_mfvscr __builtin_altivec_mfvscr |
| 826 | |
| 827 | /* vec_min */ |
| 828 | |
| 829 | #define __builtin_vec_vminsb __builtin_altivec_vminsb |
| 830 | #define __builtin_vec_vminub __builtin_altivec_vminub |
| 831 | #define __builtin_vec_vminsh __builtin_altivec_vminsh |
| 832 | #define __builtin_vec_vminuh __builtin_altivec_vminuh |
| 833 | #define __builtin_vec_vminsw __builtin_altivec_vminsw |
| 834 | #define __builtin_vec_vminuw __builtin_altivec_vminuw |
| 835 | #define __builtin_vec_vminfp __builtin_altivec_vminfp |
| 836 | #define vec_vminsb __builtin_altivec_vminsb |
| 837 | #define vec_vminub __builtin_altivec_vminub |
| 838 | #define vec_vminsh __builtin_altivec_vminsh |
| 839 | #define vec_vminuh __builtin_altivec_vminuh |
| 840 | #define vec_vminsw __builtin_altivec_vminsw |
| 841 | #define vec_vminuw __builtin_altivec_vminuw |
| 842 | #define vec_vminfp __builtin_altivec_vminfp |
| 843 | #define __builtin_vec_min vec_min |
| 844 | |
| 845 | static vector char _ATTRS_o_ai |
| 846 | vec_min(vector char a, vector char b) |
| 847 | { |
| 848 | return __builtin_altivec_vminsb(a, b); |
| 849 | } |
| 850 | |
| 851 | static vector signed char _ATTRS_o_ai |
| 852 | vec_min(vector signed char a, vector signed char b) |
| 853 | { |
| 854 | return __builtin_altivec_vminsb(a, b); |
| 855 | } |
| 856 | |
| 857 | static vector unsigned char _ATTRS_o_ai |
| 858 | vec_min(vector unsigned char a, vector unsigned char b) |
| 859 | { |
| 860 | return __builtin_altivec_vminub(a, b); |
| 861 | } |
| 862 | |
| 863 | static vector short _ATTRS_o_ai |
| 864 | vec_min(vector short a, vector short b) |
| 865 | { |
| 866 | return __builtin_altivec_vminsh(a, b); |
| 867 | } |
| 868 | |
| 869 | static vector unsigned short _ATTRS_o_ai |
| 870 | vec_min(vector unsigned short a, vector unsigned short b) |
| 871 | { |
| 872 | return __builtin_altivec_vminuh(a, b); |
| 873 | } |
| 874 | |
| 875 | static vector int _ATTRS_o_ai |
| 876 | vec_min(vector int a, vector int b) |
| 877 | { |
| 878 | return __builtin_altivec_vminsw(a, b); |
| 879 | } |
| 880 | |
| 881 | static vector unsigned int _ATTRS_o_ai |
| 882 | vec_min(vector unsigned int a, vector unsigned int b) |
| 883 | { |
| 884 | return __builtin_altivec_vminuw(a, b); |
| 885 | } |
| 886 | |
| 887 | static vector float _ATTRS_o_ai |
| 888 | vec_min(vector float a, vector float b) |
| 889 | { |
| 890 | return __builtin_altivec_vminfp(a, b); |
| 891 | } |
| 892 | |
| 893 | /* vec_mtvscr */ |
| 894 | |
| 895 | #define __builtin_vec_mtvscr __builtin_altivec_mtvscr |
| 896 | #define vec_mtvscr __builtin_altivec_mtvscr |
| 897 | |
| 898 | /* ------------------------------ predicates ------------------------------------ */ |
| 899 | |
| 900 | static int __attribute__((__always_inline__)) |
| 901 | __builtin_vec_vcmpeq_p(char CR6_param, vector float a, vector float b) |
| 902 | { |
| 903 | return __builtin_altivec_vcmpeqfp_p(CR6_param, a, b); |
| 904 | } |
| 905 | |
| 906 | static int __attribute__((__always_inline__)) |
| 907 | __builtin_vec_vcmpge_p(char CR6_param, vector float a, vector float b) |
| 908 | { |
| 909 | return __builtin_altivec_vcmpgefp_p(CR6_param, a, b); |
| 910 | } |
| 911 | |
| 912 | static int __attribute__((__always_inline__)) |
| 913 | __builtin_vec_vcmpgt_p(char CR6_param, vector float a, vector float b) |
| 914 | { |
| 915 | return __builtin_altivec_vcmpgtfp_p(CR6_param, a, b); |
| 916 | } |
| 917 | |
| 918 | /* vec_all_eq */ |
| 919 | |
| 920 | static int _ATTRS_o_ai |
| 921 | vec_all_eq(vector char a, vector char b) |
| 922 | { |
| 923 | return __builtin_altivec_vcmpequb_p(__CR6_LT, a, b); |
| 924 | } |
| 925 | |
| 926 | static int _ATTRS_o_ai |
| 927 | vec_all_eq(vector signed char a, vector signed char b) |
| 928 | { |
| 929 | return __builtin_altivec_vcmpequb_p(__CR6_LT, a, b); |
| 930 | } |
| 931 | |
| 932 | static int _ATTRS_o_ai |
| 933 | vec_all_eq(vector unsigned char a, vector unsigned char b) |
| 934 | { |
| 935 | return __builtin_altivec_vcmpequb_p(__CR6_LT, a, b); |
| 936 | } |
| 937 | |
| 938 | static int _ATTRS_o_ai |
| 939 | vec_all_eq(vector short a, vector short b) |
| 940 | { |
| 941 | return __builtin_altivec_vcmpequh_p(__CR6_LT, a, b); |
| 942 | } |
| 943 | |
| 944 | static int _ATTRS_o_ai |
| 945 | vec_all_eq(vector unsigned short a, vector unsigned short b) |
| 946 | { |
| 947 | return __builtin_altivec_vcmpequh_p(__CR6_LT, a, b); |
| 948 | } |
| 949 | |
| 950 | static int _ATTRS_o_ai |
| 951 | vec_all_eq(vector int a, vector int b) |
| 952 | { |
| 953 | return __builtin_altivec_vcmpequw_p(__CR6_LT, a, b); |
| 954 | } |
| 955 | |
| 956 | static int _ATTRS_o_ai |
| 957 | vec_all_eq(vector unsigned int a, vector unsigned int b) |
| 958 | { |
| 959 | return __builtin_altivec_vcmpequw_p(__CR6_LT, a, b); |
| 960 | } |
| 961 | |
| 962 | static int _ATTRS_o_ai |
| 963 | vec_all_eq(vector float a, vector float b) |
| 964 | { |
| 965 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, a, b); |
| 966 | } |
| 967 | |
| 968 | /* vec_all_ge */ |
| 969 | |
| 970 | static int _ATTRS_o_ai |
| 971 | vec_all_ge(vector char a, vector char b) |
| 972 | { |
| 973 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, b, a); |
| 974 | } |
| 975 | |
| 976 | static int _ATTRS_o_ai |
| 977 | vec_all_ge(vector signed char a, vector signed char b) |
| 978 | { |
| 979 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, b, a); |
| 980 | } |
| 981 | |
| 982 | static int _ATTRS_o_ai |
| 983 | vec_all_ge(vector unsigned char a, vector unsigned char b) |
| 984 | { |
| 985 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, b, a); |
| 986 | } |
| 987 | |
| 988 | static int _ATTRS_o_ai |
| 989 | vec_all_ge(vector short a, vector short b) |
| 990 | { |
| 991 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, b, a); |
| 992 | } |
| 993 | |
| 994 | static int _ATTRS_o_ai |
| 995 | vec_all_ge(vector unsigned short a, vector unsigned short b) |
| 996 | { |
| 997 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, b, a); |
| 998 | } |
| 999 | |
| 1000 | static int _ATTRS_o_ai |
| 1001 | vec_all_ge(vector int a, vector int b) |
| 1002 | { |
| 1003 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, b, a); |
| 1004 | } |
| 1005 | |
| 1006 | static int _ATTRS_o_ai |
| 1007 | vec_all_ge(vector unsigned int a, vector unsigned int b) |
| 1008 | { |
| 1009 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, b, a); |
| 1010 | } |
| 1011 | |
| 1012 | static int _ATTRS_o_ai |
| 1013 | vec_all_ge(vector float a, vector float b) |
| 1014 | { |
| 1015 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, b, a); |
| 1016 | } |
| 1017 | |
| 1018 | /* vec_all_gt */ |
| 1019 | |
| 1020 | static int _ATTRS_o_ai |
| 1021 | vec_all_gt(vector char a, vector char b) |
| 1022 | { |
| 1023 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, a, b); |
| 1024 | } |
| 1025 | |
| 1026 | static int _ATTRS_o_ai |
| 1027 | vec_all_gt(vector signed char a, vector signed char b) |
| 1028 | { |
| 1029 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, a, b); |
| 1030 | } |
| 1031 | |
| 1032 | static int _ATTRS_o_ai |
| 1033 | vec_all_gt(vector unsigned char a, vector unsigned char b) |
| 1034 | { |
| 1035 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, a, b); |
| 1036 | } |
| 1037 | |
| 1038 | static int _ATTRS_o_ai |
| 1039 | vec_all_gt(vector short a, vector short b) |
| 1040 | { |
| 1041 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, a, b); |
| 1042 | } |
| 1043 | |
| 1044 | static int _ATTRS_o_ai |
| 1045 | vec_all_gt(vector unsigned short a, vector unsigned short b) |
| 1046 | { |
| 1047 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, a, b); |
| 1048 | } |
| 1049 | |
| 1050 | static int _ATTRS_o_ai |
| 1051 | vec_all_gt(vector int a, vector int b) |
| 1052 | { |
| 1053 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, a, b); |
| 1054 | } |
| 1055 | |
| 1056 | static int _ATTRS_o_ai |
| 1057 | vec_all_gt(vector unsigned int a, vector unsigned int b) |
| 1058 | { |
| 1059 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, a, b); |
| 1060 | } |
| 1061 | |
| 1062 | static int _ATTRS_o_ai |
| 1063 | vec_all_gt(vector float a, vector float b) |
| 1064 | { |
| 1065 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, a, b); |
| 1066 | } |
| 1067 | |
| 1068 | /* vec_all_in */ |
| 1069 | |
| 1070 | static int __attribute__((__always_inline__)) |
| 1071 | vec_all_in(vector float a, vector float b) |
| 1072 | { |
| 1073 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ, a, b); |
| 1074 | } |
| 1075 | |
| 1076 | /* vec_all_le */ |
| 1077 | |
| 1078 | static int _ATTRS_o_ai |
| 1079 | vec_all_le(vector char a, vector char b) |
| 1080 | { |
| 1081 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, a, b); |
| 1082 | } |
| 1083 | |
| 1084 | static int _ATTRS_o_ai |
| 1085 | vec_all_le(vector signed char a, vector signed char b) |
| 1086 | { |
| 1087 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, a, b); |
| 1088 | } |
| 1089 | |
| 1090 | static int _ATTRS_o_ai |
| 1091 | vec_all_le(vector unsigned char a, vector unsigned char b) |
| 1092 | { |
| 1093 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, a, b); |
| 1094 | } |
| 1095 | |
| 1096 | static int _ATTRS_o_ai |
| 1097 | vec_all_le(vector short a, vector short b) |
| 1098 | { |
| 1099 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, a, b); |
| 1100 | } |
| 1101 | |
| 1102 | static int _ATTRS_o_ai |
| 1103 | vec_all_le(vector unsigned short a, vector unsigned short b) |
| 1104 | { |
| 1105 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, a, b); |
| 1106 | } |
| 1107 | |
| 1108 | static int _ATTRS_o_ai |
| 1109 | vec_all_le(vector int a, vector int b) |
| 1110 | { |
| 1111 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, a, b); |
| 1112 | } |
| 1113 | |
| 1114 | static int _ATTRS_o_ai |
| 1115 | vec_all_le(vector unsigned int a, vector unsigned int b) |
| 1116 | { |
| 1117 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, a, b); |
| 1118 | } |
| 1119 | |
| 1120 | static int _ATTRS_o_ai |
| 1121 | vec_all_le(vector float a, vector float b) |
| 1122 | { |
| 1123 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, a, b); |
| 1124 | } |
| 1125 | |
| 1126 | /* vec_all_lt */ |
| 1127 | |
| 1128 | static int _ATTRS_o_ai |
| 1129 | vec_all_lt(vector char a, vector char b) |
| 1130 | { |
| 1131 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, b, a); |
| 1132 | } |
| 1133 | |
| 1134 | static int _ATTRS_o_ai |
| 1135 | vec_all_lt(vector signed char a, vector signed char b) |
| 1136 | { |
| 1137 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, b, a); |
| 1138 | } |
| 1139 | |
| 1140 | static int _ATTRS_o_ai |
| 1141 | vec_all_lt(vector unsigned char a, vector unsigned char b) |
| 1142 | { |
| 1143 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, b, a); |
| 1144 | } |
| 1145 | |
| 1146 | static int _ATTRS_o_ai |
| 1147 | vec_all_lt(vector short a, vector short b) |
| 1148 | { |
| 1149 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, b, a); |
| 1150 | } |
| 1151 | |
| 1152 | static int _ATTRS_o_ai |
| 1153 | vec_all_lt(vector unsigned short a, vector unsigned short b) |
| 1154 | { |
| 1155 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, b, a); |
| 1156 | } |
| 1157 | |
| 1158 | static int _ATTRS_o_ai |
| 1159 | vec_all_lt(vector int a, vector int b) |
| 1160 | { |
| 1161 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, b, a); |
| 1162 | } |
| 1163 | |
| 1164 | static int _ATTRS_o_ai |
| 1165 | vec_all_lt(vector unsigned int a, vector unsigned int b) |
| 1166 | { |
| 1167 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, b, a); |
| 1168 | } |
| 1169 | |
| 1170 | static int _ATTRS_o_ai |
| 1171 | vec_all_lt(vector float a, vector float b) |
| 1172 | { |
| 1173 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, b, a); |
| 1174 | } |
| 1175 | |
| 1176 | /* vec_all_nan */ |
| 1177 | |
| 1178 | static int __attribute__((__always_inline__)) |
| 1179 | vec_all_nan(vector float a) |
| 1180 | { |
| 1181 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, a, a); |
| 1182 | } |
| 1183 | |
| 1184 | /* vec_all_ne */ |
| 1185 | |
| 1186 | static int _ATTRS_o_ai |
| 1187 | vec_all_ne(vector char a, vector char b) |
| 1188 | { |
| 1189 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, a, b); |
| 1190 | } |
| 1191 | |
| 1192 | static int _ATTRS_o_ai |
| 1193 | vec_all_ne(vector signed char a, vector signed char b) |
| 1194 | { |
| 1195 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, a, b); |
| 1196 | } |
| 1197 | |
| 1198 | static int _ATTRS_o_ai |
| 1199 | vec_all_ne(vector unsigned char a, vector unsigned char b) |
| 1200 | { |
| 1201 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, a, b); |
| 1202 | } |
| 1203 | |
| 1204 | static int _ATTRS_o_ai |
| 1205 | vec_all_ne(vector short a, vector short b) |
| 1206 | { |
| 1207 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, a, b); |
| 1208 | } |
| 1209 | |
| 1210 | static int _ATTRS_o_ai |
| 1211 | vec_all_ne(vector unsigned short a, vector unsigned short b) |
| 1212 | { |
| 1213 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, a, b); |
| 1214 | } |
| 1215 | |
| 1216 | static int _ATTRS_o_ai |
| 1217 | vec_all_ne(vector int a, vector int b) |
| 1218 | { |
| 1219 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, a, b); |
| 1220 | } |
| 1221 | |
| 1222 | static int _ATTRS_o_ai |
| 1223 | vec_all_ne(vector unsigned int a, vector unsigned int b) |
| 1224 | { |
| 1225 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, a, b); |
| 1226 | } |
| 1227 | |
| 1228 | static int _ATTRS_o_ai |
| 1229 | vec_all_ne(vector float a, vector float b) |
| 1230 | { |
| 1231 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, a, b); |
| 1232 | } |
| 1233 | |
| 1234 | /* vec_all_nge */ |
| 1235 | |
| 1236 | static int __attribute__((__always_inline__)) |
| 1237 | vec_all_nge(vector float a, vector float b) |
| 1238 | { |
| 1239 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, a, b); |
| 1240 | } |
| 1241 | |
| 1242 | /* vec_all_ngt */ |
| 1243 | |
| 1244 | static int __attribute__((__always_inline__)) |
| 1245 | vec_all_ngt(vector float a, vector float b) |
| 1246 | { |
| 1247 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, a, b); |
| 1248 | } |
| 1249 | |
| 1250 | /* vec_all_nle */ |
| 1251 | |
| 1252 | static int __attribute__((__always_inline__)) |
| 1253 | vec_all_nle(vector float a, vector float b) |
| 1254 | { |
| 1255 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, b, a); |
| 1256 | } |
| 1257 | |
| 1258 | /* vec_all_nlt */ |
| 1259 | |
| 1260 | static int __attribute__((__always_inline__)) |
| 1261 | vec_all_nlt(vector float a, vector float b) |
| 1262 | { |
| 1263 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, b, a); |
| 1264 | } |
| 1265 | |
| 1266 | /* vec_all_numeric */ |
| 1267 | |
| 1268 | static int __attribute__((__always_inline__)) |
| 1269 | vec_all_numeric(vector float a) |
| 1270 | { |
| 1271 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, a, a); |
| 1272 | } |
| 1273 | |
| 1274 | /* vec_any_eq */ |
| 1275 | |
| 1276 | static int _ATTRS_o_ai |
| 1277 | vec_any_eq(vector char a, vector char b) |
| 1278 | { |
| 1279 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, a, b); |
| 1280 | } |
| 1281 | |
| 1282 | static int _ATTRS_o_ai |
| 1283 | vec_any_eq(vector signed char a, vector signed char b) |
| 1284 | { |
| 1285 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, a, b); |
| 1286 | } |
| 1287 | |
| 1288 | static int _ATTRS_o_ai |
| 1289 | vec_any_eq(vector unsigned char a, vector unsigned char b) |
| 1290 | { |
| 1291 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, a, b); |
| 1292 | } |
| 1293 | |
| 1294 | static int _ATTRS_o_ai |
| 1295 | vec_any_eq(vector short a, vector short b) |
| 1296 | { |
| 1297 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, a, b); |
| 1298 | } |
| 1299 | |
| 1300 | static int _ATTRS_o_ai |
| 1301 | vec_any_eq(vector unsigned short a, vector unsigned short b) |
| 1302 | { |
| 1303 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, a, b); |
| 1304 | } |
| 1305 | |
| 1306 | static int _ATTRS_o_ai |
| 1307 | vec_any_eq(vector int a, vector int b) |
| 1308 | { |
| 1309 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, a, b); |
| 1310 | } |
| 1311 | |
| 1312 | static int _ATTRS_o_ai |
| 1313 | vec_any_eq(vector unsigned int a, vector unsigned int b) |
| 1314 | { |
| 1315 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, a, b); |
| 1316 | } |
| 1317 | |
| 1318 | static int _ATTRS_o_ai |
| 1319 | vec_any_eq(vector float a, vector float b) |
| 1320 | { |
| 1321 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, a, b); |
| 1322 | } |
| 1323 | |
| 1324 | /* vec_any_ge */ |
| 1325 | |
| 1326 | static int _ATTRS_o_ai |
| 1327 | vec_any_ge(vector char a, vector char b) |
| 1328 | { |
| 1329 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, b, a); |
| 1330 | } |
| 1331 | |
| 1332 | static int _ATTRS_o_ai |
| 1333 | vec_any_ge(vector signed char a, vector signed char b) |
| 1334 | { |
| 1335 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, b, a); |
| 1336 | } |
| 1337 | |
| 1338 | static int _ATTRS_o_ai |
| 1339 | vec_any_ge(vector unsigned char a, vector unsigned char b) |
| 1340 | { |
| 1341 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, b, a); |
| 1342 | } |
| 1343 | |
| 1344 | static int _ATTRS_o_ai |
| 1345 | vec_any_ge(vector short a, vector short b) |
| 1346 | { |
| 1347 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, b, a); |
| 1348 | } |
| 1349 | |
| 1350 | static int _ATTRS_o_ai |
| 1351 | vec_any_ge(vector unsigned short a, vector unsigned short b) |
| 1352 | { |
| 1353 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, b, a); |
| 1354 | } |
| 1355 | |
| 1356 | static int _ATTRS_o_ai |
| 1357 | vec_any_ge(vector int a, vector int b) |
| 1358 | { |
| 1359 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, b, a); |
| 1360 | } |
| 1361 | |
| 1362 | static int _ATTRS_o_ai |
| 1363 | vec_any_ge(vector unsigned int a, vector unsigned int b) |
| 1364 | { |
| 1365 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, b, a); |
| 1366 | } |
| 1367 | |
| 1368 | static int _ATTRS_o_ai |
| 1369 | vec_any_ge(vector float a, vector float b) |
| 1370 | { |
| 1371 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, b, a); |
| 1372 | } |
| 1373 | |
| 1374 | /* vec_any_gt */ |
| 1375 | |
| 1376 | static int _ATTRS_o_ai |
| 1377 | vec_any_gt(vector char a, vector char b) |
| 1378 | { |
| 1379 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, a, b); |
| 1380 | } |
| 1381 | |
| 1382 | static int _ATTRS_o_ai |
| 1383 | vec_any_gt(vector signed char a, vector signed char b) |
| 1384 | { |
| 1385 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, a, b); |
| 1386 | } |
| 1387 | |
| 1388 | static int _ATTRS_o_ai |
| 1389 | vec_any_gt(vector unsigned char a, vector unsigned char b) |
| 1390 | { |
| 1391 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, a, b); |
| 1392 | } |
| 1393 | |
| 1394 | static int _ATTRS_o_ai |
| 1395 | vec_any_gt(vector short a, vector short b) |
| 1396 | { |
| 1397 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, a, b); |
| 1398 | } |
| 1399 | |
| 1400 | static int _ATTRS_o_ai |
| 1401 | vec_any_gt(vector unsigned short a, vector unsigned short b) |
| 1402 | { |
| 1403 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, a, b); |
| 1404 | } |
| 1405 | |
| 1406 | static int _ATTRS_o_ai |
| 1407 | vec_any_gt(vector int a, vector int b) |
| 1408 | { |
| 1409 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, a, b); |
| 1410 | } |
| 1411 | |
| 1412 | static int _ATTRS_o_ai |
| 1413 | vec_any_gt(vector unsigned int a, vector unsigned int b) |
| 1414 | { |
| 1415 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, a, b); |
| 1416 | } |
| 1417 | |
| 1418 | static int _ATTRS_o_ai |
| 1419 | vec_any_gt(vector float a, vector float b) |
| 1420 | { |
| 1421 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, a, b); |
| 1422 | } |
| 1423 | |
| 1424 | /* vec_any_le */ |
| 1425 | |
| 1426 | static int _ATTRS_o_ai |
| 1427 | vec_any_le(vector char a, vector char b) |
| 1428 | { |
| 1429 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, a, b); |
| 1430 | } |
| 1431 | |
| 1432 | static int _ATTRS_o_ai |
| 1433 | vec_any_le(vector signed char a, vector signed char b) |
| 1434 | { |
| 1435 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, a, b); |
| 1436 | } |
| 1437 | |
| 1438 | static int _ATTRS_o_ai |
| 1439 | vec_any_le(vector unsigned char a, vector unsigned char b) |
| 1440 | { |
| 1441 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, a, b); |
| 1442 | } |
| 1443 | |
| 1444 | static int _ATTRS_o_ai |
| 1445 | vec_any_le(vector short a, vector short b) |
| 1446 | { |
| 1447 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, a, b); |
| 1448 | } |
| 1449 | |
| 1450 | static int _ATTRS_o_ai |
| 1451 | vec_any_le(vector unsigned short a, vector unsigned short b) |
| 1452 | { |
| 1453 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, a, b); |
| 1454 | } |
| 1455 | |
| 1456 | static int _ATTRS_o_ai |
| 1457 | vec_any_le(vector int a, vector int b) |
| 1458 | { |
| 1459 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, a, b); |
| 1460 | } |
| 1461 | |
| 1462 | static int _ATTRS_o_ai |
| 1463 | vec_any_le(vector unsigned int a, vector unsigned int b) |
| 1464 | { |
| 1465 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, a, b); |
| 1466 | } |
| 1467 | |
| 1468 | static int _ATTRS_o_ai |
| 1469 | vec_any_le(vector float a, vector float b) |
| 1470 | { |
| 1471 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, a, b); |
| 1472 | } |
| 1473 | |
| 1474 | /* vec_any_lt */ |
| 1475 | |
| 1476 | static int _ATTRS_o_ai |
| 1477 | vec_any_lt(vector char a, vector char b) |
| 1478 | { |
| 1479 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, b, a); |
| 1480 | } |
| 1481 | |
| 1482 | static int _ATTRS_o_ai |
| 1483 | vec_any_lt(vector signed char a, vector signed char b) |
| 1484 | { |
| 1485 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, b, a); |
| 1486 | } |
| 1487 | |
| 1488 | static int _ATTRS_o_ai |
| 1489 | vec_any_lt(vector unsigned char a, vector unsigned char b) |
| 1490 | { |
| 1491 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, b, a); |
| 1492 | } |
| 1493 | |
| 1494 | static int _ATTRS_o_ai |
| 1495 | vec_any_lt(vector short a, vector short b) |
| 1496 | { |
| 1497 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, b, a); |
| 1498 | } |
| 1499 | |
| 1500 | static int _ATTRS_o_ai |
| 1501 | vec_any_lt(vector unsigned short a, vector unsigned short b) |
| 1502 | { |
| 1503 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, b, a); |
| 1504 | } |
| 1505 | |
| 1506 | static int _ATTRS_o_ai |
| 1507 | vec_any_lt(vector int a, vector int b) |
| 1508 | { |
| 1509 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, b, a); |
| 1510 | } |
| 1511 | |
| 1512 | static int _ATTRS_o_ai |
| 1513 | vec_any_lt(vector unsigned int a, vector unsigned int b) |
| 1514 | { |
| 1515 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, b, a); |
| 1516 | } |
| 1517 | |
| 1518 | static int _ATTRS_o_ai |
| 1519 | vec_any_lt(vector float a, vector float b) |
| 1520 | { |
| 1521 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, b, a); |
| 1522 | } |
| 1523 | |
| 1524 | /* vec_any_nan */ |
| 1525 | |
| 1526 | static int __attribute__((__always_inline__)) |
| 1527 | vec_any_nan(vector float a) |
| 1528 | { |
| 1529 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, a, a); |
| 1530 | } |
| 1531 | |
| 1532 | /* vec_any_ne */ |
| 1533 | |
| 1534 | static int _ATTRS_o_ai |
| 1535 | vec_any_ne(vector char a, vector char b) |
| 1536 | { |
| 1537 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, a, b); |
| 1538 | } |
| 1539 | |
| 1540 | static int _ATTRS_o_ai |
| 1541 | vec_any_ne(vector signed char a, vector signed char b) |
| 1542 | { |
| 1543 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, a, b); |
| 1544 | } |
| 1545 | |
| 1546 | static int _ATTRS_o_ai |
| 1547 | vec_any_ne(vector unsigned char a, vector unsigned char b) |
| 1548 | { |
| 1549 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, a, b); |
| 1550 | } |
| 1551 | |
| 1552 | static int _ATTRS_o_ai |
| 1553 | vec_any_ne(vector short a, vector short b) |
| 1554 | { |
| 1555 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, a, b); |
| 1556 | } |
| 1557 | |
| 1558 | static int _ATTRS_o_ai |
| 1559 | vec_any_ne(vector unsigned short a, vector unsigned short b) |
| 1560 | { |
| 1561 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, a, b); |
| 1562 | } |
| 1563 | |
| 1564 | static int _ATTRS_o_ai |
| 1565 | vec_any_ne(vector int a, vector int b) |
| 1566 | { |
| 1567 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, a, b); |
| 1568 | } |
| 1569 | |
| 1570 | static int _ATTRS_o_ai |
| 1571 | vec_any_ne(vector unsigned int a, vector unsigned int b) |
| 1572 | { |
| 1573 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, a, b); |
| 1574 | } |
| 1575 | |
| 1576 | static int _ATTRS_o_ai |
| 1577 | vec_any_ne(vector float a, vector float b) |
| 1578 | { |
| 1579 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, a, b); |
| 1580 | } |
| 1581 | |
| 1582 | /* vec_any_nge */ |
| 1583 | |
| 1584 | static int __attribute__((__always_inline__)) |
| 1585 | vec_any_nge(vector float a, vector float b) |
| 1586 | { |
| 1587 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, a, b); |
| 1588 | } |
| 1589 | |
| 1590 | /* vec_any_ngt */ |
| 1591 | |
| 1592 | static int __attribute__((__always_inline__)) |
| 1593 | vec_any_ngt(vector float a, vector float b) |
| 1594 | { |
| 1595 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, a, b); |
| 1596 | } |
| 1597 | |
| 1598 | /* vec_any_nle */ |
| 1599 | |
| 1600 | static int __attribute__((__always_inline__)) |
| 1601 | vec_any_nle(vector float a, vector float b) |
| 1602 | { |
| 1603 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, b, a); |
| 1604 | } |
| 1605 | |
| 1606 | /* vec_any_nlt */ |
| 1607 | |
| 1608 | static int __attribute__((__always_inline__)) |
| 1609 | vec_any_nlt(vector float a, vector float b) |
| 1610 | { |
| 1611 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, b, a); |
| 1612 | } |
| 1613 | |
| 1614 | /* vec_any_numeric */ |
| 1615 | |
| 1616 | static int __attribute__((__always_inline__)) |
| 1617 | vec_any_numeric(vector float a) |
| 1618 | { |
| 1619 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, a, a); |
| 1620 | } |
| 1621 | |
| 1622 | /* vec_any_out */ |
| 1623 | |
| 1624 | static int __attribute__((__always_inline__)) |
| 1625 | vec_any_out(vector float a, vector float b) |
| 1626 | { |
| 1627 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, a, b); |
| 1628 | } |
| 1629 | |
| 1630 | #undef _ATTRS_o_ai |
| 1631 | |
| 1632 | #endif /* __ALTIVEC_H */ |