1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Generic Opcodes — LLVM 13 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Core Pipeline" href="Pipeline.html" />
<link rel="prev" title="Generic Machine IR" href="GMIR.html" />
<style type="text/css">
table.right { float: right; margin-left: 20px; }
table.right td { border: 1px solid #ccc; }
</style>
</head><body>
<div class="logo">
<a href="../index.html">
<img src="../_static/logo.png"
alt="LLVM Logo" width="250" height="88"/></a>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="Pipeline.html" title="Core Pipeline"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="GMIR.html" title="Generic Machine IR"
accesskey="P">previous</a> |</li>
<li><a href="https://llvm.org/">LLVM Home</a> | </li>
<li><a href="../index.html">Documentation</a>»</li>
<li class="nav-item nav-item-1"><a href="../Reference.html" >Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Global Instruction Selection</a> »</li>
<li class="nav-item nav-item-this"><a href="">Generic Opcodes</a></li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3>Documentation</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/GettingStartedTutorials.html">Getting Started/Tutorials</a></li>
<li><a href="https://llvm.org/docs/UserGuides.html">User Guides</a></li>
<li><a href="https://llvm.org/docs/Reference.html">Reference</a></li>
</ul>
<h3>Getting Involved</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/Contributing.html">Contributing to LLVM</a></li>
<li><a href="https://llvm.org/docs/HowToSubmitABug.html">Submitting Bug Reports</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#mailing-lists">Mailing Lists</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#irc">IRC</a></li>
<li><a href="https://llvm.org/docs/GettingInvolved.html#meetups-and-social-events">Meetups and Social Events</a></li>
</ul>
<h3>Additional Links</h3>
<ul class="want-points">
<li><a href="https://llvm.org/docs/FAQ.html">FAQ</a></li>
<li><a href="https://llvm.org/docs/Lexicon.html">Glossary</a></li>
<li><a href="https://llvm.org/pubs">Publications</a></li>
<li><a href="https://github.com/llvm/llvm-project//">Github Repository</a></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/GlobalISel/GenericOpcode.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="generic-opcodes">
<span id="gmir-opcodes"></span><h1>Generic Opcodes<a class="headerlink" href="#generic-opcodes" title="Permalink to this headline">¶</a></h1>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#constants" id="id1">Constants</a></p>
<ul>
<li><p><a class="reference internal" href="#g-implicit-def" id="id2">G_IMPLICIT_DEF</a></p></li>
<li><p><a class="reference internal" href="#g-constant" id="id3">G_CONSTANT</a></p></li>
<li><p><a class="reference internal" href="#g-fconstant" id="id4">G_FCONSTANT</a></p></li>
<li><p><a class="reference internal" href="#g-frame-index" id="id5">G_FRAME_INDEX</a></p></li>
<li><p><a class="reference internal" href="#g-global-value" id="id6">G_GLOBAL_VALUE</a></p></li>
<li><p><a class="reference internal" href="#g-block-addr" id="id7">G_BLOCK_ADDR</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#integer-extension-and-truncation" id="id8">Integer Extension and Truncation</a></p>
<ul>
<li><p><a class="reference internal" href="#g-anyext" id="id9">G_ANYEXT</a></p></li>
<li><p><a class="reference internal" href="#g-sext" id="id10">G_SEXT</a></p></li>
<li><p><a class="reference internal" href="#g-sext-inreg" id="id11">G_SEXT_INREG</a></p></li>
<li><p><a class="reference internal" href="#g-zext" id="id12">G_ZEXT</a></p></li>
<li><p><a class="reference internal" href="#g-trunc" id="id13">G_TRUNC</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#type-conversions" id="id14">Type Conversions</a></p>
<ul>
<li><p><a class="reference internal" href="#g-inttoptr" id="id15">G_INTTOPTR</a></p></li>
<li><p><a class="reference internal" href="#g-ptrtoint" id="id16">G_PTRTOINT</a></p></li>
<li><p><a class="reference internal" href="#g-bitcast" id="id17">G_BITCAST</a></p></li>
<li><p><a class="reference internal" href="#g-addrspace-cast" id="id18">G_ADDRSPACE_CAST</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#scalar-operations" id="id19">Scalar Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-extract" id="id20">G_EXTRACT</a></p></li>
<li><p><a class="reference internal" href="#g-insert" id="id21">G_INSERT</a></p></li>
<li><p><a class="reference internal" href="#g-merge-values" id="id22">G_MERGE_VALUES</a></p></li>
<li><p><a class="reference internal" href="#g-unmerge-values" id="id23">G_UNMERGE_VALUES</a></p></li>
<li><p><a class="reference internal" href="#g-bswap" id="id24">G_BSWAP</a></p></li>
<li><p><a class="reference internal" href="#g-bitreverse" id="id25">G_BITREVERSE</a></p></li>
<li><p><a class="reference internal" href="#g-sbfx-g-ubfx" id="id26">G_SBFX, G_UBFX</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#integer-operations" id="id27">Integer Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-add-g-sub-g-mul-g-and-g-or-g-xor-g-sdiv-g-udiv-g-srem-g-urem" id="id28">G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR, G_SDIV, G_UDIV, G_SREM, G_UREM</a></p></li>
<li><p><a class="reference internal" href="#g-sdivrem-g-udivrem" id="id29">G_SDIVREM, G_UDIVREM</a></p></li>
<li><p><a class="reference internal" href="#g-saddsat-g-uaddsat-g-ssubsat-g-usubsat-g-sshlsat-g-ushlsat" id="id30">G_SADDSAT, G_UADDSAT, G_SSUBSAT, G_USUBSAT, G_SSHLSAT, G_USHLSAT</a></p></li>
<li><p><a class="reference internal" href="#g-shl-g-lshr-g-ashr" id="id31">G_SHL, G_LSHR, G_ASHR</a></p></li>
<li><p><a class="reference internal" href="#g-rotr-g-rotl" id="id32">G_ROTR, G_ROTL</a></p></li>
<li><p><a class="reference internal" href="#g-icmp" id="id33">G_ICMP</a></p></li>
<li><p><a class="reference internal" href="#g-select" id="id34">G_SELECT</a></p></li>
<li><p><a class="reference internal" href="#g-ptr-add" id="id35">G_PTR_ADD</a></p></li>
<li><p><a class="reference internal" href="#g-ptrmask" id="id36">G_PTRMASK</a></p></li>
<li><p><a class="reference internal" href="#g-smin-g-smax-g-umin-g-umax" id="id37">G_SMIN, G_SMAX, G_UMIN, G_UMAX</a></p></li>
<li><p><a class="reference internal" href="#g-abs" id="id38">G_ABS</a></p></li>
<li><p><a class="reference internal" href="#g-uaddo-g-saddo-g-usubo-g-ssubo-g-smulo-g-umulo" id="id39">G_UADDO, G_SADDO, G_USUBO, G_SSUBO, G_SMULO, G_UMULO</a></p></li>
<li><p><a class="reference internal" href="#g-uadde-g-sadde-g-usube-g-ssube" id="id40">G_UADDE, G_SADDE, G_USUBE, G_SSUBE</a></p></li>
<li><p><a class="reference internal" href="#g-umulh-g-smulh" id="id41">G_UMULH, G_SMULH</a></p></li>
<li><p><a class="reference internal" href="#g-ctlz-g-cttz-g-ctpop" id="id42">G_CTLZ, G_CTTZ, G_CTPOP</a></p></li>
<li><p><a class="reference internal" href="#g-ctlz-zero-undef-g-cttz-zero-undef" id="id43">G_CTLZ_ZERO_UNDEF, G_CTTZ_ZERO_UNDEF</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#floating-point-operations" id="id44">Floating Point Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-fcmp" id="id45">G_FCMP</a></p></li>
<li><p><a class="reference internal" href="#g-fneg" id="id46">G_FNEG</a></p></li>
<li><p><a class="reference internal" href="#g-fpext" id="id47">G_FPEXT</a></p></li>
<li><p><a class="reference internal" href="#g-fptrunc" id="id48">G_FPTRUNC</a></p></li>
<li><p><a class="reference internal" href="#g-fptosi-g-fptoui-g-sitofp-g-uitofp" id="id49">G_FPTOSI, G_FPTOUI, G_SITOFP, G_UITOFP</a></p></li>
<li><p><a class="reference internal" href="#g-fabs" id="id50">G_FABS</a></p></li>
<li><p><a class="reference internal" href="#g-fcopysign" id="id51">G_FCOPYSIGN</a></p></li>
<li><p><a class="reference internal" href="#g-fcanonicalize" id="id52">G_FCANONICALIZE</a></p></li>
<li><p><a class="reference internal" href="#g-fminnum" id="id53">G_FMINNUM</a></p></li>
<li><p><a class="reference internal" href="#g-fmaxnum" id="id54">G_FMAXNUM</a></p></li>
<li><p><a class="reference internal" href="#g-fminnum-ieee" id="id55">G_FMINNUM_IEEE</a></p></li>
<li><p><a class="reference internal" href="#g-fmaxnum-ieee" id="id56">G_FMAXNUM_IEEE</a></p></li>
<li><p><a class="reference internal" href="#g-fminimum" id="id57">G_FMINIMUM</a></p></li>
<li><p><a class="reference internal" href="#g-fmaximum" id="id58">G_FMAXIMUM</a></p></li>
<li><p><a class="reference internal" href="#g-fadd-g-fsub-g-fmul-g-fdiv-g-frem" id="id59">G_FADD, G_FSUB, G_FMUL, G_FDIV, G_FREM</a></p></li>
<li><p><a class="reference internal" href="#g-fma" id="id60">G_FMA</a></p></li>
<li><p><a class="reference internal" href="#g-fmad" id="id61">G_FMAD</a></p></li>
<li><p><a class="reference internal" href="#g-fpow" id="id62">G_FPOW</a></p></li>
<li><p><a class="reference internal" href="#g-fexp-g-fexp2" id="id63">G_FEXP, G_FEXP2</a></p></li>
<li><p><a class="reference internal" href="#g-flog-g-flog2-g-flog10" id="id64">G_FLOG, G_FLOG2, G_FLOG10</a></p></li>
<li><p><a class="reference internal" href="#g-fceil-g-fcos-g-fsin-g-fsqrt-g-ffloor-g-frint-g-fnearbyint" id="id65">G_FCEIL, G_FCOS, G_FSIN, G_FSQRT, G_FFLOOR, G_FRINT, G_FNEARBYINT</a></p></li>
<li><p><a class="reference internal" href="#g-intrinsic-trunc" id="id66">G_INTRINSIC_TRUNC</a></p></li>
<li><p><a class="reference internal" href="#g-intrinsic-round" id="id67">G_INTRINSIC_ROUND</a></p></li>
<li><p><a class="reference internal" href="#g-lround-g-llround" id="id68">G_LROUND, G_LLROUND</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#vector-specific-operations" id="id69">Vector Specific Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-concat-vectors" id="id70">G_CONCAT_VECTORS</a></p></li>
<li><p><a class="reference internal" href="#g-build-vector-g-build-vector-trunc" id="id71">G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC</a></p></li>
<li><p><a class="reference internal" href="#g-insert-vector-elt" id="id72">G_INSERT_VECTOR_ELT</a></p></li>
<li><p><a class="reference internal" href="#g-extract-vector-elt" id="id73">G_EXTRACT_VECTOR_ELT</a></p></li>
<li><p><a class="reference internal" href="#g-shuffle-vector" id="id74">G_SHUFFLE_VECTOR</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#vector-reduction-operations" id="id75">Vector Reduction Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-vecreduce-seq-fadd-g-vecreduce-seq-fmul" id="id76">G_VECREDUCE_SEQ_FADD, G_VECREDUCE_SEQ_FMUL</a></p></li>
<li><p><a class="reference internal" href="#g-vecreduce-fadd-g-vecreduce-fmul" id="id77">G_VECREDUCE_FADD, G_VECREDUCE_FMUL</a></p></li>
<li><p><a class="reference internal" href="#g-vecreduce-fmax-g-vecreduce-fmin" id="id78">G_VECREDUCE_FMAX, G_VECREDUCE_FMIN</a></p></li>
<li><p><a class="reference internal" href="#integer-bitwise-reductions" id="id79">Integer/bitwise reductions</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#memory-operations" id="id80">Memory Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-load-g-sextload-g-zextload" id="id81">G_LOAD, G_SEXTLOAD, G_ZEXTLOAD</a></p></li>
<li><p><a class="reference internal" href="#g-indexed-load" id="id82">G_INDEXED_LOAD</a></p></li>
<li><p><a class="reference internal" href="#g-indexed-sextload" id="id83">G_INDEXED_SEXTLOAD</a></p></li>
<li><p><a class="reference internal" href="#g-indexed-zextload" id="id84">G_INDEXED_ZEXTLOAD</a></p></li>
<li><p><a class="reference internal" href="#g-store" id="id85">G_STORE</a></p></li>
<li><p><a class="reference internal" href="#g-indexed-store" id="id86">G_INDEXED_STORE</a></p></li>
<li><p><a class="reference internal" href="#g-atomic-cmpxchg-with-success" id="id87">G_ATOMIC_CMPXCHG_WITH_SUCCESS</a></p></li>
<li><p><a class="reference internal" href="#g-atomic-cmpxchg" id="id88">G_ATOMIC_CMPXCHG</a></p></li>
<li><p><a class="reference internal" href="#g-atomicrmw-xchg-g-atomicrmw-add-g-atomicrmw-sub-g-atomicrmw-and-g-atomicrmw-nand-g-atomicrmw-or-g-atomicrmw-xor-g-atomicrmw-max-g-atomicrmw-min-g-atomicrmw-umax-g-atomicrmw-umin-g-atomicrmw-fadd-g-atomicrmw-fsub" id="id89">G_ATOMICRMW_XCHG, G_ATOMICRMW_ADD, G_ATOMICRMW_SUB, G_ATOMICRMW_AND, G_ATOMICRMW_NAND, G_ATOMICRMW_OR, G_ATOMICRMW_XOR, G_ATOMICRMW_MAX, G_ATOMICRMW_MIN, G_ATOMICRMW_UMAX, G_ATOMICRMW_UMIN, G_ATOMICRMW_FADD, G_ATOMICRMW_FSUB</a></p></li>
<li><p><a class="reference internal" href="#g-fence" id="id90">G_FENCE</a></p></li>
<li><p><a class="reference internal" href="#g-memcpy" id="id91">G_MEMCPY</a></p></li>
<li><p><a class="reference internal" href="#g-memcpy-inline" id="id92">G_MEMCPY_INLINE</a></p></li>
<li><p><a class="reference internal" href="#g-memmove" id="id93">G_MEMMOVE</a></p></li>
<li><p><a class="reference internal" href="#g-memset" id="id94">G_MEMSET</a></p></li>
<li><p><a class="reference internal" href="#g-bzero" id="id95">G_BZERO</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#control-flow" id="id96">Control Flow</a></p>
<ul>
<li><p><a class="reference internal" href="#g-phi" id="id97">G_PHI</a></p></li>
<li><p><a class="reference internal" href="#g-br" id="id98">G_BR</a></p></li>
<li><p><a class="reference internal" href="#g-brcond" id="id99">G_BRCOND</a></p></li>
<li><p><a class="reference internal" href="#g-brindirect" id="id100">G_BRINDIRECT</a></p></li>
<li><p><a class="reference internal" href="#g-brjt" id="id101">G_BRJT</a></p></li>
<li><p><a class="reference internal" href="#g-jump-table" id="id102">G_JUMP_TABLE</a></p></li>
<li><p><a class="reference internal" href="#g-intrinsic-g-intrinsic-w-side-effects" id="id103">G_INTRINSIC, G_INTRINSIC_W_SIDE_EFFECTS</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#variadic-arguments" id="id104">Variadic Arguments</a></p>
<ul>
<li><p><a class="reference internal" href="#g-vastart" id="id105">G_VASTART</a></p></li>
<li><p><a class="reference internal" href="#g-vaarg" id="id106">G_VAARG</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#other-operations" id="id107">Other Operations</a></p>
<ul>
<li><p><a class="reference internal" href="#g-dyn-stackalloc" id="id108">G_DYN_STACKALLOC</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#optimization-hints" id="id109">Optimization Hints</a></p>
<ul>
<li><p><a class="reference internal" href="#g-assert-sext-g-assert-zext" id="id110">G_ASSERT_SEXT, G_ASSERT_ZEXT</a></p></li>
</ul>
</li>
</ul>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This documentation does not yet fully account for vectors. Many of the
scalar/integer/floating-point operations can also take vectors.</p>
</div>
<div class="section" id="constants">
<h2><a class="toc-backref" href="#id1">Constants</a><a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-implicit-def">
<h3><a class="toc-backref" href="#id2">G_IMPLICIT_DEF</a><a class="headerlink" href="#g-implicit-def" title="Permalink to this headline">¶</a></h3>
<p>An undefined value.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%0:_(s32) = G_IMPLICIT_DEF
</pre></div>
</div>
</div>
<div class="section" id="g-constant">
<h3><a class="toc-backref" href="#id3">G_CONSTANT</a><a class="headerlink" href="#g-constant" title="Permalink to this headline">¶</a></h3>
<p>An integer constant.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%0:_(s32) = G_CONSTANT i32 1
</pre></div>
</div>
</div>
<div class="section" id="g-fconstant">
<h3><a class="toc-backref" href="#id4">G_FCONSTANT</a><a class="headerlink" href="#g-fconstant" title="Permalink to this headline">¶</a></h3>
<p>A floating point constant.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%0:_(s32) = G_FCONSTANT float 1.0
</pre></div>
</div>
</div>
<div class="section" id="g-frame-index">
<h3><a class="toc-backref" href="#id5">G_FRAME_INDEX</a><a class="headerlink" href="#g-frame-index" title="Permalink to this headline">¶</a></h3>
<p>The address of an object in the stack frame.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(p0) = G_FRAME_INDEX %stack.0.ptr0
</pre></div>
</div>
</div>
<div class="section" id="g-global-value">
<h3><a class="toc-backref" href="#id6">G_GLOBAL_VALUE</a><a class="headerlink" href="#g-global-value" title="Permalink to this headline">¶</a></h3>
<p>The address of a global value.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%0(p0) = G_GLOBAL_VALUE @var_local
</pre></div>
</div>
</div>
<div class="section" id="g-block-addr">
<h3><a class="toc-backref" href="#id7">G_BLOCK_ADDR</a><a class="headerlink" href="#g-block-addr" title="Permalink to this headline">¶</a></h3>
<p>The address of a basic block.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%0:_(p0) = G_BLOCK_ADDR blockaddress(@test_blockaddress, %ir-block.block)
</pre></div>
</div>
</div>
</div>
<div class="section" id="integer-extension-and-truncation">
<h2><a class="toc-backref" href="#id8">Integer Extension and Truncation</a><a class="headerlink" href="#integer-extension-and-truncation" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-anyext">
<h3><a class="toc-backref" href="#id9">G_ANYEXT</a><a class="headerlink" href="#g-anyext" title="Permalink to this headline">¶</a></h3>
<p>Extend the underlying scalar type of an operation, leaving the high bits
unspecified.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_ANYEXT %0:_(s16)
</pre></div>
</div>
</div>
<div class="section" id="g-sext">
<h3><a class="toc-backref" href="#id10">G_SEXT</a><a class="headerlink" href="#g-sext" title="Permalink to this headline">¶</a></h3>
<p>Sign extend the underlying scalar type of an operation, copying the sign bit
into the newly-created space.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_SEXT %0:_(s16)
</pre></div>
</div>
</div>
<div class="section" id="g-sext-inreg">
<h3><a class="toc-backref" href="#id11">G_SEXT_INREG</a><a class="headerlink" href="#g-sext-inreg" title="Permalink to this headline">¶</a></h3>
<p>Sign extend the value from an arbitrary bit position, copying the sign bit
into all bits above it. This is equivalent to a shl + ashr pair with an
appropriate shift amount. $sz is an immediate (MachineOperand::isImm()
returns true) to allow targets to have some bitwidths legal and others
lowered. This opcode is particularly useful if the target has sign-extension
instructions that are cheaper than the constituent shifts as the optimizer is
able to make decisions on whether it’s better to hang on to the G_SEXT_INREG
or to lower it and optimize the individual shifts.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_SEXT_INREG %0:_(s32), 16
</pre></div>
</div>
</div>
<div class="section" id="g-zext">
<h3><a class="toc-backref" href="#id12">G_ZEXT</a><a class="headerlink" href="#g-zext" title="Permalink to this headline">¶</a></h3>
<p>Zero extend the underlying scalar type of an operation, putting zero bits
into the newly-created space.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_ZEXT %0:_(s16)
</pre></div>
</div>
</div>
<div class="section" id="g-trunc">
<h3><a class="toc-backref" href="#id13">G_TRUNC</a><a class="headerlink" href="#g-trunc" title="Permalink to this headline">¶</a></h3>
<p>Truncate the underlying scalar type of an operation. This is equivalent to
G_EXTRACT for scalar types, but acts elementwise on vectors.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s16) = G_TRUNC %0:_(s32)
</pre></div>
</div>
</div>
</div>
<div class="section" id="type-conversions">
<h2><a class="toc-backref" href="#id14">Type Conversions</a><a class="headerlink" href="#type-conversions" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-inttoptr">
<h3><a class="toc-backref" href="#id15">G_INTTOPTR</a><a class="headerlink" href="#g-inttoptr" title="Permalink to this headline">¶</a></h3>
<p>Convert an integer to a pointer.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(p0) = G_INTTOPTR %0:_(s32)
</pre></div>
</div>
</div>
<div class="section" id="g-ptrtoint">
<h3><a class="toc-backref" href="#id16">G_PTRTOINT</a><a class="headerlink" href="#g-ptrtoint" title="Permalink to this headline">¶</a></h3>
<p>Convert a pointer to an integer.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_PTRTOINT %0:_(p0)
</pre></div>
</div>
</div>
<div class="section" id="g-bitcast">
<h3><a class="toc-backref" href="#id17">G_BITCAST</a><a class="headerlink" href="#g-bitcast" title="Permalink to this headline">¶</a></h3>
<p>Reinterpret a value as a new type. This is usually done without
changing any bits but this is not always the case due a subtlety in the
definition of the <a class="reference internal" href="../LangRef.html#i-bitcast"><span class="std std-ref">LLVM-IR Bitcast Instruction</span></a>. It
is allowed to bitcast between pointers with the same size, but
different address spaces.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s64) = G_BITCAST %0:_(<2 x s32>)
</pre></div>
</div>
</div>
<div class="section" id="g-addrspace-cast">
<h3><a class="toc-backref" href="#id18">G_ADDRSPACE_CAST</a><a class="headerlink" href="#g-addrspace-cast" title="Permalink to this headline">¶</a></h3>
<p>Convert a pointer to an address space to a pointer to another address space.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(p1) = G_ADDRSPACE_CAST %0:_(p0)
</pre></div>
</div>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p><a class="reference internal" href="../LangRef.html#i-addrspacecast"><span class="std std-ref">‘addrspacecast .. to’ Instruction</span></a> doesn’t mention what happens if the cast is simply
invalid (i.e. if the address spaces are disjoint).</p>
</div>
</div>
</div>
<div class="section" id="scalar-operations">
<h2><a class="toc-backref" href="#id19">Scalar Operations</a><a class="headerlink" href="#scalar-operations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-extract">
<h3><a class="toc-backref" href="#id20">G_EXTRACT</a><a class="headerlink" href="#g-extract" title="Permalink to this headline">¶</a></h3>
<p>Extract a register of the specified size, starting from the block given by
index. This will almost certainly be mapped to sub-register COPYs after
register banks have been selected.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%3:_(s32) = G_EXTRACT %2:_(s64), 32
</pre></div>
</div>
</div>
<div class="section" id="g-insert">
<h3><a class="toc-backref" href="#id21">G_INSERT</a><a class="headerlink" href="#g-insert" title="Permalink to this headline">¶</a></h3>
<p>Insert a smaller register into a larger one at the specified bit-index.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%2:_(s64) = G_INSERT %0:(_s64), %1:_(s32), 0
</pre></div>
</div>
</div>
<div class="section" id="g-merge-values">
<h3><a class="toc-backref" href="#id22">G_MERGE_VALUES</a><a class="headerlink" href="#g-merge-values" title="Permalink to this headline">¶</a></h3>
<p>Concatenate multiple registers of the same size into a wider register.
The input operands are always ordered from lowest bits to highest:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%0:(s32) = G_MERGE_VALUES %bits_0_7:(s8), %bits_8_15:(s8),
%bits_16_23:(s8), %bits_24_31:(s8)
</pre></div>
</div>
</div>
<div class="section" id="g-unmerge-values">
<h3><a class="toc-backref" href="#id23">G_UNMERGE_VALUES</a><a class="headerlink" href="#g-unmerge-values" title="Permalink to this headline">¶</a></h3>
<p>Extract multiple registers of the specified size, starting from blocks given by
indexes. This will almost certainly be mapped to sub-register COPYs after
register banks have been selected.
The output operands are always ordered from lowest bits to highest:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%bits_0_7:(s8), %bits_8_15:(s8),
%bits_16_23:(s8), %bits_24_31:(s8) = G_UNMERGE_VALUES %0:(s32)
</pre></div>
</div>
</div>
<div class="section" id="g-bswap">
<h3><a class="toc-backref" href="#id24">G_BSWAP</a><a class="headerlink" href="#g-bswap" title="Permalink to this headline">¶</a></h3>
<p>Reverse the order of the bytes in a scalar.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_BSWAP %0:_(s32)
</pre></div>
</div>
</div>
<div class="section" id="g-bitreverse">
<h3><a class="toc-backref" href="#id25">G_BITREVERSE</a><a class="headerlink" href="#g-bitreverse" title="Permalink to this headline">¶</a></h3>
<p>Reverse the order of the bits in a scalar.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_BITREVERSE %0:_(s32)
</pre></div>
</div>
</div>
<div class="section" id="g-sbfx-g-ubfx">
<h3><a class="toc-backref" href="#id26">G_SBFX, G_UBFX</a><a class="headerlink" href="#g-sbfx-g-ubfx" title="Permalink to this headline">¶</a></h3>
<p>Extract a range of bits from a register.</p>
<p>The source operands are registers as follows:</p>
<ul class="simple">
<li><p>Source</p></li>
<li><p>The least-significant bit for the extraction</p></li>
<li><p>The width of the extraction</p></li>
</ul>
<p>The least-significant bit (lsb) and width operands are in the range:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">0</span> <span class="o"><=</span> <span class="n">lsb</span> <span class="o"><</span> <span class="n">lsb</span> <span class="o">+</span> <span class="n">width</span> <span class="o"><=</span> <span class="n">source</span> <span class="n">bitwidth</span><span class="p">,</span> <span class="n">where</span> <span class="nb">all</span> <span class="n">values</span> <span class="n">are</span> <span class="n">unsigned</span>
</pre></div>
</div>
<p>G_SBFX sign-extends the result, while G_UBFX zero-extends the result.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>; Extract 5 bits starting at bit 1 from %x and store them in %a.
; Sign-extend the result.
;
; Example:
; %x = 0...0000[10110]1 ---> %a = 1...111111[10110]
%lsb_one = G_CONSTANT i32 1
%width_five = G_CONSTANT i32 5
%a:_(s32) = G_SBFX %x, %lsb_one, %width_five
; Extract 3 bits starting at bit 2 from %x and store them in %b. Zero-extend
; the result.
;
; Example:
; %x = 1...11111[100]11 ---> %b = 0...00000[100]
%lsb_two = G_CONSTANT i32 2
%width_three = G_CONSTANT i32 3
%b:_(s32) = G_UBFX %x, %lsb_two, %width_three
</pre></div>
</div>
</div>
</div>
<div class="section" id="integer-operations">
<h2><a class="toc-backref" href="#id27">Integer Operations</a><a class="headerlink" href="#integer-operations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-add-g-sub-g-mul-g-and-g-or-g-xor-g-sdiv-g-udiv-g-srem-g-urem">
<h3><a class="toc-backref" href="#id28">G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR, G_SDIV, G_UDIV, G_SREM, G_UREM</a><a class="headerlink" href="#g-add-g-sub-g-mul-g-and-g-or-g-xor-g-sdiv-g-udiv-g-srem-g-urem" title="Permalink to this headline">¶</a></h3>
<p>These each perform their respective integer arithmetic on a scalar.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%dst:_(s32) = G_ADD %src0:_(s32), %src1:_(s32)
</pre></div>
</div>
<p>The above example adds %src1 to %src0 and stores the result in %dst.</p>
</div>
<div class="section" id="g-sdivrem-g-udivrem">
<h3><a class="toc-backref" href="#id29">G_SDIVREM, G_UDIVREM</a><a class="headerlink" href="#g-sdivrem-g-udivrem" title="Permalink to this headline">¶</a></h3>
<p>Perform integer division and remainder thereby producing two results.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%div:_(s32), %rem:_(s32) = G_SDIVREM %0:_(s32), %1:_(s32)
</pre></div>
</div>
</div>
<div class="section" id="g-saddsat-g-uaddsat-g-ssubsat-g-usubsat-g-sshlsat-g-ushlsat">
<h3><a class="toc-backref" href="#id30">G_SADDSAT, G_UADDSAT, G_SSUBSAT, G_USUBSAT, G_SSHLSAT, G_USHLSAT</a><a class="headerlink" href="#g-saddsat-g-uaddsat-g-ssubsat-g-usubsat-g-sshlsat-g-ushlsat" title="Permalink to this headline">¶</a></h3>
<p>Signed and unsigned addition, subtraction and left shift with saturation.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%2:_(s32) = G_SADDSAT %0:_(s32), %1:_(s32)
</pre></div>
</div>
</div>
<div class="section" id="g-shl-g-lshr-g-ashr">
<h3><a class="toc-backref" href="#id31">G_SHL, G_LSHR, G_ASHR</a><a class="headerlink" href="#g-shl-g-lshr-g-ashr" title="Permalink to this headline">¶</a></h3>
<p>Shift the bits of a scalar left or right inserting zeros (sign-bit for G_ASHR).</p>
</div>
<div class="section" id="g-rotr-g-rotl">
<h3><a class="toc-backref" href="#id32">G_ROTR, G_ROTL</a><a class="headerlink" href="#g-rotr-g-rotl" title="Permalink to this headline">¶</a></h3>
<p>Rotate the bits right (G_ROTR) or left (G_ROTL).</p>
</div>
<div class="section" id="g-icmp">
<h3><a class="toc-backref" href="#id33">G_ICMP</a><a class="headerlink" href="#g-icmp" title="Permalink to this headline">¶</a></h3>
<p>Perform integer comparison producing non-zero (true) or zero (false). It’s
target specific whether a true value is 1, ~0U, or some other non-zero value.</p>
</div>
<div class="section" id="g-select">
<h3><a class="toc-backref" href="#id34">G_SELECT</a><a class="headerlink" href="#g-select" title="Permalink to this headline">¶</a></h3>
<p>Select between two values depending on a zero/non-zero value.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%5:_(s32) = G_SELECT %4(s1), %6, %2
</pre></div>
</div>
</div>
<div class="section" id="g-ptr-add">
<h3><a class="toc-backref" href="#id35">G_PTR_ADD</a><a class="headerlink" href="#g-ptr-add" title="Permalink to this headline">¶</a></h3>
<p>Add a scalar offset in addressible units to a pointer. Addressible units are
typically bytes but this may vary between targets.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(p0) = G_PTR_ADD %0:_(p0), %1:_(s32)
</pre></div>
</div>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>There are currently no in-tree targets that use this with addressable units
not equal to 8 bit.</p>
</div>
</div>
<div class="section" id="g-ptrmask">
<h3><a class="toc-backref" href="#id36">G_PTRMASK</a><a class="headerlink" href="#g-ptrmask" title="Permalink to this headline">¶</a></h3>
<p>Zero out an arbitrary mask of bits of a pointer. The mask type must be
an integer, and the number of vector elements must match for all
operands. This corresponds to <cite>i_intr_llvm_ptrmask</cite>.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%2:_(p0) = G_PTRMASK %0, %1
</pre></div>
</div>
</div>
<div class="section" id="g-smin-g-smax-g-umin-g-umax">
<h3><a class="toc-backref" href="#id37">G_SMIN, G_SMAX, G_UMIN, G_UMAX</a><a class="headerlink" href="#g-smin-g-smax-g-umin-g-umax" title="Permalink to this headline">¶</a></h3>
<p>Take the minimum/maximum of two values.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%5:_(s32) = G_SMIN %6, %2
</pre></div>
</div>
</div>
<div class="section" id="g-abs">
<h3><a class="toc-backref" href="#id38">G_ABS</a><a class="headerlink" href="#g-abs" title="Permalink to this headline">¶</a></h3>
<p>Take the absolute value of a signed integer. The absolute value of the minimum
negative value (e.g. the 8-bit value <cite>0x80</cite>) is defined to be itself.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%1:_(s32) = G_ABS %0
</pre></div>
</div>
</div>
<div class="section" id="g-uaddo-g-saddo-g-usubo-g-ssubo-g-smulo-g-umulo">
<h3><a class="toc-backref" href="#id39">G_UADDO, G_SADDO, G_USUBO, G_SSUBO, G_SMULO, G_UMULO</a><a class="headerlink" href="#g-uaddo-g-saddo-g-usubo-g-ssubo-g-smulo-g-umulo" title="Permalink to this headline">¶</a></h3>
<p>Perform the requested arithmetic and produce a carry output in addition to the
normal result.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%3:_(s32), %4:_(s1) = G_UADDO %0, %1
</pre></div>
</div>
</div>
<div class="section" id="g-uadde-g-sadde-g-usube-g-ssube">
<h3><a class="toc-backref" href="#id40">G_UADDE, G_SADDE, G_USUBE, G_SSUBE</a><a class="headerlink" href="#g-uadde-g-sadde-g-usube-g-ssube" title="Permalink to this headline">¶</a></h3>
<p>Perform the requested arithmetic and consume a carry input in addition to the
normal input. Also produce a carry output in addition to the normal result.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%4:_(s32), %5:_(s1) = G_UADDE %0, %1, %3:_(s1)
</pre></div>
</div>
</div>
<div class="section" id="g-umulh-g-smulh">
<h3><a class="toc-backref" href="#id41">G_UMULH, G_SMULH</a><a class="headerlink" href="#g-umulh-g-smulh" title="Permalink to this headline">¶</a></h3>
<p>Multiply two numbers at twice the incoming bit width (signed) and return
the high half of the result.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%3:_(s32) = G_UMULH %0, %1
</pre></div>
</div>
</div>
<div class="section" id="g-ctlz-g-cttz-g-ctpop">
<h3><a class="toc-backref" href="#id42">G_CTLZ, G_CTTZ, G_CTPOP</a><a class="headerlink" href="#g-ctlz-g-cttz-g-ctpop" title="Permalink to this headline">¶</a></h3>
<p>Count leading zeros, trailing zeros, or number of set bits.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%2:_(s33) = G_CTLZ_ZERO_UNDEF %1
%2:_(s33) = G_CTTZ_ZERO_UNDEF %1
%2:_(s33) = G_CTPOP %1
</pre></div>
</div>
</div>
<div class="section" id="g-ctlz-zero-undef-g-cttz-zero-undef">
<h3><a class="toc-backref" href="#id43">G_CTLZ_ZERO_UNDEF, G_CTTZ_ZERO_UNDEF</a><a class="headerlink" href="#g-ctlz-zero-undef-g-cttz-zero-undef" title="Permalink to this headline">¶</a></h3>
<p>Count leading zeros or trailing zeros. If the value is zero then the result is
undefined.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%2:_(s33) = G_CTLZ_ZERO_UNDEF %1
%2:_(s33) = G_CTTZ_ZERO_UNDEF %1
</pre></div>
</div>
</div>
</div>
<div class="section" id="floating-point-operations">
<h2><a class="toc-backref" href="#id44">Floating Point Operations</a><a class="headerlink" href="#floating-point-operations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-fcmp">
<h3><a class="toc-backref" href="#id45">G_FCMP</a><a class="headerlink" href="#g-fcmp" title="Permalink to this headline">¶</a></h3>
<p>Perform floating point comparison producing non-zero (true) or zero
(false). It’s target specific whether a true value is 1, ~0U, or some other
non-zero value.</p>
</div>
<div class="section" id="g-fneg">
<h3><a class="toc-backref" href="#id46">G_FNEG</a><a class="headerlink" href="#g-fneg" title="Permalink to this headline">¶</a></h3>
<p>Floating point negation.</p>
</div>
<div class="section" id="g-fpext">
<h3><a class="toc-backref" href="#id47">G_FPEXT</a><a class="headerlink" href="#g-fpext" title="Permalink to this headline">¶</a></h3>
<p>Convert a floating point value to a larger type.</p>
</div>
<div class="section" id="g-fptrunc">
<h3><a class="toc-backref" href="#id48">G_FPTRUNC</a><a class="headerlink" href="#g-fptrunc" title="Permalink to this headline">¶</a></h3>
<p>Convert a floating point value to a narrower type.</p>
</div>
<div class="section" id="g-fptosi-g-fptoui-g-sitofp-g-uitofp">
<h3><a class="toc-backref" href="#id49">G_FPTOSI, G_FPTOUI, G_SITOFP, G_UITOFP</a><a class="headerlink" href="#g-fptosi-g-fptoui-g-sitofp-g-uitofp" title="Permalink to this headline">¶</a></h3>
<p>Convert between integer and floating point.</p>
</div>
<div class="section" id="g-fabs">
<h3><a class="toc-backref" href="#id50">G_FABS</a><a class="headerlink" href="#g-fabs" title="Permalink to this headline">¶</a></h3>
<p>Take the absolute value of a floating point value.</p>
</div>
<div class="section" id="g-fcopysign">
<h3><a class="toc-backref" href="#id51">G_FCOPYSIGN</a><a class="headerlink" href="#g-fcopysign" title="Permalink to this headline">¶</a></h3>
<p>Copy the value of the first operand, replacing the sign bit with that of the
second operand.</p>
</div>
<div class="section" id="g-fcanonicalize">
<h3><a class="toc-backref" href="#id52">G_FCANONICALIZE</a><a class="headerlink" href="#g-fcanonicalize" title="Permalink to this headline">¶</a></h3>
<p>See <a class="reference internal" href="../LangRef.html#i-intr-llvm-canonicalize"><span class="std std-ref">‘llvm.canonicalize.*’ Intrinsic</span></a>.</p>
</div>
<div class="section" id="g-fminnum">
<h3><a class="toc-backref" href="#id53">G_FMINNUM</a><a class="headerlink" href="#g-fminnum" title="Permalink to this headline">¶</a></h3>
<p>Perform floating-point minimum on two values.</p>
<p>In the case where a single input is a NaN (either signaling or quiet),
the non-NaN input is returned.</p>
<p>The return value of (FMINNUM 0.0, -0.0) could be either 0.0 or -0.0.</p>
</div>
<div class="section" id="g-fmaxnum">
<h3><a class="toc-backref" href="#id54">G_FMAXNUM</a><a class="headerlink" href="#g-fmaxnum" title="Permalink to this headline">¶</a></h3>
<p>Perform floating-point maximum on two values.</p>
<p>In the case where a single input is a NaN (either signaling or quiet),
the non-NaN input is returned.</p>
<p>The return value of (FMAXNUM 0.0, -0.0) could be either 0.0 or -0.0.</p>
</div>
<div class="section" id="g-fminnum-ieee">
<h3><a class="toc-backref" href="#id55">G_FMINNUM_IEEE</a><a class="headerlink" href="#g-fminnum-ieee" title="Permalink to this headline">¶</a></h3>
<p>Perform floating-point minimum on two values, following the IEEE-754 2008
definition. This differs from FMINNUM in the handling of signaling NaNs. If one
input is a signaling NaN, returns a quiet NaN.</p>
</div>
<div class="section" id="g-fmaxnum-ieee">
<h3><a class="toc-backref" href="#id56">G_FMAXNUM_IEEE</a><a class="headerlink" href="#g-fmaxnum-ieee" title="Permalink to this headline">¶</a></h3>
<p>Perform floating-point maximum on two values, following the IEEE-754 2008
definition. This differs from FMAXNUM in the handling of signaling NaNs. If one
input is a signaling NaN, returns a quiet NaN.</p>
</div>
<div class="section" id="g-fminimum">
<h3><a class="toc-backref" href="#id57">G_FMINIMUM</a><a class="headerlink" href="#g-fminimum" title="Permalink to this headline">¶</a></h3>
<p>NaN-propagating minimum that also treat -0.0 as less than 0.0. While
FMINNUM_IEEE follow IEEE 754-2008 semantics, FMINIMUM follows IEEE 754-2018
draft semantics.</p>
</div>
<div class="section" id="g-fmaximum">
<h3><a class="toc-backref" href="#id58">G_FMAXIMUM</a><a class="headerlink" href="#g-fmaximum" title="Permalink to this headline">¶</a></h3>
<p>NaN-propagating maximum that also treat -0.0 as less than 0.0. While
FMAXNUM_IEEE follow IEEE 754-2008 semantics, FMAXIMUM follows IEEE 754-2018
draft semantics.</p>
</div>
<div class="section" id="g-fadd-g-fsub-g-fmul-g-fdiv-g-frem">
<h3><a class="toc-backref" href="#id59">G_FADD, G_FSUB, G_FMUL, G_FDIV, G_FREM</a><a class="headerlink" href="#g-fadd-g-fsub-g-fmul-g-fdiv-g-frem" title="Permalink to this headline">¶</a></h3>
<p>Perform the specified floating point arithmetic.</p>
</div>
<div class="section" id="g-fma">
<h3><a class="toc-backref" href="#id60">G_FMA</a><a class="headerlink" href="#g-fma" title="Permalink to this headline">¶</a></h3>
<p>Perform a fused multiply add (i.e. without the intermediate rounding step).</p>
</div>
<div class="section" id="g-fmad">
<h3><a class="toc-backref" href="#id61">G_FMAD</a><a class="headerlink" href="#g-fmad" title="Permalink to this headline">¶</a></h3>
<p>Perform a non-fused multiply add (i.e. with the intermediate rounding step).</p>
</div>
<div class="section" id="g-fpow">
<h3><a class="toc-backref" href="#id62">G_FPOW</a><a class="headerlink" href="#g-fpow" title="Permalink to this headline">¶</a></h3>
<p>Raise the first operand to the power of the second.</p>
</div>
<div class="section" id="g-fexp-g-fexp2">
<h3><a class="toc-backref" href="#id63">G_FEXP, G_FEXP2</a><a class="headerlink" href="#g-fexp-g-fexp2" title="Permalink to this headline">¶</a></h3>
<p>Calculate the base-e or base-2 exponential of a value</p>
</div>
<div class="section" id="g-flog-g-flog2-g-flog10">
<h3><a class="toc-backref" href="#id64">G_FLOG, G_FLOG2, G_FLOG10</a><a class="headerlink" href="#g-flog-g-flog2-g-flog10" title="Permalink to this headline">¶</a></h3>
<p>Calculate the base-e, base-2, or base-10 respectively.</p>
</div>
<div class="section" id="g-fceil-g-fcos-g-fsin-g-fsqrt-g-ffloor-g-frint-g-fnearbyint">
<h3><a class="toc-backref" href="#id65">G_FCEIL, G_FCOS, G_FSIN, G_FSQRT, G_FFLOOR, G_FRINT, G_FNEARBYINT</a><a class="headerlink" href="#g-fceil-g-fcos-g-fsin-g-fsqrt-g-ffloor-g-frint-g-fnearbyint" title="Permalink to this headline">¶</a></h3>
<p>These correspond to the standard C functions of the same name.</p>
</div>
<div class="section" id="g-intrinsic-trunc">
<h3><a class="toc-backref" href="#id66">G_INTRINSIC_TRUNC</a><a class="headerlink" href="#g-intrinsic-trunc" title="Permalink to this headline">¶</a></h3>
<p>Returns the operand rounded to the nearest integer not larger in magnitude than the operand.</p>
</div>
<div class="section" id="g-intrinsic-round">
<h3><a class="toc-backref" href="#id67">G_INTRINSIC_ROUND</a><a class="headerlink" href="#g-intrinsic-round" title="Permalink to this headline">¶</a></h3>
<p>Returns the operand rounded to the nearest integer.</p>
</div>
<div class="section" id="g-lround-g-llround">
<h3><a class="toc-backref" href="#id68">G_LROUND, G_LLROUND</a><a class="headerlink" href="#g-lround-g-llround" title="Permalink to this headline">¶</a></h3>
<p>Returns the source operand rounded to the nearest integer with ties away from
zero.</p>
<p>See the LLVM LangRef entry on ‘<code class="docutils literal notranslate"><span class="pre">llvm.lround.*'</span></code> for details on behaviour.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%rounded_32:_(s32) = G_LROUND %round_me:_(s64)
%rounded_64:_(s64) = G_LLROUND %round_me:_(s64)
</pre></div>
</div>
</div>
</div>
<div class="section" id="vector-specific-operations">
<h2><a class="toc-backref" href="#id69">Vector Specific Operations</a><a class="headerlink" href="#vector-specific-operations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-concat-vectors">
<h3><a class="toc-backref" href="#id70">G_CONCAT_VECTORS</a><a class="headerlink" href="#g-concat-vectors" title="Permalink to this headline">¶</a></h3>
<p>Concatenate two vectors to form a longer vector.</p>
</div>
<div class="section" id="g-build-vector-g-build-vector-trunc">
<h3><a class="toc-backref" href="#id71">G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC</a><a class="headerlink" href="#g-build-vector-g-build-vector-trunc" title="Permalink to this headline">¶</a></h3>
<p>Create a vector from multiple scalar registers. No implicit
conversion is performed (i.e. the result element type must be the
same as all source operands)</p>
<p>The _TRUNC version truncates the larger operand types to fit the
destination vector elt type.</p>
</div>
<div class="section" id="g-insert-vector-elt">
<h3><a class="toc-backref" href="#id72">G_INSERT_VECTOR_ELT</a><a class="headerlink" href="#g-insert-vector-elt" title="Permalink to this headline">¶</a></h3>
<p>Insert an element into a vector</p>
</div>
<div class="section" id="g-extract-vector-elt">
<h3><a class="toc-backref" href="#id73">G_EXTRACT_VECTOR_ELT</a><a class="headerlink" href="#g-extract-vector-elt" title="Permalink to this headline">¶</a></h3>
<p>Extract an element from a vector</p>
</div>
<div class="section" id="g-shuffle-vector">
<h3><a class="toc-backref" href="#id74">G_SHUFFLE_VECTOR</a><a class="headerlink" href="#g-shuffle-vector" title="Permalink to this headline">¶</a></h3>
<p>Concatenate two vectors and shuffle the elements according to the mask operand.
The mask operand should be an IR Constant which exactly matches the
corresponding mask for the IR shufflevector instruction.</p>
</div>
</div>
<div class="section" id="vector-reduction-operations">
<h2><a class="toc-backref" href="#id75">Vector Reduction Operations</a><a class="headerlink" href="#vector-reduction-operations" title="Permalink to this headline">¶</a></h2>
<p>These operations represent horizontal vector reduction, producing a scalar result.</p>
<div class="section" id="g-vecreduce-seq-fadd-g-vecreduce-seq-fmul">
<h3><a class="toc-backref" href="#id76">G_VECREDUCE_SEQ_FADD, G_VECREDUCE_SEQ_FMUL</a><a class="headerlink" href="#g-vecreduce-seq-fadd-g-vecreduce-seq-fmul" title="Permalink to this headline">¶</a></h3>
<p>The SEQ variants perform reductions in sequential order. The first operand is
an initial scalar accumulator value, and the second operand is the vector to reduce.</p>
</div>
<div class="section" id="g-vecreduce-fadd-g-vecreduce-fmul">
<h3><a class="toc-backref" href="#id77">G_VECREDUCE_FADD, G_VECREDUCE_FMUL</a><a class="headerlink" href="#g-vecreduce-fadd-g-vecreduce-fmul" title="Permalink to this headline">¶</a></h3>
<p>These reductions are relaxed variants which may reduce the elements in any order.</p>
</div>
<div class="section" id="g-vecreduce-fmax-g-vecreduce-fmin">
<h3><a class="toc-backref" href="#id78">G_VECREDUCE_FMAX, G_VECREDUCE_FMIN</a><a class="headerlink" href="#g-vecreduce-fmax-g-vecreduce-fmin" title="Permalink to this headline">¶</a></h3>
<p>FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.</p>
</div>
<div class="section" id="integer-bitwise-reductions">
<h3><a class="toc-backref" href="#id79">Integer/bitwise reductions</a><a class="headerlink" href="#integer-bitwise-reductions" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><p>G_VECREDUCE_ADD</p></li>
<li><p>G_VECREDUCE_MUL</p></li>
<li><p>G_VECREDUCE_AND</p></li>
<li><p>G_VECREDUCE_OR</p></li>
<li><p>G_VECREDUCE_XOR</p></li>
<li><p>G_VECREDUCE_SMAX</p></li>
<li><p>G_VECREDUCE_SMIN</p></li>
<li><p>G_VECREDUCE_UMAX</p></li>
<li><p>G_VECREDUCE_UMIN</p></li>
</ul>
<p>Integer reductions may have a result type larger than the vector element type.
However, the reduction is performed using the vector element type and the value
in the top bits is unspecified.</p>
</div>
</div>
<div class="section" id="memory-operations">
<h2><a class="toc-backref" href="#id80">Memory Operations</a><a class="headerlink" href="#memory-operations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-load-g-sextload-g-zextload">
<h3><a class="toc-backref" href="#id81">G_LOAD, G_SEXTLOAD, G_ZEXTLOAD</a><a class="headerlink" href="#g-load-g-sextload-g-zextload" title="Permalink to this headline">¶</a></h3>
<p>Generic load. Expects a MachineMemOperand in addition to explicit
operands. If the result size is larger than the memory size, the
high bits are undefined, sign-extended, or zero-extended respectively.</p>
<p>Only G_LOAD is valid if the result is a vector type. If the result is larger
than the memory size, the high elements are undefined (i.e. this is not a
per-element, vector anyextload)</p>
</div>
<div class="section" id="g-indexed-load">
<h3><a class="toc-backref" href="#id82">G_INDEXED_LOAD</a><a class="headerlink" href="#g-indexed-load" title="Permalink to this headline">¶</a></h3>
<p>Generic indexed load. Combines a GEP with a load. $newaddr is set to $base + $offset.
If $am is 0 (post-indexed), then the value is loaded from $base; if $am is 1 (pre-indexed)
then the value is loaded from $newaddr.</p>
</div>
<div class="section" id="g-indexed-sextload">
<h3><a class="toc-backref" href="#id83">G_INDEXED_SEXTLOAD</a><a class="headerlink" href="#g-indexed-sextload" title="Permalink to this headline">¶</a></h3>
<p>Same as G_INDEXED_LOAD except that the load performed is sign-extending, as with G_SEXTLOAD.</p>
</div>
<div class="section" id="g-indexed-zextload">
<h3><a class="toc-backref" href="#id84">G_INDEXED_ZEXTLOAD</a><a class="headerlink" href="#g-indexed-zextload" title="Permalink to this headline">¶</a></h3>
<p>Same as G_INDEXED_LOAD except that the load performed is zero-extending, as with G_ZEXTLOAD.</p>
</div>
<div class="section" id="g-store">
<h3><a class="toc-backref" href="#id85">G_STORE</a><a class="headerlink" href="#g-store" title="Permalink to this headline">¶</a></h3>
<p>Generic store. Expects a MachineMemOperand in addition to explicit
operands. If the stored value size is greater than the memory size,
the high bits are implicitly truncated. If this is a vector store, the
high elements are discarded (i.e. this does not function as a per-lane
vector, truncating store)</p>
</div>
<div class="section" id="g-indexed-store">
<h3><a class="toc-backref" href="#id86">G_INDEXED_STORE</a><a class="headerlink" href="#g-indexed-store" title="Permalink to this headline">¶</a></h3>
<p>Combines a store with a GEP. See description of G_INDEXED_LOAD for indexing behaviour.</p>
</div>
<div class="section" id="g-atomic-cmpxchg-with-success">
<h3><a class="toc-backref" href="#id87">G_ATOMIC_CMPXCHG_WITH_SUCCESS</a><a class="headerlink" href="#g-atomic-cmpxchg-with-success" title="Permalink to this headline">¶</a></h3>
<p>Generic atomic cmpxchg with internal success check. Expects a
MachineMemOperand in addition to explicit operands.</p>
</div>
<div class="section" id="g-atomic-cmpxchg">
<h3><a class="toc-backref" href="#id88">G_ATOMIC_CMPXCHG</a><a class="headerlink" href="#g-atomic-cmpxchg" title="Permalink to this headline">¶</a></h3>
<p>Generic atomic cmpxchg. Expects a MachineMemOperand in addition to explicit
operands.</p>
</div>
<div class="section" id="g-atomicrmw-xchg-g-atomicrmw-add-g-atomicrmw-sub-g-atomicrmw-and-g-atomicrmw-nand-g-atomicrmw-or-g-atomicrmw-xor-g-atomicrmw-max-g-atomicrmw-min-g-atomicrmw-umax-g-atomicrmw-umin-g-atomicrmw-fadd-g-atomicrmw-fsub">
<h3><a class="toc-backref" href="#id89">G_ATOMICRMW_XCHG, G_ATOMICRMW_ADD, G_ATOMICRMW_SUB, G_ATOMICRMW_AND, G_ATOMICRMW_NAND, G_ATOMICRMW_OR, G_ATOMICRMW_XOR, G_ATOMICRMW_MAX, G_ATOMICRMW_MIN, G_ATOMICRMW_UMAX, G_ATOMICRMW_UMIN, G_ATOMICRMW_FADD, G_ATOMICRMW_FSUB</a><a class="headerlink" href="#g-atomicrmw-xchg-g-atomicrmw-add-g-atomicrmw-sub-g-atomicrmw-and-g-atomicrmw-nand-g-atomicrmw-or-g-atomicrmw-xor-g-atomicrmw-max-g-atomicrmw-min-g-atomicrmw-umax-g-atomicrmw-umin-g-atomicrmw-fadd-g-atomicrmw-fsub" title="Permalink to this headline">¶</a></h3>
<p>Generic atomicrmw. Expects a MachineMemOperand in addition to explicit
operands.</p>
</div>
<div class="section" id="g-fence">
<h3><a class="toc-backref" href="#id90">G_FENCE</a><a class="headerlink" href="#g-fence" title="Permalink to this headline">¶</a></h3>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>I couldn’t find any documentation on this at the time of writing.</p>
</div>
</div>
<div class="section" id="g-memcpy">
<h3><a class="toc-backref" href="#id91">G_MEMCPY</a><a class="headerlink" href="#g-memcpy" title="Permalink to this headline">¶</a></h3>
<p>Generic memcpy. Expects two MachineMemOperands covering the store and load
respectively, in addition to explicit operands.</p>
</div>
<div class="section" id="g-memcpy-inline">
<h3><a class="toc-backref" href="#id92">G_MEMCPY_INLINE</a><a class="headerlink" href="#g-memcpy-inline" title="Permalink to this headline">¶</a></h3>
<p>Generic inlined memcpy. Like G_MEMCPY, but it is guaranteed that this version
will not be lowered as a call to an external function. Currently the size
operand is required to evaluate as a constant (not an immediate), though that is
expected to change when llvm.memcpy.inline is taught to support dynamic sizes.</p>
</div>
<div class="section" id="g-memmove">
<h3><a class="toc-backref" href="#id93">G_MEMMOVE</a><a class="headerlink" href="#g-memmove" title="Permalink to this headline">¶</a></h3>
<p>Generic memmove. Similar to G_MEMCPY, but the source and destination memory
ranges are allowed to overlap.</p>
</div>
<div class="section" id="g-memset">
<h3><a class="toc-backref" href="#id94">G_MEMSET</a><a class="headerlink" href="#g-memset" title="Permalink to this headline">¶</a></h3>
<p>Generic memset. Expects a MachineMemOperand in addition to explicit operands.</p>
</div>
<div class="section" id="g-bzero">
<h3><a class="toc-backref" href="#id95">G_BZERO</a><a class="headerlink" href="#g-bzero" title="Permalink to this headline">¶</a></h3>
<p>Generic bzero. Expects a MachineMemOperand in addition to explicit operands.</p>
</div>
</div>
<div class="section" id="control-flow">
<h2><a class="toc-backref" href="#id96">Control Flow</a><a class="headerlink" href="#control-flow" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-phi">
<h3><a class="toc-backref" href="#id97">G_PHI</a><a class="headerlink" href="#g-phi" title="Permalink to this headline">¶</a></h3>
<p>Implement the φ node in the SSA graph representing the function.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%dst(s8) = G_PHI %src1(s8), %bb.<id1>, %src2(s8), %bb.<id2>
</pre></div>
</div>
</div>
<div class="section" id="g-br">
<h3><a class="toc-backref" href="#id98">G_BR</a><a class="headerlink" href="#g-br" title="Permalink to this headline">¶</a></h3>
<p>Unconditional branch</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>G_BR %bb.<id>
</pre></div>
</div>
</div>
<div class="section" id="g-brcond">
<h3><a class="toc-backref" href="#id99">G_BRCOND</a><a class="headerlink" href="#g-brcond" title="Permalink to this headline">¶</a></h3>
<p>Conditional branch</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>G_BRCOND %condition, %basicblock.<id>
</pre></div>
</div>
</div>
<div class="section" id="g-brindirect">
<h3><a class="toc-backref" href="#id100">G_BRINDIRECT</a><a class="headerlink" href="#g-brindirect" title="Permalink to this headline">¶</a></h3>
<p>Indirect branch</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>G_BRINDIRECT %src(p0)
</pre></div>
</div>
</div>
<div class="section" id="g-brjt">
<h3><a class="toc-backref" href="#id101">G_BRJT</a><a class="headerlink" href="#g-brjt" title="Permalink to this headline">¶</a></h3>
<p>Indirect branch to jump table entry</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>G_BRJT %ptr(p0), %jti, %idx(s64)
</pre></div>
</div>
</div>
<div class="section" id="g-jump-table">
<h3><a class="toc-backref" href="#id102">G_JUMP_TABLE</a><a class="headerlink" href="#g-jump-table" title="Permalink to this headline">¶</a></h3>
<p>Generates a pointer to the address of the jump table specified by the source
operand. The source operand is a jump table index.
G_JUMP_TABLE can be used in conjunction with G_BRJT to support jump table
codegen with GlobalISel.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%dst:_(p0) = G_JUMP_TABLE %jump-table.0
</pre></div>
</div>
<p>The above example generates a pointer to the source jump table index.</p>
</div>
<div class="section" id="g-intrinsic-g-intrinsic-w-side-effects">
<h3><a class="toc-backref" href="#id103">G_INTRINSIC, G_INTRINSIC_W_SIDE_EFFECTS</a><a class="headerlink" href="#g-intrinsic-g-intrinsic-w-side-effects" title="Permalink to this headline">¶</a></h3>
<p>Call an intrinsic</p>
<p>The _W_SIDE_EFFECTS version is considered to have unknown side-effects and
as such cannot be reordered across other side-effecting instructions.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Unlike SelectionDAG, there is no _VOID variant. Both of these are permitted
to have zero, one, or multiple results.</p>
</div>
</div>
</div>
<div class="section" id="variadic-arguments">
<h2><a class="toc-backref" href="#id104">Variadic Arguments</a><a class="headerlink" href="#variadic-arguments" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-vastart">
<h3><a class="toc-backref" href="#id105">G_VASTART</a><a class="headerlink" href="#g-vastart" title="Permalink to this headline">¶</a></h3>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>I found no documentation for this instruction at the time of writing.</p>
</div>
</div>
<div class="section" id="g-vaarg">
<h3><a class="toc-backref" href="#id106">G_VAARG</a><a class="headerlink" href="#g-vaarg" title="Permalink to this headline">¶</a></h3>
<div class="admonition caution">
<p class="admonition-title">Caution</p>
<p>I found no documentation for this instruction at the time of writing.</p>
</div>
</div>
</div>
<div class="section" id="other-operations">
<h2><a class="toc-backref" href="#id107">Other Operations</a><a class="headerlink" href="#other-operations" title="Permalink to this headline">¶</a></h2>
<div class="section" id="g-dyn-stackalloc">
<h3><a class="toc-backref" href="#id108">G_DYN_STACKALLOC</a><a class="headerlink" href="#g-dyn-stackalloc" title="Permalink to this headline">¶</a></h3>
<p>Dynamically realigns the stack pointer to the specified size and alignment.
An alignment value of <cite>0</cite> or <cite>1</cite> means no specific alignment.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%8:_(p0) = G_DYN_STACKALLOC %7(s64), 32
</pre></div>
</div>
</div>
</div>
<div class="section" id="optimization-hints">
<h2><a class="toc-backref" href="#id109">Optimization Hints</a><a class="headerlink" href="#optimization-hints" title="Permalink to this headline">¶</a></h2>
<p>These instructions do not correspond to any target instructions. They act as
hints for various combines.</p>
<div class="section" id="g-assert-sext-g-assert-zext">
<h3><a class="toc-backref" href="#id110">G_ASSERT_SEXT, G_ASSERT_ZEXT</a><a class="headerlink" href="#g-assert-sext-g-assert-zext" title="Permalink to this headline">¶</a></h3>
<p>This signifies that the contents of a register were previously extended from a
smaller type.</p>
<p>The smaller type is denoted using an immediate operand. For scalars, this is the
width of the entire smaller type. For vectors, this is the width of the smaller
element type.</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>%x_was_zexted:_(s32) = G_ASSERT_ZEXT %x(s32), 16
%y_was_zexted:_(<2 x s32>) = G_ASSERT_ZEXT %y(<2 x s32>), 16
%z_was_sexted:_(s32) = G_ASSERT_SEXT %z(s32), 8
</pre></div>
</div>
<p>G_ASSERT_SEXT and G_ASSERT_ZEXT act like copies, albeit with some restrictions.</p>
<p>The source and destination registers must</p>
<ul class="simple">
<li><p>Be virtual</p></li>
<li><p>Belong to the same register class</p></li>
<li><p>Belong to the same register bank</p></li>
</ul>
<p>It should always be safe to</p>
<ul class="simple">
<li><p>Look through the source register</p></li>
<li><p>Replace the destination register with the source register</p></li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="Pipeline.html" title="Core Pipeline"
>next</a> |</li>
<li class="right" >
<a href="GMIR.html" title="Generic Machine IR"
>previous</a> |</li>
<li><a href="https://llvm.org/">LLVM Home</a> | </li>
<li><a href="../index.html">Documentation</a>»</li>
<li class="nav-item nav-item-1"><a href="../Reference.html" >Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" >Global Instruction Selection</a> »</li>
<li class="nav-item nav-item-this"><a href="">Generic Opcodes</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2003-2021, LLVM Project.
Last updated on 2021-09-18.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.4.
</div>
</body>
</html>
|