<div dir="ltr">FWIW, this makes sense to me. I'd be interested to hear from folks that are supporting AMD processors which do support AVX to ensure that there isn't an undue runtime penalty for these.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 14, 2014 at 7:08 AM, Demikhovsky, Elena <span dir="ltr"><<a href="mailto:elena.demikhovsky@intel.com" target="_blank">elena.demikhovsky@intel.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div>
<font face="Calibri"><span style="font-size:11pt">
<div>Hi,</div>
<div> </div>
<div>I think that </div>
<div>def FeatureVectorUAMem : SubtargetFeature<"vector-unaligned-mem",</div>
<div>                                          "HasVectorUAMem", "true",</div>
<div>                 "Allow unaligned memory operands on vector/SIMD instructions">;</div>
<div> </div>
<div>should be switched-ON on AVX and AVX-512 instructions because:</div>
<div> </div>
<div>According to the AVX spec:</div>
<div>“<font face="Verdana"><span style="font-size:9pt">Most arithmetic and data processing instructions encoded using the VEX prefix and</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">performing memory accesses have more flexible memory alignment requirements</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">than instructions that are encoded without the VEX prefix. Specifically,</span></font></div>
<div><font face="Times New Roman" size="4"><span style="font-size:14pt">• <font face="Verdana"><span style="font-size:9pt">With the exception of explicitly aligned 16 or 32 byte SIMD load/store instructions,</span></font></span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">most VEX-encoded, arithmetic and data processing instructions operate in</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">a flexible environment regarding memory address alignment, i.e. VEX-encoded</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">instruction with 32-byte or 16-byte load semantics will support unaligned load</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">operation by default. Memory arguments for most instructions with VEX prefix</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">operate normally without causing #GP(0) on any byte-granularity alignment</span></font></div>
<div><font face="Verdana"><span style="font-size:9pt">(unlike Legacy SSE instructions).”</span></font></div>
<div> </div>
<div><font face="Verdana"><span style="font-size:9pt">And the same for AVX-512.</span></font></div>
<div> </div>
<div><font face="Verdana"><span style="font-size:9pt">We do not require any alignment while folding loads on the “Peephole Optimizations” on these targets.</span></font></div>
<div> </div>
<div> </div>
<div> </div>
<ul style="margin:0;padding-left:36pt">
<font face="Times New Roman" size="3" color="#31849B"><span style="font-size:12pt">
<li><b><i> Elena</i></b></li></span></font>
</ul>
<div> </div>
<div> </div>
<div> </div>
</span></font>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div></div>