From 62768590d5414a40e6b22a22a7a50e66893d0451 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 27 Apr 2020 20:09:43 -0400 Subject: [PATCH] pan/mdg: Lower specials to 32-bit Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard_nir_algebraic.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panfrost/midgard/midgard_nir_algebraic.py b/src/panfrost/midgard/midgard_nir_algebraic.py index 2ba9f226d22..3dc1900cca1 100644 --- a/src/panfrost/midgard/midgard_nir_algebraic.py +++ b/src/panfrost/midgard/midgard_nir_algebraic.py @@ -83,6 +83,12 @@ for op in ('u2u', 'i2i', 'f2f', 'i2f', 'u2f', 'f2i', 'f2u'): srcsz *= 2 dstsz *= 2 +# Midgard outputs fp32 for specials. The f2f32 will be folded in later. +SPECIAL = ['fexp2', 'flog2', 'fsin', 'fcos', 'frcp', 'frsq'] + +for op in SPECIAL: + converts += [((op + '@16', a), ('f2f16', (op, ('f2f32', a))))] + # Midgard scales fsin/fcos arguments by pi. # Pass must be run only once, after the main loop -- 2.30.2