Mesa (master): bifrost: Add lowering for b2i32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 27 17:09:32 UTC 2020


Module: Mesa
Branch: master
Commit: ef781880eb3969620e19ba118410456e3ca300f6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef781880eb3969620e19ba118410456e3ca300f6

Author: Chris Forbes <chrisforbes at google.com>
Date:   Sun Jul 26 10:43:33 2020 -0700

bifrost: Add lowering for b2i32

Since the bool representation is 0/~0, we can convert to int
just by &1.

Signed-off-by: Chris Forbes <chrisforbes at google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6079>

---

 src/panfrost/bifrost/bifrost_nir_algebraic.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/bifrost_nir_algebraic.py b/src/panfrost/bifrost/bifrost_nir_algebraic.py
index d28c82d401a..6f3f6eee1a9 100644
--- a/src/panfrost/bifrost/bifrost_nir_algebraic.py
+++ b/src/panfrost/bifrost/bifrost_nir_algebraic.py
@@ -87,7 +87,8 @@ for op in SPECIAL:
         converts += [((op + '@16', a), ('f2f16', (op, ('f2f32', a))))]
 
 converts += [(('f2b32', a), ('fne32', a, 0.0)),
-             (('i2b32', a), ('ine32', a, 0))]
+             (('i2b32', a), ('ine32', a, 0)),
+             (('b2i32', a), ('iand', 'a at 32', 1))]
 
 def main():
     parser = argparse.ArgumentParser()



More information about the mesa-commit mailing list