llvm.org GIT mirror llvm / b68a88b
Only force SSE level if it is not correct. Add an assert to check HasX86_64 status. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63552 91177308-0d34-0410-b5e6-96231b3b80d8 Torok Edwin 10 years ago
1 changed file(s) with 11 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
321321 // If feature string is not empty, parse features string.
322322 std::string CPU = GetCurrentX86CPU();
323323 ParseSubtargetFeatures(FS, CPU);
324 // All X86-64 CPUs also have SSE2, however user might request no SSE via
325 // -mattr, so don't force SSELevel here.
324326 } else {
325327 // Otherwise, use CPUID to auto-detect feature set.
326328 AutoDetectSubtargetFeatures();
329 if (Is64Bit && X86SSELevel < SSE2) {
330 // Make sure SSE2 is enabled, it is available on all X86-64 CPUs.
331 X86SSELevel = SSE2;
332 }
327333 }
328334
329 // If requesting codegen for X86-64, make sure that 64-bit and SSE2 features
330 // are enabled. These are available on all x86-64 CPUs.
335 // If requesting codegen for X86-64, make sure that 64-bit features
336 // are enabled.
331337 if (Is64Bit) {
332 HasX86_64 = true;
333 }
338 HasX86_64 = true;
339 }
340 assert(!Is64Bit || HasX86_64);
334341 DOUT << "Subtarget features: SSELevel " << X86SSELevel
335342 << ", 3DNowLevel " << X863DNowLevel
336343 << ", 64bit " << HasX86_64 << "\n";