'panfrost_bifrost',
[libpanfrost_bifrost_files, bi_opcodes_c, bi_printer_c, bi_packer_c, bifrost_nir_algebraic_c, valhall_c],
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw, inc_valhall],
- dependencies: [idep_nir, idep_bi_opcodes_h, idep_bi_builder_h],
+ dependencies: [idep_nir, idep_bi_opcodes_h, idep_bi_builder_h, idep_valhall_enums_h],
link_with: [libpanfrost_util, libpanfrost_bifrost_disasm, libpanfrost_valhall_disasm],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
depend_files : files('valhall.py'),
)
+valhall_enums_h = custom_target(
+ 'valhall_enums.h',
+ input : ['valhall_enums.h.py', 'ISA.xml'],
+ output : 'valhall_enums.h',
+ command : [prog_python, '@INPUT@'],
+ capture : true,
+ depend_files : files('valhall.py'),
+)
+
+idep_valhall_enums_h = declare_dependency(
+ sources : [valhall_enums_h],
+ include_directories : include_directories('.'),
+)
+
valhall_disasm_c = custom_target(
'valhall_disasm_c',
input : ['disasm.py', 'ISA.xml'],
--- /dev/null
+#encoding=utf-8
+
+# Copyright (C) 2021 Collabora, Ltd.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+from valhall import safe_name, enums
+
+for enum in sorted(enums):
+ print(f"enum va_{safe_name(enum)} {{")
+
+ for i, value in enumerate(enums[enum].values):
+ if value.value != 'reserved':
+ key = safe_name(f"va_{enum}_{value.value}")
+ print(f" {key.upper()} = {i},")
+
+ print("};\n")