From: Isabella Basso Date: Fri, 10 Mar 2023 20:20:09 +0000 (-0300) Subject: nir/algebraic: extend mediump patterns X-Git-Tag: upstream/23.3.3~11796 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a27bcd63d0bcde0e08197b1ac0b36c6c132af06c;p=platform%2Fupstream%2Fmesa.git nir/algebraic: extend mediump patterns Acked-by: Alyssa Rosenzweig Suggested-by: Italo Nicola Signed-off-by: Isabella Basso Part-of: --- diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index e844524..4857f62 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1488,11 +1488,17 @@ optimizations.extend([ (('i2i32', ('i2imp', 'a@32')), a), (('u2u32', ('i2imp', 'a@32')), a), + # typeA@32 -> typeB@16 -> typeB@32 ==> typeA@32 -> typeB@32 (('i2i32', ('f2imp', 'a@32')), ('f2i32', a)), (('u2u32', ('f2ump', 'a@32')), ('f2u32', a)), (('f2f32', ('i2fmp', 'a@32')), ('i2f32', a)), (('f2f32', ('u2fmp', 'a@32')), ('u2f32', a)), + # typeA@32 -> typeA@16 -> typeB@32 ==> typeA@32 -> typeB@32 + (('f2i32', ('f2fmp', 'a@32')), ('f2i32', a)), + (('f2u32', ('f2fmp', 'a@32')), ('f2u32', a)), + (('i2f32', ('i2imp', 'a@32')), ('i2f32', a)), + # Conversions from float32 to float64 and back can be removed as long as # it doesn't need to be precise, since the conversion may e.g. flush denorms (('~f2f32', ('f2f64', 'a@32')), a),