1# Copyright © 2018 Rob Clark 2# SPDX-License-Identifier: MIT 3 4ir3_nir_trig_c = custom_target( 5 'ir3_nir_trig.c', 6 input : 'ir3_nir_trig.py', 7 output : 'ir3_nir_trig.c', 8 command : [ 9 prog_python, '@INPUT@', '-p', dir_compiler_nir, 10 ], 11 capture : true, 12 depend_files : nir_algebraic_depends, 13) 14 15ir3_nir_imul_c = custom_target( 16 'ir3_nir_imul.c', 17 input : 'ir3_nir_imul.py', 18 output : 'ir3_nir_imul.c', 19 command : [ 20 prog_python, '@INPUT@', '-p', dir_compiler_nir, 21 ], 22 capture : true, 23 depend_files : nir_algebraic_depends, 24) 25 26ir3_nir_branch_and_or_not_c = custom_target( 27 'ir3_nir_branch_and_or_not.c', 28 input : 'ir3_nir_branch_and_or_not.py', 29 output : 'ir3_nir_branch_and_or_not.c', 30 command : [ 31 prog_python, '@INPUT@', '-p', dir_compiler_nir, 32 ], 33 capture : true, 34 depend_files : nir_algebraic_depends, 35) 36 37ir3_parser = custom_target( 38 'ir3_parser.[ch]', 39 input: 'ir3_parser.y', 40 output: ['ir3_parser.c', 'ir3_parser.h'], 41 command: [ 42 prog_bison, '@INPUT@', '--name-prefix=ir3_yy', '--defines=@OUTPUT1@', '--output=@OUTPUT0@' 43 ] 44) 45 46ir3_lexer = custom_target( 47 'ir3_lexer.c', 48 input: 'ir3_lexer.l', 49 output: 'ir3_lexer.c', 50 command: [ 51 prog_flex, '-o', '@OUTPUT@', '@INPUT@' 52 ] 53) 54 55libfreedreno_ir3_files = files( 56 'disasm-a3xx.c', 57 'instr-a3xx.h', 58 'ir3.c', 59 'ir3_a4xx.c', 60 'ir3_a6xx.c', 61 'ir3_array_to_ssa.c', 62 'ir3_assembler.c', 63 'ir3_assembler.h', 64 'ir3_compiler_nir.c', 65 'ir3_compiler.c', 66 'ir3_compiler.h', 67 'ir3_context.c', 68 'ir3_context.h', 69 'ir3_cf.c', 70 'ir3_cp.c', 71 'ir3_cse.c', 72 'ir3_dce.c', 73 'ir3_delay.c', 74 'ir3_dominance.c', 75 'ir3_disk_cache.c', 76 'ir3_image.c', 77 'ir3_image.h', 78 'ir3.h', 79 'ir3_legalize.c', 80 'ir3_legalize_relative.c', 81 'ir3_liveness.c', 82 'ir3_lower_parallelcopy.c', 83 'ir3_lower_shared_phi.c', 84 'ir3_lower_spill.c', 85 'ir3_lower_subgroups.c', 86 'ir3_merge_regs.c', 87 'ir3_nir.c', 88 'ir3_nir.h', 89 'ir3_nir_analyze_ubo_ranges.c', 90 'ir3_nir_lower_64b.c', 91 'ir3_nir_lower_driver_params_to_ubo.c', 92 'ir3_nir_lower_load_barycentric_at_sample.c', 93 'ir3_nir_lower_load_barycentric_at_offset.c', 94 'ir3_nir_lower_push_consts_to_preamble.c', 95 'ir3_nir_lower_io_offsets.c', 96 'ir3_nir_lower_tess.c', 97 'ir3_nir_lower_tex_prefetch.c', 98 'ir3_nir_move_varying_inputs.c', 99 'ir3_nir_lower_layer_id.c', 100 'ir3_nir_opt_preamble.c', 101 'ir3_opt_predicates.c', 102 'ir3_postsched.c', 103 'ir3_print.c', 104 'ir3_ra.c', 105 'ir3_ra.h', 106 'ir3_ra_predicates.c', 107 'ir3_ra_validate.c', 108 'ir3_reconvergence.c', 109 'ir3_remove_unreachable.c', 110 'ir3_rpt.c', 111 'ir3_sched.c', 112 'ir3_shader.c', 113 'ir3_shader.h', 114 'ir3_shared_folding.c', 115 'ir3_shared_ra.c', 116 'ir3_spill.c', 117 'ir3_validate.c', 118) 119 120libfreedreno_ir3 = static_library( 121 'freedreno_ir3', 122 [libfreedreno_ir3_files, ir3_nir_trig_c, ir3_nir_imul_c, ir3_nir_branch_and_or_not_c, ir3_parser[0], ir3_parser[1], ir3_lexer], 123 include_directories : [inc_freedreno, inc_include, inc_src], 124 c_args : [no_override_init_args], 125 gnu_symbol_visibility : 'hidden', 126 link_with: [libir3encode, libfreedreno_common], 127 dependencies : [idep_libir3decode, idep_nir_headers, dep_dl, idep_mesautil], 128 build_by_default : false, 129) 130 131test('ir3_disasm', 132 executable( 133 'ir3_disasm', 134 'tests/disasm.c', 135 link_args : [ld_args_build_id], 136 link_with: [libfreedreno_ir3], 137 dependencies: [idep_libir3decode, idep_mesautil, idep_nir], 138 include_directories: [inc_freedreno, inc_include, inc_src], 139 ), 140 suite: ['freedreno'], 141) 142 143test('ir3_delay_test', 144 executable( 145 'ir3_delay_test', 146 'tests/delay.c', 147 link_with: libfreedreno_ir3, 148 link_args: ld_args_build_id, 149 dependencies: [idep_mesautil, idep_nir], 150 include_directories: [inc_freedreno, inc_include, inc_src], 151 ), 152 suite: ['freedreno'], 153) 154