Skip to content

Commit a4a03f6

Browse files
committed
Implement SPV_KHR_uniform_group_instructions extension
Spec: KhronosGroup/SPIRV-Registry#138
1 parent 6a55fad commit a4a03f6

File tree

9 files changed

+224
-2
lines changed

9 files changed

+224
-2
lines changed

include/spirv/unified1/spirv.core.grammar.json

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8549,6 +8549,126 @@
85498549
],
85508550
"capabilities" : [ "LongConstantCompositeINTEL" ],
85518551
"version" : "None"
8552+
},
8553+
{
8554+
"opname" : "OpGroupIMulKHR",
8555+
"class" : "Group",
8556+
"opcode" : 6401,
8557+
"operands" : [
8558+
{ "kind" : "IdResultType" },
8559+
{ "kind" : "IdResult" },
8560+
{ "kind" : "IdScope", "name" : "'Execution'" },
8561+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8562+
{ "kind" : "IdRef", "name" : "'X'" }
8563+
],
8564+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8565+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8566+
"version" : "None"
8567+
},
8568+
{
8569+
"opname" : "OpGroupFMulKHR",
8570+
"class" : "Group",
8571+
"opcode" : 6402,
8572+
"operands" : [
8573+
{ "kind" : "IdResultType" },
8574+
{ "kind" : "IdResult" },
8575+
{ "kind" : "IdScope", "name" : "'Execution'" },
8576+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8577+
{ "kind" : "IdRef", "name" : "'X'" }
8578+
],
8579+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8580+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8581+
"version" : "None"
8582+
},
8583+
{
8584+
"opname" : "OpGroupBitwiseAndKHR",
8585+
"class" : "Group",
8586+
"opcode" : 6403,
8587+
"operands" : [
8588+
{ "kind" : "IdResultType" },
8589+
{ "kind" : "IdResult" },
8590+
{ "kind" : "IdScope", "name" : "'Execution'" },
8591+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8592+
{ "kind" : "IdRef", "name" : "'X'" }
8593+
],
8594+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8595+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8596+
"version" : "None"
8597+
},
8598+
{
8599+
"opname" : "OpGroupBitwiseOrKHR",
8600+
"class" : "Group",
8601+
"opcode" : 6404,
8602+
"operands" : [
8603+
{ "kind" : "IdResultType" },
8604+
{ "kind" : "IdResult" },
8605+
{ "kind" : "IdScope", "name" : "'Execution'" },
8606+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8607+
{ "kind" : "IdRef", "name" : "'X'" }
8608+
],
8609+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8610+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8611+
"version" : "None"
8612+
},
8613+
{
8614+
"opname" : "OpGroupBitwiseXorKHR",
8615+
"class" : "Group",
8616+
"opcode" : 6405,
8617+
"operands" : [
8618+
{ "kind" : "IdResultType" },
8619+
{ "kind" : "IdResult" },
8620+
{ "kind" : "IdScope", "name" : "'Execution'" },
8621+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8622+
{ "kind" : "IdRef", "name" : "'X'" }
8623+
],
8624+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8625+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8626+
"version" : "None"
8627+
},
8628+
{
8629+
"opname" : "OpGroupLogicalAndKHR",
8630+
"class" : "Group",
8631+
"opcode" : 6406,
8632+
"operands" : [
8633+
{ "kind" : "IdResultType" },
8634+
{ "kind" : "IdResult" },
8635+
{ "kind" : "IdScope", "name" : "'Execution'" },
8636+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8637+
{ "kind" : "IdRef", "name" : "'X'" }
8638+
],
8639+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8640+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8641+
"version" : "None"
8642+
},
8643+
{
8644+
"opname" : "OpGroupLogicalOrKHR",
8645+
"class" : "Group",
8646+
"opcode" : 6407,
8647+
"operands" : [
8648+
{ "kind" : "IdResultType" },
8649+
{ "kind" : "IdResult" },
8650+
{ "kind" : "IdScope", "name" : "'Execution'" },
8651+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8652+
{ "kind" : "IdRef", "name" : "'X'" }
8653+
],
8654+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8655+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8656+
"version" : "None"
8657+
},
8658+
{
8659+
"opname" : "OpGroupLogicalXorKHR",
8660+
"class" : "Group",
8661+
"opcode" : 6408,
8662+
"operands" : [
8663+
{ "kind" : "IdResultType" },
8664+
{ "kind" : "IdResult" },
8665+
{ "kind" : "IdScope", "name" : "'Execution'" },
8666+
{ "kind" : "GroupOperation", "name" : "'Operation'" },
8667+
{ "kind" : "IdRef", "name" : "'X'" }
8668+
],
8669+
"capabilities" : [ "GroupUniformArithmeticKHR" ],
8670+
"extensions" : [ "SPV_KHR_uniform_group_instructions" ],
8671+
"version" : "None"
85528672
}
85538673
],
85548674
"operand_kinds" : [
@@ -13881,6 +14001,12 @@
1388114001
"value" : 6114,
1388214002
"extensions" : [ "SPV_INTEL_debug_module" ],
1388314003
"version" : "None"
14004+
},
14005+
{
14006+
"enumerant" : "GroupUniformArithmeticKHR",
14007+
"value" : 6400,
14008+
"extensions" : [ "SPV_KHR_uniform_group_instructions"],
14009+
"version" : "None"
1388414010
}
1388514011
]
1388614012
},

