Mesa (master): aco: allow SDWA sels smaller than the operand size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 21 11:23:46 UTC 2021


Module: Mesa
Branch: master
Commit: 2d36232e62ae7daba7ab0ed23f890d6c0e4a35c3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d36232e62ae7daba7ab0ed23f890d6c0e4a35c3

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Mon Apr 19 11:32:56 2021 +0100

aco: allow SDWA sels smaller than the operand size

p_extract_vector copy-propagation can create byte sels for v2b operands.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10315>

---

 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<Instruction>& 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;
 



More information about the mesa-commit mailing list