[llvm-commits] [PATCH] Correct AVX detection in X86Subtarget::AutoDetectSubtargetFeatures()

Craig Topper craig.topper at gmail.com
Sat Aug 25 21:20:58 PDT 2012

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.


On Sat, Aug 25, 2012 at 1:33 AM, Alex Rønne Petersen <alex at lycus.org> wrote:

> Hi LLVMers,
> 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.
> The patch was created with git diff - I was told svn should be able to
> work with that.
> This is my first patch submission, so if I did something wrong, please
> bear with me. :)
> Regards,
> Alex
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120825/aceb9b7d/attachment.html>

More information about the llvm-commits mailing list