Skip to content

Commit

Permalink
Upstream tokens for SPV_INTEL_masked_gather_scatter (#391)
Browse files Browse the repository at this point in the history
This extension allows TypeVector to have a physical pointer type
Component Type and introduces gather/scatter instructions.
It will be useful for explicitly vectorized kernels.

SPIR-V validator adjustments will be done later.

Signed-off-by: Sidorov, Dmitry <[email protected]>
  • Loading branch information
MrSidims authored Jan 3, 2024
1 parent e11db4d commit 1bfd271
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/spirv/unified1/spirv.bf
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ namespace Spv
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
}

Expand Down Expand Up @@ -2109,6 +2110,8 @@ namespace Spv
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions include/spirv/unified1/spirv.core.grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -9758,6 +9758,34 @@
],
"capabilities" : [ "GroupUniformArithmeticKHR" ],
"version" : "None"
},
{
"opname" : "OpMaskedGatherINTEL",
"class" : "Memory",
"opcode" : 6428,
"operands" : [
{ "kind" : "IdResultType" },
{ "kind" : "IdResult" },
{ "kind" : "IdRef", "name" : "'PtrVector'" },
{ "kind" : "LiteralInteger", "name" : "'Alignment'" },
{ "kind" : "IdRef", "name" : "'Mask'" },
{ "kind" : "IdRef", "name" : "'FillEmpty'" }
],
"capabilities" : [ "MaskedGatherScatterINTEL" ],
"version" : "None"
},
{
"opname" : "OpMaskedScatterINTEL",
"class" : "Memory",
"opcode" : 6429,
"operands" : [
{ "kind" : "IdRef", "name" : "'InputVector'" },
{ "kind" : "IdRef", "name" : "'PtrVector'" },
{ "kind" : "LiteralInteger", "name" : "'Alignment'" },
{ "kind" : "IdRef", "name" : "'Mask'" }
],
"capabilities" : [ "MaskedGatherScatterINTEL" ],
"version" : "None"
}
],
"operand_kinds" : [
Expand Down Expand Up @@ -16327,6 +16355,12 @@
"extensions" : [ "SPV_KHR_uniform_group_instructions"],
"version" : "None"
},
{
"enumerant" : "MaskedGatherScatterINTEL",
"value" : 6427,
"extensions" : [ "SPV_INTEL_masked_gather_scatter"],
"version" : "None"
},
{
"enumerant" : "CacheControlsINTEL",
"value" : 6441,
Expand Down
3 changes: 3 additions & 0 deletions include/spirv/unified1/spirv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ public enum Capability
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
}

Expand Down Expand Up @@ -2108,6 +2109,8 @@ public enum Op
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions include/spirv/unified1/spirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,7 @@ typedef enum SpvCapability_ {
SpvCapabilityGlobalVariableHostAccessINTEL = 6187,
SpvCapabilityGlobalVariableFPGADecorationsINTEL = 6189,
SpvCapabilityGroupUniformArithmeticKHR = 6400,
SpvCapabilityMaskedGatherScatterINTEL = 6427,
SpvCapabilityCacheControlsINTEL = 6441,
SpvCapabilityMax = 0x7fffffff,
} SpvCapability;
Expand Down Expand Up @@ -2105,6 +2106,8 @@ typedef enum SpvOp_ {
SpvOpGroupLogicalAndKHR = 6406,
SpvOpGroupLogicalOrKHR = 6407,
SpvOpGroupLogicalXorKHR = 6408,
SpvOpMaskedGatherINTEL = 6428,
SpvOpMaskedScatterINTEL = 6429,
SpvOpMax = 0x7fffffff,
} SpvOp;

Expand Down Expand Up @@ -2829,6 +2832,8 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
Expand Down
5 changes: 5 additions & 0 deletions include/spirv/unified1/spirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ enum Capability {
CapabilityGlobalVariableHostAccessINTEL = 6187,
CapabilityGlobalVariableFPGADecorationsINTEL = 6189,
CapabilityGroupUniformArithmeticKHR = 6400,
CapabilityMaskedGatherScatterINTEL = 6427,
CapabilityCacheControlsINTEL = 6441,
CapabilityMax = 0x7fffffff,
};
Expand Down Expand Up @@ -2101,6 +2102,8 @@ enum Op {
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
OpMax = 0x7fffffff,
};

Expand Down Expand Up @@ -2825,6 +2828,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
case OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break;
case OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
Expand Down
5 changes: 5 additions & 0 deletions include/spirv/unified1/spirv.hpp11
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ enum class Capability : unsigned {
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
Max = 0x7fffffff,
};
Expand Down Expand Up @@ -2101,6 +2102,8 @@ enum class Op : unsigned {
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
Max = 0x7fffffff,
};

Expand Down Expand Up @@ -2825,6 +2828,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
case Op::OpMaskedGatherINTEL: *hasResult = true; *hasResultType = true; break;
case Op::OpMaskedScatterINTEL: *hasResult = false; *hasResultType = false; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
Expand Down
5 changes: 4 additions & 1 deletion include/spirv/unified1/spirv.json
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@
"GlobalVariableHostAccessINTEL": 6187,
"GlobalVariableFPGADecorationsINTEL": 6189,
"GroupUniformArithmeticKHR": 6400,
"MaskedGatherScatterINTEL": 6427,
"CacheControlsINTEL": 6441
}
},
Expand Down Expand Up @@ -2102,7 +2103,9 @@
"OpGroupBitwiseXorKHR": 6405,
"OpGroupLogicalAndKHR": 6406,
"OpGroupLogicalOrKHR": 6407,
"OpGroupLogicalXorKHR": 6408
"OpGroupLogicalXorKHR": 6408,
"OpMaskedGatherINTEL": 6428,
"OpMaskedScatterINTEL": 6429
}
}
]
Expand Down
3 changes: 3 additions & 0 deletions include/spirv/unified1/spirv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@ spv = {
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
},

Expand Down Expand Up @@ -2045,6 +2046,8 @@ spv = {
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
},

}
Expand Down
3 changes: 3 additions & 0 deletions include/spirv/unified1/spirv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@
'GlobalVariableHostAccessINTEL' : 6187,
'GlobalVariableFPGADecorationsINTEL' : 6189,
'GroupUniformArithmeticKHR' : 6400,
'MaskedGatherScatterINTEL' : 6427,
'CacheControlsINTEL' : 6441,
},

Expand Down Expand Up @@ -2045,6 +2046,8 @@
'OpGroupLogicalAndKHR' : 6406,
'OpGroupLogicalOrKHR' : 6407,
'OpGroupLogicalXorKHR' : 6408,
'OpMaskedGatherINTEL' : 6428,
'OpMaskedScatterINTEL' : 6429,
},

}
Expand Down
3 changes: 3 additions & 0 deletions include/spirv/unified1/spv.d
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ enum Capability : uint
GlobalVariableHostAccessINTEL = 6187,
GlobalVariableFPGADecorationsINTEL = 6189,
GroupUniformArithmeticKHR = 6400,
MaskedGatherScatterINTEL = 6427,
CacheControlsINTEL = 6441,
}

Expand Down Expand Up @@ -2111,6 +2112,8 @@ enum Op : uint
OpGroupLogicalAndKHR = 6406,
OpGroupLogicalOrKHR = 6407,
OpGroupLogicalXorKHR = 6408,
OpMaskedGatherINTEL = 6428,
OpMaskedScatterINTEL = 6429,
}


0 comments on commit 1bfd271

Please sign in to comment.