return rc.bytes() % 2 == 0 ? 2 : 1;
} else if (rc.bytes() == 2 && can_use_opsel(chip, instr->opcode, idx, 1)) {
return 2;
+ } else if (instr->format == Format::VOP3P) {
+ return 2;
}
switch (instr->opcode) {
update_phi_map(ctx, tmp.get(), instr.get());
return;
} else if (rc.bytes() == 2 && can_use_opsel(chip, instr->opcode, idx, byte / 2)) {
- VOP3A_instruction *vop3 = static_cast<VOP3A_instruction *>(instr.get());
+ VOP3A_instruction* vop3 = static_cast<VOP3A_instruction *>(instr.get());
vop3->opsel |= (byte / 2) << idx;
return;
+ } else if (instr->format == Format::VOP3P && byte == 2) {
+ VOP3P_instruction* vop3p = static_cast<VOP3P_instruction*>(instr.get());
+ assert(!(vop3p->opsel_lo & (1 << idx)));
+ vop3p->opsel_lo |= 1 << idx;
+ vop3p->opsel_hi |= 1 << idx;
+ return;
}
if (chip >= GFX8 && instr->opcode == aco_opcode::ds_write_b8 && byte == 2) {
return std::make_pair(2u, 2u);
else
return std::make_pair(2u, 4u);
+ case aco_opcode::v_fma_mixlo_f16:
+ return std::make_pair(2u, 2u);
default:
break;
}
}
if (reg.byte() == 2) {
- if (instr->opcode == aco_opcode::buffer_load_ubyte_d16)
+ if (instr->opcode == aco_opcode::v_fma_mixlo_f16)
+ instr->opcode = aco_opcode::v_fma_mixhi_f16;
+ else if (instr->opcode == aco_opcode::buffer_load_ubyte_d16)
instr->opcode = aco_opcode::buffer_load_ubyte_d16_hi;
else if (instr->opcode == aco_opcode::buffer_load_short_d16)
instr->opcode = aco_opcode::buffer_load_short_d16_hi;