Mesa (master): pan/mdg: Allow f2u8 and friends thru

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 16:06:16 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon May 25 14:46:53 2020 -0400

pan/mdg: Allow f2u8 and friends thru

Now that we can handle destination sizes directly, this keeps us from
needing to chew through so many conversions.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5285>

---

 src/panfrost/midgard/midgard_nir_algebraic.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/panfrost/midgard/midgard_nir_algebraic.py b/src/panfrost/midgard/midgard_nir_algebraic.py
index b611ba5a94c..fd250c1ba94 100644
--- a/src/panfrost/midgard/midgard_nir_algebraic.py
+++ b/src/panfrost/midgard/midgard_nir_algebraic.py
@@ -68,7 +68,8 @@ algebraic_late = [
 
 
 # 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
+# NIR wants more than one step, we need to break up into multiple instructions.
+# Nevertheless, we can do both a size step and a floating/int step at once.
 
 converts = []
 
@@ -85,8 +86,7 @@ for op in ('u2u', 'i2i', 'f2f', 'i2f', 'u2f', 'f2i', 'f2u'):
         while srcsz <= srcsz_max:
             # Size converter lowering is only needed if src and dst sizes are
             # spaced by a factor > 2.
-            # Type converter lowering is needed as soon as src_size != dst_size
-            if srcsz != dstsz and ((srcsz * 2 != dstsz and srcsz != dstsz * 2) or op[0] != op[2]):
+            if srcsz != dstsz and (srcsz * 2 != dstsz and srcsz != dstsz * 2):
                 cursz = srcsz
                 rule = a
                 # When converting down we first do the type conversion followed



More information about the mesa-commit mailing list