return bit;
}
-void jsonToSpirv(const std::string& jsonPath)
+bool ExcludeInstruction(unsigned op, bool buildingHeaders)
+{
+ // Some instructions in the grammar don't need to be reflected
+ // in the specification.
+
+ if (buildingHeaders)
+ return false;
+
+ if (op >= 5699 /* OpVmeImageINTEL */ && op <= 5816 /* OpSubgroupAvcSicGetInterRawSadsINTEL */)
+ return true;
+
+ return false;
+}
+
+void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
{
// only do this once.
static bool initialized = false;
const Json::Value insts = root["instructions"];
for (const auto& inst : insts) {
const unsigned int opcode = inst["opcode"].asUInt();
+ if (ExcludeInstruction(opcode, buildingHeaders))
+ continue;
const std::string name = inst["opname"].asString();
EnumCaps caps = getCaps(inst);
std::string version = inst["version"].asString();
std::pair<bool, std::string> ReadFile(const std::string& path);
// Fill in all the parameters
-void jsonToSpirv(const std::string& jsonPath);
+void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders);
// For parameterizing operands.
enum OperandClass {
return 1;
}
- spv::jsonToSpirv(jsonPath);
+ spv::jsonToSpirv(jsonPath, (Options & EOptionPrintHeader) != 0);
if (Options & EOptionPrintHeader)
spv::PrintHeader(Language, std::cout);