progname);
}
+static uint32_t
+get_dword(const brw_inst *inst, int idx)
+{
+ uint32_t dword;
+ memcpy(&dword, (char *)inst + 4 * idx, sizeof(dword));
+ return dword;
+}
+
static void
print_instruction(FILE *output, bool compact, const brw_inst *instruction)
{
break;
}
case OPT_OUTPUT_C_LITERAL: {
- fprintf(output, "\t0x%02x,", ((unsigned char *)instruction)[0]);
+ fprintf(output, "\t0x%08x,", get_dword(instruction, 0));
+
+ for (unsigned i = 1; i < byte_limit / 4; i++)
+ fprintf(output, " 0x%08x,", get_dword(instruction, i));
- for (unsigned i = 1; i < byte_limit; i++) {
- fprintf(output, " 0x%02x,", ((unsigned char *)instruction)[i]);
- }
break;
}
case OPT_OUTPUT_BIN: