Mesa (master): aco: fix vgpr nir_op_vecn with sgpr operands
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 28 23:29:08 UTC 2020
Module: Mesa
Branch: master
Commit: 3ee3ad561a29d5429309571db489f95e4ccaec5b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3ee3ad561a29d5429309571db489f95e4ccaec5b
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Mon Apr 27 21:17:56 2020 +0100
aco: fix vgpr nir_op_vecn with sgpr operands
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4772>
---
src/amd/compiler/aco_instruction_selection.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 0732a2017d9..beaebdb1257 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -1017,8 +1017,13 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
if (instr->dest.dest.ssa.bit_size >= 32 || dst.type() == RegType::vgpr) {
aco_ptr<Pseudo_instruction> vec{create_instruction<Pseudo_instruction>(aco_opcode::p_create_vector, Format::PSEUDO, instr->dest.dest.ssa.num_components, 1)};
- for (unsigned i = 0; i < num; ++i)
- vec->operands[i] = Operand{elems[i]};
+ RegClass elem_rc = RegClass::get(RegType::vgpr, instr->dest.dest.ssa.bit_size / 8u);
+ for (unsigned i = 0; i < num; ++i) {
+ if (elems[i].type() == RegType::sgpr && elem_rc.is_subdword())
+ vec->operands[i] = Operand(emit_extract_vector(ctx, elems[i], 0, elem_rc));
+ else
+ vec->operands[i] = Operand{elems[i]};
+ }
vec->definitions[0] = Definition(dst);
ctx->block->instructions.emplace_back(std::move(vec));
ctx->allocated_vec.emplace(dst.id(), elems);
More information about the mesa-commit
mailing list