vc4: If a QIR source has an unpack set, print it.
authorEric Anholt <eric@anholt.net>
Sun, 25 Oct 2015 00:33:30 +0000 (17:33 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 26 Oct 2015 23:48:34 +0000 (16:48 -0700)
Not used yet, but will be.

src/gallium/drivers/vc4/vc4_qir.c
src/gallium/drivers/vc4/vc4_qpu.h
src/gallium/drivers/vc4/vc4_qpu_disasm.c

index 3d3989fa95d1b3a7a4a2f2953e475fd2148ea8f7..d9f51bb4a3f6e01b4437546a3282475143c57e1f 100644 (file)
@@ -313,6 +313,7 @@ qir_dump_inst(struct vc4_compile *c, struct qinst *inst)
         for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) {
                 fprintf(stderr, ", ");
                 qir_print_reg(c, inst->src[i], false);
+                vc4_qpu_disasm_unpack(stderr, inst->src[i].pack);
         }
 }
 
index 0719d2828b5ef5c2cc43a7d8413a85947fc43838..866ca5c1300256e28286ff0f3941474ed1f6d5dc 100644 (file)
@@ -212,6 +212,9 @@ vc4_qpu_disasm_pack_mul(FILE *out, uint32_t pack);
 void
 vc4_qpu_disasm_pack_a(FILE *out, uint32_t pack);
 
+void
+vc4_qpu_disasm_unpack(FILE *out, uint32_t pack);
+
 void
 vc4_qpu_validate(uint64_t *insts, uint32_t num_inst);
 
index a854db219ff2d6243319df5ec18c8b5e2bad257e..c46fd1a0e3f5d25ab694050a5e6f2e711a6c7ad8 100644 (file)
@@ -257,6 +257,13 @@ vc4_qpu_disasm_pack_a(FILE *out, uint32_t pack)
         fprintf(out, "%s", DESC(qpu_pack_a, pack));
 }
 
+void
+vc4_qpu_disasm_unpack(FILE *out, uint32_t unpack)
+{
+        if (unpack != QPU_UNPACK_NOP)
+                fprintf(out, ".%s", DESC(qpu_unpack, unpack));
+}
+
 static void
 print_alu_dst(uint64_t inst, bool is_mul)
 {
@@ -315,10 +322,9 @@ print_alu_src(uint64_t inst, uint32_t mux)
                         fprintf(stderr, "%s", DESC(special_read_b, raddr - 32));
         }
 
-        if (unpack != QPU_UNPACK_NOP &&
-            ((mux == QPU_MUX_A && !(inst & QPU_PM)) ||
+        if (((mux == QPU_MUX_A && !(inst & QPU_PM)) ||
              (mux == QPU_MUX_R4 && (inst & QPU_PM)))) {
-                fprintf(stderr, ".%s", DESC(qpu_unpack, unpack));
+                vc4_qpu_disasm_unpack(stderr, unpack);
         }
 }