summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-18 11:23:34 -0700
committerJason Ekstrand <[email protected]>2017-05-26 07:58:01 -0700
commit21ba2b4bef7c68fce492607b7dae5cd5e28b3bd9 (patch)
treef089ecb4201dc915d82f1e3cfd05497153d33916 /src/intel/compiler
parentc336c224a6e6bcc1652fd7d083653f89eab60462 (diff)
intel/compiler: Make brw_disasm take const assembly
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r--src/intel/compiler/brw_disasm.c20
-rw-r--r--src/intel/compiler/brw_eu.c4
-rw-r--r--src/intel/compiler/brw_eu.h6
3 files changed, 15 insertions, 15 deletions
diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c
index 8b44736b9b6..ad41e352c2a 100644
--- a/src/intel/compiler/brw_disasm.c
+++ b/src/intel/compiler/brw_disasm.c
@@ -719,7 +719,7 @@ reg(FILE *file, unsigned _reg_file, unsigned _reg_nr)
}
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);
int err = 0;
@@ -776,7 +776,7 @@ dest(FILE *file, const struct gen_device_info *devinfo, brw_inst *inst)
}
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;
uint32_t reg_file;
@@ -942,7 +942,7 @@ src_da16(FILE *file,
}
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;
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
-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;
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
-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;
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
-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) {
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
-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) {
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
-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) {
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
-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 exec_size = 1 << brw_inst_exec_size(devinfo, inst);
@@ -1225,7 +1225,7 @@ brw_disassemble_imm(const struct gen_device_info *devinfo,
int
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 space = 0;
diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c
index 77400c19914..f5202a05ebe 100644
--- a/src/intel/compiler/brw_eu.c
+++ b/src/intel/compiler/brw_eu.c
@@ -366,12 +366,12 @@ const unsigned *brw_get_program( struct brw_codegen *p,
void
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;
for (int offset = start; offset < end;) {
- brw_inst *insn = assembly + offset;
+ const brw_inst *insn = assembly + offset;
brw_inst uncompacted;
bool compacted = brw_inst_cmpt_control(devinfo, insn);
if (0)
diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index 87c69a479cf..a3a9c63239d 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -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 *mem_ctx);
int brw_disassemble_inst(FILE *file, const struct gen_device_info *devinfo,
- struct brw_inst *inst, bool is_compacted);
-void brw_disassemble(const struct gen_device_info *devinfo, void *assembly,
- int start, int end, FILE *out);
+ const struct brw_inst *inst, bool is_compacted);
+void brw_disassemble(const struct gen_device_info *devinfo,
+ const void *assembly, int start, int end, FILE *out);
const unsigned *brw_get_program( struct brw_codegen *p, unsigned *sz );
brw_inst *brw_next_insn(struct brw_codegen *p, unsigned opcode);