void brw_disassemble(struct brw_context *brw, void *assembly, int start, int end, FILE *out) { bool dump_hex = false; for (int offset = start; offset < end;) { brw_inst *insn = assembly + offset; brw_inst uncompacted; bool compacted = brw_inst_cmpt_control(brw, insn); if (0) fprintf(out, "0x%08x: ", offset); if (compacted) { brw_compact_inst *compacted = (void *)insn; if (dump_hex) { fprintf(out, "0x%08x 0x%08x ", ((uint32_t *)insn)[1], ((uint32_t *)insn)[0]); } brw_uncompact_instruction(brw, &uncompacted, compacted); insn = &uncompacted; offset += 8; } else { if (dump_hex) { fprintf(out, "0x%08x 0x%08x 0x%08x 0x%08x ", ((uint32_t *)insn)[3], ((uint32_t *)insn)[2], ((uint32_t *)insn)[1], ((uint32_t *)insn)[0]); } offset += 16; } brw_disassemble_inst(out, brw, insn, compacted); } }
void brw_disassemble(const struct brw_device_info *devinfo, void *assembly, int start, int end, FILE *out) { bool dump_hex = (INTEL_DEBUG & DEBUG_HEX) != 0; for (int offset = start; offset < end;) { brw_inst *insn = assembly + offset; brw_inst uncompacted; bool compacted = brw_inst_cmpt_control(devinfo, insn); if (0) fprintf(out, "0x%08x: ", offset); if (compacted) { brw_compact_inst *compacted = (void *)insn; if (dump_hex) { fprintf(out, "0x%08x 0x%08x ", ((uint32_t *)insn)[1], ((uint32_t *)insn)[0]); } brw_uncompact_instruction(devinfo, &uncompacted, compacted); insn = &uncompacted; offset += 8; } else { if (dump_hex) { fprintf(out, "0x%08x 0x%08x 0x%08x 0x%08x ", ((uint32_t *)insn)[3], ((uint32_t *)insn)[2], ((uint32_t *)insn)[1], ((uint32_t *)insn)[0]); } offset += 16; } brw_disassemble_inst(out, devinfo, insn, compacted); } }