[PATCH] D28221: Add check for AVX512 support before assuming skylake processor is SKX.

Valentin Churavy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 14:12:23 PST 2017


vchuravy updated this revision to Diff 83135.
vchuravy added a comment.

SKX: Defensively check for AVX512


https://reviews.llvm.org/D28221

Files:
  lib/Support/Host.cpp


Index: lib/Support/Host.cpp
===================================================================
--- lib/Support/Host.cpp
+++ lib/Support/Host.cpp
@@ -475,14 +475,22 @@
 
     // Skylake:
     case 0x4e:
-      *Type = INTEL_COREI7; // "skylake-avx512"
-      *Subtype = INTEL_COREI7_SKYLAKE_AVX512;
-      break;
     case 0x5e:
       *Type = INTEL_COREI7; // "skylake"
       *Subtype = INTEL_COREI7_SKYLAKE;
       break;
 
+    // Skylake Xeon:
+    case 0x55:
+      *Type = INTEL_COREI7; // "skylake-avx512"
+      // Check that we really have AVX512
+      if (Features & (1 << FEATURE_AVX512)) {
+        *Subtype = INTEL_COREI7_SKYLAKE_AVX512;
+      } else {
+        *Subtype = INTEL_COREI7_SKYLAKE;
+      }
+      break;
+
     case 0x1c: // Most 45 nm Intel Atom processors
     case 0x26: // 45 nm Atom Lincroft
     case 0x27: // 32 nm Atom Medfield


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28221.83135.patch
Type: text/x-patch
Size: 866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170104/9909fe8c/attachment.bin>


More information about the llvm-commits mailing list