OSDN Git Service

vc4: Don't try the SF coalescing unless it's on a def.
authorEric Anholt <eric@anholt.net>
Mon, 4 Jan 2016 21:56:39 +0000 (13:56 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 6 Jan 2016 20:39:27 +0000 (12:39 -0800)
If you want the SF of the value of a register produced from a series of
packing MOVs or conditional MOVs, we can't just SF on the last MOV into
the register.

src/gallium/drivers/vc4/vc4_qir.c

index c6916c4..a46fb4f 100644 (file)
@@ -503,9 +503,9 @@ qir_SF(struct vc4_compile *c, struct qreg src)
         if (!list_empty(&c->instructions))
                 last_inst = (struct qinst *)c->instructions.prev;
 
-        if (!last_inst ||
-            last_inst->dst.file != src.file ||
-            last_inst->dst.index != src.index ||
+        if (src.file != QFILE_TEMP ||
+            !c->defs[src.index] ||
+            last_inst != c->defs[src.index] ||
             qir_is_multi_instruction(last_inst)) {
                 src = qir_MOV(c, src);
                 last_inst = (struct qinst *)c->instructions.prev;