[QPU_PACK_MUL_8D] = "8d",
};
+/* The QPU unpack for A and R4 files can be described the same, it's just that
+ * the R4 variants are convert-to-float only, with no int support.
+ */
+static const char *qpu_unpack[] = {
+ [QPU_UNPACK_NOP] = "",
+ [QPU_UNPACK_16A_TO_F32] = "16a",
+ [QPU_UNPACK_16B_TO_F32] = "16b",
+ [QPU_UNPACK_8D_REP] = "8d_rep",
+ [QPU_UNPACK_8A] = "8a",
+ [QPU_UNPACK_8B] = "8b",
+ [QPU_UNPACK_8C] = "8c",
+ [QPU_UNPACK_8D] = "8d",
+};
+
static const char *special_read_a[] = {
"uni",
NULL,
};
#define DESC(array, index) \
- ((index > ARRAY_SIZE(array) || !(array)[index]) ? \
+ ((index >= ARRAY_SIZE(array) || !(array)[index]) ? \
"???" : (array)[index])
static const char *
uint32_t raddr = (is_a ?
QPU_GET_FIELD(inst, QPU_RADDR_A) :
QPU_GET_FIELD(inst, QPU_RADDR_B));
+ uint32_t unpack = QPU_GET_FIELD(inst, QPU_UNPACK);
if (mux <= QPU_MUX_R5)
fprintf(stderr, "r%d", mux);
else if (si <= 39)
fprintf(stderr, "%.1f", (float)(1 << (si - 32)));
else if (si <= 47)
- fprintf(stderr, "%f", 1.0f / (256 / (si - 39)));
+ fprintf(stderr, "%f", 1.0f / (1 << (48 - si)));
else
- fprintf(stderr, "???");
+ fprintf(stderr, "<bad imm %d>", si);
} else if (raddr <= 31)
fprintf(stderr, "r%s%d", file, raddr);
else {
else
fprintf(stderr, "%s", DESC(special_read_b, raddr - 32));
}
+
+ if (unpack != QPU_UNPACK_NOP &&
+ ((mux == QPU_MUX_A && !(inst & QPU_PM)) ||
+ (mux == QPU_MUX_R4 && (inst & QPU_PM)))) {
+ fprintf(stderr, ".%s", DESC(qpu_unpack, unpack));
+ }
}
static void
switch (sig) {
case QPU_SIG_BRANCH:
- fprintf(stderr, "branch\n");
+ fprintf(stderr, "branch");
break;
case QPU_SIG_LOAD_IMM:
print_load_imm(inst);
print_add_op(inst);
fprintf(stderr, " ; ");
print_mul_op(inst);
-
- if (num_instructions != 1)
- fprintf(stderr, "\n");
break;
}
+
+ if (num_instructions != 1)
+ fprintf(stderr, "\n");
}
}