Mesa (master): aco: Use 24-bit multiplication for NGG wave id and thread id.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 24 18:09:08 UTC 2020


Module: Mesa
Branch: master
Commit: 277f37d036159d373ec9726fe00148d5e49da875
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=277f37d036159d373ec9726fe00148d5e49da875

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Thu Apr 23 15:50:56 2020 +0200

aco: Use 24-bit multiplication for NGG wave id and thread id.

Both of them should always fit 24 bits anyway.

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

---

 src/amd/compiler/aco_instruction_selection.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 2dc9fc64ea3..bca192d7564 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -10614,9 +10614,9 @@ void ngg_emit_nogs_output(isel_context *ctx)
          Temp wave_id_in_tg = bld.sop2(aco_opcode::s_bfe_u32, bld.def(s1), bld.def(s1, scc),
                                        get_arg(ctx, ctx->args->merged_wave_info), Operand(24u | (4u << 16)));
          Temp thread_id_in_wave = emit_mbcnt(ctx, bld.def(v1));
-         Temp wave_id_mul = bld.v_mul_imm(bld.def(v1), as_vgpr(ctx, wave_id_in_tg), ctx->program->wave_size);
+         Temp wave_id_mul = bld.v_mul24_imm(bld.def(v1), as_vgpr(ctx, wave_id_in_tg), ctx->program->wave_size);
          Temp thread_id_in_tg = bld.vadd32(bld.def(v1), Operand(wave_id_mul), Operand(thread_id_in_wave));
-         Temp addr = bld.v_mul_imm(bld.def(v1), thread_id_in_tg, 4u);
+         Temp addr = bld.v_mul24_imm(bld.def(v1), thread_id_in_tg, 4u);
 
          /* Load primitive ID from LDS. */
          prim_id = load_lds(ctx, 4, bld.tmp(v1), addr, 0u, 4u);



More information about the mesa-commit mailing list