mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-16 14:26:17 +00:00
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
This commit is contained in:
@@ -322,16 +322,23 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
|
|||||||
// If feature string is not empty, parse features string.
|
// If feature string is not empty, parse features string.
|
||||||
std::string CPU = GetCurrentX86CPU();
|
std::string CPU = GetCurrentX86CPU();
|
||||||
ParseSubtargetFeatures(FS, CPU);
|
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 {
|
} else {
|
||||||
// Otherwise, use CPUID to auto-detect feature set.
|
// Otherwise, use CPUID to auto-detect feature set.
|
||||||
AutoDetectSubtargetFeatures();
|
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
|
// If requesting codegen for X86-64, make sure that 64-bit features
|
||||||
// are enabled. These are available on all x86-64 CPUs.
|
// are enabled.
|
||||||
if (Is64Bit) {
|
if (Is64Bit) {
|
||||||
HasX86_64 = true;
|
HasX86_64 = true;
|
||||||
}
|
}
|
||||||
|
assert(!Is64Bit || HasX86_64);
|
||||||
DOUT << "Subtarget features: SSELevel " << X86SSELevel
|
DOUT << "Subtarget features: SSELevel " << X86SSELevel
|
||||||
<< ", 3DNowLevel " << X863DNowLevel
|
<< ", 3DNowLevel " << X863DNowLevel
|
||||||
<< ", 64bit " << HasX86_64 << "\n";
|
<< ", 64bit " << HasX86_64 << "\n";
|
||||||
|
Reference in New Issue
Block a user