From ea77f2a826bc820cb8f57f9b2a7c7eccb681c731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Petit?= Date: Wed, 29 May 2024 16:54:35 +0100 Subject: [PATCH] SPV_EXT_replicated_composites (#431) * SPV_EXT_replicated_composites Signed-off-by: Kevin Petit * Move Composite instructions to "Composite" class * Fix instruction classes --------- Signed-off-by: Kevin Petit --- include/spirv/unified1/spirv.bf | 4 ++ .../spirv/unified1/spirv.core.grammar.json | 42 +++++++++++++++++++ include/spirv/unified1/spirv.cs | 4 ++ include/spirv/unified1/spirv.h | 11 +++++ include/spirv/unified1/spirv.hpp | 11 +++++ include/spirv/unified1/spirv.hpp11 | 11 +++++ include/spirv/unified1/spirv.json | 4 ++ include/spirv/unified1/spirv.lua | 4 ++ include/spirv/unified1/spirv.py | 4 ++ include/spirv/unified1/spv.d | 4 ++ 10 files changed, 99 insertions(+) diff --git a/include/spirv/unified1/spirv.bf b/include/spirv/unified1/spirv.bf index 92b95c876..dd7ea24e9 100644 --- a/include/spirv/unified1/spirv.bf +++ b/include/spirv/unified1/spirv.bf @@ -1213,6 +1213,7 @@ namespace Spv DotProductKHR = 6019, RayCullMaskKHR = 6020, CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, FloatControls2 = 6029, @@ -1802,6 +1803,9 @@ namespace Spv OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, 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 5d904cae1..8a45a1fd2 100644 --- a/include/spirv/unified1/spirv.core.grammar.json +++ b/include/spirv/unified1/spirv.core.grammar.json @@ -4854,6 +4854,42 @@ "capabilities" : [ "CooperativeMatrixKHR" ], "version" : "None" }, + { + "opname" : "OpConstantCompositeReplicateEXT", + "class" : "Constant-Creation", + "opcode" : 4461, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "ReplicatedCompositesEXT" ], + "version" : "None" + }, + { + "opname" : "OpSpecConstantCompositeReplicateEXT", + "class" : "Constant-Creation", + "opcode" : 4462, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "ReplicatedCompositesEXT" ], + "version" : "None" + }, + { + "opname" : "OpCompositeConstructReplicateEXT", + "class" : "Composite", + "opcode" : 4463, + "operands" : [ + { "kind" : "IdResultType" }, + { "kind" : "IdResult" }, + { "kind" : "IdRef", "name" : "'Value'" } + ], + "capabilities" : [ "ReplicatedCompositesEXT" ], + "version" : "None" + }, { "opname" : "OpTypeRayQueryKHR", "class" : "Type-Declaration", @@ -16442,6 +16478,12 @@ "extensions" : [ "SPV_KHR_cooperative_matrix" ], "version" : "None" }, + { + "enumerant" : "ReplicatedCompositesEXT", + "value" : 6024, + "extensions" : [ "SPV_EXT_replicated_composites" ], + "version" : "None" + }, { "enumerant" : "BitInstructions", "value" : 6025, diff --git a/include/spirv/unified1/spirv.cs b/include/spirv/unified1/spirv.cs index 8d85cced6..bab4eb260 100644 --- a/include/spirv/unified1/spirv.cs +++ b/include/spirv/unified1/spirv.cs @@ -1212,6 +1212,7 @@ public enum Capability DotProductKHR = 6019, RayCullMaskKHR = 6020, CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, FloatControls2 = 6029, @@ -1801,6 +1802,9 @@ public enum Op OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.h b/include/spirv/unified1/spirv.h index 13d308281..d7a92b9b8 100644 --- a/include/spirv/unified1/spirv.h +++ b/include/spirv/unified1/spirv.h @@ -1212,6 +1212,7 @@ typedef enum SpvCapability_ { SpvCapabilityDotProductKHR = 6019, SpvCapabilityRayCullMaskKHR = 6020, SpvCapabilityCooperativeMatrixKHR = 6022, + SpvCapabilityReplicatedCompositesEXT = 6024, SpvCapabilityBitInstructions = 6025, SpvCapabilityGroupNonUniformRotateKHR = 6026, SpvCapabilityFloatControls2 = 6029, @@ -1797,6 +1798,9 @@ typedef enum SpvOp_ { SpvOpCooperativeMatrixStoreKHR = 4458, SpvOpCooperativeMatrixMulAddKHR = 4459, SpvOpCooperativeMatrixLengthKHR = 4460, + SpvOpConstantCompositeReplicateEXT = 4461, + SpvOpSpecConstantCompositeReplicateEXT = 4462, + SpvOpCompositeConstructReplicateEXT = 4463, SpvOpTypeRayQueryKHR = 4472, SpvOpRayQueryInitializeKHR = 4473, SpvOpRayQueryTerminateKHR = 4474, @@ -2535,6 +2539,9 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy case SpvOpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; case SpvOpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; case SpvOpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeConstructReplicateEXT: *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; @@ -3772,6 +3779,7 @@ inline const char* SpvCapabilityToString(SpvCapability value) { case SpvCapabilityDotProduct: return "DotProduct"; case SpvCapabilityRayCullMaskKHR: return "RayCullMaskKHR"; case SpvCapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case SpvCapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; case SpvCapabilityBitInstructions: return "BitInstructions"; case SpvCapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; case SpvCapabilityFloatControls2: return "FloatControls2"; @@ -4306,6 +4314,9 @@ inline const char* SpvOpToString(SpvOp value) { case SpvOpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; case SpvOpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; case SpvOpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case SpvOpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case SpvOpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case SpvOpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; case SpvOpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; case SpvOpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; case SpvOpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; diff --git a/include/spirv/unified1/spirv.hpp b/include/spirv/unified1/spirv.hpp index 21b865689..03e3d802b 100644 --- a/include/spirv/unified1/spirv.hpp +++ b/include/spirv/unified1/spirv.hpp @@ -1208,6 +1208,7 @@ enum Capability { CapabilityDotProductKHR = 6019, CapabilityRayCullMaskKHR = 6020, CapabilityCooperativeMatrixKHR = 6022, + CapabilityReplicatedCompositesEXT = 6024, CapabilityBitInstructions = 6025, CapabilityGroupNonUniformRotateKHR = 6026, CapabilityFloatControls2 = 6029, @@ -1793,6 +1794,9 @@ enum Op { OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -2531,6 +2535,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break; case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break; case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break; + case OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case OpCompositeConstructReplicateEXT: *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; @@ -3768,6 +3775,7 @@ inline const char* CapabilityToString(Capability value) { case CapabilityDotProduct: return "DotProduct"; case CapabilityRayCullMaskKHR: return "RayCullMaskKHR"; case CapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case CapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; case CapabilityBitInstructions: return "BitInstructions"; case CapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; case CapabilityFloatControls2: return "FloatControls2"; @@ -4302,6 +4310,9 @@ inline const char* OpToString(Op value) { case OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; case OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; case OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; diff --git a/include/spirv/unified1/spirv.hpp11 b/include/spirv/unified1/spirv.hpp11 index bcdff9d52..7b6f5948a 100644 --- a/include/spirv/unified1/spirv.hpp11 +++ b/include/spirv/unified1/spirv.hpp11 @@ -1208,6 +1208,7 @@ enum class Capability : unsigned { DotProductKHR = 6019, RayCullMaskKHR = 6020, CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, FloatControls2 = 6029, @@ -1793,6 +1794,9 @@ enum class Op : unsigned { OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, @@ -2531,6 +2535,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { 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::OpConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantCompositeReplicateEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructReplicateEXT: *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; @@ -3768,6 +3775,7 @@ inline const char* CapabilityToString(Capability value) { case CapabilityDotProduct: return "DotProduct"; case CapabilityRayCullMaskKHR: return "RayCullMaskKHR"; case CapabilityCooperativeMatrixKHR: return "CooperativeMatrixKHR"; + case CapabilityReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; case CapabilityBitInstructions: return "BitInstructions"; case CapabilityGroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; case CapabilityFloatControls2: return "FloatControls2"; @@ -4302,6 +4310,9 @@ inline const char* OpToString(Op value) { case OpCooperativeMatrixStoreKHR: return "OpCooperativeMatrixStoreKHR"; case OpCooperativeMatrixMulAddKHR: return "OpCooperativeMatrixMulAddKHR"; case OpCooperativeMatrixLengthKHR: return "OpCooperativeMatrixLengthKHR"; + case OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; + case OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; + case OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR"; case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; diff --git a/include/spirv/unified1/spirv.json b/include/spirv/unified1/spirv.json index 204a9c569..a99f1cacc 100644 --- a/include/spirv/unified1/spirv.json +++ b/include/spirv/unified1/spirv.json @@ -1185,6 +1185,7 @@ "DotProductKHR": 6019, "RayCullMaskKHR": 6020, "CooperativeMatrixKHR": 6022, + "ReplicatedCompositesEXT": 6024, "BitInstructions": 6025, "GroupNonUniformRotateKHR": 6026, "FloatControls2": 6029, @@ -1792,6 +1793,9 @@ "OpCooperativeMatrixStoreKHR": 4458, "OpCooperativeMatrixMulAddKHR": 4459, "OpCooperativeMatrixLengthKHR": 4460, + "OpConstantCompositeReplicateEXT": 4461, + "OpSpecConstantCompositeReplicateEXT": 4462, + "OpCompositeConstructReplicateEXT": 4463, "OpTypeRayQueryKHR": 4472, "OpRayQueryInitializeKHR": 4473, "OpRayQueryTerminateKHR": 4474, diff --git a/include/spirv/unified1/spirv.lua b/include/spirv/unified1/spirv.lua index 6dcd1b8eb..4df95b0d2 100644 --- a/include/spirv/unified1/spirv.lua +++ b/include/spirv/unified1/spirv.lua @@ -1170,6 +1170,7 @@ spv = { DotProductKHR = 6019, RayCullMaskKHR = 6020, CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, FloatControls2 = 6029, @@ -1735,6 +1736,9 @@ spv = { OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474, diff --git a/include/spirv/unified1/spirv.py b/include/spirv/unified1/spirv.py index 4b011cfe1..8c0e90683 100644 --- a/include/spirv/unified1/spirv.py +++ b/include/spirv/unified1/spirv.py @@ -1170,6 +1170,7 @@ 'DotProductKHR' : 6019, 'RayCullMaskKHR' : 6020, 'CooperativeMatrixKHR' : 6022, + 'ReplicatedCompositesEXT' : 6024, 'BitInstructions' : 6025, 'GroupNonUniformRotateKHR' : 6026, 'FloatControls2' : 6029, @@ -1735,6 +1736,9 @@ 'OpCooperativeMatrixStoreKHR' : 4458, 'OpCooperativeMatrixMulAddKHR' : 4459, 'OpCooperativeMatrixLengthKHR' : 4460, + 'OpConstantCompositeReplicateEXT' : 4461, + 'OpSpecConstantCompositeReplicateEXT' : 4462, + 'OpCompositeConstructReplicateEXT' : 4463, 'OpTypeRayQueryKHR' : 4472, 'OpRayQueryInitializeKHR' : 4473, 'OpRayQueryTerminateKHR' : 4474, diff --git a/include/spirv/unified1/spv.d b/include/spirv/unified1/spv.d index 64c115e02..01f565574 100644 --- a/include/spirv/unified1/spv.d +++ b/include/spirv/unified1/spv.d @@ -1215,6 +1215,7 @@ enum Capability : uint DotProductKHR = 6019, RayCullMaskKHR = 6020, CooperativeMatrixKHR = 6022, + ReplicatedCompositesEXT = 6024, BitInstructions = 6025, GroupNonUniformRotateKHR = 6026, FloatControls2 = 6029, @@ -1804,6 +1805,9 @@ enum Op : uint OpCooperativeMatrixStoreKHR = 4458, OpCooperativeMatrixMulAddKHR = 4459, OpCooperativeMatrixLengthKHR = 4460, + OpConstantCompositeReplicateEXT = 4461, + OpSpecConstantCompositeReplicateEXT = 4462, + OpCompositeConstructReplicateEXT = 4463, OpTypeRayQueryKHR = 4472, OpRayQueryInitializeKHR = 4473, OpRayQueryTerminateKHR = 4474,