diff options
author | David Neto <dneto@google.com> | 2019-12-20 01:16:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-20 01:16:26 +0300 |
commit | 64f36ea5296ec023f65f75d72196d3ff7ae7c7b2 (patch) | |
tree | eba5f65c03b145f17eaca9fa48ac8f791a20c052 /build_defs.bzl | |
parent | e01bc6d4e8467ecd92d1b57a4aca700788108275 (diff) |
Support OpenCL.DebugInfo.100 extended instruction set (#3080)
* Clone opencl.debuginfo.100 grammar from debuginfo grammar
Update version number to 200 revision 2
* Apply content from OpenCL.DebugInfo.100 extension text
* Rename grammar file
* Support OpenCL.DebugInfo.100 extended instructions
Add support for prefixing operand type names, to disambiguate
them between different instruction sets.
* Add tests for OpenCL.DebugInfo.100
* Support lookup of OpenCL.DebugInfo.100 extinst
* Add tests for enum values
* Recognize 2017-2019 as copyright date range
* Android.mk: support OpenCL.DebugInfo.100 extended instruction set
Also, stop generating core instruction tables for non-unified1 versions
of the grammar.
* Imported entity operand type is concrete
* Bazel: Suppoort OpenCL.DebugInfo.100
* BUILD.gn: Support OpenCL.DebugInfo.100
Diffstat (limited to 'build_defs.bzl')
-rw-r--r-- | build_defs.bzl | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/build_defs.bzl b/build_defs.bzl index 483fd2ae3..5d913a14c 100644 --- a/build_defs.bzl +++ b/build_defs.bzl @@ -40,6 +40,7 @@ TEST_COPTS = COMMON_COPTS + select({ }) DEBUGINFO_GRAMMAR_JSON_FILE = "source/extinst.debuginfo.grammar.json" +CLDEBUGINFO100_GRAMMAR_JSON_FILE = "source/extinst.opencl.debuginfo.100.grammar.json" def generate_core_tables(version = None): if not version: @@ -47,6 +48,7 @@ def generate_core_tables(version = None): grammars = [ "@spirv_headers//:spirv_core_grammar_" + version, DEBUGINFO_GRAMMAR_JSON_FILE, + CLDEBUGINFO100_GRAMMAR_JSON_FILE, ] outs = [ "core.insts-{}.inc".format(version), @@ -61,8 +63,9 @@ def generate_core_tables(version = None): "$(location :generate_grammar_tables) " + "--spirv-core-grammar=$(location {0}) " + "--extinst-debuginfo-grammar=$(location {1}) " + - "--core-insts-output=$(location {2}) " + - "--operand-kinds-output=$(location {3})" + "--extinst-cldebuginfo100-grammar=$(location {2}) " + + "--core-insts-output=$(location {3}) " + + "--operand-kinds-output=$(location {4})" ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], @@ -74,6 +77,7 @@ def generate_enum_string_mapping(version = None): grammars = [ "@spirv_headers//:spirv_core_grammar_" + version, DEBUGINFO_GRAMMAR_JSON_FILE, + CLDEBUGINFO100_GRAMMAR_JSON_FILE, ] outs = [ "extension_enum.inc", @@ -88,8 +92,9 @@ def generate_enum_string_mapping(version = None): "$(location :generate_grammar_tables) " + "--spirv-core-grammar=$(location {0}) " + "--extinst-debuginfo-grammar=$(location {1}) " + - "--extension-enum-output=$(location {2}) " + - "--enum-string-mapping-output=$(location {3})" + "--extinst-cldebuginfo100-grammar=$(location {2}) " + + "--extension-enum-output=$(location {3}) " + + "--enum-string-mapping-output=$(location {4})" ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], @@ -137,13 +142,14 @@ def generate_glsl_tables(version = None): visibility = ["//visibility:private"], ) -def generate_vendor_tables(extension = None): +def generate_vendor_tables(extension, operand_kind_prefix = ""): if not extension: fail("Must specify extension", "extension") - extension_rule = extension.replace("-", "_") + extension_rule = extension.replace("-", "_").replace(".", "_") grammars = ["source/extinst.{}.grammar.json".format(extension)] outs = ["{}.insts.inc".format(extension)] - fmtargs = grammars + outs + prefices = [operand_kind_prefix] + fmtargs = grammars + outs + prefices native.genrule( name = "gen_vendor_tables_" + extension_rule, srcs = grammars, @@ -151,7 +157,8 @@ def generate_vendor_tables(extension = None): cmd = ( "$(location :generate_grammar_tables) " + "--extinst-vendor-grammar=$(location {0}) " + - "--vendor-insts-output=$(location {1})" + "--vendor-insts-output=$(location {1}) " + + "--vendor-operand-kind-prefix={2}" ).format(*fmtargs), tools = [":generate_grammar_tables"], visibility = ["//visibility:private"], |