summaryrefslogtreecommitdiff
path: root/lib/Support/Host.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-04-23 17:38:44 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-04-23 17:38:44 +0000
commit3579a29dba8fcc7285a3a5bec4512b4ca0a91ab3 (patch)
tree5a1c1b262cef4c8bd8f6211d446552cf19701233 /lib/Support/Host.cpp
parent2a74639bc7713146b1182328892807c421c84265 (diff)
downloadllvm-3579a29dba8fcc7285a3a5bec4512b4ca0a91ab3.tar.gz
llvm-3579a29dba8fcc7285a3a5bec4512b4ca0a91ab3.tar.bz2
llvm-3579a29dba8fcc7285a3a5bec4512b4ca0a91ab3.tar.xz
Testing for _XCR_XFEATURE_ENABLED_MASK instead of a specific MSVC version because some MSVC 2010 SP1 installations do not have the _xgetbv intrinsic. Patch thanks to Serge Pavlov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Host.cpp')
-rw-r--r--lib/Support/Host.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp
index 445b344968..27c99c89ae 100644
--- a/lib/Support/Host.cpp
+++ b/lib/Support/Host.cpp
@@ -119,7 +119,7 @@ static bool OSHasAVXSupport() {
// 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_FULL_VER) && _MSC_FULL_VER >= 160040219
+#elif defined(_MSC_FULL_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
#else
int rEAX = 0; // Ensures we return false