Force vectors to be a power of two in size

llvm-svn: 24265
This commit is contained in:
Chris Lattner 2005-11-10 01:42:43 +00:00
parent 6a14d020a3
commit 8a169a30ae
2 changed files with 170 additions and 170 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1107,12 +1107,12 @@ UpRTypes : '\\' EUINT64VAL { // Type UpReference
}
| '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type?
const llvm::Type* ElemTy = $4->get();
if ((unsigned)$2 != $2) {
if ((unsigned)$2 != $2)
ThrowException("Unsigned result not equal to signed result");
}
if(!ElemTy->isPrimitiveType()) {
if (!ElemTy->isPrimitiveType())
ThrowException("Elemental type of a PackedType must be primitive");
}
if (!isPowerOf2_32($2))
ThrowException("Vector length should be a power of 2!");
$$ = new PATypeHolder(HandleUpRefs(PackedType::get(*$4, (unsigned)$2)));
delete $4;
}