[PATCH] D35161: [X86] Improve the unknown stepping support for Intel CPUs in getHostCPUName
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 26 20:27:45 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL309246: [X86] Improve the unknown stepping support for Intel CPUs in getHostCPUName (authored by ctopper).
Changed prior to commit:
https://reviews.llvm.org/D35161?vs=105722&id=108410#toc
Repository:
rL LLVM
https://reviews.llvm.org/D35161
Files:
llvm/trunk/lib/Support/Host.cpp
Index: llvm/trunk/lib/Support/Host.cpp
===================================================================
--- llvm/trunk/lib/Support/Host.cpp
+++ llvm/trunk/lib/Support/Host.cpp
@@ -380,7 +380,9 @@
// Only one bit free left in the first 32 features.
FEATURE_MOVBE = 32,
FEATURE_ADX,
- FEATURE_EM64T
+ FEATURE_EM64T,
+ FEATURE_CLFLUSHOPT,
+ FEATURE_SHA,
};
// The check below for i386 was copied from clang's cpuid.h (__get_cpuid_max).
@@ -714,7 +716,21 @@
default: // Unknown family 6 CPU, try to guess.
if (Features & (1 << FEATURE_AVX512F)) {
- *Type = INTEL_KNL; // knl
+ if (Features & (1 << FEATURE_AVX512VL)) {
+ *Type = INTEL_COREI7;
+ *Subtype = INTEL_COREI7_SKYLAKE_AVX512;
+ } else {
+ *Type = INTEL_KNL; // knl
+ }
+ break;
+ }
+ if (Features2 & (1 << (FEATURE_CLFLUSHOPT - 32))) {
+ if (Features2 & (1 << (FEATURE_SHA - 32))) {
+ *Type = INTEL_GOLDMONT;
+ } else {
+ *Type = INTEL_COREI7;
+ *Subtype = INTEL_COREI7_SKYLAKE;
+ }
break;
}
if (Features2 & (1 << (FEATURE_ADX - 32))) {
@@ -974,12 +990,16 @@
Features2 |= 1 << (FEATURE_ADX - 32);
if (HasLeaf7 && ((EBX >> 21) & 1) && HasAVX512Save)
Features |= 1 << FEATURE_AVX512IFMA;
+ if (HasLeaf7 && ((EBX >> 23) & 1))
+ Features2 |= 1 << (FEATURE_CLFLUSHOPT - 32);
if (HasLeaf7 && ((EBX >> 26) & 1) && HasAVX512Save)
Features |= 1 << FEATURE_AVX512PF;
if (HasLeaf7 && ((EBX >> 27) & 1) && HasAVX512Save)
Features |= 1 << FEATURE_AVX512ER;
if (HasLeaf7 && ((EBX >> 28) & 1) && HasAVX512Save)
Features |= 1 << FEATURE_AVX512CD;
+ if (HasLeaf7 && ((EBX >> 29) & 1))
+ Features2 |= 1 << (FEATURE_SHA - 32);
if (HasLeaf7 && ((EBX >> 30) & 1) && HasAVX512Save)
Features |= 1 << FEATURE_AVX512BW;
if (HasLeaf7 && ((EBX >> 31) & 1) && HasAVX512Save)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35161.108410.patch
Type: text/x-patch
Size: 1935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170727/6160bca6/attachment.bin>
More information about the llvm-commits
mailing list