Knowledge (XXG)

Intrinsic function

Source 📝

32: 836: 336:(based on platform specific compiler flags), providing fully portable high-level primitives (e.g., a four-element floating-point vector type) mapped onto the appropriate 913: 309:. To compensate for this, new intrinsics have been added that map to standard assembly instructions that are not normally accessible through C/C++, e.g., bit scan. 340:
implementations, while still benefiting from the C++ type system and inlining; hence the advantage over linking to hand-written assembly object files, using the C
164:. Unlike an inline function, the compiler has an intimate knowledge of an intrinsic function and can thus better integrate and optimize it for a given situation. 844: 518:
also has intrinsics for specific Java APIs. Hotspot intrinsics are standard Java APIs which may have one or more optimized implementation on some platforms.
949: 699: 49: 207:-aware operations during compiling. The compiler parses the intrinsic functions and converts them into vector math or multiprocessing 192: 115: 96: 68: 965: 337: 53: 970: 329: 75: 589: 341: 215:. Some intrinsics are used to provide additional constraints to the optimizer, such as values a variable cannot assume. 157: 784: 756: 728: 695: 642: 316:
built-ins) are slightly more abstracted, approximating the abilities of several contemporary platforms, with portable
82: 278: 42: 508: 257: 188: 877: 675: 562:
A builtin function is identified by leaving its name undeclared and allowing it to default, or by declaring it
515: 229: 64: 559:
Individual compilers have added additional builtins specific to a machine architecture or operating system.
333: 313: 298: 237: 184: 294: 252: 320:
implementations on platforms with no appropriate instructions. It is common for C++ libraries, such as
312:
Some C and C++ compilers provide non-portable platform-specific intrinsics. Other intrinsics (such as
615: 511: 212: 149: 20: 290: 168: 732: 907: 864: 788: 760: 944: 89: 707: 302: 812: 671: 204: 167:
Compilers that implement intrinsic functions may enable them only when a program requests
161: 172: 837:"Sony open sources Vector Math and SIMD math libraries (Cell PPU/SPU/other platforms)" 959: 646: 566:. A user-supplied function of the same name can be substituted by declaring it as 530:
defines nearly 90 builtin functions. These are conventionally grouped as follows:
208: 31: 171:, otherwise falling back to a default implementation provided by the language 145: 792: 764: 736: 703: 650: 153: 129: 196: 19:
This article is about compiler intrinsic functions. For X toolkit, see
306: 286: 203:, use intrinsic functions to declare, respectively, vectorizable and 200: 156:. Typically, it may substitute a sequence of automatically generated 233: 270: 16:
Function whose implementation is handled specially by the compiler
527: 325: 282: 274: 266: 262: 248: 241: 25: 549:
Storage Control builtin functions, for example ADDR, POINTER
543:
Array-handling builtin functions, for example ANY, ALL, PROD
672:"Built-in Functions Specific to Particular Target Machines" 183:
Intrinsic functions are often used to explicitly implement
584: 582: 590:"Intel® C++ Compiler 19.1 Developer Guide and Reference" 546:
Condition-handling builtin functions like ONCODE, ONFILE
191:
in languages which do not address such constructs. Some
534:
String-handling builtin functions such as INDEX, LENGTH
540:
Mathematical builtin functions like SIN, COS, LOG, ERF
537:
Arithmetic builtin functions such as ABS, CEIL, ROUND
900:
American National Standard programming language PL/I
495:// calculates a*b + c for three vectors of 16 floats 240:(GCC) implement intrinsics that map directly to the 56:. Unsourced material may be challenged and removed. 555:Miscellaneous builtin functions like DATE and TIME 152:whose implementation is handled specially by the 456:// calculates a + b for two vectors of 16 floats 426:// 64 bit * 64 bit => 128 bit multiplication 160:for the original function call, similar to an 8: 929:IBM PL/I for MVS & VM Language Reference 912:: CS1 maint: numeric names: authors list ( 116:Learn how and when to remove this message 817:Using the GNU Compiler Collection (GCC) 578: 905: 7: 363:// return internal CPU clock counter 54:adding citations to reliable sources 193:application programming interfaces 14: 878:"Intrinsic Methods in HotSpot VM" 594:Intel® C++ Compiler Documentation 245:single instruction, multiple data 179:Vectorization and parallelization 952:, IBM AIX 6.1 documentation 789:"Intrinsics and Inline Assembly" 761:"Intrinsics and Inline Assembly" 733:"Intrinsics and Inline Assembly" 700:"Intrinsics and Inline Assembly" 30: 236:, of Microsoft, Intel, and the 148:) available for use in a given 41:needs additional citations for 876:Mok, Kris (25 February 2013). 338:low level programming language 1: 552:Input-Output builtins: LINENO 332:, to achieve portability via 342:application binary interface 616:"Clang Language Extensions" 211:appropriate for the target 987: 898:ANSI X3 Committee (1976). 18: 384:// count of bits set in n 258:Streaming SIMD Extensions 132:, in compiler theory, an 927:IBM Corporation (1995). 676:Free Software Foundation 351: 301:does not support inline 950:Using milicode routines 614:The Clang Team (2020). 334:conditional compilation 299:Microsoft Visual Studio 238:GNU Compiler Collection 219:By programming language 945:Intel Intrinsics Guide 620:Clang 11 documentation 330:vector maths libraries 966:Compiler construction 647:"Compiler Intrinsics" 516:just-in-time compiler 971:Computer programming 512:Java virtual machine 295:Microsoft Visual C++ 195:(API), for example, 150:programming language 65:"Intrinsic function" 50:improve this article 21:X Toolkit Intrinsics 813:"Vector Extensions" 670:GCC documentation. 596:. 16 December 2019 134:intrinsic function 630:Builtin Functions 144:, is a function ( 138:built-in function 130:computer software 126: 125: 118: 100: 978: 933: 932: 924: 918: 917: 911: 903: 895: 889: 888: 886: 885: 873: 867: 865:Intel Intrinsics 862: 856: 855: 853: 852: 843:. Archived from 833: 827: 826: 824: 823: 809: 803: 802: 800: 799: 781: 775: 774: 772: 771: 753: 747: 746: 744: 743: 725: 719: 718: 716: 715: 706:. Archived from 692: 686: 685: 683: 682: 667: 661: 660: 658: 657: 639: 633: 632: 627: 626: 611: 605: 604: 602: 601: 586: 569: 565: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 361: 358: 355: 251:) instructions ( 142:builtin function 121: 114: 110: 107: 101: 99: 58: 34: 26: 986: 985: 981: 980: 979: 977: 976: 975: 956: 955: 941: 936: 926: 925: 921: 904: 897: 896: 892: 883: 881: 875: 874: 870: 863: 859: 850: 848: 835: 834: 830: 821: 819: 811: 810: 806: 797: 795: 783: 782: 778: 769: 767: 755: 754: 750: 741: 739: 727: 726: 722: 713: 711: 694: 693: 689: 680: 678: 669: 668: 664: 655: 653: 641: 640: 636: 624: 622: 613: 612: 608: 599: 597: 588: 587: 580: 576: 567: 563: 524: 505: 498: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 462:_mm512_fmadd_ps 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 359: 356: 353: 350: 226: 221: 205:multiprocessing 189:parallelization 181: 175:(environment). 162:inline function 122: 111: 105: 102: 59: 57: 47: 35: 24: 17: 12: 11: 5: 984: 982: 974: 973: 968: 958: 957: 954: 953: 947: 940: 939:External links 937: 935: 934: 919: 890: 868: 857: 841:Beyond3D Forum 828: 804: 776: 748: 720: 687: 662: 634: 606: 577: 575: 572: 557: 556: 553: 550: 547: 544: 541: 538: 535: 523: 520: 504: 501: 352: 349: 346: 228:Compilers for 225: 222: 220: 217: 180: 177: 173:runtime system 136:, also called 124: 123: 38: 36: 29: 15: 13: 10: 9: 6: 4: 3: 2: 983: 972: 969: 967: 964: 963: 961: 951: 948: 946: 943: 942: 938: 930: 923: 920: 915: 909: 901: 894: 891: 879: 872: 869: 866: 861: 858: 847:on 2016-06-24 846: 842: 838: 832: 829: 818: 814: 808: 805: 794: 790: 786: 780: 777: 766: 762: 758: 752: 749: 738: 734: 730: 724: 721: 710:on 2018-01-02 709: 705: 701: 697: 691: 688: 677: 673: 666: 663: 652: 648: 644: 638: 635: 631: 621: 617: 610: 607: 595: 591: 585: 583: 579: 573: 571: 560: 554: 551: 548: 545: 542: 539: 536: 533: 532: 531: 529: 521: 519: 517: 513: 510: 502: 500: 432:_mm512_add_ps 347: 345: 343: 339: 335: 331: 327: 323: 319: 315: 310: 308: 304: 300: 296: 292: 288: 284: 280: 276: 272: 268: 264: 260: 259: 254: 250: 246: 243: 239: 235: 231: 223: 218: 216: 214: 210: 206: 202: 198: 194: 190: 186: 185:vectorization 178: 176: 174: 170: 165: 163: 159: 155: 151: 147: 143: 139: 135: 131: 120: 117: 109: 106:December 2009 98: 95: 91: 88: 84: 81: 77: 74: 70: 67: –  66: 62: 61:Find sources: 55: 51: 45: 44: 39:This article 37: 33: 28: 27: 22: 928: 922: 899: 893: 882:. Retrieved 880:. Slideshare 871: 860: 849:. Retrieved 845:the original 840: 831: 820:. Retrieved 816: 807: 796:. Retrieved 779: 768:. Retrieved 751: 740:. Retrieved 723: 712:. Retrieved 708:the original 690: 679:. Retrieved 665: 654:. Retrieved 637: 629: 623:. Retrieved 619: 609: 598:. Retrieved 593: 561: 558: 525: 506: 499: 321: 317: 311: 297:compiler of 293:, ...). The 256: 244: 227: 182: 169:optimization 166: 158:instructions 141: 137: 133: 127: 112: 103: 93: 86: 79: 72: 60: 48:Please help 43:verification 40: 420:HighProduct 209:object code 960:Categories 884:2014-12-20 851:2020-01-17 822:2020-01-16 798:2011-09-28 770:2011-09-28 742:2011-09-28 714:2010-04-16 681:2012-06-20 656:2012-06-20 625:2020-01-17 600:2020-01-17 574:References 369:__popcnt64 146:subroutine 76:newspapers 908:cite book 793:Microsoft 765:Microsoft 737:Microsoft 704:Microsoft 651:Microsoft 526:ANSI/ISO 514:'s (JVM) 318:fall back 224:C and C++ 414:uint64_t 405:uint64_t 396:uint64_t 390:_umul128 387:uint64_t 375:uint64_t 366:uint64_t 354:uint64_t 348:Examples 303:assembly 213:platform 154:compiler 564:BUILTIN 509:HotSpot 408:Factor2 399:Factor1 357:__rdtsc 344:(ABI). 261:(SSE), 197:AltiVec 90:scholar 486:__m512 477:__m512 468:__m512 459:__m512 447:__m512 438:__m512 429:__m512 307:x86-64 287:AVX512 201:OpenMP 92:  85:  78:  71:  63:  568:ENTRY 271:SSSE3 97:JSTOR 83:books 914:link 785:MSDN 757:MSDN 729:MSDN 696:MSDN 643:MSDN 528:PL/I 522:PL/I 507:The 503:Java 326:Sony 305:for 283:AVX2 275:SSE4 267:SSE3 263:SSE2 249:SIMD 232:and 199:and 187:and 69:news 360:(); 328:'s 324:or 322:glm 314:GNU 291:FMA 279:AVX 253:MMX 242:x86 234:C++ 140:or 128:In 52:by 962:: 910:}} 906:{{ 839:. 815:. 791:. 787:. 763:. 759:. 735:. 731:. 702:. 698:. 674:. 649:. 645:. 628:. 618:. 592:. 581:^ 570:. 492:); 453:); 423:); 381:); 289:, 285:, 281:, 277:, 273:, 269:, 265:, 255:, 931:. 916:) 902:. 887:. 854:. 825:. 801:. 773:. 745:. 717:. 684:. 659:. 603:. 489:c 483:, 480:b 474:, 471:a 465:( 450:b 444:, 441:a 435:( 417:* 411:, 402:, 393:( 378:n 372:( 247:( 230:C 119:) 113:( 108:) 104:( 94:· 87:· 80:· 73:· 46:. 23:.

Index

X Toolkit Intrinsics

verification
improve this article
adding citations to reliable sources
"Intrinsic function"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
computer software
subroutine
programming language
compiler
instructions
inline function
optimization
runtime system
vectorization
parallelization
application programming interfaces
AltiVec
OpenMP
multiprocessing
object code
platform
C
C++

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.