(0x03, 0x03, 0x01, 0x01, 0x03, "v_add_f32", True),
(0x04, 0x04, 0x02, 0x02, 0x04, "v_sub_f32", True),
(0x05, 0x05, 0x03, 0x03, 0x05, "v_subrev_f32", True),
- (0x06, 0x06, -1, -1, 0x06, "v_mac_legacy_f32", True),
+ (0x06, 0x06, -1, -1, 0x06, "v_mac_legacy_f32", True), #GFX6,7,10
+ ( -1, -1, -1, -1, 0x06, "v_fmac_legacy_f32", True), #GFX10.3+
(0x07, 0x07, 0x04, 0x04, 0x07, "v_mul_legacy_f32", True),
(0x08, 0x08, 0x05, 0x05, 0x08, "v_mul_f32", True),
(0x09, 0x09, 0x06, 0x06, 0x09, "v_mul_i32_i24", False),
# v_mad_legacy_f32 is replaced with v_fma_legacy_f32 on GFX10.3
if ver == 'gfx10' and names == set(['v_mad_legacy_f32', 'v_fma_legacy_f32']):
continue
+ # v_mac_legacy_f32 is replaced with v_fmac_legacy_f32 on GFX10.3
+ if ver == 'gfx10' and names == set(['v_mac_legacy_f32', 'v_fmac_legacy_f32']):
+ continue
print('%s and %s share the same opcode number (%s)' % (op_to_name[key], op.name, ver))
sys.exit(1)
op = instr->operands[2];
break;
+ case aco_opcode::v_mad_legacy_f32:
+ case aco_opcode::v_fma_legacy_f32:
+ if (instr->usesModifiers() || !ctx.program->dev.has_mac_legacy32)
+ continue;
+ op = instr->operands[2];
+ break;
+
default: continue;
}
instr->opcode == aco_opcode::v_mad_legacy_f16 ||
(instr->opcode == aco_opcode::v_fma_f16 && program->chip_class >= GFX10) ||
(instr->opcode == aco_opcode::v_pk_fma_f16 && program->chip_class >= GFX10) ||
+ (instr->opcode == aco_opcode::v_mad_legacy_f32 && program->dev.has_mac_legacy32) ||
+ (instr->opcode == aco_opcode::v_fma_legacy_f32 && program->dev.has_mac_legacy32) ||
(instr->opcode == aco_opcode::v_dot4_i32_i8 && program->family != CHIP_VEGA20)) &&
instr->operands[2].isTemp() && instr->operands[2].isKillBeforeDef() &&
instr->operands[2].getTemp().type() == RegType::vgpr &&
case aco_opcode::v_fma_f16: instr->opcode = aco_opcode::v_fmac_f16; break;
case aco_opcode::v_pk_fma_f16: instr->opcode = aco_opcode::v_pk_fmac_f16; break;
case aco_opcode::v_dot4_i32_i8: instr->opcode = aco_opcode::v_dot4c_i32_i8; break;
+ case aco_opcode::v_mad_legacy_f32:
+ instr->opcode = aco_opcode::v_mac_legacy_f32;
+ break;
+ case aco_opcode::v_fma_legacy_f32:
+ instr->opcode = aco_opcode::v_fmac_legacy_f32;
+ break;
default: break;
}
}
if (instr->opcode == aco_opcode::v_interp_p2_f32 ||
instr->opcode == aco_opcode::v_mac_f32 || instr->opcode == aco_opcode::v_fmac_f32 ||
instr->opcode == aco_opcode::v_mac_f16 || instr->opcode == aco_opcode::v_fmac_f16 ||
+ instr->opcode == aco_opcode::v_fmac_legacy_f32 ||
instr->opcode == aco_opcode::v_pk_fmac_f16 ||
instr->opcode == aco_opcode::v_writelane_b32 ||
instr->opcode == aco_opcode::v_writelane_b32_e64 ||