Mesa (master): aco: change usesModifiers() considering opsel_hi on packed instructions
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 18:03:29 UTC 2021
Module: Mesa
Branch: master
Commit: 036a369f46ea7e5a3582377d72c77bf04550613c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=036a369f46ea7e5a3582377d72c77bf04550613c
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>
---
src/amd/compiler/aco_ir.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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