bifrost: Lower x->bool conversions to != 0
authorChris Forbes <chrisforbes@google.com>
Sun, 26 Jul 2020 03:11:11 +0000 (20:11 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Jul 2020 16:53:52 +0000 (16:53 +0000)
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6079>

src/panfrost/bifrost/bifrost_nir_algebraic.py

index 5e2c65c68ac59bf68eb3a24102fd2214586cf91a..d28c82d401ab41555f74c9890501baf50fa9c11a 100644 (file)
@@ -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)