Mesa (master): aco: use s_and_b64 exec to reduce uniform booleans to one bit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 14 17:12:08 UTC 2019


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Nov 12 11:40:28 2019 +0100

aco: use s_and_b64 exec to reduce uniform booleans to one bit

Reviewed-By: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>

---

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

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 7f4618b21e9..ab34a068671 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -354,7 +354,9 @@ Temp as_uniform_bool(isel_context *ctx, Temp val)
       assert(val.regClass() == s2);
       Builder bld(ctx->program, ctx->block);
       /* if we're currently in WQM mode, ensure that the source is also computed in WQM */
-      return bld.sopc(aco_opcode::s_cmp_lg_u64, bld.def(s1, scc), Operand(0u), emit_wqm(ctx, val));
+      Temp tmp = bld.tmp(s1);
+      bld.sop2(aco_opcode::s_and_b64, bld.def(s2), bld.scc(Definition(tmp)), val, Operand(exec, s2)).def(1).getTemp();
+      return emit_wqm(ctx, tmp);
    }
 }
 




More information about the mesa-commit mailing list