From 2fcf7c7014e72826d7d38fb63534fa9a9e1bee88 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Thu, 20 Jul 2023 23:04:44 +0200 Subject: [PATCH] aco: fix nir_op_vec8/16 with 16-bit elements. Fixes: 5718347c2b4 ("aco: implement vec2/3/4 with subdword operands") Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 22600ac76d8..ea03e4044c5 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -1462,11 +1462,14 @@ visit_alu_instr(isel_context* ctx, nir_alu_instr* instr) if (dst.size() == 1) bld.copy(Definition(dst), packed[0]); - else if (dst.size() == 2) - bld.pseudo(aco_opcode::p_create_vector, Definition(dst), packed[0], packed[1]); - else - bld.pseudo(aco_opcode::p_create_vector, Definition(dst), packed[0], packed[1], - packed[2]); + else { + aco_ptr vec{create_instruction( + aco_opcode::p_create_vector, Format::PSEUDO, dst.size(), 1)}; + vec->definitions[0] = Definition(dst); + for (unsigned i = 0; i < dst.size(); ++i) + vec->operands[i] = Operand(packed[i]); + bld.insert(std::move(vec)); + } } break; }