vc4: Fix handling of src packs on in qir_follow_movs().
authorEric Anholt <eric@anholt.net>
Fri, 11 Dec 2015 06:23:10 +0000 (22:23 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 11 Dec 2015 20:21:22 +0000 (12:21 -0800)
The caller isn't going to expect it from a return, so it would probably
get misinterpreted.  If the caller had an unpack in its reg, that's fine,
but don't lose track of it.

src/gallium/drivers/vc4/vc4_qir.c

index 4ec25310b670fbf5a1fc018513af7c3b0ccac3a2..c6916c48e7ea203fed4d8071368b8ef8f3224187 100644 (file)
@@ -423,13 +423,19 @@ qir_remove_instruction(struct vc4_compile *c, struct qinst *qinst)
 struct qreg
 qir_follow_movs(struct vc4_compile *c, struct qreg reg)
 {
+        int pack = reg.pack;
+
         while (reg.file == QFILE_TEMP &&
                c->defs[reg.index] &&
-               c->defs[reg.index]->op == QOP_MOV &&
-               !c->defs[reg.index]->dst.pack) {
+               (c->defs[reg.index]->op == QOP_MOV ||
+                c->defs[reg.index]->op == QOP_FMOV ||
+                c->defs[reg.index]->op == QOP_MMOV)&&
+               !c->defs[reg.index]->dst.pack &&
+               !c->defs[reg.index]->src[0].pack) {
                 reg = c->defs[reg.index]->src[0];
         }
 
+        reg.pack = pack;
         return reg;
 }