aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom/qpu/qpu_disasm.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-01-04 22:47:54 -0800
committerEric Anholt <[email protected]>2018-01-12 21:54:18 -0800
commit2bd378647bebd41338baf9c6a9297a3a72c84e84 (patch)
tree2c9794131a43ce27dd091215d649f4586d29a376 /src/broadcom/qpu/qpu_disasm.c
parent5f227ac2104e08ad434c78a472ef9ac21ebdfe73 (diff)
broadcom/vc5: Add support for QPU pack/unpack/disasm of small immediates.
Diffstat (limited to 'src/broadcom/qpu/qpu_disasm.c')
-rw-r--r--src/broadcom/qpu/qpu_disasm.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/broadcom/qpu/qpu_disasm.c b/src/broadcom/qpu/qpu_disasm.c
index 73b43f8c3d6..32e7ba12a4c 100644
--- a/src/broadcom/qpu/qpu_disasm.c
+++ b/src/broadcom/qpu/qpu_disasm.c
@@ -62,7 +62,21 @@ v3d_qpu_disasm_raddr(struct disasm_state *disasm,
if (mux == V3D_QPU_MUX_A) {
append(disasm, "rf%d", instr->raddr_a);
} else if (mux == V3D_QPU_MUX_B) {
- append(disasm, "rf%d", instr->raddr_b);
+ if (instr->sig.small_imm) {
+ uint32_t val;
+ MAYBE_UNUSED bool ok =
+ v3d_qpu_small_imm_unpack(disasm->devinfo,
+ instr->raddr_b,
+ &val);
+
+ if ((int)val >= -16 && (int)val <= 15)
+ append(disasm, "%d", val);
+ else
+ append(disasm, "0x%08x", val);
+ assert(ok);
+ } else {
+ append(disasm, "rf%d", instr->raddr_b);
+ }
} else {
append(disasm, "r%d", mux);
}