Mesa (staging/21.1): aco: allow SDWA sels smaller than the operand size

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


Module: Mesa
Branch: staging/21.1
Commit: 0c5b2aa429580cd993f0f678548ffd2eb9b9b4db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c5b2aa429580cd993f0f678548ffd2eb9b9b4db

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>
(cherry picked from commit 2d36232e62ae7daba7ab0ed23f890d6c0e4a35c3)

---

 .pick_status.json                 | 2 +-
 src/amd/compiler/aco_validate.cpp | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 495ebed8f08..7752612371e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -247,7 +247,7 @@
         "description": "aco: allow SDWA sels smaller than the operand size",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp
index 5f586dccb74..15db1799e4d 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