From e9d1643288bfcec92f3cad5e4793ec1758b2a713 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 7 Jun 2021 16:56:45 +0100 Subject: [PATCH] aco: disallow SDWA for instructions with 64-bit definitions/operands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_ir.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp index 8aab589a458..5f6eb5c177d 100644 --- a/src/amd/compiler/aco_ir.cpp +++ b/src/amd/compiler/aco_ir.cpp @@ -228,11 +228,18 @@ bool can_use_SDWA(chip_class chip, const aco_ptr& 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 ||