aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Host.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-04-03 03:11:39 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-04-03 03:11:39 +0000
commit729c19482f434d8f3889d2a2c611a6e7813444f0 (patch)
tree8d45a2a878f1b62c047cbac8b01b093ec4d671a0 /lib/Support/Host.cpp
parenta67a20c95f08b31b499d06d1fa47bdf14f9d40d0 (diff)
downloadexternal_llvm-729c19482f434d8f3889d2a2c611a6e7813444f0.zip
external_llvm-729c19482f434d8f3889d2a2c611a6e7813444f0.tar.gz
external_llvm-729c19482f434d8f3889d2a2c611a6e7813444f0.tar.bz2
Rolling back the AVX support patch due to breaking a gcc 4.6 build bot that doesn't understand the xgetbv instruction for some reason. Will revisit when time permits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Host.cpp')
-rw-r--r--lib/Support/Host.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp
index c353cc6..b9bbcb9 100644
--- a/lib/Support/Host.cpp
+++ b/lib/Support/Host.cpp
@@ -112,19 +112,6 @@ static bool GetX86CpuIDAndInfo(unsigned value, unsigned *rEAX,
#endif
}
-static bool OSHasAVXSupport() {
-#if defined( __GNUC__ ) && \
- (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4)
- int rEAX, rEDX;
- __asm__ ("xgetbv" : "=a" (rEAX), "=d" (rEDX) : "c" (0));
-#elif defined(_MSC_VER)
- unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
-#else
- int rEAX = 0; // Ensures we return false
-#endif
- return (rEAX & 6) == 6;
-}
-
static void DetectX86FamilyModel(unsigned EAX, unsigned &Family,
unsigned &Model) {
Family = (EAX >> 8) & 0xf; // Bits 8 - 11
@@ -147,10 +134,6 @@ std::string sys::getHostCPUName() {
DetectX86FamilyModel(EAX, Family, Model);
bool HasSSE3 = (ECX & 0x1);
- // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV
- // indicates that the AVX registers will be saved and restored on context
- // switch, when we have full AVX support.
- bool HasAVX = (ECX & ((1 << 28) | (1 << 27))) != 0 && OSHasAVXSupport();
GetX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
bool Em64T = (EDX >> 29) & 0x1;
@@ -260,15 +243,11 @@ std::string sys::getHostCPUName() {
case 42: // Intel Core i7 processor. All processors are manufactured
// using the 32 nm process.
case 45:
- // Not all Sandy Bridge processors support AVX (such as the Pentium
- // versions instead of the i7 versions).
- return HasAVX ? "corei7-avx" : "corei7";
+ return "corei7-avx";
// Ivy Bridge:
case 58:
- // Not all Ivy Bridge processors support AVX (such as the Pentium
- // versions instead of the i7 versions).
- return HasAVX ? "core-avx-i" : "corei7";
+ return "core-avx-i";
case 28: // Most 45 nm Intel Atom processors
case 38: // 45 nm Atom Lincroft