vc4: Swap around which src we spill to ra31/rb31.
authorEric Anholt <eric@anholt.net>
Tue, 16 Jun 2015 00:47:12 +0000 (17:47 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 16 Jun 2015 22:15:14 +0000 (15:15 -0700)
I wanted to assert that src1 came from a non-unspilled register in shader
validation, and this easily gets us that.  And, as a bonus:

total instructions in shared programs: 93347 -> 92723 (-0.67%)
instructions in affected programs:     60524 -> 59900 (-1.03%)

src/gallium/drivers/vc4/vc4_qpu_emit.c

index 577eb9200f4b9bb7b49bf47c325da4694a9c56a0..99afe4b8798427d31db47064107820ba40c73f1d 100644 (file)
@@ -117,11 +117,11 @@ fixup_raddr_conflict(struct vc4_compile *c,
                 return;
 
         if (mux0 == QPU_MUX_A) {
-                queue(c, qpu_a_MOV(qpu_rb(31), *src1));
-                *src1 = qpu_rb(31);
+                queue(c, qpu_a_MOV(qpu_rb(31), *src0));
+                *src0 = qpu_rb(31);
         } else {
-                queue(c, qpu_a_MOV(qpu_ra(31), *src1));
-                *src1 = qpu_ra(31);
+                queue(c, qpu_a_MOV(qpu_ra(31), *src0));
+                *src0 = qpu_ra(31);
         }
 }