| 1 |
# Copyright 2018 Rob Clark |
| 2 |
# Copyright 2019 Collabora, Ltd. |
| 3 |
# SPDX-License-Identifier: MIT |
| 4 |
|
| 5 |
libasahi_agx_files = files( |
| 6 |
'agx_compile.c', |
| 7 |
'agx_dce.c', |
| 8 |
'agx_liveness.c', |
| 9 |
'agx_insert_waits.c', |
| 10 |
'agx_nir_lower_address.c', |
| 11 |
'agx_nir_lower_cull_distance.c', |
| 12 |
'agx_nir_lower_fminmax.c', |
| 13 |
'agx_nir_lower_frag_sidefx.c', |
| 14 |
'agx_nir_lower_sample_mask.c', |
| 15 |
'agx_nir_lower_discard_zs_emit.c', |
| 16 |
'agx_nir_lower_interpolation.c', |
| 17 |
'agx_nir_lower_shared_bitsize.c', |
| 18 |
'agx_nir_lower_subgroups.c', |
| 19 |
'agx_nir_lower_texture.c', |
| 20 |
'agx_nir_opt_preamble.c', |
| 21 |
'agx_lower_64bit.c', |
| 22 |
'agx_lower_divergent_shuffle.c', |
| 23 |
'agx_lower_parallel_copy.c', |
| 24 |
'agx_lower_pseudo.c', |
| 25 |
'agx_lower_spill.c', |
| 26 |
'agx_lower_uniform_sources.c', |
| 27 |
'agx_pack.c', |
| 28 |
'agx_performance.c', |
| 29 |
'agx_print.c', |
| 30 |
'agx_pressure_schedule.c', |
| 31 |
'agx_ir.c', |
| 32 |
'agx_opt_cse.c', |
| 33 |
'agx_opt_break_if.c', |
| 34 |
'agx_opt_empty_else.c', |
| 35 |
'agx_opt_jmp_none.c', |
| 36 |
'agx_opt_compact_constants.c', |
| 37 |
'agx_opt_promote_constants.c', |
| 38 |
'agx_opt_register_cache.c', |
| 39 |
'agx_optimizer.c', |
| 40 |
'agx_repair_ssa.c', |
| 41 |
'agx_reindex_ssa.c', |
| 42 |
'agx_spill.c', |
| 43 |
'agx_register_allocate.c', |
| 44 |
'agx_validate.c', |
| 45 |
'agx_validate_ra.c', |
| 46 |
) |
| 47 |
|
| 48 |
agx_nir_algebraic_c = custom_target( |
| 49 |
input : 'agx_nir_algebraic.py', |
| 50 |
output : 'agx_nir_algebraic.c', |
| 51 |
command : [ |
| 52 |
prog_python, '@INPUT@', '-p', dir_compiler_nir, |
| 53 |
], |
| 54 |
capture : true, |
| 55 |
depend_files : nir_algebraic_depends, |
| 56 |
) |
| 57 |
|
| 58 |
agx_opcodes_h = custom_target( |
| 59 |
input : ['agx_opcodes.h.py'], |
| 60 |
output : 'agx_opcodes.h', |
| 61 |
command : [prog_python, '@INPUT@'], |
| 62 |
capture : true, |
| 63 |
depend_files : files('agx_opcodes.py'), |
| 64 |
) |
| 65 |
|
| 66 |
idep_agx_opcodes_h = declare_dependency( |
| 67 |
sources : [agx_opcodes_h], |
| 68 |
include_directories : include_directories('.'), |
| 69 |
) |
| 70 |
|
| 71 |
agx_opcodes_c = custom_target( |
| 72 |
input : ['agx_opcodes.c.py'], |
| 73 |
output : 'agx_opcodes.c', |
| 74 |
command : [prog_python, '@INPUT@'], |
| 75 |
capture : true, |
| 76 |
depend_files : files('agx_opcodes.py'), |
| 77 |
) |
| 78 |
|
| 79 |
agx_builder_h = custom_target( |
| 80 |
input : ['agx_builder.h.py'], |
| 81 |
output : 'agx_builder.h', |
| 82 |
command : [prog_python, '@INPUT@'], |
| 83 |
capture : true, |
| 84 |
depend_files : files('agx_opcodes.py'), |
| 85 |
) |
| 86 |
|
| 87 |
idep_agx_builder_h = declare_dependency( |
| 88 |
sources : [agx_builder_h], |
| 89 |
include_directories : include_directories('.'), |
| 90 |
) |
| 91 |
|
| 92 |
libasahi_compiler = static_library( |
| 93 |
'asahi_compiler', |
| 94 |
[libasahi_agx_files, agx_opcodes_c, agx_nir_algebraic_c], |
| 95 |
dependencies: [idep_nir, idep_agx_opcodes_h, idep_agx_builder_h, idep_mesautil, idep_libagx], |
| 96 |
link_with : [libagx2_disasm], |
| 97 |
c_args : [no_override_init_args, '-Wno-c2x-extensions'], |
| 98 |
gnu_symbol_visibility : 'hidden', |
| 99 |
build_by_default : false, |
| 100 |
) |
| 101 |
|
| 102 |
if with_tests |
| 103 |
test( |
| 104 |
'agx_tests', |
| 105 |
executable( |
| 106 |
'agx_tests', |
| 107 |
files( |
| 108 |
'test/test-compact-constants.cpp', |
| 109 |
'test/test-minifloat.cpp', |
| 110 |
'test/test-optimizer.cpp', |
| 111 |
'test/test-lower-pseudo.cpp', |
| 112 |
'test/test-lower-parallel-copy.cpp', |
| 113 |
'test/test-lower-spill.cpp', |
| 114 |
'test/test-repair-ssa.cpp', |
| 115 |
), |
| 116 |
c_args : [c_msvc_compat_args, no_override_init_args], |
| 117 |
gnu_symbol_visibility : 'hidden', |
| 118 |
dependencies: [idep_gtest, idep_nir, idep_agx_opcodes_h, idep_agx_builder_h, idep_mesautil], |
| 119 |
link_with : [libasahi_compiler], |
| 120 |
), |
| 121 |
suite : ['asahi'], |
| 122 |
protocol : 'gtest', |
| 123 |
) |
| 124 |
endif |