1# Copyright © 2017 Intel Corporation 2 3# Permission is hereby granted, free of charge, to any person obtaining a copy 4# of this software and associated documentation files (the "Software"), to deal 5# in the Software without restriction, including without limitation the rights 6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7# copies of the Software, and to permit persons to whom the Software is 8# furnished to do so, subject to the following conditions: 9 10# The above copyright notice and this permission notice shall be included in 11# all copies or substantial portions of the Software. 12 13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19# SOFTWARE. 20 21libintel_compiler_elk_files = files( 22 'elk_cfg.cpp', 23 'elk_cfg.h', 24 'elk_clip.h', 25 'elk_clip_line.c', 26 'elk_clip_point.c', 27 'elk_clip_tri.c', 28 'elk_clip_unfilled.c', 29 'elk_clip_util.c', 30 'elk_compile_clip.c', 31 'elk_compile_ff_gs.c', 32 'elk_compile_sf.c', 33 'elk_compiler.c', 34 'elk_compiler.h', 35 'elk_dead_control_flow.cpp', 36 'elk_dead_control_flow.h', 37 'elk_debug_recompile.c', 38 'elk_disasm.c', 39 'elk_disasm.h', 40 'elk_disasm_info.c', 41 'elk_disasm_info.h', 42 'elk_eu.c', 43 'elk_eu_compact.c', 44 'elk_eu_defines.h', 45 'elk_eu_emit.c', 46 'elk_eu_opcodes.h', 47 'elk_eu.h', 48 'elk_eu_util.c', 49 'elk_eu_validate.c', 50 'elk_fs_bank_conflicts.cpp', 51 'elk_fs_builder.h', 52 'elk_fs_cmod_propagation.cpp', 53 'elk_fs_combine_constants.cpp', 54 'elk_fs_copy_propagation.cpp', 55 'elk_fs.cpp', 56 'elk_fs_cse.cpp', 57 'elk_fs_dead_code_eliminate.cpp', 58 'elk_fs_generator.cpp', 59 'elk_fs.h', 60 'elk_fs_live_variables.cpp', 61 'elk_fs_live_variables.h', 62 'elk_fs_lower_pack.cpp', 63 'elk_fs_lower_regioning.cpp', 64 'elk_fs_nir.cpp', 65 'elk_fs_reg_allocate.cpp', 66 'elk_fs_register_coalesce.cpp', 67 'elk_fs_saturate_propagation.cpp', 68 'elk_fs_sel_peephole.cpp', 69 'elk_fs_thread_payload.cpp', 70 'elk_fs_validate.cpp', 71 'elk_fs_visitor.cpp', 72 'elk_inst.h', 73 'elk_interpolation_map.c', 74 'elk_ir.h', 75 'elk_ir_allocator.h', 76 'elk_ir_analysis.h', 77 'elk_ir_fs.h', 78 'elk_ir_performance.h', 79 'elk_ir_performance.cpp', 80 'elk_ir_vec4.h', 81 'elk_isa_info.h', 82 'elk_lower_logical_sends.cpp', 83 'elk_nir.h', 84 'elk_nir.c', 85 'elk_nir_analyze_boolean_resolves.c', 86 'elk_nir_analyze_ubo_ranges.c', 87 'elk_nir_attribute_workarounds.c', 88 'elk_nir_lower_alpha_to_coverage.c', 89 'elk_nir_lower_cs_intrinsics.c', 90 'elk_nir_lower_storage_image.c', 91 'elk_nir_options.h', 92 'elk_nir_options.c', 93 'elk_nir_private.h', 94 'elk_packed_float.c', 95 'elk_predicated_break.cpp', 96 'elk_prim.h', 97 'elk_private.h', 98 'elk_reg.h', 99 'elk_reg_type.c', 100 'elk_reg_type.h', 101 'elk_schedule_instructions.cpp', 102 'elk_shader.cpp', 103 'elk_shader.h', 104 'elk_simd_selection.cpp', 105 'elk_vec4_builder.h', 106 'elk_vec4_cmod_propagation.cpp', 107 'elk_vec4_copy_propagation.cpp', 108 'elk_vec4.cpp', 109 'elk_vec4_cse.cpp', 110 'elk_vec4_dead_code_eliminate.cpp', 111 'elk_vec4_generator.cpp', 112 'elk_vec4_gs_visitor.cpp', 113 'elk_vec4_gs_visitor.h', 114 'elk_vec4.h', 115 'elk_vec4_live_variables.cpp', 116 'elk_vec4_live_variables.h', 117 'elk_vec4_nir.cpp', 118 'elk_vec4_gs_nir.cpp', 119 'elk_vec4_reg_allocate.cpp', 120 'elk_vec4_surface_builder.cpp', 121 'elk_vec4_surface_builder.h', 122 'elk_vec4_tcs.cpp', 123 'elk_vec4_tcs.h', 124 'elk_vec4_tes.cpp', 125 'elk_vec4_tes.h', 126 'elk_vec4_visitor.cpp', 127 'elk_vec4_vs_visitor.cpp', 128 'elk_vec4_vs.h', 129 'elk_vue_map.c', 130 'elk_gfx6_gs_visitor.cpp', 131 'elk_gfx6_gs_visitor.h', 132) 133 134elk_nir_trig = custom_target( 135 'elk_nir_trig_workarounds.c', 136 input : 'elk_nir_trig_workarounds.py', 137 output : 'elk_nir_trig_workarounds.c', 138 command : [ 139 prog_python, '@INPUT@', '-p', dir_compiler_nir, 140 ], 141 depend_files : nir_algebraic_depends, 142 capture : true, 143) 144 145libintel_compiler_elk = static_library( 146 'intel_compiler_elk', 147 [libintel_compiler_elk_files, intel_nir_files, elk_nir_trig, ir_expression_operation_h], 148 include_directories : [inc_include, inc_src, inc_intel], 149 c_args : [no_override_init_args], 150 gnu_symbol_visibility : 'hidden', 151 dependencies : [idep_nir_headers, idep_mesautil, idep_intel_dev], 152 build_by_default : false, 153) 154 155if with_tests 156 test( 157 'intel_compiler_elk_tests', 158 executable( 159 'intel_compiler_elk_tests', 160 files( 161 'elk_test_predicated_break.cpp', 162 'elk_test_eu_compact.cpp', 163 'elk_test_eu_validate.cpp', 164 'elk_test_fs_cmod_propagation.cpp', 165 'elk_test_fs_combine_constants.cpp', 166 'elk_test_fs_copy_propagation.cpp', 167 'elk_test_fs_saturate_propagation.cpp', 168 'elk_test_simd_selection.cpp', 169 'elk_test_vec4_cmod_propagation.cpp', 170 'elk_test_vec4_copy_propagation.cpp', 171 'elk_test_vec4_dead_code_eliminate.cpp', 172 'elk_test_vec4_register_coalesce.cpp', 173 'elk_test_vf_float_conversions.cpp', 174 ), 175 ir_expression_operation_h, 176 include_directories : [inc_include, inc_src, inc_intel], 177 link_with : [ 178 libintel_compiler_elk, libintel_common, libisl 179 ], 180 dependencies : [idep_gtest, idep_nir, idep_mesautil, idep_intel_dev], 181 ), 182 suite : ['intel'], 183 protocol : 'gtest', 184 ) 185endif 186 187if with_intel_tools 188 189elk_gram_tab = custom_target( 190 'elk_gram.tab.[ch]', 191 input : 'elk_gram.y', 192 output : ['elk_gram.tab.c', 'elk_gram.tab.h'], 193 command : bison_command 194) 195 196elk_lex_yy_c = custom_target( 197 'elk_lex.yy.c', 198 input : 'elk_lex.l', 199 output : 'elk_lex.yy.c', 200 command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'] 201) 202 203elk_asm_tool = executable( 204 'elk_asm', 205 ['elk_asm_tool.c', elk_gram_tab[0], elk_gram_tab[1], elk_lex_yy_c], 206 dependencies : [idep_mesautil, dep_thread, idep_intel_dev], 207 include_directories : [inc_include, inc_src, inc_intel], 208 link_with : [libintel_common, libintel_compiler_elk], 209 c_args : [no_override_init_args], 210 gnu_symbol_visibility : 'hidden', 211 install : true 212) 213 214asm_testcases = [ 215 ['brw', 'gfx4'], 216 ['g4x', 'gfx4.5'], 217 ['ilk', 'gfx5'], 218 ['snb', 'gfx6'], 219 ['ivb', 'gfx7'], 220 ['hsw', 'gfx7.5'], 221 ['bdw', 'gfx8'], 222] 223 224test_runner = find_program('tests/run-test.py') 225foreach testcase : asm_testcases 226 _gen_name = testcase[0] 227 _gen_num = testcase[1] 228 _gen_folder = join_paths(meson.current_source_dir(), 'tests', 229 _gen_num.replace('gfx', 'gen')) 230 test( 231 'elk_asm_' + _gen_num, test_runner, 232 args : [ 233 '--elk_asm', elk_asm_tool, 234 '--gen_name', _gen_name, 235 '--gen_folder', _gen_folder, 236 ], 237 suite : 'intel', 238 ) 239endforeach 240 241elk_disasm_tool = executable( 242 'elk_disasm', 243 files('elk_disasm_tool.c'), 244 dependencies : [idep_mesautil, dep_thread, idep_intel_dev], 245 include_directories : [inc_include, inc_src, inc_intel], 246 link_with : [libintel_common, libintel_compiler_elk], 247 c_args : [no_override_init_args], 248 gnu_symbol_visibility : 'hidden', 249 install : true 250) 251 252endif 253 254