aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/compiler/aco_optimizer.cpp
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2019-12-11 16:57:11 +0000
committerRhys Perry <[email protected]>2020-01-13 13:26:43 +0000
commit7ce244b7d1b22023a43c7ca4bb8bac30c699147c (patch)
tree509c344c389320db0a040ec6275755748680c13e /src/amd/compiler/aco_optimizer.cpp
parentbbac52873f4248c2f545f12137bd24071a8043cc (diff)
aco: handle VOP3 modifiers when combining a constant comparison's NaN test
No pipeline-db changes Signed-off-by: Rhys Perry <[email protected]> Reviewed-By: Timur Kristóf <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3081>
Diffstat (limited to 'src/amd/compiler/aco_optimizer.cpp')
-rw-r--r--src/amd/compiler/aco_optimizer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 71353aae80b..6b46cb44494 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -1345,6 +1345,12 @@ bool combine_constant_comparison_ordering(opt_ctx &ctx, aco_ptr<Instruction>& in
if (prop_nan0 != prop_nan1)
return false;
+ if (nan_test->isVOP3()) {
+ VOP3A_instruction *vop3 = static_cast<VOP3A_instruction*>(nan_test);
+ if (vop3->neg[0] != vop3->neg[1] || vop3->abs[0] != vop3->abs[1] || vop3->opsel == 1 || vop3->opsel == 2)
+ return false;
+ }
+
int constant_operand = -1;
for (unsigned i = 0; i < 2; i++) {
if (cmp->operands[i].isTemp() && original_temp_id(ctx, cmp->operands[i].getTemp()) == prop_nan0) {