For PR1195:

Packed -> Vector


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34296 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2007-02-15 03:07:05 +00:00
parent 3cd4c892d9
commit 485bad1a09
2 changed files with 30 additions and 30 deletions

View File

@@ -42,7 +42,7 @@
<li><a href="#t_pointer">Pointer Type</a></li> <li><a href="#t_pointer">Pointer Type</a></li>
<li><a href="#t_struct">Structure Type</a></li> <li><a href="#t_struct">Structure Type</a></li>
<li><a href="#t_pstruct">Packed Structure Type</a></li> <li><a href="#t_pstruct">Packed Structure Type</a></li>
<li><a href="#t_packed">Packed Type</a></li> <li><a href="#t_vector">Vector Type</a></li>
<li><a href="#t_opaque">Opaque Type</a></li> <li><a href="#t_opaque">Opaque Type</a></li>
</ol> </ol>
</li> </li>
@@ -844,7 +844,7 @@ classifications:</p>
<tr> <tr>
<td><a name="t_firstclass">first class</a></td> <td><a name="t_firstclass">first class</a></td>
<td><tt>i1, i8, i16, i32, i64, float, double, <br/> <td><tt>i1, i8, i16, i32, i64, float, double, <br/>
<a href="#t_pointer">pointer</a>,<a href="#t_packed">packed</a></tt> <a href="#t_pointer">pointer</a>,<a href="#t_vector">vector</a></tt>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -1063,17 +1063,17 @@ reference to another object, which must live in memory.</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="t_packed">Packed Type</a> </div> <div class="doc_subsubsection"> <a name="t_vector">Vector Type</a> </div>
<div class="doc_text"> <div class="doc_text">
<h5>Overview:</h5> <h5>Overview:</h5>
<p>A packed type is a simple derived type that represents a vector <p>A vector type is a simple derived type that represents a vector
of elements. Packed types are used when multiple primitive data of elements. Vector types are used when multiple primitive data
are operated in parallel using a single instruction (SIMD). are operated in parallel using a single instruction (SIMD).
A packed type requires a size (number of A vector type requires a size (number of
elements) and an underlying primitive data type. Vectors must have a power elements) and an underlying primitive data type. Vectors must have a power
of two length (1, 2, 4, 8, 16 ...). Packed types are of two length (1, 2, 4, 8, 16 ...). Vector types are
considered <a href="#t_firstclass">first class</a>.</p> considered <a href="#t_firstclass">first class</a>.</p>
<h5>Syntax:</h5> <h5>Syntax:</h5>
@@ -1095,9 +1095,9 @@ be any integer or floating point type.</p>
<tt>&lt;2 x i64&gt;</tt><br/> <tt>&lt;2 x i64&gt;</tt><br/>
</td> </td>
<td class="left"> <td class="left">
Packed vector of 4 32-bit integer values.<br/> Vector of 4 32-bit integer values.<br/>
Packed vector of 8 floating-point values.<br/> Vector of 8 floating-point values.<br/>
Packed vector of 2 64-bit integer values.<br/> Vector of 2 64-bit integer values.<br/>
</td> </td>
</tr> </tr>
</table> </table>
@@ -1219,13 +1219,13 @@ and smaller aggregate constants.</p>
types of elements must match those specified by the type. types of elements must match those specified by the type.
</dd> </dd>
<dt><b>Packed constants</b></dt> <dt><b>Vector constants</b></dt>
<dd>Packed constants are represented with notation similar to packed type <dd>Vector constants are represented with notation similar to vector type
definitions (a comma separated list of elements, surrounded by definitions (a comma separated list of elements, surrounded by
less-than/greater-than's (<tt>&lt;&gt;</tt>)). For example: "<tt>&lt; i32 42, less-than/greater-than's (<tt>&lt;&gt;</tt>)). For example: "<tt>&lt; i32 42,
i32 11, i32 74, i32 100 &gt;</tt>". Packed constants must have <a i32 11, i32 74, i32 100 &gt;</tt>". VEctor constants must have <a
href="#t_packed">packed type</a>, and the number and types of elements must href="#t_vector">vector type</a>, and the number and types of elements must
match those specified by the type. match those specified by the type.
</dd> </dd>
@@ -1345,7 +1345,7 @@ following is the syntax for constant expressions:</p>
identical (same number of bits). The conversion is done as if the CST value identical (same number of bits). The conversion is done as if the CST value
was stored to memory and read back as TYPE. In other words, no bits change was stored to memory and read back as TYPE. In other words, no bits change
with this operator, just the type. This can be used for conversion of with this operator, just the type. This can be used for conversion of
packed types to any other type, as long as they have the same bit width. For vector types to any other type, as long as they have the same bit width. For
pointers it is only valid to cast to another pointer type. pointers it is only valid to cast to another pointer type.
</dd> </dd>
@@ -1737,7 +1737,7 @@ no-return function cannot be reached, and other facts.</p>
<p>Binary operators are used to do most of the computation in a <p>Binary operators are used to do most of the computation in a
program. They require two operands, execute an operation on them, and program. They require two operands, execute an operation on them, and
produce a single value. The operands might represent produce a single value. The operands might represent
multiple data, as is the case with the <a href="#t_packed">packed</a> data type. multiple data, as is the case with the <a href="#t_vector">vector</a> data type.
The result value of a binary operator is not The result value of a binary operator is not
necessarily the same type as its operands.</p> necessarily the same type as its operands.</p>
<p>There are several different binary operators:</p> <p>There are several different binary operators:</p>
@@ -1754,7 +1754,7 @@ Instruction</a> </div>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>add</tt>' instruction must be either <a <p>The two arguments to the '<tt>add</tt>' instruction must be either <a
href="#t_integer">integer</a> or <a href="#t_floating">floating point</a> values. href="#t_integer">integer</a> or <a href="#t_floating">floating point</a> values.
This instruction can also take <a href="#t_packed">packed</a> versions of the values. This instruction can also take <a href="#t_vector">vector</a> versions of the values.
Both arguments must have identical types.</p> Both arguments must have identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the integer or floating point sum of the two <p>The value produced is the integer or floating point sum of the two
@@ -1779,7 +1779,7 @@ instruction present in most other intermediate representations.</p>
<p>The two arguments to the '<tt>sub</tt>' instruction must be either <a <p>The two arguments to the '<tt>sub</tt>' instruction must be either <a
href="#t_integer">integer</a> or <a href="#t_floating">floating point</a> href="#t_integer">integer</a> or <a href="#t_floating">floating point</a>
values. values.
This instruction can also take <a href="#t_packed">packed</a> versions of the values. This instruction can also take <a href="#t_vector">vector</a> versions of the values.
Both arguments must have identical types.</p> Both arguments must have identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the integer or floating point difference of <p>The value produced is the integer or floating point difference of
@@ -1803,7 +1803,7 @@ operands.</p>
<p>The two arguments to the '<tt>mul</tt>' instruction must be either <a <p>The two arguments to the '<tt>mul</tt>' instruction must be either <a
href="#t_integer">integer</a> or <a href="#t_floating">floating point</a> href="#t_integer">integer</a> or <a href="#t_floating">floating point</a>
values. values.
This instruction can also take <a href="#t_packed">packed</a> versions of the values. This instruction can also take <a href="#t_vector">vector</a> versions of the values.
Both arguments must have identical types.</p> Both arguments must have identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the integer or floating point product of the <p>The value produced is the integer or floating point product of the
@@ -1828,7 +1828,7 @@ operands.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>udiv</tt>' instruction must be <p>The two arguments to the '<tt>udiv</tt>' instruction must be
<a href="#t_integer">integer</a> values. Both arguments must have identical <a href="#t_integer">integer</a> values. Both arguments must have identical
types. This instruction can also take <a href="#t_packed">packed</a> versions types. This instruction can also take <a href="#t_vector">vector</a> versions
of the values in which case the elements must be integers.</p> of the values in which case the elements must be integers.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the unsigned integer quotient of the two operands. This <p>The value produced is the unsigned integer quotient of the two operands. This
@@ -1851,7 +1851,7 @@ operands.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>sdiv</tt>' instruction must be <p>The two arguments to the '<tt>sdiv</tt>' instruction must be
<a href="#t_integer">integer</a> values. Both arguments must have identical <a href="#t_integer">integer</a> values. Both arguments must have identical
types. This instruction can also take <a href="#t_packed">packed</a> versions types. This instruction can also take <a href="#t_vector">vector</a> versions
of the values in which case the elements must be integers.</p> of the values in which case the elements must be integers.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the signed integer quotient of the two operands. This <p>The value produced is the signed integer quotient of the two operands. This
@@ -1874,7 +1874,7 @@ operands.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The two arguments to the '<tt>div</tt>' instruction must be <p>The two arguments to the '<tt>div</tt>' instruction must be
<a href="#t_floating">floating point</a> values. Both arguments must have <a href="#t_floating">floating point</a> values. Both arguments must have
identical types. This instruction can also take <a href="#t_packed">packed</a> identical types. This instruction can also take <a href="#t_vector">vector</a>
versions of the values in which case the elements must be floating point.</p> versions of the values in which case the elements must be floating point.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The value produced is the floating point quotient of the two operands.</p> <p>The value produced is the floating point quotient of the two operands.</p>
@@ -2244,7 +2244,7 @@ target.</p>
<p> <p>
The '<tt>extractelement</tt>' instruction extracts a single scalar The '<tt>extractelement</tt>' instruction extracts a single scalar
element from a packed vector at a specified index. element from a vector at a specified index.
</p> </p>
@@ -2252,7 +2252,7 @@ element from a packed vector at a specified index.
<p> <p>
The first operand of an '<tt>extractelement</tt>' instruction is a The first operand of an '<tt>extractelement</tt>' instruction is a
value of <a href="#t_packed">packed</a> type. The second operand is value of <a href="#t_vector">vector</a> type. The second operand is
an index indicating the position from which to extract the element. an index indicating the position from which to extract the element.
The index may be a variable.</p> The index may be a variable.</p>
@@ -2290,7 +2290,7 @@ results are undefined.
<p> <p>
The '<tt>insertelement</tt>' instruction inserts a scalar The '<tt>insertelement</tt>' instruction inserts a scalar
element into a packed vector at a specified index. element into a vector at a specified index.
</p> </p>
@@ -2298,7 +2298,7 @@ element into a packed vector at a specified index.
<p> <p>
The first operand of an '<tt>insertelement</tt>' instruction is a 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 value of <a href="#t_vector">vector</a> type. The second operand is a
scalar value whose type must equal the element type of the first scalar value whose type must equal the element type of the first
operand. The third operand is an index indicating the position at operand. The third operand is an index indicating the position at
which to insert the value. The index may be a variable.</p> which to insert the value. The index may be a variable.</p>
@@ -2306,7 +2306,7 @@ which to insert the value. The index may be a variable.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p> <p>
The result is a packed vector of the same type as <tt>val</tt>. Its The result is a vector of the same type as <tt>val</tt>. Its
element values are those of <tt>val</tt> except at position 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> <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. exceeds the length of <tt>val</tt>, the results are undefined.

View File

@@ -2315,9 +2315,9 @@ the <tt>lib/VMCore</tt> directory.</p>
<dt><tt>PointerType</tt></dt> <dt><tt>PointerType</tt></dt>
<dd>Subclass of SequentialType for pointer types.</dd> <dd>Subclass of SequentialType for pointer types.</dd>
<dt><tt>VectorType</tt></dt> <dt><tt>VectorType</tt></dt>
<dd>Subclass of SequentialType for packed (vector) types. A <dd>Subclass of SequentialType for vector types. A
packed type is similar to an ArrayType but is distinguished because it is vector type is similar to an ArrayType but is distinguished because it is
a first class type wherease ArrayType is not. Packed types are used for a first class type wherease ArrayType is not. Vector types are used for
vector operations and are usually small vectors of of an integer or floating vector operations and are usually small vectors of of an integer or floating
point type.</dd> point type.</dd>
<dt><tt>StructType</tt></dt> <dt><tt>StructType</tt></dt>