[X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.
authorCraig Topper <craig.topper@intel.com>
Mon, 24 Sep 2018 18:55:41 +0000 (18:55 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 24 Sep 2018 18:55:41 +0000 (18:55 +0000)
After r341022, we more strictly check the 64bit feature in X86Subtargets constructor when a 64-bit triple is used. If we don't infer this feature for autodetected CPUs we might incorrectly report an error if the CPU name wasn't autodetected to a CPU that supports 64-bit.

llvm-svn: 342914

llvm/lib/Support/Host.cpp

index d04f6e7..963b32b 100644 (file)
@@ -1217,6 +1217,8 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
   Features["tbm"]    = HasExtLeaf1 && ((ECX >> 21) & 1);
   Features["mwaitx"] = HasExtLeaf1 && ((ECX >> 29) & 1);
 
+  Features["64bit"]  = HasExtLeaf1 && ((EDX >> 29) & 1);
+
   // Miscellaneous memory related features, detected by
   // using the 0x80000008 leaf of the CPUID instruction
   bool HasExtLeaf8 = MaxExtLevel >= 0x80000008 &&