Changes in directory llvm/include/llvm/CodeGen:
ValueTypes.h updated: 1.23 -> 1.24 --- Log message: Add a helper method --- Diffs of the changes: (+18 -0) ValueTypes.h | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.23 llvm/include/llvm/CodeGen/ValueTypes.h:1.24 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.23 Sat Mar 18 23:26:45 2006 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sun Mar 19 17:41:32 2006 @@ -161,6 +161,24 @@ } } + /// MVT::getVectorNumElements - Given a packed vector type, return the number + /// of elements it contains. + static inline unsigned getVectorNumElements(ValueType VT) { + switch (VT) { + default: assert(0 && "Invalid vector type!"); + case v16i8: return 16; + case v8i8 : + case v8i16: return 8; + case v4i16: + case v4i32: + case v4f32: return 4; + case v2i32: + case v2i64: + case v2f32: + case v2f64: return 2; + } + } + /// 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) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits