Mesa (master): r600/sfn: Don't emit inline constants in the r600 IR

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 28 08:17:40 UTC 2020


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Wed Apr 15 16:34:43 2020 +0200

r600/sfn: Don't emit inline constants in the r600 IR

This can be handled when lowering to assembly, and it makes testing
for indirect buffer and sampler access easier.

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

---

 src/gallium/drivers/r600/sfn/sfn_valuepool.cpp | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
index 3ff386d5a0f..79c83d82859 100644
--- a/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_valuepool.cpp
@@ -526,33 +526,12 @@ int ValuePool::allocate_with_mask(unsigned index, unsigned mask, bool pre_alloc)
 
 PValue ValuePool::literal(uint32_t value)
 {
-   const uint32_t float_1 = 0x3f800000;
-   const uint32_t float_05 = 0x3f000000;
-
    auto l = m_literals.find(value);
    if (l != m_literals.end())
       return l->second;
 
-   switch (value) {
-   case 0:
-      m_literals[0] = PValue(new InlineConstValue(ALU_SRC_0, 0));
-      return m_literals[0];
-   case 1:
-      m_literals[1] = PValue(new InlineConstValue(ALU_SRC_1_INT, 0));
-      return m_literals[1];
-   case float_1:
-      m_literals[float_1] = PValue(new InlineConstValue(ALU_SRC_1, 0));
-      return m_literals[float_1];
-   case float_05:
-      m_literals[float_05] = PValue(new InlineConstValue(ALU_SRC_0_5, 0));
-      return m_literals[float_05];
-   case 0xffffffff:
-      m_literals[0xffffffff] = PValue(new InlineConstValue(ALU_SRC_M_1_INT, 0));
-      return m_literals[0xffffffff];
-   default:
-      m_literals[value] = PValue(new LiteralValue(value));
-      return m_literals[value];
-   }
+   m_literals[value] = PValue(new LiteralValue(value));
+   return m_literals[value];
 }
 
 }



More information about the mesa-commit mailing list