i965: Pass devinfo pointer to brw_instruction_name().
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 28 Apr 2016 07:19:12 +0000 (00:19 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 4 May 2016 01:06:21 +0000 (18:06 -0700)
A future series will implement support for an instruction that happens
to have the same opcode number as another instruction we support
already on a disjoint set of hardware generations.  In order to
disambiguate which instruction it is brw_instruction_name() will need
some way to find out which device we are generating code for.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vec4.cpp

index 4b6aa678d54af8f6aeb9a238d006da84955cdc30..392404033b2245483bb129d8be9067dae4a7e0c6 100644 (file)
@@ -4809,7 +4809,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
              inst->flag_subreg);
    }
 
-   fprintf(file, "%s", brw_instruction_name(inst->opcode));
+   fprintf(file, "%s", brw_instruction_name(devinfo, inst->opcode));
    if (inst->saturate)
       fprintf(file, ".sat");
    if (inst->conditional_mod) {
index 80fddfc1bd4163a16a8f0cd4a2e438627f4ebafe..a2281a79a1804c81fc2d855376b01258ffcb7089 100644 (file)
@@ -163,7 +163,7 @@ brw_texture_offset(int *offsets, unsigned num_components)
 }
 
 const char *
-brw_instruction_name(enum opcode op)
+brw_instruction_name(const struct brw_device_info *devinfo, enum opcode op)
 {
    switch (op) {
    case BRW_OPCODE_ILLEGAL ... BRW_OPCODE_NOP:
index fc228f66d81483cb605495ed774c225fa00b66ee..8ab8d5bf9707c4edeb59e8e7943851404fc63ed2 100644 (file)
@@ -235,7 +235,8 @@ struct backend_shader;
 enum brw_reg_type brw_type_for_base_type(const struct glsl_type *type);
 enum brw_conditional_mod brw_conditional_for_comparison(unsigned int op);
 uint32_t brw_math_function(enum opcode op);
-const char *brw_instruction_name(enum opcode op);
+const char *brw_instruction_name(const struct brw_device_info *devinfo,
+                                 enum opcode op);
 bool brw_saturate_immediate(enum brw_reg_type type, struct brw_reg *reg);
 bool brw_negate_immediate(enum brw_reg_type type, struct brw_reg *reg);
 bool brw_abs_immediate(enum brw_reg_type type, struct brw_reg *reg);
index a2b35603b0e2ebb9836b1d8a2c38b514e154bca0..599e45e434a120fb8e9afb3f8986790b388dcb49 100644 (file)
@@ -1393,7 +1393,7 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
               pred_ctrl_align16[inst->predicate]);
    }
 
-   fprintf(file, "%s", brw_instruction_name(inst->opcode));
+   fprintf(file, "%s", brw_instruction_name(devinfo, inst->opcode));
    if (inst->saturate)
       fprintf(file, ".sat");
    if (inst->conditional_mod) {