diff options
author | Daniel Schürmann <daniel@schuermann.dev> | 2020-09-14 11:53:33 +0100 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2021-01-13 11:24:11 -0800 |
commit | 65288fe496feadb677966d07356f9d2af4f79a7d (patch) | |
tree | f6f6c41941894ef65bfed42558fe1f5cbeb94dcb | |
parent | 03196956456a06d4fe91224615926ed81dacb159 (diff) |
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@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6680>
(cherry picked from commit 036a369f46ea7e5a3582377d72c77bf04550613c)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | 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++) { |