From: Matt Turner Date: Thu, 27 Jul 2017 00:03:12 +0000 (-0700) Subject: i965: Reverse file/type arguments to register type functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=890f863da072bceeb5fdeba504873059e2e0353b;p=mesa.git i965: Reverse file/type arguments to register type functions I think of the initial arguments as "state" and the last as the actual subject. Reviewed-by: Scott D Phillips --- diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c index 6da70605174..aafea693fc6 100644 --- a/src/intel/compiler/brw_disasm.c +++ b/src/intel/compiler/brw_disasm.c @@ -839,7 +839,7 @@ src_da1(FILE *file, if (err == -1) return 0; if (sub_reg_num) { - unsigned elem_size = brw_hw_reg_type_to_size(devinfo, type, _reg_file); + unsigned elem_size = brw_hw_reg_type_to_size(devinfo, _reg_file, type); format(file, ".%d", sub_reg_num / elem_size); /* use formal style like spec */ } src_align1_region(file, _vert_stride, _width, _horiz_stride); @@ -928,7 +928,7 @@ src_da16(FILE *file, return 0; if (_subreg_nr) { unsigned elem_size = - brw_hw_reg_type_to_size(devinfo, _reg_type, _reg_file); + brw_hw_reg_type_to_size(devinfo, _reg_file, _reg_type); /* bit4 for subreg number byte addressing. Make this same meaning as in da1 case, so output looks consistent. */ diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c index 69ebf6345c3..12e9d332a1f 100644 --- a/src/intel/compiler/brw_eu_emit.c +++ b/src/intel/compiler/brw_eu_emit.c @@ -91,7 +91,8 @@ gen7_convert_mrf_to_grf(struct brw_codegen *p, struct brw_reg *reg) */ unsigned brw_reg_type_to_hw_type(const struct gen_device_info *devinfo, - enum brw_reg_type type, enum brw_reg_file file) + enum brw_reg_file file, + enum brw_reg_type type) { if (file == BRW_IMMEDIATE_VALUE) { static const enum hw_imm_type hw_types[] = { @@ -141,7 +142,8 @@ brw_reg_type_to_hw_type(const struct gen_device_info *devinfo, */ unsigned brw_hw_reg_type_to_size(const struct gen_device_info *devinfo, - unsigned type, enum brw_reg_file file) + enum brw_reg_file file, + unsigned type) { if (file == BRW_IMMEDIATE_VALUE) { static const int hw_sizes[] = { @@ -198,8 +200,8 @@ brw_set_dest(struct brw_codegen *p, brw_inst *inst, struct brw_reg dest) brw_inst_set_dst_reg_file(devinfo, inst, dest.file); brw_inst_set_dst_reg_type(devinfo, inst, - brw_reg_type_to_hw_type(devinfo, dest.type, - dest.file)); + brw_reg_type_to_hw_type(devinfo, dest.file, + dest.type)); brw_inst_set_dst_address_mode(devinfo, inst, dest.address_mode); if (dest.address_mode == BRW_ADDRESS_DIRECT) { @@ -365,7 +367,7 @@ brw_set_src0(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg) brw_inst_set_src0_reg_file(devinfo, inst, reg.file); brw_inst_set_src0_reg_type(devinfo, inst, - brw_reg_type_to_hw_type(devinfo, reg.type, reg.file)); + brw_reg_type_to_hw_type(devinfo, reg.file, reg.type)); brw_inst_set_src0_abs(devinfo, inst, reg.abs); brw_inst_set_src0_negate(devinfo, inst, reg.negate); brw_inst_set_src0_address_mode(devinfo, inst, reg.address_mode); @@ -472,7 +474,7 @@ brw_set_src1(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg) brw_inst_set_src1_reg_file(devinfo, inst, reg.file); brw_inst_set_src1_reg_type(devinfo, inst, - brw_reg_type_to_hw_type(devinfo, reg.type, reg.file)); + brw_reg_type_to_hw_type(devinfo, reg.file, reg.type)); brw_inst_set_src1_abs(devinfo, inst, reg.abs); brw_inst_set_src1_negate(devinfo, inst, reg.negate); diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c index 54e0a2e62ec..cacf962904f 100644 --- a/src/intel/compiler/brw_eu_validate.c +++ b/src/intel/compiler/brw_eu_validate.c @@ -459,7 +459,7 @@ general_restrictions_based_on_operand_types(const struct gen_device_info *devinf unsigned exec_type = execution_type(devinfo, inst); unsigned exec_type_size = - brw_hw_reg_type_to_size(devinfo, exec_type, BRW_GENERAL_REGISTER_FILE); + brw_hw_reg_type_to_size(devinfo, BRW_GENERAL_REGISTER_FILE, exec_type); unsigned dst_type_size = brw_element_size(devinfo, inst, dst); /* On IVB/BYT, region parameters and execution size for DF are in terms of diff --git a/src/intel/compiler/brw_reg.h b/src/intel/compiler/brw_reg.h index c2c3aae4d00..4e59d75dc21 100644 --- a/src/intel/compiler/brw_reg.h +++ b/src/intel/compiler/brw_reg.h @@ -231,14 +231,14 @@ enum PACKED brw_reg_type { }; unsigned brw_reg_type_to_hw_type(const struct gen_device_info *devinfo, - enum brw_reg_type type, enum brw_reg_file file); + enum brw_reg_file file, enum brw_reg_type type); #define brw_element_size(devinfo, inst, operand) \ brw_hw_reg_type_to_size(devinfo, \ - brw_inst_ ## operand ## _reg_type(devinfo, inst), \ - brw_inst_ ## operand ## _reg_file(devinfo, inst)) + brw_inst_ ## operand ## _reg_file(devinfo, inst), \ + brw_inst_ ## operand ## _reg_type(devinfo, inst)) unsigned brw_hw_reg_type_to_size(const struct gen_device_info *devinfo, - unsigned type, enum brw_reg_file file); + enum brw_reg_file file, unsigned type); const char *brw_reg_type_letters(unsigned brw_reg_type); uint32_t brw_swizzle_immediate(enum brw_reg_type type, uint32_t x, unsigned swz);