aco: fix check_vop3_operands() for f16vec2 ffma fneg combine

For v_pk_fma_f16, we should consider all three operands, not the first
two.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 15a375b4c8 ("radv,aco: don't lower some ffma instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14229>
This commit is contained in:
Rhys Perry 2021-12-16 15:47:53 +00:00 committed by Marge Bot
parent 504e5cb4e8
commit 94603786c5

View file

@ -3120,8 +3120,11 @@ combine_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr)
ssa_info& info = ctx.info[op.tempId()];
if (info.is_vop3p() && info.instr->opcode == aco_opcode::v_pk_mul_f16 &&
info.instr->operands[1].constantEquals(0xBC00)) {
Operand ops[2] = {instr->operands[!i], info.instr->operands[0]};
if (!check_vop3_operands(ctx, 2, ops))
Operand ops[3];
for (unsigned j = 0; j < instr->operands.size(); j++)
ops[j] = instr->operands[j];
ops[i] = info.instr->operands[0];
if (!check_vop3_operands(ctx, instr->operands.size(), ops))
continue;
VOP3P_instruction* fneg = &info.instr->vop3p();