diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-20 00:20:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-20 00:20:30 +0000 |
commit | 78fca695327446df6af50c97a8e775a666e64d3b (patch) | |
tree | 3dd8c38334e9797c2984b7987a161bc8ab98d281 | |
parent | fb194b9e738ab2730ea0a3189f091737aba31c5b (diff) |
Add another helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26881 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index 43ac60b639..ff1bfc26d2 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -179,6 +179,19 @@ namespace MVT { // MVT = Machine Value Types } } + /// MVT::getIntVectorWithNumElements - Return any integer vector type that has + /// the specified number of elements. + static inline ValueType getIntVectorWithNumElements(unsigned NumElts) { + switch (NumElts) { + default: assert(0 && "Invalid vector type!"); + case 2: return v2i32; + case 4: return v4i16; + case 8: return v8i8; + case 16: return v16i8; + } + } + + /// MVT::getIntVTBitMask - Return an integer with 1's every place there are /// bits in the specified integer value type. static inline uint64_t getIntVTBitMask(ValueType VT) { |