From bcd9467d5cc11709d8c6fcbbcebd90f7e5255533 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 23 Apr 2020 17:23:21 +0100 Subject: [PATCH] aco: improve sub-dword emit_split_vector() with sgprs 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_instruction_selection.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 4366e8b2362..0732a2017d9 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -304,20 +304,21 @@ void emit_split_vector(isel_context* ctx, Temp vec_src, unsigned num_components) return; if (ctx->allocated_vec.find(vec_src.id()) != ctx->allocated_vec.end()) return; - aco_ptr split{create_instruction(aco_opcode::p_split_vector, Format::PSEUDO, 1, num_components)}; - split->operands[0] = Operand(vec_src); - std::array elems; RegClass rc; if (num_components > vec_src.size()) { - if (vec_src.type() == RegType::sgpr) + if (vec_src.type() == RegType::sgpr) { + /* should still help get_alu_src() */ + emit_split_vector(ctx, vec_src, vec_src.size()); return; - + } /* sub-dword split */ - assert(vec_src.type() == RegType::vgpr); rc = RegClass(RegType::vgpr, vec_src.bytes() / num_components).as_subdword(); } else { rc = RegClass(vec_src.type(), vec_src.size() / num_components); } + aco_ptr split{create_instruction(aco_opcode::p_split_vector, Format::PSEUDO, 1, num_components)}; + split->operands[0] = Operand(vec_src); + std::array elems; for (unsigned i = 0; i < num_components; i++) { elems[i] = {ctx->program->allocateId(), rc}; split->definitions[i] = Definition(elems[i]); -- 2.30.2