1fd4e5da5Sopenharmony_ci// Copyright (c) 2015-2016 The Khronos Group Inc.
2fd4e5da5Sopenharmony_ci//
3fd4e5da5Sopenharmony_ci// Licensed under the Apache License, Version 2.0 (the "License");
4fd4e5da5Sopenharmony_ci// you may not use this file except in compliance with the License.
5fd4e5da5Sopenharmony_ci// You may obtain a copy of the License at
6fd4e5da5Sopenharmony_ci//
7fd4e5da5Sopenharmony_ci//     http://www.apache.org/licenses/LICENSE-2.0
8fd4e5da5Sopenharmony_ci//
9fd4e5da5Sopenharmony_ci// Unless required by applicable law or agreed to in writing, software
10fd4e5da5Sopenharmony_ci// distributed under the License is distributed on an "AS IS" BASIS,
11fd4e5da5Sopenharmony_ci// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12fd4e5da5Sopenharmony_ci// See the License for the specific language governing permissions and
13fd4e5da5Sopenharmony_ci// limitations under the License.
14fd4e5da5Sopenharmony_ci
15fd4e5da5Sopenharmony_ci// Assembler tests for instructions in the "Extension Instruction" section
16fd4e5da5Sopenharmony_ci// of the SPIR-V spec.
17fd4e5da5Sopenharmony_ci
18fd4e5da5Sopenharmony_ci#include <string>
19fd4e5da5Sopenharmony_ci#include <tuple>
20fd4e5da5Sopenharmony_ci#include <vector>
21fd4e5da5Sopenharmony_ci
22fd4e5da5Sopenharmony_ci#include "gmock/gmock.h"
23fd4e5da5Sopenharmony_ci#include "source/latest_version_glsl_std_450_header.h"
24fd4e5da5Sopenharmony_ci#include "source/latest_version_opencl_std_header.h"
25fd4e5da5Sopenharmony_ci#include "source/util/string_utils.h"
26fd4e5da5Sopenharmony_ci#include "test/test_fixture.h"
27fd4e5da5Sopenharmony_ci#include "test/unit_spirv.h"
28fd4e5da5Sopenharmony_ci
29fd4e5da5Sopenharmony_cinamespace spvtools {
30fd4e5da5Sopenharmony_cinamespace {
31fd4e5da5Sopenharmony_ci
32fd4e5da5Sopenharmony_ciusing spvtest::Concatenate;
33fd4e5da5Sopenharmony_ciusing spvtest::MakeInstruction;
34fd4e5da5Sopenharmony_ciusing utils::MakeVector;
35fd4e5da5Sopenharmony_ciusing spvtest::TextToBinaryTest;
36fd4e5da5Sopenharmony_ciusing ::testing::Combine;
37fd4e5da5Sopenharmony_ciusing ::testing::Eq;
38fd4e5da5Sopenharmony_ciusing ::testing::Values;
39fd4e5da5Sopenharmony_ciusing ::testing::ValuesIn;
40fd4e5da5Sopenharmony_ci
41fd4e5da5Sopenharmony_ci// Returns a generator of common Vulkan environment values to be tested.
42fd4e5da5Sopenharmony_cistd::vector<spv_target_env> CommonVulkanEnvs() {
43fd4e5da5Sopenharmony_ci  return {SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1, SPV_ENV_UNIVERSAL_1_2,
44fd4e5da5Sopenharmony_ci          SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0,    SPV_ENV_VULKAN_1_1};
45fd4e5da5Sopenharmony_ci}
46fd4e5da5Sopenharmony_ci
47fd4e5da5Sopenharmony_ciTEST_F(TextToBinaryTest, InvalidExtInstImportName) {
48fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompileFailure("%1 = OpExtInstImport \"Haskell.std\""),
49fd4e5da5Sopenharmony_ci              Eq("Invalid extended instruction import 'Haskell.std'"));
50fd4e5da5Sopenharmony_ci}
51fd4e5da5Sopenharmony_ci
52fd4e5da5Sopenharmony_ciTEST_F(TextToBinaryTest, InvalidImportId) {
53fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompileFailure("%1 = OpTypeVoid\n"
54fd4e5da5Sopenharmony_ci                             "%2 = OpExtInst %1 %1"),
55fd4e5da5Sopenharmony_ci              Eq("Invalid extended instruction import Id 2"));
56fd4e5da5Sopenharmony_ci}
57fd4e5da5Sopenharmony_ci
58fd4e5da5Sopenharmony_ciTEST_F(TextToBinaryTest, InvalidImportInstruction) {
59fd4e5da5Sopenharmony_ci  const std::string input = R"(%1 = OpTypeVoid
60fd4e5da5Sopenharmony_ci                               %2 = OpExtInstImport "OpenCL.std"
61fd4e5da5Sopenharmony_ci                               %3 = OpExtInst %1 %2 not_in_the_opencl)";
62fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompileFailure(input),
63fd4e5da5Sopenharmony_ci              Eq("Invalid extended instruction name 'not_in_the_opencl'."));
64fd4e5da5Sopenharmony_ci}
65fd4e5da5Sopenharmony_ci
66fd4e5da5Sopenharmony_ciTEST_F(TextToBinaryTest, MultiImport) {
67fd4e5da5Sopenharmony_ci  const std::string input = R"(%2 = OpExtInstImport "OpenCL.std"
68fd4e5da5Sopenharmony_ci                               %2 = OpExtInstImport "OpenCL.std")";
69fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompileFailure(input),
70fd4e5da5Sopenharmony_ci              Eq("Import Id is being defined a second time"));
71fd4e5da5Sopenharmony_ci}
72fd4e5da5Sopenharmony_ci
73fd4e5da5Sopenharmony_ciTEST_F(TextToBinaryTest, TooManyArguments) {
74fd4e5da5Sopenharmony_ci  const std::string input = R"(%opencl = OpExtInstImport "OpenCL.std"
75fd4e5da5Sopenharmony_ci                               %2 = OpExtInst %float %opencl cos %x %oops")";
76fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompileFailure(input), Eq("Expected '=', found end of stream."));
77fd4e5da5Sopenharmony_ci}
78fd4e5da5Sopenharmony_ci
79fd4e5da5Sopenharmony_ciTEST_F(TextToBinaryTest, ExtInstFromTwoDifferentImports) {
80fd4e5da5Sopenharmony_ci  const std::string input = R"(%1 = OpExtInstImport "OpenCL.std"
81fd4e5da5Sopenharmony_ci%2 = OpExtInstImport "GLSL.std.450"
82fd4e5da5Sopenharmony_ci%4 = OpExtInst %3 %1 native_sqrt %5
83fd4e5da5Sopenharmony_ci%7 = OpExtInst %6 %2 MatrixInverse %8
84fd4e5da5Sopenharmony_ci)";
85fd4e5da5Sopenharmony_ci
86fd4e5da5Sopenharmony_ci  // Make sure it assembles correctly.
87fd4e5da5Sopenharmony_ci  EXPECT_THAT(
88fd4e5da5Sopenharmony_ci      CompiledInstructions(input),
89fd4e5da5Sopenharmony_ci      Eq(Concatenate({
90fd4e5da5Sopenharmony_ci          MakeInstruction(spv::Op::OpExtInstImport, {1},
91fd4e5da5Sopenharmony_ci                          MakeVector("OpenCL.std")),
92fd4e5da5Sopenharmony_ci          MakeInstruction(spv::Op::OpExtInstImport, {2},
93fd4e5da5Sopenharmony_ci                          MakeVector("GLSL.std.450")),
94fd4e5da5Sopenharmony_ci          MakeInstruction(
95fd4e5da5Sopenharmony_ci              spv::Op::OpExtInst,
96fd4e5da5Sopenharmony_ci              {3, 4, 1, uint32_t(OpenCLLIB::Entrypoints::Native_sqrt), 5}),
97fd4e5da5Sopenharmony_ci          MakeInstruction(spv::Op::OpExtInst,
98fd4e5da5Sopenharmony_ci                          {6, 7, 2, uint32_t(GLSLstd450MatrixInverse), 8}),
99fd4e5da5Sopenharmony_ci      })));
100fd4e5da5Sopenharmony_ci
101fd4e5da5Sopenharmony_ci  // Make sure it disassembles correctly.
102fd4e5da5Sopenharmony_ci  EXPECT_THAT(EncodeAndDecodeSuccessfully(input), Eq(input));
103fd4e5da5Sopenharmony_ci}
104fd4e5da5Sopenharmony_ci
105fd4e5da5Sopenharmony_ci// A test case for assembling into words in an instruction.
106fd4e5da5Sopenharmony_cistruct AssemblyCase {
107fd4e5da5Sopenharmony_ci  std::string input;
108fd4e5da5Sopenharmony_ci  std::vector<uint32_t> expected;
109fd4e5da5Sopenharmony_ci};
110fd4e5da5Sopenharmony_ci
111fd4e5da5Sopenharmony_ciusing ExtensionAssemblyTest = spvtest::TextToBinaryTestBase<
112fd4e5da5Sopenharmony_ci    ::testing::TestWithParam<std::tuple<spv_target_env, AssemblyCase>>>;
113fd4e5da5Sopenharmony_ci
114fd4e5da5Sopenharmony_ciTEST_P(ExtensionAssemblyTest, Samples) {
115fd4e5da5Sopenharmony_ci  const spv_target_env& env = std::get<0>(GetParam());
116fd4e5da5Sopenharmony_ci  const AssemblyCase& ac = std::get<1>(GetParam());
117fd4e5da5Sopenharmony_ci
118fd4e5da5Sopenharmony_ci  // Check that it assembles correctly.
119fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected));
120fd4e5da5Sopenharmony_ci}
121fd4e5da5Sopenharmony_ci
122fd4e5da5Sopenharmony_ciusing ExtensionRoundTripTest = spvtest::TextToBinaryTestBase<
123fd4e5da5Sopenharmony_ci    ::testing::TestWithParam<std::tuple<spv_target_env, AssemblyCase>>>;
124fd4e5da5Sopenharmony_ci
125fd4e5da5Sopenharmony_ciTEST_P(ExtensionRoundTripTest, Samples) {
126fd4e5da5Sopenharmony_ci  const spv_target_env& env = std::get<0>(GetParam());
127fd4e5da5Sopenharmony_ci  const AssemblyCase& ac = std::get<1>(GetParam());
128fd4e5da5Sopenharmony_ci
129fd4e5da5Sopenharmony_ci  // Check that it assembles correctly.
130fd4e5da5Sopenharmony_ci  EXPECT_THAT(CompiledInstructions(ac.input, env), Eq(ac.expected));
131fd4e5da5Sopenharmony_ci
132fd4e5da5Sopenharmony_ci  // Check round trip through the disassembler.
133fd4e5da5Sopenharmony_ci  EXPECT_THAT(EncodeAndDecodeSuccessfully(ac.input,
134fd4e5da5Sopenharmony_ci                                          SPV_BINARY_TO_TEXT_OPTION_NONE, env),
135fd4e5da5Sopenharmony_ci              Eq(ac.input))
136fd4e5da5Sopenharmony_ci      << "target env: " << spvTargetEnvDescription(env) << "\n";
137fd4e5da5Sopenharmony_ci}
138fd4e5da5Sopenharmony_ci
139fd4e5da5Sopenharmony_ci// SPV_KHR_shader_ballot
140fd4e5da5Sopenharmony_ci
141fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
142fd4e5da5Sopenharmony_ci    SPV_KHR_shader_ballot, ExtensionRoundTripTest,
143fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
144fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
145fd4e5da5Sopenharmony_ci    Combine(
146fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
147fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_0),
148fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
149fd4e5da5Sopenharmony_ci            {"OpCapability SubgroupBallotKHR\n",
150fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
151fd4e5da5Sopenharmony_ci                             {uint32_t(spv::Capability::SubgroupBallotKHR)})},
152fd4e5da5Sopenharmony_ci            {"%2 = OpSubgroupBallotKHR %1 %3\n",
153fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSubgroupBallotKHR, {1, 2, 3})},
154fd4e5da5Sopenharmony_ci            {"%2 = OpSubgroupFirstInvocationKHR %1 %3\n",
155fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSubgroupFirstInvocationKHR, {1, 2, 3})},
156fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupEqMask\n",
157fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
158fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
159fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupEqMaskKHR)})},
160fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupGeMask\n",
161fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
162fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
163fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupGeMaskKHR)})},
164fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupGtMask\n",
165fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
166fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
167fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupGtMaskKHR)})},
168fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupLeMask\n",
169fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
170fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
171fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupLeMaskKHR)})},
172fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupLtMask\n",
173fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
174fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
175fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupLtMaskKHR)})},
176fd4e5da5Sopenharmony_ci        })));
177fd4e5da5Sopenharmony_ci
178fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
179fd4e5da5Sopenharmony_ci    SPV_KHR_shader_ballot_vulkan_1_1, ExtensionRoundTripTest,
180fd4e5da5Sopenharmony_ci    // In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
181fd4e5da5Sopenharmony_ci    // builtin enums.
182fd4e5da5Sopenharmony_ci    Combine(
183fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
184fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
185fd4e5da5Sopenharmony_ci            {"OpCapability SubgroupBallotKHR\n",
186fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
187fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::SubgroupBallotKHR})},
188fd4e5da5Sopenharmony_ci            {"%2 = OpSubgroupBallotKHR %1 %3\n",
189fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSubgroupBallotKHR, {1, 2, 3})},
190fd4e5da5Sopenharmony_ci            {"%2 = OpSubgroupFirstInvocationKHR %1 %3\n",
191fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSubgroupFirstInvocationKHR, {1, 2, 3})},
192fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupEqMask\n",
193fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
194fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
195fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupEqMask)})},
196fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupGeMask\n",
197fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
198fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
199fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupGeMask)})},
200fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupGtMask\n",
201fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
202fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
203fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupGtMask)})},
204fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupLeMask\n",
205fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
206fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
207fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupLeMask)})},
208fd4e5da5Sopenharmony_ci            {"OpDecorate %1 BuiltIn SubgroupLtMask\n",
209fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
210fd4e5da5Sopenharmony_ci                             {1, uint32_t(spv::Decoration::BuiltIn),
211fd4e5da5Sopenharmony_ci                              uint32_t(spv::BuiltIn::SubgroupLtMask)})},
212fd4e5da5Sopenharmony_ci        })));
213fd4e5da5Sopenharmony_ci
214fd4e5da5Sopenharmony_ci// The old builtin names (with KHR suffix) still work in the assembler, and
215fd4e5da5Sopenharmony_ci// map to the enums without the KHR.
216fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
217fd4e5da5Sopenharmony_ci    SPV_KHR_shader_ballot_vulkan_1_1_alias_check, ExtensionAssemblyTest,
218fd4e5da5Sopenharmony_ci    // In SPIR-V 1.3 and Vulkan 1.1 we can drop the KHR suffix on the
219fd4e5da5Sopenharmony_ci    // builtin enums.
220fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
221fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
222fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn SubgroupEqMaskKHR\n",
223fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
224fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
225fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::SubgroupEqMask})},
226fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn SubgroupGeMaskKHR\n",
227fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
228fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
229fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::SubgroupGeMask})},
230fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn SubgroupGtMaskKHR\n",
231fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
232fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
233fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::SubgroupGtMask})},
234fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn SubgroupLeMaskKHR\n",
235fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
236fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
237fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::SubgroupLeMask})},
238fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn SubgroupLtMaskKHR\n",
239fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
240fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
241fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::SubgroupLtMask})},
242fd4e5da5Sopenharmony_ci            })));
243fd4e5da5Sopenharmony_ci
244fd4e5da5Sopenharmony_ci// SPV_KHR_shader_draw_parameters
245fd4e5da5Sopenharmony_ci
246fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
247fd4e5da5Sopenharmony_ci    SPV_KHR_shader_draw_parameters, ExtensionRoundTripTest,
248fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
249fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
250fd4e5da5Sopenharmony_ci    Combine(ValuesIn(CommonVulkanEnvs()),
251fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
252fd4e5da5Sopenharmony_ci                {"OpCapability DrawParameters\n",
253fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpCapability,
254fd4e5da5Sopenharmony_ci                                 {(uint32_t)spv::Capability::DrawParameters})},
255fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn BaseVertex\n",
256fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
257fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
258fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::BaseVertex})},
259fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn BaseInstance\n",
260fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
261fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
262fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::BaseInstance})},
263fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn DrawIndex\n",
264fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
265fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
266fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::DrawIndex})},
267fd4e5da5Sopenharmony_ci            })));
268fd4e5da5Sopenharmony_ci
269fd4e5da5Sopenharmony_ci// SPV_KHR_subgroup_vote
270fd4e5da5Sopenharmony_ci
271fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
272fd4e5da5Sopenharmony_ci    SPV_KHR_subgroup_vote, ExtensionRoundTripTest,
273fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
274fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
275fd4e5da5Sopenharmony_ci    Combine(ValuesIn(CommonVulkanEnvs()),
276fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
277fd4e5da5Sopenharmony_ci                {"OpCapability SubgroupVoteKHR\n",
278fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpCapability,
279fd4e5da5Sopenharmony_ci                                 {(uint32_t)spv::Capability::SubgroupVoteKHR})},
280fd4e5da5Sopenharmony_ci                {"%2 = OpSubgroupAnyKHR %1 %3\n",
281fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpSubgroupAnyKHR, {1, 2, 3})},
282fd4e5da5Sopenharmony_ci                {"%2 = OpSubgroupAllKHR %1 %3\n",
283fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpSubgroupAllKHR, {1, 2, 3})},
284fd4e5da5Sopenharmony_ci                {"%2 = OpSubgroupAllEqualKHR %1 %3\n",
285fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpSubgroupAllEqualKHR, {1, 2, 3})},
286fd4e5da5Sopenharmony_ci            })));
287fd4e5da5Sopenharmony_ci
288fd4e5da5Sopenharmony_ci// SPV_KHR_16bit_storage
289fd4e5da5Sopenharmony_ci
290fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
291fd4e5da5Sopenharmony_ci    SPV_KHR_16bit_storage, ExtensionRoundTripTest,
292fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
293fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
294fd4e5da5Sopenharmony_ci    Combine(
295fd4e5da5Sopenharmony_ci        ValuesIn(CommonVulkanEnvs()),
296fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
297fd4e5da5Sopenharmony_ci            {"OpCapability StorageBuffer16BitAccess\n",
298fd4e5da5Sopenharmony_ci             MakeInstruction(
299fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
300fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::StorageUniformBufferBlock16})},
301fd4e5da5Sopenharmony_ci            {"OpCapability StorageBuffer16BitAccess\n",
302fd4e5da5Sopenharmony_ci             MakeInstruction(
303fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
304fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::StorageBuffer16BitAccess})},
305fd4e5da5Sopenharmony_ci            {"OpCapability UniformAndStorageBuffer16BitAccess\n",
306fd4e5da5Sopenharmony_ci             MakeInstruction(
307fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
308fd4e5da5Sopenharmony_ci                 {(uint32_t)
309fd4e5da5Sopenharmony_ci                      spv::Capability::UniformAndStorageBuffer16BitAccess})},
310fd4e5da5Sopenharmony_ci            {"OpCapability UniformAndStorageBuffer16BitAccess\n",
311fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
312fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::StorageUniform16})},
313fd4e5da5Sopenharmony_ci            {"OpCapability StoragePushConstant16\n",
314fd4e5da5Sopenharmony_ci             MakeInstruction(
315fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
316fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::StoragePushConstant16})},
317fd4e5da5Sopenharmony_ci            {"OpCapability StorageInputOutput16\n",
318fd4e5da5Sopenharmony_ci             MakeInstruction(
319fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
320fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::StorageInputOutput16})},
321fd4e5da5Sopenharmony_ci        })));
322fd4e5da5Sopenharmony_ci
323fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
324fd4e5da5Sopenharmony_ci    SPV_KHR_16bit_storage_alias_check, ExtensionAssemblyTest,
325fd4e5da5Sopenharmony_ci    Combine(
326fd4e5da5Sopenharmony_ci        ValuesIn(CommonVulkanEnvs()),
327fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
328fd4e5da5Sopenharmony_ci            // The old name maps to the new enum.
329fd4e5da5Sopenharmony_ci            {"OpCapability StorageUniformBufferBlock16\n",
330fd4e5da5Sopenharmony_ci             MakeInstruction(
331fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
332fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::StorageBuffer16BitAccess})},
333fd4e5da5Sopenharmony_ci            // The new name maps to the old enum.
334fd4e5da5Sopenharmony_ci            {"OpCapability UniformAndStorageBuffer16BitAccess\n",
335fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
336fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::StorageUniform16})},
337fd4e5da5Sopenharmony_ci        })));
338fd4e5da5Sopenharmony_ci
339fd4e5da5Sopenharmony_ci// SPV_KHR_device_group
340fd4e5da5Sopenharmony_ci
341fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
342fd4e5da5Sopenharmony_ci    SPV_KHR_device_group, ExtensionRoundTripTest,
343fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
344fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
345fd4e5da5Sopenharmony_ci    Combine(ValuesIn(CommonVulkanEnvs()),
346fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
347fd4e5da5Sopenharmony_ci                {"OpCapability DeviceGroup\n",
348fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpCapability,
349fd4e5da5Sopenharmony_ci                                 {(uint32_t)spv::Capability::DeviceGroup})},
350fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn DeviceIndex\n",
351fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
352fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
353fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::DeviceIndex})},
354fd4e5da5Sopenharmony_ci            })));
355fd4e5da5Sopenharmony_ci
356fd4e5da5Sopenharmony_ci// SPV_KHR_8bit_storage
357fd4e5da5Sopenharmony_ci
358fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
359fd4e5da5Sopenharmony_ci    SPV_KHR_8bit_storage, ExtensionRoundTripTest,
360fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
361fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
362fd4e5da5Sopenharmony_ci    Combine(ValuesIn(CommonVulkanEnvs()),
363fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
364fd4e5da5Sopenharmony_ci                {"OpCapability StorageBuffer8BitAccess\n",
365fd4e5da5Sopenharmony_ci                 MakeInstruction(
366fd4e5da5Sopenharmony_ci                     spv::Op::OpCapability,
367fd4e5da5Sopenharmony_ci                     {(uint32_t)spv::Capability::StorageBuffer8BitAccess})},
368fd4e5da5Sopenharmony_ci                {"OpCapability UniformAndStorageBuffer8BitAccess\n",
369fd4e5da5Sopenharmony_ci                 MakeInstruction(
370fd4e5da5Sopenharmony_ci                     spv::Op::OpCapability,
371fd4e5da5Sopenharmony_ci                     {(uint32_t)
372fd4e5da5Sopenharmony_ci                          spv::Capability::UniformAndStorageBuffer8BitAccess})},
373fd4e5da5Sopenharmony_ci                {"OpCapability StoragePushConstant8\n",
374fd4e5da5Sopenharmony_ci                 MakeInstruction(
375fd4e5da5Sopenharmony_ci                     spv::Op::OpCapability,
376fd4e5da5Sopenharmony_ci                     {(uint32_t)spv::Capability::StoragePushConstant8})},
377fd4e5da5Sopenharmony_ci            })));
378fd4e5da5Sopenharmony_ci
379fd4e5da5Sopenharmony_ci// SPV_KHR_multiview
380fd4e5da5Sopenharmony_ci
381fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
382fd4e5da5Sopenharmony_ci    SPV_KHR_multiview, ExtensionRoundTripTest,
383fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
384fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
385fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
386fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_0),
387fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
388fd4e5da5Sopenharmony_ci                {"OpCapability MultiView\n",
389fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpCapability,
390fd4e5da5Sopenharmony_ci                                 {(uint32_t)spv::Capability::MultiView})},
391fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn ViewIndex\n",
392fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
393fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
394fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::ViewIndex})},
395fd4e5da5Sopenharmony_ci            })));
396fd4e5da5Sopenharmony_ci
397fd4e5da5Sopenharmony_ci// SPV_AMD_shader_explicit_vertex_parameter
398fd4e5da5Sopenharmony_ci
399fd4e5da5Sopenharmony_ci#define PREAMBLE \
400fd4e5da5Sopenharmony_ci  "%1 = OpExtInstImport \"SPV_AMD_shader_explicit_vertex_parameter\"\n"
401fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
402fd4e5da5Sopenharmony_ci    SPV_AMD_shader_explicit_vertex_parameter, ExtensionRoundTripTest,
403fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
404fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
405fd4e5da5Sopenharmony_ci    Combine(
406fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
407fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_0),
408fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
409fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 InterpolateAtVertexAMD %4 %5\n",
410fd4e5da5Sopenharmony_ci             Concatenate(
411fd4e5da5Sopenharmony_ci                 {MakeInstruction(
412fd4e5da5Sopenharmony_ci                      spv::Op::OpExtInstImport, {1},
413fd4e5da5Sopenharmony_ci                      MakeVector("SPV_AMD_shader_explicit_vertex_parameter")),
414fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 1, 4, 5})})},
415fd4e5da5Sopenharmony_ci        })));
416fd4e5da5Sopenharmony_ci#undef PREAMBLE
417fd4e5da5Sopenharmony_ci
418fd4e5da5Sopenharmony_ci// SPV_AMD_shader_trinary_minmax
419fd4e5da5Sopenharmony_ci
420fd4e5da5Sopenharmony_ci#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_trinary_minmax\"\n"
421fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
422fd4e5da5Sopenharmony_ci    SPV_AMD_shader_trinary_minmax, ExtensionRoundTripTest,
423fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
424fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
425fd4e5da5Sopenharmony_ci    Combine(
426fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
427fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_0),
428fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
429fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 FMin3AMD %4 %5 %6\n",
430fd4e5da5Sopenharmony_ci             Concatenate(
431fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
432fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
433fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 1, 4, 5, 6})})},
434fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 UMin3AMD %4 %5 %6\n",
435fd4e5da5Sopenharmony_ci             Concatenate(
436fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
437fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
438fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 2, 4, 5, 6})})},
439fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 SMin3AMD %4 %5 %6\n",
440fd4e5da5Sopenharmony_ci             Concatenate(
441fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
442fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
443fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 3, 4, 5, 6})})},
444fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 FMax3AMD %4 %5 %6\n",
445fd4e5da5Sopenharmony_ci             Concatenate(
446fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
447fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
448fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 4, 4, 5, 6})})},
449fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 UMax3AMD %4 %5 %6\n",
450fd4e5da5Sopenharmony_ci             Concatenate(
451fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
452fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
453fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 5, 4, 5, 6})})},
454fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 SMax3AMD %4 %5 %6\n",
455fd4e5da5Sopenharmony_ci             Concatenate(
456fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
457fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
458fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 6, 4, 5, 6})})},
459fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 FMid3AMD %4 %5 %6\n",
460fd4e5da5Sopenharmony_ci             Concatenate(
461fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
462fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
463fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 7, 4, 5, 6})})},
464fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 UMid3AMD %4 %5 %6\n",
465fd4e5da5Sopenharmony_ci             Concatenate(
466fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
467fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
468fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 8, 4, 5, 6})})},
469fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 SMid3AMD %4 %5 %6\n",
470fd4e5da5Sopenharmony_ci             Concatenate(
471fd4e5da5Sopenharmony_ci                 {MakeInstruction(spv::Op::OpExtInstImport, {1},
472fd4e5da5Sopenharmony_ci                                  MakeVector("SPV_AMD_shader_trinary_minmax")),
473fd4e5da5Sopenharmony_ci                  MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 9, 4, 5, 6})})},
474fd4e5da5Sopenharmony_ci        })));
475fd4e5da5Sopenharmony_ci#undef PREAMBLE
476fd4e5da5Sopenharmony_ci
477fd4e5da5Sopenharmony_ci// SPV_AMD_gcn_shader
478fd4e5da5Sopenharmony_ci
479fd4e5da5Sopenharmony_ci#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_gcn_shader\"\n"
480fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
481fd4e5da5Sopenharmony_ci    SPV_AMD_gcn_shader, ExtensionRoundTripTest,
482fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
483fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
484fd4e5da5Sopenharmony_ci    Combine(
485fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
486fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_0),
487fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
488fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceIndexAMD %4\n",
489fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
490fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_gcn_shader")),
491fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst,
492fd4e5da5Sopenharmony_ci                                          {2, 3, 1, 1, 4})})},
493fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 CubeFaceCoordAMD %4\n",
494fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
495fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_gcn_shader")),
496fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst,
497fd4e5da5Sopenharmony_ci                                          {2, 3, 1, 2, 4})})},
498fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 TimeAMD\n",
499fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
500fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_gcn_shader")),
501fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst, {2, 3, 1, 3})})},
502fd4e5da5Sopenharmony_ci        })));
503fd4e5da5Sopenharmony_ci#undef PREAMBLE
504fd4e5da5Sopenharmony_ci
505fd4e5da5Sopenharmony_ci// SPV_AMD_shader_ballot
506fd4e5da5Sopenharmony_ci
507fd4e5da5Sopenharmony_ci#define PREAMBLE "%1 = OpExtInstImport \"SPV_AMD_shader_ballot\"\n"
508fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
509fd4e5da5Sopenharmony_ci    SPV_AMD_shader_ballot, ExtensionRoundTripTest,
510fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
511fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
512fd4e5da5Sopenharmony_ci    Combine(
513fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
514fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_0),
515fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
516fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 SwizzleInvocationsAMD %4 %5\n",
517fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
518fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_shader_ballot")),
519fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst,
520fd4e5da5Sopenharmony_ci                                          {2, 3, 1, 1, 4, 5})})},
521fd4e5da5Sopenharmony_ci            {PREAMBLE
522fd4e5da5Sopenharmony_ci             "%3 = OpExtInst %2 %1 SwizzleInvocationsMaskedAMD %4 %5\n",
523fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
524fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_shader_ballot")),
525fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst,
526fd4e5da5Sopenharmony_ci                                          {2, 3, 1, 2, 4, 5})})},
527fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 WriteInvocationAMD %4 %5 %6\n",
528fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
529fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_shader_ballot")),
530fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst,
531fd4e5da5Sopenharmony_ci                                          {2, 3, 1, 3, 4, 5, 6})})},
532fd4e5da5Sopenharmony_ci            {PREAMBLE "%3 = OpExtInst %2 %1 MbcntAMD %4\n",
533fd4e5da5Sopenharmony_ci             Concatenate({MakeInstruction(spv::Op::OpExtInstImport, {1},
534fd4e5da5Sopenharmony_ci                                          MakeVector("SPV_AMD_shader_ballot")),
535fd4e5da5Sopenharmony_ci                          MakeInstruction(spv::Op::OpExtInst,
536fd4e5da5Sopenharmony_ci                                          {2, 3, 1, 4, 4})})},
537fd4e5da5Sopenharmony_ci        })));
538fd4e5da5Sopenharmony_ci#undef PREAMBLE
539fd4e5da5Sopenharmony_ci
540fd4e5da5Sopenharmony_ci// SPV_KHR_variable_pointers
541fd4e5da5Sopenharmony_ci
542fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
543fd4e5da5Sopenharmony_ci    SPV_KHR_variable_pointers, ExtensionRoundTripTest,
544fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
545fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
546fd4e5da5Sopenharmony_ci    Combine(
547fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
548fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_0),
549fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
550fd4e5da5Sopenharmony_ci            {"OpCapability VariablePointers\n",
551fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
552fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::VariablePointers})},
553fd4e5da5Sopenharmony_ci            {"OpCapability VariablePointersStorageBuffer\n",
554fd4e5da5Sopenharmony_ci             MakeInstruction(
555fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
556fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::VariablePointersStorageBuffer})},
557fd4e5da5Sopenharmony_ci        })));
558fd4e5da5Sopenharmony_ci
559fd4e5da5Sopenharmony_ci// SPV_KHR_vulkan_memory_model
560fd4e5da5Sopenharmony_ci
561fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
562fd4e5da5Sopenharmony_ci    SPV_KHR_vulkan_memory_model, ExtensionRoundTripTest,
563fd4e5da5Sopenharmony_ci    // We'll get coverage over operand tables by trying the universal
564fd4e5da5Sopenharmony_ci    // environments, and at least one specific environment.
565fd4e5da5Sopenharmony_ci    //
566fd4e5da5Sopenharmony_ci    // Note: SPV_KHR_vulkan_memory_model adds scope enum value QueueFamilyKHR.
567fd4e5da5Sopenharmony_ci    // Scope enums are used in ID definitions elsewhere, that don't know they
568fd4e5da5Sopenharmony_ci    // are using particular enums.  So the assembler doesn't support assembling
569fd4e5da5Sopenharmony_ci    // those enums names into the corresponding values.  So there is no asm/dis
570fd4e5da5Sopenharmony_ci    // tests for those enums.
571fd4e5da5Sopenharmony_ci    Combine(
572fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
573fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1),
574fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
575fd4e5da5Sopenharmony_ci            {"OpCapability VulkanMemoryModel\n",
576fd4e5da5Sopenharmony_ci             MakeInstruction(
577fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
578fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::VulkanMemoryModelKHR})},
579fd4e5da5Sopenharmony_ci            {"OpCapability VulkanMemoryModelDeviceScope\n",
580fd4e5da5Sopenharmony_ci             MakeInstruction(
581fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
582fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::VulkanMemoryModelDeviceScopeKHR})},
583fd4e5da5Sopenharmony_ci            {"OpMemoryModel Logical Vulkan\n",
584fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpMemoryModel,
585fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::AddressingModel::Logical,
586fd4e5da5Sopenharmony_ci                              (uint32_t)spv::MemoryModel::VulkanKHR})},
587fd4e5da5Sopenharmony_ci            {"OpStore %1 %2 MakePointerAvailable %3\n",
588fd4e5da5Sopenharmony_ci             MakeInstruction(
589fd4e5da5Sopenharmony_ci                 spv::Op::OpStore,
590fd4e5da5Sopenharmony_ci                 {1, 2,
591fd4e5da5Sopenharmony_ci                  (uint32_t)spv::MemoryAccessMask::MakePointerAvailableKHR,
592fd4e5da5Sopenharmony_ci                  3})},
593fd4e5da5Sopenharmony_ci            {"OpStore %1 %2 Volatile|MakePointerAvailable %3\n",
594fd4e5da5Sopenharmony_ci             MakeInstruction(
595fd4e5da5Sopenharmony_ci                 spv::Op::OpStore,
596fd4e5da5Sopenharmony_ci                 {1, 2,
597fd4e5da5Sopenharmony_ci                  int(spv::MemoryAccessMask::MakePointerAvailableKHR) |
598fd4e5da5Sopenharmony_ci                      int(spv::MemoryAccessMask::Volatile),
599fd4e5da5Sopenharmony_ci                  3})},
600fd4e5da5Sopenharmony_ci            {"OpStore %1 %2 Aligned|MakePointerAvailable 4 %3\n",
601fd4e5da5Sopenharmony_ci             MakeInstruction(
602fd4e5da5Sopenharmony_ci                 spv::Op::OpStore,
603fd4e5da5Sopenharmony_ci                 {1, 2,
604fd4e5da5Sopenharmony_ci                  int(spv::MemoryAccessMask::MakePointerAvailableKHR) |
605fd4e5da5Sopenharmony_ci                      int(spv::MemoryAccessMask::Aligned),
606fd4e5da5Sopenharmony_ci                  4, 3})},
607fd4e5da5Sopenharmony_ci            {"OpStore %1 %2 MakePointerAvailable|NonPrivatePointer %3\n",
608fd4e5da5Sopenharmony_ci             MakeInstruction(
609fd4e5da5Sopenharmony_ci                 spv::Op::OpStore,
610fd4e5da5Sopenharmony_ci                 {1, 2,
611fd4e5da5Sopenharmony_ci                  int(spv::MemoryAccessMask::MakePointerAvailableKHR) |
612fd4e5da5Sopenharmony_ci                      int(spv::MemoryAccessMask::NonPrivatePointerKHR),
613fd4e5da5Sopenharmony_ci                  3})},
614fd4e5da5Sopenharmony_ci            {"%2 = OpLoad %1 %3 MakePointerVisible %4\n",
615fd4e5da5Sopenharmony_ci             MakeInstruction(
616fd4e5da5Sopenharmony_ci                 spv::Op::OpLoad,
617fd4e5da5Sopenharmony_ci                 {1, 2, 3,
618fd4e5da5Sopenharmony_ci                  (uint32_t)spv::MemoryAccessMask::MakePointerVisibleKHR, 4})},
619fd4e5da5Sopenharmony_ci            {"%2 = OpLoad %1 %3 Volatile|MakePointerVisible %4\n",
620fd4e5da5Sopenharmony_ci             MakeInstruction(
621fd4e5da5Sopenharmony_ci                 spv::Op::OpLoad,
622fd4e5da5Sopenharmony_ci                 {1, 2, 3,
623fd4e5da5Sopenharmony_ci                  int(spv::MemoryAccessMask::MakePointerVisibleKHR) |
624fd4e5da5Sopenharmony_ci                      int(spv::MemoryAccessMask::Volatile),
625fd4e5da5Sopenharmony_ci                  4})},
626fd4e5da5Sopenharmony_ci            {"%2 = OpLoad %1 %3 Aligned|MakePointerVisible 8 %4\n",
627fd4e5da5Sopenharmony_ci             MakeInstruction(
628fd4e5da5Sopenharmony_ci                 spv::Op::OpLoad,
629fd4e5da5Sopenharmony_ci                 {1, 2, 3,
630fd4e5da5Sopenharmony_ci                  int(spv::MemoryAccessMask::MakePointerVisibleKHR) |
631fd4e5da5Sopenharmony_ci                      int(spv::MemoryAccessMask::Aligned),
632fd4e5da5Sopenharmony_ci                  8, 4})},
633fd4e5da5Sopenharmony_ci            {"%2 = OpLoad %1 %3 MakePointerVisible|NonPrivatePointer "
634fd4e5da5Sopenharmony_ci             "%4\n",
635fd4e5da5Sopenharmony_ci             MakeInstruction(
636fd4e5da5Sopenharmony_ci                 spv::Op::OpLoad,
637fd4e5da5Sopenharmony_ci                 {1, 2, 3,
638fd4e5da5Sopenharmony_ci                  int(spv::MemoryAccessMask::MakePointerVisibleKHR) |
639fd4e5da5Sopenharmony_ci                      int(spv::MemoryAccessMask::NonPrivatePointerKHR),
640fd4e5da5Sopenharmony_ci                  4})},
641fd4e5da5Sopenharmony_ci            {"OpCopyMemory %1 %2 "
642fd4e5da5Sopenharmony_ci             "MakePointerAvailable|"
643fd4e5da5Sopenharmony_ci             "MakePointerVisible|"
644fd4e5da5Sopenharmony_ci             "NonPrivatePointer "
645fd4e5da5Sopenharmony_ci             "%3 %4\n",
646fd4e5da5Sopenharmony_ci             MakeInstruction(
647fd4e5da5Sopenharmony_ci                 spv::Op::OpCopyMemory,
648fd4e5da5Sopenharmony_ci                 {1, 2,
649fd4e5da5Sopenharmony_ci                  (int(spv::MemoryAccessMask::MakePointerVisibleKHR) |
650fd4e5da5Sopenharmony_ci                   int(spv::MemoryAccessMask::MakePointerAvailableKHR) |
651fd4e5da5Sopenharmony_ci                   int(spv::MemoryAccessMask::NonPrivatePointerKHR)),
652fd4e5da5Sopenharmony_ci                  3, 4})},
653fd4e5da5Sopenharmony_ci            {"OpCopyMemorySized %1 %2 %3 "
654fd4e5da5Sopenharmony_ci             "MakePointerAvailable|"
655fd4e5da5Sopenharmony_ci             "MakePointerVisible|"
656fd4e5da5Sopenharmony_ci             "NonPrivatePointer "
657fd4e5da5Sopenharmony_ci             "%4 %5\n",
658fd4e5da5Sopenharmony_ci             MakeInstruction(
659fd4e5da5Sopenharmony_ci                 spv::Op::OpCopyMemorySized,
660fd4e5da5Sopenharmony_ci                 {1, 2, 3,
661fd4e5da5Sopenharmony_ci                  (int(spv::MemoryAccessMask::MakePointerVisibleKHR) |
662fd4e5da5Sopenharmony_ci                   int(spv::MemoryAccessMask::MakePointerAvailableKHR) |
663fd4e5da5Sopenharmony_ci                   int(spv::MemoryAccessMask::NonPrivatePointerKHR)),
664fd4e5da5Sopenharmony_ci                  4, 5})},
665fd4e5da5Sopenharmony_ci            // Image operands
666fd4e5da5Sopenharmony_ci            {"OpImageWrite %1 %2 %3 MakeTexelAvailable "
667fd4e5da5Sopenharmony_ci             "%4\n",
668fd4e5da5Sopenharmony_ci             MakeInstruction(
669fd4e5da5Sopenharmony_ci                 spv::Op::OpImageWrite,
670fd4e5da5Sopenharmony_ci                 {1, 2, 3, int(spv::ImageOperandsMask::MakeTexelAvailableKHR),
671fd4e5da5Sopenharmony_ci                  4})},
672fd4e5da5Sopenharmony_ci            {"OpImageWrite %1 %2 %3 MakeTexelAvailable|NonPrivateTexel "
673fd4e5da5Sopenharmony_ci             "%4\n",
674fd4e5da5Sopenharmony_ci             MakeInstruction(
675fd4e5da5Sopenharmony_ci                 spv::Op::OpImageWrite,
676fd4e5da5Sopenharmony_ci                 {1, 2, 3,
677fd4e5da5Sopenharmony_ci                  int(spv::ImageOperandsMask::MakeTexelAvailableKHR) |
678fd4e5da5Sopenharmony_ci                      int(spv::ImageOperandsMask::NonPrivateTexelKHR),
679fd4e5da5Sopenharmony_ci                  4})},
680fd4e5da5Sopenharmony_ci            {"OpImageWrite %1 %2 %3 "
681fd4e5da5Sopenharmony_ci             "MakeTexelAvailable|NonPrivateTexel|VolatileTexel "
682fd4e5da5Sopenharmony_ci             "%4\n",
683fd4e5da5Sopenharmony_ci             MakeInstruction(
684fd4e5da5Sopenharmony_ci                 spv::Op::OpImageWrite,
685fd4e5da5Sopenharmony_ci                 {1, 2, 3,
686fd4e5da5Sopenharmony_ci                  int(spv::ImageOperandsMask::MakeTexelAvailableKHR) |
687fd4e5da5Sopenharmony_ci                      int(spv::ImageOperandsMask::NonPrivateTexelKHR) |
688fd4e5da5Sopenharmony_ci                      int(spv::ImageOperandsMask::VolatileTexelKHR),
689fd4e5da5Sopenharmony_ci                  4})},
690fd4e5da5Sopenharmony_ci            {"%2 = OpImageRead %1 %3 %4 MakeTexelVisible "
691fd4e5da5Sopenharmony_ci             "%5\n",
692fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpImageRead,
693fd4e5da5Sopenharmony_ci                             {1, 2, 3, 4,
694fd4e5da5Sopenharmony_ci                              int(spv::ImageOperandsMask::MakeTexelVisibleKHR),
695fd4e5da5Sopenharmony_ci                              5})},
696fd4e5da5Sopenharmony_ci            {"%2 = OpImageRead %1 %3 %4 "
697fd4e5da5Sopenharmony_ci             "MakeTexelVisible|NonPrivateTexel "
698fd4e5da5Sopenharmony_ci             "%5\n",
699fd4e5da5Sopenharmony_ci             MakeInstruction(
700fd4e5da5Sopenharmony_ci                 spv::Op::OpImageRead,
701fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4,
702fd4e5da5Sopenharmony_ci                  int(spv::ImageOperandsMask::MakeTexelVisibleKHR) |
703fd4e5da5Sopenharmony_ci                      int(spv::ImageOperandsMask::NonPrivateTexelKHR),
704fd4e5da5Sopenharmony_ci                  5})},
705fd4e5da5Sopenharmony_ci            {"%2 = OpImageRead %1 %3 %4 "
706fd4e5da5Sopenharmony_ci             "MakeTexelVisible|NonPrivateTexel|VolatileTexel "
707fd4e5da5Sopenharmony_ci             "%5\n",
708fd4e5da5Sopenharmony_ci             MakeInstruction(
709fd4e5da5Sopenharmony_ci                 spv::Op::OpImageRead,
710fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4,
711fd4e5da5Sopenharmony_ci                  int(spv::ImageOperandsMask::MakeTexelVisibleKHR) |
712fd4e5da5Sopenharmony_ci                      int(spv::ImageOperandsMask::NonPrivateTexelKHR) |
713fd4e5da5Sopenharmony_ci                      int(spv::ImageOperandsMask::VolatileTexelKHR),
714fd4e5da5Sopenharmony_ci                  5})},
715fd4e5da5Sopenharmony_ci
716fd4e5da5Sopenharmony_ci            // Memory semantics ID values are numbers put into a SPIR-V
717fd4e5da5Sopenharmony_ci            // constant integer referenced by Id. There is no token for
718fd4e5da5Sopenharmony_ci            // them, and so no assembler or disassembler support required.
719fd4e5da5Sopenharmony_ci            // Similar for Scope ID.
720fd4e5da5Sopenharmony_ci        })));
721fd4e5da5Sopenharmony_ci
722fd4e5da5Sopenharmony_ci// SPV_GOOGLE_decorate_string
723fd4e5da5Sopenharmony_ci
724fd4e5da5Sopenharmony_ci// Now that OpDecorateString is the preferred spelling for
725fd4e5da5Sopenharmony_ci// OpDecorateStringGOOGLE use that name in round trip tests, and the GOOGLE
726fd4e5da5Sopenharmony_ci// name in an assembly-only test.
727fd4e5da5Sopenharmony_ci
728fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
729fd4e5da5Sopenharmony_ci    SPV_GOOGLE_decorate_string, ExtensionRoundTripTest,
730fd4e5da5Sopenharmony_ci    Combine(
731fd4e5da5Sopenharmony_ci        // We'll get coverage over operand tables by trying the universal
732fd4e5da5Sopenharmony_ci        // environments, and at least one specific environment.
733fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
734fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_0),
735fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
736fd4e5da5Sopenharmony_ci            {"OpDecorateString %1 UserSemantic \"ABC\"\n",
737fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorateStringGOOGLE,
738fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::Decoration::HlslSemanticGOOGLE},
739fd4e5da5Sopenharmony_ci                             MakeVector("ABC"))},
740fd4e5da5Sopenharmony_ci            {"OpDecorateString %1 UserSemantic \"ABC\"\n",
741fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorateString,
742fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::Decoration::UserSemantic},
743fd4e5da5Sopenharmony_ci                             MakeVector("ABC"))},
744fd4e5da5Sopenharmony_ci            {"OpMemberDecorateString %1 3 UserSemantic \"DEF\"\n",
745fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpMemberDecorateStringGOOGLE,
746fd4e5da5Sopenharmony_ci                             {1, 3, (uint32_t)spv::Decoration::UserSemantic},
747fd4e5da5Sopenharmony_ci                             MakeVector("DEF"))},
748fd4e5da5Sopenharmony_ci            {"OpMemberDecorateString %1 3 UserSemantic \"DEF\"\n",
749fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpMemberDecorateString,
750fd4e5da5Sopenharmony_ci                             {1, 3, (uint32_t)spv::Decoration::UserSemantic},
751fd4e5da5Sopenharmony_ci                             MakeVector("DEF"))},
752fd4e5da5Sopenharmony_ci        })));
753fd4e5da5Sopenharmony_ci
754fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
755fd4e5da5Sopenharmony_ci    SPV_GOOGLE_decorate_string, ExtensionAssemblyTest,
756fd4e5da5Sopenharmony_ci    Combine(
757fd4e5da5Sopenharmony_ci        // We'll get coverage over operand tables by trying the universal
758fd4e5da5Sopenharmony_ci        // environments, and at least one specific environment.
759fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
760fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_0),
761fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
762fd4e5da5Sopenharmony_ci            {"OpDecorateStringGOOGLE %1 HlslSemanticGOOGLE \"ABC\"\n",
763fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorateStringGOOGLE,
764fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::Decoration::HlslSemanticGOOGLE},
765fd4e5da5Sopenharmony_ci                             MakeVector("ABC"))},
766fd4e5da5Sopenharmony_ci            {"OpMemberDecorateStringGOOGLE %1 3 HlslSemanticGOOGLE \"DEF\"\n",
767fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpMemberDecorateStringGOOGLE,
768fd4e5da5Sopenharmony_ci                             {1, 3,
769fd4e5da5Sopenharmony_ci                              (uint32_t)spv::Decoration::HlslSemanticGOOGLE},
770fd4e5da5Sopenharmony_ci                             MakeVector("DEF"))},
771fd4e5da5Sopenharmony_ci        })));
772fd4e5da5Sopenharmony_ci
773fd4e5da5Sopenharmony_ci// SPV_GOOGLE_hlsl_functionality1
774fd4e5da5Sopenharmony_ci
775fd4e5da5Sopenharmony_ci// Now that CounterBuffer is the preferred spelling for HlslCounterBufferGOOGLE,
776fd4e5da5Sopenharmony_ci// use that name in round trip tests, and the GOOGLE name in an assembly-only
777fd4e5da5Sopenharmony_ci// test.
778fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
779fd4e5da5Sopenharmony_ci    SPV_GOOGLE_hlsl_functionality1, ExtensionRoundTripTest,
780fd4e5da5Sopenharmony_ci    Combine(
781fd4e5da5Sopenharmony_ci        // We'll get coverage over operand tables by trying the universal
782fd4e5da5Sopenharmony_ci        // environments, and at least one specific environment.
783fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
784fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_0),
785fd4e5da5Sopenharmony_ci        // HlslSemanticGOOGLE is tested in SPV_GOOGLE_decorate_string, since
786fd4e5da5Sopenharmony_ci        // they are coupled together.
787fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
788fd4e5da5Sopenharmony_ci            {"OpDecorateId %1 CounterBuffer %2\n",
789fd4e5da5Sopenharmony_ci             MakeInstruction(
790fd4e5da5Sopenharmony_ci                 spv::Op::OpDecorateId,
791fd4e5da5Sopenharmony_ci                 {1, (uint32_t)spv::Decoration::HlslCounterBufferGOOGLE, 2})},
792fd4e5da5Sopenharmony_ci            {"OpDecorateId %1 CounterBuffer %2\n",
793fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorateId,
794fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::Decoration::CounterBuffer, 2})},
795fd4e5da5Sopenharmony_ci        })));
796fd4e5da5Sopenharmony_ci
797fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
798fd4e5da5Sopenharmony_ci    SPV_GOOGLE_hlsl_functionality1, ExtensionAssemblyTest,
799fd4e5da5Sopenharmony_ci    Combine(
800fd4e5da5Sopenharmony_ci        // We'll get coverage over operand tables by trying the universal
801fd4e5da5Sopenharmony_ci        // environments, and at least one specific environment.
802fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
803fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_VULKAN_1_0),
804fd4e5da5Sopenharmony_ci        // HlslSemanticGOOGLE is tested in SPV_GOOGLE_decorate_string, since
805fd4e5da5Sopenharmony_ci        // they are coupled together.
806fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
807fd4e5da5Sopenharmony_ci            {"OpDecorateId %1 HlslCounterBufferGOOGLE %2\n",
808fd4e5da5Sopenharmony_ci             MakeInstruction(
809fd4e5da5Sopenharmony_ci                 spv::Op::OpDecorateId,
810fd4e5da5Sopenharmony_ci                 {1, (uint32_t)spv::Decoration::HlslCounterBufferGOOGLE, 2})},
811fd4e5da5Sopenharmony_ci        })));
812fd4e5da5Sopenharmony_ci
813fd4e5da5Sopenharmony_ci// SPV_NV_viewport_array2
814fd4e5da5Sopenharmony_ci
815fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
816fd4e5da5Sopenharmony_ci    SPV_NV_viewport_array2, ExtensionRoundTripTest,
817fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
818fd4e5da5Sopenharmony_ci                   SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3,
819fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1),
820fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
821fd4e5da5Sopenharmony_ci                {"OpExtension \"SPV_NV_viewport_array2\"\n",
822fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpExtension,
823fd4e5da5Sopenharmony_ci                                 MakeVector("SPV_NV_viewport_array2"))},
824fd4e5da5Sopenharmony_ci                // The EXT and NV extensions have the same token number for this
825fd4e5da5Sopenharmony_ci                // capability.
826fd4e5da5Sopenharmony_ci                {"OpCapability ShaderViewportIndexLayerEXT\n",
827fd4e5da5Sopenharmony_ci                 MakeInstruction(
828fd4e5da5Sopenharmony_ci                     spv::Op::OpCapability,
829fd4e5da5Sopenharmony_ci                     {(uint32_t)spv::Capability::ShaderViewportIndexLayerNV})},
830fd4e5da5Sopenharmony_ci                // Check the new capability's token number
831fd4e5da5Sopenharmony_ci                {"OpCapability ShaderViewportIndexLayerEXT\n",
832fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpCapability, {5254})},
833fd4e5da5Sopenharmony_ci                // Decorations
834fd4e5da5Sopenharmony_ci                {"OpDecorate %1 ViewportRelativeNV\n",
835fd4e5da5Sopenharmony_ci                 MakeInstruction(
836fd4e5da5Sopenharmony_ci                     spv::Op::OpDecorate,
837fd4e5da5Sopenharmony_ci                     {1, (uint32_t)spv::Decoration::ViewportRelativeNV})},
838fd4e5da5Sopenharmony_ci                {"OpDecorate %1 BuiltIn ViewportMaskNV\n",
839fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpDecorate,
840fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::Decoration::BuiltIn,
841fd4e5da5Sopenharmony_ci                                  (uint32_t)spv::BuiltIn::ViewportMaskNV})},
842fd4e5da5Sopenharmony_ci            })));
843fd4e5da5Sopenharmony_ci
844fd4e5da5Sopenharmony_ci// SPV_NV_shader_subgroup_partitioned
845fd4e5da5Sopenharmony_ci
846fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
847fd4e5da5Sopenharmony_ci    SPV_NV_shader_subgroup_partitioned, ExtensionRoundTripTest,
848fd4e5da5Sopenharmony_ci    Combine(
849fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_1),
850fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
851fd4e5da5Sopenharmony_ci            {"OpExtension \"SPV_NV_shader_subgroup_partitioned\"\n",
852fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExtension,
853fd4e5da5Sopenharmony_ci                             MakeVector("SPV_NV_shader_subgroup_partitioned"))},
854fd4e5da5Sopenharmony_ci            {"OpCapability GroupNonUniformPartitionedNV\n",
855fd4e5da5Sopenharmony_ci             MakeInstruction(
856fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
857fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::GroupNonUniformPartitionedNV})},
858fd4e5da5Sopenharmony_ci            // Check the new capability's token number
859fd4e5da5Sopenharmony_ci            {"OpCapability GroupNonUniformPartitionedNV\n",
860fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5297})},
861fd4e5da5Sopenharmony_ci            {"%2 = OpGroupNonUniformPartitionNV %1 %3\n",
862fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupNonUniformPartitionNV, {1, 2, 3})},
863fd4e5da5Sopenharmony_ci            // Check the new instruction's token number
864fd4e5da5Sopenharmony_ci            {"%2 = OpGroupNonUniformPartitionNV %1 %3\n",
865fd4e5da5Sopenharmony_ci             MakeInstruction(static_cast<spv::Op>(5296), {1, 2, 3})},
866fd4e5da5Sopenharmony_ci            // Check the new group operations
867fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIAdd %1 %3 PartitionedReduceNV %4\n",
868fd4e5da5Sopenharmony_ci             MakeInstruction(
869fd4e5da5Sopenharmony_ci                 spv::Op::OpGroupIAdd,
870fd4e5da5Sopenharmony_ci                 {1, 2, 3, (uint32_t)spv::GroupOperation::PartitionedReduceNV,
871fd4e5da5Sopenharmony_ci                  4})},
872fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIAdd %1 %3 PartitionedReduceNV %4\n",
873fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupIAdd, {1, 2, 3, 6, 4})},
874fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIAdd %1 %3 PartitionedInclusiveScanNV %4\n",
875fd4e5da5Sopenharmony_ci             MakeInstruction(
876fd4e5da5Sopenharmony_ci                 spv::Op::OpGroupIAdd,
877fd4e5da5Sopenharmony_ci                 {1, 2, 3,
878fd4e5da5Sopenharmony_ci                  (uint32_t)spv::GroupOperation::PartitionedInclusiveScanNV,
879fd4e5da5Sopenharmony_ci                  4})},
880fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIAdd %1 %3 PartitionedInclusiveScanNV %4\n",
881fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupIAdd, {1, 2, 3, 7, 4})},
882fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n",
883fd4e5da5Sopenharmony_ci             MakeInstruction(
884fd4e5da5Sopenharmony_ci                 spv::Op::OpGroupIAdd,
885fd4e5da5Sopenharmony_ci                 {1, 2, 3,
886fd4e5da5Sopenharmony_ci                  (uint32_t)spv::GroupOperation::PartitionedExclusiveScanNV,
887fd4e5da5Sopenharmony_ci                  4})},
888fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIAdd %1 %3 PartitionedExclusiveScanNV %4\n",
889fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupIAdd, {1, 2, 3, 8, 4})},
890fd4e5da5Sopenharmony_ci        })));
891fd4e5da5Sopenharmony_ci
892fd4e5da5Sopenharmony_ci// SPV_EXT_descriptor_indexing
893fd4e5da5Sopenharmony_ci
894fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
895fd4e5da5Sopenharmony_ci    SPV_EXT_descriptor_indexing, ExtensionRoundTripTest,
896fd4e5da5Sopenharmony_ci    Combine(
897fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_1,
898fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_2, SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0,
899fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_1),
900fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
901fd4e5da5Sopenharmony_ci            {"OpExtension \"SPV_EXT_descriptor_indexing\"\n",
902fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExtension,
903fd4e5da5Sopenharmony_ci                             MakeVector("SPV_EXT_descriptor_indexing"))},
904fd4e5da5Sopenharmony_ci            // Check capabilities, by name
905fd4e5da5Sopenharmony_ci            {"OpCapability ShaderNonUniform\n",
906fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
907fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::ShaderNonUniformEXT})},
908fd4e5da5Sopenharmony_ci            {"OpCapability RuntimeDescriptorArray\n",
909fd4e5da5Sopenharmony_ci             MakeInstruction(
910fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
911fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::RuntimeDescriptorArrayEXT})},
912fd4e5da5Sopenharmony_ci            {"OpCapability InputAttachmentArrayDynamicIndexing\n",
913fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
914fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
915fd4e5da5Sopenharmony_ci                                  InputAttachmentArrayDynamicIndexingEXT})},
916fd4e5da5Sopenharmony_ci            {"OpCapability UniformTexelBufferArrayDynamicIndexing\n",
917fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
918fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
919fd4e5da5Sopenharmony_ci                                  UniformTexelBufferArrayDynamicIndexingEXT})},
920fd4e5da5Sopenharmony_ci            {"OpCapability StorageTexelBufferArrayDynamicIndexing\n",
921fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
922fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
923fd4e5da5Sopenharmony_ci                                  StorageTexelBufferArrayDynamicIndexingEXT})},
924fd4e5da5Sopenharmony_ci            {"OpCapability UniformBufferArrayNonUniformIndexing\n",
925fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
926fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
927fd4e5da5Sopenharmony_ci                                  UniformBufferArrayNonUniformIndexingEXT})},
928fd4e5da5Sopenharmony_ci            {"OpCapability SampledImageArrayNonUniformIndexing\n",
929fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
930fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
931fd4e5da5Sopenharmony_ci                                  SampledImageArrayNonUniformIndexingEXT})},
932fd4e5da5Sopenharmony_ci            {"OpCapability StorageBufferArrayNonUniformIndexing\n",
933fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
934fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
935fd4e5da5Sopenharmony_ci                                  StorageBufferArrayNonUniformIndexingEXT})},
936fd4e5da5Sopenharmony_ci            {"OpCapability StorageImageArrayNonUniformIndexing\n",
937fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
938fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
939fd4e5da5Sopenharmony_ci                                  StorageImageArrayNonUniformIndexingEXT})},
940fd4e5da5Sopenharmony_ci            {"OpCapability InputAttachmentArrayNonUniformIndexing\n",
941fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
942fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::
943fd4e5da5Sopenharmony_ci                                  InputAttachmentArrayNonUniformIndexingEXT})},
944fd4e5da5Sopenharmony_ci            {"OpCapability UniformTexelBufferArrayNonUniformIndexing\n",
945fd4e5da5Sopenharmony_ci             MakeInstruction(
946fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
947fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::
948fd4e5da5Sopenharmony_ci                      UniformTexelBufferArrayNonUniformIndexingEXT})},
949fd4e5da5Sopenharmony_ci            {"OpCapability StorageTexelBufferArrayNonUniformIndexing\n",
950fd4e5da5Sopenharmony_ci             MakeInstruction(
951fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
952fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::
953fd4e5da5Sopenharmony_ci                      StorageTexelBufferArrayNonUniformIndexingEXT})},
954fd4e5da5Sopenharmony_ci            // Check capabilities, by number
955fd4e5da5Sopenharmony_ci            {"OpCapability ShaderNonUniform\n",
956fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5301})},
957fd4e5da5Sopenharmony_ci            {"OpCapability RuntimeDescriptorArray\n",
958fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5302})},
959fd4e5da5Sopenharmony_ci            {"OpCapability InputAttachmentArrayDynamicIndexing\n",
960fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5303})},
961fd4e5da5Sopenharmony_ci            {"OpCapability UniformTexelBufferArrayDynamicIndexing\n",
962fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5304})},
963fd4e5da5Sopenharmony_ci            {"OpCapability StorageTexelBufferArrayDynamicIndexing\n",
964fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5305})},
965fd4e5da5Sopenharmony_ci            {"OpCapability UniformBufferArrayNonUniformIndexing\n",
966fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5306})},
967fd4e5da5Sopenharmony_ci            {"OpCapability SampledImageArrayNonUniformIndexing\n",
968fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5307})},
969fd4e5da5Sopenharmony_ci            {"OpCapability StorageBufferArrayNonUniformIndexing\n",
970fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5308})},
971fd4e5da5Sopenharmony_ci            {"OpCapability StorageImageArrayNonUniformIndexing\n",
972fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5309})},
973fd4e5da5Sopenharmony_ci            {"OpCapability InputAttachmentArrayNonUniformIndexing\n",
974fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5310})},
975fd4e5da5Sopenharmony_ci            {"OpCapability UniformTexelBufferArrayNonUniformIndexing\n",
976fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5311})},
977fd4e5da5Sopenharmony_ci            {"OpCapability StorageTexelBufferArrayNonUniformIndexing\n",
978fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability, {5312})},
979fd4e5da5Sopenharmony_ci
980fd4e5da5Sopenharmony_ci            // Check the decoration token
981fd4e5da5Sopenharmony_ci            {"OpDecorate %1 NonUniform\n",
982fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate,
983fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::Decoration::NonUniformEXT})},
984fd4e5da5Sopenharmony_ci            {"OpDecorate %1 NonUniform\n",
985fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDecorate, {1, 5300})},
986fd4e5da5Sopenharmony_ci        })));
987fd4e5da5Sopenharmony_ci
988fd4e5da5Sopenharmony_ci// SPV_KHR_linkonce_odr
989fd4e5da5Sopenharmony_ci
990fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
991fd4e5da5Sopenharmony_ci    SPV_KHR_linkonce_odr, ExtensionRoundTripTest,
992fd4e5da5Sopenharmony_ci    Combine(
993fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_3, SPV_ENV_VULKAN_1_0,
994fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2),
995fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
996fd4e5da5Sopenharmony_ci            {"OpExtension \"SPV_KHR_linkonce_odr\"\n",
997fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExtension,
998fd4e5da5Sopenharmony_ci                             MakeVector("SPV_KHR_linkonce_odr"))},
999fd4e5da5Sopenharmony_ci            {"OpDecorate %1 LinkageAttributes \"foobar\" LinkOnceODR\n",
1000fd4e5da5Sopenharmony_ci             MakeInstruction(
1001fd4e5da5Sopenharmony_ci                 spv::Op::OpDecorate,
1002fd4e5da5Sopenharmony_ci                 Concatenate({{1, (uint32_t)spv::Decoration::LinkageAttributes},
1003fd4e5da5Sopenharmony_ci                              MakeVector("foobar"),
1004fd4e5da5Sopenharmony_ci                              {(uint32_t)spv::LinkageType::LinkOnceODR}}))},
1005fd4e5da5Sopenharmony_ci        })));
1006fd4e5da5Sopenharmony_ci
1007fd4e5da5Sopenharmony_ci// SPV_KHR_expect_assume
1008fd4e5da5Sopenharmony_ci
1009fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1010fd4e5da5Sopenharmony_ci    SPV_KHR_expect_assume, ExtensionRoundTripTest,
1011fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_3,
1012fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2),
1013fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
1014fd4e5da5Sopenharmony_ci                {"OpExtension \"SPV_KHR_expect_assume\"\n",
1015fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpExtension,
1016fd4e5da5Sopenharmony_ci                                 MakeVector("SPV_KHR_expect_assume"))},
1017fd4e5da5Sopenharmony_ci                {"OpAssumeTrueKHR %1\n",
1018fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpAssumeTrueKHR, {1})}})));
1019fd4e5da5Sopenharmony_ci// SPV_KHR_subgroup_uniform_control_flow
1020fd4e5da5Sopenharmony_ci
1021fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1022fd4e5da5Sopenharmony_ci    SPV_KHR_subgroup_uniform_control_flow, ExtensionRoundTripTest,
1023fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_3,
1024fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2),
1025fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
1026fd4e5da5Sopenharmony_ci                {"OpExtension \"SPV_KHR_subgroup_uniform_control_flow\"\n",
1027fd4e5da5Sopenharmony_ci                 MakeInstruction(
1028fd4e5da5Sopenharmony_ci                     spv::Op::OpExtension,
1029fd4e5da5Sopenharmony_ci                     MakeVector("SPV_KHR_subgroup_uniform_control_flow"))},
1030fd4e5da5Sopenharmony_ci                {"OpExecutionMode %1 SubgroupUniformControlFlowKHR\n",
1031fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpExecutionMode,
1032fd4e5da5Sopenharmony_ci                                 {1, (uint32_t)spv::ExecutionMode::
1033fd4e5da5Sopenharmony_ci                                         SubgroupUniformControlFlowKHR})},
1034fd4e5da5Sopenharmony_ci            })));
1035fd4e5da5Sopenharmony_ci
1036fd4e5da5Sopenharmony_ci// SPV_KHR_integer_dot_product
1037fd4e5da5Sopenharmony_ci
1038fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1039fd4e5da5Sopenharmony_ci    SPV_KHR_integer_dot_product, ExtensionRoundTripTest,
1040fd4e5da5Sopenharmony_ci    Combine(
1041fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5,
1042fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1,
1043fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3),
1044fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
1045fd4e5da5Sopenharmony_ci            {"OpExtension \"SPV_KHR_integer_dot_product\"\n",
1046fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExtension,
1047fd4e5da5Sopenharmony_ci                             MakeVector("SPV_KHR_integer_dot_product"))},
1048fd4e5da5Sopenharmony_ci            {"OpCapability DotProductInputAll\n",
1049fd4e5da5Sopenharmony_ci             MakeInstruction(
1050fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1051fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::DotProductInputAllKHR})},
1052fd4e5da5Sopenharmony_ci            {"OpCapability DotProductInput4x8Bit\n",
1053fd4e5da5Sopenharmony_ci             MakeInstruction(
1054fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1055fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::DotProductInput4x8BitKHR})},
1056fd4e5da5Sopenharmony_ci            {"OpCapability DotProductInput4x8BitPacked\n",
1057fd4e5da5Sopenharmony_ci             MakeInstruction(
1058fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1059fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::DotProductInput4x8BitPackedKHR})},
1060fd4e5da5Sopenharmony_ci            {"OpCapability DotProduct\n",
1061fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpCapability,
1062fd4e5da5Sopenharmony_ci                             {(uint32_t)spv::Capability::DotProductKHR})},
1063fd4e5da5Sopenharmony_ci            {"%2 = OpSDot %1 %3 %4\n",
1064fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSDotKHR, {1, 2, 3, 4})},
1065fd4e5da5Sopenharmony_ci            {"%2 = OpSDot %1 %3 %4 PackedVectorFormat4x8Bit\n",
1066fd4e5da5Sopenharmony_ci             MakeInstruction(
1067fd4e5da5Sopenharmony_ci                 spv::Op::OpSDotKHR,
1068fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4,
1069fd4e5da5Sopenharmony_ci                  (uint32_t)
1070fd4e5da5Sopenharmony_ci                      spv::PackedVectorFormat::PackedVectorFormat4x8BitKHR})},
1071fd4e5da5Sopenharmony_ci            {"%2 = OpUDot %1 %3 %4\n",
1072fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpUDotKHR, {1, 2, 3, 4})},
1073fd4e5da5Sopenharmony_ci            {"%2 = OpUDot %1 %3 %4 PackedVectorFormat4x8Bit\n",
1074fd4e5da5Sopenharmony_ci             MakeInstruction(
1075fd4e5da5Sopenharmony_ci                 spv::Op::OpUDotKHR,
1076fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4,
1077fd4e5da5Sopenharmony_ci                  (uint32_t)
1078fd4e5da5Sopenharmony_ci                      spv::PackedVectorFormat::PackedVectorFormat4x8BitKHR})},
1079fd4e5da5Sopenharmony_ci            {"%2 = OpSUDot %1 %3 %4\n",
1080fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSUDotKHR, {1, 2, 3, 4})},
1081fd4e5da5Sopenharmony_ci            {"%2 = OpSUDot %1 %3 %4 PackedVectorFormat4x8Bit\n",
1082fd4e5da5Sopenharmony_ci             MakeInstruction(
1083fd4e5da5Sopenharmony_ci                 spv::Op::OpSUDotKHR,
1084fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4,
1085fd4e5da5Sopenharmony_ci                  (uint32_t)
1086fd4e5da5Sopenharmony_ci                      spv::PackedVectorFormat::PackedVectorFormat4x8BitKHR})},
1087fd4e5da5Sopenharmony_ci            {"%2 = OpSDotAccSat %1 %3 %4 %5\n",
1088fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSDotAccSatKHR, {1, 2, 3, 4, 5})},
1089fd4e5da5Sopenharmony_ci            {"%2 = OpSDotAccSat %1 %3 %4 %5 PackedVectorFormat4x8Bit\n",
1090fd4e5da5Sopenharmony_ci             MakeInstruction(
1091fd4e5da5Sopenharmony_ci                 spv::Op::OpSDotAccSatKHR,
1092fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4, 5,
1093fd4e5da5Sopenharmony_ci                  (uint32_t)
1094fd4e5da5Sopenharmony_ci                      spv::PackedVectorFormat::PackedVectorFormat4x8BitKHR})},
1095fd4e5da5Sopenharmony_ci            {"%2 = OpUDotAccSat %1 %3 %4 %5\n",
1096fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpUDotAccSatKHR, {1, 2, 3, 4, 5})},
1097fd4e5da5Sopenharmony_ci            {"%2 = OpUDotAccSat %1 %3 %4 %5 PackedVectorFormat4x8Bit\n",
1098fd4e5da5Sopenharmony_ci             MakeInstruction(
1099fd4e5da5Sopenharmony_ci                 spv::Op::OpUDotAccSatKHR,
1100fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4, 5,
1101fd4e5da5Sopenharmony_ci                  (uint32_t)
1102fd4e5da5Sopenharmony_ci                      spv::PackedVectorFormat::PackedVectorFormat4x8BitKHR})},
1103fd4e5da5Sopenharmony_ci            {"%2 = OpSUDotAccSat %1 %3 %4 %5\n",
1104fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpSUDotAccSatKHR, {1, 2, 3, 4, 5})},
1105fd4e5da5Sopenharmony_ci            {"%2 = OpSUDotAccSat %1 %3 %4 %5 PackedVectorFormat4x8Bit\n",
1106fd4e5da5Sopenharmony_ci             MakeInstruction(
1107fd4e5da5Sopenharmony_ci                 spv::Op::OpSUDotAccSatKHR,
1108fd4e5da5Sopenharmony_ci                 {1, 2, 3, 4, 5,
1109fd4e5da5Sopenharmony_ci                  (uint32_t)
1110fd4e5da5Sopenharmony_ci                      spv::PackedVectorFormat::PackedVectorFormat4x8BitKHR})},
1111fd4e5da5Sopenharmony_ci        })));
1112fd4e5da5Sopenharmony_ci
1113fd4e5da5Sopenharmony_ci// SPV_KHR_bit_instructions
1114fd4e5da5Sopenharmony_ci
1115fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1116fd4e5da5Sopenharmony_ci    SPV_KHR_bit_instructions, ExtensionRoundTripTest,
1117fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5,
1118fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2),
1119fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
1120fd4e5da5Sopenharmony_ci                {"OpExtension \"SPV_KHR_bit_instructions\"\n",
1121fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpExtension,
1122fd4e5da5Sopenharmony_ci                                 MakeVector("SPV_KHR_bit_instructions"))},
1123fd4e5da5Sopenharmony_ci                {"OpCapability BitInstructions\n",
1124fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpCapability,
1125fd4e5da5Sopenharmony_ci                                 {(uint32_t)spv::Capability::BitInstructions})},
1126fd4e5da5Sopenharmony_ci            })));
1127fd4e5da5Sopenharmony_ci
1128fd4e5da5Sopenharmony_ci// SPV_KHR_uniform_group_instructions
1129fd4e5da5Sopenharmony_ci
1130fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1131fd4e5da5Sopenharmony_ci    SPV_KHR_uniform_group_instructions, ExtensionRoundTripTest,
1132fd4e5da5Sopenharmony_ci    Combine(
1133fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5,
1134fd4e5da5Sopenharmony_ci               SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1,
1135fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3),
1136fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
1137fd4e5da5Sopenharmony_ci            {"OpExtension \"SPV_KHR_uniform_group_instructions\"\n",
1138fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExtension,
1139fd4e5da5Sopenharmony_ci                             MakeVector("SPV_KHR_uniform_group_instructions"))},
1140fd4e5da5Sopenharmony_ci            {"OpCapability GroupUniformArithmeticKHR\n",
1141fd4e5da5Sopenharmony_ci             MakeInstruction(
1142fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1143fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::GroupUniformArithmeticKHR})},
1144fd4e5da5Sopenharmony_ci            {"%2 = OpGroupIMulKHR %1 %3 Reduce %4\n",
1145fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupIMulKHR,
1146fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1147fd4e5da5Sopenharmony_ci                              4})},
1148fd4e5da5Sopenharmony_ci            {"%2 = OpGroupFMulKHR %1 %3 Reduce %4\n",
1149fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupFMulKHR,
1150fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1151fd4e5da5Sopenharmony_ci                              4})},
1152fd4e5da5Sopenharmony_ci            {"%2 = OpGroupBitwiseAndKHR %1 %3 Reduce %4\n",
1153fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupBitwiseAndKHR,
1154fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1155fd4e5da5Sopenharmony_ci                              4})},
1156fd4e5da5Sopenharmony_ci            {"%2 = OpGroupBitwiseOrKHR %1 %3 Reduce %4\n",
1157fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupBitwiseOrKHR,
1158fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1159fd4e5da5Sopenharmony_ci                              4})},
1160fd4e5da5Sopenharmony_ci            {"%2 = OpGroupBitwiseXorKHR %1 %3 Reduce %4\n",
1161fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupBitwiseXorKHR,
1162fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1163fd4e5da5Sopenharmony_ci                              4})},
1164fd4e5da5Sopenharmony_ci            {"%2 = OpGroupLogicalAndKHR %1 %3 Reduce %4\n",
1165fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupLogicalAndKHR,
1166fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1167fd4e5da5Sopenharmony_ci                              4})},
1168fd4e5da5Sopenharmony_ci            {"%2 = OpGroupLogicalOrKHR %1 %3 Reduce %4\n",
1169fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupLogicalOrKHR,
1170fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1171fd4e5da5Sopenharmony_ci                              4})},
1172fd4e5da5Sopenharmony_ci            {"%2 = OpGroupLogicalXorKHR %1 %3 Reduce %4\n",
1173fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpGroupLogicalXorKHR,
1174fd4e5da5Sopenharmony_ci                             {1, 2, 3, (uint32_t)spv::GroupOperation::Reduce,
1175fd4e5da5Sopenharmony_ci                              4})},
1176fd4e5da5Sopenharmony_ci        })));
1177fd4e5da5Sopenharmony_ci
1178fd4e5da5Sopenharmony_ci// SPV_KHR_subgroup_rotate
1179fd4e5da5Sopenharmony_ci
1180fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1181fd4e5da5Sopenharmony_ci    SPV_KHR_subgroup_rotate, ExtensionRoundTripTest,
1182fd4e5da5Sopenharmony_ci    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_6,
1183fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2,
1184fd4e5da5Sopenharmony_ci                   SPV_ENV_VULKAN_1_3, SPV_ENV_OPENCL_2_1),
1185fd4e5da5Sopenharmony_ci            ValuesIn(std::vector<AssemblyCase>{
1186fd4e5da5Sopenharmony_ci                {"OpExtension \"SPV_KHR_subgroup_rotate\"\n",
1187fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpExtension,
1188fd4e5da5Sopenharmony_ci                                 MakeVector("SPV_KHR_subgroup_rotate"))},
1189fd4e5da5Sopenharmony_ci                {"OpCapability GroupNonUniformRotateKHR\n",
1190fd4e5da5Sopenharmony_ci                 MakeInstruction(
1191fd4e5da5Sopenharmony_ci                     spv::Op::OpCapability,
1192fd4e5da5Sopenharmony_ci                     {(uint32_t)spv::Capability::GroupNonUniformRotateKHR})},
1193fd4e5da5Sopenharmony_ci                {"%2 = OpGroupNonUniformRotateKHR %1 %3 %4 %5\n",
1194fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpGroupNonUniformRotateKHR,
1195fd4e5da5Sopenharmony_ci                                 {1, 2, 3, 4, 5})},
1196fd4e5da5Sopenharmony_ci                {"%2 = OpGroupNonUniformRotateKHR %1 %3 %4 %5 %6\n",
1197fd4e5da5Sopenharmony_ci                 MakeInstruction(spv::Op::OpGroupNonUniformRotateKHR,
1198fd4e5da5Sopenharmony_ci                                 {1, 2, 3, 4, 5, 6})},
1199fd4e5da5Sopenharmony_ci            })));
1200fd4e5da5Sopenharmony_ci
1201fd4e5da5Sopenharmony_ci// SPV_EXT_shader_tile_image
1202fd4e5da5Sopenharmony_ci
1203fd4e5da5Sopenharmony_ciINSTANTIATE_TEST_SUITE_P(
1204fd4e5da5Sopenharmony_ci    SPV_EXT_shader_tile_image, ExtensionRoundTripTest,
1205fd4e5da5Sopenharmony_ci    Combine(
1206fd4e5da5Sopenharmony_ci        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5, SPV_ENV_VULKAN_1_0,
1207fd4e5da5Sopenharmony_ci               SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3),
1208fd4e5da5Sopenharmony_ci        ValuesIn(std::vector<AssemblyCase>{
1209fd4e5da5Sopenharmony_ci            {"OpExtension \"SPV_EXT_shader_tile_image\"\n",
1210fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExtension,
1211fd4e5da5Sopenharmony_ci                             MakeVector("SPV_EXT_shader_tile_image"))},
1212fd4e5da5Sopenharmony_ci            {"OpCapability TileImageColorReadAccessEXT\n",
1213fd4e5da5Sopenharmony_ci             MakeInstruction(
1214fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1215fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::TileImageColorReadAccessEXT})},
1216fd4e5da5Sopenharmony_ci            {"OpCapability TileImageDepthReadAccessEXT\n",
1217fd4e5da5Sopenharmony_ci             MakeInstruction(
1218fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1219fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::TileImageDepthReadAccessEXT})},
1220fd4e5da5Sopenharmony_ci            {"OpCapability TileImageStencilReadAccessEXT\n",
1221fd4e5da5Sopenharmony_ci             MakeInstruction(
1222fd4e5da5Sopenharmony_ci                 spv::Op::OpCapability,
1223fd4e5da5Sopenharmony_ci                 {(uint32_t)spv::Capability::TileImageStencilReadAccessEXT})},
1224fd4e5da5Sopenharmony_ci            {"OpExecutionMode %1 NonCoherentColorAttachmentReadEXT\n",
1225fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExecutionMode,
1226fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::ExecutionMode::
1227fd4e5da5Sopenharmony_ci                                     NonCoherentColorAttachmentReadEXT})},
1228fd4e5da5Sopenharmony_ci            {"OpExecutionMode %1 NonCoherentDepthAttachmentReadEXT\n",
1229fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExecutionMode,
1230fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::ExecutionMode::
1231fd4e5da5Sopenharmony_ci                                     NonCoherentDepthAttachmentReadEXT})},
1232fd4e5da5Sopenharmony_ci            {"OpExecutionMode %1 NonCoherentStencilAttachmentReadEXT\n",
1233fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpExecutionMode,
1234fd4e5da5Sopenharmony_ci                             {1, (uint32_t)spv::ExecutionMode::
1235fd4e5da5Sopenharmony_ci                                     NonCoherentStencilAttachmentReadEXT})},
1236fd4e5da5Sopenharmony_ci            {"%2 = OpColorAttachmentReadEXT %1 %3\n",
1237fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpColorAttachmentReadEXT, {1, 2, 3})},
1238fd4e5da5Sopenharmony_ci            {"%2 = OpColorAttachmentReadEXT %1 %3 %4\n",
1239fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpColorAttachmentReadEXT, {1, 2, 3, 4})},
1240fd4e5da5Sopenharmony_ci            {"%2 = OpDepthAttachmentReadEXT %1\n",
1241fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDepthAttachmentReadEXT, {1, 2})},
1242fd4e5da5Sopenharmony_ci            {"%2 = OpDepthAttachmentReadEXT %1 %3\n",
1243fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpDepthAttachmentReadEXT, {1, 2, 3})},
1244fd4e5da5Sopenharmony_ci            {"%2 = OpStencilAttachmentReadEXT %1\n",
1245fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpStencilAttachmentReadEXT, {1, 2})},
1246fd4e5da5Sopenharmony_ci            {"%2 = OpStencilAttachmentReadEXT %1 %3\n",
1247fd4e5da5Sopenharmony_ci             MakeInstruction(spv::Op::OpStencilAttachmentReadEXT, {1, 2, 3})},
1248fd4e5da5Sopenharmony_ci        })));
1249fd4e5da5Sopenharmony_ci
1250fd4e5da5Sopenharmony_ci}  // namespace
1251fd4e5da5Sopenharmony_ci}  // namespace spvtools
1252