nir/opt_algebraic: optimize unpack_32_2x16 of extract

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39511>
This commit is contained in:
Georg Lehmann 2026-01-24 19:39:25 +01:00 committed by Marge Bot
parent b4b1aa6eb8
commit b18d9c1b33

View file

@ -2276,6 +2276,9 @@ optimizations.extend([
(('extract_u8', ('pack_32_4x8_split', a, b, c, d), 2), ('u2u', c)),
(('extract_u8', ('pack_32_4x8_split', a, b, c, d), 3), ('u2u', d)),
(('unpack_32_2x16', ('extract_u16', a, 0)), ('vec2', ('unpack_32_2x16.x', a), 0)),
(('unpack_32_2x16', ('extract_u16', a, 1)), ('vec2', ('unpack_32_2x16.y', a), 0)),
# Reduce intermediate precision with int64.
(('u2u32', ('iadd(is_used_once)', 'a@64', b)),
('iadd', ('u2u32', a), ('u2u32', b))),