Mesa (master): r600/sfn: Count only literals that are not inline to split instruction groups

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 21 15:20:09 UTC 2020


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sun Apr 12 16:52:57 2020 +0200

r600/sfn: Count only literals that are not inline to split instruction groups

An instruction group can only support 4 distinct literals, but inline
constants count into this number, so skip them when counting.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

---

 src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp b/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp
index cf76d475679..e6a9f202819 100644
--- a/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_ir_to_assembly.cpp
@@ -246,7 +246,7 @@ bool AssemblyFromShaderLegacyImpl::emit_alu(const AluInstruction& ai, ECFAluOpCo
     * scheduler */
    if (m_nliterals_in_group > 4) {
       sfn_log << SfnLog::assembly << "  Have " << m_nliterals_in_group << " inject a last op (nop)\n";
-      alu.op = op0_nop;
+      alu.op = ALU_OP0_NOP;
       alu.last = 1;
       int retval = r600_bytecode_add_alu(m_bc, &alu);
       if (retval)
@@ -1057,21 +1057,31 @@ bool AssemblyFromShaderLegacyImpl::copy_src(r600_bytecode_alu_src& src, const Va
       if (v.value() == 0) {
          src.sel = ALU_SRC_0;
          src.chan = 0;
+         --m_nliterals_in_group;
          return true;
       }
       if (v.value() == 1) {
          src.sel = ALU_SRC_1_INT;
          src.chan = 0;
+         --m_nliterals_in_group;
          return true;
       }
       if (v.value_float() == 1.0f) {
          src.sel = ALU_SRC_1;
          src.chan = 0;
+         --m_nliterals_in_group;
          return true;
       }
       if (v.value_float() == 0.5f) {
          src.sel = ALU_SRC_0_5;
          src.chan = 0;
+         --m_nliterals_in_group;
+         return true;
+      }
+      if (v.value() == 0xffffffff) {
+         src.sel = ALU_SRC_M_1_INT;
+         src.chan = 0;
+         --m_nliterals_in_group;
          return true;
       }
       src.value = v.value();



More information about the mesa-commit mailing list