2017-09-14 17:57:17 -07:00
|
|
|
# Copyright © 2017 Intel Corporation
|
|
|
|
|
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
|
# SOFTWARE.
|
|
|
|
|
|
|
|
|
|
libintel_compiler_files = files(
|
|
|
|
|
'brw_cfg.cpp',
|
|
|
|
|
'brw_cfg.h',
|
|
|
|
|
'brw_clip.h',
|
|
|
|
|
'brw_clip_line.c',
|
|
|
|
|
'brw_clip_point.c',
|
|
|
|
|
'brw_clip_tri.c',
|
|
|
|
|
'brw_clip_unfilled.c',
|
|
|
|
|
'brw_clip_util.c',
|
|
|
|
|
'brw_compile_clip.c',
|
2021-03-20 06:23:32 +10:00
|
|
|
'brw_compile_ff_gs.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_compile_sf.c',
|
|
|
|
|
'brw_compiler.c',
|
|
|
|
|
'brw_compiler.h',
|
|
|
|
|
'brw_dead_control_flow.cpp',
|
|
|
|
|
'brw_dead_control_flow.h',
|
2019-04-15 21:59:50 -07:00
|
|
|
'brw_debug_recompile.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_disasm.c',
|
2017-11-16 11:43:51 -08:00
|
|
|
'brw_disasm_info.c',
|
|
|
|
|
'brw_disasm_info.h',
|
2022-06-30 01:47:09 -07:00
|
|
|
'brw_eu.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_eu_compact.c',
|
|
|
|
|
'brw_eu_defines.h',
|
|
|
|
|
'brw_eu_emit.c',
|
|
|
|
|
'brw_eu.h',
|
|
|
|
|
'brw_eu_util.c',
|
|
|
|
|
'brw_eu_validate.c',
|
2017-06-15 15:23:57 -07:00
|
|
|
'brw_fs_bank_conflicts.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_fs_builder.h',
|
|
|
|
|
'brw_fs_cmod_propagation.cpp',
|
|
|
|
|
'brw_fs_combine_constants.cpp',
|
|
|
|
|
'brw_fs_copy_propagation.cpp',
|
|
|
|
|
'brw_fs.cpp',
|
|
|
|
|
'brw_fs_cse.cpp',
|
|
|
|
|
'brw_fs_dead_code_eliminate.cpp',
|
|
|
|
|
'brw_fs_generator.cpp',
|
|
|
|
|
'brw_fs.h',
|
|
|
|
|
'brw_fs_live_variables.cpp',
|
|
|
|
|
'brw_fs_live_variables.h',
|
2023-10-10 15:35:46 -07:00
|
|
|
'brw_fs_lower_dpas.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_fs_lower_pack.cpp',
|
2018-12-29 04:00:13 -08:00
|
|
|
'brw_fs_lower_regioning.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_fs_nir.cpp',
|
|
|
|
|
'brw_fs_reg_allocate.cpp',
|
|
|
|
|
'brw_fs_register_coalesce.cpp',
|
|
|
|
|
'brw_fs_saturate_propagation.cpp',
|
2018-11-09 14:13:37 -08:00
|
|
|
'brw_fs_scoreboard.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_fs_sel_peephole.cpp',
|
2022-08-19 12:40:20 -07:00
|
|
|
'brw_fs_thread_payload.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_fs_validate.cpp',
|
|
|
|
|
'brw_fs_visitor.cpp',
|
|
|
|
|
'brw_inst.h',
|
|
|
|
|
'brw_interpolation_map.c',
|
2016-03-06 18:13:59 -08:00
|
|
|
'brw_ir.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_ir_allocator.h',
|
2016-03-06 18:11:20 -08:00
|
|
|
'brw_ir_analysis.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_ir_fs.h',
|
2020-03-26 14:59:02 -07:00
|
|
|
'brw_ir_performance.h',
|
|
|
|
|
'brw_ir_performance.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_ir_vec4.h',
|
2022-06-29 14:25:19 -07:00
|
|
|
'brw_isa_info.h',
|
2022-06-27 12:24:58 -07:00
|
|
|
'brw_lower_logical_sends.cpp',
|
2021-10-29 12:27:45 -07:00
|
|
|
'brw_mesh.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_nir.h',
|
|
|
|
|
'brw_nir.c',
|
|
|
|
|
'brw_nir_analyze_boolean_resolves.c',
|
|
|
|
|
'brw_nir_analyze_ubo_ranges.c',
|
|
|
|
|
'brw_nir_attribute_workarounds.c',
|
2023-03-06 20:11:53 +02:00
|
|
|
'brw_nir_blockify_uniform_loads.c',
|
2021-03-25 14:53:32 +02:00
|
|
|
'brw_nir_clamp_per_vertex_loads.c',
|
2018-12-17 09:17:06 +01:00
|
|
|
'brw_nir_lower_conversions.c',
|
2023-06-13 19:45:49 -07:00
|
|
|
'brw_nir_lower_cooperative_matrix.c',
|
2017-10-06 10:08:11 -07:00
|
|
|
'brw_nir_lower_cs_intrinsics.c',
|
2019-09-27 16:23:46 -07:00
|
|
|
'brw_nir_lower_alpha_to_coverage.c',
|
2020-08-06 16:22:15 -05:00
|
|
|
'brw_nir_lower_intersection_shader.c',
|
2023-04-24 18:42:48 +03:00
|
|
|
'brw_nir_lower_non_uniform_resource_intel.c',
|
2023-08-24 01:23:00 +03:00
|
|
|
'brw_nir_lower_non_uniform_barycentric_at_sample.c',
|
2021-06-21 13:44:53 +03:00
|
|
|
'brw_nir_lower_ray_queries.c',
|
2020-08-06 12:59:49 -05:00
|
|
|
'brw_nir_lower_rt_intrinsics.c',
|
2020-08-06 13:53:34 -05:00
|
|
|
'brw_nir_lower_shader_calls.c',
|
2021-02-17 13:47:36 +02:00
|
|
|
'brw_nir_lower_shading_rate_output.c',
|
2023-06-27 17:54:05 +03:00
|
|
|
'brw_nir_lower_sparse.c',
|
2021-02-03 11:34:46 -08:00
|
|
|
'brw_nir_lower_storage_image.c',
|
2024-02-02 20:33:34 -08:00
|
|
|
'brw_nir_lower_texture.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_nir_opt_peephole_ffma.c',
|
2022-02-02 18:49:25 -08:00
|
|
|
'brw_nir_opt_peephole_imul32x16.c',
|
2020-08-06 12:59:49 -05:00
|
|
|
'brw_nir_rt.h',
|
2020-08-06 13:20:07 -05:00
|
|
|
'brw_nir_rt.c',
|
2020-08-06 12:44:57 -05:00
|
|
|
'brw_nir_rt_builder.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_nir_tcs_workarounds.c',
|
2020-01-13 15:11:25 +02:00
|
|
|
'brw_nir_clamp_image_1d_2d_array_sizes.c',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_packed_float.c',
|
|
|
|
|
'brw_predicated_break.cpp',
|
2022-06-29 15:19:57 -07:00
|
|
|
'brw_prim.h',
|
2021-10-06 22:37:42 -07:00
|
|
|
'brw_private.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_reg.h',
|
|
|
|
|
'brw_reg_type.c',
|
|
|
|
|
'brw_reg_type.h',
|
2020-08-06 12:53:47 -05:00
|
|
|
'brw_rt.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_schedule_instructions.cpp',
|
|
|
|
|
'brw_shader.cpp',
|
|
|
|
|
'brw_shader.h',
|
2022-11-07 17:35:16 -08:00
|
|
|
'brw_simd_selection.cpp',
|
2017-09-14 17:57:17 -07:00
|
|
|
'brw_vec4_builder.h',
|
|
|
|
|
'brw_vec4_cmod_propagation.cpp',
|
|
|
|
|
'brw_vec4_copy_propagation.cpp',
|
|
|
|
|
'brw_vec4.cpp',
|
|
|
|
|
'brw_vec4_cse.cpp',
|
|
|
|
|
'brw_vec4_dead_code_eliminate.cpp',
|
|
|
|
|
'brw_vec4_generator.cpp',
|
|
|
|
|
'brw_vec4_gs_visitor.cpp',
|
|
|
|
|
'brw_vec4_gs_visitor.h',
|
|
|
|
|
'brw_vec4.h',
|
|
|
|
|
'brw_vec4_live_variables.cpp',
|
|
|
|
|
'brw_vec4_live_variables.h',
|
|
|
|
|
'brw_vec4_nir.cpp',
|
|
|
|
|
'brw_vec4_gs_nir.cpp',
|
|
|
|
|
'brw_vec4_reg_allocate.cpp',
|
|
|
|
|
'brw_vec4_surface_builder.cpp',
|
|
|
|
|
'brw_vec4_surface_builder.h',
|
|
|
|
|
'brw_vec4_tcs.cpp',
|
|
|
|
|
'brw_vec4_tcs.h',
|
|
|
|
|
'brw_vec4_tes.cpp',
|
|
|
|
|
'brw_vec4_tes.h',
|
|
|
|
|
'brw_vec4_visitor.cpp',
|
|
|
|
|
'brw_vec4_vs_visitor.cpp',
|
|
|
|
|
'brw_vec4_vs.h',
|
|
|
|
|
'brw_vue_map.c',
|
2021-03-30 12:12:22 -07:00
|
|
|
'gfx6_gs_visitor.cpp',
|
|
|
|
|
'gfx6_gs_visitor.h',
|
2017-09-14 17:57:17 -07:00
|
|
|
)
|
|
|
|
|
|
2024-02-09 15:30:57 -08:00
|
|
|
brw_device_sha1_gen_src = custom_target('brw_device_sha1_gen.c',
|
|
|
|
|
input : ['brw_device_sha1_gen_c.py', '../dev/intel_device_info.py'],
|
|
|
|
|
output : ['brw_device_sha1_gen.c'],
|
|
|
|
|
command : [prog_python, '@INPUT0@', '--outdir', meson.current_build_dir()])
|
|
|
|
|
|
|
|
|
|
|
2017-09-14 17:57:17 -07:00
|
|
|
brw_nir_trig = custom_target(
|
|
|
|
|
'brw_nir_trig_workarounds.c',
|
|
|
|
|
input : 'brw_nir_trig_workarounds.py',
|
|
|
|
|
output : 'brw_nir_trig_workarounds.c',
|
2017-12-11 15:56:08 -08:00
|
|
|
command : [
|
2022-08-10 02:04:51 +03:00
|
|
|
prog_python, '@INPUT@', '-p', dir_compiler_nir,
|
2017-12-11 15:56:08 -08:00
|
|
|
],
|
2022-02-16 14:02:16 -08:00
|
|
|
depend_files : nir_algebraic_depends,
|
2017-09-14 17:57:17 -07:00
|
|
|
capture : true,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
libintel_compiler = static_library(
|
|
|
|
|
'intel_compiler',
|
2024-02-09 15:30:57 -08:00
|
|
|
[libintel_compiler_files, brw_nir_trig, ir_expression_operation_h, [brw_device_sha1_gen_src]],
|
2023-08-02 19:24:14 +08:00
|
|
|
include_directories : [inc_include, inc_src, inc_intel],
|
2020-04-24 13:10:41 -07:00
|
|
|
c_args : [no_override_init_args],
|
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
2023-02-15 10:09:57 -08:00
|
|
|
dependencies : [idep_nir_headers, idep_mesautil, idep_intel_dev],
|
2017-09-14 17:57:17 -07:00
|
|
|
build_by_default : false,
|
|
|
|
|
)
|
|
|
|
|
|
2021-02-19 10:34:49 -06:00
|
|
|
# For now this tool is only going to be used by Anv
|
2023-08-31 13:16:29 -04:00
|
|
|
if get_option('intel-clc') == 'system'
|
|
|
|
|
prog_intel_clc = find_program('intel_clc', native : true)
|
|
|
|
|
dep_prog_intel_clc = []
|
|
|
|
|
elif with_intel_clc
|
2021-02-19 10:34:49 -06:00
|
|
|
prog_intel_clc = executable(
|
|
|
|
|
'intel_clc',
|
2023-06-15 11:31:39 -07:00
|
|
|
['intel_clc.c', 'brw_kernel.c'],
|
2021-02-19 10:34:49 -06:00
|
|
|
link_with : [
|
2023-02-15 10:09:57 -08:00
|
|
|
libintel_compiler, libintel_common,libisl,
|
2021-02-19 10:34:49 -06:00
|
|
|
],
|
2023-08-02 19:24:14 +08:00
|
|
|
include_directories : [inc_include, inc_src, inc_intel],
|
2021-02-19 10:34:49 -06:00
|
|
|
c_args : [pre_args, no_override_init_args],
|
2022-10-01 00:36:59 -07:00
|
|
|
link_args : [ld_args_build_id],
|
2023-06-14 22:13:39 -07:00
|
|
|
dependencies : [idep_nir, idep_vtn, idep_mesaclc, idep_mesautil, idep_intel_dev],
|
2021-02-19 10:34:49 -06:00
|
|
|
native : true,
|
2024-02-12 15:06:06 +02:00
|
|
|
install : get_option('install-intel-clc'),
|
2021-02-19 10:34:49 -06:00
|
|
|
)
|
2023-08-31 13:16:29 -04:00
|
|
|
dep_prog_intel_clc = [prog_intel_clc]
|
2021-02-19 10:34:49 -06:00
|
|
|
endif
|
|
|
|
|
|
2017-09-14 17:57:17 -07:00
|
|
|
if with_tests
|
2021-10-11 23:27:53 -07:00
|
|
|
test(
|
|
|
|
|
'intel_compiler_tests',
|
|
|
|
|
executable(
|
|
|
|
|
'intel_compiler_tests',
|
|
|
|
|
files(
|
2023-11-03 22:41:59 -07:00
|
|
|
'test_predicated_break.cpp',
|
2021-10-11 23:27:53 -07:00
|
|
|
'test_eu_compact.cpp',
|
|
|
|
|
'test_eu_validate.cpp',
|
|
|
|
|
'test_fs_cmod_propagation.cpp',
|
2024-01-17 18:32:11 -08:00
|
|
|
'test_fs_combine_constants.cpp',
|
2021-10-11 23:27:53 -07:00
|
|
|
'test_fs_copy_propagation.cpp',
|
|
|
|
|
'test_fs_saturate_propagation.cpp',
|
|
|
|
|
'test_fs_scoreboard.cpp',
|
2021-10-06 22:37:42 -07:00
|
|
|
'test_simd_selection.cpp',
|
2021-10-11 23:27:53 -07:00
|
|
|
'test_vec4_cmod_propagation.cpp',
|
|
|
|
|
'test_vec4_copy_propagation.cpp',
|
|
|
|
|
'test_vec4_dead_code_eliminate.cpp',
|
|
|
|
|
'test_vec4_register_coalesce.cpp',
|
|
|
|
|
'test_vf_float_conversions.cpp',
|
2018-11-19 13:44:15 -08:00
|
|
|
),
|
2021-10-11 23:27:53 -07:00
|
|
|
ir_expression_operation_h,
|
2023-08-02 19:24:14 +08:00
|
|
|
include_directories : [inc_include, inc_src, inc_intel],
|
2021-10-11 23:27:53 -07:00
|
|
|
link_with : [
|
2023-02-15 10:09:57 -08:00
|
|
|
libintel_compiler, libintel_common, libisl
|
2021-10-11 23:27:53 -07:00
|
|
|
],
|
2023-02-15 10:09:57 -08:00
|
|
|
dependencies : [idep_gtest, idep_nir, idep_mesautil, idep_intel_dev],
|
2021-10-11 23:27:53 -07:00
|
|
|
),
|
|
|
|
|
suite : ['intel'],
|
2023-02-23 10:49:37 +00:00
|
|
|
protocol : 'gtest',
|
2021-10-11 23:27:53 -07:00
|
|
|
)
|
2017-09-14 17:57:17 -07:00
|
|
|
endif
|
2024-02-09 13:55:14 -08:00
|
|
|
|
|
|
|
|
if with_intel_tools
|
|
|
|
|
|
|
|
|
|
bison_command = []
|
|
|
|
|
if yacc_is_bison
|
|
|
|
|
bison_command = [
|
|
|
|
|
prog_bison, '@INPUT@', '--defines=@OUTPUT1@',
|
|
|
|
|
'--output=@OUTPUT0@'
|
|
|
|
|
]
|
|
|
|
|
else
|
|
|
|
|
bison_command = [
|
|
|
|
|
prog_bison, '-H', '@OUTPUT1@',
|
|
|
|
|
'-o', '@OUTPUT0@', '@INPUT@'
|
|
|
|
|
]
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
brw_gram_tab = custom_target(
|
|
|
|
|
'brw_gram.tab.[ch]',
|
|
|
|
|
input : 'brw_gram.y',
|
|
|
|
|
output : ['brw_gram.tab.c', 'brw_gram.tab.h'],
|
|
|
|
|
command : bison_command
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
brw_lex_yy_c = custom_target(
|
|
|
|
|
'brw_lex.yy.c',
|
|
|
|
|
input : 'brw_lex.l',
|
|
|
|
|
output : 'brw_lex.yy.c',
|
|
|
|
|
command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@']
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
brw_asm_tool = executable(
|
|
|
|
|
'brw_asm',
|
|
|
|
|
['brw_asm_tool.c', brw_gram_tab[0], brw_gram_tab[1], brw_lex_yy_c],
|
|
|
|
|
dependencies : [idep_mesautil, dep_thread, idep_intel_dev],
|
|
|
|
|
include_directories : [inc_include, inc_src, inc_intel],
|
|
|
|
|
link_with : [libintel_common, libintel_compiler],
|
|
|
|
|
c_args : [no_override_init_args],
|
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
|
install : true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
asm_testcases = [
|
|
|
|
|
['brw', 'gfx4'],
|
|
|
|
|
['g4x', 'gfx4.5'],
|
|
|
|
|
['ilk', 'gfx5'],
|
|
|
|
|
['snb', 'gfx6'],
|
|
|
|
|
['ivb', 'gfx7'],
|
|
|
|
|
['hsw', 'gfx7.5'],
|
|
|
|
|
['bdw', 'gfx8'],
|
|
|
|
|
['skl', 'gfx9'],
|
|
|
|
|
['icl', 'gfx11'],
|
|
|
|
|
['tgl', 'gfx12'],
|
|
|
|
|
['dg2', 'gfx12.5'],
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
test_runner = find_program('tests/run-test.py')
|
|
|
|
|
foreach testcase : asm_testcases
|
|
|
|
|
_gen_name = testcase[0]
|
|
|
|
|
_gen_num = testcase[1]
|
|
|
|
|
_gen_folder = join_paths(meson.current_source_dir(), 'tests',
|
|
|
|
|
_gen_num.replace('gfx', 'gen'))
|
|
|
|
|
test(
|
|
|
|
|
'brw_asm_' + _gen_num, test_runner,
|
|
|
|
|
args : [
|
|
|
|
|
'--brw_asm', brw_asm_tool,
|
|
|
|
|
'--gen_name', _gen_name,
|
|
|
|
|
'--gen_folder', _gen_folder,
|
|
|
|
|
],
|
|
|
|
|
suite : 'intel',
|
|
|
|
|
)
|
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
brw_disasm_tool = executable(
|
|
|
|
|
'brw_disasm',
|
|
|
|
|
files('brw_disasm_tool.c'),
|
|
|
|
|
dependencies : [idep_mesautil, dep_thread, idep_intel_dev],
|
|
|
|
|
include_directories : [inc_include, inc_src, inc_intel],
|
|
|
|
|
link_with : [libintel_common, libintel_compiler],
|
|
|
|
|
c_args : [no_override_init_args],
|
|
|
|
|
gnu_symbol_visibility : 'hidden',
|
|
|
|
|
install : true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|