summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-20 22:35:55 +0000
committerChris Lattner <sabre@nondot.org>2007-01-20 22:35:55 +0000
commit50ee0e40e553cbf2ce4eb920d7e2cb264f927438 (patch)
tree66423d72e856a6b3c463e21c0bb7241e7183c60e /llvm/lib/VMCore
parent7476fa445672333a766866debf2fed569dd408d9 (diff)
downloadbcm5719-llvm-50ee0e40e553cbf2ce4eb920d7e2cb264f927438.tar.gz
bcm5719-llvm-50ee0e40e553cbf2ce4eb920d7e2cb264f927438.zip
Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can. Patch by Scott Michel! llvm-svn: 33409
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/ValueTypes.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/ValueTypes.cpp b/llvm/lib/VMCore/ValueTypes.cpp
index 8732d641983..e421d5d4303 100644
--- a/llvm/lib/VMCore/ValueTypes.cpp
+++ b/llvm/lib/VMCore/ValueTypes.cpp
@@ -82,8 +82,8 @@ MVT::ValueType MVT::getVectorType(ValueType VT, unsigned NumElements) {
}
/// 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 @@ const Type *MVT::getTypeForValueType(MVT::ValueType VT) {
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);
}
}
OpenPOWER on IntegriCloud