include/spirv/unified1/spirv.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,7 @@ public enum Capability
10871087
OptNoneINTEL = 6094,
10881088
AtomicFloat16AddEXT = 6095,
10891089
DebugInfoModuleINTEL = 6114,
1090+
GroupUniformArithmeticKHR = 6400,
10901091
}
10911092

10921093
public enum RayFlagsShift
@@ -1851,6 +1852,14 @@ public enum Op
18511852
OpTypeStructContinuedINTEL = 6090,
18521853
OpConstantCompositeContinuedINTEL = 6091,
18531854
OpSpecConstantCompositeContinuedINTEL = 6092,
1855+
OpGroupIMulKHR = 6401,
1856+
OpGroupFMulKHR = 6402,
1857+
OpGroupBitwiseAndKHR = 6403,
1858+
OpGroupBitwiseOrKHR = 6404,
1859+
OpGroupBitwiseXorKHR = 6405,
1860+
OpGroupLogicalAndKHR = 6406,
1861+
OpGroupLogicalOrKHR = 6407,
1862+
OpGroupLogicalXorKHR = 6408,
18541863
}
18551864
}
18561865
}

include/spirv/unified1/spirv.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,7 @@ typedef enum SpvCapability_ {
10871087
SpvCapabilityOptNoneINTEL = 6094,
10881088
SpvCapabilityAtomicFloat16AddEXT = 6095,
10891089
SpvCapabilityDebugInfoModuleINTEL = 6114,
1090+
SpvCapabilityGroupUniformArithmeticKHR = 6400,
10901091
SpvCapabilityMax = 0x7fffffff,
10911092
} SpvCapability;
10921093

@@ -1849,6 +1850,14 @@ typedef enum SpvOp_ {
18491850
SpvOpTypeStructContinuedINTEL = 6090,
18501851
SpvOpConstantCompositeContinuedINTEL = 6091,
18511852
SpvOpSpecConstantCompositeContinuedINTEL = 6092,
1853+
SpvOpGroupIMulKHR = 6401,
1854+
SpvOpGroupFMulKHR = 6402,
1855+
SpvOpGroupBitwiseAndKHR = 6403,
1856+
SpvOpGroupBitwiseOrKHR = 6404,
1857+
SpvOpGroupBitwiseXorKHR = 6405,
1858+
SpvOpGroupLogicalAndKHR = 6406,
1859+
SpvOpGroupLogicalOrKHR = 6407,
1860+
SpvOpGroupLogicalXorKHR = 6408,
18521861
SpvOpMax = 0x7fffffff,
18531862
} SpvOp;
18541863

