[PATCH] D79806: [CodeGen] Specify meaning of ISD opcodes for scalable vectors
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 22 10:43:29 PDT 2020
sdesmalen updated this revision to Diff 265769.
sdesmalen added a comment.
- Added clarification that extract_subvector does not support extracting a scalable vector from a fixed-width vector (and similar for insert_subvector).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79806/new/
https://reviews.llvm.org/D79806
Files:
llvm/include/llvm/CodeGen/ISDOpcodes.h
Index: llvm/include/llvm/CodeGen/ISDOpcodes.h
===================================================================
--- llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -445,44 +445,59 @@
/// Returns platform specific canonical encoding of a floating point number.
FCANONICALIZE,
- /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the
- /// specified, possibly variable, elements. The number of elements is
- /// required to be a power of two. The types of the operands must all be
- /// the same and must match the vector element type, except that integer
- /// types are allowed to be larger than the element type, in which case
- /// the operands are implicitly truncated.
+ /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector
+ /// with the specified, possibly variable, elements. The number of elements
+ /// is required to be a power of two. The types of the operands must all be
+ /// the same and must match the vector element type, except that integer types
+ /// are allowed to be larger than the element type, in which case the operands
+ /// are implicitly truncated.
BUILD_VECTOR,
/// INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element
- /// at IDX replaced with VAL. If the type of VAL is larger than the vector
- /// element type then VAL is truncated before replacement.
+ /// at IDX replaced with VAL. If the type of VAL is larger than the vector
+ /// element type then VAL is truncated before replacement. If VECTOR is a
+ /// scalable vector, then IDX is not first scaled by the runtime scaling
+ /// factor of VECTOR. If VECTOR is a scalable vector and IDX is a constant
+ /// value, then IDX may be larger than the minimum vector width.
INSERT_VECTOR_ELT,
/// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
- /// identified by the (potentially variable) element number IDX. If the
- /// return type is an integer type larger than the element type of the
- /// vector, the result is extended to the width of the return type. In
- /// that case, the high bits are undefined.
+ /// identified by the (potentially variable) element number IDX. If the return
+ /// type is an integer type larger than the element type of the vector, the
+ /// result is extended to the width of the return type. In that case, the high
+ /// bits are undefined. If VECTOR is a scalable vector, then IDX is not first
+ /// scaled by the runtime scaling factor of VECTOR. If VECTOR is a scalable
+ /// vector and IDX is a constant value, then IDX may be larger than the
+ /// minimum vector width.
EXTRACT_VECTOR_ELT,
/// CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of
/// vector type with the same length and element type, this produces a
/// concatenated vector result value, with length equal to the sum of the
- /// lengths of the input vectors.
+ /// lengths of the input vectors. If VECTOR0 is a fixed-width vector, then
+ /// VECTOR1..VECTORN must all be fixed-width vectors. Similarly, if VECTOR0
+ /// is a scalable vector, then VECTOR1..VECTORN must all be scalable vectors.
CONCAT_VECTORS,
- /// INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector
- /// with VECTOR2 inserted into VECTOR1 at the constant element number
- /// IDX, which must be a multiple of the VECTOR2 vector length. The
- /// elements of VECTOR1 starting at IDX are overwritten with VECTOR2.
- /// Elements IDX through vector_length(VECTOR2) must be valid VECTOR1
- /// indices.
+ /// INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2
+ /// inserted into VECTOR1. Let the type of VECTOR2 be T, then IDX is first
+ /// scaled by the same runtime scaling factor of T to form IDX_0, which
+ /// represents the starting element number at which VECTOR2 will be
+ /// inserted. The elements of VECTOR1 starting at IDX_0 are overwritten with
+ /// VECTOR2. Elements IDX_0 through (IDX_0 + vector_length(VECTOR2) - 1)
+ /// must be valid VECTOR1 indices.
+ /// IDX must be a constant multiple of T's known minimum vector length.
+ /// This operation supports inserting a fixed-width vector into a
+ /// scalable vector, but not the other way around.
INSERT_SUBVECTOR,
- /// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an
- /// vector value) starting with the constant element number IDX, which
- /// must be a multiple of the result vector length. Elements IDX through
- /// vector_length(VECTOR) must be valid VECTOR indices.
+ /// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR.
+ /// Let the result type be T, then IDX is first scaled by the same runtime
+ /// scaling factor of T. The resulting index represents the starting
+ /// element number from which a subvector of type T is extracted.
+ /// IDX must be a constant multiple of T's known minimum vector length.
+ /// This operation supports extracting a fixed-width vector from a
+ /// scalable vector, but not the other way around.
EXTRACT_SUBVECTOR,
/// VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79806.265769.patch
Type: text/x-patch
Size: 5184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200522/8c5f8b14/attachment.bin>
More information about the llvm-commits
mailing list