intel/compiler: Make brw_disasm take const assembly

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Jason Ekstrand 2017-03-18 11:23:34 -07:00
parent c336c224a6
commit 21ba2b4bef
3 changed files with 15 additions and 15 deletions

View File

@ -719,7 +719,7 @@ reg(FILE *file, unsigned _reg_file, unsigned _reg_nr)
} }
static int static int
dest(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) dest(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
unsigned elem_size = brw_element_size(devinfo, inst, dst); unsigned elem_size = brw_element_size(devinfo, inst, dst);
int err = 0; int err = 0;
@ -776,7 +776,7 @@ dest(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
} }
static int static int
dest_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) dest_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
int err = 0; int err = 0;
uint32_t reg_file; uint32_t reg_file;
@ -942,7 +942,7 @@ src_da16(FILE *file,
} }
static int static int
src0_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) src0_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
int err = 0; int err = 0;
unsigned src0_subreg_nr = brw_inst_3src_src0_subreg_nr(devinfo, inst); unsigned src0_subreg_nr = brw_inst_3src_src0_subreg_nr(devinfo, inst);
@ -969,7 +969,7 @@ src0_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
} }
static int static int
src1_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) src1_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
int err = 0; int err = 0;
unsigned src1_subreg_nr = brw_inst_3src_src1_subreg_nr(devinfo, inst); unsigned src1_subreg_nr = brw_inst_3src_src1_subreg_nr(devinfo, inst);
@ -997,7 +997,7 @@ src1_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
static int static int
src2_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) src2_3src(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
int err = 0; int err = 0;
unsigned src2_subreg_nr = brw_inst_3src_src2_subreg_nr(devinfo, inst); unsigned src2_subreg_nr = brw_inst_3src_src2_subreg_nr(devinfo, inst);
@ -1024,7 +1024,7 @@ src2_3src(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
} }
static int static int
imm(FILE *file, const struct gen_device_info *devinfo, unsigned type, brw_inst *inst) imm(FILE *file, const struct gen_device_info *devinfo, unsigned type, const brw_inst *inst)
{ {
switch (type) { switch (type) {
case BRW_HW_REG_TYPE_UD: case BRW_HW_REG_TYPE_UD:
@ -1066,7 +1066,7 @@ imm(FILE *file, const struct gen_device_info *devinfo, unsigned type, brw_inst *
} }
static int static int
src0(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) src0(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
if (brw_inst_src0_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) { if (brw_inst_src0_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) {
return imm(file, devinfo, brw_inst_src0_reg_type(devinfo, inst), inst); return imm(file, devinfo, brw_inst_src0_reg_type(devinfo, inst), inst);
@ -1122,7 +1122,7 @@ src0(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
} }
static int static int
src1(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) src1(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
if (brw_inst_src1_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) { if (brw_inst_src1_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) {
return imm(file, devinfo, brw_inst_src1_reg_type(devinfo, inst), inst); return imm(file, devinfo, brw_inst_src1_reg_type(devinfo, inst), inst);
@ -1178,7 +1178,7 @@ src1(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
} }
static int static int
qtr_ctrl(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst) qtr_ctrl(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst)
{ {
int qtr_ctl = brw_inst_qtr_control(devinfo, inst); int qtr_ctl = brw_inst_qtr_control(devinfo, inst);
int exec_size = 1 << brw_inst_exec_size(devinfo, inst); int exec_size = 1 << brw_inst_exec_size(devinfo, inst);
@ -1225,7 +1225,7 @@ brw_disassemble_imm(const struct gen_device_info *devinfo,
int int
brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo, brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
brw_inst *inst, bool is_compacted) const brw_inst *inst, bool is_compacted)
{ {
int err = 0; int err = 0;
int space = 0; int space = 0;

View File

@ -366,12 +366,12 @@ const unsigned *brw_get_program( struct brw_codegen *p,
void void
brw_disassemble(const struct gen_device_info *devinfo, brw_disassemble(const struct gen_device_info *devinfo,
void *assembly, int start, int end, FILE *out) const void *assembly, int start, int end, FILE *out)
{ {
bool dump_hex = (INTEL_DEBUG & DEBUG_HEX) != 0; bool dump_hex = (INTEL_DEBUG & DEBUG_HEX) != 0;
for (int offset = start; offset < end;) { for (int offset = start; offset < end;) {
brw_inst *insn = assembly + offset; const brw_inst *insn = assembly + offset;
brw_inst uncompacted; brw_inst uncompacted;
bool compacted = brw_inst_cmpt_control(devinfo, insn); bool compacted = brw_inst_cmpt_control(devinfo, insn);
if (0) if (0)

View File

@ -115,9 +115,9 @@ void brw_set_default_acc_write_control(struct brw_codegen *p, unsigned value);
void brw_init_codegen(const struct gen_device_info *, struct brw_codegen *p, void brw_init_codegen(const struct gen_device_info *, struct brw_codegen *p,
void *mem_ctx); void *mem_ctx);
int brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo, int brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
struct brw_inst *inst, bool is_compacted); const struct brw_inst *inst, bool is_compacted);
void brw_disassemble(const struct gen_device_info *devinfo, void *assembly, void brw_disassemble(const struct gen_device_info *devinfo,
int start, int end, FILE *out); const void *assembly, int start, int end, FILE *out);
const unsigned *brw_get_program( struct brw_codegen *p, unsigned *sz ); const unsigned *brw_get_program( struct brw_codegen *p, unsigned *sz );
brw_inst *brw_next_insn(struct brw_codegen *p, unsigned opcode); brw_inst *brw_next_insn(struct brw_codegen *p, unsigned opcode);