[Mesa-dev] [PATCH v4 19/28] i965/vec4: fix SIMD-width lowering for VEC4_OPCODE_FROM_DOUBLE

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Mar 20 09:17:16 UTC 2017


Now the VEC4_OPCODE_FROM_DOUBLE's destination data is written with
stride 2. We need to take into account this when doing the split
so we don't overwrite data.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/intel/compiler/brw_vec4.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_vec4.cpp b/src/intel/compiler/brw_vec4.cpp
index b26f8035811..f4eea954404 100644
--- a/src/intel/compiler/brw_vec4.cpp
+++ b/src/intel/compiler/brw_vec4.cpp
@@ -2198,6 +2198,7 @@ vec4_visitor::lower_simd_width()
          linst->group = channel_offset;
          linst->size_written = size_written;
 
+         bool d2f_pass = (inst->opcode == VEC4_OPCODE_FROM_DOUBLE && n > 0);
          /* Compute split dst region */
          dst_reg dst;
          if (needs_temp) {
@@ -2212,7 +2213,11 @@ vec4_visitor::lower_simd_width()
                inst->insert_before(block, copy);
             }
          } else {
-            dst = horiz_offset(inst->dst, channel_offset);
+            /* d2x conversion is done with a destination's stride of 2. We need
+             * to take into account when splitting it.
+             */
+            unsigned stride = d2f_pass ? 2 : 1;
+            dst = horiz_offset(inst->dst, stride * channel_offset);
          }
          linst->dst = dst;
 
-- 
2.11.0



More information about the mesa-dev mailing list