Mesa (main): aco: clarify a portion of do_pack_2x16

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 31 18:32:15 UTC 2022


Module: Mesa
Branch: main
Commit: 9b60a678413a31addb4220f1a6f6d2928f6c1fa4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9b60a678413a31addb4220f1a6f6d2928f6c1fa4

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri May 13 13:49:49 2022 +0100

aco: clarify a portion of do_pack_2x16

This confused me a bit when I first saw it.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>

---

 src/amd/compiler/aco_lower_to_hw_instr.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp
index 0ada830b632..9c76913166b 100644
--- a/src/amd/compiler/aco_lower_to_hw_instr.cpp
+++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp
@@ -1405,7 +1405,9 @@ do_pack_2x16(lower_context* ctx, Builder& bld, Definition def, Operand lo, Opera
       bld.vop2(aco_opcode::v_lshlrev_b32, def_hi, Operand::c32(16u), hi);
       hi.setFixed(def.physReg().advance(2));
    } else if (ctx->program->gfx_level >= GFX8) {
-      /* either lo or hi can be placed with just a v_mov */
+      /* Either lo or hi can be placed with just a v_mov. SDWA is not needed, because
+       * op.physReg().byte()==def.physReg().byte() and the other half will be overwritten.
+       */
       assert(lo.physReg().byte() == 0 || hi.physReg().byte() == 2);
       Operand& op = lo.physReg().byte() == 0 ? lo : hi;
       PhysReg reg = def.physReg().advance(op.physReg().byte());



More information about the mesa-commit mailing list