pan/mdg: Prefer type over regmode for schedule constraints
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 12 Jun 2020 16:22:54 +0000 (12:22 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 12 Jun 2020 16:57:11 +0000 (12:57 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5443>

src/panfrost/midgard/midgard_schedule.c

index 114a8de3211b7a51410c512e272d909fb0e5e26a..9dee152c5e49c0f157245ecf037c173cfae0eb43 100644 (file)
@@ -198,12 +198,12 @@ mir_is_scalar(midgard_instruction *ains)
 
         /* Otherwise, check mode hazards */
         bool could_scalar = true;
+        unsigned szd = nir_alu_type_get_type_size(ains->dest_type);
         unsigned sz0 = nir_alu_type_get_type_size(ains->src_types[0]);
         unsigned sz1 = nir_alu_type_get_type_size(ains->src_types[1]);
 
         /* Only 16/32-bit can run on a scalar unit */
-        could_scalar &= ains->alu.reg_mode != midgard_reg_mode_8;
-        could_scalar &= ains->alu.reg_mode != midgard_reg_mode_64;
+        could_scalar &= (szd == 16) || (szd == 32);
 
         if (ains->src[0] != ~0)
                 could_scalar &= (sz0 == 16) || (sz0 == 32);