From 33befb58b048659bc9b36e4deade617f2ec7c20f Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 2 May 2022 13:16:54 +0100 Subject: [PATCH] aco: fix redirect combine in propagate_constants_vop3p() with negatives MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This previously didn't correctly consider negative integers when bits=16 (which sign-extend) and would have combined 0xfffe0000.xy as -2.yx. Now it combines 0xfffeffff.xy as that instead. It was also skipped when bits=32. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 88440c1..82dbf82 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -949,12 +949,7 @@ propagate_constants_vop3p(opt_ctx& ctx, aco_ptr& instr, ssa_info& i /* opsel must point to lo for both halves */ vop3p->opsel_lo &= ~(1 << i); vop3p->opsel_hi &= ~(1 << i); - } else if (const_lo == Operand::c16(0)) { - /* don't inline FP constants into integer instructions */ - // TODO: check if negative integers are zero- or sign-extended - if (bits == 32 && const_hi.constantValue() > 64u) - return; - + } else if (const_lo.constantValue() == const_hi.constantValue16(true)) { instr->operands[i] = const_hi; /* redirect opsel selection */ -- 2.7.4