diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-04-03 16:28:24 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-04-03 16:28:24 +0000 |
commit | 1ac8f9073ce0fd0e247b477a427b35fa383cb3bd (patch) | |
tree | 011995a9ce51a605b9a2afb3aa659673a382a478 /lib/Support | |
parent | 375d767b5408cb2ba33185921f382c5f1115bce3 (diff) | |
download | external_llvm-1ac8f9073ce0fd0e247b477a427b35fa383cb3bd.zip external_llvm-1ac8f9073ce0fd0e247b477a427b35fa383cb3bd.tar.gz external_llvm-1ac8f9073ce0fd0e247b477a427b35fa383cb3bd.tar.bz2 |
Testing for Visual Studio 2010 SP1 or greater before calling the _xgetbv intrinsic. This also fixes a minor code formatting issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/Host.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index f91fb37..fef66e6 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -113,13 +113,13 @@ static bool GetX86CpuIDAndInfo(unsigned value, unsigned *rEAX, } static bool OSHasAVXSupport() {
-#if defined( __GNUC__ )
+#if defined(__GNUC__)
// Check xgetbv; this uses a .byte sequence instead of the instruction
// directly because older assemblers do not include support for xgetbv and
// there is no easy way to conditionally compile based on the assembler used.
int rEAX, rEDX;
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0));
-#elif defined(_MSC_VER)
+#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219
unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
#else
int rEAX = 0; // Ensures we return false
|