freedreno/ir3: tidy up duplication of common nir options

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>
This commit is contained in:
Timothy Arceri 2022-05-18 16:00:42 +10:00 committed by Marge Bot
parent 0f1cbcd6a7
commit 34e868d882
1 changed files with 49 additions and 90 deletions

View File

@ -70,110 +70,71 @@ ir3_compiler_destroy(struct ir3_compiler *compiler)
ralloc_free(compiler);
}
#define COMMON_OPTIONS \
.lower_fpow = true, \
.lower_scmp = true, \
.lower_flrp16 = true, \
.lower_flrp32 = true, \
.lower_flrp64 = true, \
.lower_ffract = true, \
.lower_fmod = true, \
.lower_fdiv = true, \
.lower_isign = true, \
.lower_ldexp = true, \
.lower_uadd_carry = true, \
.lower_usub_borrow = true, \
.lower_mul_high = true, \
.lower_mul_2x32_64 = true, \
.fuse_ffma16 = true, \
.fuse_ffma32 = true, \
.fuse_ffma64 = true, \
.vertex_id_zero_based = false, \
.lower_extract_byte = true, \
.lower_extract_word = true, \
.lower_insert_byte = true, \
.lower_insert_word = true, \
.lower_helper_invocation = true, \
.lower_bitfield_insert_to_shifts = true, \
.lower_bitfield_extract_to_shifts = true, \
.lower_pack_half_2x16 = true, \
.lower_pack_snorm_4x8 = true, \
.lower_pack_snorm_2x16 = true, \
.lower_pack_unorm_4x8 = true, \
.lower_pack_unorm_2x16 = true, \
.lower_unpack_half_2x16 = true, \
.lower_unpack_snorm_4x8 = true, \
.lower_unpack_snorm_2x16 = true, \
.lower_unpack_unorm_4x8 = true, \
.lower_unpack_unorm_2x16 = true, \
.lower_pack_split = true, \
.use_interpolated_input_intrinsics = true, \
.lower_rotate = true, \
.lower_to_scalar = true, \
.has_imul24 = true, \
.has_fsub = true, \
.has_isub = true, \
.force_indirect_unrolling_sampler = true, \
.lower_uniforms_to_ubo = true, \
.use_scoped_barrier = true
static const nir_shader_compiler_options nir_options = {
.lower_fpow = true,
.lower_scmp = true,
.lower_flrp16 = true,
.lower_flrp32 = true,
.lower_flrp64 = true,
.lower_ffract = true,
.lower_fmod = true,
.lower_fdiv = true,
.lower_isign = true,
.lower_ldexp = true,
.lower_uadd_carry = true,
.lower_usub_borrow = true,
.lower_mul_high = true,
.lower_mul_2x32_64 = true,
.fuse_ffma16 = true,
.fuse_ffma32 = true,
.fuse_ffma64 = true,
.vertex_id_zero_based = true,
.lower_extract_byte = true,
.lower_extract_word = true,
.lower_insert_byte = true,
.lower_insert_word = true,
.lower_helper_invocation = true,
.lower_bitfield_insert_to_shifts = true,
.lower_bitfield_extract_to_shifts = true,
.lower_pack_half_2x16 = true,
.lower_pack_snorm_4x8 = true,
.lower_pack_snorm_2x16 = true,
.lower_pack_unorm_4x8 = true,
.lower_pack_unorm_2x16 = true,
.lower_unpack_half_2x16 = true,
.lower_unpack_snorm_4x8 = true,
.lower_unpack_snorm_2x16 = true,
.lower_unpack_unorm_4x8 = true,
.lower_unpack_unorm_2x16 = true,
.lower_pack_split = true,
.use_interpolated_input_intrinsics = true,
.lower_rotate = true,
.lower_to_scalar = true,
.has_imul24 = true,
.has_fsub = true,
.has_isub = true,
COMMON_OPTIONS,
.lower_wpos_pntc = true,
.lower_cs_local_index_to_id = true,
.force_indirect_unrolling_sampler = true,
/* Only needed for the spirv_to_nir() pass done in ir3_cmdline.c
* but that should be harmless for GL since 64b is not
* supported there.
*/
.lower_int64_options = (nir_lower_int64_options)~0,
.lower_uniforms_to_ubo = true,
.use_scoped_barrier = true,
};
/* we don't want to lower vertex_id to _zero_based on newer gpus: */
static const nir_shader_compiler_options nir_options_a6xx = {
.lower_fpow = true,
.lower_scmp = true,
.lower_flrp16 = true,
.lower_flrp32 = true,
.lower_flrp64 = true,
.lower_ffract = true,
.lower_fmod = true,
.lower_fdiv = true,
.lower_isign = true,
.lower_ldexp = true,
.lower_uadd_carry = true,
.lower_usub_borrow = true,
.lower_mul_high = true,
.lower_mul_2x32_64 = true,
.fuse_ffma16 = true,
.fuse_ffma32 = true,
.fuse_ffma64 = true,
.vertex_id_zero_based = false,
.lower_extract_byte = true,
.lower_extract_word = true,
.lower_insert_byte = true,
.lower_insert_word = true,
.lower_helper_invocation = true,
.lower_bitfield_insert_to_shifts = true,
.lower_bitfield_extract_to_shifts = true,
.lower_pack_half_2x16 = true,
.lower_pack_snorm_4x8 = true,
.lower_pack_snorm_2x16 = true,
.lower_pack_unorm_4x8 = true,
.lower_pack_unorm_2x16 = true,
.lower_unpack_half_2x16 = true,
.lower_unpack_snorm_4x8 = true,
.lower_unpack_snorm_2x16 = true,
.lower_unpack_unorm_4x8 = true,
.lower_unpack_unorm_2x16 = true,
.lower_pack_split = true,
.use_interpolated_input_intrinsics = true,
.lower_rotate = true,
COMMON_OPTIONS,
.vectorize_io = true,
.lower_to_scalar = true,
.has_imul24 = true,
.has_fsub = true,
.has_isub = true,
.max_unroll_iterations = 32,
.force_indirect_unrolling = nir_var_all,
.force_indirect_unrolling_sampler = true,
.lower_wpos_pntc = true,
.lower_cs_local_index_to_id = true,
@ -182,9 +143,7 @@ static const nir_shader_compiler_options nir_options_a6xx = {
* supported there.
*/
.lower_int64_options = (nir_lower_int64_options)~0,
.lower_uniforms_to_ubo = true,
.lower_device_index_to_zero = true,
.use_scoped_barrier = true,
.has_udot_4x8 = true,
.has_sudot_4x8 = true,
};