<div dir="ltr">I just wanted to avoid it getting removed later on because somebody sees it as an unnecessary micro-optimization providing no real benefit.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">- Chuck<br></div></div></div>
<br><div class="gmail_quote">On Wed, Jun 29, 2016 at 7:49 PM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Am 29.06.2016 um 04:32 schrieb Chuck Atkins:<br>
> This aligns the 4-element color float array to 16 byte boundaries. This<br>
> should allow compiler vectorizers to generate better optimizations.<br>
> Also fixes broken vectorization generated by Intel compiler.<br>
><br>
> v2: Fixed indentation and added a lengthy comment explaining the<br>
> reason for the alignment.<br>
><br>
> Reported-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com">timothy.o.rowley@intel.com</a>><br>
> Tested-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com">timothy.o.rowley@intel.com</a>><br>
> Signed-off-by: Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com">chuck.atkins@kitware.com</a>><br>
> Acked-by: Roland Scheidegger <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>><br>
> ---<br>
> src/gallium/include/pipe/p_state.h | 12 +++++++++++-<br>
> 1 file changed, 11 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h<br>
> index 1543e90..5526c39 100644<br>
> --- a/src/gallium/include/pipe/p_state.h<br>
> +++ b/src/gallium/include/pipe/p_state.h<br>
> @@ -326,7 +326,17 @@ struct pipe_blend_state<br>
><br>
> struct pipe_blend_color<br>
> {<br>
> - float color[4];<br>
> + /**<br>
> + * Making the color array explicitly 16-byte aligned provides a hint to<br>
> + * compilers to make more efficient auto-vectorization optimizations.<br>
> + * The actual performance gains from vectorizing the blend color array are<br>
> + * fairly minimal, if any, but the alignment is necessary to work around<br>
> + * buggy vectorization in some compilers which fail to generate the correct<br>
> + * unaligned accessors resulting in a segfault. Specifically several<br>
> + * versions of the Intel compiler are known to be affected but it's likely<br>
> + * others are as well.<br>
> + */<br>
> + PIPE_ALIGN_VAR(16) float color[4];<br>
> };<br>
><br>
><br>
<br>
</div></div>I'm all for comments but that looks a bit too much for such a simple<br>
thing. I think the first sentence would do...<br>
<span class="HOEnZb"><font color="#888888"><br>
Roland<br>
<br>
<br>
</font></span></blockquote></div><br></div>