[llvm-commits] CVS: llvm/lib/VMCore/ValueTypes.cpp

Chris Lattner sabre at nondot.org
Sat Jan 20 14:36:27 PST 2007



Changes in directory llvm/lib/VMCore:

ValueTypes.cpp updated: 1.11 -> 1.12
---
Log message:

Teach TargetData to handle 'preferred' alignment for each target, and use 
these alignment amounts to align scalars when we can.  Patch by Scott Michel!



---
Diffs of the changes:  (+11 -2)

 ValueTypes.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)


Index: llvm/lib/VMCore/ValueTypes.cpp
diff -u llvm/lib/VMCore/ValueTypes.cpp:1.11 llvm/lib/VMCore/ValueTypes.cpp:1.12
--- llvm/lib/VMCore/ValueTypes.cpp:1.11	Fri Jan 19 15:13:56 2007
+++ llvm/lib/VMCore/ValueTypes.cpp	Sat Jan 20 16:35:55 2007
@@ -82,8 +82,8 @@
 }
 
 /// MVT::getTypeForValueType - This method returns an LLVM type corresponding
-/// to the specified ValueType.  For integer types, this returns an unsigned
-/// type.  Note that this will abort for types that cannot be represented.
+/// to the specified ValueType.  Note that this will abort for types that cannot
+/// be represented.
 const Type *MVT::getTypeForValueType(MVT::ValueType VT) {
   switch (VT) {
   default: assert(0 && "ValueType does not correspond to LLVM type!");
@@ -95,5 +95,14 @@
   case MVT::i64:   return Type::Int64Ty;
   case MVT::f32:   return Type::FloatTy;
   case MVT::f64:   return Type::DoubleTy;
+  case MVT::v8i8:  return PackedType::get(Type::Int8Ty, 8);
+  case MVT::v4i16: return PackedType::get(Type::Int16Ty, 4);
+  case MVT::v2i32: return PackedType::get(Type::Int32Ty, 2);
+  case MVT::v16i8: return PackedType::get(Type::Int8Ty, 16);
+  case MVT::v8i16: return PackedType::get(Type::Int16Ty, 8);
+  case MVT::v4i32: return PackedType::get(Type::Int32Ty, 4);
+  case MVT::v2i64: return PackedType::get(Type::Int64Ty, 2);
+  case MVT::v4f32: return PackedType::get(Type::FloatTy, 4);
+  case MVT::v2f64: return PackedType::get(Type::DoubleTy, 2);
   }
 }






More information about the llvm-commits mailing list