summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_qir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-08-18 21:26:05 -0700
committerEric Anholt <[email protected]>2015-08-20 23:43:04 -0700
commit8b36d107fdd6f6b91556fcdc3498df16803d4181 (patch)
tree197465bb5fde7eb6081064552ce27d61785f6221 /src/gallium/drivers/vc4/vc4_qir.c
parent572a48366d9dfac6a7f9ee8f4d29832c496125e2 (diff)
vc4: Pack the unorm-packing bits into a src MUL instruction when possible.
Now that we do non-SSA QIR instructions, we can take a NIR SSA src that's only used by the unorm packing and just stuff the pack bits into it. total instructions in shared programs: 98136 -> 97974 (-0.17%) instructions in affected programs: 4149 -> 3987 (-3.90%)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_qir.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c
index f27b2d2d949..92669a83010 100644
--- a/src/gallium/drivers/vc4/vc4_qir.c
+++ b/src/gallium/drivers/vc4/vc4_qir.c
@@ -286,6 +286,29 @@ qir_dump_inst(struct vc4_compile *c, struct qinst *inst)
inst->sf ? ".sf" : "");
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");
+ }
+ }
for (int i = 0; i < qir_get_op_nsrc(inst->op); i++) {
fprintf(stderr, ", ");
qir_print_reg(c, inst->src[i], false);