summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-05-12 19:01:56 +0000
committerNate Begeman <natebegeman@mac.com>2008-05-12 19:01:56 +0000
commitac80ade1580378e484e24c9f66d2fa5b058e5891 (patch)
tree67b07f1009d7e84478af68b27592195536cda14d /docs
parent7c2e4f2fc5a2fdcf4e933a03dd2e89154c946401 (diff)
downloadllvm-ac80ade1580378e484e24c9f66d2fa5b058e5891.tar.gz
llvm-ac80ade1580378e484e24c9f66d2fa5b058e5891.tar.bz2
llvm-ac80ade1580378e484e24c9f66d2fa5b058e5891.tar.xz
Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details. CodeGen support coming in a follow up patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.html114
1 files changed, 111 insertions, 3 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 6591b27303..71f9c11117 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -140,6 +140,8 @@
<ol>
<li><a href="#i_icmp">'<tt>icmp</tt>' Instruction</a></li>
<li><a href="#i_fcmp">'<tt>fcmp</tt>' Instruction</a></li>
+ <li><a href="#i_vicmp">'<tt>vicmp</tt>' Instruction</a></li>
+ <li><a href="#i_vfcmp">'<tt>vfcmp</tt>' Instruction</a></li>
<li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li>
<li><a href="#i_select">'<tt>select</tt>' Instruction</a></li>
<li><a href="#i_call">'<tt>call</tt>' Instruction</a></li>
@@ -1680,6 +1682,12 @@ following is the syntax for constant expressions:</p>
<dt><b><tt>fcmp COND ( VAL1, VAL2 )</tt></b></dt>
<dd>Performs the <a href="#i_fcmp">fcmp operation</a> on constants.</dd>
+ <dt><b><tt>vicmp COND ( VAL1, VAL2 )</tt></b></dt>
+ <dd>Performs the <a href="#i_vicmp">vicmp operation</a> on constants.</dd>
+
+ <dt><b><tt>vfcmp COND ( VAL1, VAL2 )</tt></b></dt>
+ <dd>Performs the <a href="#i_vfcmp">vfcmp operation</a> on constants.</dd>
+
<dt><b><tt>extractelement ( VAL, IDX )</tt></b></dt>
<dd>Perform the <a href="#i_extractelement">extractelement
@@ -3672,9 +3680,9 @@ a value, just a keyword. The possible condition code are:
<a href="#t_floating">floating point</a> typed. They must have identical
types.</p>
<h5>Semantics:</h5>
-<p>The '<tt>fcmp</tt>' compares <tt>var1</tt> and <tt>var2</tt> according to
-the condition code given as <tt>cond</tt>. The comparison performed always
-yields a <a href="#t_primitive">i1</a> result, as follows:
+<p>The '<tt>fcmp</tt>' instruction compares <tt>var1</tt> and <tt>var2</tt>
+according to the condition code given as <tt>cond</tt>. The comparison performed
+always yields a <a href="#t_primitive">i1</a> result, as follows:
<ol>
<li><tt>false</tt>: always yields <tt>false</tt>, regardless of operands.</li>
<li><tt>oeq</tt>: yields <tt>true</tt> if both operands are not a QNAN and
@@ -3715,6 +3723,106 @@ yields a <a href="#t_primitive">i1</a> result, as follows:
</div>
<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+ <a name="i_vicmp">'<tt>vicmp</tt>' Instruction</a>
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<pre> &lt;result&gt; = vicmp &lt;cond&gt; &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt; <i>; yields {ty}:result</i>
+</pre>
+<h5>Overview:</h5>
+<p>The '<tt>vicmp</tt>' instruction returns an integer vector value based on
+element-wise comparison of its two integer vector operands.</p>
+<h5>Arguments:</h5>
+<p>The '<tt>vicmp</tt>' instruction takes three operands. The first operand is
+the condition code indicating the kind of comparison to perform. It is not
+a value, just a keyword. The possible condition code are:
+<ol>
+ <li><tt>eq</tt>: equal</li>
+ <li><tt>ne</tt>: not equal </li>
+ <li><tt>ugt</tt>: unsigned greater than</li>
+ <li><tt>uge</tt>: unsigned greater or equal</li>
+ <li><tt>ult</tt>: unsigned less than</li>
+ <li><tt>ule</tt>: unsigned less or equal</li>
+ <li><tt>sgt</tt>: signed greater than</li>
+ <li><tt>sge</tt>: signed greater or equal</li>
+ <li><tt>slt</tt>: signed less than</li>
+ <li><tt>sle</tt>: signed less or equal</li>
+</ol>
+<p>The remaining two arguments must be <a href="#t_vector">vector</a> of
+<a href="#t_integer">integer</a> typed. They must also be identical types.</p>
+<h5>Semantics:</h5>
+<p>The '<tt>vicmp</tt>' instruction compares <tt>var1</tt> and <tt>var2</tt>
+according to the condition code given as <tt>cond</tt>. The comparison yields a
+<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a> result, of
+identical type as the values being compared. The most significant bit in each
+element is 1 if the element-wise comparison evaluates to true, and is 0
+otherwise. All other bits of the result are undefined. The condition codes
+are evaluated identically to the <a href="#i_icmp">'<tt>icmp</tt>'
+instruction</a>.
+
+<h5>Example:</h5>
+<pre>
+ &lt;result&gt; = vicmp eq <2 x i32> < i32 4, i32 0 >, < i32 5, i32 0 > <i>; yields: result=<2 x i32> < i32 0, i32 -1 ></i>
+ &lt;result&gt; = vicmp ult <2 x i8> < i8 1, i8 2 >, < i8 2, i8 2> <i>; yields: result=<2 x i8> < i8 -1, i8 0 ></i>
+</pre>
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+ <a name="i_vfcmp">'<tt>vfcmp</tt>' Instruction</a>
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<pre> &lt;result&gt; = vfcmp &lt;cond&gt; &lt;ty&gt; &lt;var1&gt;, &lt;var2&gt;</pre>
+<h5>Overview:</h5>
+<p>The '<tt>vfcmp</tt>' instruction returns an integer vector value based on
+element-wise comparison of its two floating point vector operands. The output
+elements have the same width as the input elements.</p>
+<h5>Arguments:</h5>
+<p>The '<tt>vfcmp</tt>' instruction takes three operands. The first operand is
+the condition code indicating the kind of comparison to perform. It is not
+a value, just a keyword. The possible condition code are:
+<ol>
+ <li><tt>false</tt>: no comparison, always returns false</li>
+ <li><tt>oeq</tt>: ordered and equal</li>
+ <li><tt>ogt</tt>: ordered and greater than </li>
+ <li><tt>oge</tt>: ordered and greater than or equal</li>
+ <li><tt>olt</tt>: ordered and less than </li>
+ <li><tt>ole</tt>: ordered and less than or equal</li>
+ <li><tt>one</tt>: ordered and not equal</li>
+ <li><tt>ord</tt>: ordered (no nans)</li>
+ <li><tt>ueq</tt>: unordered or equal</li>
+ <li><tt>ugt</tt>: unordered or greater than </li>
+ <li><tt>uge</tt>: unordered or greater than or equal</li>
+ <li><tt>ult</tt>: unordered or less than </li>
+ <li><tt>ule</tt>: unordered or less than or equal</li>
+ <li><tt>une</tt>: unordered or not equal</li>
+ <li><tt>uno</tt>: unordered (either nans)</li>
+ <li><tt>true</tt>: no comparison, always returns true</li>
+</ol>
+<p>The remaining two arguments must be <a href="#t_vector">vector</a> of
+<a href="#t_floating">floating point</a> typed. They must also be identical
+types.</p>
+<h5>Semantics:</h5>
+<p>The '<tt>vfcmp</tt>' instruction compares <tt>var1</tt> and <tt>var2</tt>
+according to the condition code given as <tt>cond</tt>. The comparison yields a
+<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a> result, with
+an identical number of elements as the values being compared, and each element
+having identical with to the width of the floating point elements. The most
+significant bit in each element is 1 if the element-wise comparison evaluates to
+true, and is 0 otherwise. All other bits of the result are undefined. The
+condition codes are evaluated identically to the
+<a href="#i_fcmp">'<tt>fcmp</tt>' instruction</a>.
+
+<h5>Example:</h5>
+<pre>
+ &lt;result&gt; = vfcmp oeq <2 x float> < float 4, float 0 >, < float 5, float 0 > <i>; yields: result=<2 x i32> < i32 0, i32 -1 ></i>
+ &lt;result&gt; = vfcmp ult <2 x double> < double 1, double 2 >, < double 2, double 2> <i>; yields: result=<2 x i64> < i64 -1, i64 0 ></i>
+</pre>
+</div>
+
+<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_phi">'<tt>phi</tt>'
Instruction</a> </div>
<div class="doc_text">