The check for XSAVE isn't necessary since all processors that support AVX support XSAVE. Checking OSXSAVE isn't sufficient you would also need to check XGETBV to make sure save/restore of XMM and YMM state is enabled by the OS.<br>
<br>~Craig<br><br><div class="gmail_quote">On Sat, Aug 25, 2012 at 1:33 AM, Alex Rønne Petersen <span dir="ltr"><<a href="mailto:alex@lycus.org" target="_blank">alex@lycus.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi LLVMers,<div><br></div><div>The AVX detection code in X86Subtarget::AutoDetectSubtargetFeatures() only checked for the CPUID.{EAX = 1}.ECX.AVX bit previously. This is not enough; the XSAVE and OSXSAVE bits also need to be checked to be sure that the OS is aware of XMM/YMM registers and saves them during context switches. This patch fixes that.</div>

<div><br></div><div>The patch was created with git diff - I was told svn should be able to work with that.</div><div><br></div><div>This is my first patch submission, so if I did something wrong, please bear with me. :)</div>

<div><br></div><div>Regards,</div><div>Alex</div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>~Craig<br>