summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-08-21 00:04:36 -0700
committerEric Anholt <[email protected]>2015-08-21 13:29:26 -0700
commit7e0b868cf31003ada12063398fb91485ed8043dd (patch)
tree3afe65ef54dad3bbfb33bcae63504e4c8beeaa3e /src/gallium
parent4ae137534a8718db4611782dbfec773504b6e3be (diff)
vc4: Reuse QPU dumping for packing bits in QIR.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc4/vc4_qir.c25
-rw-r--r--src/gallium/drivers/vc4/vc4_qpu.h7
-rw-r--r--src/gallium/drivers/vc4/vc4_qpu_disasm.c16
3 files changed, 26 insertions, 22 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c
index 4e0dc385d80..e5efb7cba7e 100644
--- a/src/gallium/drivers/vc4/vc4_qir.c
+++ b/src/gallium/drivers/vc4/vc4_qir.c
@@ -287,26 +287,11 @@ qir_dump_inst(struct vc4_compile *c, struct qinst *inst)
qir_print_reg(c, inst->dst, true);
if (inst->dst.pack) {
- if (qir_is_mul(inst)) {
- switch (inst->dst.pack) {
- case QPU_PACK_MUL_8888:
- fprintf(stderr, ".8888");
- break;
- case QPU_PACK_MUL_8A:
- fprintf(stderr, ".8a");
- break;
- case QPU_PACK_MUL_8B:
- fprintf(stderr, ".8b");
- break;
- case QPU_PACK_MUL_8C:
- fprintf(stderr, ".8c");
- break;
- case QPU_PACK_MUL_8D:
- fprintf(stderr, ".8d");
- break;
- }
- } else {
- unreachable("packs only set up for MULs so far.\n");
+ if (inst->dst.pack) {
+ if (qir_is_mul(inst))
+ vc4_qpu_disasm_pack_mul(stderr, inst->dst.pack);
+ else
+ vc4_qpu_disasm_pack_a(stderr, inst->dst.pack);
}
}
for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) {
diff --git a/src/gallium/drivers/vc4/vc4_qpu.h b/src/gallium/drivers/vc4/vc4_qpu.h
index fbb90ba12a0..0719d2828b5 100644
--- a/src/gallium/drivers/vc4/vc4_qpu.h
+++ b/src/gallium/drivers/vc4/vc4_qpu.h
@@ -24,6 +24,7 @@
#ifndef VC4_QPU_H
#define VC4_QPU_H
+#include <stdio.h>
#include <stdint.h>
#include "util/u_math.h"
@@ -206,6 +207,12 @@ void
vc4_qpu_disasm(const uint64_t *instructions, int num_instructions);
void
+vc4_qpu_disasm_pack_mul(FILE *out, uint32_t pack);
+
+void
+vc4_qpu_disasm_pack_a(FILE *out, uint32_t pack);
+
+void
vc4_qpu_validate(uint64_t *insts, uint32_t num_inst);
#endif /* VC4_QPU_H */
diff --git a/src/gallium/drivers/vc4/vc4_qpu_disasm.c b/src/gallium/drivers/vc4/vc4_qpu_disasm.c
index 00aeb300a9b..0879787ec03 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_disasm.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_disasm.c
@@ -245,6 +245,18 @@ get_special_write_desc(int reg, bool is_a)
return special_write[reg];
}
+void
+vc4_qpu_disasm_pack_mul(FILE *out, uint32_t pack)
+{
+ fprintf(out, ".%s", DESC(qpu_pack_mul, pack));
+}
+
+void
+vc4_qpu_disasm_pack_a(FILE *out, uint32_t pack)
+{
+ fprintf(out, "%s", DESC(qpu_pack_a, pack));
+}
+
static void
print_alu_dst(uint64_t inst, bool is_mul)
{
@@ -263,9 +275,9 @@ print_alu_dst(uint64_t inst, bool is_mul)
fprintf(stderr, "%s%d?", file, waddr);
if (is_mul && (inst & QPU_PM)) {
- fprintf(stderr, ".%s", DESC(qpu_pack_mul, pack));
+ vc4_qpu_disasm_pack_mul(stderr, pack);
} else if (is_a && !(inst & QPU_PM)) {
- fprintf(stderr, "%s", DESC(qpu_pack_a, pack));
+ vc4_qpu_disasm_pack_a(stderr, pack);
}
}