summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-10-16 13:34:11 +0000
committerDuncan Sands <baldrick@free.fr>2007-10-16 13:34:11 +0000
commitce042d0bc09251630d33292a45ebbd03e6ab6d1e (patch)
treeb9138a3ea4d1ff8c76136ed78b2ad085a3f6f574 /llvm
parentbbbfbe95f72329c526085506b7289c76a5ddc068 (diff)
downloadbcm5719-llvm-ce042d0bc09251630d33292a45ebbd03e6ab6d1e.tar.gz
bcm5719-llvm-ce042d0bc09251630d33292a45ebbd03e6ab6d1e.zip
Document the fact that the verifier currently requires the
top bit of a ValueType to be zero. Enforce this by ensuring an assertion failure if someone tries to create a ValueType without this property. I chose this minimal approach rather than a more official integration of the notion of reserved bits into ValueType because I'm hoping that the verifier will be changed to no longer require this :) llvm-svn: 43031
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/ValueTypes.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h
index 05f10e8b04e..780482b0793 100644
--- a/llvm/include/llvm/CodeGen/ValueTypes.h
+++ b/llvm/include/llvm/CodeGen/ValueTypes.h
@@ -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;
@@ -313,7 +315,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 &&
OpenPOWER on IntegriCloud