[llvm-commits] [llvm] r63552 - /llvm/trunk/lib/Target/X86/X86Subtarget.cpp
Torok Edwin
edwintorok at gmail.com
Mon Feb 2 13:57:34 PST 2009
Author: edwin
Date: Mon Feb 2 15:57:34 2009
New Revision: 63552
URL: http://llvm.org/viewvc/llvm-project?rev=63552&view=rev
Log:
Only force SSE level if it is not correct.
Add an assert to check HasX86_64 status.
Modified:
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=63552&r1=63551&r2=63552&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon Feb 2 15:57:34 2009
@@ -322,16 +322,23 @@
// If feature string is not empty, parse features string.
std::string CPU = GetCurrentX86CPU();
ParseSubtargetFeatures(FS, CPU);
+ // All X86-64 CPUs also have SSE2, however user might request no SSE via
+ // -mattr, so don't force SSELevel here.
} 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 and SSE2 features
- // are enabled. These are available on all x86-64 CPUs.
+ // If requesting codegen for X86-64, make sure that 64-bit features
+ // are enabled.
if (Is64Bit) {
- HasX86_64 = true;
+ HasX86_64 = true;
}
+ assert(!Is64Bit || HasX86_64);
DOUT << "Subtarget features: SSELevel " << X86SSELevel
<< ", 3DNowLevel " << X863DNowLevel
<< ", 64bit " << HasX86_64 << "\n";
More information about the llvm-commits
mailing list