Module: Mesa Branch: staging/21.0 Commit: 23c866a5dbd3c937549fb61f7c4d4130d286621b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=23c866a5dbd3c937549fb61f7c4d4130d286621b
Author: Rhys Perry <[email protected]> Date: Mon Apr 19 11:32:56 2021 +0100 aco: allow SDWA sels smaller than the operand size p_extract_vector copy-propagation can create byte sels for v2b operands. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10315> (cherry picked from commit 2d36232e62ae7daba7ab0ed23f890d6c0e4a35c3) Conflicts: src/amd/compiler/aco_validate.cpp --- .pick_status.json | 2 +- src/amd/compiler/aco_validate.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5474ad3ed81..d66c471ce7e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6538,7 +6538,7 @@ "description": "aco: allow SDWA sels smaller than the operand size", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index d753670da8d..81a3f043075 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -574,8 +574,10 @@ bool validate_subdword_operand(chip_class chip, const aco_ptr<Instruction>& inst return byte == 0; if (instr->format == Format::PSEUDO && chip >= GFX8) return true; - if (instr->isSDWA() && (static_cast<SDWA_instruction *>(instr.get())->sel[index] & sdwa_asuint) == (sdwa_isra | op.bytes())) - return true; + if (instr->isSDWA()) { + unsigned sel = static_cast<SDWA_instruction *>(instr.get())->sel[index] & sdwa_asuint; + return (sel & sdwa_isra) && (sel & sdwa_rasize) <= op.bytes(); + } if (byte == 2 && can_use_opsel(chip, instr->opcode, index, 1)) return true; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
