Mesa (staging/19.2): intel/fs: fix SHADER_OPCODE_CLUSTER_BROADCAST for SIMD32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 23 18:32:12 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: 770e77dcd113cbf3ec9bd04b947647e645b99547
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=770e77dcd113cbf3ec9bd04b947647e645b99547

Author: Paulo Zanoni <paulo.r.zanoni at intel.com>
Date:   Wed Sep  4 15:07:20 2019 -0700

intel/fs: fix SHADER_OPCODE_CLUSTER_BROADCAST for SIMD32

The current code can create functions with a width of 32, which is not
supported by our hardware. Add some code to simplify how we express
what we want and prevent such cases.

For some unknown reason, all the tests I could run seem to work even
with these unsupported MOVs.

Fixes: b0858c1cc6 "intel/fs: Add a couple of simple helper opcodes"
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
(cherry picked from commit 8e614c7a29a8926b20f5c18ef447ff82cafb7f1c)

---

 src/intel/compiler/brw_fs_generator.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp
index df215a6174b..84f70e7c48b 100644
--- a/src/intel/compiler/brw_fs_generator.cpp
+++ b/src/intel/compiler/brw_fs_generator.cpp
@@ -2164,8 +2164,17 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width,
          assert(src[2].type == BRW_REGISTER_TYPE_UD);
          const unsigned component = src[1].ud;
          const unsigned cluster_size = src[2].ud;
+         unsigned vstride = cluster_size;
+         unsigned width = cluster_size;
+
+         /* The maximum exec_size is 32, but the maximum width is only 16. */
+         if (inst->exec_size == width) {
+            vstride = 0;
+            width = 1;
+         }
+
          struct brw_reg strided = stride(suboffset(src[0], component),
-                                         cluster_size, cluster_size, 0);
+                                         vstride, width, 0);
          if (type_sz(src[0].type) > 4 &&
              (devinfo->is_cherryview || gen_device_info_is_9lp(devinfo))) {
             /* IVB has an issue (which we found empirically) where it reads




More information about the mesa-commit mailing list