From 0ffefad7916969b4de24aa14140f5e40d0cec58a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 25 Jul 2020 20:11:11 -0700 Subject: [PATCH] bifrost: Lower x->bool conversions to != 0 Signed-off-by: Chris Forbes Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_nir_algebraic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_nir_algebraic.py b/src/panfrost/bifrost/bifrost_nir_algebraic.py index 5e2c65c68ac..d28c82d401a 100644 --- a/src/panfrost/bifrost/bifrost_nir_algebraic.py +++ b/src/panfrost/bifrost/bifrost_nir_algebraic.py @@ -86,6 +86,9 @@ SPECIAL = ['fexp2', 'flog2', 'fsin', 'fcos'] for op in SPECIAL: converts += [((op + '@16', a), ('f2f16', (op, ('f2f32', a))))] +converts += [(('f2b32', a), ('fne32', a, 0.0)), + (('i2b32', a), ('ine32', a, 0))] + def main(): parser = argparse.ArgumentParser() parser.add_argument('-p', '--import-path', required=True) -- 2.30.2