[llvm] r342914 - [X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 11:55:42 PDT 2018


Author: ctopper
Date: Mon Sep 24 11:55:41 2018
New Revision: 342914

URL: http://llvm.org/viewvc/llvm-project?rev=342914&view=rev
Log:
[X86] Infer 64bit feature support from the CPUID results in getHostCPUFeatures.

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.

Modified:
    llvm/trunk/lib/Support/Host.cpp

Modified: llvm/trunk/lib/Support/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Host.cpp?rev=342914&r1=342913&r2=342914&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Host.cpp (original)
+++ llvm/trunk/lib/Support/Host.cpp Mon Sep 24 11:55:41 2018
@@ -1217,6 +1217,8 @@ bool sys::getHostCPUFeatures(StringMap<b
   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 &&




More information about the llvm-commits mailing list