diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-20 22:35:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-20 22:35:55 +0000 |
commit | 58092e35a3368e130438cbc793c8f9dce2e4fe0f (patch) | |
tree | c970c89150c10f0c2c19bc5670cd7df017ab0eae /lib/VMCore/ValueTypes.cpp | |
parent | c5633c235e94f69c6a77e894bcc84d8ba71106f0 (diff) | |
download | external_llvm-58092e35a3368e130438cbc793c8f9dce2e4fe0f.zip external_llvm-58092e35a3368e130438cbc793c8f9dce2e4fe0f.tar.gz external_llvm-58092e35a3368e130438cbc793c8f9dce2e4fe0f.tar.bz2 |
Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can. Patch by Scott Michel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ValueTypes.cpp')
-rw-r--r-- | lib/VMCore/ValueTypes.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/VMCore/ValueTypes.cpp b/lib/VMCore/ValueTypes.cpp index 8732d64..e421d5d 100644 --- a/lib/VMCore/ValueTypes.cpp +++ b/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); } } |