From: Matt Turner Date: Wed, 26 Jul 2017 21:25:54 +0000 (-0700) Subject: i965: Rename brw_inst's functions that access the register type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fb8323328684bd7fe4e8c71c7415f51acf25e5b;p=mesa.git i965: Rename brw_inst's functions that access the register type Put hw_ in the name so that it's clear these are the hardware encodings. Reviewed-by: Scott D Phillips --- diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c index aafea693fc6..731e64a8ad8 100644 --- a/src/intel/compiler/brw_disasm.c +++ b/src/intel/compiler/brw_disasm.c @@ -739,7 +739,7 @@ dest(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) brw_inst_dst_hstride(devinfo, inst), NULL); string(file, ">"); err |= control(file, "dest reg encoding", reg_encoding, - brw_inst_dst_reg_type(devinfo, inst), NULL); + brw_inst_dst_reg_hw_type(devinfo, inst), NULL); } else { string(file, "g[a0"); if (brw_inst_dst_ia_subreg_nr(devinfo, inst)) @@ -752,7 +752,7 @@ dest(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) brw_inst_dst_hstride(devinfo, inst), NULL); string(file, ">"); err |= control(file, "dest reg encoding", reg_encoding, - brw_inst_dst_reg_type(devinfo, inst), NULL); + brw_inst_dst_reg_hw_type(devinfo, inst), NULL); } } else { if (brw_inst_dst_address_mode(devinfo, inst) == BRW_ADDRESS_DIRECT) { @@ -766,7 +766,7 @@ dest(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) err |= control(file, "writemask", writemask, brw_inst_da16_writemask(devinfo, inst), NULL); err |= control(file, "dest reg encoding", reg_encoding, - brw_inst_dst_reg_type(devinfo, inst), NULL); + brw_inst_dst_reg_hw_type(devinfo, inst), NULL); } else { err = 1; string(file, "Indirect align16 address mode not supported"); @@ -1077,13 +1077,13 @@ static int 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); + return imm(file, devinfo, brw_inst_src0_reg_hw_type(devinfo, inst), inst); } else if (brw_inst_access_mode(devinfo, inst) == BRW_ALIGN_1) { if (brw_inst_src0_address_mode(devinfo, inst) == BRW_ADDRESS_DIRECT) { return src_da1(file, devinfo, brw_inst_opcode(devinfo, inst), - brw_inst_src0_reg_type(devinfo, inst), + brw_inst_src0_reg_hw_type(devinfo, inst), brw_inst_src0_reg_file(devinfo, inst), brw_inst_src0_vstride(devinfo, inst), brw_inst_src0_width(devinfo, inst), @@ -1096,7 +1096,7 @@ src0(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) return src_ia1(file, devinfo, brw_inst_opcode(devinfo, inst), - brw_inst_src0_reg_type(devinfo, inst), + brw_inst_src0_reg_hw_type(devinfo, inst), brw_inst_src0_reg_file(devinfo, inst), brw_inst_src0_ia1_addr_imm(devinfo, inst), brw_inst_src0_ia_subreg_nr(devinfo, inst), @@ -1111,7 +1111,7 @@ src0(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) return src_da16(file, devinfo, brw_inst_opcode(devinfo, inst), - brw_inst_src0_reg_type(devinfo, inst), + brw_inst_src0_reg_hw_type(devinfo, inst), brw_inst_src0_reg_file(devinfo, inst), brw_inst_src0_vstride(devinfo, inst), brw_inst_src0_da_reg_nr(devinfo, inst), @@ -1133,13 +1133,13 @@ static int 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); + return imm(file, devinfo, brw_inst_src1_reg_hw_type(devinfo, inst), inst); } else if (brw_inst_access_mode(devinfo, inst) == BRW_ALIGN_1) { if (brw_inst_src1_address_mode(devinfo, inst) == BRW_ADDRESS_DIRECT) { return src_da1(file, devinfo, brw_inst_opcode(devinfo, inst), - brw_inst_src1_reg_type(devinfo, inst), + brw_inst_src1_reg_hw_type(devinfo, inst), brw_inst_src1_reg_file(devinfo, inst), brw_inst_src1_vstride(devinfo, inst), brw_inst_src1_width(devinfo, inst), @@ -1152,7 +1152,7 @@ src1(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) return src_ia1(file, devinfo, brw_inst_opcode(devinfo, inst), - brw_inst_src1_reg_type(devinfo, inst), + brw_inst_src1_reg_hw_type(devinfo, inst), brw_inst_src1_reg_file(devinfo, inst), brw_inst_src1_ia1_addr_imm(devinfo, inst), brw_inst_src1_ia_subreg_nr(devinfo, inst), @@ -1167,7 +1167,7 @@ src1(FILE *file, const struct gen_device_info *devinfo, const brw_inst *inst) return src_da16(file, devinfo, brw_inst_opcode(devinfo, inst), - brw_inst_src1_reg_type(devinfo, inst), + brw_inst_src1_reg_hw_type(devinfo, inst), brw_inst_src1_reg_file(devinfo, inst), brw_inst_src1_vstride(devinfo, inst), brw_inst_src1_da_reg_nr(devinfo, inst), diff --git a/src/intel/compiler/brw_eu_compact.c b/src/intel/compiler/brw_eu_compact.c index bca526f5927..743ee9519c1 100644 --- a/src/intel/compiler/brw_eu_compact.c +++ b/src/intel/compiler/brw_eu_compact.c @@ -995,10 +995,10 @@ precompact(const struct gen_device_info *devinfo, brw_inst inst) !(devinfo->is_haswell && brw_inst_opcode(devinfo, &inst) == BRW_OPCODE_DIM) && !(devinfo->gen >= 8 && - (brw_inst_src0_reg_type(devinfo, &inst) == GEN8_HW_IMM_TYPE_DF || - brw_inst_src0_reg_type(devinfo, &inst) == GEN8_HW_IMM_TYPE_UQ || - brw_inst_src0_reg_type(devinfo, &inst) == GEN8_HW_IMM_TYPE_Q))) { - brw_inst_set_src1_reg_type(devinfo, &inst, BRW_HW_REG_TYPE_UD); + (brw_inst_src0_reg_hw_type(devinfo, &inst) == GEN8_HW_IMM_TYPE_DF || + brw_inst_src0_reg_hw_type(devinfo, &inst) == GEN8_HW_IMM_TYPE_UQ || + brw_inst_src0_reg_hw_type(devinfo, &inst) == GEN8_HW_IMM_TYPE_Q))) { + brw_inst_set_src1_reg_hw_type(devinfo, &inst, BRW_HW_REG_TYPE_UD); } /* Compacted instructions only have 12-bits (plus 1 for the other 20) @@ -1013,10 +1013,10 @@ precompact(const struct gen_device_info *devinfo, brw_inst inst) * If we see a 0.0:F, change the type to VF so that it can be compacted. */ if (brw_inst_imm_ud(devinfo, &inst) == 0x0 && - brw_inst_src0_reg_type(devinfo, &inst) == BRW_HW_REG_TYPE_F && - brw_inst_dst_reg_type(devinfo, &inst) == BRW_HW_REG_TYPE_F && + brw_inst_src0_reg_hw_type(devinfo, &inst) == BRW_HW_REG_TYPE_F && + brw_inst_dst_reg_hw_type(devinfo, &inst) == BRW_HW_REG_TYPE_F && brw_inst_dst_hstride(devinfo, &inst) == BRW_HORIZONTAL_STRIDE_1) { - brw_inst_set_src0_reg_type(devinfo, &inst, BRW_HW_IMM_TYPE_VF); + brw_inst_set_src0_reg_hw_type(devinfo, &inst, BRW_HW_IMM_TYPE_VF); } /* There are no mappings for dst:d | i:d, so if the immediate is suitable @@ -1024,10 +1024,10 @@ precompact(const struct gen_device_info *devinfo, brw_inst inst) */ if (is_compactable_immediate(brw_inst_imm_ud(devinfo, &inst)) && brw_inst_cond_modifier(devinfo, &inst) == BRW_CONDITIONAL_NONE && - brw_inst_src0_reg_type(devinfo, &inst) == BRW_HW_REG_TYPE_D && - brw_inst_dst_reg_type(devinfo, &inst) == BRW_HW_REG_TYPE_D) { - brw_inst_set_src0_reg_type(devinfo, &inst, BRW_HW_REG_TYPE_UD); - brw_inst_set_dst_reg_type(devinfo, &inst, BRW_HW_REG_TYPE_UD); + brw_inst_src0_reg_hw_type(devinfo, &inst) == BRW_HW_REG_TYPE_D && + brw_inst_dst_reg_hw_type(devinfo, &inst) == BRW_HW_REG_TYPE_D) { + brw_inst_set_src0_reg_hw_type(devinfo, &inst, BRW_HW_REG_TYPE_UD); + brw_inst_set_dst_reg_hw_type(devinfo, &inst, BRW_HW_REG_TYPE_UD); } return inst; diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c index 133a28e1bf2..064e4a03876 100644 --- a/src/intel/compiler/brw_eu_emit.c +++ b/src/intel/compiler/brw_eu_emit.c @@ -97,9 +97,9 @@ brw_set_dest(struct brw_codegen *p, brw_inst *inst, struct brw_reg dest) gen7_convert_mrf_to_grf(p, &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.file, - dest.type)); + brw_inst_set_dst_reg_hw_type(devinfo, inst, + 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) { @@ -264,8 +264,8 @@ brw_set_src0(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg) validate_reg(devinfo, inst, 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.file, reg.type)); + brw_inst_set_src0_reg_hw_type(devinfo, inst, + 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); @@ -283,8 +283,8 @@ brw_set_src0(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg) if (type_sz(reg.type) < 8) { brw_inst_set_src1_reg_file(devinfo, inst, BRW_ARCHITECTURE_REGISTER_FILE); - brw_inst_set_src1_reg_type(devinfo, inst, - brw_inst_src0_reg_type(devinfo, inst)); + brw_inst_set_src1_reg_hw_type(devinfo, inst, + brw_inst_src0_reg_hw_type(devinfo, inst)); } } else { if (reg.address_mode == BRW_ADDRESS_DIRECT) { @@ -371,8 +371,8 @@ brw_set_src1(struct brw_codegen *p, brw_inst *inst, struct brw_reg reg) validate_reg(devinfo, inst, 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.file, reg.type)); + brw_inst_set_src1_reg_hw_type(devinfo, inst, + 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 cacf962904f..c004e62ffba 100644 --- a/src/intel/compiler/brw_eu_validate.c +++ b/src/intel/compiler/brw_eu_validate.c @@ -93,14 +93,14 @@ signed_type(unsigned type) static bool inst_is_raw_move(const struct gen_device_info *devinfo, const brw_inst *inst) { - unsigned dst_type = signed_type(brw_inst_dst_reg_type(devinfo, inst)); - unsigned src_type = signed_type(brw_inst_src0_reg_type(devinfo, inst)); + unsigned dst_type = signed_type(brw_inst_dst_reg_hw_type(devinfo, inst)); + unsigned src_type = signed_type(brw_inst_src0_reg_hw_type(devinfo, inst)); if (brw_inst_src0_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE) { /* FIXME: not strictly true */ - if (brw_inst_src0_reg_type(devinfo, inst) == BRW_HW_IMM_TYPE_VF || - brw_inst_src0_reg_type(devinfo, inst) == BRW_HW_IMM_TYPE_UV || - brw_inst_src0_reg_type(devinfo, inst) == BRW_HW_IMM_TYPE_V) { + if (brw_inst_src0_reg_hw_type(devinfo, inst) == BRW_HW_IMM_TYPE_VF || + brw_inst_src0_reg_hw_type(devinfo, inst) == BRW_HW_IMM_TYPE_UV || + brw_inst_src0_reg_hw_type(devinfo, inst) == BRW_HW_IMM_TYPE_V) { return false; } } else if (brw_inst_src0_negate(devinfo, inst) || @@ -316,8 +316,8 @@ execution_type(const struct gen_device_info *devinfo, const brw_inst *inst) { unsigned num_sources = num_sources_from_inst(devinfo, inst); unsigned src0_exec_type, src1_exec_type; - unsigned src0_type = brw_inst_src0_reg_type(devinfo, inst); - unsigned src1_type = brw_inst_src1_reg_type(devinfo, inst); + unsigned src0_type = brw_inst_src0_reg_hw_type(devinfo, inst); + unsigned src1_type = brw_inst_src1_reg_hw_type(devinfo, inst); bool src0_is_immediate = brw_inst_src0_reg_file(devinfo, inst) == BRW_IMMEDIATE_VALUE; @@ -327,7 +327,7 @@ execution_type(const struct gen_device_info *devinfo, const brw_inst *inst) /* Execution data type is independent of destination data type, except in * mixed F/HF instructions on CHV and SKL+. */ - unsigned dst_exec_type = brw_inst_dst_reg_type(devinfo, inst); + unsigned dst_exec_type = brw_inst_dst_reg_hw_type(devinfo, inst); src0_exec_type = execution_type_for_type(src0_type, src0_is_immediate); if (num_sources == 1) { @@ -443,8 +443,8 @@ general_restrictions_based_on_operand_types(const struct gen_device_info *devinf unsigned dst_stride = 1 << (brw_inst_dst_hstride(devinfo, inst) - 1); bool dst_type_is_byte = - brw_inst_dst_reg_type(devinfo, inst) == BRW_HW_REG_TYPE_B || - brw_inst_dst_reg_type(devinfo, inst) == BRW_HW_REG_TYPE_UB; + brw_inst_dst_reg_hw_type(devinfo, inst) == BRW_HW_REG_TYPE_B || + brw_inst_dst_reg_hw_type(devinfo, inst) == BRW_HW_REG_TYPE_UB; if (dst_type_is_byte) { if (is_packed(exec_size * dst_stride, exec_size, dst_stride)) { @@ -1014,8 +1014,8 @@ region_alignment_rules(const struct gen_device_info *devinfo, (1 << (brw_inst_src ## n ## _hstride(devinfo, inst) - 1)) : 0; \ bool src ## n ## _is_packed_word = \ is_packed(vstride, width, hstride) && \ - (brw_inst_src ## n ## _reg_type(devinfo, inst) == BRW_HW_REG_TYPE_W || \ - brw_inst_src ## n ## _reg_type(devinfo, inst) == BRW_HW_REG_TYPE_UW); \ + (brw_inst_src ## n ## _reg_hw_type(devinfo, inst) == BRW_HW_REG_TYPE_W || \ + brw_inst_src ## n ## _reg_hw_type(devinfo, inst) == BRW_HW_REG_TYPE_UW); \ \ ERROR_IF(src ## n ## _regs == 1 && \ !src ## n ## _has_scalar_region(devinfo, inst) && \ @@ -1057,8 +1057,8 @@ vector_immediate_restrictions(const struct gen_device_info *devinfo, brw_inst_dst_da1_subreg_nr(devinfo, inst) : 0; unsigned dst_stride = 1 << (brw_inst_dst_hstride(devinfo, inst) - 1); unsigned type = num_sources == 1 ? - brw_inst_src0_reg_type(devinfo, inst) : - brw_inst_src1_reg_type(devinfo, inst); + brw_inst_src0_reg_hw_type(devinfo, inst) : + brw_inst_src1_reg_hw_type(devinfo, inst); /* The PRMs say: * diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h index cd3b0e95ea0..4195150112c 100644 --- a/src/intel/compiler/brw_inst.h +++ b/src/intel/compiler/brw_inst.h @@ -135,7 +135,7 @@ F(src1_da16_subreg_nr, 100, 100) F(src1_da1_subreg_nr, 100, 96) F(src1_da16_swiz_y, 99, 98) F(src1_da16_swiz_x, 97, 96) -F8(src1_reg_type, /* 4+ */ 46, 44, /* 8+ */ 94, 91) +F8(src1_reg_hw_type, /* 4+ */ 46, 44, /* 8+ */ 94, 91) F8(src1_reg_file, /* 4+ */ 43, 42, /* 8+ */ 90, 89) F(src0_vstride, 88, 85) F(src0_width, 84, 82) @@ -160,9 +160,9 @@ F(dst_da_reg_nr, 60, 53) F(dst_da16_subreg_nr, 52, 52) F(dst_da1_subreg_nr, 52, 48) F(da16_writemask, 51, 48) /* Dst.ChanEn */ -F8(src0_reg_type, /* 4+ */ 41, 39, /* 8+ */ 46, 43) +F8(src0_reg_hw_type, /* 4+ */ 41, 39, /* 8+ */ 46, 43) F8(src0_reg_file, /* 4+ */ 38, 37, /* 8+ */ 42, 41) -F8(dst_reg_type, /* 4+ */ 36, 34, /* 8+ */ 40, 37) +F8(dst_reg_hw_type, /* 4+ */ 36, 34, /* 8+ */ 40, 37) F8(dst_reg_file, /* 4+ */ 33, 32, /* 8+ */ 36, 35) F8(mask_control, /* 4+ */ 9, 9, /* 8+ */ 34, 34) FF(flag_reg_nr, diff --git a/src/intel/compiler/brw_reg_type.h b/src/intel/compiler/brw_reg_type.h index a21bad5b158..ab482d231a0 100644 --- a/src/intel/compiler/brw_reg_type.h +++ b/src/intel/compiler/brw_reg_type.h @@ -67,10 +67,10 @@ enum brw_reg_type brw_hw_type_to_reg_type(const struct gen_device_info *devinfo, enum brw_reg_file file, unsigned hw_type); -#define brw_element_size(devinfo, inst, operand) \ - brw_hw_reg_type_to_size(devinfo, \ - brw_inst_ ## operand ## _reg_file(devinfo, inst), \ - brw_inst_ ## operand ## _reg_type(devinfo, inst)) +#define brw_element_size(devinfo, inst, operand) \ + brw_hw_reg_type_to_size(devinfo, \ + brw_inst_ ## operand ## _reg_file(devinfo, inst), \ + brw_inst_ ## operand ## _reg_hw_type(devinfo, inst)) unsigned brw_hw_reg_type_to_size(const struct gen_device_info *devinfo, enum brw_reg_file file, unsigned hw_type); diff --git a/src/intel/compiler/test_eu_validate.cpp b/src/intel/compiler/test_eu_validate.cpp index b43c41704b4..c3686888291 100644 --- a/src/intel/compiler/test_eu_validate.cpp +++ b/src/intel/compiler/test_eu_validate.cpp @@ -208,19 +208,19 @@ TEST_P(validation_test, opcode46) TEST_P(validation_test, dest_stride_must_be_equal_to_the_ratio_of_exec_size_to_dest_size) { brw_ADD(p, g0, g0, g0); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); EXPECT_FALSE(validate(p)); clear_instructions(p); brw_ADD(p, g0, g0, g0); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); EXPECT_TRUE(validate(p)); } @@ -234,9 +234,9 @@ TEST_P(validation_test, dst_subreg_must_be_aligned_to_exec_type_size) brw_ADD(p, g0, g0, g0); brw_inst_set_dst_da1_subreg_nr(&devinfo, last_inst, 2); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); EXPECT_FALSE(validate(p)); @@ -246,12 +246,12 @@ TEST_P(validation_test, dst_subreg_must_be_aligned_to_exec_type_size) brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_4); brw_inst_set_dst_da1_subreg_nr(&devinfo, last_inst, 8); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); brw_inst_set_src0_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_4); brw_inst_set_src0_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src0_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_1); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_4); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_1); @@ -478,9 +478,9 @@ TEST_P(validation_test, source_cannot_span_more_than_2_registers) { brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_32); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_8); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); @@ -491,9 +491,9 @@ TEST_P(validation_test, source_cannot_span_more_than_2_registers) brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_16); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_8); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); @@ -515,9 +515,9 @@ TEST_P(validation_test, destination_cannot_span_more_than_2_registers) brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_32); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); EXPECT_FALSE(validate(p)); @@ -527,12 +527,12 @@ TEST_P(validation_test, destination_cannot_span_more_than_2_registers) brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_8); brw_inst_set_dst_da1_subreg_nr(&devinfo, last_inst, 6); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_4); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src0_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src0_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src0_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_1); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_1); @@ -544,9 +544,9 @@ TEST_P(validation_test, src_region_spans_two_regs_dst_region_spans_one) { /* Writes to dest are to the lower OWord */ brw_ADD(p, g0, g0, g0); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); @@ -558,9 +558,9 @@ TEST_P(validation_test, src_region_spans_two_regs_dst_region_spans_one) /* Writes to dest are to the upper OWord */ brw_ADD(p, g0, g0, g0); brw_inst_set_dst_da1_subreg_nr(&devinfo, last_inst, 16); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); @@ -572,9 +572,9 @@ TEST_P(validation_test, src_region_spans_two_regs_dst_region_spans_one) /* Writes to dest are evenly split between OWords */ brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_16); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_8); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); @@ -587,12 +587,12 @@ TEST_P(validation_test, src_region_spans_two_regs_dst_region_spans_one) brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_4); brw_inst_set_dst_da1_subreg_nr(&devinfo, last_inst, 10); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src0_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_4); brw_inst_set_src0_width(&devinfo, last_inst, BRW_WIDTH_4); brw_inst_set_src0_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_1); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_16); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_2); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_1); @@ -679,9 +679,9 @@ TEST_P(validation_test, two_src_two_dst_each_dst_must_be_derived_from_one_src) brw_MOV(p, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_16); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src0_da1_subreg_nr(&devinfo, last_inst, 8); brw_inst_set_src0_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_4); brw_inst_set_src0_width(&devinfo, last_inst, BRW_WIDTH_4); @@ -716,9 +716,9 @@ TEST_P(validation_test, one_src_two_dst) brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_16); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_D); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); EXPECT_TRUE(validate(p)); @@ -727,9 +727,9 @@ TEST_P(validation_test, one_src_two_dst) brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_16); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src1_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_0); brw_inst_set_src1_width(&devinfo, last_inst, BRW_WIDTH_1); brw_inst_set_src1_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_0); @@ -745,12 +745,12 @@ TEST_P(validation_test, one_src_two_dst) brw_ADD(p, g0, g0, g0); brw_inst_set_exec_size(&devinfo, last_inst, BRW_EXECUTE_16); brw_inst_set_dst_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_2); - brw_inst_set_dst_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); - brw_inst_set_src0_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_dst_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src0_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); brw_inst_set_src0_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_0); brw_inst_set_src0_width(&devinfo, last_inst, BRW_WIDTH_1); brw_inst_set_src0_hstride(&devinfo, last_inst, BRW_HORIZONTAL_STRIDE_0); - brw_inst_set_src1_reg_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); + brw_inst_set_src1_reg_hw_type(&devinfo, last_inst, BRW_HW_REG_TYPE_W); if (devinfo.gen >= 8) { EXPECT_TRUE(validate(p));