1# Copyright © 2017 Intel Corporation 2# SPDX-License-Identifier: MIT 3 4libintel_compiler_elk_files = files( 5 'elk_cfg.cpp', 6 'elk_cfg.h', 7 'elk_clip.h', 8 'elk_clip_line.c', 9 'elk_clip_point.c', 10 'elk_clip_tri.c', 11 'elk_clip_unfilled.c', 12 'elk_clip_util.c', 13 'elk_compile_clip.c', 14 'elk_compile_ff_gs.c', 15 'elk_compile_sf.c', 16 'elk_compiler.c', 17 'elk_compiler.h', 18 'elk_dead_control_flow.cpp', 19 'elk_dead_control_flow.h', 20 'elk_debug_recompile.c', 21 'elk_disasm.c', 22 'elk_disasm.h', 23 'elk_disasm_info.c', 24 'elk_disasm_info.h', 25 'elk_eu.c', 26 'elk_eu_compact.c', 27 'elk_eu_defines.h', 28 'elk_eu_emit.c', 29 'elk_eu_opcodes.h', 30 'elk_eu.h', 31 'elk_eu_util.c', 32 'elk_eu_validate.c', 33 'elk_fs_bank_conflicts.cpp', 34 'elk_fs_builder.h', 35 'elk_fs_cmod_propagation.cpp', 36 'elk_fs_combine_constants.cpp', 37 'elk_fs_copy_propagation.cpp', 38 'elk_fs.cpp', 39 'elk_fs_cse.cpp', 40 'elk_fs_dead_code_eliminate.cpp', 41 'elk_fs_generator.cpp', 42 'elk_fs.h', 43 'elk_fs_live_variables.cpp', 44 'elk_fs_live_variables.h', 45 'elk_fs_lower_pack.cpp', 46 'elk_fs_lower_regioning.cpp', 47 'elk_fs_nir.cpp', 48 'elk_fs_reg_allocate.cpp', 49 'elk_fs_register_coalesce.cpp', 50 'elk_fs_saturate_propagation.cpp', 51 'elk_fs_sel_peephole.cpp', 52 'elk_fs_thread_payload.cpp', 53 'elk_fs_validate.cpp', 54 'elk_fs_visitor.cpp', 55 'elk_inst.h', 56 'elk_interpolation_map.c', 57 'elk_ir.h', 58 'elk_ir_allocator.h', 59 'elk_ir_analysis.h', 60 'elk_ir_fs.h', 61 'elk_ir_performance.h', 62 'elk_ir_performance.cpp', 63 'elk_ir_vec4.h', 64 'elk_isa_info.h', 65 'elk_lower_logical_sends.cpp', 66 'elk_nir.h', 67 'elk_nir.c', 68 'elk_nir_analyze_boolean_resolves.c', 69 'elk_nir_analyze_ubo_ranges.c', 70 'elk_nir_attribute_workarounds.c', 71 'elk_nir_lower_alpha_to_coverage.c', 72 'elk_nir_lower_cs_intrinsics.c', 73 'elk_nir_lower_storage_image.c', 74 'elk_nir_options.h', 75 'elk_nir_options.c', 76 'elk_nir_private.h', 77 'elk_packed_float.c', 78 'elk_predicated_break.cpp', 79 'elk_prim.h', 80 'elk_private.h', 81 'elk_reg.h', 82 'elk_reg_type.c', 83 'elk_reg_type.h', 84 'elk_schedule_instructions.cpp', 85 'elk_shader.cpp', 86 'elk_shader.h', 87 'elk_simd_selection.cpp', 88 'elk_spirv.c', 89 'elk_vec4_builder.h', 90 'elk_vec4_cmod_propagation.cpp', 91 'elk_vec4_copy_propagation.cpp', 92 'elk_vec4.cpp', 93 'elk_vec4_cse.cpp', 94 'elk_vec4_dead_code_eliminate.cpp', 95 'elk_vec4_generator.cpp', 96 'elk_vec4_gs_visitor.cpp', 97 'elk_vec4_gs_visitor.h', 98 'elk_vec4.h', 99 'elk_vec4_live_variables.cpp', 100 'elk_vec4_live_variables.h', 101 'elk_vec4_nir.cpp', 102 'elk_vec4_gs_nir.cpp', 103 'elk_vec4_reg_allocate.cpp', 104 'elk_vec4_surface_builder.cpp', 105 'elk_vec4_surface_builder.h', 106 'elk_vec4_tcs.cpp', 107 'elk_vec4_tcs.h', 108 'elk_vec4_tes.cpp', 109 'elk_vec4_tes.h', 110 'elk_vec4_visitor.cpp', 111 'elk_vec4_vs_visitor.cpp', 112 'elk_vec4_vs.h', 113 'elk_vue_map.c', 114 'elk_gfx6_gs_visitor.cpp', 115 'elk_gfx6_gs_visitor.h', 116) 117 118elk_nir_trig = custom_target( 119 'elk_nir_trig_workarounds.c', 120 input : 'elk_nir_trig_workarounds.py', 121 output : 'elk_nir_trig_workarounds.c', 122 command : [ 123 prog_python, '@INPUT@', '-p', dir_compiler_nir, 124 ], 125 depend_files : nir_algebraic_depends, 126 capture : true, 127) 128 129libintel_compiler_elk = static_library( 130 'intel_compiler_elk', 131 [libintel_compiler_elk_files, intel_nir_files, elk_nir_trig, ir_expression_operation_h], 132 include_directories : [inc_include, inc_src, inc_intel], 133 c_args : [no_override_init_args], 134 gnu_symbol_visibility : 'hidden', 135 dependencies : [idep_nir_headers, idep_mesautil, idep_intel_dev], 136 build_by_default : false, 137) 138 139idep_intel_compiler_elk = declare_dependency( 140 link_with : [libintel_compiler_elk], 141 dependencies : [ 142 idep_nir, 143 idep_vtn, 144 ], 145) 146 147if with_tests 148 test( 149 'intel_compiler_elk_tests', 150 executable( 151 'intel_compiler_elk_tests', 152 files( 153 'elk_test_predicated_break.cpp', 154 'elk_test_eu_compact.cpp', 155 'elk_test_eu_validate.cpp', 156 'elk_test_fs_cmod_propagation.cpp', 157 'elk_test_fs_combine_constants.cpp', 158 'elk_test_fs_copy_propagation.cpp', 159 'elk_test_fs_saturate_propagation.cpp', 160 'elk_test_simd_selection.cpp', 161 'elk_test_vec4_cmod_propagation.cpp', 162 'elk_test_vec4_copy_propagation.cpp', 163 'elk_test_vec4_dead_code_eliminate.cpp', 164 'elk_test_vec4_register_coalesce.cpp', 165 'elk_test_vf_float_conversions.cpp', 166 ), 167 ir_expression_operation_h, 168 include_directories : [inc_include, inc_src, inc_intel], 169 link_with : [ 170 libintel_common, libisl 171 ], 172 dependencies : [idep_gtest, idep_nir, idep_mesautil, idep_intel_dev, 173 idep_intel_compiler_elk], 174 ), 175 suite : ['intel'], 176 protocol : 'gtest', 177 ) 178endif 179 180if with_intel_tools 181 182elk_gram_tab = custom_target( 183 'elk_gram.tab.[ch]', 184 input : 'elk_gram.y', 185 output : ['elk_gram.tab.c', 'elk_gram.tab.h'], 186 command : bison_command 187) 188 189elk_lex_yy_c = custom_target( 190 'elk_lex.yy.c', 191 input : 'elk_lex.l', 192 output : 'elk_lex.yy.c', 193 command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'] 194) 195 196elk_asm_tool = executable( 197 'elk_asm', 198 ['elk_asm_tool.c', elk_gram_tab[0], elk_gram_tab[1], elk_lex_yy_c], 199 dependencies : [idep_mesautil, dep_thread, idep_intel_dev, idep_intel_compiler_elk], 200 include_directories : [inc_include, inc_src, inc_intel], 201 link_with : [libintel_common], 202 c_args : [no_override_init_args], 203 gnu_symbol_visibility : 'hidden', 204 install : true 205) 206 207asm_testcases = [ 208 ['brw', 'gfx4'], 209 ['g4x', 'gfx4.5'], 210 ['ilk', 'gfx5'], 211 ['snb', 'gfx6'], 212 ['ivb', 'gfx7'], 213 ['hsw', 'gfx7.5'], 214 ['bdw', 'gfx8'], 215] 216 217test_runner = find_program('tests/run-test.py') 218foreach testcase : asm_testcases 219 _gen_name = testcase[0] 220 _gen_num = testcase[1] 221 _gen_folder = join_paths(meson.current_source_dir(), 'tests', 222 _gen_num.replace('gfx', 'gen')) 223 test( 224 'elk_asm_' + _gen_num, test_runner, 225 args : [ 226 '--elk_asm', elk_asm_tool, 227 '--gen_name', _gen_name, 228 '--gen_folder', _gen_folder, 229 ], 230 suite : 'intel', 231 ) 232endforeach 233 234elk_disasm_tool = executable( 235 'elk_disasm', 236 files('elk_disasm_tool.c'), 237 dependencies : [idep_mesautil, dep_thread, idep_intel_dev, idep_intel_compiler_elk], 238 include_directories : [inc_include, inc_src, inc_intel], 239 link_with : [libintel_common], 240 c_args : [no_override_init_args], 241 gnu_symbol_visibility : 'hidden', 242 install : true 243) 244 245endif 246