From 2d36232e62ae7daba7ab0ed23f890d6c0e4a35c3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 19 Apr 2021 11:32:56 +0100 Subject: [PATCH] aco: allow SDWA sels smaller than the operand size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit p_extract_vector copy-propagation can create byte sels for v2b operands. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Cc: mesa-stable Part-of: --- src/amd/compiler/aco_validate.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index 5d81eb0a36c..e5c44d6dabd 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -549,8 +549,10 @@ bool validate_subdword_operand(chip_class chip, const aco_ptr& inst return byte == 0; if (instr->isPseudo() && chip >= GFX8) return true; - if (instr->isSDWA() && (instr->sdwa().sel[index] & sdwa_asuint) == (sdwa_isra | op.bytes())) - return true; + if (instr->isSDWA()) { + unsigned sel = instr->sdwa().sel[index] & sdwa_asuint; + return (sel & sdwa_isra) && (sel & sdwa_rasize) <= op.bytes(); + } if (byte == 2 && can_use_opsel(chip, instr->opcode, index, 1)) return true;