diff options
author | Keith Whitwell <[email protected]> | 2009-11-05 15:34:18 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-11-05 15:34:18 +0000 |
commit | aa9773d056a8799050304f75c1bf4c1f470e7e53 (patch) | |
tree | 0e89b092ad7187b6224083f36ed2c3b33dbbea05 /src/gallium/drivers/i965/brw_disasm.c | |
parent | 203adb8ea68da0fbb2e4643e36e273f31c29980f (diff) |
i965g: disassemble more than one instruction at a time
Diffstat (limited to 'src/gallium/drivers/i965/brw_disasm.c')
-rw-r--r-- | src/gallium/drivers/i965/brw_disasm.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/gallium/drivers/i965/brw_disasm.c b/src/gallium/drivers/i965/brw_disasm.c index 29fe8480057..df0c7b9a2b8 100644 --- a/src/gallium/drivers/i965/brw_disasm.c +++ b/src/gallium/drivers/i965/brw_disasm.c @@ -455,7 +455,7 @@ static int reg (FILE *file, GLuint _reg_file, GLuint _reg_nr) return err; } -static int dest (FILE *file, struct brw_instruction *inst) +static int dest (FILE *file, const struct brw_instruction *inst) { int err = 0; @@ -621,7 +621,7 @@ static int src_da16 (FILE *file, } -static int imm (FILE *file, GLuint type, struct brw_instruction *inst) { +static int imm (FILE *file, GLuint type, const struct brw_instruction *inst) { switch (type) { case BRW_REGISTER_TYPE_UD: format (file, "0x%08xUD", inst->bits3.ud); @@ -650,7 +650,7 @@ static int imm (FILE *file, GLuint type, struct brw_instruction *inst) { return 0; } -static int src0 (FILE *file, struct brw_instruction *inst) +static int src0 (FILE *file, const struct brw_instruction *inst) { if (inst->bits1.da1.src0_reg_file == BRW_IMMEDIATE_VALUE) return imm (file, inst->bits1.da1.src0_reg_type, @@ -710,7 +710,7 @@ static int src0 (FILE *file, struct brw_instruction *inst) } } -static int src1 (FILE *file, struct brw_instruction *inst) +static int src1 (FILE *file, const struct brw_instruction *inst) { if (inst->bits1.da1.src1_reg_file == BRW_IMMEDIATE_VALUE) return imm (file, inst->bits1.da1.src1_reg_type, @@ -770,7 +770,7 @@ static int src1 (FILE *file, struct brw_instruction *inst) } } -int brw_disasm (FILE *file, struct brw_instruction *inst) +static int brw_disasm_insn (FILE *file, const struct brw_instruction *inst) { int err = 0; int space = 0; @@ -900,3 +900,21 @@ int brw_disasm (FILE *file, struct brw_instruction *inst) newline (file); return err; } + + +int brw_disasm (FILE *file, + const struct brw_instruction *inst, + unsigned count) +{ + int i, err; + + for (i = 0; i < count; i++) { + err = brw_disasm_insn(stderr, &inst[i]); + if (err) + return err; + } + + fprintf(file, "\n"); + return 0; +} + |