From 1ead285d920769ee88be53d83c5d41046a8fa341 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 23 Mar 2022 18:32:06 +0000 Subject: [PATCH] aco: fix RA validation of 16-bit fma_mix operands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_validate.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index 695f3c3c67b..6f76b42995d 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -774,9 +774,13 @@ validate_subdword_operand(chip_class chip, const aco_ptr& instr, un if (instr->isSDWA()) return byte + instr->sdwa().sel[index].offset() + instr->sdwa().sel[index].size() <= 4 && byte % instr->sdwa().sel[index].size() == 0; - if (instr->isVOP3P()) + if (instr->isVOP3P()) { + bool fma_mix = instr->opcode == aco_opcode::v_fma_mixlo_f16 || + instr->opcode == aco_opcode::v_fma_mixhi_f16 || + instr->opcode == aco_opcode::v_fma_mix_f32; return ((instr->vop3p().opsel_lo >> index) & 1) == (byte >> 1) && - ((instr->vop3p().opsel_hi >> index) & 1) == (byte >> 1); + ((instr->vop3p().opsel_hi >> index) & 1) == (fma_mix || (byte >> 1)); + } if (byte == 2 && can_use_opsel(chip, instr->opcode, index)) return true;