[clang] cc9fa50 - [AArch64] Remove AES, SHA2, SHA3 and SM4 features from armv8.6-a+

David Green via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 23 10:39:23 PST 2023


Author: David Green
Date: 2023-01-23T18:39:17Z
New Revision: cc9fa501ea668d197c8b55da17b76680fe79b231

URL: https://github.com/llvm/llvm-project/commit/cc9fa501ea668d197c8b55da17b76680fe79b231
DIFF: https://github.com/llvm/llvm-project/commit/cc9fa501ea668d197c8b55da17b76680fe79b231.diff

LOG: [AArch64] Remove AES, SHA2, SHA3 and SM4 features from armv8.6-a+

The Armv8.6-a and later architecture definitions included AES, SHA2,
SHA3 and SM4, but this did not have an effect when specifying
-march=armv8.6-a. The did not set preprocessor features
(https://godbolt.org/z/1YKad6M8e) or enable the relevant instructions
(like eor3 from sha3: https://godbolt.org/z/vY9v4MqvG). Similarly
architectures armv8 to armv8.5 defined +crypto, but this did not effect
the -march's, only the -mcpu with those architectures. I believe this
was working as intended.

After D141411 we now add the default features for architectures except
for +crypto, which has had the effect of enabling aes/sha2/sha3/sm4 when
-march=armv8.6-a is used. This patch removed those crypto features
again, going back to how things were before. It also removes the
AEK_CRYPTO feature from lower architecture levels, moving it to the cpus
that use it. This shouldn't make any changes, but a few extra tests have
been added for preprocessor features that have improved since llvm 15.

The -mcpu=ampere1 cpu is the only armv8.6+ cpu at present. For that, the
AES, SHA2 and SHA3 features have been re-added to the CPU definition to
keep it in-line with the gcc definition from
https://github.com/gcc-mirror/gcc/commit/db2f5d661239737157cf131de7d4df1c17d8d88d.

Differential Revision: https://reviews.llvm.org/D141606

Added: 
    

Modified: 
    clang/lib/Basic/Targets/AArch64.cpp
    clang/test/CodeGen/aarch64-targetattr.c
    clang/test/Preprocessor/aarch64-target-features.c
    llvm/include/llvm/TargetParser/AArch64TargetParser.h
    llvm/unittests/TargetParser/TargetParserTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 1e6c24c12b24f..dfed95f0513f0 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -698,8 +698,6 @@ void AArch64TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
   if (llvm::AArch64::getExtensionFeatures(Extensions, CPUFeats)) {
     for (auto F : CPUFeats) {
       assert(F[0] == '+' && "Expected + in target feature!");
-      if (F == "+crypto")
-        continue;
       Features[F.drop_front(1)] = true;
     }
   }

diff  --git a/clang/test/CodeGen/aarch64-targetattr.c b/clang/test/CodeGen/aarch64-targetattr.c
index 6ce3c72c44b72..cc697b8894acf 100644
--- a/clang/test/CodeGen/aarch64-targetattr.c
+++ b/clang/test/CodeGen/aarch64-targetattr.c
@@ -92,7 +92,7 @@ void nosimd() {}
 // CHECK: attributes #0 = { {{.*}} "target-features"="+crc,+fp-armv8,+lse,+neon,+ras,+rdm,+v8.1a,+v8.2a,+v8a" }
 // CHECK: attributes #1 = { {{.*}} "target-features"="+crc,+fp-armv8,+fullfp16,+lse,+neon,+ras,+rdm,+sve,+v8.1a,+v8.2a,+v8a" }
 // CHECK: attributes #2 = { {{.*}} "target-features"="+crc,+fp-armv8,+fullfp16,+lse,+neon,+ras,+rdm,+sve,+sve2,+v8.1a,+v8.2a,+v8a" }
-// CHECK: attributes #3 = { {{.*}} "target-features"="+aes,+bf16,+crc,+dotprod,+fp-armv8,+fullfp16,+i8mm,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" }
+// CHECK: attributes #3 = { {{.*}} "target-features"="+bf16,+crc,+dotprod,+fp-armv8,+fullfp16,+i8mm,+lse,+neon,+ras,+rcpc,+rdm,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" }
 // CHECK: attributes #4 = { {{.*}} "target-cpu"="cortex-a710" "target-features"="+bf16,+crc,+dotprod,+flagm,+fp-armv8,+fp16fml,+fullfp16,+i8mm,+lse,+mte,+neon,+pauth,+ras,+rcpc,+rdm,+sb,+sve,+sve2,+sve2-bitperm" }
 // CHECK: attributes #5 = { {{.*}} "tune-cpu"="cortex-a710" }
 // CHECK: attributes #6 = { {{.*}} "target-cpu"="generic" }
@@ -104,6 +104,6 @@ void nosimd() {}
 // CHECK: attributes #12 = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+sve" }
 // CHECK: attributes #13 = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+sve,-sve2" }
 // CHECK: attributes #14 = { {{.*}} "target-features"="+fullfp16" }
-// CHECK: attributes #15 = { {{.*}} "target-cpu"="neoverse-n1" "target-features"="+aes,+bf16,+crc,+crypto,+dotprod,+fp-armv8,+fullfp16,+i8mm,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+spe,+ssbs,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" "tune-cpu"="cortex-a710" }
-// CHECK: attributes #16 = { {{.*}} "branch-target-enforcement"="true" {{.*}} "target-features"="+aes,+bf16,+crc,+crypto,+dotprod,+fp-armv8,+fullfp16,+i8mm,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+spe,+ssbs,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" "tune-cpu"="cortex-a710" }
+// CHECK: attributes #15 = { {{.*}} "target-cpu"="neoverse-n1" "target-features"="+bf16,+crc,+crypto,+dotprod,+fp-armv8,+fullfp16,+i8mm,+lse,+neon,+ras,+rcpc,+rdm,+spe,+ssbs,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" "tune-cpu"="cortex-a710" }
+// CHECK: attributes #16 = { {{.*}} "branch-target-enforcement"="true" {{.*}} "target-features"="+bf16,+crc,+crypto,+dotprod,+fp-armv8,+fullfp16,+i8mm,+lse,+neon,+ras,+rcpc,+rdm,+spe,+ssbs,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" "tune-cpu"="cortex-a710" }
 // CHECK: attributes #17 = { {{.*}} "target-features"="-neon" }

diff  --git a/clang/test/Preprocessor/aarch64-target-features.c b/clang/test/Preprocessor/aarch64-target-features.c
index 8ad5b3a91c4d6..ba1b56c492067 100644
--- a/clang/test/Preprocessor/aarch64-target-features.c
+++ b/clang/test/Preprocessor/aarch64-target-features.c
@@ -181,6 +181,14 @@
 // CHECK-SVE-8_5-NOT: __ARM_FEATURE_SVE_MATMUL_INT8 1
 // CHECK-SVE-8_5: __ARM_FEATURE_SVE 1
 
+// RUN: %clang -target aarch64-none-linux-gnu -march=armv8.6-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-8_6 %s
+// CHECK-8_6-NOT: __ARM_FEATURE_AES 1
+// CHECK-8_6: __ARM_FEATURE_BF16 1
+// CHECK-8_6: __ARM_FEATURE_MATMUL_INT8 1
+// CHECK-8_6-NOT: __ARM_FEATURE_SHA2 1
+// CHECK-8_6-NOT: __ARM_FEATURE_SHA3 1
+// CHECK-8_6-NOT: __ARM_FEATURE_SM4 1
+
 // RUN: %clang -target aarch64-none-linux-gnu -march=armv8.6-a+sve -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE-8_6 %s
 // CHECK-SVE-8_6: __ARM_FEATURE_SVE 1
 // CHECK-SVE-8_6: __ARM_FEATURE_SVE_BF16 1
@@ -194,6 +202,10 @@
 // CHECK-SVE-8_6-NOFEATURES:     __ARM_FEATURE_SVE 1
 
 // RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2 %s
+// RUN: %clang -target aarch64-none-linux-gnu -march=armv9.1-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2 %s
+// RUN: %clang -target aarch64-none-linux-gnu -march=armv9.2-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2 %s
+// RUN: %clang -target aarch64-none-linux-gnu -march=armv9.3-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2 %s
+// RUN: %clang -target aarch64-none-linux-gnu -march=armv9.4-a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2 %s
 // RUN: %clang -target aarch64-none-linux-gnu -march=armv9-a+sve2 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE2 %s
 // CHECK-SVE2: __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
 // CHECK-SVE2: __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
@@ -217,6 +229,7 @@
 // CHECK-SVE2BITPERM: __ARM_FEATURE_SVE2_BITPERM 1
 
 // RUN: %clang -target aarch64-none-linux-gnu -march=armv8.2a+dotprod -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DOTPROD %s
+// RUN: %clang -target aarch64-none-linux-gnu -march=armv8.4a -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DOTPROD %s
 // CHECK-DOTPROD: __ARM_FEATURE_DOTPROD 1
 // CHECK-DOTPROD: __ARM_NEON 1
 // CHECK-DOTPROD: __ARM_NEON_FP 0xE

diff  --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 4df96dcf7554f..818cc411e5fe9 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -305,24 +305,23 @@ struct ArchInfo {
 
 // clang-format off
 inline constexpr ArchInfo INVALID   = { VersionTuple{0, 0}, AProfile, "invalid", "+", (AArch64::AEK_NONE)};
-inline constexpr ArchInfo ARMV8A    = { VersionTuple{8, 0}, AProfile, "armv8-a", "+v8a", (AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD), };
+inline constexpr ArchInfo ARMV8A    = { VersionTuple{8, 0}, AProfile, "armv8-a", "+v8a", (AArch64::AEK_FP | AArch64::AEK_SIMD), };
 inline constexpr ArchInfo ARMV8_1A  = { VersionTuple{8, 1}, AProfile, "armv8.1-a", "+v8.1a", (ARMV8A.DefaultExts | AArch64::AEK_CRC | AArch64::AEK_LSE | AArch64::AEK_RDM)};
 inline constexpr ArchInfo ARMV8_2A  = { VersionTuple{8, 2}, AProfile, "armv8.2-a", "+v8.2a", (ARMV8_1A.DefaultExts | AArch64::AEK_RAS)};
 inline constexpr ArchInfo ARMV8_3A  = { VersionTuple{8, 3}, AProfile, "armv8.3-a", "+v8.3a", (ARMV8_2A.DefaultExts | AArch64::AEK_RCPC)};
 inline constexpr ArchInfo ARMV8_4A  = { VersionTuple{8, 4}, AProfile, "armv8.4-a", "+v8.4a", (ARMV8_3A.DefaultExts | AArch64::AEK_DOTPROD)};
 inline constexpr ArchInfo ARMV8_5A  = { VersionTuple{8, 5}, AProfile, "armv8.5-a", "+v8.5a", (ARMV8_4A.DefaultExts)};
-constexpr unsigned BaseNoCrypto = ARMV8_5A.DefaultExts ^ AArch64::AEK_CRYPTO; // 8.6 onwards has no AEK_CRYPTO
-inline constexpr ArchInfo ARMV8_6A  = { VersionTuple{8, 6}, AProfile, "armv8.6-a", "+v8.6a", (BaseNoCrypto | AArch64::AEK_SM4 | AArch64::AEK_SHA3 | AArch64::AEK_BF16 | AArch64::AEK_SHA2 | AArch64::AEK_AES | AArch64::AEK_I8MM)};
+inline constexpr ArchInfo ARMV8_6A  = { VersionTuple{8, 6}, AProfile, "armv8.6-a", "+v8.6a", (ARMV8_5A.DefaultExts | AArch64::AEK_BF16 | AArch64::AEK_I8MM)};
 inline constexpr ArchInfo ARMV8_7A  = { VersionTuple{8, 7}, AProfile, "armv8.7-a", "+v8.7a", (ARMV8_6A.DefaultExts)};
 inline constexpr ArchInfo ARMV8_8A  = { VersionTuple{8, 8}, AProfile, "armv8.8-a", "+v8.8a", (ARMV8_7A.DefaultExts | AArch64::AEK_MOPS | AArch64::AEK_HBC)};
 inline constexpr ArchInfo ARMV8_9A  = { VersionTuple{8, 9}, AProfile, "armv8.9-a", "+v8.9a", (ARMV8_8A.DefaultExts | AArch64::AEK_SPECRES2 | AArch64::AEK_CSSC | AArch64::AEK_RASv2)};
-inline constexpr ArchInfo ARMV9A    = { VersionTuple{9, 0}, AProfile, "armv9-a", "+v9a", (BaseNoCrypto | AArch64::AEK_FP16 | AArch64::AEK_SVE | AArch64::AEK_SVE2)};
+inline constexpr ArchInfo ARMV9A    = { VersionTuple{9, 0}, AProfile, "armv9-a", "+v9a", (ARMV8_5A.DefaultExts | AArch64::AEK_FP16 | AArch64::AEK_SVE | AArch64::AEK_SVE2)};
 inline constexpr ArchInfo ARMV9_1A  = { VersionTuple{9, 1}, AProfile, "armv9.1-a", "+v9.1a", (ARMV9A.DefaultExts | AArch64::AEK_BF16 | AArch64::AEK_I8MM)};
 inline constexpr ArchInfo ARMV9_2A  = { VersionTuple{9, 2}, AProfile, "armv9.2-a", "+v9.2a", (ARMV9_1A.DefaultExts)};
 inline constexpr ArchInfo ARMV9_3A  = { VersionTuple{9, 3}, AProfile, "armv9.3-a", "+v9.3a", (ARMV9_2A.DefaultExts | AArch64::AEK_MOPS | AArch64::AEK_HBC)};
 inline constexpr ArchInfo ARMV9_4A  = { VersionTuple{9, 4}, AProfile, "armv9.4-a", "+v9.4a", (ARMV9_3A.DefaultExts | AArch64::AEK_SPECRES2 | AArch64::AEK_CSSC | AArch64::AEK_RASv2)};
 // For v8-R, we do not enable crypto and align with GCC that enables a more minimal set of optional architecture extensions.
-inline constexpr ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", ((BaseNoCrypto ^ AArch64::AEK_LSE) | AArch64::AEK_SSBS | AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SB), };
+inline constexpr ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", ((ARMV8_5A.DefaultExts ^ AArch64::AEK_LSE) | AArch64::AEK_SSBS | AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SB), };
 // clang-format on
 
 // The set of all architectures
@@ -341,43 +340,45 @@ struct CpuInfo {
 };
 
 inline constexpr CpuInfo CpuInfos[] = {
-    {"cortex-a34", ARMV8A, (AArch64::AEK_CRC)},
-    {"cortex-a35", ARMV8A, (AArch64::AEK_CRC)},
-    {"cortex-a53", ARMV8A, (AArch64::AEK_CRC)},
+    {"cortex-a34", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"cortex-a35", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"cortex-a53", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
     {"cortex-a55", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC)},
     {"cortex-a510", ARMV9A,
      (AArch64::AEK_BF16 | AArch64::AEK_I8MM | AArch64::AEK_SB |
       AArch64::AEK_PAUTH | AArch64::AEK_MTE | AArch64::AEK_SSBS |
       AArch64::AEK_SVE | AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM |
       AArch64::AEK_FP16FML)},
-    {"cortex-a57", ARMV8A, (AArch64::AEK_CRC)},
+    {"cortex-a57", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
     {"cortex-a65", ARMV8_2A,
-     (AArch64::AEK_DOTPROD | AArch64::AEK_FP16 | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
     {"cortex-a65ae", ARMV8_2A,
-     (AArch64::AEK_DOTPROD | AArch64::AEK_FP16 | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS)},
-    {"cortex-a72", ARMV8A, (AArch64::AEK_CRC)},
-    {"cortex-a73", ARMV8A, (AArch64::AEK_CRC)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+    {"cortex-a72", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"cortex-a73", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
     {"cortex-a75", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC)},
     {"cortex-a76", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
     {"cortex-a76ae", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
     {"cortex-a77", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-      AArch64::AEK_SSBS)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_RCPC |
+      AArch64::AEK_DOTPROD | AArch64::AEK_SSBS)},
     {"cortex-a78", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS | AArch64::AEK_PROFILE)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS | AArch64::AEK_PROFILE)},
     {"cortex-a78c", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS | AArch64::AEK_PROFILE | AArch64::AEK_FLAGM |
-      AArch64::AEK_PAUTH | AArch64::AEK_FP16FML)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS | AArch64::AEK_PROFILE |
+      AArch64::AEK_FLAGM | AArch64::AEK_PAUTH | AArch64::AEK_FP16FML)},
     {"cortex-a710", ARMV9A,
      (AArch64::AEK_MTE | AArch64::AEK_PAUTH | AArch64::AEK_FLAGM |
       AArch64::AEK_SB | AArch64::AEK_I8MM | AArch64::AEK_FP16FML |
@@ -391,11 +392,12 @@ inline constexpr CpuInfo CpuInfos[] = {
       AArch64::AEK_BF16 | AArch64::AEK_FLAGM)},
     {"cortex-r82", ARMV8R, (AArch64::AEK_LSE)},
     {"cortex-x1", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS | AArch64::AEK_PROFILE)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS | AArch64::AEK_PROFILE)},
     {"cortex-x1c", ARMV8_2A,
-     (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS | AArch64::AEK_PAUTH | AArch64::AEK_PROFILE)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_RCPC | AArch64::AEK_SSBS | AArch64::AEK_PAUTH |
+      AArch64::AEK_PROFILE)},
     {"cortex-x2", ARMV9A,
      (AArch64::AEK_MTE | AArch64::AEK_BF16 | AArch64::AEK_I8MM |
       AArch64::AEK_PAUTH | AArch64::AEK_SSBS | AArch64::AEK_SB |
@@ -408,72 +410,83 @@ inline constexpr CpuInfo CpuInfos[] = {
       AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_PREDRES |
       AArch64::AEK_FLAGM | AArch64::AEK_SSBS)},
     {"neoverse-e1", ARMV8_2A,
-     (AArch64::AEK_DOTPROD | AArch64::AEK_FP16 | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS)},
-    {"neoverse-n1", ARMV8_2A,
-     (AArch64::AEK_DOTPROD | AArch64::AEK_FP16 | AArch64::AEK_PROFILE |
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
       AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+    {"neoverse-n1", ARMV8_2A,
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
+      AArch64::AEK_PROFILE | AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
     {"neoverse-n2", ARMV8_5A,
-     (AArch64::AEK_BF16 | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-      AArch64::AEK_I8MM | AArch64::AEK_MTE | AArch64::AEK_SB |
-      AArch64::AEK_SSBS | AArch64::AEK_SVE | AArch64::AEK_SVE2 |
-      AArch64::AEK_SVE2BITPERM)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_BF16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_FP16 | AArch64::AEK_I8MM | AArch64::AEK_MTE |
+      AArch64::AEK_SB | AArch64::AEK_SSBS | AArch64::AEK_SVE |
+      AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM)},
     {"neoverse-512tvb", ARMV8_4A,
-     (AArch64::AEK_SVE | AArch64::AEK_SSBS | AArch64::AEK_FP16 |
-      AArch64::AEK_BF16 | AArch64::AEK_DOTPROD | AArch64::AEK_PROFILE |
-      AArch64::AEK_RAND | AArch64::AEK_FP16FML | AArch64::AEK_I8MM)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_SVE | AArch64::AEK_SSBS |
+      AArch64::AEK_FP16 | AArch64::AEK_BF16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_PROFILE | AArch64::AEK_RAND | AArch64::AEK_FP16FML |
+      AArch64::AEK_I8MM)},
     {"neoverse-v1", ARMV8_4A,
-     (AArch64::AEK_SVE | AArch64::AEK_SSBS | AArch64::AEK_FP16 |
-      AArch64::AEK_BF16 | AArch64::AEK_DOTPROD | AArch64::AEK_PROFILE |
-      AArch64::AEK_RAND | AArch64::AEK_FP16FML | AArch64::AEK_I8MM)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_SVE | AArch64::AEK_SSBS |
+      AArch64::AEK_FP16 | AArch64::AEK_BF16 | AArch64::AEK_DOTPROD |
+      AArch64::AEK_PROFILE | AArch64::AEK_RAND | AArch64::AEK_FP16FML |
+      AArch64::AEK_I8MM)},
     {"neoverse-v2", ARMV9A,
      (AArch64::AEK_SVE | AArch64::AEK_SVE2 | AArch64::AEK_SSBS |
       AArch64::AEK_FP16 | AArch64::AEK_BF16 | AArch64::AEK_RAND |
       AArch64::AEK_DOTPROD | AArch64::AEK_PROFILE | AArch64::AEK_SVE2BITPERM |
       AArch64::AEK_FP16FML | AArch64::AEK_I8MM | AArch64::AEK_MTE)},
-    {"cyclone", ARMV8A, (AArch64::AEK_NONE)},
-    {"apple-a7", ARMV8A, (AArch64::AEK_NONE)},
-    {"apple-a8", ARMV8A, (AArch64::AEK_NONE)},
-    {"apple-a9", ARMV8A, (AArch64::AEK_NONE)},
-    {"apple-a10", ARMV8A, (AArch64::AEK_CRC | AArch64::AEK_RDM)},
-    {"apple-a11", ARMV8_2A, (AArch64::AEK_FP16)},
-    {"apple-a12", ARMV8_3A, (AArch64::AEK_FP16)},
+    {"cyclone", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_NONE)},
+    {"apple-a7", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_NONE)},
+    {"apple-a8", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_NONE)},
+    {"apple-a9", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_NONE)},
+    {"apple-a10", ARMV8A,
+     (AArch64::AEK_CRYPTO | AArch64::AEK_CRC | AArch64::AEK_RDM)},
+    {"apple-a11", ARMV8_2A, (AArch64::AEK_CRYPTO | AArch64::AEK_FP16)},
+    {"apple-a12", ARMV8_3A, (AArch64::AEK_CRYPTO | AArch64::AEK_FP16)},
     {"apple-a13", ARMV8_4A,
-     (AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
+      AArch64::AEK_SHA3)},
     {"apple-a14", ARMV8_5A,
-     (AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
+      AArch64::AEK_SHA3)},
     {"apple-a15", ARMV8_5A,
-     (AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
+      AArch64::AEK_SHA3 | AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
     {"apple-a16", ARMV8_5A,
-     (AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
+      AArch64::AEK_SHA3 | AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
     {"apple-m1", ARMV8_5A,
-     (AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
+      AArch64::AEK_SHA3)},
     {"apple-m2", ARMV8_5A,
-     (AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
-    {"apple-s4", ARMV8_3A, (AArch64::AEK_FP16)},
-    {"apple-s5", ARMV8_3A, (AArch64::AEK_FP16)},
-    {"exynos-m3", ARMV8A, (AArch64::AEK_CRC)},
-    {"exynos-m4", ARMV8_2A, (AArch64::AEK_DOTPROD | AArch64::AEK_FP16)},
-    {"exynos-m5", ARMV8_2A, (AArch64::AEK_DOTPROD | AArch64::AEK_FP16)},
-    {"falkor", ARMV8A, (AArch64::AEK_CRC | AArch64::AEK_RDM)},
-    {"saphira", ARMV8_3A, (AArch64::AEK_PROFILE)},
-    {"kryo", ARMV8A, (AArch64::AEK_CRC)},
-    {"thunderx2t99", ARMV8_1A, (AArch64::AEK_NONE)},
-    {"thunderx3t110", ARMV8_3A, (AArch64::AEK_NONE)},
-    {"thunderx", ARMV8A, (AArch64::AEK_CRC)},
-    {"thunderxt88", ARMV8A, (AArch64::AEK_CRC)},
-    {"thunderxt81", ARMV8A, (AArch64::AEK_CRC)},
-    {"thunderxt83", ARMV8A, (AArch64::AEK_CRC)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
+      AArch64::AEK_SHA3 | AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
+    {"apple-s4", ARMV8_3A, (AArch64::AEK_CRYPTO | AArch64::AEK_FP16)},
+    {"apple-s5", ARMV8_3A, (AArch64::AEK_CRYPTO | AArch64::AEK_FP16)},
+    {"exynos-m3", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"exynos-m4", ARMV8_2A,
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16)},
+    {"exynos-m5", ARMV8_2A,
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16)},
+    {"falkor", ARMV8A,
+     (AArch64::AEK_CRYPTO | AArch64::AEK_CRC | AArch64::AEK_RDM)},
+    {"saphira", ARMV8_3A, (AArch64::AEK_CRYPTO | AArch64::AEK_PROFILE)},
+    {"kryo", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"thunderx2t99", ARMV8_1A, (AArch64::AEK_CRYPTO)},
+    {"thunderx3t110", ARMV8_3A, (AArch64::AEK_CRYPTO)},
+    {"thunderx", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"thunderxt88", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"thunderxt81", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
+    {"thunderxt83", ARMV8A, (AArch64::AEK_CRYPTO | AArch64::AEK_CRC)},
     {"tsv110", ARMV8_2A,
-     (AArch64::AEK_DOTPROD | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
-      AArch64::AEK_PROFILE)},
-    {"a64fx", ARMV8_2A, (AArch64::AEK_FP16 | AArch64::AEK_SVE)},
-    {"carmel", ARMV8_2A, (AArch64::AEK_FP16)},
+     (AArch64::AEK_CRYPTO | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
+      AArch64::AEK_FP16FML | AArch64::AEK_PROFILE)},
+    {"a64fx", ARMV8_2A,
+     (AArch64::AEK_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_SVE)},
+    {"carmel", ARMV8_2A, (AArch64::AEK_CRYPTO | AArch64::AEK_FP16)},
     {"ampere1", ARMV8_6A,
-     (AArch64::AEK_FP16 | AArch64::AEK_SB | AArch64::AEK_SSBS)},
+     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
+      AArch64::AEK_FP16 | AArch64::AEK_SB | AArch64::AEK_SSBS)},
     // Invalid CPU
     {"invalid", INVALID, (AArch64::AEK_INVALID)},
 };

diff  --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index 92756972fcd49..c922b7ca026ab 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -1337,9 +1337,9 @@ INSTANTIATE_TEST_SUITE_P(
                          AArch64::AEK_CRC  | AArch64::AEK_FP   | AArch64::AEK_FP16   |
                              AArch64::AEK_SIMD | AArch64::AEK_RAS  | AArch64::AEK_LSE     |
                              AArch64::AEK_RDM  | AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_SM4  | AArch64::AEK_SHA3 | AArch64::AEK_BF16    |
-                             AArch64::AEK_SHA2 | AArch64::AEK_AES  | AArch64::AEK_I8MM    |
-                             AArch64::AEK_SSBS | AArch64::AEK_SB,
+                             AArch64::AEK_SHA3 | AArch64::AEK_BF16 | AArch64::AEK_SHA2 |
+                             AArch64::AEK_AES  | AArch64::AEK_I8MM | AArch64::AEK_SSBS |
+                             AArch64::AEK_SB,
                          "8.6-A"),
         ARMCPUTestParams(
             "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
@@ -1352,13 +1352,13 @@ INSTANTIATE_TEST_SUITE_P(
                 AArch64::AEK_FP16FML | AArch64::AEK_I8MM,
             "8.4-A"),
         ARMCPUTestParams("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_NONE | AArch64::AEK_CRC |
+                         AArch64::AEK_CRC |
                              AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
                              AArch64::AEK_RDM | AArch64::AEK_FP |
                              AArch64::AEK_SIMD,
                          "8.1-A"),
         ARMCPUTestParams("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_NONE | AArch64::AEK_CRC |
+                         AArch64::AEK_CRC |
                              AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
                              AArch64::AEK_RDM | AArch64::AEK_FP |
                              AArch64::AEK_SIMD | AArch64::AEK_RAS |


        


More information about the cfe-commits mailing list