pan/bi: Lower b2f to bcsel

Since we can get a zero for free and a one inlined into the constant,
the obvious turns out to be efficient (while allowing flexibility for
boolean size).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4139>
This commit is contained in:
Alyssa Rosenzweig 2020-03-10 08:33:11 -04:00 committed by Marge Bot
parent d3823551b4
commit 08ab7cecd9

View file

@ -38,6 +38,8 @@ algebraic_late = [
(('ineg', a), ('isub', 0, a)),
]
for sz in ('16', '32', '64'):
algebraic_late += [(('b2f' + sz, 'a@1'), ('bcsel', a, 1.0, 0.0))]
# Midgard is able to type convert down by only one "step" per instruction; if
# NIR wants more than one step, we need to break up into multiple instructions