pan/bi: Optimize pattern from nir_lower_idiv

This takes advantage of the .i1 modifier on the comparison to get b2i32 "for
free" in typical circumstances, saving an instruction. Will help with an instr
count regression from lower_idiv.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17266>
This commit is contained in:
Alyssa Rosenzweig 2022-08-02 10:16:11 -04:00 committed by Marge Bot
parent 1ef20f1f35
commit 35a7490ce2

View file

@ -53,6 +53,8 @@ algebraic_late = [
(('fabs', ('fddx', a)), ('fabs', ('fddx_must_abs_mali', a))),
(('fabs', ('fddy', b)), ('fabs', ('fddy_must_abs_mali', b))),
(('b32csel', 'b@32', ('iadd', 'a@32', 1), a), ('iadd', a, ('b2i32', b))),
]
# Handling all combinations of boolean and float sizes for b2f is nontrivial.