diff options
author | Samuel Pitoiset <[email protected]> | 2020-05-26 09:38:27 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2020-06-03 19:48:42 +0200 |
commit | f31c9b4edf6e8d972f26461c49c5e193bf6d9a13 (patch) | |
tree | 8ca5ecc3406bbc8b9bf7a6375ead1438f1ccd9ea /src | |
parent | a521c67d223c6e32ea9040643b1bd5a3cdfea04e (diff) |
aco: fix subdword copies on GFX6-GFX7
SDWA is only GFX8+. Use v_mov_b32 since the upper 16 bits don't matter.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5227>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/compiler/aco_builder_h.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/amd/compiler/aco_builder_h.py b/src/amd/compiler/aco_builder_h.py index 2b56e04e501..eb655471c90 100644 --- a/src/amd/compiler/aco_builder_h.py +++ b/src/amd/compiler/aco_builder_h.py @@ -382,13 +382,17 @@ public: } else if (op.bytes() > 2) { return pseudo(aco_opcode::p_create_vector, dst, op); } else if (dst.regClass().is_subdword()) { - aco_ptr<SDWA_instruction> sdwa{create_instruction<SDWA_instruction>(aco_opcode::v_mov_b32, asSDWA(Format::VOP1), 1, 1)}; - sdwa->operands[0] = op; - sdwa->definitions[0] = dst; - sdwa->sel[0] = op.bytes() == 1 ? sdwa_ubyte : sdwa_uword; - sdwa->dst_sel = dst.bytes() == 1 ? sdwa_ubyte : sdwa_uword; - sdwa->dst_preserve = true; - return insert(std::move(sdwa)); + if (program->chip_class >= GFX8) { + aco_ptr<SDWA_instruction> sdwa{create_instruction<SDWA_instruction>(aco_opcode::v_mov_b32, asSDWA(Format::VOP1), 1, 1)}; + sdwa->operands[0] = op; + sdwa->definitions[0] = dst; + sdwa->sel[0] = op.bytes() == 1 ? sdwa_ubyte : sdwa_uword; + sdwa->dst_sel = dst.bytes() == 1 ? sdwa_ubyte : sdwa_uword; + sdwa->dst_preserve = true; + return insert(std::move(sdwa)); + } else { + return vop1(aco_opcode::v_mov_b32, dst, op); + } } else { unreachable("Unhandled case in bld.copy()"); } |