diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-08 23:07:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-08 23:07:04 +0000 |
commit | 3df241e4b2b93329fdeea16a4eb366347442f99f (patch) | |
tree | 1a94e3543f99e1cef026d43990d2cb4919efcaeb /docs/LangRef.html | |
parent | a1d95e16df0949fcd33b1ee938a4791dac6f6cad (diff) | |
download | external_llvm-3df241e4b2b93329fdeea16a4eb366347442f99f.zip external_llvm-3df241e4b2b93329fdeea16a4eb366347442f99f.tar.gz external_llvm-3df241e4b2b93329fdeea16a4eb366347442f99f.tar.bz2 |
Move the vector instructions to their own subsection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.html')
-rw-r--r-- | docs/LangRef.html | 697 |
1 files changed, 360 insertions, 337 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index af50b9c..bf63884 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -91,6 +91,16 @@ <li><a href="#i_shr">'<tt>shr</tt>' Instruction</a></li> </ol> </li> + <li><a href="#vectorops">Vector Operations</a> + <ol> + <li><a href="#i_extractelement">'<tt>extractelement</tt>' Instruction</a></li> + <li><a href="#i_insertelement">'<tt>insertelement</tt>' Instruction</a></li> + <li><a href="#i_shufflevector">'<tt>shufflevector</tt>' Instruction</a></li> + <li><a href="#i_vsetint">'<tt>vsetint</tt>' Instruction</a></li> + <li><a href="#i_vsetfp">'<tt>vsetfp</tt>' Instruction</a></li> + <li><a href="#i_vselect">'<tt>vselect</tt>' Instruction</a></li> + </ol> + </li> <li><a href="#memoryops">Memory Access Operations</a> <ol> <li><a href="#i_malloc">'<tt>malloc</tt>' Instruction</a></li> @@ -106,12 +116,6 @@ <li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li> <li><a href="#i_cast">'<tt>cast .. to</tt>' Instruction</a></li> <li><a href="#i_select">'<tt>select</tt>' Instruction</a></li> - <li><a href="#i_vsetint">'<tt>vsetint</tt>' Instruction</a></li> - <li><a href="#i_vsetfp">'<tt>vsetfp</tt>' Instruction</a></li> - <li><a href="#i_vselect">'<tt>vselect</tt>' Instruction</a></li> - <li><a href="#i_extractelement">'<tt>extractelement</tt>' Instruction</a></li> - <li><a href="#i_insertelement">'<tt>insertelement</tt>' Instruction</a></li> - <li><a href="#i_shufflevector">'<tt>shufflevector</tt>' Instruction</a></li> <li><a href="#i_call">'<tt>call</tt>' Instruction</a></li> <li><a href="#i_va_arg">'<tt>va_arg</tt>' Instruction</a></li> </ol> @@ -1896,6 +1900,356 @@ positions.</p> <!-- ======================================================================= --> <div class="doc_subsection"> + <a name="vectorops">Vector Operations</a> +</div> + +<div class="doc_text"> + +<p>LLVM supports several instructions to represent vector operations in a +target-independent manner. This instructions cover the element-access and +vector-specific operations needed to process vectors effectively. While LLVM +does directly support these vector operations, many sophisticated algorithms +will want to use target-specific intrinsics to take full advantage of a specific +target.</p> + +</div> + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> + <a name="i_extractelement">'<tt>extractelement</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> + +<pre> + <result> = extractelement <n x <ty>> <val>, uint <idx> <i>; yields <ty></i> +</pre> + +<h5>Overview:</h5> + +<p> +The '<tt>extractelement</tt>' instruction extracts a single scalar +element from a packed vector at a specified index. +</p> + + +<h5>Arguments:</h5> + +<p> +The first operand of an '<tt>extractelement</tt>' instruction is a +value of <a href="#t_packed">packed</a> type. The second operand is +an index indicating the position from which to extract the element. +The index may be a variable.</p> + +<h5>Semantics:</h5> + +<p> +The result is a scalar of the same type as the element type of +<tt>val</tt>. Its value is the value at position <tt>idx</tt> of +<tt>val</tt>. If <tt>idx</tt> exceeds the length of <tt>val</tt>, the +results are undefined. +</p> + +<h5>Example:</h5> + +<pre> + %result = extractelement <4 x int> %vec, uint 0 <i>; yields int</i> +</pre> +</div> + + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> + <a name="i_insertelement">'<tt>insertelement</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> + +<pre> + <result> = insertelement <n x <ty>> <val>, <ty> <elt>, uint <idx> <i>; yields <n x <ty>></i> +</pre> + +<h5>Overview:</h5> + +<p> +The '<tt>insertelement</tt>' instruction inserts a scalar +element into a packed vector at a specified index. +</p> + + +<h5>Arguments:</h5> + +<p> +The first operand of an '<tt>insertelement</tt>' instruction is a +value of <a href="#t_packed">packed</a> type. The second operand is a +scalar value whose type must equal the element type of the first +operand. The third operand is an index indicating the position at +which to insert the value. The index may be a variable.</p> + +<h5>Semantics:</h5> + +<p> +The result is a packed vector of the same type as <tt>val</tt>. Its +element values are those of <tt>val</tt> except at position +<tt>idx</tt>, where it gets the value <tt>elt</tt>. If <tt>idx</tt> +exceeds the length of <tt>val</tt>, the results are undefined. +</p> + +<h5>Example:</h5> + +<pre> + %result = insertelement <4 x int> %vec, int 1, uint 0 <i>; yields <4 x int></i> +</pre> +</div> + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> + <a name="i_shufflevector">'<tt>shufflevector</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> + +<pre> + <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <n x uint> <mask> <i>; yields <n x <ty>></i> +</pre> + +<h5>Overview:</h5> + +<p> +The '<tt>shufflevector</tt>' instruction constructs a permutation of elements +from two input vectors, returning a vector of the same type. +</p> + +<h5>Arguments:</h5> + +<p> +The first two operands of a '<tt>shufflevector</tt>' instruction are vectors +with types that match each other and types that match the result of the +instruction. The third argument is a shuffle mask, which has the same number +of elements as the other vector type, but whose element type is always 'uint'. +</p> + +<p> +The shuffle mask operand is required to be a constant vector with either +constant integer or undef values. +</p> + +<h5>Semantics:</h5> + +<p> +The elements of the two input vectors are numbered from left to right across +both of the vectors. The shuffle mask operand specifies, for each element of +the result vector, which element of the two input registers the result element +gets. The element selector may be undef (meaning "don't care") and the second +operand may be undef if performing a shuffle from only one vector. +</p> + +<h5>Example:</h5> + +<pre> + %result = shufflevector <4 x int> %v1, <4 x int> %v2, + <4 x uint> <uint 0, uint 4, uint 1, uint 5> <i>; yields <4 x int></i> + %result = shufflevector <4 x int> %v1, <4 x int> undef, + <4 x uint> <uint 0, uint 1, uint 2, uint 3> <i>; yields <4 x int></i> - Identity shuffle. +</pre> +</div> + + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> <a name="i_vsetint">'<tt>vsetint</tt>' +Instruction</a> </div> +<div class="doc_text"> +<h5>Syntax:</h5> +<pre><result> = vsetint <op>, <n x <ty>> <var1>, <var2> <i>; yields <n x bool></i> +</pre> + +<h5>Overview:</h5> + +<p>The '<tt>vsetint</tt>' instruction takes two integer vectors and +returns a vector of boolean values representing, at each position, the +result of the comparison between the values at that position in the +two operands.</p> + +<h5>Arguments:</h5> + +<p>The arguments to a '<tt>vsetint</tt>' instruction are a comparison +operation and two value arguments. The value arguments must be of <a +href="#t_integral">integral</a> <a href="#t_packed">packed</a> type, +and they must have identical types. The operation argument must be +one of <tt>eq</tt>, <tt>ne</tt>, <tt>slt</tt>, <tt>sgt</tt>, +<tt>sle</tt>, <tt>sge</tt>, <tt>ult</tt>, <tt>ugt</tt>, <tt>ule</tt>, +<tt>uge</tt>, <tt>true</tt>, and <tt>false</tt>. The result is a +packed <tt>bool</tt> value with the same length as each operand.</p> + +<h5>Semantics:</h5> + +<p>The following table shows the semantics of '<tt>vsetint</tt>'. For +each position of the result, the comparison is done on the +corresponding positions of the two value arguments. Note that the +signedness of the comparison depends on the comparison opcode and +<i>not</i> on the signedness of the value operands. E.g., <tt>vsetint +slt <4 x unsigned> %x, %y</tt> does an elementwise <i>signed</i> +comparison of <tt>%x</tt> and <tt>%y</tt>.</p> + +<table border="1" cellspacing="0" cellpadding="4"> + <tbody> + <tr><th>Operation</th><th>Result is true iff</th><th>Comparison is</th></tr> + <tr><td><tt>eq</tt></td><td>var1 == var2</td><td>--</td></tr> + <tr><td><tt>ne</tt></td><td>var1 != var2</td><td>--</td></tr> + <tr><td><tt>slt</tt></td><td>var1 < var2</td><td>signed</td></tr> + <tr><td><tt>sgt</tt></td><td>var1 > var2</td><td>signed</td></tr> + <tr><td><tt>sle</tt></td><td>var1 <= var2</td><td>signed</td></tr> + <tr><td><tt>sge</tt></td><td>var1 >= var2</td><td>signed</td></tr> + <tr><td><tt>ult</tt></td><td>var1 < var2</td><td>unsigned</td></tr> + <tr><td><tt>ugt</tt></td><td>var1 > var2</td><td>unsigned</td></tr> + <tr><td><tt>ule</tt></td><td>var1 <= var2</td><td>unsigned</td></tr> + <tr><td><tt>uge</tt></td><td>var1 >= var2</td><td>unsigned</td></tr> + <tr><td><tt>true</tt></td><td>always</td><td>--</td></tr> + <tr><td><tt>false</tt></td><td>never</td><td>--</td></tr> + </tbody> +</table> + +<h5>Example:</h5> +<pre> <result> = vsetint eq <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = false, false</i> + <result> = vsetint ne <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = true, true</i> + <result> = vsetint slt <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = true, false</i> + <result> = vsetint sgt <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = false, true</i> + <result> = vsetint sle <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = true, false</i> + <result> = vsetint sge <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = false, true</i> +</pre> +</div> + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> <a name="i_vsetfp">'<tt>vsetfp</tt>' +Instruction</a> </div> +<div class="doc_text"> +<h5>Syntax:</h5> +<pre><result> = vsetfp <op>, <n x <ty>> <var1>, <var2> <i>; yields <n x bool></i> +</pre> + +<h5>Overview:</h5> + +<p>The '<tt>vsetfp</tt>' instruction takes two floating point vector +arguments and returns a vector of boolean values representing, at each +position, the result of the comparison between the values at that +position in the two operands.</p> + +<h5>Arguments:</h5> + +<p>The arguments to a '<tt>vsetfp</tt>' instruction are a comparison +operation and two value arguments. The value arguments must be of <a +href="t_floating">floating point</a> <a href="#t_packed">packed</a> +type, and they must have identical types. The operation argument must +be one of <tt>eq</tt>, <tt>ne</tt>, <tt>lt</tt>, <tt>gt</tt>, +<tt>le</tt>, <tt>ge</tt>, <tt>oeq</tt>, <tt>one</tt>, <tt>olt</tt>, +<tt>ogt</tt>, <tt>ole</tt>, <tt>oge</tt>, <tt>ueq</tt>, <tt>une</tt>, +<tt>ult</tt>, <tt>ugt</tt>, <tt>ule</tt>, <tt>uge</tt>, <tt>o</tt>, +<tt>u</tt>, <tt>true</tt>, and <tt>false</tt>. The result is a packed +<tt>bool</tt> value with the same length as each operand.</p> + +<h5>Semantics:</h5> + +<p>The following table shows the semantics of '<tt>vsetfp</tt>' for +floating point types. If either operand is a floating point Not a +Number (NaN) value, the operation is unordered, and the value in the +first column below is produced at that position. Otherwise, the +operation is ordered, and the value in the second column is +produced.</p> + +<table border="1" cellspacing="0" cellpadding="4"> + <tbody> + <tr><th>Operation</th><th>If unordered<th>Otherwise true iff</th></tr> + <tr><td><tt>eq</tt></td><td>undefined</td><td>var1 == var2</td></tr> + <tr><td><tt>ne</tt></td><td>undefined</td><td>var1 != var2</td></tr> + <tr><td><tt>lt</tt></td><td>undefined</td><td>var1 < var2</td></tr> + <tr><td><tt>gt</tt></td><td>undefined</td><td>var1 > var2</td></tr> + <tr><td><tt>le</tt></td><td>undefined</td><td>var1 <= var2</td></tr> + <tr><td><tt>ge</tt></td><td>undefined</td><td>var1 >= var2</td></tr> + <tr><td><tt>oeq</tt></td><td>false</td><td>var1 == var2</td></tr> + <tr><td><tt>one</tt></td><td>false</td><td>var1 != var2</td></tr> + <tr><td><tt>olt</tt></td><td>false</td><td>var1 < var2</td></tr> + <tr><td><tt>ogt</tt></td><td>false</td><td>var1 > var2</td></tr> + <tr><td><tt>ole</tt></td><td>false</td><td>var1 <= var2</td></tr> + <tr><td><tt>oge</tt></td><td>false</td><td>var1 >= var2</td></tr> + <tr><td><tt>ueq</tt></td><td>true</td><td>var1 == var2</td></tr> + <tr><td><tt>une</tt></td><td>true</td><td>var1 != var2</td></tr> + <tr><td><tt>ult</tt></td><td>true</td><td>var1 < var2</td></tr> + <tr><td><tt>ugt</tt></td><td>true</td><td>var1 > var2</td></tr> + <tr><td><tt>ule</tt></td><td>true</td><td>var1 <= var2</td></tr> + <tr><td><tt>uge</tt></td><td>true</td><td>var1 >= var2</td></tr> + <tr><td><tt>o</tt></td><td>false</td><td>always</td></tr> + <tr><td><tt>u</tt></td><td>true</td><td>never</td></tr> + <tr><td><tt>true</tt></td><td>true</td><td>always</td></tr> + <tr><td><tt>false</tt></td><td>false</td><td>never</td></tr> + </tbody> +</table> + +<h5>Example:</h5> +<pre> <result> = vsetfp eq <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = false, false</i> + <result> = vsetfp ne <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = true, true</i> + <result> = vsetfp lt <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = true, false</i> + <result> = vsetfp gt <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = false, true</i> + <result> = vsetfp le <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = true, false</i> + <result> = vsetfp ge <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = false, true</i> +</pre> +</div> + +<!-- _______________________________________________________________________ --> +<div class="doc_subsubsection"> + <a name="i_vselect">'<tt>vselect</tt>' Instruction</a> +</div> + +<div class="doc_text"> + +<h5>Syntax:</h5> + +<pre> + <result> = vselect <n x bool> <cond>, <n x <ty>> <val1>, <n x <ty>> <val2> <i>; yields <n x <ty>></i> +</pre> + +<h5>Overview:</h5> + +<p> +The '<tt>vselect</tt>' instruction chooses one value at each position +of a vector based on a condition. +</p> + + +<h5>Arguments:</h5> + +<p> +The '<tt>vselect</tt>' instruction requires a <a +href="#t_packed">packed</a> <tt>bool</tt> value indicating the +condition at each vector position, and two values of the same packed +type. All three operands must have the same length. The type of the +result is the same as the type of the two value operands.</p> + +<h5>Semantics:</h5> + +<p> +At each position where the <tt>bool</tt> vector is true, that position +of the result gets its value from the first value argument; otherwise, +it gets its value from the second value argument. +</p> + +<h5>Example:</h5> + +<pre> + %X = vselect bool <2 x bool> <bool true, bool false>, <2 x ubyte> <ubyte 17, ubyte 17>, + <2 x ubyte> <ubyte 42, ubyte 42> <i>; yields <2 x ubyte>:17, 42</i> +</pre> +</div> + + + +<!-- ======================================================================= --> +<div class="doc_subsection"> <a name="memoryops">Memory Access Operations</a> </div> @@ -2338,337 +2692,6 @@ value argument; otherwise, it returns the second value argument. </pre> </div> -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> <a name="i_vsetint">'<tt>vsetint</tt>' -Instruction</a> </div> -<div class="doc_text"> -<h5>Syntax:</h5> -<pre><result> = vsetint <op>, <n x <ty>> <var1>, <var2> <i>; yields <n x bool></i> -</pre> - -<h5>Overview:</h5> - -<p>The '<tt>vsetint</tt>' instruction takes two integer vectors and -returns a vector of boolean values representing, at each position, the -result of the comparison between the values at that position in the -two operands.</p> - -<h5>Arguments:</h5> - -<p>The arguments to a '<tt>vsetint</tt>' instruction are a comparison -operation and two value arguments. The value arguments must be of <a -href="#t_integral">integral</a> <a href="#t_packed">packed</a> type, -and they must have identical types. The operation argument must be -one of <tt>eq</tt>, <tt>ne</tt>, <tt>slt</tt>, <tt>sgt</tt>, -<tt>sle</tt>, <tt>sge</tt>, <tt>ult</tt>, <tt>ugt</tt>, <tt>ule</tt>, -<tt>uge</tt>, <tt>true</tt>, and <tt>false</tt>. The result is a -packed <tt>bool</tt> value with the same length as each operand.</p> - -<h5>Semantics:</h5> - -<p>The following table shows the semantics of '<tt>vsetint</tt>'. For -each position of the result, the comparison is done on the -corresponding positions of the two value arguments. Note that the -signedness of the comparison depends on the comparison opcode and -<i>not</i> on the signedness of the value operands. E.g., <tt>vsetint -slt <4 x unsigned> %x, %y</tt> does an elementwise <i>signed</i> -comparison of <tt>%x</tt> and <tt>%y</tt>.</p> - -<table border="1" cellspacing="0" cellpadding="4"> - <tbody> - <tr><th>Operation</th><th>Result is true iff</th><th>Comparison is</th></tr> - <tr><td><tt>eq</tt></td><td>var1 == var2</td><td>--</td></tr> - <tr><td><tt>ne</tt></td><td>var1 != var2</td><td>--</td></tr> - <tr><td><tt>slt</tt></td><td>var1 < var2</td><td>signed</td></tr> - <tr><td><tt>sgt</tt></td><td>var1 > var2</td><td>signed</td></tr> - <tr><td><tt>sle</tt></td><td>var1 <= var2</td><td>signed</td></tr> - <tr><td><tt>sge</tt></td><td>var1 >= var2</td><td>signed</td></tr> - <tr><td><tt>ult</tt></td><td>var1 < var2</td><td>unsigned</td></tr> - <tr><td><tt>ugt</tt></td><td>var1 > var2</td><td>unsigned</td></tr> - <tr><td><tt>ule</tt></td><td>var1 <= var2</td><td>unsigned</td></tr> - <tr><td><tt>uge</tt></td><td>var1 >= var2</td><td>unsigned</td></tr> - <tr><td><tt>true</tt></td><td>always</td><td>--</td></tr> - <tr><td><tt>false</tt></td><td>never</td><td>--</td></tr> - </tbody> -</table> - -<h5>Example:</h5> -<pre> <result> = vsetint eq <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = false, false</i> - <result> = vsetint ne <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = true, true</i> - <result> = vsetint slt <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = true, false</i> - <result> = vsetint sgt <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = false, true</i> - <result> = vsetint sle <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = true, false</i> - <result> = vsetint sge <2 x int> <int 0, int 1>, <int 1, int 0> <i>; yields {<2 x bool>}:result = false, true</i> -</pre> -</div> - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> <a name="i_vsetfp">'<tt>vsetfp</tt>' -Instruction</a> </div> -<div class="doc_text"> -<h5>Syntax:</h5> -<pre><result> = vsetfp <op>, <n x <ty>> <var1>, <var2> <i>; yields <n x bool></i> -</pre> - -<h5>Overview:</h5> - -<p>The '<tt>vsetfp</tt>' instruction takes two floating point vector -arguments and returns a vector of boolean values representing, at each -position, the result of the comparison between the values at that -position in the two operands.</p> - -<h5>Arguments:</h5> - -<p>The arguments to a '<tt>vsetfp</tt>' instruction are a comparison -operation and two value arguments. The value arguments must be of <a -href="t_floating">floating point</a> <a href="#t_packed">packed</a> -type, and they must have identical types. The operation argument must -be one of <tt>eq</tt>, <tt>ne</tt>, <tt>lt</tt>, <tt>gt</tt>, -<tt>le</tt>, <tt>ge</tt>, <tt>oeq</tt>, <tt>one</tt>, <tt>olt</tt>, -<tt>ogt</tt>, <tt>ole</tt>, <tt>oge</tt>, <tt>ueq</tt>, <tt>une</tt>, -<tt>ult</tt>, <tt>ugt</tt>, <tt>ule</tt>, <tt>uge</tt>, <tt>o</tt>, -<tt>u</tt>, <tt>true</tt>, and <tt>false</tt>. The result is a packed -<tt>bool</tt> value with the same length as each operand.</p> - -<h5>Semantics:</h5> - -<p>The following table shows the semantics of '<tt>vsetfp</tt>' for -floating point types. If either operand is a floating point Not a -Number (NaN) value, the operation is unordered, and the value in the -first column below is produced at that position. Otherwise, the -operation is ordered, and the value in the second column is -produced.</p> - -<table border="1" cellspacing="0" cellpadding="4"> - <tbody> - <tr><th>Operation</th><th>If unordered<th>Otherwise true iff</th></tr> - <tr><td><tt>eq</tt></td><td>undefined</td><td>var1 == var2</td></tr> - <tr><td><tt>ne</tt></td><td>undefined</td><td>var1 != var2</td></tr> - <tr><td><tt>lt</tt></td><td>undefined</td><td>var1 < var2</td></tr> - <tr><td><tt>gt</tt></td><td>undefined</td><td>var1 > var2</td></tr> - <tr><td><tt>le</tt></td><td>undefined</td><td>var1 <= var2</td></tr> - <tr><td><tt>ge</tt></td><td>undefined</td><td>var1 >= var2</td></tr> - <tr><td><tt>oeq</tt></td><td>false</td><td>var1 == var2</td></tr> - <tr><td><tt>one</tt></td><td>false</td><td>var1 != var2</td></tr> - <tr><td><tt>olt</tt></td><td>false</td><td>var1 < var2</td></tr> - <tr><td><tt>ogt</tt></td><td>false</td><td>var1 > var2</td></tr> - <tr><td><tt>ole</tt></td><td>false</td><td>var1 <= var2</td></tr> - <tr><td><tt>oge</tt></td><td>false</td><td>var1 >= var2</td></tr> - <tr><td><tt>ueq</tt></td><td>true</td><td>var1 == var2</td></tr> - <tr><td><tt>une</tt></td><td>true</td><td>var1 != var2</td></tr> - <tr><td><tt>ult</tt></td><td>true</td><td>var1 < var2</td></tr> - <tr><td><tt>ugt</tt></td><td>true</td><td>var1 > var2</td></tr> - <tr><td><tt>ule</tt></td><td>true</td><td>var1 <= var2</td></tr> - <tr><td><tt>uge</tt></td><td>true</td><td>var1 >= var2</td></tr> - <tr><td><tt>o</tt></td><td>false</td><td>always</td></tr> - <tr><td><tt>u</tt></td><td>true</td><td>never</td></tr> - <tr><td><tt>true</tt></td><td>true</td><td>always</td></tr> - <tr><td><tt>false</tt></td><td>false</td><td>never</td></tr> - </tbody> -</table> - -<h5>Example:</h5> -<pre> <result> = vsetfp eq <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = false, false</i> - <result> = vsetfp ne <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = true, true</i> - <result> = vsetfp lt <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = true, false</i> - <result> = vsetfp gt <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = false, true</i> - <result> = vsetfp le <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = true, false</i> - <result> = vsetfp ge <2 x float> <float 0.0, float 1.0>, <float 1.0, float 0.0> <i>; yields {<2 x bool>}:result = false, true</i> -</pre> -</div> - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> - <a name="i_vselect">'<tt>vselect</tt>' Instruction</a> -</div> - -<div class="doc_text"> - -<h5>Syntax:</h5> - -<pre> - <result> = vselect <n x bool> <cond>, <n x <ty>> <val1>, <n x <ty>> <val2> <i>; yields <n x <ty>></i> -</pre> - -<h5>Overview:</h5> - -<p> -The '<tt>vselect</tt>' instruction chooses one value at each position -of a vector based on a condition. -</p> - - -<h5>Arguments:</h5> - -<p> -The '<tt>vselect</tt>' instruction requires a <a -href="#t_packed">packed</a> <tt>bool</tt> value indicating the -condition at each vector position, and two values of the same packed -type. All three operands must have the same length. The type of the -result is the same as the type of the two value operands.</p> - -<h5>Semantics:</h5> - -<p> -At each position where the <tt>bool</tt> vector is true, that position -of the result gets its value from the first value argument; otherwise, -it gets its value from the second value argument. -</p> - -<h5>Example:</h5> - -<pre> - %X = vselect bool <2 x bool> <bool true, bool false>, <2 x ubyte> <ubyte 17, ubyte 17>, - <2 x ubyte> <ubyte 42, ubyte 42> <i>; yields <2 x ubyte>:17, 42</i> -</pre> -</div> - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> - <a name="i_extractelement">'<tt>extractelement</tt>' Instruction</a> -</div> - -<div class="doc_text"> - -<h5>Syntax:</h5> - -<pre> - <result> = extractelement <n x <ty>> <val>, uint <idx> <i>; yields <ty></i> -</pre> - -<h5>Overview:</h5> - -<p> -The '<tt>extractelement</tt>' instruction extracts a single scalar -element from a packed vector at a specified index. -</p> - - -<h5>Arguments:</h5> - -<p> -The first operand of an '<tt>extractelement</tt>' instruction is a -value of <a href="#t_packed">packed</a> type. The second operand is -an index indicating the position from which to extract the element. -The index may be a variable.</p> - -<h5>Semantics:</h5> - -<p> -The result is a scalar of the same type as the element type of -<tt>val</tt>. Its value is the value at position <tt>idx</tt> of -<tt>val</tt>. If <tt>idx</tt> exceeds the length of <tt>val</tt>, the -results are undefined. -</p> - -<h5>Example:</h5> - -<pre> - %result = extractelement <4 x int> %vec, uint 0 <i>; yields int</i> -</pre> -</div> - - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> - <a name="i_insertelement">'<tt>insertelement</tt>' Instruction</a> -</div> - -<div class="doc_text"> - -<h5>Syntax:</h5> - -<pre> - <result> = insertelement <n x <ty>> <val>, <ty> <elt>, uint <idx> <i>; yields <n x <ty>></i> -</pre> - -<h5>Overview:</h5> - -<p> -The '<tt>insertelement</tt>' instruction inserts a scalar -element into a packed vector at a specified index. -</p> - - -<h5>Arguments:</h5> - -<p> -The first operand of an '<tt>insertelement</tt>' instruction is a -value of <a href="#t_packed">packed</a> type. The second operand is a -scalar value whose type must equal the element type of the first -operand. The third operand is an index indicating the position at -which to insert the value. The index may be a variable.</p> - -<h5>Semantics:</h5> - -<p> -The result is a packed vector of the same type as <tt>val</tt>. Its -element values are those of <tt>val</tt> except at position -<tt>idx</tt>, where it gets the value <tt>elt</tt>. If <tt>idx</tt> -exceeds the length of <tt>val</tt>, the results are undefined. -</p> - -<h5>Example:</h5> - -<pre> - %result = insertelement <4 x int> %vec, int 1, uint 0 <i>; yields <4 x int></i> -</pre> -</div> - -<!-- _______________________________________________________________________ --> -<div class="doc_subsubsection"> - <a name="i_shufflevector">'<tt>shufflevector</tt>' Instruction</a> -</div> - -<div class="doc_text"> - -<h5>Syntax:</h5> - -<pre> - <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <n x uint> <mask> <i>; yields <n x <ty>></i> -</pre> - -<h5>Overview:</h5> - -<p> -The '<tt>shufflevector</tt>' instruction constructs a permutation of elements -from two input vectors, returning a vector of the same type. -</p> - -<h5>Arguments:</h5> - -<p> -The first two operands of a '<tt>shufflevector</tt>' instruction are vectors -with types that match each other and types that match the result of the -instruction. The third argument is a shuffle mask, which has the same number -of elements as the other vector type, but whose element type is always 'uint'. -</p> - -<p> -The shuffle mask operand is required to be a constant vector with either -constant integer or undef values. -</p> - -<h5>Semantics:</h5> - -<p> -The elements of the two input vectors are numbered from left to right across -both of the vectors. The shuffle mask operand specifies, for each element of -the result vector, which element of the two input registers the result element -gets. The element selector may be undef (meaning "don't care") and the second -operand may be undef if performing a shuffle from only one vector. -</p> - -<h5>Example:</h5> - -<pre> - %result = shufflevector <4 x int> %v1, <4 x int> %v2, - <4 x uint> <uint 0, uint 4, uint 1, uint 5> <i>; yields <4 x int></i> - %result = shufflevector <4 x int> %v1, <4 x int> undef, - <4 x uint> <uint 0, uint 1, uint 2, uint 3> <i>; yields <4 x int></i> - Identity shuffle. -</pre> -</div> - <!-- _______________________________________________________________________ --> <div class="doc_subsubsection"> |