summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-04-03 18:00:22 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-04-03 18:00:22 +0000
commit5e6d20524a1f77f9c24e1b06d0dcb6d5c2d2b874 (patch)
tree26f89730ca449187371d7298a8b5b6b1261bab24
parentb0c810ff6d238198fec9d9b727809831f0f9bab3 (diff)
downloadbcm5719-llvm-5e6d20524a1f77f9c24e1b06d0dcb6d5c2d2b874.tar.gz
bcm5719-llvm-5e6d20524a1f77f9c24e1b06d0dcb6d5c2d2b874.zip
Ensuring that both bits are set, and not just a combination of one or the other.
llvm-svn: 178674
-rw-r--r--llvm/lib/Support/Host.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index fef66e634f9..73d98d14874 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -152,7 +152,8 @@ std::string sys::getHostCPUName() {
// If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV
// indicates that the AVX registers will be saved and restored on context
// switch, then we have full AVX support.
- bool HasAVX = (ECX & ((1 << 28) | (1 << 27))) != 0 && OSHasAVXSupport();
+ const unsigned AVXBits = (1 << 27) | (1 << 28);
+ bool HasAVX = ((ECX & AVXBits) == AVXBits) && OSHasAVXSupport();
GetX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
bool Em64T = (EDX >> 29) & 0x1;
OpenPOWER on IntegriCloud