diff options
author | Dale Johannesen <dalej@apple.com> | 2008-03-01 03:40:57 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-03-01 03:40:57 +0000 |
commit | 3c8b59c546b5d56b2cae74da55e26eb994ed36bf (patch) | |
tree | b0ecc37821a3352b6586f593d0b553d2f25af631 /include/llvm/CodeGen/ValueTypes.h | |
parent | 84d4a2b4ad0874a46642bb568b45720d55e46b64 (diff) |
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
Diffstat (limited to 'include/llvm/CodeGen/ValueTypes.h')
-rw-r--r-- | include/llvm/CodeGen/ValueTypes.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h index f2b8dfccca..6b20b7d6a9 100644 --- a/include/llvm/CodeGen/ValueTypes.h +++ b/include/llvm/CodeGen/ValueTypes.h @@ -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. /// |