vc4: Fix overzealous raddr conflict resolution.
authorEric Anholt <eric@anholt.net>
Tue, 23 Sep 2014 19:50:05 +0000 (12:50 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 23 Sep 2014 20:51:29 +0000 (13:51 -0700)
We only need to do the fixup when both args are in the same file, not just
when both are in physical registers.

src/gallium/drivers/vc4/vc4_qpu_emit.c

index 81b3b8bd78452329a1b251e799c72a2e5d6f448a..985f2c4bdab7673dfa5a2b13be16404e00a56192 100644 (file)
@@ -79,12 +79,14 @@ static void
 fixup_raddr_conflict(struct vc4_compile *c,
                struct qpu_reg src0, struct qpu_reg *src1)
 {
-        if ((src0.mux == QPU_MUX_A || src0.mux == QPU_MUX_B) &&
-            (src1->mux == QPU_MUX_A || src1->mux == QPU_MUX_B) &&
-            src0.addr != src1->addr) {
-                queue(c, qpu_a_MOV(qpu_r3(), *src1));
-                *src1 = qpu_r3();
+        if ((src0.mux != QPU_MUX_A && src0.mux != QPU_MUX_B) ||
+            src0.mux != src1->mux ||
+            src0.addr == src1->addr) {
+                return;
         }
+
+        queue(c, qpu_a_MOV(qpu_r3(), *src1));
+        *src1 = qpu_r3();
 }
 
 static void