Add MVT::is128BitVector and is64BitVector. Shrink

unaligned load/store code using them.  Per review
of unaligned load/store vector patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen
2008-03-01 03:40:57 +00:00
parent 84d4a2b4ad
commit 3c8b59c546
2 changed files with 18 additions and 16 deletions

View File

@ -250,6 +250,19 @@ namespace MVT { // MVT = Machine Value Types
return (getSizeInBits(VT) + 7)/8*8;
}
/// MVT::is64BitVector - Return true if this is a 64-bit vector type.
static inline bool is64BitVector(ValueType VT) {
return (VT==v8i8 || VT==v4i16 || VT==v2i32 || VT==v1i64 || VT==v2f32 ||
(isExtendedVT(VT) && isVector(VT) && getSizeInBits(VT)==64));
}
/// MVT::is128BitVector - Return true if this is a 128-bit vector type.
static inline bool is128BitVector(ValueType VT) {
return (VT==v16i8 || VT==v8i16 || VT==v4i32 || VT==v2i64 ||
VT==v4f32 || VT==v2f64 ||
(isExtendedVT(VT) && isVector(VT) && getSizeInBits(VT)==128));
}
/// MVT::getIntegerType - Returns the ValueType that represents an integer
/// with the given number of bits.
///