mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
aco: fix vgpr nir_op_vecn with sgpr operands
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4772>
This commit is contained in:
parent
c5eda3c746
commit
3ee3ad561a
1 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue