move MachineFrameInfo::CreateFixedObject out of line, give MachineFrameInfo
[oota-llvm.git] / include / llvm / CodeGen / ValueTypes.h
index 05f10e8b04e21e6cd8f3582de18b4db40df3b0cb..f2b8dfcccaddaccd0c23a9c5b233b3a8e9ebda0b 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -107,7 +107,9 @@ namespace MVT {  // MVT = Machine Value Types
   ///
   /// 31--------------16-----------8-------------0
   ///  | Vector length | Precision | Simple type |
-  ///                  |      Vector element     |
+  ///  |               |      Vector element     |
+  ///
+  /// Note that the verifier currently requires the top bit to be zero.
 
   typedef uint32_t ValueType;
 
@@ -241,6 +243,13 @@ namespace MVT {  // MVT = Machine Value Types
     }
   }
 
+  /// MVT::getStoreSizeInBits - Return the number of bits overwritten by a
+  /// store of the specified value type.
+  ///
+  static inline unsigned getStoreSizeInBits(ValueType VT) {
+    return (getSizeInBits(VT) + 7)/8*8;
+  }
+
   /// MVT::getIntegerType - Returns the ValueType that represents an integer
   /// with the given number of bits.
   ///
@@ -313,7 +322,8 @@ namespace MVT {  // MVT = Machine Value Types
       if (NumElements == 2)  return MVT::v2f64;
       break;
     }
-    ValueType Result = VT | ((NumElements + 1) << (32 - VectorBits));
+    // Set the length with the top bit forced to zero (needed by the verifier).
+    ValueType Result = VT | (((NumElements + 1) << (33 - VectorBits)) >> 1);
     assert(getVectorElementType(Result) == VT &&
            "Bad vector element type!");
     assert(getVectorNumElements(Result) == NumElements &&