diff options
author | Rob Clark <[email protected]> | 2018-03-15 18:42:44 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-03-27 08:36:37 -0400 |
commit | 76dfed8ae2d5c6c509eb2661389be3c6a25077df (patch) | |
tree | e811d58f7f277c7844c3421eab1203e7d55607a2 /src/compiler/nir/meson.build | |
parent | cc3a88e81dbceb12b79eb4ebe7a4ce5ba97fc291 (diff) |
nir: mako all the intrinsics
I threatened to do this a long time ago.. I probably *should* have done
it a long time ago when there where many fewer intrinsics. But the
system of macro/#include magic for dealing with intrinsics is a bit
annoying, and python has the nice property of optional fxn params,
making it possible to define new intrinsics while ignoring parameters
that are not applicable (and naming optional params). And not having to
specify various array lengths explicitly is nice too.
I think the end result makes it easier to add new intrinsics.
v2: couple small fixes found with a test program to compare the old and
new tables
v3: misc comments, don't rely on capture=true for meson.build, get rid
of system_values table to avoid return value of intrinsic() and
*mostly* remove side-effects, add autotools build support
v4: scons build
Signed-off-by: Rob Clark <[email protected]>
Acked-by: Dylan Baker <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/meson.build')
-rw-r--r-- | src/compiler/nir/meson.build | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build index 887035d7595..cbee73256ef 100644 --- a/src/compiler/nir/meson.build +++ b/src/compiler/nir/meson.build @@ -65,6 +65,24 @@ nir_opt_algebraic_c = custom_target( depend_files : files('nir_algebraic.py'), ) +nir_intrinsics_h = custom_target( + 'nir_intrinsics.h', + input : 'nir_intrinsics_h.py', + output : 'nir_intrinsics.h', + command : [prog_python2, '@INPUT@', '--outdir', meson.current_build_dir()], + capture : false, + depend_files : files('nir_intrinsics.py'), +) + +nir_intrinsics_c = custom_target( + 'nir_intrinsic.c', + input : 'nir_intrinsics_c.py', + output : 'nir_intrinsics.c', + command : [prog_python2, '@INPUT@', '--outdir', meson.current_build_dir()], + capture: false, + depend_files : files('nir_intrinsics.py'), +) + spirv_info_c = custom_target( 'spirv_info.c', input : files('../spirv/spirv_info_c.py', '../spirv/spirv.core.grammar.json'), @@ -96,8 +114,6 @@ files_libnir = files( 'nir_inline_functions.c', 'nir_instr_set.c', 'nir_instr_set.h', - 'nir_intrinsics.c', - 'nir_intrinsics.h', 'nir_linking_helpers.c', 'nir_liveness.c', 'nir_loop_analyze.c', @@ -202,7 +218,7 @@ libnir = static_library( 'nir', [files_libnir, spirv_info_c, nir_opt_algebraic_c, nir_opcodes_c, nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h, - vtn_gather_types_c], + vtn_gather_types_c, nir_intrinsics_c, nir_intrinsics_h], include_directories : [inc_common, inc_compiler, include_directories('../spirv')], c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args], link_with : libcompiler, @@ -211,7 +227,7 @@ libnir = static_library( # Headers-only dependency idep_nir_headers = declare_dependency( - sources : [nir_opcodes_h, nir_builder_opcodes_h], + sources : [nir_opcodes_h, nir_builder_opcodes_h, nir_intrinsics_h], include_directories : include_directories('.'), ) |