mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
nir: add option to lower half packing opcodes
Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3106>
This commit is contained in:
parent
2d3182b429
commit
004797002f
2 changed files with 14 additions and 0 deletions
|
|
@ -2761,11 +2761,13 @@ typedef struct nir_shader_compiler_options {
|
|||
bool lower_ldexp;
|
||||
|
||||
bool lower_pack_half_2x16;
|
||||
bool lower_pack_half_2x16_split;
|
||||
bool lower_pack_unorm_2x16;
|
||||
bool lower_pack_snorm_2x16;
|
||||
bool lower_pack_unorm_4x8;
|
||||
bool lower_pack_snorm_4x8;
|
||||
bool lower_unpack_half_2x16;
|
||||
bool lower_unpack_half_2x16_split;
|
||||
bool lower_unpack_unorm_2x16;
|
||||
bool lower_unpack_snorm_2x16;
|
||||
bool lower_unpack_unorm_4x8;
|
||||
|
|
|
|||
|
|
@ -1117,6 +1117,18 @@ optimizations.extend([
|
|||
127.0))),
|
||||
'options->lower_unpack_snorm_4x8'),
|
||||
|
||||
(('pack_half_2x16_split', 'a@32', 'b@32'),
|
||||
('ior', ('ishl', ('u2u32', ('f2f16', b)), 16), ('u2u32', ('f2f16', a))),
|
||||
'options->lower_pack_half_2x16_split'),
|
||||
|
||||
(('unpack_half_2x16_split_x', 'a@32'),
|
||||
('f2f32', ('u2u16', a)),
|
||||
'options->lower_unpack_half_2x16_split'),
|
||||
|
||||
(('unpack_half_2x16_split_y', 'a@32'),
|
||||
('f2f32', ('u2u16', ('ushr', a, 16))),
|
||||
'options->lower_unpack_half_2x16_split'),
|
||||
|
||||
(('isign', a), ('imin', ('imax', a, -1), 1), 'options->lower_isign'),
|
||||
(('fsign', a), ('fsub', ('b2f', ('flt', 0.0, a)), ('b2f', ('flt', a, 0.0))), 'options->lower_fsign'),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue