diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index df8fd1a1640..c3503a363cc 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/lib/Target/X86/X86Subtarget.cpp @@ -230,14 +230,22 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { if (CPUName.empty()) CPUName = "generic"; - // Make sure 64-bit features are available in 64-bit mode. (But make sure - // SSE2 can be turned off explicitly.) std::string FullFS = FS; if (In64BitMode) { + // SSE2 should default to enabled in 64-bit mode, but can be turned off + // explicitly. if (!FullFS.empty()) - FullFS = "+64bit,+sse2," + FullFS; + FullFS = "+sse2," + FullFS; else - FullFS = "+64bit,+sse2"; + FullFS = "+sse2"; + + // If no CPU was specified, enable 64bit feature to satisy later check. + if (CPUName == "generic") { + if (!FullFS.empty()) + FullFS = "+64bit," + FullFS; + else + FullFS = "+64bit"; + } } // LAHF/SAHF are always supported in non-64-bit mode. @@ -272,8 +280,9 @@ void X86Subtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { LLVM_DEBUG(dbgs() << "Subtarget features: SSELevel " << X86SSELevel << ", 3DNowLevel " << X863DNowLevel << ", 64bit " << HasX86_64 << "\n"); - assert((!In64BitMode || HasX86_64) && - "64-bit code requested on a subtarget that doesn't support it!"); + if (In64BitMode && !HasX86_64) + report_fatal_error("64-bit code requested on a subtarget that doesn't " + "support it!"); // Stack alignment is 16 bytes on Darwin, Linux, kFreeBSD and Solaris (both // 32 and 64 bit) and for all 64-bit targets. |

