nir/opt_algebraic: canonicalize scmp with -0.0

We already do this for non fused comparisons.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39123>
This commit is contained in:
Georg Lehmann 2026-01-02 10:28:01 +01:00 committed by Marge Bot
parent 2824c12252
commit 7d2a946730

View file

@ -1499,6 +1499,12 @@ optimizations.extend([
(('sge', a, b), ('b2f', ('fge', a, b)), 'options->lower_scmp'),
(('seq', a, b), ('b2f', ('feq', a, b)), 'options->lower_scmp'),
(('sne', a, b), ('b2f', ('fneu', a, b)), 'options->lower_scmp'),
(('slt', a, '#b(is_negative_zero)'), ('slt', a, 0.0)),
(('slt', '#b(is_negative_zero)', a), ('slt', 0.0, a)),
(('sge', a, '#b(is_negative_zero)'), ('sge', a, 0.0)),
(('sge', '#b(is_negative_zero)', a), ('sge', 0.0, a)),
(('seq', a, '#b(is_negative_zero)'), ('seq', a, 0.0)),
(('sne', a, '#b(is_negative_zero)'), ('sne', a, 0.0)),
(('seq', ('seq', a, b), 1.0), ('seq', a, b)),
(('seq', ('sne', a, b), 1.0), ('sne', a, b)),
(('seq', ('slt', a, b), 1.0), ('slt', a, b)),