pan/midgard: Force perspective ops to use vec4
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 24 Jul 2019 22:36:46 +0000 (15:36 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 25 Jul 2019 13:37:22 +0000 (06:37 -0700)
It doesn't make sense to use them with anything less.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_ra.c

index 19c60f4b05dfde7ff89d84cf3b9a2d26f5d385ab..485ab789cd4a997c11ef8c31844b1cc2c3cb7e43 100644 (file)
@@ -317,6 +317,16 @@ set_class(unsigned *classes, unsigned node, unsigned class)
         classes[node] |= (class << 2);
 }
 
+static void
+force_vec4(unsigned *classes, unsigned node)
+{
+        if ((node < 0) || (node >= SSA_FIXED_MINIMUM))
+                return;
+
+        /* Force vec4 = 3 */
+        classes[node] |= 0x3;
+}
+
 /* Special register classes impose special constraints on who can read their
  * values, so check that */
 
@@ -514,6 +524,12 @@ allocate_registers(compiler_context *ctx, bool *spilled)
 
                         set_class(found_class, ins->ssa_args.src0, class);
                         set_class(found_class, ins->ssa_args.src1, class);
+
+                        if (force_r27) {
+                                force_vec4(found_class, ins->ssa_args.dest);
+                                force_vec4(found_class, ins->ssa_args.src0);
+                                force_vec4(found_class, ins->ssa_args.src1);
+                        }
                 }
         }