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:
20
parse.yy
20
parse.yy
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user