Skip to content

Commit f9b2580

Browse files
committed
Merge from mainline.
Tevert part of the x86 subtarget logic changes: when -march=x86-64 is given, override the subtarget settings and enable 64-bit support. This restores the earlier behavior, and fixes regressions on Non-64-bit-capable x86-32 hosts. This isn't necessarily the best approach, but the most obvious alternative is to require -mcpu=x86-64 or -mattr=+64bit to be used with -march=x86-64 when the host doesn't have 64-bit support. This makes things little more consistent, but it's less convenient, and it has the practical drawback of requiring lots of test changes, so I opted for the above approach for now. llvm-svn: 63792
1 parent 5667100 commit f9b2580

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/X86/X86Subtarget.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,16 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
327327
} else {
328328
// Otherwise, use CPUID to auto-detect feature set.
329329
AutoDetectSubtargetFeatures();
330-
// If requesting codegen for X86-64, make sure that 64-bit features
331-
// are enabled.
332-
if (Is64Bit)
333-
HasX86_64 = true;
334330
// Make sure SSE2 is enabled; it is available on all X86-64 CPUs.
335331
if (Is64Bit && X86SSELevel < SSE2)
336332
X86SSELevel = SSE2;
337333
}
338334

335+
// If requesting codegen for X86-64, make sure that 64-bit features
336+
// are enabled.
337+
if (Is64Bit)
338+
HasX86_64 = true;
339+
339340
DOUT << "Subtarget features: SSELevel " << X86SSELevel
340341
<< ", 3DNowLevel " << X863DNowLevel
341342
<< ", 64bit " << HasX86_64 << "\n";

0 commit comments

Comments
 (0)