SPV_CORE10_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/spirv.core.grammar.json
SPV_CORE11_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.1/spirv.core.grammar.json
SPV_CORE12_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/spirv.core.grammar.json
-SPV_GLSL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/extinst.glsl.std.450.grammar.json
-SPV_OPENCL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/extinst.opencl.std.100.grammar.json
+SPV_GLSL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/extinst.glsl.std.450.grammar.json
+SPV_OPENCL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/extinst.opencl.std.100.grammar.json
define gen_spvtools_grammar_tables
$(call generate-file-dir,$(1)/core.insts-1.0.inc)
-$(1)/core.insts-1.0.inc $(1)/operand.kinds-1.0.inc $(1)/glsl.std.450.insts-1.0.inc $(1)/opencl.std.insts-1.0.inc: \
+$(1)/core.insts-1.0.inc $(1)/operand.kinds-1.0.inc $(1)/glsl.std.450.insts.inc $(1)/opencl.std.insts.inc: \
$(LOCAL_PATH)/utils/generate_grammar_tables.py \
$(SPV_CORE10_GRAMMAR) \
$(SPV_GLSL_GRAMMAR) \
--extinst-glsl-grammar=$(SPV_GLSL_GRAMMAR) \
--extinst-opencl-grammar=$(SPV_OPENCL_GRAMMAR) \
--core-insts-output=$(1)/core.insts-1.0.inc \
- --glsl-insts-output=$(1)/glsl.std.450.insts-1.0.inc \
- --opencl-insts-output=$(1)/opencl.std.insts-1.0.inc \
+ --glsl-insts-output=$(1)/glsl.std.450.insts.inc \
+ --opencl-insts-output=$(1)/opencl.std.insts.inc \
--operand-kinds-output=$(1)/operand.kinds-1.0.inc
@echo "[$(TARGET_ARCH_ABI)] Grammar v1.0 : instructions & operands <= grammar JSON files"
$(1)/core.insts-1.1.inc $(1)/operand.kinds-1.1.inc: \
@echo "[$(TARGET_ARCH_ABI)] Grammar v1.2 : instructions & operands <= grammar JSON files"
$(LOCAL_PATH)/source/opcode.cpp: $(1)/core.insts-1.0.inc $(1)/core.insts-1.1.inc $(1)/core.insts-1.2.inc
$(LOCAL_PATH)/source/operand.cpp: $(1)/operand.kinds-1.0.inc $(1)/operand.kinds-1.1.inc $(1)/operand.kinds-1.2.inc
-$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/glsl.std.450.insts-1.0.inc $(1)/opencl.std.insts-1.0.inc
+$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/glsl.std.450.insts.inc $(1)/opencl.std.insts.inc
endef
$(eval $(call gen_spvtools_grammar_tables,$(SPVTOOLS_OUT_PATH)))
macro(spvtools_glsl_tables VERSION)
set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json")
set(GLSL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.glsl.std.450.grammar.json")
- set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/glsl.std.450.insts-${VERSION}.inc")
+ set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/glsl.std.450.insts.inc")
add_custom_command(OUTPUT ${GRAMMAR_INC_FILE}
COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT}
--spirv-core-grammar=${CORE_GRAMMAR_JSON_FILE}
macro(spvtools_opencl_tables VERSION)
set(CORE_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/spirv.core.grammar.json")
set(OPENCL_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/${VERSION}/extinst.opencl.std.100.grammar.json")
- set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/opencl.std.insts-${VERSION}.inc")
+ set(GRAMMAR_INC_FILE "${spirv-tools_BINARY_DIR}/opencl.std.insts.inc")
add_custom_command(OUTPUT ${GRAMMAR_INC_FILE}
COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT}
--spirv-core-grammar=${CORE_GRAMMAR_JSON_FILE}
spvtools_core_tables("1.1")
spvtools_core_tables("1.2")
spvtools_enum_string_mapping("1.2")
-spvtools_opencl_tables("1.0")
-spvtools_glsl_tables("1.0")
+spvtools_opencl_tables("1.2")
+spvtools_glsl_tables("1.2")
spvtools_vendor_tables("spv-amd-shader-explicit-vertex-parameter")
spvtools_vendor_tables("spv-amd-shader-trinary-minmax")
spvtools_vendor_tables("spv-amd-gcn-shader")
${CMAKE_CURRENT_SOURCE_DIR}/extensions.h
${CMAKE_CURRENT_SOURCE_DIR}/id_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/instruction.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/latest_version_glsl_std_450_header.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/latest_version_opencl_std_header.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/latest_version_spirv_header.h
${CMAKE_CURRENT_SOURCE_DIR}/macro.h
${CMAKE_CURRENT_SOURCE_DIR}/name_mapper.h
${CMAKE_CURRENT_SOURCE_DIR}/opcode.h
#ifndef LIBSPIRV_ASSEMBLY_GRAMMAR_H_
#define LIBSPIRV_ASSEMBLY_GRAMMAR_H_
+#include "latest_version_spirv_header.h"
#include "operand.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
#include "table.h"
namespace libspirv {
#include <unordered_set>
#include <vector>
-#include "spirv/1.2/GLSL.std.450.h"
-#include "spirv/1.2/OpenCL.std.h"
-#include "spirv/1.2/spirv.h"
+#include "latest_version_glsl_std_450_header.h"
+#include "latest_version_opencl_std_header.h"
+#include "latest_version_spirv_header.h"
#include "binary.h"
#include "diagnostic.h"
#include <unordered_set>
#include <vector>
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
#include "util/huffman_codec.h"
namespace spvtools {
#include <set>
#include <utility>
-#include "spirv/1.2/spirv.h"
+#include "latest_version_spirv_header.h"
namespace libspirv {
#include <cassert>
#include <cstring>
-#include "spirv/1.0/GLSL.std.450.h"
-#include "spirv/1.0/OpenCL.std.h"
+#include "latest_version_glsl_std_450_header.h"
+#include "latest_version_opencl_std_header.h"
#include "spirv_definition.h"
#include "macro.h"
-#include "glsl.std.450.insts-1.0.inc" // defines glsl_entries
-#include "opencl.std.insts-1.0.inc" // defines opencl_entries
+#include "glsl.std.450.insts.inc" // defines glsl_entries
+#include "opencl.std.insts.inc" // defines opencl_entries
#include "spv-amd-gcn-shader.insts.inc"
#include "spv-amd-shader-ballot.insts.inc"
#include <cstdint>
#include <vector>
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
// Describes an instruction.
struct spv_instruction_t {
--- /dev/null
+// Copyright (c) 2017 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_
+#define LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_
+
+#include "spirv/1.2/GLSL.std.450.h"
+
+#endif // LIBSPIRV_LATEST_VERSION_GLSL_STD_450_HEADER_H_
--- /dev/null
+// Copyright (c) 2017 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_
+#define LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_
+
+#include "spirv/1.2/OpenCL.std.h"
+
+#endif // LIBSPIRV_LATEST_VERSION_OPENCL_STD_HEADER_H_
--- /dev/null
+// Copyright (c) 2017 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_
+#define LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_
+
+#include "spirv/1.2/spirv.h"
+
+#endif // LIBSPIRV_LATEST_VERSION_SPIRV_HEADER_H_
#define LIBSPIRV_OPCODE_H_
#include "instruction.h"
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
#include "table.h"
// Returns the name of a registered SPIR-V generator as a null-terminated
#include "cfa.h"
#include "iterator.h"
-#include "spirv/1.0/GLSL.std.450.h"
+#include "latest_version_glsl_std_450_header.h"
#include <stack>
#include "operand.h"
#include "util/ilist_node.h"
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
namespace spvtools {
namespace ir {
#include "operand.h"
#include "util/ilist.h"
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
namespace spvtools {
namespace ir {
// Runs the given function |f| on the instructions in the list and optionally
// on the preceding debug line instructions.
- inline void ForEachInst(
- const std::function<void(Instruction*)>& f,
- bool run_on_debug_line_insts) {
+ inline void ForEachInst(const std::function<void(Instruction*)>& f,
+ bool run_on_debug_line_insts) {
auto next = begin();
- for( auto i = next; i != end(); i = next ) {
+ for (auto i = next; i != end(); i = next) {
++next;
i->ForEachInst(f, run_on_debug_line_insts);
}
// limitations under the License.
#include "ir_context.h"
+#include "latest_version_glsl_std_450_header.h"
#include "log.h"
#include "mem_pass.h"
-#include "spirv/1.0/GLSL.std.450.h"
#include <cstring>
#include "cfa.h"
#include "iterator.h"
-#include "spirv/1.0/GLSL.std.450.h"
+#include "latest_version_glsl_std_450_header.h"
namespace spvtools {
namespace opt {
#ifndef LIBSPIRV_OPT_REFLECT_H_
#define LIBSPIRV_OPT_REFLECT_H_
-#include "spirv/1.2/spirv.h"
+#include "latest_version_spirv_header.h"
namespace spvtools {
namespace ir {
#include <unordered_map>
#include <vector>
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
namespace spvtools {
namespace opt {
#ifndef LIBSPIRV_SPIRV_CONSTANT_H_
#define LIBSPIRV_SPIRV_CONSTANT_H_
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
// Version number macros.
#include <cstdint>
-#include "spirv/1.2/spirv.h"
+#include "latest_version_spirv_header.h"
#define spvIsInBitfield(value, bitfield) ((value) == ((value)&bitfield))
#ifndef LIBSPIRV_TABLE_H_
#define LIBSPIRV_TABLE_H_
-#include "spirv/1.2/spirv.h"
+#include "latest_version_spirv_header.h"
#include "extensions.h"
#include "message.h"
#ifndef LIBSPIRV_VAL_BASICBLOCK_H_
#define LIBSPIRV_VAL_BASICBLOCK_H_
-#include "spirv/1.2/spirv.h"
+#include "latest_version_spirv_header.h"
#include <cstdint>
#include <unordered_map>
#include <vector>
-#include "spirv/1.2/spirv.h"
+#include "latest_version_spirv_header.h"
namespace libspirv {
#include <unordered_set>
#include <vector>
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
#include "val/basic_block.h"
#include "val/construct.h"
#include "decoration.h"
#include "diagnostic.h"
#include "enum_set.h"
+#include "latest_version_spirv_header.h"
#include "spirv-tools/libspirv.h"
-#include "spirv/1.2/spirv.h"
#include "spirv_definition.h"
#include "val/function.h"
#include "val/instruction.h"
#include <vector>
#include "gmock/gmock.h"
+#include "latest_version_opencl_std_header.h"
#include "source/message.h"
#include "source/table.h"
-#include "spirv/1.0/OpenCL.std.h"
#include "test_fixture.h"
#include "unit_spirv.h"
#include <algorithm>
#include <vector>
-#include "spirv/1.0/GLSL.std.450.h"
+#include "latest_version_glsl_std_450_header.h"
#include "unit_spirv.h"
namespace {
#include "unit_spirv.h"
#include <gmock/gmock.h>
-#include "spirv/1.0/OpenCL.std.h"
+#include "latest_version_opencl_std_header.h"
#include "test_fixture.h"
namespace {
#include <sstream>
#include <string>
-#include "spirv/1.1/spirv.h"
+#include "latest_version_spirv_header.h"
#include "test_fixture.h"
#include "tools/stats/stats_analyzer.h"
#include "unit_spirv.h"
#include "gmock/gmock.h"
-#include "spirv/1.0/GLSL.std.450.h"
-#include "spirv/1.0/OpenCL.std.h"
+#include "latest_version_glsl_std_450_header.h"
+#include "latest_version_opencl_std_header.h"
#include "test_fixture.h"
namespace {
#include <vector>
#include "gtest/gtest.h"
-#include "spirv/1.1/spirv.h"
+#include "latest_version_spirv_header.h"
#include "enum_set.h"
#include "extensions.h"