!(devinfo->is_haswell &&
brw_inst_opcode(devinfo, &inst) == BRW_OPCODE_DIM) &&
!(devinfo->gen >= 8 &&
- (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);
+ (brw_inst_src0_type(devinfo, &inst) == BRW_REGISTER_TYPE_DF ||
+ brw_inst_src0_type(devinfo, &inst) == BRW_REGISTER_TYPE_UQ ||
+ brw_inst_src0_type(devinfo, &inst) == BRW_REGISTER_TYPE_Q))) {
+ enum brw_reg_file file = brw_inst_src0_reg_file(devinfo, &inst);
+ brw_inst_set_src1_file_type(devinfo, &inst, file, BRW_REGISTER_TYPE_UD);
}
/* Compacted instructions only have 12-bits (plus 1 for the other 20)
* 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_hw_type(devinfo, &inst) == BRW_HW_REG_TYPE_F &&
- brw_inst_dst_reg_hw_type(devinfo, &inst) == BRW_HW_REG_TYPE_F &&
+ brw_inst_src0_type(devinfo, &inst) == BRW_REGISTER_TYPE_F &&
+ brw_inst_dst_type(devinfo, &inst) == BRW_REGISTER_TYPE_F &&
brw_inst_dst_hstride(devinfo, &inst) == BRW_HORIZONTAL_STRIDE_1) {
- brw_inst_set_src0_reg_hw_type(devinfo, &inst, BRW_HW_IMM_TYPE_VF);
+ enum brw_reg_file file = brw_inst_src0_reg_file(devinfo, &inst);
+ brw_inst_set_src0_file_type(devinfo, &inst, file, BRW_REGISTER_TYPE_VF);
}
/* There are no mappings for dst:d | i:d, so if the immediate is suitable
*/
if (is_compactable_immediate(brw_inst_imm_ud(devinfo, &inst)) &&
brw_inst_cond_modifier(devinfo, &inst) == BRW_CONDITIONAL_NONE &&
- 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);
+ brw_inst_src0_type(devinfo, &inst) == BRW_REGISTER_TYPE_D &&
+ brw_inst_dst_type(devinfo, &inst) == BRW_REGISTER_TYPE_D) {
+ enum brw_reg_file src_file = brw_inst_src0_reg_file(devinfo, &inst);
+ enum brw_reg_file dst_file = brw_inst_dst_reg_file(devinfo, &inst);
+
+ brw_inst_set_src0_file_type(devinfo, &inst, src_file, BRW_REGISTER_TYPE_UD);
+ brw_inst_set_dst_file_type(devinfo, &inst, dst_file, BRW_REGISTER_TYPE_UD);
}
return inst;
gen7_convert_mrf_to_grf(p, &dest);
- brw_inst_set_dst_reg_file(devinfo, inst, dest.file);
- brw_inst_set_dst_reg_hw_type(devinfo, inst,
- brw_reg_type_to_hw_type(devinfo, dest.file,
- dest.type));
+ brw_inst_set_dst_file_type(devinfo, inst, dest.file, dest.type);
brw_inst_set_dst_address_mode(devinfo, inst, dest.address_mode);
if (dest.address_mode == BRW_ADDRESS_DIRECT) {
validate_reg(devinfo, inst, reg);
- brw_inst_set_src0_reg_file(devinfo, inst, reg.file);
- brw_inst_set_src0_reg_hw_type(devinfo, inst,
- brw_reg_type_to_hw_type(devinfo, reg.file, reg.type));
+ brw_inst_set_src0_file_type(devinfo, inst, 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);
validate_reg(devinfo, inst, reg);
- brw_inst_set_src1_reg_file(devinfo, inst, reg.file);
- brw_inst_set_src1_reg_hw_type(devinfo, inst,
- brw_reg_type_to_hw_type(devinfo, reg.file, reg.type));
+ brw_inst_set_src1_file_type(devinfo, inst, reg.file, reg.type);
brw_inst_set_src1_abs(devinfo, inst, reg.abs);
brw_inst_set_src1_negate(devinfo, inst, reg.negate);