summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-02-06 00:36:26 -0800
committerKenneth Graunke <[email protected]>2015-02-17 15:24:15 -0800
commit27b6ef7ecaa60ce192ec74eef2245c25ed4e703b (patch)
tree9bcc12e13f5fdcb239d6e122b636bb8cb23ab1bd /src/mesa
parent0b499abb51c80867ad034f2a6d9fcb1e86d021cc (diff)
i965: Add a function to disassemble an instruction from the 4 dwords.
I used this a while back when debugging GPU hangs, and it seems like it could be useful, so I figured I'd add it so people can use it in the debugger. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_disasm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c
index 7405d9bfd99..863a6b323ce 100644
--- a/src/mesa/drivers/dri/i965/brw_disasm.c
+++ b/src/mesa/drivers/dri/i965/brw_disasm.c
@@ -1197,6 +1197,18 @@ qtr_ctrl(FILE *file, struct brw_context *brw, brw_inst *inst)
return 0;
}
+#ifdef DEBUG
+static __attribute__((__unused__)) int
+brw_disassemble_imm(struct brw_context *brw,
+ uint32_t dw3, uint32_t dw2, uint32_t dw1, uint32_t dw0)
+{
+ brw_inst inst;
+ inst.data[0] = (((uint64_t) dw1) << 32) | ((uint64_t) dw0);
+ inst.data[1] = (((uint64_t) dw3) << 32) | ((uint64_t) dw2);
+ return brw_disassemble_inst(stderr, brw, &inst, false);
+}
+#endif
+
int
brw_disassemble_inst(FILE *file, struct brw_context *brw, brw_inst *inst,
bool is_compacted)