diff options
author | John Kessenich <johnkslang@users.noreply.github.com> | 2023-06-22 08:06:20 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 08:06:20 -0600 |
commit | 3469b164e25cee24435029a569933cb42578db5d (patch) | |
tree | 084f30e99f96b27e53d76ddd45f6344a65be80ac | |
parent | 10db9d4e194246a020a4148e220837ac7c68cfd9 (diff) | |
parent | 6b5af05fbf85eea8250a9233761a60584e2e9dcf (diff) | |
download | SPIRV-Headers-3469b164e25cee24435029a569933cb42578db5d.tar.gz SPIRV-Headers-3469b164e25cee24435029a569933cb42578db5d.tar.bz2 SPIRV-Headers-3469b164e25cee24435029a569933cb42578db5d.zip |
Merge pull request #355 from kpet/spv-khr-cooperative-matrix
Add definitions for SPV_KHR_cooperative_matrix
-rw-r--r-- | include/spirv/unified1/spirv.bf | 38 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.core.grammar.json | 161 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.cs | 38 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.h | 42 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.hpp | 46 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.hpp11 | 46 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.json | 37 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.lua | 34 | ||||
-rw-r--r-- | include/spirv/unified1/spirv.py | 34 | ||||
-rw-r--r-- | include/spirv/unified1/spv.d | 38 | ||||
-rw-r--r-- | tools/buildHeaders/jsonToSpirv.cpp | 15 | ||||
-rw-r--r-- | tools/buildHeaders/jsonToSpirv.h | 3 |
12 files changed, 532 insertions, 0 deletions
diff --git a/include/spirv/unified1/spirv.bf b/include/spirv/unified1/spirv.bf index 25dddd1..495d185 100644 --- a/include/spirv/unified1/spirv.bf +++ b/include/spirv/unified1/spirv.bf @@ -1160,6 +1160,7 @@ namespace Spv DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1281,6 +1282,38 @@ namespace Spv PackedVectorFormat4x8BitKHR = 0, } + [AllowDuplicates, CRepr] public enum CooperativeMatrixOperandsShift + { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + } + + [AllowDuplicates, CRepr] public enum CooperativeMatrixOperandsMask + { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, + } + + [AllowDuplicates, CRepr] public enum CooperativeMatrixLayout + { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + } + + [AllowDuplicates, CRepr] public enum CooperativeMatrixUse + { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + } + [AllowDuplicates, CRepr] public enum Op { OpNop = 0, @@ -1655,6 +1688,11 @@ namespace Spv OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.core.grammar.json b/include/spirv/unified1/spirv.core.grammar.json index 2695213..3ca1276 100644 --- a/include/spirv/unified1/spirv.core.grammar.json +++ b/include/spirv/unified1/spirv.core.grammar.json @@ -4494,6 +4494,77 @@ "version" : "1.6" }, { + "opname" : "OpTypeCooperativeMatrixKHR", + "class" : "Type-Declaration", + "opcode" : 4456, + "operands" : [ + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Component Type'" }, + { "kind" : "IdScope", "name" : "'Scope'" }, + { "kind" : "IdRef", "name" : "'Rows'" }, + { "kind" : "IdRef", "name" : "'Columns'" }, + { "kind" : "IdRef", "name" : "'Use'" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixLoadKHR", + "class" : "Memory", + "opcode" : 4457, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'MemoryLayout'" }, + { "kind" : "IdRef", "name" : "'Stride'", "quantifier": "?" }, + { "kind" : "MemoryAccess", "name" : "'Memory Operand'", "quantifier" : "?" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixStoreKHR", + "class" : "Memory", + "opcode" : 4458, + "operands" : [ + { "kind" : "IdRef", "name" : "'Pointer'" }, + { "kind" : "IdRef", "name" : "'Object'" }, + { "kind" : "IdRef", "name" : "'MemoryLayout'" }, + { "kind" : "IdRef", "name" : "'Stride'", "quantifier": "?" }, + { "kind" : "MemoryAccess", "name" : "'Memory Operand'", "quantifier" : "?" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixMulAddKHR", + "class" : "Arithmetic", + "opcode" : 4459, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'A'" }, + { "kind" : "IdRef", "name" : "'B'" }, + { "kind" : "IdRef", "name" : "'C'" }, + { "kind" : "CooperativeMatrixOperands", "name" : "'Cooperative Matrix Operands'", "quantifier" : "?" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "opname" : "OpCooperativeMatrixLengthKHR", + "class" : "Miscellaneous", + "opcode" : 4460, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Type'" } + ], + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { "opname" : "OpTypeRayQueryKHR", "class" : "Reserved", "opcode" : 4472, @@ -15119,6 +15190,12 @@ "version" : "None" }, { + "enumerant" : "CooperativeMatrixKHR", + "value" : 6022, + "extensions" : [ "SPV_KHR_cooperative_matrix" ], + "version" : "None" + }, + { "enumerant" : "BitInstructions", "value" : 6025, "extensions" : [ "SPV_KHR_bit_instructions" ], @@ -15284,6 +15361,90 @@ ] }, { + "category" : "BitEnum", + "kind" : "CooperativeMatrixOperands", + "enumerants" : [ + { + "enumerant" : "None", + "value" : "0x0000", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixASignedComponents", + "value" : "0x0001", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixBSignedComponents", + "value" : "0x0002", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixCSignedComponents", + "value" : "0x0004", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixResultSignedComponents", + "value" : "0x0008", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "SaturatingAccumulation", + "value" : "0x0010", + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "CooperativeMatrixLayout", + "enumerants" : [ + { + "enumerant" : "RowMajorKHR", + "value" : 0, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "ColumnMajorKHR", + "value" : 1, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + } + ] + }, + { + "category" : "ValueEnum", + "kind" : "CooperativeMatrixUse", + "enumerants" : [ + { + "enumerant" : "MatrixAKHR", + "value" : 0, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixBKHR", + "value" : 1, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + }, + { + "enumerant" : "MatrixAccumulatorKHR", + "value" : 2, + "capabilities" : [ "CooperativeMatrixKHR" ], + "version" : "None" + } + ] + }, + { "category" : "Id", "kind" : "IdResultType", "doc" : "Reference to an <id> representing the result's type of the enclosing instruction" diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs index 2e97182..1e6f0fc 100644 --- a/include/spirv/unified1/spirv.cs +++ b/include/spirv/unified1/spirv.cs @@ -1159,6 +1159,7 @@ namespace Spv DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1280,6 +1281,38 @@ namespace Spv PackedVectorFormat4x8BitKHR = 0, } + public enum CooperativeMatrixOperandsShift + { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + } + + public enum CooperativeMatrixOperandsMask + { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, + } + + public enum CooperativeMatrixLayout + { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + } + + public enum CooperativeMatrixUse + { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + } + public enum Op { OpNop = 0, @@ -1654,6 +1687,11 @@ namespace Spv OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index 6304add..50eb986 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -1159,6 +1159,7 @@ typedef enum SpvCapability_ { SpvCapabilityDotProduct = 6019, SpvCapabilityDotProductKHR = 6019, SpvCapabilityRayCullMaskKHR = 6020, + SpvCapabilityCooperativeMatrixKHR = 6022, SpvCapabilityBitInstructions = 6025, SpvCapabilityGroupNonUniformRotateKHR = 6026, SpvCapabilityAtomicFloat32AddEXT = 6033, @@ -1279,6 +1280,37 @@ typedef enum SpvPackedVectorFormat_ { SpvPackedVectorFormatMax = 0x7fffffff, } SpvPackedVectorFormat; +typedef enum SpvCooperativeMatrixOperandsShift_ { + SpvCooperativeMatrixOperandsMatrixASignedComponentsShift = 0, + SpvCooperativeMatrixOperandsMatrixBSignedComponentsShift = 1, + SpvCooperativeMatrixOperandsMatrixCSignedComponentsShift = 2, + SpvCooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3, + SpvCooperativeMatrixOperandsSaturatingAccumulationShift = 4, + SpvCooperativeMatrixOperandsMax = 0x7fffffff, +} SpvCooperativeMatrixOperandsShift; + +typedef enum SpvCooperativeMatrixOperandsMask_ { + SpvCooperativeMatrixOperandsMaskNone = 0, + SpvCooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001, + SpvCooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002, + SpvCooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004, + SpvCooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008, + SpvCooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010, +} SpvCooperativeMatrixOperandsMask; + +typedef enum SpvCooperativeMatrixLayout_ { + SpvCooperativeMatrixLayoutRowMajorKHR = 0, + SpvCooperativeMatrixLayoutColumnMajorKHR = 1, + SpvCooperativeMatrixLayoutMax = 0x7fffffff, +} SpvCooperativeMatrixLayout; + +typedef enum SpvCooperativeMatrixUse_ { + SpvCooperativeMatrixUseMatrixAKHR = 0, + SpvCooperativeMatrixUseMatrixBKHR = 1, + SpvCooperativeMatrixUseMatrixAccumulatorKHR = 2, + SpvCooperativeMatrixUseMax = 0x7fffffff, +} SpvCooperativeMatrixUse; + typedef enum SpvOp_ { SpvOpNop = 0, SpvOpUndef = 1, @@ -1652,6 +1684,11 @@ typedef enum SpvOp_ { SpvOpUDotAccSatKHR = 4454, SpvOpSUDotAccSat = 4455, SpvOpSUDotAccSatKHR = 4455, + SpvOpTypeCooperativeMatrixKHR = 4456, + SpvOpCooperativeMatrixLoadKHR = 4457, + SpvOpCooperativeMatrixStoreKHR = 4458, + SpvOpCooperativeMatrixMulAddKHR = 4459, + SpvOpCooperativeMatrixLengthKHR = 4460, SpvOpTypeRayQueryKHR = 4472, SpvOpRayQueryInitializeKHR = 4473, SpvOpRayQueryTerminateKHR = 4474, @@ -2370,6 +2407,11 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break; case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break; case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case SpvOpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index b4bba0c..072373a 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -1155,6 +1155,7 @@ enum Capability { CapabilityDotProduct = 6019, CapabilityDotProductKHR = 6019, CapabilityRayCullMaskKHR = 6020, + CapabilityCooperativeMatrixKHR = 6022, CapabilityBitInstructions = 6025, CapabilityGroupNonUniformRotateKHR = 6026, CapabilityAtomicFloat32AddEXT = 6033, @@ -1275,6 +1276,37 @@ enum PackedVectorFormat { PackedVectorFormatMax = 0x7fffffff, }; +enum CooperativeMatrixOperandsShift { + CooperativeMatrixOperandsMatrixASignedComponentsShift = 0, + CooperativeMatrixOperandsMatrixBSignedComponentsShift = 1, + CooperativeMatrixOperandsMatrixCSignedComponentsShift = 2, + CooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3, + CooperativeMatrixOperandsSaturatingAccumulationShift = 4, + CooperativeMatrixOperandsMax = 0x7fffffff, +}; + +enum CooperativeMatrixOperandsMask { + CooperativeMatrixOperandsMaskNone = 0, + CooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001, + CooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002, + CooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004, + CooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008, + CooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010, +}; + +enum CooperativeMatrixLayout { + CooperativeMatrixLayoutRowMajorKHR = 0, + CooperativeMatrixLayoutColumnMajorKHR = 1, + CooperativeMatrixLayoutMax = 0x7fffffff, +}; + +enum CooperativeMatrixUse { + CooperativeMatrixUseMatrixAKHR = 0, + CooperativeMatrixUseMatrixBKHR = 1, + CooperativeMatrixUseMatrixAccumulatorKHR = 2, + CooperativeMatrixUseMax = 0x7fffffff, +}; + enum Op { OpNop = 0, OpUndef = 1, @@ -1648,6 +1680,11 @@ enum Op { OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -2366,6 +2403,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpSDotAccSat: *hasResult = true; *hasResultType = true; break; case OpUDotAccSat: *hasResult = true; *hasResultType = true; break; case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; @@ -2748,6 +2790,10 @@ inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShad inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } } // end namespace spv diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index 445636b..9788e8b 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -1155,6 +1155,7 @@ enum class Capability : unsigned { DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1275,6 +1276,37 @@ enum class PackedVectorFormat : unsigned { Max = 0x7fffffff, }; +enum class CooperativeMatrixOperandsShift : unsigned { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixOperandsMask : unsigned { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, +}; + +enum class CooperativeMatrixLayout : unsigned { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + Max = 0x7fffffff, +}; + +enum class CooperativeMatrixUse : unsigned { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + Max = 0x7fffffff, +}; + enum class Op : unsigned { OpNop = 0, OpUndef = 1, @@ -1648,6 +1680,11 @@ enum class Op : unsigned { OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -2366,6 +2403,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break; case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break; case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break; + case Op::OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break; case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; @@ -2748,6 +2790,10 @@ constexpr FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentS constexpr FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); } constexpr FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); } constexpr FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); } +constexpr CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); } } // end namespace spv diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json index 90d2268..b449ef0 100644 --- a/include/spirv/unified1/spirv.json +++ b/include/spirv/unified1/spirv.json @@ -1135,6 +1135,7 @@ "DotProduct": 6019, "DotProductKHR": 6019, "RayCullMaskKHR": 6020, + "CooperativeMatrixKHR": 6022, "BitInstructions": 6025, "GroupNonUniformRotateKHR": 6026, "AtomicFloat32AddEXT": 6033, @@ -1262,6 +1263,37 @@ } }, { + "Name": "CooperativeMatrixOperands", + "Type": "Bit", + "Values": + { + "MatrixASignedComponents": 0, + "MatrixBSignedComponents": 1, + "MatrixCSignedComponents": 2, + "MatrixResultSignedComponents": 3, + "SaturatingAccumulation": 4 + } + }, + { + "Name": "CooperativeMatrixLayout", + "Type": "Value", + "Values": + { + "RowMajorKHR": 0, + "ColumnMajorKHR": 1 + } + }, + { + "Name": "CooperativeMatrixUse", + "Type": "Value", + "Values": + { + "MatrixAKHR": 0, + "MatrixBKHR": 1, + "MatrixAccumulatorKHR": 2 + } + }, + { "Name": "Op", "Type": "Value", "Values": @@ -1638,6 +1670,11 @@ "OpUDotAccSatKHR": 4454, "OpSUDotAccSat": 4455, "OpSUDotAccSatKHR": 4455, + "OpTypeCooperativeMatrixKHR": 4456, + "OpCooperativeMatrixLoadKHR": 4457, + "OpCooperativeMatrixStoreKHR": 4458, + "OpCooperativeMatrixMulAddKHR": 4459, + "OpCooperativeMatrixLengthKHR": 4460, "OpTypeRayQueryKHR": 4472, "OpRayQueryInitializeKHR": 4473, "OpRayQueryTerminateKHR": 4474, diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua index 9026d6e..858fc5d 100644 --- a/include/spirv/unified1/spirv.lua +++ b/include/spirv/unified1/spirv.lua @@ -1117,6 +1117,7 @@ spv = { DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1226,6 +1227,34 @@ spv = { PackedVectorFormat4x8BitKHR = 0, }, + CooperativeMatrixOperandsShift = { + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, + }, + + CooperativeMatrixOperandsMask = { + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, + }, + + CooperativeMatrixLayout = { + RowMajorKHR = 0, + ColumnMajorKHR = 1, + }, + + CooperativeMatrixUse = { + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, + }, + Op = { OpNop = 0, OpUndef = 1, @@ -1599,6 +1628,11 @@ spv = { OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py index da72145..e4550d1 100644 --- a/include/spirv/unified1/spirv.py +++ b/include/spirv/unified1/spirv.py @@ -1117,6 +1117,7 @@ spv = { 'DotProduct' : 6019, 'DotProductKHR' : 6019, 'RayCullMaskKHR' : 6020, + 'CooperativeMatrixKHR' : 6022, 'BitInstructions' : 6025, 'GroupNonUniformRotateKHR' : 6026, 'AtomicFloat32AddEXT' : 6033, @@ -1226,6 +1227,34 @@ spv = { 'PackedVectorFormat4x8BitKHR' : 0, }, + 'CooperativeMatrixOperandsShift' : { + 'MatrixASignedComponents' : 0, + 'MatrixBSignedComponents' : 1, + 'MatrixCSignedComponents' : 2, + 'MatrixResultSignedComponents' : 3, + 'SaturatingAccumulation' : 4, + }, + + 'CooperativeMatrixOperandsMask' : { + 'MaskNone' : 0, + 'MatrixASignedComponents' : 0x00000001, + 'MatrixBSignedComponents' : 0x00000002, + 'MatrixCSignedComponents' : 0x00000004, + 'MatrixResultSignedComponents' : 0x00000008, + 'SaturatingAccumulation' : 0x00000010, + }, + + 'CooperativeMatrixLayout' : { + 'RowMajorKHR' : 0, + 'ColumnMajorKHR' : 1, + }, + + 'CooperativeMatrixUse' : { + 'MatrixAKHR' : 0, + 'MatrixBKHR' : 1, + 'MatrixAccumulatorKHR' : 2, + }, + 'Op' : { 'OpNop' : 0, 'OpUndef' : 1, @@ -1599,6 +1628,11 @@ spv = { 'OpUDotAccSatKHR' : 4454, 'OpSUDotAccSat' : 4455, 'OpSUDotAccSatKHR' : 4455, + 'OpTypeCooperativeMatrixKHR' : 4456, + 'OpCooperativeMatrixLoadKHR' : 4457, + 'OpCooperativeMatrixStoreKHR' : 4458, + 'OpCooperativeMatrixMulAddKHR' : 4459, + 'OpCooperativeMatrixLengthKHR' : 4460, 'OpTypeRayQueryKHR' : 4472, 'OpRayQueryInitializeKHR' : 4473, 'OpRayQueryTerminateKHR' : 4474, diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d index dc3b92b..fac4d46 100644 --- a/include/spirv/unified1/spv.d +++ b/include/spirv/unified1/spv.d @@ -1162,6 +1162,7 @@ enum Capability : uint DotProduct = 6019, DotProductKHR = 6019, RayCullMaskKHR = 6020, + CooperativeMatrixKHR = 6022, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, AtomicFloat32AddEXT = 6033, @@ -1283,6 +1284,38 @@ enum PackedVectorFormat : uint PackedVectorFormat4x8BitKHR = 0, } +enum CooperativeMatrixOperandsShift : uint +{ + MatrixASignedComponents = 0, + MatrixBSignedComponents = 1, + MatrixCSignedComponents = 2, + MatrixResultSignedComponents = 3, + SaturatingAccumulation = 4, +} + +enum CooperativeMatrixOperandsMask : uint +{ + MaskNone = 0, + MatrixASignedComponents = 0x00000001, + MatrixBSignedComponents = 0x00000002, + MatrixCSignedComponents = 0x00000004, + MatrixResultSignedComponents = 0x00000008, + SaturatingAccumulation = 0x00000010, +} + +enum CooperativeMatrixLayout : uint +{ + RowMajorKHR = 0, + ColumnMajorKHR = 1, +} + +enum CooperativeMatrixUse : uint +{ + MatrixAKHR = 0, + MatrixBKHR = 1, + MatrixAccumulatorKHR = 2, +} + enum Op : uint { OpNop = 0, @@ -1657,6 +1690,11 @@ enum Op : uint OpUDotAccSatKHR = 4454, OpSUDotAccSat = 4455, OpSUDotAccSatKHR = 4455, + OpTypeCooperativeMatrixKHR = 4456, + OpCooperativeMatrixLoadKHR = 4457, + OpCooperativeMatrixStoreKHR = 4458, + OpCooperativeMatrixMulAddKHR = 4459, + OpCooperativeMatrixLengthKHR = 4460, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/tools/buildHeaders/jsonToSpirv.cpp b/tools/buildHeaders/jsonToSpirv.cpp index 67b5bce..1f2cb77 100644 --- a/tools/buildHeaders/jsonToSpirv.cpp +++ b/tools/buildHeaders/jsonToSpirv.cpp @@ -88,6 +88,9 @@ EnumValues RayQueryCommittedIntersectionTypeParams; EnumValues RayQueryCandidateIntersectionTypeParams; EnumValues FragmentShadingRateParams; EnumValues PackedVectorFormatParams; +EnumValues CooperativeMatrixOperandsParams; +EnumValues CooperativeMatrixLayoutParams; +EnumValues CooperativeMatrixUseParams; std::pair<bool, std::string> ReadFile(const std::string& path) { @@ -234,6 +237,12 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co type = OperandFragmentShadingRate; } else if (operandKind == "PackedVectorFormat") { type = OperandPackedVectorFormat; + } else if (operandKind == "CooperativeMatrixOperands") { + type = OperandCooperativeMatrixOperands; + } else if (operandKind == "CooperativeMatrixLayout") { + type = OperandCooperativeMatrixLayout; + } else if (operandKind == "CooperativeMatrixUse") { + type = OperandCooperativeMatrixUse; } if (type == OperandNone) { @@ -544,6 +553,12 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) establishOperandClass(enumName, OperandFragmentShadingRate, &FragmentShadingRateParams, operandEnum, category); } else if (enumName == "PackedVectorFormat") { establishOperandClass(enumName, OperandPackedVectorFormat, &PackedVectorFormatParams, operandEnum, category); + } else if (enumName == "CooperativeMatrixOperands") { + establishOperandClass(enumName, OperandCooperativeMatrixOperands, &CooperativeMatrixOperandsParams, operandEnum, category); + } else if (enumName == "CooperativeMatrixLayout") { + establishOperandClass(enumName, OperandCooperativeMatrixLayout, &CooperativeMatrixLayoutParams, operandEnum, category); + } else if (enumName == "CooperativeMatrixUse") { + establishOperandClass(enumName, OperandCooperativeMatrixUse, &CooperativeMatrixUseParams, operandEnum, category); } } } diff --git a/tools/buildHeaders/jsonToSpirv.h b/tools/buildHeaders/jsonToSpirv.h index 3be6456..a5db3a2 100644 --- a/tools/buildHeaders/jsonToSpirv.h +++ b/tools/buildHeaders/jsonToSpirv.h @@ -96,6 +96,9 @@ enum OperandClass { OperandQuantizationModes, OperandOverflowModes, OperandPackedVectorFormat, + OperandCooperativeMatrixOperands, + OperandCooperativeMatrixLayout, + OperandCooperativeMatrixUse, OperandOpcode, |