[llvm] r370915 - [X86] Add support for avx512bf16 for __builtin_cpu_supports and compiler-rt's cpu indicator.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 4 09:01:43 PDT 2019
Author: ctopper
Date: Wed Sep 4 09:01:43 2019
New Revision: 370915
URL: http://llvm.org/viewvc/llvm-project?rev=370915&view=rev
Log:
[X86] Add support for avx512bf16 for __builtin_cpu_supports and compiler-rt's cpu indicator.
Modified:
llvm/trunk/include/llvm/Support/X86TargetParser.def
llvm/trunk/lib/Support/Host.cpp
Modified: llvm/trunk/include/llvm/Support/X86TargetParser.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/X86TargetParser.def?rev=370915&r1=370914&r2=370915&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/X86TargetParser.def (original)
+++ llvm/trunk/include/llvm/Support/X86TargetParser.def Wed Sep 4 09:01:43 2019
@@ -161,13 +161,13 @@ X86_FEATURE_COMPAT(32, FEATURE_GFNI,
X86_FEATURE_COMPAT(33, FEATURE_VPCLMULQDQ, "vpclmulqdq")
X86_FEATURE_COMPAT(34, FEATURE_AVX512VNNI, "avx512vnni")
X86_FEATURE_COMPAT(35, FEATURE_AVX512BITALG, "avx512bitalg")
+X86_FEATURE_COMPAT(36, FEATURE_AVX512BF16, "avx512bf16")
// Features below here are not in libgcc/compiler-rt.
X86_FEATURE (64, FEATURE_MOVBE)
X86_FEATURE (65, FEATURE_ADX)
X86_FEATURE (66, FEATURE_EM64T)
X86_FEATURE (67, FEATURE_CLFLUSHOPT)
X86_FEATURE (68, FEATURE_SHA)
-X86_FEATURE (69, FEATURE_AVX512BF16)
-X86_FEATURE (70, FEATURE_AVX512VP2INTERSECT)
+X86_FEATURE (69, FEATURE_AVX512VP2INTERSECT)
#undef X86_FEATURE_COMPAT
#undef X86_FEATURE
Modified: llvm/trunk/lib/Support/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Host.cpp?rev=370915&r1=370914&r2=370915&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Host.cpp (original)
+++ llvm/trunk/lib/Support/Host.cpp Wed Sep 4 09:01:43 2019
@@ -680,7 +680,7 @@ getIntelProcessorTypeAndSubtype(unsigned
// Skylake Xeon:
case 0x55:
*Type = X86::INTEL_COREI7;
- if (Features3 & (1 << (X86::FEATURE_AVX512BF16 - 64)))
+ if (Features2 & (1 << (X86::FEATURE_AVX512BF16 - 32)))
*Subtype = X86::INTEL_COREI7_COOPERLAKE; // "cooperlake"
else if (Features2 & (1 << (X86::FEATURE_AVX512VNNI - 32)))
*Subtype = X86::INTEL_COREI7_CASCADELAKE; // "cascadelake"
@@ -765,7 +765,7 @@ getIntelProcessorTypeAndSubtype(unsigned
break;
}
- if (Features3 & (1 << (X86::FEATURE_AVX512BF16 - 64))) {
+ if (Features2 & (1 << (X86::FEATURE_AVX512BF16 - 32))) {
*Type = X86::INTEL_COREI7;
*Subtype = X86::INTEL_COREI7_COOPERLAKE;
break;
@@ -1088,6 +1088,11 @@ static void getAvailableFeatures(unsigne
if (HasLeaf7 && ((EDX >> 8) & 1) && HasAVX512Save)
setFeature(X86::FEATURE_AVX512VP2INTERSECT);
+ bool HasLeaf7Subleaf1 =
+ MaxLeaf >= 7 && !getX86CpuIDAndInfoEx(0x7, 0x1, &EAX, &EBX, &ECX, &EDX);
+ if (HasLeaf7Subleaf1 && ((EAX >> 5) & 1) && HasAVX512Save)
+ setFeature(X86::FEATURE_AVX512BF16);
+
unsigned MaxExtLevel;
getX86CpuIDAndInfo(0x80000000, &MaxExtLevel, &EBX, &ECX, &EDX);
More information about the llvm-commits
mailing list