From 18545d4bc29fead574456d86dc21b8998842c0e6 Mon Sep 17 00:00:00 2001 From: "Maksimova, Viktoria" Date: Thu, 8 Feb 2024 04:26:08 -0800 Subject: [PATCH 1/3] Headers support for SPV_INTEL_maximum_registers extension --- include/spirv/unified1/spirv.bf | 4 +++ .../spirv/unified1/spirv.core.grammar.json | 33 +++++++++++++++++++ include/spirv/unified1/spirv.cs | 4 +++ include/spirv/unified1/spirv.h | 4 +++ include/spirv/unified1/spirv.hpp | 4 +++ include/spirv/unified1/spirv.hpp11 | 4 +++ include/spirv/unified1/spirv.json | 8 +++-- include/spirv/unified1/spirv.lua | 4 +++ include/spirv/unified1/spirv.py | 4 +++ include/spirv/unified1/spv.d | 4 +++ 10 files changed, 71 insertions(+), 2 deletions(-) diff --git a/include/spirv/unified1/spirv.bf b/include/spirv/unified1/spirv.bf index 4231b3340..837726b2f 100644 --- a/include/spirv/unified1/spirv.bf +++ b/include/spirv/unified1/spirv.bf @@ -212,6 +212,9 @@ namespace Spv StreamingInterfaceINTEL = 6154, RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, } [AllowDuplicates, CRepr] public enum StorageClass @@ -1227,6 +1230,7 @@ namespace Spv GroupUniformArithmeticKHR = 6400, MaskedGatherScatterINTEL = 6427, CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, } [AllowDuplicates, CRepr] public enum RayFlagsShift diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json index 1d595c1ad..9577fb05f 100644 --- a/include/spirv/unified1/spirv.core.grammar.json +++ b/include/spirv/unified1/spirv.core.grammar.json @@ -11596,6 +11596,33 @@ ], "capabilities" : [ "VectorComputeINTEL" ], "version" : "None" + }, + { + "enumerant" : "MaximumRegistersINTEL", + "value" : 6461, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Number of Registers'" } + ], + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "MaximumRegistersIdINTEL", + "value" : 6462, + "parameters" : [ + { "kind" : "IdRef", "name" : "'Number of Registers'" } + ], + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" + }, + { + "enumerant" : "NamedMaximumRegistersINTEL", + "value" : 6463, + "parameters" : [ + { "kind" : "LiteralInteger", "name" : "'Named Maximum Number of Registers'" } + ], + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" } ] }, @@ -16454,6 +16481,12 @@ "value" : 6441, "extensions" : [ "SPV_INTEL_cache_controls" ], "version" : "None" + }, + { + "enumerant" : "RegisterLimitsINTEL", + "value" : 6460, + "extensions" : [ "SPV_INTEL_maximum_registers" ], + "version" : "None" } ] }, diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs index 41bbbf121..c674acf75 100644 --- a/include/spirv/unified1/spirv.cs +++ b/include/spirv/unified1/spirv.cs @@ -211,6 +211,9 @@ public enum ExecutionMode StreamingInterfaceINTEL = 6154, RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, } public enum StorageClass @@ -1226,6 +1229,7 @@ public enum Capability GroupUniformArithmeticKHR = 6400, MaskedGatherScatterINTEL = 6427, CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, } public enum RayFlagsShift diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index a68b7a176..60ced73ba 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -219,6 +219,9 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeStreamingInterfaceINTEL = 6154, SpvExecutionModeRegisterMapInterfaceINTEL = 6160, SpvExecutionModeNamedBarrierCountINTEL = 6417, + SpvExecutionModeMaximumRegistersINTEL = 6461, + SpvExecutionModeMaximumRegistersIdINTEL = 6462, + SpvExecutionModeNamedMaximumRegistersINTEL = 6463, SpvExecutionModeMax = 0x7fffffff, } SpvExecutionMode; @@ -1226,6 +1229,7 @@ typedef enum SpvCapability_ { SpvCapabilityGroupUniformArithmeticKHR = 6400, SpvCapabilityMaskedGatherScatterINTEL = 6427, SpvCapabilityCacheControlsINTEL = 6441, + SpvCapabilityRegisterLimitsINTEL = 6460, SpvCapabilityMax = 0x7fffffff, } SpvCapability; diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index b9c874337..b78a7f8ac 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -215,6 +215,9 @@ enum ExecutionMode { ExecutionModeStreamingInterfaceINTEL = 6154, ExecutionModeRegisterMapInterfaceINTEL = 6160, ExecutionModeNamedBarrierCountINTEL = 6417, + ExecutionModeMaximumRegistersINTEL = 6461, + ExecutionModeMaximumRegistersIdINTEL = 6462, + ExecutionModeNamedMaximumRegistersINTEL = 6463, ExecutionModeMax = 0x7fffffff, }; @@ -1222,6 +1225,7 @@ enum Capability { CapabilityGroupUniformArithmeticKHR = 6400, CapabilityMaskedGatherScatterINTEL = 6427, CapabilityCacheControlsINTEL = 6441, + CapabilityRegisterLimitsINTEL = 6460, CapabilityMax = 0x7fffffff, }; diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index e32ff7a4f..5b93c2bab 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -215,6 +215,9 @@ enum class ExecutionMode : unsigned { StreamingInterfaceINTEL = 6154, RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, Max = 0x7fffffff, }; @@ -1222,6 +1225,7 @@ enum class Capability : unsigned { GroupUniformArithmeticKHR = 6400, MaskedGatherScatterINTEL = 6427, CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, Max = 0x7fffffff, }; diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json index ee03b6ccd..15aa742ac 100644 --- a/include/spirv/unified1/spirv.json +++ b/include/spirv/unified1/spirv.json @@ -233,7 +233,10 @@ "FPFastMathDefault": 6028, "StreamingInterfaceINTEL": 6154, "RegisterMapInterfaceINTEL": 6160, - "NamedBarrierCountINTEL": 6417 + "NamedBarrierCountINTEL": 6417, + "MaximumRegistersINTEL": 6461, + "MaximumRegistersIdINTEL": 6462, + "NamedMaximumRegistersINTEL": 6463 } }, { @@ -1198,7 +1201,8 @@ "GlobalVariableFPGADecorationsINTEL": 6189, "GroupUniformArithmeticKHR": 6400, "MaskedGatherScatterINTEL": 6427, - "CacheControlsINTEL": 6441 + "CacheControlsINTEL": 6441, + "RegisterLimitsINTEL": 6460 } }, { diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua index 391939d80..2c2bd740c 100644 --- a/include/spirv/unified1/spirv.lua +++ b/include/spirv/unified1/spirv.lua @@ -202,6 +202,9 @@ spv = { StreamingInterfaceINTEL = 6154, RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, }, StorageClass = { @@ -1184,6 +1187,7 @@ spv = { GroupUniformArithmeticKHR = 6400, MaskedGatherScatterINTEL = 6427, CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, }, RayFlagsShift = { diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py index 3ab1f07c6..d81e52da6 100644 --- a/include/spirv/unified1/spirv.py +++ b/include/spirv/unified1/spirv.py @@ -202,6 +202,9 @@ 'StreamingInterfaceINTEL' : 6154, 'RegisterMapInterfaceINTEL' : 6160, 'NamedBarrierCountINTEL' : 6417, + 'MaximumRegistersINTEL' : 6461, + 'MaximumRegistersIdINTEL' : 6462, + 'NamedMaximumRegistersINTEL' : 6463, }, 'StorageClass' : { @@ -1184,6 +1187,7 @@ 'GroupUniformArithmeticKHR' : 6400, 'MaskedGatherScatterINTEL' : 6427, 'CacheControlsINTEL' : 6441, + 'RegisterLimitsINTEL' : 6460, }, 'RayFlagsShift' : { diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d index 7df78ccf6..18a5b8e3c 100644 --- a/include/spirv/unified1/spv.d +++ b/include/spirv/unified1/spv.d @@ -214,6 +214,9 @@ enum ExecutionMode : uint StreamingInterfaceINTEL = 6154, RegisterMapInterfaceINTEL = 6160, NamedBarrierCountINTEL = 6417, + MaximumRegistersINTEL = 6461, + MaximumRegistersIdINTEL = 6462, + NamedMaximumRegistersINTEL = 6463, } enum StorageClass : uint @@ -1229,6 +1232,7 @@ enum Capability : uint GroupUniformArithmeticKHR = 6400, MaskedGatherScatterINTEL = 6427, CacheControlsINTEL = 6441, + RegisterLimitsINTEL = 6460, } enum RayFlagsShift : uint From f4802b4cbf3443e394179105370023b3bd483a0e Mon Sep 17 00:00:00 2001 From: "Maksimova, Viktoria" Date: Wed, 14 Feb 2024 04:51:38 -0800 Subject: [PATCH 2/3] Use an operand kind for the named maximum number of registers --- include/spirv/unified1/spirv.bf | 5 +++++ include/spirv/unified1/spirv.core.grammar.json | 14 +++++++++++++- include/spirv/unified1/spirv.cs | 5 +++++ include/spirv/unified1/spirv.h | 4 ++++ include/spirv/unified1/spirv.hpp | 4 ++++ include/spirv/unified1/spirv.hpp11 | 4 ++++ include/spirv/unified1/spirv.json | 8 ++++++++ include/spirv/unified1/spirv.lua | 4 ++++ include/spirv/unified1/spirv.py | 4 ++++ include/spirv/unified1/spv.d | 5 +++++ tools/buildHeaders/jsonToSpirv.cpp | 5 +++++ tools/buildHeaders/jsonToSpirv.h | 1 + 12 files changed, 62 insertions(+), 1 deletion(-) diff --git a/include/spirv/unified1/spirv.bf b/include/spirv/unified1/spirv.bf index 837726b2f..0382de7e4 100644 --- a/include/spirv/unified1/spirv.bf +++ b/include/spirv/unified1/spirv.bf @@ -1401,6 +1401,11 @@ namespace Spv StreamingINTEL = 3, } + [AllowDuplicates, CRepr] public enum NamedMaximumNumberOfRegisters + { + AutoINTEL = 0, + } + [AllowDuplicates, CRepr] public enum Op { OpNop = 0, diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json index 9577fb05f..40a0947bb 100644 --- a/include/spirv/unified1/spirv.core.grammar.json +++ b/include/spirv/unified1/spirv.core.grammar.json @@ -11619,7 +11619,7 @@ "enumerant" : "NamedMaximumRegistersINTEL", "value" : 6463, "parameters" : [ - { "kind" : "LiteralInteger", "name" : "'Named Maximum Number of Registers'" } + { "kind" : "NamedMaximumNumberOfRegisters", "name" : "'Named Maximum Number of Registers'" } ], "capabilities" : [ "RegisterLimitsINTEL" ], "version" : "None" @@ -16724,6 +16724,18 @@ } ] }, + { + "category" : "ValueEnum", + "kind" : "NamedMaximumNumberOfRegisters", + "enumerants" : [ + { + "enumerant" : "AutoINTEL", + "value" : 0, + "capabilities" : [ "RegisterLimitsINTEL" ], + "version" : "None" + } + ] + }, { "category" : "Id", "kind" : "IdResultType", diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs index c674acf75..92dcc2bdc 100644 --- a/include/spirv/unified1/spirv.cs +++ b/include/spirv/unified1/spirv.cs @@ -1400,6 +1400,11 @@ public enum StoreCacheControl StreamingINTEL = 3, } + public enum NamedMaximumNumberOfRegisters + { + AutoINTEL = 0, + } + public enum Op { OpNop = 0, diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index 60ced73ba..cfda3a7aa 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -1398,6 +1398,10 @@ typedef enum SpvStoreCacheControl_ { SpvStoreCacheControlMax = 0x7fffffff, } SpvStoreCacheControl; +typedef enum SpvNamedMaximumNumberOfRegisters_ { + SpvAutoINTEL = 0, +} SpvNamedMaximumNumberOfRegisters; + typedef enum SpvOp_ { SpvOpNop = 0, SpvOpUndef = 1, diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index b78a7f8ac..0d324203b 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -1394,6 +1394,10 @@ enum StoreCacheControl { StoreCacheControlMax = 0x7fffffff, }; +enum NamedMaximumNumberOfRegisters { + AutoINTEL = 0, +}; + enum Op { OpNop = 0, OpUndef = 1, diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index 5b93c2bab..e65bb7931 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -1394,6 +1394,10 @@ enum class StoreCacheControl : unsigned { Max = 0x7fffffff, }; +enum class NamedMaximumNumberOfRegisters : unsigned { + AutoINTEL = 0, +}; + enum class Op : unsigned { OpNop = 0, OpUndef = 1, diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json index 15aa742ac..78017540f 100644 --- a/include/spirv/unified1/spirv.json +++ b/include/spirv/unified1/spirv.json @@ -1389,6 +1389,14 @@ "StreamingINTEL": 3 } }, + { + "Name": "NamedMaximumNumberOfRegisters", + "Type": "Value", + "Values": + { + "AutoINTEL": 0 + } + }, { "Name": "Op", "Type": "Value", diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua index 2c2bd740c..75fc3c2e7 100644 --- a/include/spirv/unified1/spirv.lua +++ b/include/spirv/unified1/spirv.lua @@ -1338,6 +1338,10 @@ spv = { StreamingINTEL = 3, }, + NamedMaximumNumberOfRegisters = { + AutoINTEL = 0, + }, + Op = { OpNop = 0, OpUndef = 1, diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py index d81e52da6..5af2aa2e3 100644 --- a/include/spirv/unified1/spirv.py +++ b/include/spirv/unified1/spirv.py @@ -1338,6 +1338,10 @@ 'StreamingINTEL' : 3, }, + 'NamedMaximumNumberOfRegisters' : { + 'AutoINTEL' : 0, + }, + 'Op' : { 'OpNop' : 0, 'OpUndef' : 1, diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d index 18a5b8e3c..4860e8334 100644 --- a/include/spirv/unified1/spv.d +++ b/include/spirv/unified1/spv.d @@ -1403,6 +1403,11 @@ enum StoreCacheControl : uint StreamingINTEL = 3, } +enum NamedMaximumNumberOfRegisters : uint +{ + AutoINTEL = 0, +} + enum Op : uint { OpNop = 0, diff --git a/tools/buildHeaders/jsonToSpirv.cpp b/tools/buildHeaders/jsonToSpirv.cpp index 6eed13c13..6d140ba76 100644 --- a/tools/buildHeaders/jsonToSpirv.cpp +++ b/tools/buildHeaders/jsonToSpirv.cpp @@ -272,6 +272,7 @@ EnumValues InitializationModeQualifierParams; EnumValues HostAccessQualifierParams; EnumValues LoadCacheControlParams; EnumValues StoreCacheControlParams; +EnumValues NamedMaximumNumberOfRegistersParams; std::pair ReadFile(const std::string& path) { @@ -434,6 +435,8 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co type = OperandLoadCacheControl; } else if (operandKind == "StoreCacheControl") { type = OperandStoreCacheControl; + } else if (operandKind == "NamedMaximumNumberOfRegisters") { + type = OperandNamedMaximumNumberOfRegisters; } if (type == OperandNone) { @@ -777,6 +780,8 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) establishOperandClass(enumName, OperandLoadCacheControl, &LoadCacheControlParams, operandEnum, category); } else if (enumName == "StoreCacheControl") { establishOperandClass(enumName, OperandStoreCacheControl, &StoreCacheControlParams, operandEnum, category); + } else if (enumName == "NamedMaximumNumberOfRegisters") { + establishOperandClass(enumName, OperandNamedMaximumNumberOfRegisters, &NamedMaximumNumberOfRegistersParams, operandEnum, category); } } diff --git a/tools/buildHeaders/jsonToSpirv.h b/tools/buildHeaders/jsonToSpirv.h index 4afbeb76f..24f75c948 100644 --- a/tools/buildHeaders/jsonToSpirv.h +++ b/tools/buildHeaders/jsonToSpirv.h @@ -103,6 +103,7 @@ enum OperandClass { OperandHostAccessQualifier, OperandLoadCacheControl, OperandStoreCacheControl, + OperandNamedMaximumNumberOfRegisters, OperandOpcode, From 0000d081f7f67323671a698c67a202b1cec66b17 Mon Sep 17 00:00:00 2001 From: "Maksimova, Viktoria" Date: Wed, 14 Feb 2024 04:55:32 -0800 Subject: [PATCH 3/3] apply CI suggestions --- include/spirv/unified1/spirv.h | 3 ++- include/spirv/unified1/spirv.hpp | 3 ++- include/spirv/unified1/spirv.hpp11 | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index cfda3a7aa..e602be19d 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -1399,7 +1399,8 @@ typedef enum SpvStoreCacheControl_ { } SpvStoreCacheControl; typedef enum SpvNamedMaximumNumberOfRegisters_ { - SpvAutoINTEL = 0, + SpvNamedMaximumNumberOfRegistersAutoINTEL = 0, + SpvNamedMaximumNumberOfRegistersMax = 0x7fffffff, } SpvNamedMaximumNumberOfRegisters; typedef enum SpvOp_ { diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index 0d324203b..6a42147a3 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -1395,7 +1395,8 @@ enum StoreCacheControl { }; enum NamedMaximumNumberOfRegisters { - AutoINTEL = 0, + NamedMaximumNumberOfRegistersAutoINTEL = 0, + NamedMaximumNumberOfRegistersMax = 0x7fffffff, }; enum Op { diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index e65bb7931..7f1e38bb5 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -1396,6 +1396,7 @@ enum class StoreCacheControl : unsigned { enum class NamedMaximumNumberOfRegisters : unsigned { AutoINTEL = 0, + Max = 0x7fffffff, }; enum class Op : unsigned {