[llvm-commits] [llvm] r164668 - /llvm/trunk/include/llvm/CodeGen/ValueTypes.h
Craig Topper
craig.topper at gmail.com
Wed Sep 26 00:17:37 PDT 2012
Author: ctopper
Date: Wed Sep 26 02:17:37 2012
New Revision: 164668
URL: http://llvm.org/viewvc/llvm-project?rev=164668&view=rev
Log:
Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.
Modified:
llvm/trunk/include/llvm/CodeGen/ValueTypes.h
Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=164668&r1=164667&r2=164668&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Wed Sep 26 02:17:37 2012
@@ -181,6 +181,18 @@
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 @@
/// 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.
More information about the llvm-commits
mailing list