From 293d37e19d8213213719fa975d8801fb126a0c51 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 25 May 2020 14:46:53 -0400 Subject: [PATCH] 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 Part-of: --- 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 -- 2.30.2