2019-07-10 18:33:24 +01:00
|
|
|
# Copyright © 2018 Rob Clark
|
|
|
|
# Copyright © 2019 Collabora
|
|
|
|
|
|
|
|
# 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 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.
|
|
|
|
|
2021-07-16 16:48:46 +01:00
|
|
|
subdir('valhall')
|
|
|
|
|
2021-07-23 17:04:13 +01:00
|
|
|
inc_valhall = include_directories(['.', 'valhall'])
|
|
|
|
|
2019-07-10 18:33:24 +01:00
|
|
|
libpanfrost_bifrost_files = files(
|
2021-06-24 16:49:19 +01:00
|
|
|
'bi_helper_invocations.c',
|
2020-05-05 22:58:16 +01:00
|
|
|
'bi_layout.c',
|
2020-03-11 18:54:49 +00:00
|
|
|
'bi_liveness.c',
|
2021-04-03 21:06:04 +01:00
|
|
|
'bi_lower_divergent_indirects.c',
|
2021-02-23 23:46:43 +00:00
|
|
|
'bi_lower_swizzle.c',
|
2022-06-02 15:50:54 +01:00
|
|
|
'bi_lower_xfb.c',
|
2020-03-03 20:39:04 +00:00
|
|
|
'bi_print.c',
|
2021-04-13 23:47:04 +01:00
|
|
|
'bi_opt_constant_fold.c',
|
2021-02-10 16:47:24 +00:00
|
|
|
'bi_opt_copy_prop.c',
|
2020-03-11 19:10:32 +00:00
|
|
|
'bi_opt_dce.c',
|
2021-06-25 00:36:11 +01:00
|
|
|
'bi_opt_cse.c',
|
2021-02-09 23:23:06 +00:00
|
|
|
'bi_opt_push_ubo.c',
|
2022-02-23 18:50:54 +00:00
|
|
|
'bi_opt_message_preload.c',
|
2021-06-11 00:05:29 +01:00
|
|
|
'bi_opt_mod_props.c',
|
2021-11-08 19:49:53 +00:00
|
|
|
'bi_opt_dual_tex.c',
|
2022-05-06 18:49:30 +01:00
|
|
|
'bi_pressure_schedule.c',
|
2020-03-12 18:16:22 +00:00
|
|
|
'bi_pack.c',
|
2020-03-12 00:39:36 +00:00
|
|
|
'bi_ra.c',
|
2020-03-07 00:25:00 +00:00
|
|
|
'bi_schedule.c',
|
2021-02-12 21:50:08 +00:00
|
|
|
'bi_scoreboard.c',
|
2021-07-27 23:34:35 +01:00
|
|
|
'bi_validate.c',
|
2020-03-04 14:19:06 +00:00
|
|
|
'bir.c',
|
2020-03-03 00:47:11 +00:00
|
|
|
'bifrost_compile.c',
|
2022-05-19 21:57:31 +01:00
|
|
|
'valhall/va_insert_flow.c',
|
2021-07-27 19:17:14 +01:00
|
|
|
'valhall/va_lower_constants.c',
|
2021-07-23 21:35:06 +01:00
|
|
|
'valhall/va_lower_isel.c',
|
2022-05-09 15:17:00 +01:00
|
|
|
'valhall/va_lower_split_64bit.c',
|
2021-07-22 01:29:54 +01:00
|
|
|
'valhall/va_optimize.c',
|
2022-06-15 21:52:39 +01:00
|
|
|
'valhall/va_mark_last.c',
|
2022-05-20 17:31:12 +01:00
|
|
|
'valhall/va_merge_flow.c',
|
2021-07-19 20:51:52 +01:00
|
|
|
'valhall/va_pack.c',
|
2021-08-02 22:11:03 +01:00
|
|
|
'valhall/va_perf.c',
|
2021-07-23 16:21:29 +01:00
|
|
|
'valhall/va_validate.c',
|
2019-07-10 18:33:24 +01:00
|
|
|
)
|
|
|
|
|
2020-09-14 18:21:33 +01:00
|
|
|
bifrost_gen_disasm_c = custom_target(
|
|
|
|
'bifrost_gen_disasm.c',
|
|
|
|
input : ['gen_disasm.py', 'ISA.xml'],
|
|
|
|
output : 'bifrost_gen_disasm.c',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
2020-12-08 00:58:22 +00:00
|
|
|
depend_files : files('bifrost_isa.py'),
|
2020-09-14 18:21:33 +01:00
|
|
|
)
|
|
|
|
|
2020-12-23 17:29:34 +00:00
|
|
|
bi_opcodes_c = custom_target(
|
|
|
|
'bi_opcodes.c',
|
|
|
|
input : ['bi_opcodes.c.py', 'ISA.xml'],
|
|
|
|
output : 'bi_opcodes.c',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('bifrost_isa.py'),
|
|
|
|
)
|
|
|
|
|
2020-11-27 19:39:40 +00:00
|
|
|
bi_printer_c = custom_target(
|
|
|
|
'bi_printer.c',
|
|
|
|
input : ['bi_printer.c.py', 'ISA.xml'],
|
|
|
|
output : 'bi_printer.c',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('bifrost_isa.py'),
|
|
|
|
)
|
|
|
|
|
2020-12-04 19:54:00 +00:00
|
|
|
bi_packer_c = custom_target(
|
|
|
|
'bi_packer.c',
|
|
|
|
input : ['bi_packer.c.py', 'ISA.xml'],
|
|
|
|
output : 'bi_packer.c',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('bifrost_isa.py'),
|
|
|
|
)
|
|
|
|
|
2020-11-27 18:51:00 +00:00
|
|
|
bi_opcodes_h = custom_target(
|
|
|
|
'bi_opcodes.h',
|
|
|
|
input : ['bi_opcodes.h.py', 'ISA.xml'],
|
|
|
|
output : 'bi_opcodes.h',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('bifrost_isa.py'),
|
|
|
|
)
|
|
|
|
|
|
|
|
idep_bi_opcodes_h = declare_dependency(
|
|
|
|
sources : [bi_opcodes_h],
|
|
|
|
include_directories : include_directories('.'),
|
|
|
|
)
|
|
|
|
|
2020-11-28 00:01:00 +00:00
|
|
|
bi_builder_h = custom_target(
|
|
|
|
'bi_builder.h',
|
|
|
|
input : ['bi_builder.h.py', 'ISA.xml'],
|
|
|
|
output : 'bi_builder.h',
|
|
|
|
command : [prog_python, '@INPUT@'],
|
|
|
|
capture : true,
|
|
|
|
depend_files : files('bifrost_isa.py'),
|
|
|
|
)
|
|
|
|
|
|
|
|
idep_bi_builder_h = declare_dependency(
|
|
|
|
sources : [bi_builder_h],
|
|
|
|
include_directories : include_directories('.'),
|
|
|
|
)
|
|
|
|
|
2021-06-11 01:21:28 +01:00
|
|
|
bifrost_nir_algebraic_c = custom_target(
|
|
|
|
'bifrost_nir_algebraic.c',
|
|
|
|
input : 'bifrost_nir_algebraic.py',
|
|
|
|
output : 'bifrost_nir_algebraic.c',
|
|
|
|
command : [
|
2022-08-10 00:04:51 +01:00
|
|
|
prog_python, '@INPUT@', '-p', dir_compiler_nir,
|
2021-06-11 01:21:28 +01:00
|
|
|
],
|
|
|
|
capture : true,
|
2022-02-16 22:02:16 +00:00
|
|
|
depend_files : nir_algebraic_depends,
|
2021-06-11 01:21:28 +01:00
|
|
|
)
|
|
|
|
|
2020-08-05 22:25:27 +01:00
|
|
|
libpanfrost_bifrost_disasm = static_library(
|
|
|
|
'panfrost_bifrost_disasm',
|
2020-09-14 18:21:33 +01:00
|
|
|
['disassemble.c', 'bi_print_common.c', bifrost_gen_disasm_c],
|
2020-08-05 22:25:27 +01:00
|
|
|
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost_hw],
|
|
|
|
dependencies: [idep_nir],
|
|
|
|
link_with: [libpanfrost_util],
|
|
|
|
c_args : [no_override_init_args],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
build_by_default : false,
|
|
|
|
)
|
|
|
|
|
2019-07-10 18:33:24 +01:00
|
|
|
libpanfrost_bifrost = static_library(
|
|
|
|
'panfrost_bifrost',
|
2021-07-23 17:04:13 +01:00
|
|
|
[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],
|
2022-03-24 21:13:24 +00:00
|
|
|
dependencies: [idep_nir, idep_bi_opcodes_h, idep_bi_builder_h, idep_valhall_enums_h],
|
2021-12-04 19:23:43 +00:00
|
|
|
link_with: [libpanfrost_util, libpanfrost_bifrost_disasm, libpanfrost_valhall_disasm],
|
2020-04-24 21:10:41 +01:00
|
|
|
c_args : [no_override_init_args],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2019-07-10 18:33:24 +01:00
|
|
|
build_by_default : false,
|
|
|
|
)
|
2021-07-26 17:15:15 +01:00
|
|
|
|
|
|
|
if with_tests
|
2021-11-04 23:45:00 +00:00
|
|
|
test(
|
|
|
|
'bifrost_tests',
|
|
|
|
executable(
|
|
|
|
'bifrost_tests',
|
|
|
|
files(
|
2021-11-04 21:33:09 +00:00
|
|
|
'test/test-constant-fold.cpp',
|
2021-11-08 19:52:03 +00:00
|
|
|
'test/test-dual-texture.cpp',
|
2022-06-22 21:36:11 +01:00
|
|
|
'test/test-lower-swizzle.cpp',
|
2022-02-24 18:36:24 +00:00
|
|
|
'test/test-message-preload.cpp',
|
2021-11-05 00:41:18 +00:00
|
|
|
'test/test-optimizer.cpp',
|
2021-11-04 21:32:38 +00:00
|
|
|
'test/test-pack-formats.cpp',
|
2021-11-04 22:01:58 +00:00
|
|
|
'test/test-packing.cpp',
|
2021-11-04 23:45:00 +00:00
|
|
|
'test/test-scheduler-predicates.cpp',
|
2021-07-22 16:59:09 +01:00
|
|
|
'valhall/test/test-add-imm.cpp',
|
2021-07-23 16:21:29 +01:00
|
|
|
'valhall/test/test-validate-fau.cpp',
|
2022-05-19 21:58:36 +01:00
|
|
|
'valhall/test/test-insert-flow.cpp',
|
2021-07-23 21:36:04 +01:00
|
|
|
'valhall/test/test-lower-isel.cpp',
|
2022-06-02 19:50:39 +01:00
|
|
|
'valhall/test/test-lower-constants.cpp',
|
2022-06-15 22:19:56 +01:00
|
|
|
'valhall/test/test-mark-last.cpp',
|
2022-05-20 17:30:59 +01:00
|
|
|
'valhall/test/test-merge-flow.cpp',
|
2021-11-19 20:38:04 +00:00
|
|
|
'valhall/test/test-packing.cpp',
|
2021-11-04 23:45:00 +00:00
|
|
|
),
|
|
|
|
c_args : [c_msvc_compat_args, no_override_init_args],
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2021-07-22 16:59:09 +01:00
|
|
|
include_directories : [inc_include, inc_src, inc_mesa, inc_valhall],
|
2021-11-04 23:45:00 +00:00
|
|
|
dependencies: [idep_gtest, idep_nir, idep_bi_opcodes_h, idep_bi_builder_h],
|
|
|
|
link_with : [libpanfrost_bifrost],
|
|
|
|
),
|
|
|
|
suite : ['panfrost'],
|
|
|
|
protocol : gtest_test_protocol,
|
|
|
|
)
|
2021-07-26 17:15:15 +01:00
|
|
|
endif
|