From fc39c3a0b1e044878cc002f41d121ba1e4a69dae Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 2 May 2022 13:19:45 +0100 Subject: [PATCH] aco: don't use opsel to fold constants into dot accumulation sources MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_optimizer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index b844de2..88440c1 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -912,6 +912,14 @@ propagate_constants_vop3p(opt_ctx& ctx, aco_ptr& instr, ssa_info& i return; } + /* The accumulation operand of dot product instructions ignores opsel. */ + bool cannot_use_opsel = + (instr->opcode == aco_opcode::v_dot4_i32_i8 || instr->opcode == aco_opcode::v_dot2_i32_i16 || + instr->opcode == aco_opcode::v_dot4_u32_u8 || instr->opcode == aco_opcode::v_dot2_u32_u16) && + i == 2; + if (cannot_use_opsel) + return; + /* try to fold inline constants */ VOP3P_instruction* vop3p = &instr->vop3p(); /* TODO: if bits==32, we might be able to get an inline constant if we sign-extend or shift left -- 2.7.4