Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers support for SPV_INTEL_maximum_registers extension #416

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/spirv/unified1/spirv.bf
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ namespace Spv
StreamingInterfaceINTEL = 6154,
RegisterMapInterfaceINTEL = 6160,
NamedBarrierCountINTEL = 6417,
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
}

[AllowDuplicates, CRepr] public enum StorageClass
Expand Down Expand Up @@ -1227,6 +1230,7 @@ namespace Spv
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
}

[AllowDuplicates, CRepr] public enum RayFlagsShift
Expand Down Expand Up @@ -1397,6 +1401,11 @@ namespace Spv
StreamingINTEL = 3,
}

[AllowDuplicates, CRepr] public enum NamedMaximumNumberOfRegisters
{
AutoINTEL = 0,
}

[AllowDuplicates, CRepr] public enum Op
{
OpNop = 0,
Expand Down
45 changes: 45 additions & 0 deletions include/spirv/unified1/spirv.core.grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "NamedMaximumNumberOfRegisters", "name" : "'Named Maximum Number of Registers'" }
],
"capabilities" : [ "RegisterLimitsINTEL" ],
"version" : "None"
}
]
},
Expand Down Expand Up @@ -16454,6 +16481,12 @@
"value" : 6441,
"extensions" : [ "SPV_INTEL_cache_controls" ],
"version" : "None"
},
{
"enumerant" : "RegisterLimitsINTEL",
"value" : 6460,
"extensions" : [ "SPV_INTEL_maximum_registers" ],
"version" : "None"
}
]
},
Expand Down Expand Up @@ -16691,6 +16724,18 @@
}
]
},
{
"category" : "ValueEnum",
"kind" : "NamedMaximumNumberOfRegisters",
"enumerants" : [
{
"enumerant" : "AutoINTEL",
"value" : 0,
"capabilities" : [ "RegisterLimitsINTEL" ],
"version" : "None"
}
]
},
{
"category" : "Id",
"kind" : "IdResultType",
Expand Down
9 changes: 9 additions & 0 deletions include/spirv/unified1/spirv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ public enum ExecutionMode
StreamingInterfaceINTEL = 6154,
RegisterMapInterfaceINTEL = 6160,
NamedBarrierCountINTEL = 6417,
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
}

public enum StorageClass
Expand Down Expand Up @@ -1226,6 +1229,7 @@ public enum Capability
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
}

public enum RayFlagsShift
Expand Down Expand Up @@ -1396,6 +1400,11 @@ public enum StoreCacheControl
StreamingINTEL = 3,
}

public enum NamedMaximumNumberOfRegisters
{
AutoINTEL = 0,
}

public enum Op
{
OpNop = 0,
Expand Down
9 changes: 9 additions & 0 deletions include/spirv/unified1/spirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeStreamingInterfaceINTEL = 6154,
SpvExecutionModeRegisterMapInterfaceINTEL = 6160,
SpvExecutionModeNamedBarrierCountINTEL = 6417,
SpvExecutionModeMaximumRegistersINTEL = 6461,
SpvExecutionModeMaximumRegistersIdINTEL = 6462,
SpvExecutionModeNamedMaximumRegistersINTEL = 6463,
SpvExecutionModeMax = 0x7fffffff,
} SpvExecutionMode;

Expand Down Expand Up @@ -1226,6 +1229,7 @@ typedef enum SpvCapability_ {
SpvCapabilityGroupUniformArithmeticKHR = 6400,
SpvCapabilityMaskedGatherScatterINTEL = 6427,
SpvCapabilityCacheControlsINTEL = 6441,
SpvCapabilityRegisterLimitsINTEL = 6460,
SpvCapabilityMax = 0x7fffffff,
} SpvCapability;

Expand Down Expand Up @@ -1394,6 +1398,11 @@ typedef enum SpvStoreCacheControl_ {
SpvStoreCacheControlMax = 0x7fffffff,
} SpvStoreCacheControl;

typedef enum SpvNamedMaximumNumberOfRegisters_ {
SpvNamedMaximumNumberOfRegistersAutoINTEL = 0,
SpvNamedMaximumNumberOfRegistersMax = 0x7fffffff,
} SpvNamedMaximumNumberOfRegisters;

