mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
intel/elk: Compile ELK library, tests and tools
For now is not linked to any driver. The tools were renamed to use elk prefix to avoid conflicting with the brw ones. The run-test.py script was also updated due to that change. Before the new compiler can be linked together with the old (going to be done for Iris and other tools), the symbol conflicts need to be fixed first. This will happen in a later commit. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27563>
This commit is contained in:
parent
d44462c08d
commit
0083585fc5
7 changed files with 38 additions and 87 deletions
|
|
@ -29,11 +29,11 @@
|
|||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "compiler/brw_reg.h"
|
||||
#include "compiler/brw_reg_type.h"
|
||||
#include "compiler/brw_eu_defines.h"
|
||||
#include "compiler/brw_inst.h"
|
||||
#include "compiler/brw_eu.h"
|
||||
#include "brw_reg.h"
|
||||
#include "brw_reg_type.h"
|
||||
#include "brw_eu_defines.h"
|
||||
#include "brw_inst.h"
|
||||
#include "brw_eu.h"
|
||||
#include "dev/intel_device_info.h"
|
||||
#include "util/list.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ const struct nir_shader_compiler_options brw_vector_nir_options = {
|
|||
struct brw_compiler *
|
||||
brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
|
||||
{
|
||||
assert(devinfo->ver <= 8);
|
||||
|
||||
struct brw_compiler *compiler = rzalloc(mem_ctx, struct brw_compiler);
|
||||
|
||||
compiler->devinfo = devinfo;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include "util/ralloc.h"
|
||||
#include "util/u_math.h"
|
||||
#include "brw_isa_info.h"
|
||||
#include "intel_shader_enums.h"
|
||||
#include "../intel_shader_enums.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import sys
|
|||
from mako.template import Template
|
||||
from mako import exceptions
|
||||
|
||||
sys.path.append(f"{os.path.dirname(sys.argv[0])}/../dev")
|
||||
sys.path.append(f"{os.path.dirname(sys.argv[0])}/../../dev")
|
||||
import intel_device_info
|
||||
|
||||
template = COPYRIGHT + """
|
||||
|
|
|
|||
|
|
@ -18,25 +18,7 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
intel_nir_files = files(
|
||||
'intel_nir.h',
|
||||
'intel_nir.c',
|
||||
|
||||
'intel_nir_blockify_uniform_loads.c',
|
||||
'intel_nir_clamp_image_1d_2d_array_sizes.c',
|
||||
'intel_nir_clamp_per_vertex_loads.c',
|
||||
'intel_nir_lower_conversions.c',
|
||||
'intel_nir_lower_non_uniform_barycentric_at_sample.c',
|
||||
'intel_nir_lower_non_uniform_resource_intel.c',
|
||||
'intel_nir_lower_shading_rate_output.c',
|
||||
'intel_nir_lower_sparse.c',
|
||||
'intel_nir_lower_texture.c',
|
||||
'intel_nir_opt_peephole_ffma.c',
|
||||
'intel_nir_opt_peephole_imul32x16.c',
|
||||
'intel_nir_tcs_workarounds.c',
|
||||
)
|
||||
|
||||
libintel_compiler_files = files(
|
||||
libintel_compiler_elk_files = files(
|
||||
'brw_cfg.cpp',
|
||||
'brw_cfg.h',
|
||||
'brw_clip.h',
|
||||
|
|
@ -54,6 +36,7 @@ libintel_compiler_files = files(
|
|||
'brw_dead_control_flow.h',
|
||||
'brw_debug_recompile.c',
|
||||
'brw_disasm.c',
|
||||
'brw_disasm.h',
|
||||
'brw_disasm_info.c',
|
||||
'brw_disasm_info.h',
|
||||
'brw_eu.c',
|
||||
|
|
@ -156,13 +139,12 @@ libintel_compiler_files = files(
|
|||
'gfx6_gs_visitor.h',
|
||||
)
|
||||
|
||||
brw_device_sha1_gen_src = custom_target('brw_device_sha1_gen.c',
|
||||
input : ['brw_device_sha1_gen_c.py', '../dev/intel_device_info.py'],
|
||||
elk_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()])
|
||||
|
||||
|
||||
brw_nir_trig = custom_target(
|
||||
elk_nir_trig = custom_target(
|
||||
'brw_nir_trig_workarounds.c',
|
||||
input : 'brw_nir_trig_workarounds.py',
|
||||
output : 'brw_nir_trig_workarounds.c',
|
||||
|
|
@ -173,9 +155,9 @@ brw_nir_trig = custom_target(
|
|||
capture : true,
|
||||
)
|
||||
|
||||
libintel_compiler = static_library(
|
||||
'intel_compiler',
|
||||
[libintel_compiler_files, intel_nir_files, brw_nir_trig, ir_expression_operation_h, [brw_device_sha1_gen_src]],
|
||||
libintel_compiler_elk = static_library(
|
||||
'intel_compiler_elk',
|
||||
[libintel_compiler_elk_files, intel_nir_files, elk_nir_trig, ir_expression_operation_h, [elk_device_sha1_gen_src]],
|
||||
include_directories : [inc_include, inc_src, inc_intel],
|
||||
c_args : [no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
|
|
@ -183,32 +165,11 @@ libintel_compiler = static_library(
|
|||
build_by_default : false,
|
||||
)
|
||||
|
||||
# For now this tool is only going to be used by Anv
|
||||
if get_option('intel-clc') == 'system'
|
||||
prog_intel_clc = find_program('intel_clc', native : true)
|
||||
dep_prog_intel_clc = []
|
||||
elif with_intel_clc
|
||||
prog_intel_clc = executable(
|
||||
'intel_clc',
|
||||
['intel_clc.c', 'brw_kernel.c'],
|
||||
link_with : [
|
||||
libintel_compiler, libintel_common,libisl,
|
||||
],
|
||||
include_directories : [inc_include, inc_src, inc_intel],
|
||||
c_args : [pre_args, no_override_init_args],
|
||||
link_args : [ld_args_build_id],
|
||||
dependencies : [idep_nir, idep_vtn, idep_mesaclc, idep_mesautil, idep_intel_dev],
|
||||
native : true,
|
||||
install : get_option('install-intel-clc'),
|
||||
)
|
||||
dep_prog_intel_clc = [prog_intel_clc]
|
||||
endif
|
||||
|
||||
if with_tests
|
||||
test(
|
||||
'intel_compiler_tests',
|
||||
'intel_compiler_elk_tests',
|
||||
executable(
|
||||
'intel_compiler_tests',
|
||||
'intel_compiler_elk_tests',
|
||||
files(
|
||||
'test_predicated_break.cpp',
|
||||
'test_eu_compact.cpp',
|
||||
|
|
@ -228,7 +189,7 @@ if with_tests
|
|||
ir_expression_operation_h,
|
||||
include_directories : [inc_include, inc_src, inc_intel],
|
||||
link_with : [
|
||||
libintel_compiler, libintel_common, libisl
|
||||
libintel_compiler_elk, libintel_common, libisl
|
||||
],
|
||||
dependencies : [idep_gtest, idep_nir, idep_mesautil, idep_intel_dev],
|
||||
),
|
||||
|
|
@ -239,39 +200,26 @@ endif
|
|||
|
||||
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(
|
||||
elk_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(
|
||||
elk_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],
|
||||
elk_asm_tool = executable(
|
||||
'elk_asm',
|
||||
['brw_asm_tool.c', elk_gram_tab[0], elk_gram_tab[1], elk_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],
|
||||
link_with : [libintel_common, libintel_compiler_elk],
|
||||
c_args : [no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true
|
||||
|
|
@ -298,9 +246,9 @@ foreach testcase : asm_testcases
|
|||
_gen_folder = join_paths(meson.current_source_dir(), 'tests',
|
||||
_gen_num.replace('gfx', 'gen'))
|
||||
test(
|
||||
'brw_asm_' + _gen_num, test_runner,
|
||||
'elk_asm_' + _gen_num, test_runner,
|
||||
args : [
|
||||
'--brw_asm', brw_asm_tool,
|
||||
'--elk_asm', elk_asm_tool,
|
||||
'--gen_name', _gen_name,
|
||||
'--gen_folder', _gen_folder,
|
||||
],
|
||||
|
|
@ -308,12 +256,12 @@ foreach testcase : asm_testcases
|
|||
)
|
||||
endforeach
|
||||
|
||||
brw_disasm_tool = executable(
|
||||
'brw_disasm',
|
||||
elk_disasm_tool = executable(
|
||||
'elk_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],
|
||||
link_with : [libintel_common, libintel_compiler_elk],
|
||||
c_args : [no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : true
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ except ImportError:
|
|||
from shlex import split as split_args
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--brw_asm',
|
||||
help='path to brw_asm binary')
|
||||
parser.add_argument('--elk_asm',
|
||||
help='path to elk_asm binary')
|
||||
parser.add_argument('--gen_name',
|
||||
help='name of the hardware generation (as understood by brw_asm)')
|
||||
help='name of the hardware generation (as understood by elk_asm)')
|
||||
parser.add_argument('--gen_folder',
|
||||
type=pathlib.Path,
|
||||
help='name of the folder for the generation')
|
||||
|
|
@ -27,9 +27,9 @@ args = parser.parse_args()
|
|||
|
||||
wrapper = os.environ.get('MESON_EXE_WRAPPER')
|
||||
if wrapper is not None:
|
||||
brw_asm = split_args(wrapper) + [args.brw_asm]
|
||||
elk_asm = split_args(wrapper) + [args.elk_asm]
|
||||
else:
|
||||
brw_asm = [args.brw_asm]
|
||||
elk_asm = [args.elk_asm]
|
||||
|
||||
if not args.gen_folder.is_dir():
|
||||
print('Test files path does not exist or is not a directory.',
|
||||
|
|
@ -43,7 +43,7 @@ for asm_file in args.gen_folder.glob('*.asm'):
|
|||
expected_path = args.gen_folder / expected_file
|
||||
|
||||
try:
|
||||
command = brw_asm + [
|
||||
command = elk_asm + [
|
||||
'--type', 'hex',
|
||||
'--gen', args.gen_name,
|
||||
asm_file
|
||||
|
|
|
|||
|
|
@ -321,3 +321,4 @@ brw_disasm_tool = executable(
|
|||
|
||||
endif
|
||||
|
||||
subdir('elk')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue