[llvm-commits] [llvm] r150416 - /llvm/trunk/include/llvm/CodeGen/ValueTypes.h

Owen Anderson resistor at mac.com
Mon Feb 13 13:47:20 PST 2012


Author: resistor
Date: Mon Feb 13 15:47:20 2012
New Revision: 150416

URL: http://llvm.org/viewvc/llvm-project?rev=150416&view=rev
Log:
v2f16 is a floating point type.  Add symbolic floating point type ranges to prevent this kind of issue in the future.

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=150416&r1=150415&r2=150416&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Mon Feb 13 15:47:20 2012
@@ -53,6 +53,9 @@
       f128           =  11,   // This is a 128 bit floating point value
       ppcf128        =  12,   // This is a PPC 128-bit floating point value
 
+      FIRST_FP_VALUETYPE = f16,
+      LAST_FP_VALUETYPE  = ppcf128,
+
       v2i8           =  13,   //  2 x i8
       v4i8           =  14,   //  4 x i8
       v8i8           =  15,   //  8 x i8
@@ -79,6 +82,8 @@
 
       FIRST_VECTOR_VALUETYPE = v2i8,
       LAST_VECTOR_VALUETYPE  = v4f64,
+      FIRST_FP_VECTOR_VALUETYPE = v2f16,
+      LAST_FP_VECTOR_VALUETYPE = v4f64,
 
       x86mmx         =  35,   // This is an X86 MMX value
 
@@ -146,8 +151,10 @@
 
     /// isFloatingPoint - Return true if this is a FP, or a vector FP type.
     bool isFloatingPoint() const {
-      return ((SimpleTy >= MVT::f16 && SimpleTy <= MVT::ppcf128) ||
-	      (SimpleTy >= MVT::v2f32 && SimpleTy <= MVT::v4f64));
+      return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
+               SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
+	      (SimpleTy >= MVT::FIRST_FP_VECTOR_VALUETYPE &&
+         SimpleTy <= MVT::LAST_FP_VECTOR_VALUETYPE));
     }
 
     /// isInteger - Return true if this is an integer, or a vector integer type.





More information about the llvm-commits mailing list