Add support for mask vectors of 8 and 16-bit element types.

There were a number of places throughout the system that assumed that the
execution mask would only have either 32-bit or 1-bit elements.  This
commit makes it possible to have a target with an 8- or 16-bit mask.
This commit is contained in:
Matt Pharr
2013-07-23 16:38:10 -07:00
parent 83e1630fbc
commit e7abf3f2ea
8 changed files with 284 additions and 133 deletions

View File

@@ -2148,8 +2148,24 @@ lAddFunctionParams(Declarator *decl) {
/** Add a symbol for the built-in mask variable to the symbol table */
static void lAddMaskToSymbolTable(SourcePos pos) {
const Type *t = g->target->getMaskBitCount() == 1 ?
AtomicType::VaryingBool : AtomicType::VaryingUInt32;
const Type *t;
switch (g->target->getMaskBitCount()) {
case 1:
t = AtomicType::VaryingBool;
break;
case 8:
t = AtomicType::VaryingUInt8;
break;
case 16:
t = AtomicType::VaryingUInt16;
break;
case 32:
t = AtomicType::VaryingUInt32;
break;
default:
FATAL("Unhandled mask bitsize in lAddMaskToSymbolTable");
}
t = t->GetAsConstType();
Symbol *maskSymbol = new Symbol("__mask", pos, t);
m->symbolTable->AddVariable(maskSymbol);