aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-08-11 01:14:02 +0000
committerBob Wilson <bob.wilson@apple.com>2009-08-11 01:14:02 +0000
commit61fc4cf7aa0b87ceab62082cee8ef5ce3f574ffc (patch)
tree6c361f43f73aad64e12ee591fe48a1a42169edb4 /include
parent1c5cf1b3785c4e6dcd0b8549008861cb2c4e49ee (diff)
Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h21
-rw-r--r--include/llvm/CodeGen/ValueTypes.td7
-rw-r--r--include/llvm/Intrinsics.h2
-rw-r--r--include/llvm/Intrinsics.td1
4 files changed, 23 insertions, 8 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index a77ed50805..b32bda9c79 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -83,26 +83,31 @@ namespace llvm {
MAX_ALLOWED_VALUETYPE = 64,
// Metadata - This is MDNode or MDString.
- Metadata = 251,
+ Metadata = 250,
// iPTRAny - An int value the size of the pointer of the current
// target to any address space. This must only be used internal to
// tblgen. Other than for overloading, we treat iPTRAny the same as iPTR.
- iPTRAny = 252,
+ iPTRAny = 251,
+
+ // vAny - A vector with any length and element size. This is used
+ // for intrinsics that have overloadings based on vector types.
+ // This is only for tblgen's consumption!
+ vAny = 252,
// fAny - Any floating-point or vector floating-point value. This is used
// for intrinsics that have overloadings based on floating-point types.
// This is only for tblgen's consumption!
- fAny = 253,
+ fAny = 253,
// iAny - An integer or vector integer value of any bit width. This is
// used for intrinsics that have overloadings based on integer bit widths.
// This is only for tblgen's consumption!
- iAny = 254,
+ iAny = 254,
// iPTR - An int value the size of the pointer of the current
// target. This should only be used internal to tblgen!
- iPTR = 255,
+ iPTR = 255,
// LastSimpleValueType - The greatest valid SimpleValueType value.
LastSimpleValueType = 255
@@ -284,6 +289,11 @@ namespace llvm {
V==v4i64) : isExtended256BitVector();
}
+ /// isOverloaded - Return true if this is an overloaded type for TableGen.
+ bool isOverloaded() const {
+ return (V==iAny || V==fAny || V==vAny || V==iPTRAny);
+ }
+
/// isByteSized - Return true if the bit size is a multiple of 8.
bool isByteSized() const {
return (getSizeInBits() & 7) == 0;
@@ -396,6 +406,7 @@ namespace llvm {
case iPTRAny:
case iAny:
case fAny:
+ case vAny:
assert(0 && "Value type is overloaded.");
default:
return getExtendedSizeInBits();
diff --git a/include/llvm/CodeGen/ValueTypes.td b/include/llvm/CodeGen/ValueTypes.td
index 596da059c9..986555b976 100644
--- a/include/llvm/CodeGen/ValueTypes.td
+++ b/include/llvm/CodeGen/ValueTypes.td
@@ -56,11 +56,14 @@ def v8f32 : ValueType<256, 31>; // 8 x f32 vector value
def v2f64 : ValueType<128, 32>; // 2 x f64 vector value
def v4f64 : ValueType<256, 33>; // 4 x f64 vector value
-def MetadataVT: ValueType<0, 251>; // Metadata
+def MetadataVT: ValueType<0, 250>; // Metadata
// Pseudo valuetype mapped to the current pointer size to any address space.
// Should only be used in TableGen.
-def iPTRAny : ValueType<0, 252>;
+def iPTRAny : ValueType<0, 251>;
+
+// Pseudo valuetype to represent "vector of any size"
+def vAny : ValueType<0 , 252>;
// Pseudo valuetype to represent "float of any format"
def fAny : ValueType<0 , 253>;
diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h
index 0b99204bb1..5750a27d73 100644
--- a/include/llvm/Intrinsics.h
+++ b/include/llvm/Intrinsics.h
@@ -63,7 +63,7 @@ namespace Intrinsic {
/// declaration for an intrinsic, and return it.
///
/// The Tys and numTys parameters are for intrinsics with overloaded types
- /// (i.e., those using iAny or fAny). For a declaration for an overloaded
+ /// (e.g., those using iAny or fAny). For a declaration for an overloaded
/// intrinsic, Tys should point to an array of numTys pointers to Type,
/// and must provide exactly one type for each overloaded type in the
/// intrinsic.
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td
index 25f6604afa..83d28fb8fe 100644
--- a/include/llvm/Intrinsics.td
+++ b/include/llvm/Intrinsics.td
@@ -94,6 +94,7 @@ class LLVMTruncatedElementVectorType<int num> : LLVMMatchType<num>;
def llvm_void_ty : LLVMType<isVoid>;
def llvm_anyint_ty : LLVMType<iAny>;
def llvm_anyfloat_ty : LLVMType<fAny>;
+def llvm_anyvector_ty : LLVMType<vAny>;
def llvm_i1_ty : LLVMType<i1>;
def llvm_i8_ty : LLVMType<i8>;
def llvm_i16_ty : LLVMType<i16>;