import {AssemblyInstructionInfo} from '../base';

export function getAsmOpcode(opcode: string | undefined): AssemblyInstructionInfo | undefined {
    if (!opcode) return;
    switch (opcode.toUpperCase()) {
        case 'RET':
            return {
                url: `https://llvm.org/docs/LangRef.html#ret-instruction`,
                html: `<span id="i-ret"></span><h4><a class="toc-backref" href="#id1799">‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ Instruction</a><a class="headerlink" href="#ret-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="syntax"><h5>Syntax:<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ret</span> <span class="o">&lt;</span><span class="nb">type</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">value</span><span class="o">&gt;</span>       <span class="p">;</span> <span class="n">Return</span> <span class="n">a</span> <span class="n">value</span> <span class="kn">from</span> <span class="nn">a</span> <span class="n">non</span><span class="o">-</span><span class="n">void</span> <span class="n">function</span><span class="n">ret</span> <span class="n">void</span>                 <span class="p">;</span> <span class="n">Return</span> <span class="kn">from</span> <span class="nn">void</span> <span class="n">function</span></pre></div></div></div><div class="section" id="overview"><h5>Overview:<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction is used to return control flow (and optionallya value) from a function back to the caller.</p><p>There are two forms of the ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction: one that returns avalue and then causes control flow, and one that just causes controlflow to occur.</p></div><div class="section" id="arguments"><h5>Arguments:<a class="headerlink" href="#arguments" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction optionally accepts a single argument, thereturn value. The type of the return value must be a ‘<a class="reference internal" href="#t-firstclass"><span class="std std-ref">firstclass</span></a>’ type.</p><p>A function is not <a class="reference internal" href="#wellformed"><span class="std std-ref">well formed</span></a> if it has a non-voidreturn type and contains a ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction with no return value ora return value with a type that does not match its type, or if it has avoid return type and contains a ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction with a returnvalue.</p></div><div class="section" id="id29"><h5>Semantics:<a class="headerlink" href="#id29" title="Permalink to this headline">¶</a></h5><p>When the ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction is executed, control flow returns back tothe calling function’s context. If the caller is a“<a class="reference internal" href="#i-call"><span class="std std-ref">call</span></a>” instruction, execution continues at theinstruction after the call. If the caller was an“<a class="reference internal" href="#i-invoke"><span class="std std-ref">invoke</span></a>” instruction, execution continues at thebeginning of the “normal” destination block. If the instruction returnsa value, that value shall set the call or invoke instruction’s returnvalue.</p></div><div class="section" id="example"><h5>Example:<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span><span class="k">ret</span> <span class="kt">i32</span> <span class="m">5</span>                       <span class="c">; Return an integer value of 5</span><span class="k">ret</span> <span class="k">void</span>                        <span class="c">; Return from a void function</span><span class="k">ret</span> <span class="p">{</span> <span class="kt">i32</span><span class="p">,</span> <span class="kt">i8</span> <span class="p">}</span> <span class="p">{</span> <span class="kt">i32</span> <span class="m">4</span><span class="p">,</span> <span class="kt">i8</span> <span class="m">2</span> <span class="p">}</span> <span class="c">; Return a struct of values 4 and 2</span></pre></div></div></div>`,
                tooltip: `There are two forms of the ‘ret’ instruction: one that returns avalue and then causes control flow, and one that just causes controlflow to occur.`,
            };
        case 'BR':
            return {
                url: `https://llvm.org/docs/LangRef.html#br-instruction`,
                html: `<span id="i-br"></span><h4><a class="toc-backref" href="#id1800">‘<code class="docutils literal notranslate"><span class="pre">br</span></code>’ Instruction</a><a class="headerlink" href="#br-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id30"><h5>Syntax:<a class="headerlink" href="#id30" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">br</span> <span class="n">i1</span> <span class="o">&lt;</span><span class="n">cond</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">iftrue</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">iffalse</span><span class="o">&gt;</span><span class="n">br</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">dest</span><span class="o">&gt;</span>          <span class="p">;</span> <span class="n">Unconditional</span> <span class="n">branch</span></pre></div></div></div><div class="section" id="id31"><h5>Overview:<a class="headerlink" href="#id31" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">br</span></code>’ instruction is used to cause control flow to transfer to adifferent basic block in the current function. There are two forms ofthis instruction, corresponding to a conditional branch and anunconditional branch.</p></div><div class="section" id="id32"><h5>Arguments:<a class="headerlink" href="#id32" title="Permalink to this headline">¶</a></h5><p>The conditional branch form of the ‘<code class="docutils literal notranslate"><span class="pre">br</span></code>’ instruction takes a single‘<code class="docutils literal notranslate"><span class="pre">i1</span></code>’ value and two ‘<code class="docutils literal notranslate"><span class="pre">label</span></code>’ values. The unconditional form of the‘<code class="docutils literal notranslate"><span class="pre">br</span></code>’ instruction takes a single ‘<code class="docutils literal notranslate"><span class="pre">label</span></code>’ value as a target.</p></div><div class="section" id="id33"><h5>Semantics:<a class="headerlink" href="#id33" title="Permalink to this headline">¶</a></h5><p>Upon execution of a conditional ‘<code class="docutils literal notranslate"><span class="pre">br</span></code>’ instruction, the ‘<code class="docutils literal notranslate"><span class="pre">i1</span></code>’argument is evaluated. If the value is <code class="docutils literal notranslate"><span class="pre">true</span></code>, control flows to the‘<code class="docutils literal notranslate"><span class="pre">iftrue</span></code>’ <code class="docutils literal notranslate"><span class="pre">label</span></code> argument. If “cond” is <code class="docutils literal notranslate"><span class="pre">false</span></code>, control flowsto the ‘<code class="docutils literal notranslate"><span class="pre">iffalse</span></code>’ <code class="docutils literal notranslate"><span class="pre">label</span></code> argument.If ‘<code class="docutils literal notranslate"><span class="pre">cond</span></code>’ is <code class="docutils literal notranslate"><span class="pre">poison</span></code> or <code class="docutils literal notranslate"><span class="pre">undef</span></code>, this instruction has undefinedbehavior.</p></div><div class="section" id="id34"><h5>Example:<a class="headerlink" href="#id34" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span><span class="nl">Test:</span>  <span class="nv">%cond</span> <span class="p">=</span> <span class="k">icmp</span> <span class="k">eq</span> <span class="kt">i32</span> <span class="nv">%a</span><span class="p">,</span> <span class="nv">%b</span>  <span class="k">br</span> <span class="kt">i1</span> <span class="nv">%cond</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%IfEqual</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%IfUnequal</span><span class="nl">IfEqual:</span>  <span class="k">ret</span> <span class="kt">i32</span> <span class="m">1</span><span class="nl">IfUnequal:</span>  <span class="k">ret</span> <span class="kt">i32</span> <span class="m">0</span></pre></div></div></div>`,
                tooltip: `The conditional branch form of the ‘br’ instruction takes a single‘i1’ value and two ‘label’ values. The unconditional form of the‘br’ instruction takes a single ‘label’ value as a target.`,
            };
        case 'SWITCH':
            return {
                url: `https://llvm.org/docs/LangRef.html#switch-instruction`,
                html: `<span id="i-switch"></span><h4><a class="toc-backref" href="#id1801">‘<code class="docutils literal notranslate"><span class="pre">switch</span></code>’ Instruction</a><a class="headerlink" href="#switch-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id35"><h5>Syntax:<a class="headerlink" href="#id35" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">switch</span> <span class="o">&lt;</span><span class="n">intty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">value</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">defaultdest</span><span class="o">&gt;</span> <span class="p">[</span> <span class="o">&lt;</span><span class="n">intty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">val</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">dest</span><span class="o">&gt;</span> <span class="o">...</span> <span class="p">]</span></pre></div></div></div><div class="section" id="id36"><h5>Overview:<a class="headerlink" href="#id36" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">switch</span></code>’ instruction is used to transfer control flow to one ofseveral different places. It is a generalization of the ‘<code class="docutils literal notranslate"><span class="pre">br</span></code>’instruction, allowing a branch to occur to one of many possibledestinations.</p></div><div class="section" id="id37"><h5>Arguments:<a class="headerlink" href="#id37" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">switch</span></code>’ instruction uses three parameters: an integercomparison value ‘<code class="docutils literal notranslate"><span class="pre">value</span></code>’, a default ‘<code class="docutils literal notranslate"><span class="pre">label</span></code>’ destination, and anarray of pairs of comparison value constants and ‘<code class="docutils literal notranslate"><span class="pre">label</span></code>’s. The tableis not allowed to contain duplicate constant entries.</p></div><div class="section" id="id38"><h5>Semantics:<a class="headerlink" href="#id38" title="Permalink to this headline">¶</a></h5><p>The <code class="docutils literal notranslate"><span class="pre">switch</span></code> instruction specifies a table of values and destinations.When the ‘<code class="docutils literal notranslate"><span class="pre">switch</span></code>’ instruction is executed, this table is searchedfor the given value. If the value is found, control flow is transferredto the corresponding destination; otherwise, control flow is transferredto the default destination.If ‘<code class="docutils literal notranslate"><span class="pre">value</span></code>’ is <code class="docutils literal notranslate"><span class="pre">poison</span></code> or <code class="docutils literal notranslate"><span class="pre">undef</span></code>, this instruction has undefinedbehavior.</p></div><div class="section" id="implementation"><h5>Implementation:<a class="headerlink" href="#implementation" title="Permalink to this headline">¶</a></h5><p>Depending on properties of the target machine and the particular<code class="docutils literal notranslate"><span class="pre">switch</span></code> instruction, this instruction may be code generated indifferent ways. For example, it could be generated as a series ofchained conditional branches or with a lookup table.</p></div><div class="section" id="id39"><h5>Example:<a class="headerlink" href="#id39" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span><span class="c">; Emulate a conditional br instruction</span><span class="nv">%Val</span> <span class="p">=</span> <span class="k">zext</span> <span class="kt">i1</span> <span class="nv">%value</span> <span class="k">to</span> <span class="kt">i32</span><span class="k">switch</span> <span class="kt">i32</span> <span class="nv">%Val</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%truedest</span> <span class="p">[</span> <span class="kt">i32</span> <span class="m">0</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%falsedest</span> <span class="p">]</span><span class="c">; Emulate an unconditional br instruction</span><span class="k">switch</span> <span class="kt">i32</span> <span class="m">0</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%dest</span> <span class="p">[</span> <span class="p">]</span><span class="c">; Implement a jump table:</span><span class="k">switch</span> <span class="kt">i32</span> <span class="nv">%val</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%otherwise</span> <span class="p">[</span> <span class="kt">i32</span> <span class="m">0</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%onzero</span>                                    <span class="kt">i32</span> <span class="m">1</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%onone</span>                                    <span class="kt">i32</span> <span class="m">2</span><span class="p">,</span> <span class="kt">label</span> <span class="nv">%ontwo</span> <span class="p">]</span></pre></div></div></div>`,
                tooltip: `The ‘switch’ instruction uses three parameters: an integercomparison value ‘value’, a default ‘label’ destination, and anarray of pairs of comparison value constants and ‘label’s. The tableis not allowed to contain duplicate constant entries.`,
            };
        case 'INDIRECTBR':
            return {
                url: `https://llvm.org/docs/LangRef.html#indirectbr-instruction`,
                html: `<span id="i-indirectbr"></span><h4><a class="toc-backref" href="#id1802">‘<code class="docutils literal notranslate"><span class="pre">indirectbr</span></code>’ Instruction</a><a class="headerlink" href="#indirectbr-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id40"><h5>Syntax:<a class="headerlink" href="#id40" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">indirectbr</span> <span class="n">ptr</span> <span class="o">&lt;</span><span class="n">address</span><span class="o">&gt;</span><span class="p">,</span> <span class="p">[</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">dest1</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">dest2</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">...</span> <span class="p">]</span></pre></div></div></div><div class="section" id="id41"><h5>Overview:<a class="headerlink" href="#id41" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">indirectbr</span></code>’ instruction implements an indirect branch to alabel within the current function, whose address is specified by“<code class="docutils literal notranslate"><span class="pre">address</span></code>”. Address must be derived from a<a class="reference internal" href="#blockaddress"><span class="std std-ref">blockaddress</span></a> constant.</p></div><div class="section" id="id42"><h5>Arguments:<a class="headerlink" href="#id42" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">address</span></code>’ argument is the address of the label to jump to. Therest of the arguments indicate the full set of possible destinationsthat the address may point to. Blocks are allowed to occur multipletimes in the destination list, though this isn’t particularly useful.</p><p>This destination list is required so that dataflow analysis has anaccurate understanding of the CFG.</p></div><div class="section" id="id43"><h5>Semantics:<a class="headerlink" href="#id43" title="Permalink to this headline">¶</a></h5><p>Control transfers to the block specified in the address argument. Allpossible destination blocks must be listed in the label list, otherwisethis instruction has undefined behavior. This implies that jumps tolabels defined in other functions have undefined behavior as well.If ‘<code class="docutils literal notranslate"><span class="pre">address</span></code>’ is <code class="docutils literal notranslate"><span class="pre">poison</span></code> or <code class="docutils literal notranslate"><span class="pre">undef</span></code>, this instruction has undefinedbehavior.</p></div><div class="section" id="id44"><h5>Implementation:<a class="headerlink" href="#id44" title="Permalink to this headline">¶</a></h5><p>This is typically implemented with a jump through a register.</p></div><div class="section" id="id45"><h5>Example:<a class="headerlink" href="#id45" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span>indirectbr ptr %Addr, [ label %bb1, label %bb2, label %bb3 ]</pre></div></div></div>`,
                tooltip: `The ‘address’ argument is the address of the label to jump to. Therest of the arguments indicate the full set of possible destinationsthat the address may point to. Blocks are allowed to occur multipletimes in the destination list, though this isn’t particularly useful.`,
            };
        case 'INVOKE':
            return {
                url: `https://llvm.org/docs/LangRef.html#invoke-instruction`,
                html: `<span id="i-invoke"></span><h4><a class="toc-backref" href="#id1803">‘<code class="docutils literal notranslate"><span class="pre">invoke</span></code>’ Instruction</a><a class="headerlink" href="#invoke-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id46"><h5>Syntax:<a class="headerlink" href="#id46" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">invoke</span> <span class="p">[</span><span class="n">cconv</span><span class="p">]</span> <span class="p">[</span><span class="n">ret</span> <span class="n">attrs</span><span class="p">]</span> <span class="p">[</span><span class="n">addrspace</span><span class="p">(</span><span class="o">&lt;</span><span class="n">num</span><span class="o">&gt;</span><span class="p">)]</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;|&lt;</span><span class="n">fnty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">fnptrval</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&lt;</span><span class="n">function</span> <span class="n">args</span><span class="o">&gt;</span><span class="p">)</span> <span class="p">[</span><span class="n">fn</span> <span class="n">attrs</span><span class="p">]</span>              <span class="p">[</span><span class="n">operand</span> <span class="n">bundles</span><span class="p">]</span> <span class="n">to</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">normal</span> <span class="n">label</span><span class="o">&gt;</span> <span class="n">unwind</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">exception</span> <span class="n">label</span><span class="o">&gt;</span></pre></div></div></div><div class="section" id="id47"><h5>Overview:<a class="headerlink" href="#id47" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">invoke</span></code>’ instruction causes control to transfer to a specifiedfunction, with the possibility of control flow transfer to either the‘<code class="docutils literal notranslate"><span class="pre">normal</span></code>’ label or the ‘<code class="docutils literal notranslate"><span class="pre">exception</span></code>’ label. If the callee functionreturns with the “<code class="docutils literal notranslate"><span class="pre">ret</span></code>” instruction, control flow will return to the“normal” label. If the callee (or any indirect callees) returns via the“<a class="reference internal" href="#i-resume"><span class="std std-ref">resume</span></a>” instruction or other exception handlingmechanism, control is interrupted and continued at the dynamicallynearest “exception” label.</p><p>The ‘<code class="docutils literal notranslate"><span class="pre">exception</span></code>’ label is a <a class="reference external" href="ExceptionHandling.html#overview">landingpad</a> for the exception. As such,‘<code class="docutils literal notranslate"><span class="pre">exception</span></code>’ label is required to have the“<a class="reference internal" href="#i-landingpad"><span class="std std-ref">landingpad</span></a>” instruction, which contains theinformation about the behavior of the program after unwinding happens,as its first non-PHI instruction. The restrictions on the“<code class="docutils literal notranslate"><span class="pre">landingpad</span></code>” instruction’s tightly couples it to the “<code class="docutils literal notranslate"><span class="pre">invoke</span></code>”instruction, so that the important information contained within the“<code class="docutils literal notranslate"><span class="pre">landingpad</span></code>” instruction can’t be lost through normal code motion.</p></div><div class="section" id="id48"><h5>Arguments:<a class="headerlink" href="#id48" title="Permalink to this headline">¶</a></h5><p>This instruction requires several arguments:</p><ol class="arabic simple"><li>The optional “cconv” marker indicates which <a class="reference internal" href="#callingconv"><span class="std std-ref">callingconvention</span></a> the call should use. If none isspecified, the call defaults to using C calling conventions.</li><li>The optional <a class="reference internal" href="#paramattrs"><span class="std std-ref">Parameter Attributes</span></a> list for returnvalues. Only ‘<code class="docutils literal notranslate"><span class="pre">zeroext</span></code>’, ‘<code class="docutils literal notranslate"><span class="pre">signext</span></code>’, and ‘<code class="docutils literal notranslate"><span class="pre">inreg</span></code>’ attributesare valid here.</li><li>The optional addrspace attribute can be used to indicate the address spaceof the called function. If it is not specified, the program address spacefrom the <a class="reference internal" href="#langref-datalayout"><span class="std std-ref">datalayout string</span></a> will be used.</li><li>‘<code class="docutils literal notranslate"><span class="pre">ty</span></code>’: the type of the call instruction itself which is also thetype of the return value. Functions that return no value are marked<code class="docutils literal notranslate"><span class="pre">void</span></code>.</li><li>‘<code class="docutils literal notranslate"><span class="pre">fnty</span></code>’: shall be the signature of the function being invoked. Theargument types must match the types implied by this signature. Thistype can be omitted if the function is not varargs.</li><li>‘<code class="docutils literal notranslate"><span class="pre">fnptrval</span></code>’: An LLVM value containing a pointer to a function tobe invoked. In most cases, this is a direct function invocation, butindirect <code class="docutils literal notranslate"><span class="pre">invoke</span></code>’s are just as possible, calling an arbitrary pointerto function value.</li><li>‘<code class="docutils literal notranslate"><span class="pre">function</span> <span class="pre">args</span></code>’: argument list whose types match the functionsignature argument types and parameter attributes. All arguments mustbe of <a class="reference internal" href="#t-firstclass"><span class="std std-ref">first class</span></a> type. If the function signatureindicates the function accepts a variable number of arguments, theextra arguments can be specified.</li><li>‘<code class="docutils literal notranslate"><span class="pre">normal</span> <span class="pre">label</span></code>’: the label reached when the called functionexecutes a ‘<code class="docutils literal notranslate"><span class="pre">ret</span></code>’ instruction.</li><li>‘<code class="docutils literal notranslate"><span class="pre">exception</span> <span class="pre">label</span></code>’: the label reached when a callee returns viathe <a class="reference internal" href="#i-resume"><span class="std std-ref">resume</span></a> instruction or other exception handlingmechanism.</li><li>The optional <a class="reference internal" href="#fnattrs"><span class="std std-ref">function attributes</span></a> list.</li><li>The optional <a class="reference internal" href="#opbundles"><span class="std std-ref">operand bundles</span></a> list.</li></ol></div><div class="section" id="id49"><h5>Semantics:<a class="headerlink" href="#id49" title="Permalink to this headline">¶</a></h5><p>This instruction is designed to operate as a standard ‘<code class="docutils literal notranslate"><span class="pre">call</span></code>’instruction in most regards. The primary difference is that itestablishes an association with a label, which is used by the runtimelibrary to unwind the stack.</p><p>This instruction is used in languages with destructors to ensure thatproper cleanup is performed in the case of either a <code class="docutils literal notranslate"><span class="pre">longjmp</span></code> or athrown exception. Additionally, this is important for implementation of‘<code class="docutils literal notranslate"><span class="pre">catch</span></code>’ clauses in high-level languages that support them.</p><p>For the purposes of the SSA form, the definition of the value returnedby the ‘<code class="docutils literal notranslate"><span class="pre">invoke</span></code>’ instruction is deemed to occur on the edge from thecurrent block to the “normal” label. If the callee unwinds then noreturn value is available.</p></div><div class="section" id="id50"><h5>Example:<a class="headerlink" href="#id50" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span><span class="nv">%retval</span> <span class="p">=</span> <span class="k">invoke</span> <span class="kt">i32</span> <span class="vg">@Test</span><span class="p">(</span><span class="kt">i32</span> <span class="m">15</span><span class="p">)</span> <span class="k">to</span> <span class="kt">label</span> <span class="nv">%Continue</span>            <span class="k">unwind</span> <span class="kt">label</span> <span class="nv">%TestCleanup</span>              <span class="c">; i32:retval set</span><span class="nv">%retval</span> <span class="p">=</span> <span class="k">invoke</span> <span class="k">coldcc</span> <span class="kt">i32</span> <span class="nv">%Testfnptr</span><span class="p">(</span><span class="kt">i32</span> <span class="m">15</span><span class="p">)</span> <span class="k">to</span> <span class="kt">label</span> <span class="nv">%Continue</span>            <span class="k">unwind</span> <span class="kt">label</span> <span class="nv">%TestCleanup</span>              <span class="c">; i32:retval set</span></pre></div></div></div>`,
                tooltip: `The ‘exception’ label is a landingpad for the exception. As such,‘exception’ label is required to have the“landingpad” instruction, which contains theinformation about the behavior of the program after unwinding happens,as its first non-PHI instruction. The restrictions on the“landingpad” instruction’s tightly couples it to the “invoke”instruction, so that the important information contained within the“landingpad” instruction can’t be lost through normal code motion.`,
            };
        case 'CALLBR':
            return {
                url: `https://llvm.org/docs/LangRef.html#callbr-instruction`,
                html: `<span id="i-callbr"></span><h4><a class="toc-backref" href="#id1804">‘<code class="docutils literal notranslate"><span class="pre">callbr</span></code>’ Instruction</a><a class="headerlink" href="#callbr-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id51"><h5>Syntax:<a class="headerlink" href="#id51" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">callbr</span> <span class="p">[</span><span class="n">cconv</span><span class="p">]</span> <span class="p">[</span><span class="n">ret</span> <span class="n">attrs</span><span class="p">]</span> <span class="p">[</span><span class="n">addrspace</span><span class="p">(</span><span class="o">&lt;</span><span class="n">num</span><span class="o">&gt;</span><span class="p">)]</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;|&lt;</span><span class="n">fnty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">fnptrval</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&lt;</span><span class="n">function</span> <span class="n">args</span><span class="o">&gt;</span><span class="p">)</span> <span class="p">[</span><span class="n">fn</span> <span class="n">attrs</span><span class="p">]</span>              <span class="p">[</span><span class="n">operand</span> <span class="n">bundles</span><span class="p">]</span> <span class="n">to</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">fallthrough</span> <span class="n">label</span><span class="o">&gt;</span> <span class="p">[</span><span class="n">indirect</span> <span class="n">labels</span><span class="p">]</span></pre></div></div></div><div class="section" id="id52"><h5>Overview:<a class="headerlink" href="#id52" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">callbr</span></code>’ instruction causes control to transfer to a specifiedfunction, with the possibility of control flow transfer to either the‘<code class="docutils literal notranslate"><span class="pre">fallthrough</span></code>’ label or one of the ‘<code class="docutils literal notranslate"><span class="pre">indirect</span></code>’ labels.</p><p>This instruction should only be used to implement the “goto” feature of gccstyle inline assembly. Any other usage is an error in the IR verifier.</p></div><div class="section" id="id53"><h5>Arguments:<a class="headerlink" href="#id53" title="Permalink to this headline">¶</a></h5><p>This instruction requires several arguments:</p><ol class="arabic simple"><li>The optional “cconv” marker indicates which <a class="reference internal" href="#callingconv"><span class="std std-ref">callingconvention</span></a> the call should use. If none isspecified, the call defaults to using C calling conventions.</li><li>The optional <a class="reference internal" href="#paramattrs"><span class="std std-ref">Parameter Attributes</span></a> list for returnvalues. Only ‘<code class="docutils literal notranslate"><span class="pre">zeroext</span></code>’, ‘<code class="docutils literal notranslate"><span class="pre">signext</span></code>’, and ‘<code class="docutils literal notranslate"><span class="pre">inreg</span></code>’ attributesare valid here.</li><li>The optional addrspace attribute can be used to indicate the address spaceof the called function. If it is not specified, the program address spacefrom the <a class="reference internal" href="#langref-datalayout"><span class="std std-ref">datalayout string</span></a> will be used.</li><li>‘<code class="docutils literal notranslate"><span class="pre">ty</span></code>’: the type of the call instruction itself which is also thetype of the return value. Functions that return no value are marked<code class="docutils literal notranslate"><span class="pre">void</span></code>.</li><li>‘<code class="docutils literal notranslate"><span class="pre">fnty</span></code>’: shall be the signature of the function being called. Theargument types must match the types implied by this signature. Thistype can be omitted if the function is not varargs.</li><li>‘<code class="docutils literal notranslate"><span class="pre">fnptrval</span></code>’: An LLVM value containing a pointer to a function tobe called. In most cases, this is a direct function call, butother <code class="docutils literal notranslate"><span class="pre">callbr</span></code>’s are just as possible, calling an arbitrary pointerto function value.</li><li>‘<code class="docutils literal notranslate"><span class="pre">function</span> <span class="pre">args</span></code>’: argument list whose types match the functionsignature argument types and parameter attributes. All arguments mustbe of <a class="reference internal" href="#t-firstclass"><span class="std std-ref">first class</span></a> type. If the function signatureindicates the function accepts a variable number of arguments, theextra arguments can be specified.</li><li>‘<code class="docutils literal notranslate"><span class="pre">fallthrough</span> <span class="pre">label</span></code>’: the label reached when the inline assembly’sexecution exits the bottom.</li><li>‘<code class="docutils literal notranslate"><span class="pre">indirect</span> <span class="pre">labels</span></code>’: the labels reached when a callee transfers controlto a location other than the ‘<code class="docutils literal notranslate"><span class="pre">fallthrough</span> <span class="pre">label</span></code>’. Label constraintsrefer to these destinations.</li><li>The optional <a class="reference internal" href="#fnattrs"><span class="std std-ref">function attributes</span></a> list.</li><li>The optional <a class="reference internal" href="#opbundles"><span class="std std-ref">operand bundles</span></a> list.</li></ol></div><div class="section" id="id54"><h5>Semantics:<a class="headerlink" href="#id54" title="Permalink to this headline">¶</a></h5><p>This instruction is designed to operate as a standard ‘<code class="docutils literal notranslate"><span class="pre">call</span></code>’instruction in most regards. The primary difference is that itestablishes an association with additional labels to define where controlflow goes after the call.</p><p>The output values of a ‘<code class="docutils literal notranslate"><span class="pre">callbr</span></code>’ instruction are available only tothe ‘<code class="docutils literal notranslate"><span class="pre">fallthrough</span></code>’ block, not to any ‘<code class="docutils literal notranslate"><span class="pre">indirect</span></code>’ blocks(s).</p><p>The only use of this today is to implement the “goto” feature of gcc inlineassembly where additional labels can be provided as locations for the inlineassembly to jump to.</p></div><div class="section" id="id55"><h5>Example:<a class="headerlink" href="#id55" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span>; "asm goto" without output constraints.callbr void asm "", "r,!i"(i32 %x)            to label %fallthrough [label %indirect]; "asm goto" with output constraints.&lt;result&gt; = callbr i32 asm "", "=r,r,!i"(i32 %x)            to label %fallthrough [label %indirect]</pre></div></div></div>`,
                tooltip: `This instruction should only be used to implement the “goto” feature of gccstyle inline assembly. Any other usage is an error in the IR verifier.`,
            };
        case 'RESUME':
            return {
                url: `https://llvm.org/docs/LangRef.html#resume-instruction`,
                html: `<span id="i-resume"></span><h4><a class="toc-backref" href="#id1805">‘<code class="docutils literal notranslate"><span class="pre">resume</span></code>’ Instruction</a><a class="headerlink" href="#resume-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id56"><h5>Syntax:<a class="headerlink" href="#id56" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">resume</span> <span class="o">&lt;</span><span class="nb">type</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">value</span><span class="o">&gt;</span></pre></div></div></div><div class="section" id="id57"><h5>Overview:<a class="headerlink" href="#id57" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">resume</span></code>’ instruction is a terminator instruction that has nosuccessors.</p></div><div class="section" id="id58"><h5>Arguments:<a class="headerlink" href="#id58" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">resume</span></code>’ instruction requires one argument, which must have thesame type as the result of any ‘<code class="docutils literal notranslate"><span class="pre">landingpad</span></code>’ instruction in the samefunction.</p></div><div class="section" id="id59"><h5>Semantics:<a class="headerlink" href="#id59" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">resume</span></code>’ instruction resumes propagation of an existing(in-flight) exception whose unwinding was interrupted with a<a class="reference internal" href="#i-landingpad"><span class="std std-ref">landingpad</span></a> instruction.</p></div><div class="section" id="id60"><h5>Example:<a class="headerlink" href="#id60" title="Permalink to this headline">¶</a></h5><div class="highlight-llvm notranslate"><div class="highlight"><pre><span></span>resume { ptr, i32 } %exn</pre></div></div></div>`,
                tooltip: `The ‘resume’ instruction requires one argument, which must have thesame type as the result of any ‘landingpad’ instruction in the samefunction.`,
            };
        case 'CATCHSWITCH':
            return {
                url: `https://llvm.org/docs/LangRef.html#catchswitch-instruction`,
                html: `<span id="i-catchswitch"></span><h4><a class="toc-backref" href="#id1806">‘<code class="docutils literal notranslate"><span class="pre">catchswitch</span></code>’ Instruction</a><a class="headerlink" href="#catchswitch-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id61"><h5>Syntax:<a class="headerlink" href="#id61" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">resultval</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">catchswitch</span> <span class="n">within</span> <span class="o">&lt;</span><span class="n">parent</span><span class="o">&gt;</span> <span class="p">[</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">handler1</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">handler2</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">...</span> <span class="p">]</span> <span class="n">unwind</span> <span class="n">to</span> <span class="n">caller</span><span class="o">&lt;</span><span class="n">resultval</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">catchswitch</span> <span class="n">within</span> <span class="o">&lt;</span><span class="n">parent</span><span class="o">&gt;</span> <span class="p">[</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">handler1</span><span class="o">&gt;</span><span class="p">,</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">handler2</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">...</span> <span class="p">]</span> <span class="n">unwind</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">default</span><span class="o">&gt;</span></pre></div></div></div><div class="section" id="id62"><h5>Overview:<a class="headerlink" href="#id62" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">catchswitch</span></code>’ instruction is used by <a class="reference external" href="ExceptionHandling.html#overview">LLVM’s exception handling system</a> to describe the set of possible catch handlersthat may be executed by the <a class="reference internal" href="#personalityfn"><span class="std std-ref">EH personality routine</span></a>.</p></div><div class="section" id="id63"><h5>Arguments:<a class="headerlink" href="#id63" title="Permalink to this headline">¶</a></h5><p>The <code class="docutils literal notranslate"><span class="pre">parent</span></code> argument is the token of the funclet that contains the<code class="docutils literal notranslate"><span class="pre">catchswitch</span></code> instruction. If the <code class="docutils literal notranslate"><span class="pre">catchswitch</span></code> is not inside a funclet,this operand may be the token <code class="docutils literal notranslate"><span class="pre">none</span></code>.</p><p>The <code class="docutils literal notranslate"><span class="pre">default</span></code> argument is the label of another basic block beginning witheither a <code class="docutils literal notranslate"><span class="pre">cleanuppad</span></code> or <code class="docutils literal notranslate"><span class="pre">catchswitch</span></code> instruction.  This unwind destinationmust be a legal target with respect to the <code class="docutils literal notranslate"><span class="pre">parent</span></code> links, as described inthe <a class="reference external" href="ExceptionHandling.html#wineh-constraints">exception handling documentation</a>.</p><p>The <code class="docutils literal notranslate"><span class="pre">handlers</span></code> are a nonempty list of successor blocks that each begin with a<a class="reference internal" href="#i-catchpad"><span class="std std-ref">catchpad</span></a> instruction.</p></div><div class="section" id="id64"><h5>Semantics:<a class="headerlink" href="#id64" title="Permalink to this headline">¶</a></h5><p>Executing this instruction transfers control to one of the successors in<code class="docutils literal notranslate"><span class="pre">handlers</span></code>, if appropriate, or continues to unwind via the unwind label ifpresent.</p><p>The <code class="docutils literal notranslate"><span class="pre">catchswitch</span></code> is both a terminator and a “pad” instruction, meaning thatit must be both the first non-phi instruction and last instruction in the basicblock. Therefore, it must be the only non-phi instruction in the block.</p></div><div class="section" id="id65"><h5>Example:<a class="headerlink" href="#id65" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>dispatch1:  %cs1 = catchswitch within none [label %handler0, label %handler1] unwind to callerdispatch2:  %cs2 = catchswitch within %parenthandler [label %handler0] unwind label %cleanup</pre></div></div></div>`,
                tooltip: `The parent argument is the token of the funclet that contains thecatchswitch instruction. If the catchswitch is not inside a funclet,this operand may be the token none.`,
            };
        case 'CATCHRET':
            return {
                url: `https://llvm.org/docs/LangRef.html#catchret-instruction`,
                html: `<span id="i-catchret"></span><h4><a class="toc-backref" href="#id1807">‘<code class="docutils literal notranslate"><span class="pre">catchret</span></code>’ Instruction</a><a class="headerlink" href="#catchret-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id66"><h5>Syntax:<a class="headerlink" href="#id66" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">catchret</span> <span class="kn">from</span> <span class="o">&lt;</span><span class="n">token</span><span class="o">&gt;</span> <span class="n">to</span> <span class="n">label</span> <span class="o">&lt;</span><span class="n">normal</span><span class="o">&gt;</span></pre></div></div></div><div class="section" id="id67"><h5>Overview:<a class="headerlink" href="#id67" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">catchret</span></code>’ instruction is a terminator instruction that has asingle successor.</p></div><div class="section" id="id68"><h5>Arguments:<a class="headerlink" href="#id68" title="Permalink to this headline">¶</a></h5><p>The first argument to a ‘<code class="docutils literal notranslate"><span class="pre">catchret</span></code>’ indicates which <code class="docutils literal notranslate"><span class="pre">catchpad</span></code> itexits.  It must be a <a class="reference internal" href="#i-catchpad"><span class="std std-ref">catchpad</span></a>.The second argument to a ‘<code class="docutils literal notranslate"><span class="pre">catchret</span></code>’ specifies where control willtransfer to next.</p></div><div class="section" id="id69"><h5>Semantics:<a class="headerlink" href="#id69" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">catchret</span></code>’ instruction ends an existing (in-flight) exception whoseunwinding was interrupted with a <a class="reference internal" href="#i-catchpad"><span class="std std-ref">catchpad</span></a> instruction.  The<a class="reference internal" href="#personalityfn"><span class="std std-ref">personality function</span></a> gets a chance to execute arbitrarycode to, for example, destroy the active exception.  Control then transfers to<code class="docutils literal notranslate"><span class="pre">normal</span></code>.</p><p>The <code class="docutils literal notranslate"><span class="pre">token</span></code> argument must be a token produced by a <code class="docutils literal notranslate"><span class="pre">catchpad</span></code> instruction.If the specified <code class="docutils literal notranslate"><span class="pre">catchpad</span></code> is not the most-recently-entered not-yet-exitedfunclet pad (as described in the <a class="reference external" href="ExceptionHandling.html#wineh-constraints">EH documentation</a>),the <code class="docutils literal notranslate"><span class="pre">catchret</span></code>’s behavior is undefined.</p></div><div class="section" id="id70"><h5>Example:<a class="headerlink" href="#id70" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>catchret from %catch to label %continue</pre></div></div></div>`,
                tooltip: `The first argument to a ‘catchret’ indicates which catchpad itexits.  It must be a catchpad.The second argument to a ‘catchret’ specifies where control willtransfer to next.`,
            };
        case 'CLEANUPRET':
            return {
                url: `https://llvm.org/docs/LangRef.html#cleanupret-instruction`,
                html: `<span id="i-cleanupret"></span><h4><a class="toc-backref" href="#id1808">‘<code class="docutils literal notranslate"><span class="pre">cleanupret</span></code>’ Instruction</a><a class="headerlink" href="#cleanupret-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id71"><h5>Syntax:<a class="headerlink" href="#id71" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cleanupret</span> <span class="kn">from</span> <span class="o">&lt;</span><span class="n">value</span><span class="o">&gt;</span> <span class="n">unwind</span> <span class="n">label</span> <span class="o">&lt;</span><span class="k">continue</span><span class="o">&gt;</span><span class="n">cleanupret</span> <span class="kn">from</span> <span class="o">&lt;</span><span class="n">value</span><span class="o">&gt;</span> <span class="n">unwind</span> <span class="n">to</span> <span class="n">caller</span></pre></div></div></div><div class="section" id="id72"><h5>Overview:<a class="headerlink" href="#id72" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">cleanupret</span></code>’ instruction is a terminator instruction that hasan optional successor.</p></div><div class="section" id="id73"><h5>Arguments:<a class="headerlink" href="#id73" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">cleanupret</span></code>’ instruction requires one argument, which indicateswhich <code class="docutils literal notranslate"><span class="pre">cleanuppad</span></code> it exits, and must be a <a class="reference internal" href="#i-cleanuppad"><span class="std std-ref">cleanuppad</span></a>.If the specified <code class="docutils literal notranslate"><span class="pre">cleanuppad</span></code> is not the most-recently-entered not-yet-exitedfunclet pad (as described in the <a class="reference external" href="ExceptionHandling.html#wineh-constraints">EH documentation</a>),the <code class="docutils literal notranslate"><span class="pre">cleanupret</span></code>’s behavior is undefined.</p><p>The ‘<code class="docutils literal notranslate"><span class="pre">cleanupret</span></code>’ instruction also has an optional successor, <code class="docutils literal notranslate"><span class="pre">continue</span></code>,which must be the label of another basic block beginning with either a<code class="docutils literal notranslate"><span class="pre">cleanuppad</span></code> or <code class="docutils literal notranslate"><span class="pre">catchswitch</span></code> instruction.  This unwind destination mustbe a legal target with respect to the <code class="docutils literal notranslate"><span class="pre">parent</span></code> links, as described in the<a class="reference external" href="ExceptionHandling.html#wineh-constraints">exception handling documentation</a>.</p></div><div class="section" id="id76"><h5>Semantics:<a class="headerlink" href="#id76" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">cleanupret</span></code>’ instruction indicates to the<a class="reference internal" href="#personalityfn"><span class="std std-ref">personality function</span></a> that one<a class="reference internal" href="#i-cleanuppad"><span class="std std-ref">cleanuppad</span></a> it transferred control to has ended.It transfers control to <code class="docutils literal notranslate"><span class="pre">continue</span></code> or unwinds out of the function.</p></div><div class="section" id="id77"><h5>Example:<a class="headerlink" href="#id77" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>cleanupret from %cleanup unwind to callercleanupret from %cleanup unwind label %continue</pre></div></div></div>`,
                tooltip: `The ‘cleanupret’ instruction requires one argument, which indicateswhich cleanuppad it exits, and must be a cleanuppad.If the specified cleanuppad is not the most-recently-entered not-yet-exitedfunclet pad (as described in the EH documentation),the cleanupret’s behavior is undefined.`,
            };
        case 'UNREACHABLE':
            return {
                url: `https://llvm.org/docs/LangRef.html#unreachable-instruction`,
                html: `<span id="i-unreachable"></span><h4><a class="toc-backref" href="#id1809">‘<code class="docutils literal notranslate"><span class="pre">unreachable</span></code>’ Instruction</a><a class="headerlink" href="#unreachable-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id78"><h5>Syntax:<a class="headerlink" href="#id78" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">unreachable</span></pre></div></div></div><div class="section" id="id79"><h5>Overview:<a class="headerlink" href="#id79" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">unreachable</span></code>’ instruction has no defined semantics. Thisinstruction is used to inform the optimizer that a particular portion ofthe code is not reachable. This can be used to indicate that the codeafter a no-return function cannot be reached, and other facts.</p></div><div class="section" id="id80"><h5>Semantics:<a class="headerlink" href="#id80" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">unreachable</span></code>’ instruction has no defined semantics.</p></div>`,
                tooltip: `The ‘unreachable’ instruction has no defined semantics.`,
            };
        case 'FNEG':
            return {
                url: `https://llvm.org/docs/LangRef.html#fneg-instruction`,
                html: `<span id="i-fneg"></span><h4><a class="toc-backref" href="#id1811">‘<code class="docutils literal notranslate"><span class="pre">fneg</span></code>’ Instruction</a><a class="headerlink" href="#fneg-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id81"><h5>Syntax:<a class="headerlink" href="#id81" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">fneg</span> <span class="p">[</span><span class="n">fast</span><span class="o">-</span><span class="n">math</span> <span class="n">flags</span><span class="p">]</span><span class="o">*</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id82"><h5>Overview:<a class="headerlink" href="#id82" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">fneg</span></code>’ instruction returns the negation of its operand.</p></div><div class="section" id="id83"><h5>Arguments:<a class="headerlink" href="#id83" title="Permalink to this headline">¶</a></h5><p>The argument to the ‘<code class="docutils literal notranslate"><span class="pre">fneg</span></code>’ instruction must be a<a class="reference internal" href="#t-floating"><span class="std std-ref">floating-point</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> offloating-point values.</p></div><div class="section" id="id84"><h5>Semantics:<a class="headerlink" href="#id84" title="Permalink to this headline">¶</a></h5><p>The value produced is a copy of the operand with its sign bit flipped.This instruction can also take any number of <a class="reference internal" href="#fastmath"><span class="std std-ref">fast-mathflags</span></a>, which are optimization hints to enable otherwiseunsafe floating-point optimizations:</p></div><div class="section" id="id85"><h5>Example:<a class="headerlink" href="#id85" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = fneg float %val          ; yields float:result = -%var</pre></div></div></div>`,
                tooltip: `The argument to the ‘fneg’ instruction must be afloating-point or vector offloating-point values.`,
            };
        case 'ADD':
            return {
                url: `https://llvm.org/docs/LangRef.html#add-instruction`,
                html: `<span id="i-add"></span><h4><a class="toc-backref" href="#id1813">‘<code class="docutils literal notranslate"><span class="pre">add</span></code>’ Instruction</a><a class="headerlink" href="#add-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id86"><h5>Syntax:<a class="headerlink" href="#id86" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">add</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>          <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">add</span> <span class="n">nuw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>      <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">add</span> <span class="n">nsw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>      <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">add</span> <span class="n">nuw</span> <span class="n">nsw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>  <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id87"><h5>Overview:<a class="headerlink" href="#id87" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">add</span></code>’ instruction returns the sum of its two operands.</p></div><div class="section" id="id88"><h5>Arguments:<a class="headerlink" href="#id88" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">add</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id89"><h5>Semantics:<a class="headerlink" href="#id89" title="Permalink to this headline">¶</a></h5><p>The value produced is the integer sum of the two operands.</p><p>If the sum has unsigned overflow, the result returned is themathematical result modulo 2<sup>n</sup>, where n is the bit width ofthe result.</p><p>Because LLVM integers use a two’s complement representation, thisinstruction is appropriate for both signed and unsigned integers.</p><p><code class="docutils literal notranslate"><span class="pre">nuw</span></code> and <code class="docutils literal notranslate"><span class="pre">nsw</span></code> stand for “No Unsigned Wrap” and “No Signed Wrap”,respectively. If the <code class="docutils literal notranslate"><span class="pre">nuw</span></code> and/or <code class="docutils literal notranslate"><span class="pre">nsw</span></code> keywords are present, theresult value of the <code class="docutils literal notranslate"><span class="pre">add</span></code> is a <a class="reference internal" href="#poisonvalues"><span class="std std-ref">poison value</span></a> ifunsigned and/or signed overflow, respectively, occurs.</p></div><div class="section" id="id90"><h5>Example:<a class="headerlink" href="#id90" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = add i32 4, %var          ; yields i32:result = 4 + %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘add’ instruction must beinteger or vector of integer values. Botharguments must have identical types.`,
            };
        case 'FADD':
            return {
                url: `https://llvm.org/docs/LangRef.html#fadd-instruction`,
                html: `<span id="i-fadd"></span><h4><a class="toc-backref" href="#id1814">‘<code class="docutils literal notranslate"><span class="pre">fadd</span></code>’ Instruction</a><a class="headerlink" href="#fadd-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id91"><h5>Syntax:<a class="headerlink" href="#id91" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">fadd</span> <span class="p">[</span><span class="n">fast</span><span class="o">-</span><span class="n">math</span> <span class="n">flags</span><span class="p">]</span><span class="o">*</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id92"><h5>Overview:<a class="headerlink" href="#id92" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">fadd</span></code>’ instruction returns the sum of its two operands.</p></div><div class="section" id="id93"><h5>Arguments:<a class="headerlink" href="#id93" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">fadd</span></code>’ instruction must be<a class="reference internal" href="#t-floating"><span class="std std-ref">floating-point</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> offloating-point values. Both arguments must have identical types.</p></div><div class="section" id="id94"><h5>Semantics:<a class="headerlink" href="#id94" title="Permalink to this headline">¶</a></h5><p>The value produced is the floating-point sum of the two operands.This instruction is assumed to execute in the default <a class="reference internal" href="#floatenv"><span class="std std-ref">floating-pointenvironment</span></a>.This instruction can also take any number of <a class="reference internal" href="#fastmath"><span class="std std-ref">fast-mathflags</span></a>, which are optimization hints to enable otherwiseunsafe floating-point optimizations:</p></div><div class="section" id="id95"><h5>Example:<a class="headerlink" href="#id95" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = fadd float 4.0, %var          ; yields float:result = 4.0 + %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘fadd’ instruction must befloating-point or vector offloating-point values. Both arguments must have identical types.`,
            };
        case 'SUB':
            return {
                url: `https://llvm.org/docs/LangRef.html#sub-instruction`,
                html: `<span id="i-sub"></span><h4><a class="toc-backref" href="#id1815">‘<code class="docutils literal notranslate"><span class="pre">sub</span></code>’ Instruction</a><a class="headerlink" href="#sub-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id96"><h5>Syntax:<a class="headerlink" href="#id96" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">sub</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>          <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">sub</span> <span class="n">nuw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>      <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">sub</span> <span class="n">nsw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>      <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">sub</span> <span class="n">nuw</span> <span class="n">nsw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>  <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id97"><h5>Overview:<a class="headerlink" href="#id97" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">sub</span></code>’ instruction returns the difference of its two operands.</p><p>Note that the ‘<code class="docutils literal notranslate"><span class="pre">sub</span></code>’ instruction is used to represent the ‘<code class="docutils literal notranslate"><span class="pre">neg</span></code>’instruction present in most other intermediate representations.</p></div><div class="section" id="id98"><h5>Arguments:<a class="headerlink" href="#id98" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">sub</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id99"><h5>Semantics:<a class="headerlink" href="#id99" title="Permalink to this headline">¶</a></h5><p>The value produced is the integer difference of the two operands.</p><p>If the difference has unsigned overflow, the result returned is themathematical result modulo 2<sup>n</sup>, where n is the bit width ofthe result.</p><p>Because LLVM integers use a two’s complement representation, thisinstruction is appropriate for both signed and unsigned integers.</p><p><code class="docutils literal notranslate"><span class="pre">nuw</span></code> and <code class="docutils literal notranslate"><span class="pre">nsw</span></code> stand for “No Unsigned Wrap” and “No Signed Wrap”,respectively. If the <code class="docutils literal notranslate"><span class="pre">nuw</span></code> and/or <code class="docutils literal notranslate"><span class="pre">nsw</span></code> keywords are present, theresult value of the <code class="docutils literal notranslate"><span class="pre">sub</span></code> is a <a class="reference internal" href="#poisonvalues"><span class="std std-ref">poison value</span></a> ifunsigned and/or signed overflow, respectively, occurs.</p></div><div class="section" id="id100"><h5>Example:<a class="headerlink" href="#id100" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = sub i32 4, %var          ; yields i32:result = 4 - %var&lt;result&gt; = sub i32 0, %val          ; yields i32:result = -%var</pre></div></div></div>`,
                tooltip: `Note that the ‘sub’ instruction is used to represent the ‘neg’instruction present in most other intermediate representations.`,
            };
        case 'FSUB':
            return {
                url: `https://llvm.org/docs/LangRef.html#fsub-instruction`,
                html: `<span id="i-fsub"></span><h4><a class="toc-backref" href="#id1816">‘<code class="docutils literal notranslate"><span class="pre">fsub</span></code>’ Instruction</a><a class="headerlink" href="#fsub-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id101"><h5>Syntax:<a class="headerlink" href="#id101" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">fsub</span> <span class="p">[</span><span class="n">fast</span><span class="o">-</span><span class="n">math</span> <span class="n">flags</span><span class="p">]</span><span class="o">*</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id102"><h5>Overview:<a class="headerlink" href="#id102" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">fsub</span></code>’ instruction returns the difference of its two operands.</p></div><div class="section" id="id103"><h5>Arguments:<a class="headerlink" href="#id103" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">fsub</span></code>’ instruction must be<a class="reference internal" href="#t-floating"><span class="std std-ref">floating-point</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> offloating-point values. Both arguments must have identical types.</p></div><div class="section" id="id104"><h5>Semantics:<a class="headerlink" href="#id104" title="Permalink to this headline">¶</a></h5><p>The value produced is the floating-point difference of the two operands.This instruction is assumed to execute in the default <a class="reference internal" href="#floatenv"><span class="std std-ref">floating-pointenvironment</span></a>.This instruction can also take any number of <a class="reference internal" href="#fastmath"><span class="std std-ref">fast-mathflags</span></a>, which are optimization hints to enable otherwiseunsafe floating-point optimizations:</p></div><div class="section" id="id105"><h5>Example:<a class="headerlink" href="#id105" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = fsub float 4.0, %var           ; yields float:result = 4.0 - %var&lt;result&gt; = fsub float -0.0, %val          ; yields float:result = -%var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘fsub’ instruction must befloating-point or vector offloating-point values. Both arguments must have identical types.`,
            };
        case 'MUL':
            return {
                url: `https://llvm.org/docs/LangRef.html#mul-instruction`,
                html: `<span id="i-mul"></span><h4><a class="toc-backref" href="#id1817">‘<code class="docutils literal notranslate"><span class="pre">mul</span></code>’ Instruction</a><a class="headerlink" href="#mul-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id106"><h5>Syntax:<a class="headerlink" href="#id106" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">mul</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>          <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">mul</span> <span class="n">nuw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>      <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">mul</span> <span class="n">nsw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>      <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">mul</span> <span class="n">nuw</span> <span class="n">nsw</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>  <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id107"><h5>Overview:<a class="headerlink" href="#id107" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">mul</span></code>’ instruction returns the product of its two operands.</p></div><div class="section" id="id108"><h5>Arguments:<a class="headerlink" href="#id108" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">mul</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id109"><h5>Semantics:<a class="headerlink" href="#id109" title="Permalink to this headline">¶</a></h5><p>The value produced is the integer product of the two operands.</p><p>If the result of the multiplication has unsigned overflow, the resultreturned is the mathematical result modulo 2<sup>n</sup>, where n is thebit width of the result.</p><p>Because LLVM integers use a two’s complement representation, and theresult is the same width as the operands, this instruction returns thecorrect result for both signed and unsigned integers. If a full product(e.g. <code class="docutils literal notranslate"><span class="pre">i32</span></code> * <code class="docutils literal notranslate"><span class="pre">i32</span></code> -&gt; <code class="docutils literal notranslate"><span class="pre">i64</span></code>) is needed, the operands should besign-extended or zero-extended as appropriate to the width of the fullproduct.</p><p><code class="docutils literal notranslate"><span class="pre">nuw</span></code> and <code class="docutils literal notranslate"><span class="pre">nsw</span></code> stand for “No Unsigned Wrap” and “No Signed Wrap”,respectively. If the <code class="docutils literal notranslate"><span class="pre">nuw</span></code> and/or <code class="docutils literal notranslate"><span class="pre">nsw</span></code> keywords are present, theresult value of the <code class="docutils literal notranslate"><span class="pre">mul</span></code> is a <a class="reference internal" href="#poisonvalues"><span class="std std-ref">poison value</span></a> ifunsigned and/or signed overflow, respectively, occurs.</p></div><div class="section" id="id110"><h5>Example:<a class="headerlink" href="#id110" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = mul i32 4, %var          ; yields i32:result = 4 * %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘mul’ instruction must beinteger or vector of integer values. Botharguments must have identical types.`,
            };
        case 'FMUL':
            return {
                url: `https://llvm.org/docs/LangRef.html#fmul-instruction`,
                html: `<span id="i-fmul"></span><h4><a class="toc-backref" href="#id1818">‘<code class="docutils literal notranslate"><span class="pre">fmul</span></code>’ Instruction</a><a class="headerlink" href="#fmul-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id111"><h5>Syntax:<a class="headerlink" href="#id111" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">fmul</span> <span class="p">[</span><span class="n">fast</span><span class="o">-</span><span class="n">math</span> <span class="n">flags</span><span class="p">]</span><span class="o">*</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id112"><h5>Overview:<a class="headerlink" href="#id112" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">fmul</span></code>’ instruction returns the product of its two operands.</p></div><div class="section" id="id113"><h5>Arguments:<a class="headerlink" href="#id113" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">fmul</span></code>’ instruction must be<a class="reference internal" href="#t-floating"><span class="std std-ref">floating-point</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> offloating-point values. Both arguments must have identical types.</p></div><div class="section" id="id114"><h5>Semantics:<a class="headerlink" href="#id114" title="Permalink to this headline">¶</a></h5><p>The value produced is the floating-point product of the two operands.This instruction is assumed to execute in the default <a class="reference internal" href="#floatenv"><span class="std std-ref">floating-pointenvironment</span></a>.This instruction can also take any number of <a class="reference internal" href="#fastmath"><span class="std std-ref">fast-mathflags</span></a>, which are optimization hints to enable otherwiseunsafe floating-point optimizations:</p></div><div class="section" id="id115"><h5>Example:<a class="headerlink" href="#id115" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = fmul float 4.0, %var          ; yields float:result = 4.0 * %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘fmul’ instruction must befloating-point or vector offloating-point values. Both arguments must have identical types.`,
            };
        case 'UDIV':
            return {
                url: `https://llvm.org/docs/LangRef.html#udiv-instruction`,
                html: `<span id="i-udiv"></span><h4><a class="toc-backref" href="#id1819">‘<code class="docutils literal notranslate"><span class="pre">udiv</span></code>’ Instruction</a><a class="headerlink" href="#udiv-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id116"><h5>Syntax:<a class="headerlink" href="#id116" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">udiv</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>         <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">udiv</span> <span class="n">exact</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id117"><h5>Overview:<a class="headerlink" href="#id117" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">udiv</span></code>’ instruction returns the quotient of its two operands.</p></div><div class="section" id="id118"><h5>Arguments:<a class="headerlink" href="#id118" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">udiv</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id119"><h5>Semantics:<a class="headerlink" href="#id119" title="Permalink to this headline">¶</a></h5><p>The value produced is the unsigned integer quotient of the two operands.</p><p>Note that unsigned integer division and signed integer division aredistinct operations; for signed integer division, use ‘<code class="docutils literal notranslate"><span class="pre">sdiv</span></code>’.</p><p>Division by zero is undefined behavior. For vectors, if any elementof the divisor is zero, the operation has undefined behavior.</p><p>If the <code class="docutils literal notranslate"><span class="pre">exact</span></code> keyword is present, the result value of the <code class="docutils literal notranslate"><span class="pre">udiv</span></code> isa <a class="reference internal" href="#poisonvalues"><span class="std std-ref">poison value</span></a> if %op1 is not a multiple of %op2 (assuch, “((a udiv exact b) mul b) == a”).</p></div><div class="section" id="id120"><h5>Example:<a class="headerlink" href="#id120" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = udiv i32 4, %var          ; yields i32:result = 4 / %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘udiv’ instruction must beinteger or vector of integer values. Botharguments must have identical types.`,
            };
        case 'SDIV':
            return {
                url: `https://llvm.org/docs/LangRef.html#sdiv-instruction`,
                html: `<span id="i-sdiv"></span><h4><a class="toc-backref" href="#id1820">‘<code class="docutils literal notranslate"><span class="pre">sdiv</span></code>’ Instruction</a><a class="headerlink" href="#sdiv-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id121"><h5>Syntax:<a class="headerlink" href="#id121" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">sdiv</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>         <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">sdiv</span> <span class="n">exact</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id122"><h5>Overview:<a class="headerlink" href="#id122" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">sdiv</span></code>’ instruction returns the quotient of its two operands.</p></div><div class="section" id="id123"><h5>Arguments:<a class="headerlink" href="#id123" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">sdiv</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id124"><h5>Semantics:<a class="headerlink" href="#id124" title="Permalink to this headline">¶</a></h5><p>The value produced is the signed integer quotient of the two operandsrounded towards zero.</p><p>Note that signed integer division and unsigned integer division aredistinct operations; for unsigned integer division, use ‘<code class="docutils literal notranslate"><span class="pre">udiv</span></code>’.</p><p>Division by zero is undefined behavior. For vectors, if any elementof the divisor is zero, the operation has undefined behavior.Overflow also leads to undefined behavior; this is a rare case, but canoccur, for example, by doing a 32-bit division of -2147483648 by -1.</p><p>If the <code class="docutils literal notranslate"><span class="pre">exact</span></code> keyword is present, the result value of the <code class="docutils literal notranslate"><span class="pre">sdiv</span></code> isa <a class="reference internal" href="#poisonvalues"><span class="std std-ref">poison value</span></a> if the result would be rounded.</p></div><div class="section" id="id125"><h5>Example:<a class="headerlink" href="#id125" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = sdiv i32 4, %var          ; yields i32:result = 4 / %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘sdiv’ instruction must beinteger or vector of integer values. Botharguments must have identical types.`,
            };
        case 'FDIV':
            return {
                url: `https://llvm.org/docs/LangRef.html#fdiv-instruction`,
                html: `<span id="i-fdiv"></span><h4><a class="toc-backref" href="#id1821">‘<code class="docutils literal notranslate"><span class="pre">fdiv</span></code>’ Instruction</a><a class="headerlink" href="#fdiv-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id126"><h5>Syntax:<a class="headerlink" href="#id126" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">fdiv</span> <span class="p">[</span><span class="n">fast</span><span class="o">-</span><span class="n">math</span> <span class="n">flags</span><span class="p">]</span><span class="o">*</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id127"><h5>Overview:<a class="headerlink" href="#id127" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">fdiv</span></code>’ instruction returns the quotient of its two operands.</p></div><div class="section" id="id128"><h5>Arguments:<a class="headerlink" href="#id128" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">fdiv</span></code>’ instruction must be<a class="reference internal" href="#t-floating"><span class="std std-ref">floating-point</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> offloating-point values. Both arguments must have identical types.</p></div><div class="section" id="id129"><h5>Semantics:<a class="headerlink" href="#id129" title="Permalink to this headline">¶</a></h5><p>The value produced is the floating-point quotient of the two operands.This instruction is assumed to execute in the default <a class="reference internal" href="#floatenv"><span class="std std-ref">floating-pointenvironment</span></a>.This instruction can also take any number of <a class="reference internal" href="#fastmath"><span class="std std-ref">fast-mathflags</span></a>, which are optimization hints to enable otherwiseunsafe floating-point optimizations:</p></div><div class="section" id="id130"><h5>Example:<a class="headerlink" href="#id130" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = fdiv float 4.0, %var          ; yields float:result = 4.0 / %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘fdiv’ instruction must befloating-point or vector offloating-point values. Both arguments must have identical types.`,
            };
        case 'UREM':
            return {
                url: `https://llvm.org/docs/LangRef.html#urem-instruction`,
                html: `<span id="i-urem"></span><h4><a class="toc-backref" href="#id1822">‘<code class="docutils literal notranslate"><span class="pre">urem</span></code>’ Instruction</a><a class="headerlink" href="#urem-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id131"><h5>Syntax:<a class="headerlink" href="#id131" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">urem</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id132"><h5>Overview:<a class="headerlink" href="#id132" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">urem</span></code>’ instruction returns the remainder from the unsigneddivision of its two arguments.</p></div><div class="section" id="id133"><h5>Arguments:<a class="headerlink" href="#id133" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">urem</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id134"><h5>Semantics:<a class="headerlink" href="#id134" title="Permalink to this headline">¶</a></h5><p>This instruction returns the unsigned integer <em>remainder</em> of a division.This instruction always performs an unsigned division to get theremainder.</p><p>Note that unsigned integer remainder and signed integer remainder aredistinct operations; for signed integer remainder, use ‘<code class="docutils literal notranslate"><span class="pre">srem</span></code>’.</p><p>Taking the remainder of a division by zero is undefined behavior.For vectors, if any element of the divisor is zero, the operation hasundefined behavior.</p></div><div class="section" id="id135"><h5>Example:<a class="headerlink" href="#id135" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = urem i32 4, %var          ; yields i32:result = 4 % %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘urem’ instruction must beinteger or vector of integer values. Botharguments must have identical types.`,
            };
        case 'SREM':
            return {
                url: `https://llvm.org/docs/LangRef.html#srem-instruction`,
                html: `<span id="i-srem"></span><h4><a class="toc-backref" href="#id1823">‘<code class="docutils literal notranslate"><span class="pre">srem</span></code>’ Instruction</a><a class="headerlink" href="#srem-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id136"><h5>Syntax:<a class="headerlink" href="#id136" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">srem</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id137"><h5>Overview:<a class="headerlink" href="#id137" title="Permalink to this headline">¶</a></h5><p>The ‘<code class="docutils literal notranslate"><span class="pre">srem</span></code>’ instruction returns the remainder from the signeddivision of its two operands. This instruction can also take<a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> versions of the values in which case the elementsmust be integers.</p></div><div class="section" id="id138"><h5>Arguments:<a class="headerlink" href="#id138" title="Permalink to this headline">¶</a></h5><p>The two arguments to the ‘<code class="docutils literal notranslate"><span class="pre">srem</span></code>’ instruction must be<a class="reference internal" href="#t-integer"><span class="std std-ref">integer</span></a> or <a class="reference internal" href="#t-vector"><span class="std std-ref">vector</span></a> of integer values. Botharguments must have identical types.</p></div><div class="section" id="id139"><h5>Semantics:<a class="headerlink" href="#id139" title="Permalink to this headline">¶</a></h5><p>This instruction returns the <em>remainder</em> of a division (where the resultis either zero or has the same sign as the dividend, <code class="docutils literal notranslate"><span class="pre">op1</span></code>), not the<em>modulo</em> operator (where the result is either zero or has the same signas the divisor, <code class="docutils literal notranslate"><span class="pre">op2</span></code>) of a value. For more information about thedifference, see <a class="reference external" href="http://mathforum.org/dr.math/problems/anne.4.28.99.html">The MathForum</a>. For atable of how this is implemented in various languages, please see<a class="reference external" href="http://en.wikipedia.org/wiki/Modulo_operation">Wikipedia: modulooperation</a>.</p><p>Note that signed integer remainder and unsigned integer remainder aredistinct operations; for unsigned integer remainder, use ‘<code class="docutils literal notranslate"><span class="pre">urem</span></code>’.</p><p>Taking the remainder of a division by zero is undefined behavior.For vectors, if any element of the divisor is zero, the operation hasundefined behavior.Overflow also leads to undefined behavior; this is a rare case, but canoccur, for example, by taking the remainder of a 32-bit division of-2147483648 by -1. (The remainder doesn’t actually overflow, but thisrule lets srem be implemented using instructions that return both theresult of the division and the remainder.)</p></div><div class="section" id="id140"><h5>Example:<a class="headerlink" href="#id140" title="Permalink to this headline">¶</a></h5><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>&lt;result&gt; = srem i32 4, %var          ; yields i32:result = 4 % %var</pre></div></div></div>`,
                tooltip: `The two arguments to the ‘srem’ instruction must beinteger or vector of integer values. Botharguments must have identical types.`,
            };
        case 'FREM':
            return {
                url: `https://llvm.org/docs/LangRef.html#frem-instruction`,
                html: `<span id="i-frem"></span><h4><a class="toc-backref" href="#id1824">‘<code class="docutils literal notranslate"><span class="pre">frem</span></code>’ Instruction</a><a class="headerlink" href="#frem-instruction" title="Permalink to this headline">¶</a></h4><div class="section" id="id141"><h5>Syntax:<a class="headerlink" href="#id141" title="Permalink to this headline">¶</a></h5><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">result</span><span class="o">&gt;</span> <span class="o">=</span> <span class="n">frem</span> <span class="p">[</span><span class="n">fast</span><span class="o">-</span><span class="n">math</span> <span class="n">flags</span><span class="p">]</span><span class="o">*</span> <span class="o">&lt;</span><span class="n">ty</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">op1</span><span class="o">&gt;</span><span class="p">,</span> <span class="o">&lt;</span><span class="n">op2</span><span class="o">&gt;</span>   <span class="p">;</span> <span class="n">yields</span> <span class="n">ty</span><span class="p">:</span><span class="n">result</span></pre></div></div></div><div class="section" id="id142"><h5>Overview:<a class="headerlink" href="#id142" title="Permalink to this headline">¶</a