diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2023-07-20 23:04:44 +0200 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2023-07-28 18:48:24 +0100 |
commit | 5b10c4e4b4a3b3ef7a2d3b3c3af792af699077a9 (patch) | |
tree | d835666f268f363e15c59ade9e50c4f7b890b45a | |
parent | 0b771cc271e92fed1a8c10546f45993e3442940f (diff) | |
download | mesa-5b10c4e4b4a3b3ef7a2d3b3c3af792af699077a9.tar.gz mesa-5b10c4e4b4a3b3ef7a2d3b3c3af792af699077a9.tar.bz2 mesa-5b10c4e4b4a3b3ef7a2d3b3c3af792af699077a9.zip |
aco: fix nir_op_vec8/16 with 16-bit elements.
Fixes: 5718347c2b4 ("aco: implement vec2/3/4 with subdword operands")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24286>
(cherry picked from commit 2fcf7c7014e72826d7d38fb63534fa9a9e1bee88)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/.pick_status.json b/.pick_status.json index 8659063c56f..a938b387c1b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2344,7 +2344,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" }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index bcf28615310..f6bc9dead15 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -1460,11 +1460,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; } |