vc4: Use register allocator CLASS_BIT_R0_R3 to clean up CLASS_B.
authorEric Anholt <eric@anholt.net>
Thu, 10 Nov 2016 22:37:36 +0000 (14:37 -0800)
committerEric Anholt <eric@anholt.net>
Sun, 13 Nov 2016 02:46:35 +0000 (18:46 -0800)
We have had no reason to separate ability to store in an accumulator from
ability to store in B, but with FS threading, we need to be able to force
values to be stored only in the physical regfiles.

src/gallium/drivers/vc4/vc4_register_allocate.c

index ab343ee3134409ba9603b18790cf41a5136d6113..a067fbb33e8b25aeb8033d94e10b4d726a181c73 100644 (file)
@@ -166,7 +166,7 @@ node_to_temp_priority(const void *in_a, const void *in_b)
 }
 
 #define CLASS_BIT_A                    (1 << 0)
-#define CLASS_BIT_B_OR_ACC             (1 << 1)
+#define CLASS_BIT_B                    (1 << 1)
 #define CLASS_BIT_R4                   (1 << 2)
 #define CLASS_BIT_R0_R3                        (1 << 4)
 
@@ -212,7 +212,7 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
          * incrementally remove bits that the temp definitely can't be in.
          */
         memset(class_bits,
-               CLASS_BIT_A | CLASS_BIT_B_OR_ACC | CLASS_BIT_R4,
+               CLASS_BIT_A | CLASS_BIT_B | CLASS_BIT_R4 | CLASS_BIT_R0_R3,
                sizeof(class_bits));
 
         int ip = 0;
@@ -285,10 +285,10 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
                 int node = temp_to_node[i];
 
                 switch (class_bits[i]) {
-                case CLASS_BIT_A | CLASS_BIT_B_OR_ACC | CLASS_BIT_R4:
+                case CLASS_BIT_A | CLASS_BIT_B | CLASS_BIT_R4 | CLASS_BIT_R0_R3:
                         ra_set_node_class(g, node, vc4->reg_class_any);
                         break;
-                case CLASS_BIT_A | CLASS_BIT_B_OR_ACC:
+                case CLASS_BIT_A | CLASS_BIT_B | CLASS_BIT_R0_R3:
                         ra_set_node_class(g, node, vc4->reg_class_a_or_b_or_acc);
                         break;
                 case CLASS_BIT_A | CLASS_BIT_R4: