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