SPV capabilities: Add int16, int64, float16, and float64.
This commit is contained in:
@@ -165,6 +165,18 @@ Id Builder::makeIntegerType(int width, bool hasSign)
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
|
||||
// deal with capabilities
|
||||
switch (width) {
|
||||
case 16:
|
||||
addCapability(CapabilityInt16);
|
||||
break;
|
||||
case 64:
|
||||
addCapability(CapabilityInt64);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
@@ -185,6 +197,18 @@ Id Builder::makeFloatType(int width)
|
||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||
module.mapInstruction(type);
|
||||
|
||||
// deal with capabilities
|
||||
switch (width) {
|
||||
case 16:
|
||||
addCapability(CapabilityFloat16);
|
||||
break;
|
||||
case 64:
|
||||
addCapability(CapabilityFloat64);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return type->getResultId();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user