summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2020-04-24 14:27:33 -0400
committerMarge Bot <[email protected]>2020-04-27 18:40:03 +0000
commit42093bb694bdcb6fb5bb762c118520c107456f4a (patch)
tree68170419e5cde64b2c7ac49b10defd5687f970c2 /src/compiler
parentcbeda7f78e36caa7e4ca775bd848e1c8d38ee5d7 (diff)
nir: add pack_32_2x16_split/unpack_32_2x16_split lowering
The new option replaces the two other _split lowering options, since there's no need for separate options. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4738>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir.h4
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py18
2 files changed, 17 insertions, 5 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index ce12410b79b..59a034f1907 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2863,18 +2863,18 @@ 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;
bool lower_unpack_snorm_4x8;
+ bool lower_pack_split;
+
bool lower_extract_byte;
bool lower_extract_word;
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index bcf13bdf399..b2643641a8e 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -1295,15 +1295,27 @@ optimizations.extend([
(('pack_half_2x16_split', 'a@32', 'b@32'),
('ior', ('ishl', ('u2u32', ('f2f16', b)), 16), ('u2u32', ('f2f16', a))),
- 'options->lower_pack_half_2x16_split'),
+ 'options->lower_pack_split'),
(('unpack_half_2x16_split_x', 'a@32'),
('f2f32', ('u2u16', a)),
- 'options->lower_unpack_half_2x16_split'),
+ 'options->lower_pack_split'),
(('unpack_half_2x16_split_y', 'a@32'),
('f2f32', ('u2u16', ('ushr', a, 16))),
- 'options->lower_unpack_half_2x16_split'),
+ 'options->lower_pack_split'),
+
+ (('pack_32_2x16_split', 'a@16', 'b@16'),
+ ('ior', ('ishl', ('u2u32', b), 16), ('u2u32', a)),
+ 'options->lower_pack_split'),
+
+ (('unpack_32_2x16_split_x', 'a@32'),
+ ('u2u16', a),
+ 'options->lower_pack_split'),
+
+ (('unpack_32_2x16_split_y', 'a@32'),
+ ('u2u16', ('ushr', 'a', 16)),
+ 'options->lower_pack_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'),