@@ -2503,6 +2512,14 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
25032512
case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
25042513
case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
25052514
case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
2515+
case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
2516+
case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
2517+
case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
2518+
case SpvOpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
2519+
case SpvOpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
2520+
case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
2521+
case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
2522+
case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
25062523
}
25072524
}
25082525
#endif /* SPV_ENABLE_UTILITY_CODE */

include/spirv/unified1/spirv.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ enum Capability {
10831083
CapabilityOptNoneINTEL = 6094,
10841084
CapabilityAtomicFloat16AddEXT = 6095,
10851085
CapabilityDebugInfoModuleINTEL = 6114,
1086+
CapabilityGroupUniformArithmeticKHR = 6400,
10861087
CapabilityMax = 0x7fffffff,
10871088
};
10881089

@@ -1845,6 +1846,14 @@ enum Op {
18451846
OpTypeStructContinuedINTEL = 6090,
18461847
OpConstantCompositeContinuedINTEL = 6091,
18471848
OpSpecConstantCompositeContinuedINTEL = 6092,
1849+
OpGroupIMulKHR = 6401,
1850+
OpGroupFMulKHR = 6402,
1851+
OpGroupBitwiseAndKHR = 6403,
1852+
OpGroupBitwiseOrKHR = 6404,
1853+
OpGroupBitwiseXorKHR = 6405,
1854+
OpGroupLogicalAndKHR = 6406,
1855+
OpGroupLogicalOrKHR = 6407,
1856+
OpGroupLogicalXorKHR = 6408,
18481857
OpMax = 0x7fffffff,
18491858
};
18501859

@@ -2499,6 +2508,14 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
24992508
case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
25002509
case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
25012510
case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
2511+
case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
2512+
case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
2513+
case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
2514+
case OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
2515+
case OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
2516+
case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
2517+
case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
2518+
case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
25022519
}
25032520
}
25042521
#endif /* SPV_ENABLE_UTILITY_CODE */

include/spirv/unified1/spirv.hpp11

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ enum class Capability : unsigned {
10831083
OptNoneINTEL = 6094,
10841084
AtomicFloat16AddEXT = 6095,
10851085
DebugInfoModuleINTEL = 6114,
1086+
GroupUniformArithmeticKHR = 6400,
10861087
Max = 0x7fffffff,
10871088
};
10881089

@@ -1845,6 +1846,14 @@ enum class Op : unsigned {
18451846
OpTypeStructContinuedINTEL = 6090,
18461847
OpConstantCompositeContinuedINTEL = 6091,
18471848
OpSpecConstantCompositeContinuedINTEL = 6092,
1849+
OpGroupIMulKHR = 6401,
1850+
OpGroupFMulKHR = 6402,
1851+
OpGroupBitwiseAndKHR = 6403,
1852+
OpGroupBitwiseOrKHR = 6404,
1853+
OpGroupBitwiseXorKHR = 6405,
1854+
OpGroupLogicalAndKHR = 6406,
1855+
OpGroupLogicalOrKHR = 6407,
1856+
OpGroupLogicalXorKHR = 6408,
18481857
Max = 0x7fffffff,
18491858
};
18501859

@@ -2499,6 +2508,14 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
24992508
case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
25002509
case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
25012510
case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
2511+
case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
2512+
case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
2513+
case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
2514+
case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
2515+
case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
2516+
case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
2517+
case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
2518+
case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
25022519
}
25032520
}
25042521
#endif /* SPV_ENABLE_UTILITY_CODE */

include/spirv/unified1/spirv.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,8 @@
10641064
"LongConstantCompositeINTEL": 6089,
10651065
"OptNoneINTEL": 6094,
10661066
"AtomicFloat16AddEXT": 6095,
1067-
"DebugInfoModuleINTEL": 6114
1067+
"DebugInfoModuleINTEL": 6114,
1068+
"GroupUniformArithmeticKHR": 6400
10681069
}
10691070
},
10701071
{
@@ -1837,7 +1838,15 @@
18371838
"OpTypeBufferSurfaceINTEL": 6086,
18381839
"OpTypeStructContinuedINTEL": 6090,
18391840
"OpConstantCompositeContinuedINTEL": 6091,
1840-
"OpSpecConstantCompositeContinuedINTEL": 6092
1841+
"OpSpecConstantCompositeContinuedINTEL": 6092,
1842+
"OpGroupIMulKHR": 6401,
1843+
"OpGroupFMulKHR": 6402,
1844+
"OpGroupBitwiseAndKHR": 6403,
1845+
"OpGroupBitwiseOrKHR": 6404,
1846+
"OpGroupBitwiseXorKHR": 6405,
1847+
"OpGroupLogicalAndKHR": 6406,
1848+
"OpGroupLogicalOrKHR": 6407,
1849+
"OpGroupLogicalXorKHR": 6408
18411850
}
18421851
}
18431852
]

