<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 18, 2019 at 6:09 PM Francisco Jerez <<a href="mailto:currojerez@riseup.net">currojerez@riseup.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Strides up to 32B can be implemented for the source regions of most<br>
instructions by leveraging either the vertical or the horizontal<br>
stride of the hardware Align1 region. The main motivation for this is<br>
that currently the lower_integer_multiplication() pass will happily<br>
double the stride of one of the 32-bit sources, which can blow up if<br>
the stride of the original source was already the maximum value<br>
allowed by the hardware.<br></blockquote><div><br></div><div>I thought this looked familiar so I did some digging...</div><div><br></div><div>On Nov 2 of 2017, I wrote almost exactly this same patch which was committed on Nov 7 as e8c9e65185de3e821e1</div><div>On Nov 14, Matt reverted it in a31d0382084c8aa8 because it wasn't needed anymore and he wasn't sure of its correctness.</div><div><br></div><div>And here we are again....<br></div><div><br></div><div>I still believe it to be correct so it is</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></div><div><br></div><div>My one major request is that you include some of the history of this change in the commit message. As far as the patch itself goes, it's identical to mine except for the unneeded whitespace change and one additional assert which I believe to be a good addition.</div><div><br></div><div>I've also CC'd matt in case he wants to throw in his $.02</div><div><br></div><div>--Jason<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
An alternative would be to use the regioning legalization pass in<br>
order to lower such strides into the composition of multiple legal<br>
strides, but that would be somewhat less efficient.<br>
<br>
This showed up as a regression from my commit cbea91eb57a501bebb1ca2<br>
in Vulkan 1.1 CTS tests on CHV/BXT platforms, however it was really a<br>
pre-existing problem that had affected conformance on other platforms<br>
without native support for integer multiplication. CHV/BXT were<br>
getting around it because the code I removed in that commit had the<br>
"fortunate" side effect of emitting narrower regions that didn't hit<br>
the hardware stride limit after lowering. Beyond fixing the<br>
regression this fixes ~90 additional Vulkan 1.1 subgroup CTS tests on<br>
ICL (that's why this patch is marked for inclusion in mesa-stable even<br>
though the original regressing patch was not).<br>
<br>
Cc: <a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=109328Reported-by" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=109328<br>
Reported-by</a>: Mark Janes <<a href="mailto:mark.a.janes@intel.com" target="_blank">mark.a.janes@intel.com</a>><br>
---<br>
src/intel/compiler/brw_fs_generator.cpp | 14 +++++++++++---<br>
1 file changed, 11 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp<br>
index 5fc6cf5f8cc..b169eacf15b 100644<br>
--- a/src/intel/compiler/brw_fs_generator.cpp<br>
+++ b/src/intel/compiler/brw_fs_generator.cpp<br>
@@ -90,9 +90,17 @@ brw_reg_from_fs_reg(const struct gen_device_info *devinfo, fs_inst *inst,<br>
* different execution size when the number of components<br>
* written to each destination GRF is not the same.<br>
*/<br>
- const unsigned width = MIN2(reg_width, phys_width);<br>
- brw_reg = brw_vecn_reg(width, brw_file_from_reg(reg), reg->nr, 0);<br>
- brw_reg = stride(brw_reg, width * reg->stride, width, reg->stride);<br>
+ if (reg->stride > 4) {<br>
+ assert(reg != &inst->dst);<br>
+ assert(reg->stride * type_sz(reg->type) <= REG_SIZE);<br>
+ brw_reg = brw_vecn_reg(1, brw_file_from_reg(reg), reg->nr, 0);<br>
+ brw_reg = stride(brw_reg, reg->stride, 1, 0);<br>
+<br></blockquote><div><br></div><div>Extra whitespace?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ } else {<br>
+ const unsigned width = MIN2(reg_width, phys_width);<br>
+ brw_reg = brw_vecn_reg(width, brw_file_from_reg(reg), reg->nr, 0);<br>
+ brw_reg = stride(brw_reg, width * reg->stride, width, reg->stride);<br>
+ }<br>
<br>
if (devinfo->gen == 7 && !devinfo->is_haswell) {<br>
/* From the IvyBridge PRM (EU Changes by Processor Generation, page 13):<br>
-- <br>
2.19.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div></div></div>