mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Fix codegen for x86-64 on systems (like ppc or i386) that don't have 64-bit
features autodetected. This fixes PR1010 and Regression/CodeGen/X86/xmm-r64.ll on non-x86-64 hosts. llvm-svn: 31879
This commit is contained in:
parent
a2bbd246e0
commit
86e39c84b6
@ -205,14 +205,23 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
|
||||
// If feature string is not empty, parse features string.
|
||||
std::string CPU = GetCurrentX86CPU();
|
||||
ParseSubtargetFeatures(FS, CPU);
|
||||
} else
|
||||
// Otherwise, use CPUID to auto-detect feature set.
|
||||
AutoDetectSubtargetFeatures();
|
||||
|
||||
if (Is64Bit && !HasX86_64) {
|
||||
if (Is64Bit && !HasX86_64)
|
||||
std::cerr << "Warning: Generation of 64-bit code for a 32-bit processor "
|
||||
"requested.\n";
|
||||
if (Is64Bit && X86SSELevel < SSE2)
|
||||
std::cerr << "Warning: 64-bit processors all have at least SSE2.\n";
|
||||
} else {
|
||||
// Otherwise, use CPUID to auto-detect feature set.
|
||||
AutoDetectSubtargetFeatures();
|
||||
}
|
||||
|
||||
// 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 (Is64Bit) {
|
||||
HasX86_64 = true;
|
||||
if (X86SSELevel < SSE2)
|
||||
X86SSELevel = SSE2;
|
||||
}
|
||||
|
||||
// Set the boolean corresponding to the current target triple, or the default
|
||||
|
Loading…
Reference in New Issue
Block a user