[llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h

Evan Cheng evan.cheng at apple.com
Tue Feb 28 16:55:38 PST 2006



Changes in directory llvm/include/llvm/CodeGen:

ValueTypes.h updated: 1.19 -> 1.20
---
Log message:

- Added v2f32, not used by any target currently. Only for testing purpose.
- Minor bug fix.


---
Diffs of the changes:  (+27 -12)

 ValueTypes.h |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)


Index: llvm/include/llvm/CodeGen/ValueTypes.h
diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.19 llvm/include/llvm/CodeGen/ValueTypes.h:1.20
--- llvm/include/llvm/CodeGen/ValueTypes.h:1.19	Wed Feb 22 10:23:43 2006
+++ llvm/include/llvm/CodeGen/ValueTypes.h	Tue Feb 28 18:55:26 2006
@@ -56,20 +56,21 @@
     v4i32          =  19,   //  4 x i32
     v2i64          =  20,   //  2 x i64
 
-    v4f32          =  21,   //  4 x f32
-    v2f64          =  22,   //  2 x f64
+    v2f32          =  21,   //  2 x f32
+    v4f32          =  22,   //  4 x f32
+    v2f64          =  23,   //  2 x f64
 
     LAST_VALUETYPE          // This always remains at the end of the list.
   };
 
   static inline bool isInteger(ValueType VT) {
-    return (VT >= i1 && VT <= i128) || (VT >= v16i8 && VT <= v2i64);
+    return (VT >= i1 && VT <= i128) || (VT >= v8i8 && VT <= v2i64);
   }
   static inline bool isFloatingPoint(ValueType VT) {
     return (VT >= f32 && VT <= f128) || (VT >= v4f32 && VT <= v2f64);
   }
   static inline bool isVector(ValueType VT) {
-    return (VT >= v16i8 && VT <= v2f64);
+    return (VT >= v8i8 && VT <= v2f64);
   }
   
   /// getVectorType - Returns the ValueType that represents a vector NumElements
@@ -80,11 +81,24 @@
     switch (VT) {
     default: 
       break;
+    case MVT::i8:
+      if (NumElements == 8)  return MVT::v8i8;
+      if (NumElements == 16) return MVT::v16i8;
+      break;
+    case MVT::i16:
+      if (NumElements == 4)  return MVT::v4i16;
+      if (NumElements == 8)  return MVT::v8i16;
+      break;
     case MVT::i32:
-      if (NumElements == 4) return MVT::v4i32;
+      if (NumElements == 2)  return MVT::v2i32;
+      if (NumElements == 4)  return MVT::v4i32;
       break;
     case MVT::f32:
-      if (NumElements == 4) return MVT::v4f32;
+      if (NumElements == 2)  return MVT::v2f32;
+      if (NumElements == 4)  return MVT::v4f32;
+      break;
+    case MVT::f64:
+      if (NumElements == 2)  return MVT::v2f64;
       break;
     }
     return MVT::Other;
@@ -93,17 +107,18 @@
   static inline unsigned getSizeInBits(ValueType VT) {
     switch (VT) {
     default: assert(0 && "ValueType has no known size!");
-    case MVT::i1  : return 1;
-    case MVT::i8  : return 8;
-    case MVT::i16 : return 16;
+    case MVT::i1  :  return 1;
+    case MVT::i8  :  return 8;
+    case MVT::i16 :  return 16;
     case MVT::f32 :
-    case MVT::i32 : return 32;
+    case MVT::i32 :  return 32;
     case MVT::f64 :
     case MVT::i64 :
     case MVT::v8i8:
     case MVT::v4i16:
-    case MVT::v2i32:return 64;
-    case MVT::f80 : return 80;
+    case MVT::v2i32: 
+    case MVT::v2f32: return 64;
+    case MVT::f80 :  return 80;
     case MVT::f128:
     case MVT::i128: 
     case MVT::v16i8:






More information about the llvm-commits mailing list