#include "opencl.std.insts-1.0.inc"
};
+static const spv_ext_inst_desc_t spv_amd_shader_explicit_vertex_parameter_entries[] = {
+#include "spv-amd-shader-explicit-vertex-parameter.insts.inc"
+};
+
+static const spv_ext_inst_desc_t spv_amd_shader_trinary_minmax_entries[] = {
+#include "spv-amd-shader-trinary-minmax.insts.inc"
+};
+
static const spv_ext_inst_desc_t spv_amd_gcn_shader_entries[] = {
#include "spv-amd-gcn-shader.insts.inc"
};
+static const spv_ext_inst_desc_t spv_amd_shader_ballot_entries[] = {
+#include "spv-amd-shader-ballot.insts.inc"
+};
+
spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
spv_target_env env) {
if (!pExtInstTable) return SPV_ERROR_INVALID_POINTER;
glslStd450Entries_1_0},
{SPV_EXT_INST_TYPE_OPENCL_STD, ARRAY_SIZE(openclEntries_1_0),
openclEntries_1_0},
+ {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER,
+ ARRAY_SIZE(spv_amd_shader_explicit_vertex_parameter_entries), spv_amd_shader_explicit_vertex_parameter_entries},
+ {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX,
+ ARRAY_SIZE(spv_amd_shader_trinary_minmax_entries), spv_amd_shader_trinary_minmax_entries},
{SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER,
ARRAY_SIZE(spv_amd_gcn_shader_entries), spv_amd_gcn_shader_entries},
+ {SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT,
+ ARRAY_SIZE(spv_amd_shader_ballot_entries), spv_amd_shader_ballot_entries},
};
static const spv_ext_inst_table_t table_1_0 = {ARRAY_SIZE(groups_1_0),
if (!strcmp("OpenCL.std", name)) {
return SPV_EXT_INST_TYPE_OPENCL_STD;
}
+ if (!strcmp("SPV_AMD_shader_explicit_vertex_parameter", name)) {
+ return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER;
+ }
+ if (!strcmp("SPV_AMD_shader_trinary_minmax", name)) {
+ return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX;
+ }
if (!strcmp("SPV_AMD_gcn_shader", name)) {
return SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER;
}
+ if (!strcmp("SPV_AMD_shader_ballot", name)) {
+ return SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT;
+ }
return SPV_EXT_INST_TYPE_NONE;
}
--- /dev/null
+{
+ "revision" : 4,
+ "instructions" : [
+ {
+ "opname" : "FMin3AMD",
+ "opcode" : 1,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "UMin3AMD",
+ "opcode" : 2,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "SMin3AMD",
+ "opcode" : 3,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "FMax3AMD",
+ "opcode" : 4,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "UMax3AMD",
+ "opcode" : 5,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "SMax3AMD",
+ "opcode" : 6,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "FMid3AMD",
+ "opcode" : 7,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "UMid3AMD",
+ "opcode" : 8,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ },
+ {
+ "opname" : "SMid3AMD",
+ "opcode" : 9,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'x'" },
+ { "kind" : "IdRef", "name" : "'y'" },
+ { "kind" : "IdRef", "name" : "'z'" }
+ ],
+ "extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
+ }
+ ]
+}
})), );
+// SPV_AMD_shader_explicit_vertex_parameter
+
+#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n"
+INSTANTIATE_TEST_CASE_P(
+ SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest,
+ // We'll get coverage over operand tables by trying the universal
+ // environments, and at least one specific environment.
+ Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
+ SPV_ENV_VULKAN_1_0),
+ ValuesIn(std::vector<AssemblyCase>{
+ {PREAMBLE "%3 = OpExtInst %2 %1 InterpolateAtVertexAMD %4 %5\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_explicit_vertex_parameter")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})},
+ })), );
+#undef PREAMBLE
+
+
+// SPV_AMD_shader_trinary_minmax
+
+#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n"
+INSTANTIATE_TEST_CASE_P(
+ SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest,
+ // We'll get coverage over operand tables by trying the universal
+ // environments, and at least one specific environment.
+ Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
+ SPV_ENV_VULKAN_1_0),
+ ValuesIn(std::vector<AssemblyCase>{
+ {PREAMBLE "%3 = OpExtInst %2 %1 FMin3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 UMin3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 SMin3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 3, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 FMax3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 UMax3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 5, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 SMax3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 6, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 FMid3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 7, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 UMid3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 8, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 SMid3AMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_trinary_minmax")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 9, 4, 5, 6})})},
+ })), );
+#undef PREAMBLE
+
+
// SPV_AMD_gcn_shader
#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n"
Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
SPV_ENV_VULKAN_1_0),
ValuesIn(std::vector<AssemblyCase>{
- {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceCoordAMD %4\n",
- Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
- MakeVector("SPV_AMD_gcn_shader")),
- MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4})})},
{PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceIndexAMD %4\n",
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
MakeVector("SPV_AMD_gcn_shader")),
MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceCoordAMD %4\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_gcn_shader")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4})})},
{PREAMBLE "%3 = OpExtInst %2 %1 TimeAMD\n",
Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
MakeVector("SPV_AMD_gcn_shader")),
#undef PREAMBLE
+// SPV_AMD_shader_ballot
+
+#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n"
+INSTANTIATE_TEST_CASE_P(
+ SPV_AMD_shader_ballot, ExtensionRoundTripTest,
+ // We'll get coverage over operand tables by trying the universal
+ // environments, and at least one specific environment.
+ Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
+ SPV_ENV_VULKAN_1_0),
+ ValuesIn(std::vector<AssemblyCase>{
+ {PREAMBLE "%3 = OpExtInst %2 %1 SwizzleInvocationsAMD %4 %5\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_ballot")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 1, 4, 5})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 SwizzleInvocationsMaskedAMD %4 %5\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_ballot")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 2, 4, 5})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 WriteInvocationAMD %4 %5 %6\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_ballot")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 3, 4, 5, 6})})},
+ {PREAMBLE "%3 = OpExtInst %2 %1 MbcntAMD %4\n",
+ Concatenate({MakeInstruction(SpvOpExtInstImport, {1},
+ MakeVector("SPV_AMD_shader_ballot")),
+ MakeInstruction(SpvOpExtInst, {2, 3, 1, 4, 4})})},
+ })), );
+#undef PREAMBLE
+
+
// SPV_KHR_variable_pointers
INSTANTIATE_TEST_CASE_P(