+//===----------------------------------------------------------------------===//
+// Helpers for working with extended types.
+
+/// FilterVTs - Filter a list of VT's according to a predicate.
+///
+template<typename T>
+static std::vector<MVT::ValueType>
+FilterVTs(const std::vector<MVT::ValueType> &InVTs, T Filter) {
+ std::vector<MVT::ValueType> Result;
+ for (unsigned i = 0, e = InVTs.size(); i != e; ++i)
+ if (Filter(InVTs[i]))
+ Result.push_back(InVTs[i]);
+ return Result;
+}
+
+/// isExtIntegerVT - Return true if the specified extended value type is
+/// integer, or isInt.
+static bool isExtIntegerVT(unsigned char VT) {
+ return VT == MVT::isInt ||
+ (VT < MVT::LAST_VALUETYPE && MVT::isInteger((MVT::ValueType)VT));
+}
+
+/// isExtFloatingPointVT - Return true if the specified extended value type is
+/// floating point, or isFP.
+static bool isExtFloatingPointVT(unsigned char VT) {
+ return VT == MVT::isFP ||
+ (VT < MVT::LAST_VALUETYPE && MVT::isFloatingPoint((MVT::ValueType)VT));
+}
+