From 08ab7cecd98ca5e128ed3bfc7cc38b0a24b37181 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 10 Mar 2020 08:33:11 -0400 Subject: [PATCH] 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 Part-of: --- src/panfrost/bifrost/bifrost_nir_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_nir_algebraic.py b/src/panfrost/bifrost/bifrost_nir_algebraic.py index fd31bdca9e7..1fb49b1c690 100644 --- a/src/panfrost/bifrost/bifrost_nir_algebraic.py +++ b/src/panfrost/bifrost/bifrost_nir_algebraic.py @@ -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 -- 2.30.2