]> granicus.if.org Git - clang/commitdiff
Move AESNI generation to Skylake and Goldmont
authorErich Keane <erich.keane@intel.com>
Mon, 10 Sep 2018 21:12:21 +0000 (21:12 +0000)
committerErich Keane <erich.keane@intel.com>
Mon, 10 Sep 2018 21:12:21 +0000 (21:12 +0000)
The instruction set first appeared with Westmere, but not all processors
in that and the next few generations have the instructions. According to
Wikipedia[1], the first generation in which all SKUs have AES
instructions are Skylake and Goldmont. I can't find any Skylake,
Kabylake, Kabylake-R or Cannon Lake currently listed at
https://ark.intel.com that says "IntelĀ® AES New Instructions" "No".

This matches GCC commit
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01940.html

[1] https://en.wikipedia.org/wiki/AES_instruction_set

Patch By: thiagomacieira
Differential Revision: https://reviews.llvm.org/D51510

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341862 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/X86.cpp

index eaca1811c0fe04f865d7cb7a64c4b35c3a4468b0..22a8b1e46a08921d948e14d61a904259112a6146 100644 (file)
@@ -170,6 +170,7 @@ bool X86TargetInfo::initFeatureMap(
       setFeatureEnabledImpl(Features, "sgx", true);
     setFeatureEnabledImpl(Features, "clflushopt", true);
     setFeatureEnabledImpl(Features, "rtm", true);
+    setFeatureEnabledImpl(Features, "aes", true);
     LLVM_FALLTHROUGH;
   case CK_Broadwell:
     setFeatureEnabledImpl(Features, "rdseed", true);
@@ -196,7 +197,6 @@ bool X86TargetInfo::initFeatureMap(
     setFeatureEnabledImpl(Features, "xsaveopt", true);
     LLVM_FALLTHROUGH;
   case CK_Westmere:
-    setFeatureEnabledImpl(Features, "aes", true);
     setFeatureEnabledImpl(Features, "pclmul", true);
     LLVM_FALLTHROUGH;
   case CK_Nehalem:
@@ -248,10 +248,10 @@ bool X86TargetInfo::initFeatureMap(
     setFeatureEnabledImpl(Features, "clflushopt", true);
     setFeatureEnabledImpl(Features, "mpx", true);
     setFeatureEnabledImpl(Features, "fsgsbase", true);
+    setFeatureEnabledImpl(Features, "aes", true);
     LLVM_FALLTHROUGH;
   case CK_Silvermont:
     setFeatureEnabledImpl(Features, "rdrnd", true);
-    setFeatureEnabledImpl(Features, "aes", true);
     setFeatureEnabledImpl(Features, "pclmul", true);
     setFeatureEnabledImpl(Features, "sse4.2", true);
     setFeatureEnabledImpl(Features, "prfchw", true);