aco: disallow SDWA for instructions with 64-bit definitions/operands

For example, v_cvt_f64_i32. LLVM doesn't seem to allow this either and it
doesn't seem to work correctly.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3151>
This commit is contained in:
Rhys Perry
2021-06-07 16:56:45 +01:00
committed by Marge Bot
parent 1cbcfb8b38
commit e9d1643288
+7
View File
@@ -228,11 +228,18 @@ bool can_use_SDWA(chip_class chip, const aco_ptr<Instruction>& instr)
}
}
if (!instr->definitions.empty() && instr->definitions[0].bytes() > 4)
return false;
if (!instr->operands.empty()) {
if (instr->operands[0].isLiteral())
return false;
if (chip < GFX9 && !instr->operands[0].isOfType(RegType::vgpr))
return false;
if (instr->operands[0].bytes() > 4)
return false;
if (instr->operands.size() > 1 && instr->operands[1].bytes() > 4)
return false;
}
bool is_mac = instr->opcode == aco_opcode::v_mac_f32 ||