[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h

Chris Lattner lattner at cs.uiuc.edu
Sun Mar 19 16:20:42 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

ValueTypes.h updated: 1.24 -> 1.25
---
Log message:

Add another helper


---
Diffs of the changes:  (+13 -0)

 ValueTypes.h |   13 +++++++++++++
 1 files changed, 13 insertions(+)


Index: llvm/include/llvm/CodeGen/ValueTypes.h
diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.24 llvm/include/llvm/CodeGen/ValueTypes.h:1.25
--- llvm/include/llvm/CodeGen/ValueTypes.h:1.24	Sun Mar 19 17:41:32 2006
+++ llvm/include/llvm/CodeGen/ValueTypes.h	Sun Mar 19 18:20:30 2006
@@ -179,6 +179,19 @@
     }
   }
   
+  /// 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) {






More information about the llvm-commits mailing list