<div dir="ltr">I think that makes sense. We need to enable ISD::FMA for the smaller types when AVX512 is enabled. Probably need to add AVX512 in PerformFMACombine and isFMAFasterThanFMulAndFAdd as well.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 1:23 PM, Ahmed Bougacha <span dir="ltr"><<a href="mailto:ahmed.bougacha@gmail.com" target="_blank">ahmed.bougacha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">In <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10617-23192429&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ysla99Ut5xWyr-2nCahmS3WbIhr3MLkA0y59Pyn9Uzs&s=CRfFLdD96V9UXgr7Sf8k4GIUnDI3LxLR5RX2wxAbk6U&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10617#192429</a>, @craig.topper wrote:<br>
<br>
> Are the 512-bit intrinsics in clang's headers qualified with F16C and FMA<br>
>  defines? They don't seem to be in gcc's headers. And gcc doesn't seem to<br>
>  auto enable FMA or F16C when avx512 is specified.<br>
><br>
> Similar question for the instructions in llvm.<br>
<br>
<br>
</span>They're not?<br>
<br>
But, if that's what you're getting at: if the defines have a 1-to-1 mapping with the intrinsics/headers (I think they do?), then on second thought, this isn't the right fix: +avx512f says nothing about whether we support FMA/F16C intrinsics, only the AVX512F ones.<br>
<br>
Then the actual issue here is that, for fma and f16c, LLVM codegen relies on +fma/+f16c only to mark say f32 ISD::FMA as legal, and generate X86ISD::FMADD.  Both of which are necessary to generate even the AVX512F instruction, and this makes it impossible with +avx512f alone.<br>
Does that make sense?  If so I'll post a patch!<br>
<span class="HOEnZb"><font color="#888888"><br>
-Ahmed<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10617&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ysla99Ut5xWyr-2nCahmS3WbIhr3MLkA0y59Pyn9Uzs&s=XWVIZVcDWw06lQyestBuOUTHWzkK_3a3grlzKzvxEx4&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10617</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ysla99Ut5xWyr-2nCahmS3WbIhr3MLkA0y59Pyn9Uzs&s=26w_Wozti6I3lDql73Lx1LNHlDdWIID5jBRv0vM58RI&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>