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_nir_triop_bitwise_c = custom_target( 38 'ir3_nir_triop_bitwise.c', 39 input : 'ir3_nir_triop_bitwise.py', 40 output : 'ir3_nir_triop_bitwise.c', 41 command : [ 42 prog_python, '@INPUT@', '-p', dir_compiler_nir, 43 ], 44 capture : true, 45 depend_files : nir_algebraic_depends, 46) 47 48ir3_parser = custom_target( 49 'ir3_parser.[ch]', 50 input: 'ir3_parser.y', 51 output: ['ir3_parser.c', 'ir3_parser.h'], 52 command: [ 53 prog_bison, '@INPUT@', '--name-prefix=ir3_yy', '--defines=@OUTPUT1@', '--output=@OUTPUT0@' 54 ] 55) 56 57ir3_lexer = custom_target( 58 'ir3_lexer.c', 59 input: 'ir3_lexer.l', 60 output: 'ir3_lexer.c', 61 command: [ 62 prog_flex, '-o', '@OUTPUT@', '@INPUT@' 63 ] 64) 65 66libfreedreno_ir3_files = files( 67 'disasm-a3xx.c', 68 'instr-a3xx.h', 69 'ir3.c', 70 'ir3_a4xx.c', 71 'ir3_a6xx.c', 72 'ir3_array_to_ssa.c', 73 'ir3_assembler.c', 74 'ir3_assembler.h', 75 'ir3_compiler_nir.c', 76 'ir3_compiler.c', 77 'ir3_compiler.h', 78 'ir3_context.c', 79 'ir3_context.h', 80 'ir3_cf.c', 81 'ir3_cp.c', 82 'ir3_cse.c', 83 'ir3_dce.c', 84 'ir3_delay.c', 85 'ir3_dominance.c', 86 'ir3_disk_cache.c', 87 'ir3_image.c', 88 'ir3_image.h', 89 'ir3.h', 90 'ir3_legalize.c', 91 'ir3_legalize_relative.c', 92 'ir3_liveness.c', 93 'ir3_lower_parallelcopy.c', 94 'ir3_lower_shared_phi.c', 95 'ir3_lower_spill.c', 96 'ir3_lower_subgroups.c', 97 'ir3_merge_regs.c', 98 'ir3_nir.c', 99 'ir3_nir.h', 100 'ir3_nir_analyze_ubo_ranges.c', 101 'ir3_nir_lower_64b.c', 102 'ir3_nir_lower_driver_params_to_ubo.c', 103 'ir3_nir_lower_load_barycentric_at_sample.c', 104 'ir3_nir_lower_load_barycentric_at_offset.c', 105 'ir3_nir_lower_push_consts_to_preamble.c', 106 'ir3_nir_lower_shading_rate.c', 107 'ir3_nir_lower_io_offsets.c', 108 'ir3_nir_lower_tess.c', 109 'ir3_nir_lower_tex_prefetch.c', 110 'ir3_nir_move_varying_inputs.c', 111 'ir3_nir_lower_layer_id.c', 112 'ir3_nir_opt_preamble.c', 113 'ir3_opt_predicates.c', 114 'ir3_postsched.c', 115 'ir3_print.c', 116 'ir3_ra.c', 117 'ir3_ra.h', 118 'ir3_ra_predicates.c', 119 'ir3_ra_validate.c', 120 'ir3_reconvergence.c', 121 'ir3_remove_unreachable.c', 122 'ir3_rpt.c', 123 'ir3_sched.c', 124 'ir3_shader.c', 125 'ir3_shader.h', 126 'ir3_shared_folding.c', 127 'ir3_shared_ra.c', 128 'ir3_spill.c', 129 'ir3_validate.c', 130) 131 132libfreedreno_ir3 = static_library( 133 'freedreno_ir3', 134 [libfreedreno_ir3_files, ir3_nir_trig_c, ir3_nir_imul_c, ir3_nir_branch_and_or_not_c, ir3_nir_triop_bitwise_c, ir3_parser[0], ir3_parser[1], ir3_lexer], 135 include_directories : [inc_freedreno, inc_include, inc_src], 136 c_args : [no_override_init_args], 137 gnu_symbol_visibility : 'hidden', 138 link_with: [libir3encode, libfreedreno_common], 139 dependencies : [idep_libir3decode, idep_nir_headers, dep_dl, idep_mesautil], 140 build_by_default : false, 141) 142 143test('ir3_disasm', 144 executable( 145 'ir3_disasm', 146 'tests/disasm.c', 147 link_args : [ld_args_build_id], 148 link_with: [libfreedreno_ir3], 149 dependencies: [idep_libir3decode, idep_mesautil, idep_nir], 150 include_directories: [inc_freedreno, inc_include, inc_src], 151 ), 152 suite: ['freedreno'], 153) 154 155test('ir3_delay_test', 156 executable( 157 'ir3_delay_test', 158 'tests/delay.c', 159 link_with: libfreedreno_ir3, 160 link_args: ld_args_build_id, 161 dependencies: [idep_mesautil, idep_nir], 162 include_directories: [inc_freedreno, inc_include, inc_src], 163 ), 164 suite: ['freedreno'], 165) 166