xref: /aosp_15_r20/external/mesa3d/src/amd/compiler/meson.build (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1# Copyright © 2018 Valve Corporation
2# SPDX-License-Identifier: MIT
3
4aco_depends = files('aco_opcodes.py')
5
6aco_opcodes_h = custom_target(
7  'aco_opcodes.h',
8  input : 'aco_opcodes_h.py',
9  output : 'aco_opcodes.h',
10  command : [prog_python, '@INPUT@'],
11  capture : true,
12  depend_files : aco_depends,
13)
14
15aco_opcodes_c = custom_target(
16  'aco_opcodes.cpp',
17  input : 'aco_opcodes_cpp.py',
18  output : 'aco_opcodes.cpp',
19  command : [prog_python, '@INPUT@'],
20  capture : true,
21  depend_files : aco_depends,
22)
23
24aco_builder_h = custom_target(
25  'aco_builder.h',
26  input : 'aco_builder_h.py',
27  output : 'aco_builder.h',
28  command : [prog_python, '@INPUT@'],
29  capture : true,
30  depend_files : aco_depends,
31)
32
33libaco_files = files(
34  'aco_dead_code_analysis.cpp',
35  'aco_dominance.cpp',
36  'aco_instruction_selection.cpp',
37  'aco_instruction_selection.h',
38  'aco_instruction_selection_setup.cpp',
39  'aco_interface.cpp',
40  'aco_interface.h',
41  'aco_ir.cpp',
42  'aco_ir.h',
43  'aco_assembler.cpp',
44  'aco_form_hard_clauses.cpp',
45  'aco_insert_delay_alu.cpp',
46  'aco_insert_exec_mask.cpp',
47  'aco_insert_NOPs.cpp',
48  'aco_insert_waitcnt.cpp',
49  'aco_reduce_assign.cpp',
50  'aco_register_allocation.cpp',
51  'aco_live_var_analysis.cpp',
52  'aco_lower_phis.cpp',
53  'aco_lower_subdword.cpp',
54  'aco_lower_to_cssa.cpp',
55  'aco_lower_to_hw_instr.cpp',
56  'aco_optimizer.cpp',
57  'aco_optimizer_postRA.cpp',
58  'aco_opt_value_numbering.cpp',
59  'aco_print_asm.cpp',
60  'aco_print_ir.cpp',
61  'aco_reindex_ssa.cpp',
62  'aco_scheduler.cpp',
63  'aco_scheduler_ilp.cpp',
64  'aco_spill.cpp',
65  'aco_ssa_elimination.cpp',
66  'aco_statistics.cpp',
67  'aco_util.h',
68  'aco_validate.cpp',
69)
70
71cpp_args_aco = cpp.get_supported_arguments(['-fno-exceptions', '-fno-rtti', '-Wimplicit-fallthrough', '-Wshadow'])
72
73_libaco = static_library(
74  'aco',
75  [libaco_files, aco_opcodes_c, aco_opcodes_h, aco_builder_h],
76  include_directories : [
77   inc_include, inc_src, inc_amd, inc_amd_common,
78  ],
79  dependencies : [
80    dep_llvm, dep_thread, dep_valgrind, idep_nir_headers, idep_amdgfxregs_h, idep_mesautil,
81  ],
82  gnu_symbol_visibility : 'hidden',
83  build_by_default : true,
84  cpp_args : [cpp_args_aco, cpp_msvc_compat_args],
85)
86
87# Also link with aco
88idep_aco = declare_dependency(
89  include_directories : include_directories('.'),
90  link_with : _libaco,
91  sources : [aco_opcodes_h, aco_builder_h],
92)
93