nir/algebraic: turn u{ge,lt} a, 1 to i{ne,eq} a, 0

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32189>
This commit is contained in:
Karmjit Mahil
2024-11-20 15:22:28 +01:00
committed by Marge Bot
parent 6b671d4dab
commit aad0aa0a9c

View File

@@ -1268,6 +1268,9 @@ optimizations.extend([
(('ior', ('uge', 2, a), ('ieq', a, 3)), ('uge', 3, a)),
(('ior', a, ('ieq', a, False)), True),
(('uge', a, 1), ('ine', a, 0)),
(('ult', a, 1), ('ieq', a, 0)),
(('ine', ('ineg', ('b2i', 'a@1')), ('ineg', ('b2i', 'b@1'))), ('ine', a, b)),
(('b2i', ('ine', 'a@1', 'b@1')), ('b2i', ('ixor', a, b))),