summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-09-26 07:17:37 +0000
committerCraig Topper <craig.topper@gmail.com>2012-09-26 07:17:37 +0000
commit0f841b4f95cd3a5c451d65f5fd082d8bcb2828d9 (patch)
tree8f90c8cdb7084bd9ee64057271537f3cf0fff41a /include
parent542b716bbcb3fa1b3354bc71bb84327921f73da3 (diff)
downloadllvm-0f841b4f95cd3a5c451d65f5fd082d8bcb2828d9.tar.gz
llvm-0f841b4f95cd3a5c451d65f5fd082d8bcb2828d9.tar.bz2
llvm-0f841b4f95cd3a5c451d65f5fd082d8bcb2828d9.tar.xz
Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index 5781402d85..766d5fbe57 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -181,6 +181,18 @@ namespace llvm {
SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
}
+ /// is16BitVector - Return true if this is a 16-bit vector type.
+ bool is16BitVector() const {
+ return (SimpleTy == MVT::v2i8 || SimpleTy == MVT::v1i16 ||
+ SimpleTy == MVT::v16i1);
+ }
+
+ /// is32BitVector - Return true if this is a 32-bit vector type.
+ bool is32BitVector() const {
+ return (SimpleTy == MVT::v4i8 || SimpleTy == MVT::v2i16 ||
+ SimpleTy == MVT::v1i32);
+ }
+
/// is64BitVector - Return true if this is a 64-bit vector type.
bool is64BitVector() const {
return (SimpleTy == MVT::v8i8 || SimpleTy == MVT::v4i16 ||
@@ -563,19 +575,12 @@ namespace llvm {
/// is16BitVector - Return true if this is a 16-bit vector type.
bool is16BitVector() const {
- if (!isSimple())
- return isExtended16BitVector();
-
- return (V == MVT::v2i8 || V==MVT::v1i16 || V == MVT::v16i1);
+ return isSimple() ? V.is16BitVector() : isExtended16BitVector();
}
/// is32BitVector - Return true if this is a 32-bit vector type.
bool is32BitVector() const {
- if (!isSimple())
- return isExtended32BitVector();
-
- return (V == MVT::v4i8 || V==MVT::v2i16
- || V==MVT::v1i32);
+ return isSimple() ? V.is32BitVector() : isExtended32BitVector();
}
/// is64BitVector - Return true if this is a 64-bit vector type.