summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86Subtarget.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-10-17 05:33:10 +0000
committerCraig Topper <craig.topper@gmail.com>2011-10-17 05:33:10 +0000
commit4b2dc74d3f17b40a57eba3068ce498a7f30769fe (patch)
tree4af6049f024e484b185b6ffed96477f8dfc047db /lib/Target/X86/X86Subtarget.cpp
parent24bb92556614434a5c5c2246b19e71d85426cab3 (diff)
downloadllvm-4b2dc74d3f17b40a57eba3068ce498a7f30769fe.tar.gz
llvm-4b2dc74d3f17b40a57eba3068ce498a7f30769fe.tar.bz2
llvm-4b2dc74d3f17b40a57eba3068ce498a7f30769fe.tar.xz
Don't use inline assembly in 64-bit Visual Studio. Unfortunately, this means that cpuid leaf 7 can't be queried on versions of Visual Studio earlier than VS 2008 SP1. Fixes PR11147.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index c08dac9f99..45a8c2f1e8 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -278,14 +278,15 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
}
if (IsIntel && MaxLevel >= 7) {
- X86_MC::GetCpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX);
- if ((EBX >> 3) & 0x1) {
- HasBMI = true;
- ToggleFeature(X86::FeatureBMI);
- }
- if ((EBX >> 8) & 0x1) {
- HasBMI2 = true;
- ToggleFeature(X86::FeatureBMI2);
+ if (!X86_MC::GetCpuIDAndInfoEx(0x7, 0x0, &EAX, &EBX, &ECX, &EDX)) {
+ if ((EBX >> 3) & 0x1) {
+ HasBMI = true;
+ ToggleFeature(X86::FeatureBMI);
+ }
+ if ((EBX >> 8) & 0x1) {
+ HasBMI2 = true;
+ ToggleFeature(X86::FeatureBMI2);
+ }
}
}
}