panfrost/midgard: Make sure promote_fmov() only promotes 32-bit imovs
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 20 Jan 2020 14:55:21 +0000 (15:55 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Jan 2020 15:31:28 +0000 (15:31 +0000)
mir_constant_float() assumes we're dealing with 32-bit integers/floats,
which is only the case if reg_mode is equal to midgard_reg_mode_32.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3478>

src/panfrost/midgard/midgard_opt_float.c

index ab6e57be3f8e166371dd9c68d939a130f5d269fe..43e1cd2ea78c79a1f7e88b430ef9da194839a254 100644 (file)
@@ -56,6 +56,7 @@ midgard_opt_promote_fmov(compiler_context *ctx, midgard_block *block)
                 if (!ins->has_constants) continue;
                 if (mir_nontrivial_source2_mod_simple(ins)) continue;
                 if (mir_nontrivial_outmod(ins)) continue;
+                if (ins->alu.reg_mode != midgard_reg_mode_32) continue;
 
                 /* We found an imov with a constant. Check the constants */
                 bool ok = true;