include/spirv/unified1/spirv.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ spv = {
10451045
OptNoneINTEL = 6094,
10461046
AtomicFloat16AddEXT = 6095,
10471047
DebugInfoModuleINTEL = 6114,
1048+
GroupUniformArithmeticKHR = 6400,
10481049
},
10491050

10501051
RayFlagsShift = {
@@ -1796,6 +1797,14 @@ spv = {
17961797
OpTypeStructContinuedINTEL = 6090,
17971798
OpConstantCompositeContinuedINTEL = 6091,
17981799
OpSpecConstantCompositeContinuedINTEL = 6092,
1800+
OpGroupIMulKHR = 6401,
1801+
OpGroupFMulKHR = 6402,
1802+
OpGroupBitwiseAndKHR = 6403,
1803+
OpGroupBitwiseOrKHR = 6404,
1804+
OpGroupBitwiseXorKHR = 6405,
1805+
OpGroupLogicalAndKHR = 6406,
1806+
OpGroupLogicalOrKHR = 6407,
1807+
OpGroupLogicalXorKHR = 6408,
17991808
},
18001809

18011810
}

include/spirv/unified1/spirv.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@
10451045
'OptNoneINTEL' : 6094,
10461046
'AtomicFloat16AddEXT' : 6095,
10471047
'DebugInfoModuleINTEL' : 6114,
1048+
'GroupUniformArithmeticKHR' : 6400,
10481049
},
10491050

10501051
'RayFlagsShift' : {
@@ -1796,6 +1797,14 @@
17961797
'OpTypeStructContinuedINTEL' : 6090,
17971798
'OpConstantCompositeContinuedINTEL' : 6091,
17981799
'OpSpecConstantCompositeContinuedINTEL' : 6092,
1800+
'OpGroupIMulKHR' : 6401,
1801+
'OpGroupFMulKHR' : 6402,
1802+
'OpGroupBitwiseAndKHR' : 6403,
1803+
'OpGroupBitwiseOrKHR' : 6404,
1804+
'OpGroupBitwiseXorKHR' : 6405,
1805+
'OpGroupLogicalAndKHR' : 6406,
1806+
'OpGroupLogicalOrKHR' : 6407,
1807+
'OpGroupLogicalXorKHR' : 6408,
17991808
},
18001809

18011810
}

include/spirv/unified1/spv.d

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,7 @@ enum Capability : uint
10901090
OptNoneINTEL = 6094,
10911091
AtomicFloat16AddEXT = 6095,
10921092
DebugInfoModuleINTEL = 6114,
1093+
GroupUniformArithmeticKHR = 6400,
10931094
}
10941095

10951096
enum RayFlagsShift : uint
@@ -1854,6 +1855,14 @@ enum Op : uint
18541855
OpTypeStructContinuedINTEL = 6090,
18551856
OpConstantCompositeContinuedINTEL = 6091,
18561857
OpSpecConstantCompositeContinuedINTEL = 6092,
1858+
OpGroupIMulKHR = 6401,
1859+
OpGroupFMulKHR = 6402,
1860+
OpGroupBitwiseAndKHR = 6403,
1861+
OpGroupBitwiseOrKHR = 6404,
1862+
OpGroupBitwiseXorKHR = 6405,
1863+
OpGroupLogicalAndKHR = 6406,
1864+
OpGroupLogicalOrKHR = 6407,
1865+
OpGroupLogicalXorKHR = 6408,
18571866
}
18581867

18591868

0 commit comments

Comments
 (0)