Mesa (staging/21.0): aco: change usesModifiers() considering opsel_hi on packed instructions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 19:31:06 UTC 2021


Module: Mesa
Branch: staging/21.0
Commit: 65288fe496feadb677966d07356f9d2af4f79a7d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65288fe496feadb677966d07356f9d2af4f79a7d

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Mon Sep 14 11:53:33 2020 +0100

aco: change usesModifiers() considering opsel_hi on packed instructions

opsel_hi == 1 means that the high operand selects the
high bits of the input, which is the normal behavior.

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6680>
(cherry picked from commit 036a369f46ea7e5a3582377d72c77bf04550613c)

---

 .pick_status.json         | 2 +-
 src/amd/compiler/aco_ir.h | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 627e4fc76f9..30efc7a7ec7 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -364,7 +364,7 @@
         "description": "aco: change usesModifiers() considering opsel_hi on packed instructions",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h
index f8aab8cef67..69a9d977595 100644
--- a/src/amd/compiler/aco_ir.h
+++ b/src/amd/compiler/aco_ir.h
@@ -1443,8 +1443,12 @@ constexpr bool Instruction::usesModifiers() const noexcept
       for (unsigned i = 0; i < operands.size(); i++) {
          if (vop3p->neg_lo[i] || vop3p->neg_hi[i])
             return true;
+
+         /* opsel_hi must be 1 to not be considered a modifier - even for constants */
+         if (!(vop3p->opsel_hi & (1 << i)))
+            return true;
       }
-      return vop3p->opsel_lo || vop3p->opsel_hi || vop3p->clamp;
+      return vop3p->opsel_lo || vop3p->clamp;
    } else if (isVOP3()) {
       const VOP3A_instruction *vop3 = static_cast<const VOP3A_instruction*>(this);
       for (unsigned i = 0; i < operands.size(); i++) {



More information about the mesa-commit mailing list