llvm.org GIT mirror llvm / 1ac8f90
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 Aaron Ballman 7 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
112112 }
113113
114114 static bool OSHasAVXSupport() {
115 #if defined( __GNUC__ )
115 #if defined(__GNUC__)
116116 // Check xgetbv; this uses a .byte sequence instead of the instruction
117117 // directly because older assemblers do not include support for xgetbv and
118118 // there is no easy way to conditionally compile based on the assembler used.
119119 int rEAX, rEDX;
120120 __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0));
121 #elif defined(_MSC_VER)
121 #elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219
122122 unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
123123 #else
124124 int rEAX = 0; // Ensures we return false