From 7ce244b7d1b22023a43c7ca4bb8bac30c699147c Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 11 Dec 2019 16:57:11 +0000 Subject: [PATCH] aco: handle VOP3 modifiers when combining a constant comparison's NaN test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No pipeline-db changes Signed-off-by: Rhys Perry Reviewed-By: Timur Kristóf Part-of: --- src/amd/compiler/aco_optimizer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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& in if (prop_nan0 != prop_nan1) return false; + if (nan_test->isVOP3()) { + VOP3A_instruction *vop3 = static_cast(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) { -- 2.30.2