aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86Subtarget.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-03 00:04:43 +0000
committerDan Gohman <gohman@apple.com>2009-02-03 00:04:43 +0000
commitf75e5b4d8cbbec83924a3186a167a03564e5c373 (patch)
treed62257faa741547d30db110a16ac88d7c025560e /lib/Target/X86/X86Subtarget.cpp
parentca57b84729303d6f0c5abf951563efcde97010cd (diff)
downloadexternal_llvm-f75e5b4d8cbbec83924a3186a167a03564e5c373.zip
external_llvm-f75e5b4d8cbbec83924a3186a167a03564e5c373.tar.gz
external_llvm-f75e5b4d8cbbec83924a3186a167a03564e5c373.tar.bz2
Change Feature64Bit to not imply FeatureSSE2. All x86-64 hardware has
SSE2, however it's possible to disable SSE2, and the subtarget support code thinks that if 64-bit implies SSE2 and SSE2 is disabled then 64-bit should also be disabled. Instead, just mark all the 64-bit subtargets as explicitly supporting SSE2. Also, move the code that makes -march=x86-64 enable 64-bit support by default to only apply when there is no explicit subtarget. If you need to specify a subtarget and you want 64-bit code, you'll need to select a subtarget that supports 64-bit code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 185f45b..5ceafa4 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -327,21 +327,20 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
} else {
// Otherwise, use CPUID to auto-detect feature set.
AutoDetectSubtargetFeatures();
- if (Is64Bit && X86SSELevel < SSE2) {
- // Make sure SSE2 is enabled, it is available on all X86-64 CPUs.
- X86SSELevel = SSE2;
- }
- }
-
- // If requesting codegen for X86-64, make sure that 64-bit features
- // are enabled.
- if (Is64Bit) {
+ // If requesting codegen for X86-64, make sure that 64-bit features
+ // are enabled.
+ if (Is64Bit)
HasX86_64 = true;
+ // Make sure SSE2 is enabled; it is available on all X86-64 CPUs.
+ if (Is64Bit && X86SSELevel < SSE2)
+ X86SSELevel = SSE2;
}
- assert(!Is64Bit || HasX86_64);
+
DOUT << "Subtarget features: SSELevel " << X86SSELevel
<< ", 3DNowLevel " << X863DNowLevel
<< ", 64bit " << HasX86_64 << "\n";
+ assert((!Is64Bit || HasX86_64) &&
+ "64-bit code requested on a subtarget that doesn't support it!");
// Set the boolean corresponding to the current target triple, or the default
// if one cannot be determined, to true.