typedef enum SpvOp_ {
SpvOpNop = 0,
SpvOpUndef = 1,
Expand Down
9 changes: 9 additions & 0 deletions include/spirv/unified1/spirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ enum ExecutionMode {
ExecutionModeStreamingInterfaceINTEL = 6154,
ExecutionModeRegisterMapInterfaceINTEL = 6160,
ExecutionModeNamedBarrierCountINTEL = 6417,
ExecutionModeMaximumRegistersINTEL = 6461,
ExecutionModeMaximumRegistersIdINTEL = 6462,
ExecutionModeNamedMaximumRegistersINTEL = 6463,
ExecutionModeMax = 0x7fffffff,
};

Expand Down Expand Up @@ -1222,6 +1225,7 @@ enum Capability {
CapabilityGroupUniformArithmeticKHR = 6400,
CapabilityMaskedGatherScatterINTEL = 6427,
CapabilityCacheControlsINTEL = 6441,
CapabilityRegisterLimitsINTEL = 6460,
CapabilityMax = 0x7fffffff,
};

Expand Down Expand Up @@ -1390,6 +1394,11 @@ enum StoreCacheControl {
StoreCacheControlMax = 0x7fffffff,
};

enum NamedMaximumNumberOfRegisters {
NamedMaximumNumberOfRegistersAutoINTEL = 0,
NamedMaximumNumberOfRegistersMax = 0x7fffffff,
};

enum Op {
OpNop = 0,
OpUndef = 1,
Expand Down
9 changes: 9 additions & 0 deletions include/spirv/unified1/spirv.hpp11
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ enum class ExecutionMode : unsigned {
StreamingInterfaceINTEL = 6154,
RegisterMapInterfaceINTEL = 6160,
NamedBarrierCountINTEL = 6417,
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
Max = 0x7fffffff,
};

Expand Down Expand Up @@ -1222,6 +1225,7 @@ enum class Capability : unsigned {
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
Max = 0x7fffffff,
};

Expand Down Expand Up @@ -1390,6 +1394,11 @@ enum class StoreCacheControl : unsigned {
Max = 0x7fffffff,
};

enum class NamedMaximumNumberOfRegisters : unsigned {
AutoINTEL = 0,
Max = 0x7fffffff,
};

enum class Op : unsigned {
OpNop = 0,
OpUndef = 1,
Expand Down
16 changes: 14 additions & 2 deletions include/spirv/unified1/spirv.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@
"FPFastMathDefault": 6028,
"StreamingInterfaceINTEL": 6154,
"RegisterMapInterfaceINTEL": 6160,
"NamedBarrierCountINTEL": 6417
"NamedBarrierCountINTEL": 6417,
"MaximumRegistersINTEL": 6461,
"MaximumRegistersIdINTEL": 6462,
"NamedMaximumRegistersINTEL": 6463
}
},
{
Expand Down Expand Up @@ -1198,7 +1201,8 @@
"GlobalVariableFPGADecorationsINTEL": 6189,
"GroupUniformArithmeticKHR": 6400,
"MaskedGatherScatterINTEL": 6427,
"CacheControlsINTEL": 6441
"CacheControlsINTEL": 6441,
"RegisterLimitsINTEL": 6460
}
},
{
Expand Down Expand Up @@ -1385,6 +1389,14 @@
"StreamingINTEL": 3
}
},
{
"Name": "NamedMaximumNumberOfRegisters",
"Type": "Value",
"Values":
{
"AutoINTEL": 0
}
},
{
"Name": "Op",
"Type": "Value",
Expand Down
8 changes: 8 additions & 0 deletions include/spirv/unified1/spirv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ spv = {
StreamingInterfaceINTEL = 6154,
RegisterMapInterfaceINTEL = 6160,
NamedBarrierCountINTEL = 6417,
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
},

StorageClass = {
Expand Down Expand Up @@ -1184,6 +1187,7 @@ spv = {
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
},

RayFlagsShift = {
Expand Down Expand Up @@ -1334,6 +1338,10 @@ spv = {
StreamingINTEL = 3,
},

NamedMaximumNumberOfRegisters = {
AutoINTEL = 0,
},

Op = {
OpNop = 0,
OpUndef = 1,
Expand Down
8 changes: 8 additions & 0 deletions include/spirv/unified1/spirv.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@
'StreamingInterfaceINTEL' : 6154,
'RegisterMapInterfaceINTEL' : 6160,
'NamedBarrierCountINTEL' : 6417,
'MaximumRegistersINTEL' : 6461,
'MaximumRegistersIdINTEL' : 6462,
'NamedMaximumRegistersINTEL' : 6463,
},

'StorageClass' : {
Expand Down Expand Up @@ -1184,6 +1187,7 @@
'GroupUniformArithmeticKHR' : 6400,
'MaskedGatherScatterINTEL' : 6427,
'CacheControlsINTEL' : 6441,
'RegisterLimitsINTEL' : 6460,
},

'RayFlagsShift' : {
Expand Down Expand Up @@ -1334,6 +1338,10 @@
'StreamingINTEL' : 3,
},

'NamedMaximumNumberOfRegisters' : {
'AutoINTEL' : 0,
},

'Op' : {
'OpNop' : 0,
'OpUndef' : 1,
Expand Down
9 changes: 9 additions & 0 deletions include/spirv/unified1/spv.d
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ enum ExecutionMode : uint
StreamingInterfaceINTEL = 6154,
RegisterMapInterfaceINTEL = 6160,
NamedBarrierCountINTEL = 6417,
MaximumRegistersINTEL = 6461,
MaximumRegistersIdINTEL = 6462,
NamedMaximumRegistersINTEL = 6463,
}

enum StorageClass : uint
Expand Down Expand Up @@ -1229,6 +1232,7 @@ enum Capability : uint
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
RegisterLimitsINTEL = 6460,
}

enum RayFlagsShift : uint
Expand Down Expand Up @@ -1399,6 +1403,11 @@ enum StoreCacheControl : uint
StreamingINTEL = 3,
}

enum NamedMaximumNumberOfRegisters : uint
{
AutoINTEL = 0,
}

enum Op : uint
{
OpNop = 0,
Expand Down
5 changes: 5 additions & 0 deletions tools/buildHeaders/jsonToSpirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ EnumValues InitializationModeQualifierParams;
EnumValues HostAccessQualifierParams;
EnumValues LoadCacheControlParams;
EnumValues StoreCacheControlParams;
EnumValues NamedMaximumNumberOfRegistersParams;

std::pair<bool, std::string> ReadFile(const std::string& path)
{
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions tools/buildHeaders/jsonToSpirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ enum OperandClass {
OperandHostAccessQualifier,
OperandLoadCacheControl,
OperandStoreCacheControl,
OperandNamedMaximumNumberOfRegisters,

OperandOpcode,

Expand Down