aco: fix nir_op_vec8/16 with 16-bit elements.

Fixes: 5718347c2b ("aco: implement vec2/3/4 with subdword operands")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24286>
(cherry picked from commit 2fcf7c7014)
This commit is contained in:
Bas Nieuwenhuizen 2023-07-20 23:04:44 +02:00 committed by Dylan Baker
parent 6dc7de2441
commit 9d5a4e0e02
2 changed files with 9 additions and 6 deletions

View file

@ -14664,7 +14664,7 @@
"description": "aco: fix nir_op_vec8/16 with 16-bit elements.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "5718347c2b42ee25e5377d40024aaaa929889c44",
"notes": null

View file

@ -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<Pseudo_instruction> vec{create_instruction<Pseudo_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;
}