[clang] [AArch64]: Refactor target parser to use Bitset. (PR #65423)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 16:04:59 PDT 2023


https://github.com/hassnaaHamdi updated https://github.com/llvm/llvm-project/pull/65423:

>From 7f28cca36c704b29433791e0ec0f6e1520f90317 Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi <hassnaa.hamdi at arm.com>
Date: Tue, 5 Sep 2023 23:17:31 +0000
Subject: [PATCH 1/3] [AArch64]: Refactor target parser to use BitVector.

Use BitVector instead of BitMasking for the Architecture Extensions,
because the number of extensions will exceed the bitmask max size.

Change-Id: Ib4dcf7ee7a400d93ce89c02895ebf4cec2da0f7f
---
 clang/lib/Basic/Targets/AArch64.cpp           |    2 +-
 clang/lib/Driver/ToolChains/Arch/AArch64.cpp  |    2 +-
 .../llvm/TargetParser/AArch64TargetParser.h   |  428 ++--
 llvm/lib/TargetParser/AArch64TargetParser.cpp |    4 +-
 .../TargetParser/AArch64TargetParserTest.cpp  |  965 +++++++++
 .../TargetParser/ArmTargetParserTest.cpp      |  965 +++++++++
 llvm/unittests/TargetParser/CMakeLists.txt    |    3 +-
 .../TargetParser/TargetParserTest.cpp         | 1808 -----------------
 .../llvm/unittests/TargetParser/BUILD.gn      |    3 +-
 9 files changed, 2154 insertions(+), 2026 deletions(-)
 create mode 100644 llvm/unittests/TargetParser/AArch64TargetParserTest.cpp
 create mode 100644 llvm/unittests/TargetParser/ArmTargetParserTest.cpp
 delete mode 100644 llvm/unittests/TargetParser/TargetParserTest.cpp

diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 6c43c8b592622d0..5956baaefea6954 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -968,7 +968,7 @@ bool AArch64TargetInfo::initFeatureMap(
   // Parse the CPU and add any implied features.
   std::optional<llvm::AArch64::CpuInfo> CpuInfo = llvm::AArch64::parseCpu(CPU);
   if (CpuInfo) {
-    uint64_t Exts = CpuInfo->getImpliedExtensions();
+    llvm::BitVector Exts = CpuInfo->getImpliedExtensions();
     std::vector<StringRef> CPUFeats;
     llvm::AArch64::getExtensionFeatures(Exts, CPUFeats);
     for (auto F : CPUFeats) {
diff --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 507ad9247704103..43b14ddca3010d8 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -158,7 +158,7 @@ static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU,
 
     Features.push_back(ArchInfo->ArchFeature);
 
-    uint64_t Extension = CpuInfo->getImpliedExtensions();
+    llvm::BitVector Extension = CpuInfo->getImpliedExtensions();
     if (!llvm::AArch64::getExtensionFeatures(Extension, Features))
       return false;
   }
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index dc4cdfa8e90ac12..ddaf60564add0aa 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -19,6 +19,7 @@
 #include "llvm/Support/VersionTuple.h"
 #include <array>
 #include <vector>
+#include "llvm/ADT/BitVector.h"
 
 namespace llvm {
 
@@ -96,64 +97,65 @@ static_assert(FEAT_MAX <= 64,
 // Arch extension modifiers for CPUs. These are labelled with their Arm ARM
 // feature name (though the canonical reference for those is AArch64.td)
 // clang-format off
-enum ArchExtKind : uint64_t {
-  AEK_NONE =        1,
-  AEK_CRC =         1 << 1,  // FEAT_CRC32
-  AEK_CRYPTO =      1 << 2,
-  AEK_FP =          1 << 3,  // FEAT_FP
-  AEK_SIMD =        1 << 4,  // FEAT_AdvSIMD
-  AEK_FP16 =        1 << 5,  // FEAT_FP16
-  AEK_PROFILE =     1 << 6,  // FEAT_SPE
-  AEK_RAS =         1 << 7,  // FEAT_RAS, FEAT_RASv1p1
-  AEK_LSE =         1 << 8,  // FEAT_LSE
-  AEK_SVE =         1 << 9,  // FEAT_SVE
-  AEK_DOTPROD =     1 << 10, // FEAT_DotProd
-  AEK_RCPC =        1 << 11, // FEAT_LRCPC
-  AEK_RDM =         1 << 12, // FEAT_RDM
-  AEK_SM4 =         1 << 13, // FEAT_SM4, FEAT_SM3
-  AEK_SHA3 =        1 << 14, // FEAT_SHA3, FEAT_SHA512
-  AEK_SHA2 =        1 << 15, // FEAT_SHA1, FEAT_SHA256
-  AEK_AES =         1 << 16, // FEAT_AES, FEAT_PMULL
-  AEK_FP16FML =     1 << 17, // FEAT_FHM
-  AEK_RAND =        1 << 18, // FEAT_RNG
-  AEK_MTE =         1 << 19, // FEAT_MTE, FEAT_MTE2
-  AEK_SSBS =        1 << 20, // FEAT_SSBS, FEAT_SSBS2
-  AEK_SB =          1 << 21, // FEAT_SB
-  AEK_PREDRES =     1 << 22, // FEAT_SPECRES
-  AEK_SVE2 =        1 << 23, // FEAT_SVE2
-  AEK_SVE2AES =     1 << 24, // FEAT_SVE_AES, FEAT_SVE_PMULL128
-  AEK_SVE2SM4 =     1 << 25, // FEAT_SVE_SM4
-  AEK_SVE2SHA3 =    1 << 26, // FEAT_SVE_SHA3
-  AEK_SVE2BITPERM = 1 << 27, // FEAT_SVE_BitPerm
-  AEK_TME =         1 << 28, // FEAT_TME
-  AEK_BF16 =        1 << 29, // FEAT_BF16
-  AEK_I8MM =        1 << 30, // FEAT_I8MM
-  AEK_F32MM =       1ULL << 31, // FEAT_F32MM
-  AEK_F64MM =       1ULL << 32, // FEAT_F64MM
-  AEK_LS64 =        1ULL << 33, // FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA
-  AEK_BRBE =        1ULL << 34, // FEAT_BRBE
-  AEK_PAUTH =       1ULL << 35, // FEAT_PAuth
-  AEK_FLAGM =       1ULL << 36, // FEAT_FlagM
-  AEK_SME =         1ULL << 37, // FEAT_SME
-  AEK_SMEF64F64 =   1ULL << 38, // FEAT_SME_F64F64
-  AEK_SMEI16I64 =   1ULL << 39, // FEAT_SME_I16I64
-  AEK_HBC =         1ULL << 40, // FEAT_HBC
-  AEK_MOPS =        1ULL << 41, // FEAT_MOPS
-  AEK_PERFMON =     1ULL << 42, // FEAT_PMUv3
-  AEK_SME2 =        1ULL << 43, // FEAT_SME2
-  AEK_SVE2p1 =      1ULL << 44, // FEAT_SVE2p1
-  AEK_SME2p1 =      1ULL << 45, // FEAT_SME2p1
-  AEK_B16B16 =      1ULL << 46, // FEAT_B16B16
-  AEK_SMEF16F16 =   1ULL << 47, // FEAT_SMEF16F16
-  AEK_CSSC =        1ULL << 48, // FEAT_CSSC
-  AEK_RCPC3 =       1ULL << 49, // FEAT_LRCPC3
-  AEK_THE =         1ULL << 50, // FEAT_THE
-  AEK_D128 =        1ULL << 51, // FEAT_D128
-  AEK_LSE128 =      1ULL << 52, // FEAT_LSE128
-  AEK_SPECRES2 =    1ULL << 53, // FEAT_SPECRES2
-  AEK_RASv2 =       1ULL << 54, // FEAT_RASv2
-  AEK_ITE =         1ULL << 55, // FEAT_ITE
-  AEK_GCS =         1ULL << 56, // FEAT_GCS
+enum ArchExtKind : int {
+  AEK_NONE =          1,
+  AEK_CRC =           2,  // FEAT_CRC32
+  AEK_CRYPTO =        3,
+  AEK_FP =            4,  // FEAT_FP
+  AEK_SIMD =          5,  // FEAT_AdvSIMD
+  AEK_FP16 =          6,  // FEAT_FP16
+  AEK_PROFILE =       7,  // FEAT_SPE
+  AEK_RAS =           8,  // FEAT_RAS, FEAT_RASv1p1
+  AEK_LSE =           9,  // FEAT_LSE
+  AEK_SVE =           10,  // FEAT_SVE
+  AEK_DOTPROD =       11, // FEAT_DotProd
+  AEK_RCPC =          12, // FEAT_LRCPC
+  AEK_RDM =           13, // FEAT_RDM
+  AEK_SM4 =           14, // FEAT_SM4, FEAT_SM3
+  AEK_SHA3 =          15, // FEAT_SHA3, FEAT_SHA512
+  AEK_SHA2 =          16, // FEAT_SHA1, FEAT_SHA256
+  AEK_AES =           17, // FEAT_AES, FEAT_PMULL
+  AEK_FP16FML =       18, // FEAT_FHM
+  AEK_RAND =          19, // FEAT_RNG
+  AEK_MTE =           20, // FEAT_MTE, FEAT_MTE2
+  AEK_SSBS =          21, // FEAT_SSBS, FEAT_SSBS2
+  AEK_SB =            22, // FEAT_SB
+  AEK_PREDRES =       23, // FEAT_SPECRES
+  AEK_SVE2 =          24, // FEAT_SVE2
+  AEK_SVE2AES =       25, // FEAT_SVE_AES, FEAT_SVE_PMULL128
+  AEK_SVE2SM4 =       26, // FEAT_SVE_SM4
+  AEK_SVE2SHA3 =      27, // FEAT_SVE_SHA3
+  AEK_SVE2BITPERM =   28, // FEAT_SVE_BitPerm
+  AEK_TME =           29, // FEAT_TME
+  AEK_BF16 =          30, // FEAT_BF16
+  AEK_I8MM =          31, // FEAT_I8MM
+  AEK_F32MM =         32, // FEAT_F32MM
+  AEK_F64MM =         33, // FEAT_F64MM
+  AEK_LS64 =          34, // FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA
+  AEK_BRBE =          35, // FEAT_BRBE
+  AEK_PAUTH =         36, // FEAT_PAuth
+  AEK_FLAGM =         37, // FEAT_FlagM
+  AEK_SME =           38, // FEAT_SME
+  AEK_SMEF64F64 =     39, // FEAT_SME_F64F64
+  AEK_SMEI16I64 =     40, // FEAT_SME_I16I64
+  AEK_HBC =           41, // FEAT_HBC
+  AEK_MOPS =          42, // FEAT_MOPS
+  AEK_PERFMON =       43, // FEAT_PMUv3
+  AEK_SME2 =          44, // FEAT_SME2
+  AEK_SVE2p1 =        45, // FEAT_SVE2p1
+  AEK_SME2p1 =        46, // FEAT_SME2p1
+  AEK_B16B16 =        47, // FEAT_B16B16
+  AEK_SMEF16F16 =     48, // FEAT_SMEF16F16
+  AEK_CSSC =          49, // FEAT_CSSC
+  AEK_RCPC3 =         50, // FEAT_LRCPC3
+  AEK_THE =           51, // FEAT_THE
+  AEK_D128 =          52, // FEAT_D128
+  AEK_LSE128 =        53, // FEAT_LSE128
+  AEK_SPECRES2 =      54, // FEAT_SPECRES2
+  AEK_RASv2 =         55, // FEAT_RASv2
+  AEK_ITE =           56, // FEAT_ITE
+  AEK_GCS =           57, // FEAT_GCS
+  AEK_EXTENTIONS_NUM =  58
 };
 // clang-format on
 
@@ -260,7 +262,7 @@ inline constexpr ExtensionInfo Extensions[] = {
     {"tme", AArch64::AEK_TME, "+tme", "-tme", FEAT_MAX, "", 0},
     {"wfxt", AArch64::AEK_NONE, {}, {}, FEAT_WFXT, "+wfxt", 550},
     {"gcs", AArch64::AEK_GCS, "+gcs", "-gcs", FEAT_MAX, "", 0},
-    // Special cases
+            // Special cases
     {"none", AArch64::AEK_NONE, {}, {}, FEAT_MAX, "", ExtensionInfo::MaxFMVPriority},
 };
 // clang-format on
@@ -273,7 +275,7 @@ struct ArchInfo {
   ArchProfile Profile;   // Architecuture profile
   StringRef Name;        // Human readable name, e.g. "armv8.1-a"
   StringRef ArchFeature; // Command line feature flag, e.g. +v8a
-  uint64_t DefaultExts;  // bitfield of default extensions ArchExtKind
+  BitVector DefaultExts;  // bitfield of default extensions ArchExtKind
 
   bool operator==(const ArchInfo &Other) const {
     return this->Name == Other.Name;
@@ -315,23 +317,23 @@ struct ArchInfo {
 };
 
 // clang-format off
-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)};
-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", (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)};
+inline ArchInfo ARMV8A    = { VersionTuple{8, 0}, AProfile, "armv8-a", "+v8a", (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD)), };
+inline ArchInfo ARMV8_1A  = { VersionTuple{8, 1}, AProfile, "armv8.1-a", "+v8.1a", (BitVector(ARMV8A.DefaultExts).set(AArch64::AEK_CRC).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM))};
+inline ArchInfo ARMV8_2A  = { VersionTuple{8, 2}, AProfile, "armv8.2-a", "+v8.2a", (BitVector(ARMV8_1A.DefaultExts).set(AArch64::AEK_RAS))};
+inline ArchInfo ARMV8_3A  = { VersionTuple{8, 3}, AProfile, "armv8.3-a", "+v8.3a", (BitVector(ARMV8_2A.DefaultExts).set(AArch64::AEK_RCPC))};
+inline ArchInfo ARMV8_4A  = { VersionTuple{8, 4}, AProfile, "armv8.4-a", "+v8.4a", (BitVector(ARMV8_3A.DefaultExts).set(AArch64::AEK_DOTPROD))};
+inline ArchInfo ARMV8_5A  = { VersionTuple{8, 5}, AProfile, "armv8.5-a", "+v8.5a", (BitVector(ARMV8_4A.DefaultExts))};
+inline ArchInfo ARMV8_6A  = { VersionTuple{8, 6}, AProfile, "armv8.6-a", "+v8.6a", (BitVector(ARMV8_5A.DefaultExts).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))};
+inline ArchInfo ARMV8_7A  = { VersionTuple{8, 7}, AProfile, "armv8.7-a", "+v8.7a", (BitVector(ARMV8_6A.DefaultExts))};
+inline ArchInfo ARMV8_8A  = { VersionTuple{8, 8}, AProfile, "armv8.8-a", "+v8.8a", (BitVector(ARMV8_7A.DefaultExts).set(AArch64::AEK_MOPS).set(AArch64::AEK_HBC))};
+inline ArchInfo ARMV8_9A  = { VersionTuple{8, 9}, AProfile, "armv8.9-a", "+v8.9a", (BitVector(ARMV8_8A.DefaultExts).set(AArch64::AEK_SPECRES2).set(AArch64::AEK_CSSC).set(AArch64::AEK_RASv2))};
+inline ArchInfo ARMV9A    = { VersionTuple{9, 0}, AProfile, "armv9-a", "+v9a", (BitVector(ARMV8_5A.DefaultExts).set(AArch64::AEK_FP16).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2))};
+inline ArchInfo ARMV9_1A  = { VersionTuple{9, 1}, AProfile, "armv9.1-a", "+v9.1a", (BitVector(ARMV9A.DefaultExts).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))};
+inline ArchInfo ARMV9_2A  = { VersionTuple{9, 2}, AProfile, "armv9.2-a", "+v9.2a", (BitVector(ARMV9_1A.DefaultExts))};
+inline ArchInfo ARMV9_3A  = { VersionTuple{9, 3}, AProfile, "armv9.3-a", "+v9.3a", (BitVector(ARMV9_2A.DefaultExts).set(AArch64::AEK_MOPS).set(AArch64::AEK_HBC))};
+inline ArchInfo ARMV9_4A  = { VersionTuple{9, 4}, AProfile, "armv9.4-a", "+v9.4a", (BitVector(ARMV9_3A.DefaultExts).set(AArch64::AEK_SPECRES2).set(AArch64::AEK_CSSC).set(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", ((ARMV8_5A.DefaultExts ^ AArch64::AEK_LSE) | AArch64::AEK_SSBS | AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SB), };
+inline ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", (BitVector(ARMV8_5A.DefaultExts).flip(AArch64::AEK_LSE).set(AArch64::AEK_SSBS).set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SB)), };
 // clang-format on
 
 // The set of all architectures
@@ -345,203 +347,205 @@ static constexpr std::array<const ArchInfo *, 16> ArchInfos = {
 struct CpuInfo {
   StringRef Name; // Name, as written for -mcpu.
   const ArchInfo &Arch;
-  uint64_t DefaultExtensions; // Default extensions for this CPU. These will be
+  BitVector DefaultExtensions; // Default extensions for this CPU. These will be
                               // ORd with the architecture defaults.
 
-  uint64_t getImpliedExtensions() const {
-    return DefaultExtensions | Arch.DefaultExts;
+  BitVector getImpliedExtensions() const {
+    BitVector ImpliedExts(DefaultExtensions);
+    ImpliedExts |= Arch.DefaultExts;
+    return ImpliedExts;
   }
 };
 
-inline constexpr CpuInfo CpuInfos[] = {
+inline CpuInfo CpuInfos[] = {
     {"cortex-a34", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"cortex-a35", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"cortex-a53", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"cortex-a55", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(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)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM).set(AArch64::AEK_SB).
+      set(AArch64::AEK_PAUTH).set(AArch64::AEK_MTE).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+      set(AArch64::AEK_FP16FML))},
     {"cortex-a57", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"cortex-a65", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16 | AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
     {"cortex-a65ae", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16 | AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
     {"cortex-a72", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"cortex-a73", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"cortex-a75", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC))},
     {"cortex-a76", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
     {"cortex-a76ae", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
     {"cortex-a77", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_RCPC | AArch64::AEK_DOTPROD | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_SSBS))},
     {"cortex-a78", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-      AArch64::AEK_PROFILE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_PROFILE))},
     {"cortex-a78c", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-      AArch64::AEK_PROFILE | AArch64::AEK_FLAGM | AArch64::AEK_PAUTH |
-      AArch64::AEK_FP16FML)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_PROFILE).set(AArch64::AEK_FLAGM).set(AArch64::AEK_PAUTH).
+      set(AArch64::AEK_FP16FML))},
     {"cortex-a710", ARMV9A,
-     (AArch64::AEK_MTE | AArch64::AEK_PAUTH | AArch64::AEK_FLAGM |
-      AArch64::AEK_SB | AArch64::AEK_I8MM | AArch64::AEK_FP16FML |
-      AArch64::AEK_SVE | AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM |
-      AArch64::AEK_BF16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_FLAGM).
+      set(AArch64::AEK_SB).set(AArch64::AEK_I8MM).set(AArch64::AEK_FP16FML).
+      set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+      set(AArch64::AEK_BF16))},
     {"cortex-a715", ARMV9A,
-     (AArch64::AEK_SB | AArch64::AEK_SSBS | AArch64::AEK_MTE |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_PAUTH |
-      AArch64::AEK_I8MM | AArch64::AEK_PREDRES | AArch64::AEK_PERFMON |
-      AArch64::AEK_PROFILE | AArch64::AEK_SVE | AArch64::AEK_SVE2BITPERM |
-      AArch64::AEK_BF16 | AArch64::AEK_FLAGM)},
-    {"cortex-r82", ARMV8R, (AArch64::AEK_LSE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_SB).set(AArch64::AEK_SSBS).set(AArch64::AEK_MTE).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_PAUTH).
+      set(AArch64::AEK_I8MM).set(AArch64::AEK_PREDRES).set(AArch64::AEK_PERFMON).
+      set(AArch64::AEK_PROFILE).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2BITPERM).
+      set(AArch64::AEK_BF16).set(AArch64::AEK_FLAGM))},
+    {"cortex-r82", ARMV8R, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_LSE))},
     {"cortex-x1", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-      AArch64::AEK_PROFILE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_PROFILE))},
     {"cortex-x1c", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_DOTPROD | AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-      AArch64::AEK_PAUTH | AArch64::AEK_PROFILE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_PAUTH).set(AArch64::AEK_PROFILE))},
     {"cortex-x2", ARMV9A,
-     (AArch64::AEK_MTE | AArch64::AEK_BF16 | AArch64::AEK_I8MM |
-      AArch64::AEK_PAUTH | AArch64::AEK_SSBS | AArch64::AEK_SB |
-      AArch64::AEK_SVE | AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM |
-      AArch64::AEK_FP16FML)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_MTE).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM).
+      set(AArch64::AEK_PAUTH).set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).
+      set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+      set(AArch64::AEK_FP16FML))},
     {"cortex-x3", ARMV9A,
-     (AArch64::AEK_SVE | AArch64::AEK_PERFMON | AArch64::AEK_PROFILE |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM | AArch64::AEK_MTE |
-      AArch64::AEK_SVE2BITPERM | AArch64::AEK_SB | AArch64::AEK_PAUTH |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_PREDRES |
-      AArch64::AEK_FLAGM | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_SVE).set(AArch64::AEK_PERFMON).set(AArch64::AEK_PROFILE).
+      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM).set(AArch64::AEK_MTE).
+      set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SB).set(AArch64::AEK_PAUTH).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_PREDRES).
+      set(AArch64::AEK_FLAGM).set(AArch64::AEK_SSBS))},
     {"neoverse-e1", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16 | AArch64::AEK_RCPC | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
     {"neoverse-n1", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16 | AArch64::AEK_PROFILE | AArch64::AEK_RCPC |
-      AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_PROFILE).set(AArch64::AEK_RCPC).
+      set(AArch64::AEK_SSBS))},
     {"neoverse-n2", ARMV8_5A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_SM4 | 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)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_SM4).set(AArch64::AEK_BF16).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_I8MM).set(AArch64::AEK_MTE).
+      set(AArch64::AEK_SB).set(AArch64::AEK_SSBS).set(AArch64::AEK_SVE).
+      set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM))},
     {"neoverse-512tvb", ARMV8_4A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_SM4 | 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)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_SM4).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).set(AArch64::AEK_FP16FML).
+      set(AArch64::AEK_I8MM))},
     {"neoverse-v1", ARMV8_4A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_SM4 | 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)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_SM4).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).set(AArch64::AEK_FP16FML).
+      set(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)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).set(AArch64::AEK_RAND).
+      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_PROFILE).set(AArch64::AEK_SVE2BITPERM).
+      set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM).set(AArch64::AEK_MTE))},
     {"cyclone", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_NONE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
     {"apple-a7", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_NONE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
     {"apple-a8", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_NONE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
     {"apple-a9", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_NONE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
     {"apple-a10", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC |
-      AArch64::AEK_RDM)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC).
+      set(AArch64::AEK_RDM))},
     {"apple-a11", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
     {"apple-a12", ARMV8_3A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
     {"apple-a13", ARMV8_4A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3))},
     {"apple-a14", ARMV8_5A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3))},
     {"apple-a15", ARMV8_5A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))},
     {"apple-a16", ARMV8_5A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))},
     {"apple-m1", ARMV8_5A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3))},
     {"apple-m2", ARMV8_5A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-      AArch64::AEK_BF16 | AArch64::AEK_I8MM)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))},
     {"apple-s4", ARMV8_3A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
     {"apple-s5", ARMV8_3A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
     {"exynos-m3", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"exynos-m4", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16))},
     {"exynos-m5", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16))},
     {"falkor", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC |
-      AArch64::AEK_RDM)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC).
+      set(AArch64::AEK_RDM))},
     {"saphira", ARMV8_3A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_PROFILE)},
-    {"kryo", ARMV8A, (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
-    {"thunderx2t99", ARMV8_1A, (AArch64::AEK_AES | AArch64::AEK_SHA2)},
-    {"thunderx3t110", ARMV8_3A, (AArch64::AEK_AES | AArch64::AEK_SHA2)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_PROFILE))},
+    {"kryo", ARMV8A, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+    {"thunderx2t99", ARMV8_1A, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2))},
+    {"thunderx3t110", ARMV8_3A, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2))},
     {"thunderx", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"thunderxt88", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"thunderxt81", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"thunderxt83", ARMV8A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_CRC)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
     {"tsv110", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-      AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_PROFILE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_PROFILE))},
     {"a64fx", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16 |
-      AArch64::AEK_SVE)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
+      set(AArch64::AEK_SVE))},
     {"carmel", ARMV8_2A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_FP16)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
     {"ampere1", ARMV8_6A,
-     (AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-      AArch64::AEK_FP16 | AArch64::AEK_SB | AArch64::AEK_SSBS |
-      AArch64::AEK_RAND)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+      set(AArch64::AEK_FP16).set(AArch64::AEK_SB).set(AArch64::AEK_SSBS).
+      set(AArch64::AEK_RAND))},
     {"ampere1a", ARMV8_6A,
-     (AArch64::AEK_FP16 | AArch64::AEK_RAND | AArch64::AEK_SM4 |
-      AArch64::AEK_SHA3 | AArch64::AEK_SHA2 | AArch64::AEK_AES |
-      AArch64::AEK_MTE | AArch64::AEK_SB | AArch64::AEK_SSBS)},
+     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_FP16).set(AArch64::AEK_RAND).set(AArch64::AEK_SM4).
+      set(AArch64::AEK_SHA3).set(AArch64::AEK_SHA2).set(AArch64::AEK_AES).
+      set(AArch64::AEK_MTE).set(AArch64::AEK_SB).set(AArch64::AEK_SSBS))},
 };
 
 // An alias for a CPU.
@@ -552,7 +556,7 @@ struct CpuAlias {
 
 inline constexpr CpuAlias CpuAliases[] = {{"grace", "neoverse-v2"}};
 
-bool getExtensionFeatures(uint64_t Extensions,
+bool getExtensionFeatures(BitVector Extensions,
                           std::vector<StringRef> &Features);
 
 StringRef getArchExtFeature(StringRef ArchExt);
diff --git a/llvm/lib/TargetParser/AArch64TargetParser.cpp b/llvm/lib/TargetParser/AArch64TargetParser.cpp
index 3a1f549b2803408..be78153aa3a55b9 100644
--- a/llvm/lib/TargetParser/AArch64TargetParser.cpp
+++ b/llvm/lib/TargetParser/AArch64TargetParser.cpp
@@ -54,11 +54,11 @@ uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs) {
   return FeaturesMask;
 }
 
-bool AArch64::getExtensionFeatures(uint64_t InputExts,
+bool AArch64::getExtensionFeatures(BitVector InputExts,
                                    std::vector<StringRef> &Features) {
   for (const auto &E : Extensions)
     /* INVALID and NONE have no feature name. */
-    if ((InputExts & E.ID) && !E.Feature.empty())
+    if (InputExts.test(E.ID) && !E.Feature.empty())
       Features.push_back(E.Feature);
 
   return true;
diff --git a/llvm/unittests/TargetParser/AArch64TargetParserTest.cpp b/llvm/unittests/TargetParser/AArch64TargetParserTest.cpp
new file mode 100644
index 000000000000000..89c6295d91a84d4
--- /dev/null
+++ b/llvm/unittests/TargetParser/AArch64TargetParserTest.cpp
@@ -0,0 +1,965 @@
+//===----------- TargetParser.cpp - Target Parser -------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/TargetParser/TargetParser.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/FormatVariadic.h"
+#include "llvm/TargetParser/AArch64TargetParser.h"
+#include "llvm/TargetParser/ARMTargetParser.h"
+#include "llvm/TargetParser/ARMTargetParserCommon.h"
+#include "llvm/TargetParser/Triple.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include <optional>
+#include <string>
+
+using namespace llvm;
+
+namespace {
+const char *AArch64Arch[] = {
+    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
+    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
+    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
+    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
+    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
+    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
+    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
+    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
+    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
+    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
+    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
+    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
+    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
+    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
+    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
+    "armv9.4a",
+};
+
+std::string FormatExtensionFlags(BitVector Flags) {
+  std::vector<StringRef> Features;
+
+  // AEK_NONE is not meant to be shown to the user so the target parser
+  // does not recognise it. It is relevant here though.
+  if (Flags.test(AArch64::AEK_NONE))
+    Features.push_back("none");
+  AArch64::getExtensionFeatures(Flags, Features);
+
+  // The target parser also includes every extension you don't have.
+  // E.g. if AEK_CRC is not set then it adds "-crc". Not useful here.
+  Features.erase(std::remove_if(Features.begin(), Features.end(),
+                                [](StringRef extension) {
+                                  return extension.startswith("-");
+                                }),
+                 Features.end());
+
+  return llvm::join(Features, ", ");
+}
+
+std::string SerializeExtensionFlags(BitVector Flags) {
+  std::string SerializedFlags;
+
+  for(unsigned int i = 0; i < Flags.size(); i ++)
+    SerializedFlags += (int)Flags[i];
+  return SerializedFlags;
+}
+
+struct AssertSameExtensionFlags {
+  AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
+
+  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
+                                      BitVector ExpectedFlags,
+                                      BitVector GotFlags) {
+    if (ExpectedFlags == GotFlags)
+      return testing::AssertionSuccess();
+
+    return testing::AssertionFailure() << llvm::formatv(
+               "CPU: {4}\n"
+               "Expected extension flags: {0} ({1:x})\n"
+               "     Got extension flags: {2} ({3:x})\n",
+               FormatExtensionFlags(ExpectedFlags), SerializeExtensionFlags(ExpectedFlags),
+               FormatExtensionFlags(GotFlags), SerializeExtensionFlags(GotFlags), CPUName);
+  }
+
+private:
+  StringRef CPUName;
+};
+
+struct AArch64CPUTestParams {
+  AArch64CPUTestParams(StringRef CPUName, StringRef ExpectedArch,
+                   StringRef ExpectedFPU, BitVector ExpectedFlags,
+                   StringRef CPUAttr)
+      : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
+        ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
+
+  friend std::ostream &operator<<(std::ostream &os,
+                                  const AArch64CPUTestParams &params) {
+    return os << "\"" << params.CPUName.str() << "\", \""
+              << params.ExpectedArch.str() << "\", \""
+              << params.ExpectedFPU.str() << "\", 0x" << std::hex
+              << SerializeExtensionFlags(params.ExpectedFlags) << ", \"" << params.CPUAttr.str() << "\"";
+  }
+
+  StringRef CPUName;
+  StringRef ExpectedArch;
+  StringRef ExpectedFPU;
+  BitVector ExpectedFlags;
+  StringRef CPUAttr;
+};
+
+class CPUTestFixture
+    : public ::testing::TestWithParam<AArch64CPUTestParams> {};
+
+TEST_P(CPUTestFixture, testAArch64CPU) {
+  AArch64CPUTestParams params = GetParam();
+
+  const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
+  EXPECT_TRUE(Cpu);
+  EXPECT_EQ(params.ExpectedArch, Cpu->Arch.Name);
+
+  EXPECT_PRED_FORMAT2(
+      AssertSameExtensionFlags(params.CPUName),
+      params.ExpectedFlags, Cpu->getImpliedExtensions());
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    AArch64CPUTests, CPUTestFixture,
+    ::testing::Values(
+        AArch64CPUTestParams("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC)),
+                         "8.2-A"),
+        AArch64CPUTestParams(
+            "cortex-a510", "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_I8MM).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
+                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_PAUTH).
+                set(AArch64::AEK_MTE).set(AArch64::AEK_SSBS).set(AArch64::AEK_FP16).
+                set(AArch64::AEK_FP16FML).set(AArch64::AEK_SB)),
+            "9-A"),
+        AArch64CPUTestParams("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_PROFILE)),
+                         "8.2-A"),
+        AArch64CPUTestParams(
+            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_PROFILE).set(AArch64::AEK_FLAGM).
+                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FP16FML)),
+            "8.2-A"),
+        AArch64CPUTestParams(
+            "cortex-a710", "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_MTE).
+                set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SVE).
+                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SB).
+                set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16)),
+            "9-A"),
+        AArch64CPUTestParams(
+            "cortex-a715", "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
+                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_I8MM).
+                set(AArch64::AEK_PERFMON).set(AArch64::AEK_PREDRES).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16FML).
+                set(AArch64::AEK_FP16).set(AArch64::AEK_FLAGM)),
+            "9-A"),
+        AArch64CPUTestParams(
+            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
+                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
+            "8.4-A"),
+        AArch64CPUTestParams("neoverse-v2", "armv9-a", "neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).
+                             set(AArch64::AEK_SSBS).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_MTE).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
+                             set(AArch64::AEK_SVE2).set(AArch64::AEK_PROFILE).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM).
+                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_RAND)),
+                         "9-A"),
+        AArch64CPUTestParams("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SSBS).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_SB)),
+                         "8-R"),
+        AArch64CPUTestParams("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_PROFILE)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_PAUTH).set(AArch64::AEK_PROFILE)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-x2", "armv9-a", "neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).
+                             set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16).
+                             set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
+                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_SB).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML)),
+                         "9-A"),
+        AArch64CPUTestParams(
+            "cortex-x3",
+            "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
+                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SB).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_PERFMON).
+                set(AArch64::AEK_I8MM).set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
+                set(AArch64::AEK_PREDRES).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SSBS)),
+            "9-A"),
+        AArch64CPUTestParams("cyclone", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP16)),
+                         "8.2-A"),
+        AArch64CPUTestParams("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
+                         "8.3-A"),
+        AArch64CPUTestParams("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
+                         "8.4-A"),
+        AArch64CPUTestParams("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
+                         "8.3-A"),
+        AArch64CPUTestParams("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
+                         "8.3-A"),
+        AArch64CPUTestParams("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
+                         "8.2-A"),
+        AArch64CPUTestParams("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
+                         "8.2-A"),
+        AArch64CPUTestParams("falkor", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RDM)),
+                         "8-A"),
+        AArch64CPUTestParams("kryo", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_PROFILE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams(
+            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).
+                set(AArch64::AEK_SHA3).set(AArch64::AEK_SM4).set(AArch64::AEK_FP).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).set(AArch64::AEK_RAS).
+                set(AArch64::AEK_LSE).set(AArch64::AEK_SVE).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).set(AArch64::AEK_MTE).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_SVE2).
+                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_I8MM)),
+            "8.5-A"),
+        AArch64CPUTestParams(
+            "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).set(AArch64::AEK_SHA2).
+                set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).set(AArch64::AEK_SSBS).
+                set(AArch64::AEK_SB).set(AArch64::AEK_RAND)),
+            "8.6-A"),
+        AArch64CPUTestParams(
+            "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_SM4).set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_SHA2).set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_RAND).
+                set(AArch64::AEK_MTE)),
+            "8.6-A"),
+        AArch64CPUTestParams(
+            "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
+                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
+            "8.4-A"),
+        AArch64CPUTestParams("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8.1-A"),
+        AArch64CPUTestParams("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC)),
+                         "8.3-A"),
+        AArch64CPUTestParams("thunderx", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_DOTPROD)),
+                         "8.2-A"),
+        AArch64CPUTestParams("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_SVE).set(AArch64::AEK_RDM)),
+                         "8.2-A"),
+        AArch64CPUTestParams("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RDM)),
+                         "8.2-A")));
+
+// Note: number of CPUs includes aliases.
+static constexpr unsigned NumAArch64CPUArchs = 62;
+
+TEST(TargetParserTest, testAArch64CPUArchList) {
+  SmallVector<StringRef, NumAArch64CPUArchs> List;
+  AArch64::fillValidCPUArchList(List);
+
+  // No list exists for these in this test suite, so ensure all are
+  // valid, and match the expected 'magic' count.
+  EXPECT_EQ(List.size(), NumAArch64CPUArchs);
+  for(StringRef CPU : List) {
+    EXPECT_TRUE(AArch64::parseCpu(CPU));
+  }
+}
+
+bool testAArch64Arch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
+                     unsigned ArchAttr) {
+  const std::optional<AArch64::ArchInfo> AI = AArch64::parseArch(Arch);
+  return AI.has_value();
+}
+
+TEST(TargetParserTest, testAArch64Arch) {
+  EXPECT_TRUE(testAArch64Arch("armv8-a", "cortex-a53", "v8a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.1-a", "generic", "v8.1a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.2-a", "generic", "v8.2a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.3-a", "generic", "v8.3a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.4-a", "generic", "v8.4a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.5-a", "generic", "v8.5a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.6-a", "generic", "v8.6a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.7-a", "generic", "v8.7a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.8-a", "generic", "v8.8a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.9-a", "generic", "v8.9a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9-a", "generic", "v9a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.1-a", "generic", "v9.1a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.2-a", "generic", "v9.2a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.3-a", "generic", "v9.3a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.4-a", "generic", "v9.4a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+}
+
+bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {
+  std::optional<AArch64::ExtensionInfo> Extension =
+      AArch64::parseArchExtension(ArchExt);
+  if (!Extension)
+    return false;
+  std::optional<AArch64::CpuInfo> CpuInfo = AArch64::parseCpu(CPUName);
+  return CpuInfo->getImpliedExtensions().test(Extension->ID);
+}
+
+bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {
+  std::optional<AArch64::ExtensionInfo> Extension =
+      AArch64::parseArchExtension(ArchExt);
+  if (!Extension)
+    return false;
+  return AI.DefaultExts.test(Extension->ID);
+}
+
+TEST(TargetParserTest, testAArch64Extension) {
+  EXPECT_FALSE(testAArch64Extension("cortex-a34", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a35", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a53", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a55", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "dotprod"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a57", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a72", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a73", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a75", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "lse"));
+  EXPECT_FALSE(testAArch64Extension("cyclone", "ras"));
+  EXPECT_FALSE(testAArch64Extension("exynos-m3", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "lse"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "lse"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("falkor", "rdm"));
+  EXPECT_FALSE(testAArch64Extension("kryo", "ras"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "crc"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "lse"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "ras"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "rcpc"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "profile"));
+  EXPECT_FALSE(testAArch64Extension("saphira", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("thunderx2t99", "ras"));
+  EXPECT_FALSE(testAArch64Extension("thunderx", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt81", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt83", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt88", "lse"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "aes"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "sha2"));
+  EXPECT_FALSE(testAArch64Extension("tsv110", "sha3"));
+  EXPECT_FALSE(testAArch64Extension("tsv110", "sm4"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "ras"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "profile"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("a64fx", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("a64fx", "sve"));
+  EXPECT_FALSE(testAArch64Extension("a64fx", "sve2"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "aes"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "sha2"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "fp16"));
+
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8A, "ras"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_1A, "ras"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "profile"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16fml"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16fml"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16fml"));
+}
+
+TEST(TargetParserTest, AArch64ExtensionFeatures) {
+  std::vector<uint64_t> Extensions = {
+      AArch64::AEK_CRC,           AArch64::AEK_LSE,           AArch64::AEK_RDM,
+      AArch64::AEK_CRYPTO,        AArch64::AEK_SM4,           AArch64::AEK_SHA3,
+      AArch64::AEK_SHA2,          AArch64::AEK_AES,           AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP,            AArch64::AEK_SIMD,          AArch64::AEK_FP16,
+      AArch64::AEK_FP16FML,       AArch64::AEK_PROFILE,       AArch64::AEK_RAS,
+      AArch64::AEK_SVE,           AArch64::AEK_SVE2,          AArch64::AEK_SVE2AES,
+      AArch64::AEK_SVE2SM4,       AArch64::AEK_SVE2SHA3,      AArch64::AEK_SVE2BITPERM,
+      AArch64::AEK_RCPC,          AArch64::AEK_RAND,          AArch64::AEK_MTE,
+      AArch64::AEK_SSBS,          AArch64::AEK_SB,            AArch64::AEK_PREDRES,
+      AArch64::AEK_BF16,          AArch64::AEK_I8MM,          AArch64::AEK_F32MM,
+      AArch64::AEK_F64MM,         AArch64::AEK_TME,           AArch64::AEK_LS64,
+      AArch64::AEK_BRBE,          AArch64::AEK_PAUTH,         AArch64::AEK_FLAGM,
+      AArch64::AEK_SME,           AArch64::AEK_SMEF64F64,     AArch64::AEK_SMEI16I64,
+      AArch64::AEK_SME2,          AArch64::AEK_HBC,           AArch64::AEK_MOPS,
+      AArch64::AEK_PERFMON,       AArch64::AEK_SVE2p1,        AArch64::AEK_SME2p1,
+      AArch64::AEK_B16B16,        AArch64::AEK_SMEF16F16,     AArch64::AEK_CSSC,
+      AArch64::AEK_RCPC3,         AArch64::AEK_THE,           AArch64::AEK_D128,
+      AArch64::AEK_LSE128,        AArch64::AEK_SPECRES2,      AArch64::AEK_RASv2,
+      AArch64::AEK_ITE,           AArch64::AEK_GCS,
+  };
+
+  std::vector<StringRef> Features;
+
+  BitVector ExtVal(AArch64::AEK_EXTENTIONS_NUM);
+  for (auto Ext : Extensions)
+    ExtVal.set(Ext);
+
+  // NONE has no feature names.
+  // We return True here because NONE is a valid choice.
+  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE), Features));
+  EXPECT_TRUE(!Features.size());
+
+  AArch64::getExtensionFeatures(ExtVal, Features);
+  EXPECT_EQ(Extensions.size(), Features.size());
+
+  EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2p1"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+b16b16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f64mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+tme"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ls64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+brbe"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+hbc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mops"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+perfmon"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+cssc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+the"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+gcs"));
+
+  // Assuming we listed every extension above, this should produce the same
+  // result. (note that AEK_NONE doesn't have a name so it won't be in the
+  // result despite its bit being set)
+  std::vector<StringRef> AllFeatures;
+  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM, true), AllFeatures));
+  EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
+}
+
+TEST(TargetParserTest, AArch64ArchFeatures) {
+  EXPECT_EQ(AArch64::ARMV8A.ArchFeature, "+v8a");
+  EXPECT_EQ(AArch64::ARMV8_1A.ArchFeature, "+v8.1a");
+  EXPECT_EQ(AArch64::ARMV8_2A.ArchFeature, "+v8.2a");
+  EXPECT_EQ(AArch64::ARMV8_3A.ArchFeature, "+v8.3a");
+  EXPECT_EQ(AArch64::ARMV8_4A.ArchFeature, "+v8.4a");
+  EXPECT_EQ(AArch64::ARMV8_5A.ArchFeature, "+v8.5a");
+  EXPECT_EQ(AArch64::ARMV8_6A.ArchFeature, "+v8.6a");
+  EXPECT_EQ(AArch64::ARMV8_7A.ArchFeature, "+v8.7a");
+  EXPECT_EQ(AArch64::ARMV8_8A.ArchFeature, "+v8.8a");
+  EXPECT_EQ(AArch64::ARMV8_9A.ArchFeature, "+v8.9a");
+  EXPECT_EQ(AArch64::ARMV9A.ArchFeature, "+v9a");
+  EXPECT_EQ(AArch64::ARMV9_1A.ArchFeature, "+v9.1a");
+  EXPECT_EQ(AArch64::ARMV9_2A.ArchFeature, "+v9.2a");
+  EXPECT_EQ(AArch64::ARMV9_3A.ArchFeature, "+v9.3a");
+  EXPECT_EQ(AArch64::ARMV9_4A.ArchFeature, "+v9.4a");
+  EXPECT_EQ(AArch64::ARMV8R.ArchFeature, "+v8r");
+}
+
+TEST(TargetParserTest, AArch64ArchPartialOrder) {
+  for (const auto *A : AArch64::ArchInfos) {
+    EXPECT_EQ(*A, *A);
+
+    // v8r has no relation to other valid architectures
+    if (*A != AArch64::ARMV8R) {
+      EXPECT_FALSE(A->implies(AArch64::ARMV8R));
+      EXPECT_FALSE(AArch64::ARMV8R.implies(*A));
+    }
+  }
+
+  for (const auto *A : {
+           &AArch64::ARMV8_1A,
+           &AArch64::ARMV8_2A,
+           &AArch64::ARMV8_3A,
+           &AArch64::ARMV8_4A,
+           &AArch64::ARMV8_5A,
+           &AArch64::ARMV8_6A,
+           &AArch64::ARMV8_7A,
+           &AArch64::ARMV8_8A,
+           &AArch64::ARMV8_9A,
+       })
+    EXPECT_TRUE(A->implies(AArch64::ARMV8A));
+
+  for (const auto *A : {&AArch64::ARMV9_1A, &AArch64::ARMV9_2A,
+                        &AArch64::ARMV9_3A, &AArch64::ARMV9_4A})
+    EXPECT_TRUE(A->implies(AArch64::ARMV9A));
+
+  EXPECT_TRUE(AArch64::ARMV8_1A.implies(AArch64::ARMV8A));
+  EXPECT_TRUE(AArch64::ARMV8_2A.implies(AArch64::ARMV8_1A));
+  EXPECT_TRUE(AArch64::ARMV8_3A.implies(AArch64::ARMV8_2A));
+  EXPECT_TRUE(AArch64::ARMV8_4A.implies(AArch64::ARMV8_3A));
+  EXPECT_TRUE(AArch64::ARMV8_5A.implies(AArch64::ARMV8_4A));
+  EXPECT_TRUE(AArch64::ARMV8_6A.implies(AArch64::ARMV8_5A));
+  EXPECT_TRUE(AArch64::ARMV8_7A.implies(AArch64::ARMV8_6A));
+  EXPECT_TRUE(AArch64::ARMV8_8A.implies(AArch64::ARMV8_7A));
+  EXPECT_TRUE(AArch64::ARMV8_9A.implies(AArch64::ARMV8_8A));
+
+  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV9A));
+  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV9_1A));
+  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV9_2A));
+  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV9_3A));
+
+  EXPECT_TRUE(AArch64::ARMV9A.implies(AArch64::ARMV8_5A));
+  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV8_6A));
+  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV8_7A));
+  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV8_8A));
+  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV8_9A));
+}
+
+TEST(TargetParserTest, AArch64ArchExtFeature) {
+  const char *ArchExt[][4] = {
+      {"crc", "nocrc", "+crc", "-crc"},
+      {"crypto", "nocrypto", "+crypto", "-crypto"},
+      {"flagm", "noflagm", "+flagm", "-flagm"},
+      {"fp", "nofp", "+fp-armv8", "-fp-armv8"},
+      {"simd", "nosimd", "+neon", "-neon"},
+      {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
+      {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
+      {"profile", "noprofile", "+spe", "-spe"},
+      {"ras", "noras", "+ras", "-ras"},
+      {"lse", "nolse", "+lse", "-lse"},
+      {"rdm", "nordm", "+rdm", "-rdm"},
+      {"sve", "nosve", "+sve", "-sve"},
+      {"sve2", "nosve2", "+sve2", "-sve2"},
+      {"sve2-aes", "nosve2-aes", "+sve2-aes", "-sve2-aes"},
+      {"sve2-sm4", "nosve2-sm4", "+sve2-sm4", "-sve2-sm4"},
+      {"sve2-sha3", "nosve2-sha3", "+sve2-sha3", "-sve2-sha3"},
+      {"sve2p1", "nosve2p1", "+sve2p1", "-sve2p1"},
+      {"b16b16", "nob16b16", "+b16b16", "-b16b16"},
+      {"sve2-bitperm", "nosve2-bitperm", "+sve2-bitperm", "-sve2-bitperm"},
+      {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
+      {"rcpc", "norcpc", "+rcpc", "-rcpc"},
+      {"rng", "norng", "+rand", "-rand"},
+      {"memtag", "nomemtag", "+mte", "-mte"},
+      {"tme", "notme", "+tme", "-tme"},
+      {"pauth", "nopauth", "+pauth", "-pauth"},
+      {"ssbs", "nossbs", "+ssbs", "-ssbs"},
+      {"sb", "nosb", "+sb", "-sb"},
+      {"predres", "nopredres", "+predres", "-predres"},
+      {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
+      {"f32mm", "nof32mm", "+f32mm", "-f32mm"},
+      {"f64mm", "nof64mm", "+f64mm", "-f64mm"},
+      {"sme", "nosme", "+sme", "-sme"},
+      {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"},
+      {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"},
+      {"sme-f16f16", "nosme-f16f16", "+sme-f16f16", "-sme-f16f16"},
+      {"sme2", "nosme2", "+sme2", "-sme2"},
+      {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"},
+      {"hbc", "nohbc", "+hbc", "-hbc"},
+      {"mops", "nomops", "+mops", "-mops"},
+      {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},
+      {"predres2", "nopredres2", "+specres2", "-specres2"},
+      {"rasv2", "norasv2", "+rasv2", "-rasv2"},
+      {"gcs", "nogcs", "+gcs", "-gcs"},
+  };
+
+  for (unsigned i = 0; i < std::size(ArchExt); i++) {
+    EXPECT_EQ(StringRef(ArchExt[i][2]),
+              AArch64::getArchExtFeature(ArchExt[i][0]));
+    EXPECT_EQ(StringRef(ArchExt[i][3]),
+              AArch64::getArchExtFeature(ArchExt[i][1]));
+  }
+}
+
+} // namespace
diff --git a/llvm/unittests/TargetParser/ArmTargetParserTest.cpp b/llvm/unittests/TargetParser/ArmTargetParserTest.cpp
new file mode 100644
index 000000000000000..52611022cd7ffb6
--- /dev/null
+++ b/llvm/unittests/TargetParser/ArmTargetParserTest.cpp
@@ -0,0 +1,965 @@
+//===----------- TargetParser.cpp - Target Parser -------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/TargetParser/TargetParser.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/FormatVariadic.h"
+#include "llvm/TargetParser/AArch64TargetParser.h"
+#include "llvm/TargetParser/ARMTargetParser.h"
+#include "llvm/TargetParser/ARMTargetParserCommon.h"
+#include "llvm/TargetParser/Triple.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include <optional>
+#include <string>
+
+using namespace llvm;
+
+namespace {
+const char *AArch64Arch[] = {
+    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
+    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
+    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
+    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
+    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
+    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
+    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
+    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
+    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
+    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
+    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
+    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
+    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
+    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
+    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
+    "armv9.4a",
+};
+
+std::string FormatExtensionFlags(BitVector Flags) {
+  std::vector<StringRef> Features;
+
+  // AEK_NONE is not meant to be shown to the user so the target parser
+  // does not recognise it. It is relevant here though.
+  if (Flags.test(AArch64::AEK_NONE))
+    Features.push_back("none");
+  AArch64::getExtensionFeatures(Flags, Features);
+
+  // The target parser also includes every extension you don't have.
+  // E.g. if AEK_CRC is not set then it adds "-crc". Not useful here.
+  Features.erase(std::remove_if(Features.begin(), Features.end(),
+                                [](StringRef extension) {
+                                  return extension.startswith("-");
+                                }),
+                 Features.end());
+
+  return llvm::join(Features, ", ");
+}
+
+std::string SerializeExtensionFlags(BitVector Flags) {
+  std::string SerializedFlags;
+
+  for(int i = 0; i < Flags.size(); i ++)
+    SerializedFlags += (int)Flags[i];
+  return SerializedFlags;
+}
+
+struct AssertSameExtensionFlags {
+  AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
+
+  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
+                                      BitVector ExpectedFlags,
+                                      BitVector GotFlags) {
+    if (ExpectedFlags == GotFlags)
+      return testing::AssertionSuccess();
+
+    return testing::AssertionFailure() << llvm::formatv(
+               "CPU: {4}\n"
+               "Expected extension flags: {0} ({1:x})\n"
+               "     Got extension flags: {2} ({3:x})\n",
+               FormatExtensionFlags(ExpectedFlags), SerializeExtensionFlags(ExpectedFlags),
+               FormatExtensionFlags(GotFlags), SerializeExtensionFlags(GotFlags), CPUName);
+  }
+
+private:
+  StringRef CPUName;
+};
+
+struct AArch64CPUTestParams {
+  AArch64CPUTestParams(StringRef CPUName, StringRef ExpectedArch,
+                   StringRef ExpectedFPU, BitVector ExpectedFlags,
+                   StringRef CPUAttr)
+      : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
+        ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
+
+  friend std::ostream &operator<<(std::ostream &os,
+                                  const AArch64CPUTestParams &params) {
+    return os << "\"" << params.CPUName.str() << "\", \""
+              << params.ExpectedArch.str() << "\", \""
+              << params.ExpectedFPU.str() << "\", 0x" << std::hex
+              << SerializeExtensionFlags(params.ExpectedFlags) << ", \"" << params.CPUAttr.str() << "\"";
+  }
+
+  StringRef CPUName;
+  StringRef ExpectedArch;
+  StringRef ExpectedFPU;
+  BitVector ExpectedFlags;
+  StringRef CPUAttr;
+};
+
+class AArch64CPUTestFixture
+    : public ::testing::TestWithParam<AArch64CPUTestParams> {};
+
+TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
+  AArch64CPUTestParams params = GetParam();
+
+  const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
+  EXPECT_TRUE(Cpu);
+  EXPECT_EQ(params.ExpectedArch, Cpu->Arch.Name);
+
+  EXPECT_PRED_FORMAT2(
+      AssertSameExtensionFlags(params.CPUName),
+      params.ExpectedFlags, Cpu->getImpliedExtensions());
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    AArch64CPUTests, AArch64CPUTestFixture,
+    ::testing::Values(
+        AArch64CPUTestParams("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC)),
+                         "8.2-A"),
+        AArch64CPUTestParams(
+            "cortex-a510", "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_I8MM).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
+                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_PAUTH).
+                set(AArch64::AEK_MTE).set(AArch64::AEK_SSBS).set(AArch64::AEK_FP16).
+                set(AArch64::AEK_FP16FML).set(AArch64::AEK_SB)),
+            "9-A"),
+        AArch64CPUTestParams("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_PROFILE)),
+                         "8.2-A"),
+        AArch64CPUTestParams(
+            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_PROFILE).set(AArch64::AEK_FLAGM).
+                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FP16FML)),
+            "8.2-A"),
+        AArch64CPUTestParams(
+            "cortex-a710", "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_MTE).
+                set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SVE).
+                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SB).
+                set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16)),
+            "9-A"),
+        AArch64CPUTestParams(
+            "cortex-a715", "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
+                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_I8MM).
+                set(AArch64::AEK_PERFMON).set(AArch64::AEK_PREDRES).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16FML).
+                set(AArch64::AEK_FP16).set(AArch64::AEK_FLAGM)),
+            "9-A"),
+        AArch64CPUTestParams(
+            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
+                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
+            "8.4-A"),
+        AArch64CPUTestParams("neoverse-v2", "armv9-a", "neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).
+                             set(AArch64::AEK_SSBS).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_MTE).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
+                             set(AArch64::AEK_SVE2).set(AArch64::AEK_PROFILE).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM).
+                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_RAND)),
+                         "9-A"),
+        AArch64CPUTestParams("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SSBS).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_SB)),
+                         "8-R"),
+        AArch64CPUTestParams("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_PROFILE)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_PAUTH).set(AArch64::AEK_PROFILE)),
+                         "8.2-A"),
+        AArch64CPUTestParams("cortex-x2", "armv9-a", "neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).
+                             set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16).
+                             set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
+                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SSBS).
+                             set(AArch64::AEK_SB).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML)),
+                         "9-A"),
+        AArch64CPUTestParams(
+            "cortex-x3",
+            "armv9-a", "neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
+                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SB).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_PERFMON).
+                set(AArch64::AEK_I8MM).set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
+                set(AArch64::AEK_PREDRES).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SSBS)),
+            "9-A"),
+        AArch64CPUTestParams("cyclone", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP16)),
+                         "8.2-A"),
+        AArch64CPUTestParams("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
+                         "8.3-A"),
+        AArch64CPUTestParams("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
+                         "8.4-A"),
+        AArch64CPUTestParams("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
+                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
+                         "8.5-A"),
+        AArch64CPUTestParams("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
+                         "8.3-A"),
+        AArch64CPUTestParams("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
+                         "8.3-A"),
+        AArch64CPUTestParams("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
+                         "8.2-A"),
+        AArch64CPUTestParams("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
+                         "8.2-A"),
+        AArch64CPUTestParams("falkor", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RDM)),
+                         "8-A"),
+        AArch64CPUTestParams("kryo", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8-A"),
+        AArch64CPUTestParams("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
+                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_PROFILE).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_SSBS)),
+                         "8.2-A"),
+        AArch64CPUTestParams(
+            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).
+                set(AArch64::AEK_SHA3).set(AArch64::AEK_SM4).set(AArch64::AEK_FP).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).set(AArch64::AEK_RAS).
+                set(AArch64::AEK_LSE).set(AArch64::AEK_SVE).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).set(AArch64::AEK_MTE).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_SVE2).
+                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_I8MM)),
+            "8.5-A"),
+        AArch64CPUTestParams(
+            "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).set(AArch64::AEK_SHA2).
+                set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).set(AArch64::AEK_SSBS).
+                set(AArch64::AEK_SB).set(AArch64::AEK_RAND)),
+            "8.6-A"),
+        AArch64CPUTestParams(
+            "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_SM4).set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_SHA2).set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).
+                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_RAND).
+                set(AArch64::AEK_MTE)),
+            "8.6-A"),
+        AArch64CPUTestParams(
+            "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
+            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
+                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
+                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
+                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
+                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
+                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
+                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
+            "8.4-A"),
+        AArch64CPUTestParams("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD)),
+                         "8.1-A"),
+        AArch64CPUTestParams("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_RCPC)),
+                         "8.3-A"),
+        AArch64CPUTestParams("thunderx", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
+                             set(AArch64::AEK_FP)),
+                         "8-A"),
+        AArch64CPUTestParams("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
+                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
+                             set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_DOTPROD)),
+                         "8.2-A"),
+        AArch64CPUTestParams("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_SVE).set(AArch64::AEK_RDM)),
+                         "8.2-A"),
+        AArch64CPUTestParams("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
+                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
+                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
+                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
+                             set(AArch64::AEK_RDM)),
+                         "8.2-A")));
+
+// Note: number of CPUs includes aliases.
+static constexpr unsigned NumAArch64CPUArchs = 62;
+
+TEST(TargetParserTest, testAArch64CPUArchList) {
+  SmallVector<StringRef, NumAArch64CPUArchs> List;
+  AArch64::fillValidCPUArchList(List);
+
+  // No list exists for these in this test suite, so ensure all are
+  // valid, and match the expected 'magic' count.
+  EXPECT_EQ(List.size(), NumAArch64CPUArchs);
+  for(StringRef CPU : List) {
+    EXPECT_TRUE(AArch64::parseCpu(CPU));
+  }
+}
+
+bool testAArch64Arch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
+                     unsigned ArchAttr) {
+  const std::optional<AArch64::ArchInfo> AI = AArch64::parseArch(Arch);
+  return AI.has_value();
+}
+
+TEST(TargetParserTest, testAArch64Arch) {
+  EXPECT_TRUE(testAArch64Arch("armv8-a", "cortex-a53", "v8a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.1-a", "generic", "v8.1a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.2-a", "generic", "v8.2a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.3-a", "generic", "v8.3a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.4-a", "generic", "v8.4a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.5-a", "generic", "v8.5a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.6-a", "generic", "v8.6a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.7-a", "generic", "v8.7a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.8-a", "generic", "v8.8a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.9-a", "generic", "v8.9a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9-a", "generic", "v9a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.1-a", "generic", "v9.1a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.2-a", "generic", "v9.2a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.3-a", "generic", "v9.3a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.4-a", "generic", "v9.4a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+}
+
+bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {
+  std::optional<AArch64::ExtensionInfo> Extension =
+      AArch64::parseArchExtension(ArchExt);
+  if (!Extension)
+    return false;
+  std::optional<AArch64::CpuInfo> CpuInfo = AArch64::parseCpu(CPUName);
+  return CpuInfo->getImpliedExtensions().test(Extension->ID);
+}
+
+bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {
+  std::optional<AArch64::ExtensionInfo> Extension =
+      AArch64::parseArchExtension(ArchExt);
+  if (!Extension)
+    return false;
+  return AI.DefaultExts.test(Extension->ID);
+}
+
+TEST(TargetParserTest, testAArch64Extension) {
+  EXPECT_FALSE(testAArch64Extension("cortex-a34", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a35", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a53", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a55", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "dotprod"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a57", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a72", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a73", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a75", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "lse"));
+  EXPECT_FALSE(testAArch64Extension("cyclone", "ras"));
+  EXPECT_FALSE(testAArch64Extension("exynos-m3", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "lse"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "lse"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("falkor", "rdm"));
+  EXPECT_FALSE(testAArch64Extension("kryo", "ras"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "crc"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "lse"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "ras"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "rcpc"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "profile"));
+  EXPECT_FALSE(testAArch64Extension("saphira", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("thunderx2t99", "ras"));
+  EXPECT_FALSE(testAArch64Extension("thunderx", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt81", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt83", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt88", "lse"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "aes"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "sha2"));
+  EXPECT_FALSE(testAArch64Extension("tsv110", "sha3"));
+  EXPECT_FALSE(testAArch64Extension("tsv110", "sm4"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "ras"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "profile"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("a64fx", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("a64fx", "sve"));
+  EXPECT_FALSE(testAArch64Extension("a64fx", "sve2"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "aes"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "sha2"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "fp16"));
+
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8A, "ras"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_1A, "ras"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "profile"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16fml"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16fml"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16fml"));
+}
+
+TEST(TargetParserTest, AArch64ExtensionFeatures) {
+  std::vector<uint64_t> Extensions = {
+      AArch64::AEK_CRC,           AArch64::AEK_LSE,           AArch64::AEK_RDM,
+      AArch64::AEK_CRYPTO,        AArch64::AEK_SM4,           AArch64::AEK_SHA3,
+      AArch64::AEK_SHA2,          AArch64::AEK_AES,           AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP,            AArch64::AEK_SIMD,          AArch64::AEK_FP16,
+      AArch64::AEK_FP16FML,       AArch64::AEK_PROFILE,       AArch64::AEK_RAS,
+      AArch64::AEK_SVE,           AArch64::AEK_SVE2,          AArch64::AEK_SVE2AES,
+      AArch64::AEK_SVE2SM4,       AArch64::AEK_SVE2SHA3,      AArch64::AEK_SVE2BITPERM,
+      AArch64::AEK_RCPC,          AArch64::AEK_RAND,          AArch64::AEK_MTE,
+      AArch64::AEK_SSBS,          AArch64::AEK_SB,            AArch64::AEK_PREDRES,
+      AArch64::AEK_BF16,          AArch64::AEK_I8MM,          AArch64::AEK_F32MM,
+      AArch64::AEK_F64MM,         AArch64::AEK_TME,           AArch64::AEK_LS64,
+      AArch64::AEK_BRBE,          AArch64::AEK_PAUTH,         AArch64::AEK_FLAGM,
+      AArch64::AEK_SME,           AArch64::AEK_SMEF64F64,     AArch64::AEK_SMEI16I64,
+      AArch64::AEK_SME2,          AArch64::AEK_HBC,           AArch64::AEK_MOPS,
+      AArch64::AEK_PERFMON,       AArch64::AEK_SVE2p1,        AArch64::AEK_SME2p1,
+      AArch64::AEK_B16B16,        AArch64::AEK_SMEF16F16,     AArch64::AEK_CSSC,
+      AArch64::AEK_RCPC3,         AArch64::AEK_THE,           AArch64::AEK_D128,
+      AArch64::AEK_LSE128,        AArch64::AEK_SPECRES2,      AArch64::AEK_RASv2,
+      AArch64::AEK_ITE,           AArch64::AEK_GCS,
+  };
+
+  std::vector<StringRef> Features;
+
+  BitVector ExtVal(AArch64::AEK_EXTENTIONS_NUM);
+  for (auto Ext : Extensions)
+    ExtVal.set(Ext);
+
+  // NONE has no feature names.
+  // We return True here because NONE is a valid choice.
+  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE), Features));
+  EXPECT_TRUE(!Features.size());
+
+  AArch64::getExtensionFeatures(ExtVal, Features);
+  EXPECT_EQ(Extensions.size(), Features.size());
+
+  EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2p1"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+b16b16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f64mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+tme"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ls64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+brbe"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+hbc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mops"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+perfmon"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+cssc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+the"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+gcs"));
+
+  // Assuming we listed every extension above, this should produce the same
+  // result. (note that AEK_NONE doesn't have a name so it won't be in the
+  // result despite its bit being set)
+  std::vector<StringRef> AllFeatures;
+  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM, true), AllFeatures));
+  EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
+}
+
+TEST(TargetParserTest, AArch64ArchFeatures) {
+  EXPECT_EQ(AArch64::ARMV8A.ArchFeature, "+v8a");
+  EXPECT_EQ(AArch64::ARMV8_1A.ArchFeature, "+v8.1a");
+  EXPECT_EQ(AArch64::ARMV8_2A.ArchFeature, "+v8.2a");
+  EXPECT_EQ(AArch64::ARMV8_3A.ArchFeature, "+v8.3a");
+  EXPECT_EQ(AArch64::ARMV8_4A.ArchFeature, "+v8.4a");
+  EXPECT_EQ(AArch64::ARMV8_5A.ArchFeature, "+v8.5a");
+  EXPECT_EQ(AArch64::ARMV8_6A.ArchFeature, "+v8.6a");
+  EXPECT_EQ(AArch64::ARMV8_7A.ArchFeature, "+v8.7a");
+  EXPECT_EQ(AArch64::ARMV8_8A.ArchFeature, "+v8.8a");
+  EXPECT_EQ(AArch64::ARMV8_9A.ArchFeature, "+v8.9a");
+  EXPECT_EQ(AArch64::ARMV9A.ArchFeature, "+v9a");
+  EXPECT_EQ(AArch64::ARMV9_1A.ArchFeature, "+v9.1a");
+  EXPECT_EQ(AArch64::ARMV9_2A.ArchFeature, "+v9.2a");
+  EXPECT_EQ(AArch64::ARMV9_3A.ArchFeature, "+v9.3a");
+  EXPECT_EQ(AArch64::ARMV9_4A.ArchFeature, "+v9.4a");
+  EXPECT_EQ(AArch64::ARMV8R.ArchFeature, "+v8r");
+}
+
+TEST(TargetParserTest, AArch64ArchPartialOrder) {
+  for (const auto *A : AArch64::ArchInfos) {
+    EXPECT_EQ(*A, *A);
+
+    // v8r has no relation to other valid architectures
+    if (*A != AArch64::ARMV8R) {
+      EXPECT_FALSE(A->implies(AArch64::ARMV8R));
+      EXPECT_FALSE(AArch64::ARMV8R.implies(*A));
+    }
+  }
+
+  for (const auto *A : {
+           &AArch64::ARMV8_1A,
+           &AArch64::ARMV8_2A,
+           &AArch64::ARMV8_3A,
+           &AArch64::ARMV8_4A,
+           &AArch64::ARMV8_5A,
+           &AArch64::ARMV8_6A,
+           &AArch64::ARMV8_7A,
+           &AArch64::ARMV8_8A,
+           &AArch64::ARMV8_9A,
+       })
+    EXPECT_TRUE(A->implies(AArch64::ARMV8A));
+
+  for (const auto *A : {&AArch64::ARMV9_1A, &AArch64::ARMV9_2A,
+                        &AArch64::ARMV9_3A, &AArch64::ARMV9_4A})
+    EXPECT_TRUE(A->implies(AArch64::ARMV9A));
+
+  EXPECT_TRUE(AArch64::ARMV8_1A.implies(AArch64::ARMV8A));
+  EXPECT_TRUE(AArch64::ARMV8_2A.implies(AArch64::ARMV8_1A));
+  EXPECT_TRUE(AArch64::ARMV8_3A.implies(AArch64::ARMV8_2A));
+  EXPECT_TRUE(AArch64::ARMV8_4A.implies(AArch64::ARMV8_3A));
+  EXPECT_TRUE(AArch64::ARMV8_5A.implies(AArch64::ARMV8_4A));
+  EXPECT_TRUE(AArch64::ARMV8_6A.implies(AArch64::ARMV8_5A));
+  EXPECT_TRUE(AArch64::ARMV8_7A.implies(AArch64::ARMV8_6A));
+  EXPECT_TRUE(AArch64::ARMV8_8A.implies(AArch64::ARMV8_7A));
+  EXPECT_TRUE(AArch64::ARMV8_9A.implies(AArch64::ARMV8_8A));
+
+  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV9A));
+  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV9_1A));
+  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV9_2A));
+  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV9_3A));
+
+  EXPECT_TRUE(AArch64::ARMV9A.implies(AArch64::ARMV8_5A));
+  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV8_6A));
+  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV8_7A));
+  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV8_8A));
+  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV8_9A));
+}
+
+TEST(TargetParserTest, AArch64ArchExtFeature) {
+  const char *ArchExt[][4] = {
+      {"crc", "nocrc", "+crc", "-crc"},
+      {"crypto", "nocrypto", "+crypto", "-crypto"},
+      {"flagm", "noflagm", "+flagm", "-flagm"},
+      {"fp", "nofp", "+fp-armv8", "-fp-armv8"},
+      {"simd", "nosimd", "+neon", "-neon"},
+      {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
+      {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
+      {"profile", "noprofile", "+spe", "-spe"},
+      {"ras", "noras", "+ras", "-ras"},
+      {"lse", "nolse", "+lse", "-lse"},
+      {"rdm", "nordm", "+rdm", "-rdm"},
+      {"sve", "nosve", "+sve", "-sve"},
+      {"sve2", "nosve2", "+sve2", "-sve2"},
+      {"sve2-aes", "nosve2-aes", "+sve2-aes", "-sve2-aes"},
+      {"sve2-sm4", "nosve2-sm4", "+sve2-sm4", "-sve2-sm4"},
+      {"sve2-sha3", "nosve2-sha3", "+sve2-sha3", "-sve2-sha3"},
+      {"sve2p1", "nosve2p1", "+sve2p1", "-sve2p1"},
+      {"b16b16", "nob16b16", "+b16b16", "-b16b16"},
+      {"sve2-bitperm", "nosve2-bitperm", "+sve2-bitperm", "-sve2-bitperm"},
+      {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
+      {"rcpc", "norcpc", "+rcpc", "-rcpc"},
+      {"rng", "norng", "+rand", "-rand"},
+      {"memtag", "nomemtag", "+mte", "-mte"},
+      {"tme", "notme", "+tme", "-tme"},
+      {"pauth", "nopauth", "+pauth", "-pauth"},
+      {"ssbs", "nossbs", "+ssbs", "-ssbs"},
+      {"sb", "nosb", "+sb", "-sb"},
+      {"predres", "nopredres", "+predres", "-predres"},
+      {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
+      {"f32mm", "nof32mm", "+f32mm", "-f32mm"},
+      {"f64mm", "nof64mm", "+f64mm", "-f64mm"},
+      {"sme", "nosme", "+sme", "-sme"},
+      {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"},
+      {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"},
+      {"sme-f16f16", "nosme-f16f16", "+sme-f16f16", "-sme-f16f16"},
+      {"sme2", "nosme2", "+sme2", "-sme2"},
+      {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"},
+      {"hbc", "nohbc", "+hbc", "-hbc"},
+      {"mops", "nomops", "+mops", "-mops"},
+      {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},
+      {"predres2", "nopredres2", "+specres2", "-specres2"},
+      {"rasv2", "norasv2", "+rasv2", "-rasv2"},
+      {"gcs", "nogcs", "+gcs", "-gcs"},
+  };
+
+  for (unsigned i = 0; i < std::size(ArchExt); i++) {
+    EXPECT_EQ(StringRef(ArchExt[i][2]),
+              AArch64::getArchExtFeature(ArchExt[i][0]));
+    EXPECT_EQ(StringRef(ArchExt[i][3]),
+              AArch64::getArchExtFeature(ArchExt[i][1]));
+  }
+}
+
+} // namespace
diff --git a/llvm/unittests/TargetParser/CMakeLists.txt b/llvm/unittests/TargetParser/CMakeLists.txt
index 501acc044687026..8891ffe54445b21 100644
--- a/llvm/unittests/TargetParser/CMakeLists.txt
+++ b/llvm/unittests/TargetParser/CMakeLists.txt
@@ -6,7 +6,8 @@ set(LLVM_LINK_COMPONENTS
 add_llvm_unittest(TargetParserTests
   CSKYTargetParserTest.cpp
   Host.cpp
-  TargetParserTest.cpp
+  ArmTargetParserTest.cpp
+  AArch64TargetParserTest.cpp
   TripleTest.cpp
   )
 
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
deleted file mode 100644
index 741d5a2d4b48090..000000000000000
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ /dev/null
@@ -1,1808 +0,0 @@
-//===----------- TargetParser.cpp - Target Parser -------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/TargetParser/TargetParser.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/ARMBuildAttributes.h"
-#include "llvm/Support/FormatVariadic.h"
-#include "llvm/TargetParser/AArch64TargetParser.h"
-#include "llvm/TargetParser/ARMTargetParser.h"
-#include "llvm/TargetParser/ARMTargetParserCommon.h"
-#include "llvm/TargetParser/Triple.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include <optional>
-#include <string>
-
-using namespace llvm;
-
-namespace {
-const char *ARMArch[] = {
-    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
-    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
-    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
-    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
-    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
-    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
-    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
-    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
-    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
-    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
-    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
-    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
-    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
-    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
-    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
-    "armv9.4a",
-};
-
-template <ARM::ISAKind ISAKind>
-std::string FormatExtensionFlags(uint64_t Flags) {
-  std::vector<StringRef> Features;
-
-  if (ISAKind == ARM::ISAKind::AARCH64) {
-    // AEK_NONE is not meant to be shown to the user so the target parser
-    // does not recognise it. It is relevant here though.
-    if (Flags & AArch64::AEK_NONE)
-      Features.push_back("none");
-    AArch64::getExtensionFeatures(Flags, Features);
-  } else {
-    if (Flags & ARM::AEK_NONE)
-      Features.push_back("none");
-    ARM::getExtensionFeatures(Flags, Features);
-  }
-
-  // The target parser also includes every extension you don't have.
-  // E.g. if AEK_CRC is not set then it adds "-crc". Not useful here.
-  Features.erase(std::remove_if(Features.begin(), Features.end(),
-                                [](StringRef extension) {
-                                  return extension.startswith("-");
-                                }),
-                 Features.end());
-
-  return llvm::join(Features, ", ");
-}
-
-template <ARM::ISAKind ISAKind> struct AssertSameExtensionFlags {
-  AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
-
-  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
-                                      uint64_t ExpectedFlags,
-                                      uint64_t GotFlags) {
-    if (ExpectedFlags == GotFlags)
-      return testing::AssertionSuccess();
-
-    return testing::AssertionFailure() << llvm::formatv(
-               "CPU: {4}\n"
-               "Expected extension flags: {0} ({1:x})\n"
-               "     Got extension flags: {2} ({3:x})\n",
-               FormatExtensionFlags<ISAKind>(ExpectedFlags), ExpectedFlags,
-               FormatExtensionFlags<ISAKind>(GotFlags), GotFlags, CPUName);
-  }
-
-private:
-  StringRef CPUName;
-};
-
-struct ARMCPUTestParams {
-  ARMCPUTestParams(StringRef CPUName, StringRef ExpectedArch,
-                   StringRef ExpectedFPU, uint64_t ExpectedFlags,
-                   StringRef CPUAttr)
-      : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
-        ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
-
-  friend std::ostream &operator<<(std::ostream &os,
-                                  const ARMCPUTestParams &params) {
-    return os << "\"" << params.CPUName.str() << "\", \""
-              << params.ExpectedArch.str() << "\", \""
-              << params.ExpectedFPU.str() << "\", 0x" << std::hex
-              << params.ExpectedFlags << ", \"" << params.CPUAttr.str() << "\"";
-  }
-
-  StringRef CPUName;
-  StringRef ExpectedArch;
-  StringRef ExpectedFPU;
-  uint64_t ExpectedFlags;
-  StringRef CPUAttr;
-};
-
-class ARMCPUTestFixture : public ::testing::TestWithParam<ARMCPUTestParams> {};
-
-TEST_P(ARMCPUTestFixture, ARMCPUTests) {
-  auto params = GetParam();
-
-  ARM::ArchKind AK = ARM::parseCPUArch(params.CPUName);
-  EXPECT_EQ(params.ExpectedArch, ARM::getArchName(AK));
-
-  ARM::FPUKind FPUKind = ARM::getDefaultFPU(params.CPUName, AK);
-  EXPECT_EQ(params.ExpectedFPU, ARM::getFPUName(FPUKind));
-
-  uint64_t default_extensions = ARM::getDefaultExtensions(params.CPUName, AK);
-  EXPECT_PRED_FORMAT2(
-      AssertSameExtensionFlags<ARM::ISAKind::ARM>(params.CPUName),
-      params.ExpectedFlags, default_extensions);
-
-  EXPECT_EQ(params.CPUAttr, ARM::getCPUAttr(AK));
-}
-
-// Note that we include ARM::AEK_NONE even when there are other extensions
-// we expect. This is because the default extensions for a CPU are the sum
-// of the default extensions for its architecture and for the CPU.
-// So if a CPU has no extra extensions, it adds AEK_NONE.
-INSTANTIATE_TEST_SUITE_P(
-    ARMCPUTestsPart1, ARMCPUTestFixture,
-    ::testing::Values(
-        ARMCPUTestParams("invalid", "invalid", "invalid", ARM::AEK_NONE, ""),
-        ARMCPUTestParams("generic", "invalid", "none", ARM::AEK_NONE, ""),
-
-        ARMCPUTestParams("arm8", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams("arm810", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams("strongarm", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams("strongarm110", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams("strongarm1100", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams("strongarm1110", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams("arm7tdmi", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm7tdmi-s", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm710t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm720t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm9", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm9tdmi", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm920", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm920t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm922t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm940t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("ep9312", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams("arm10tdmi", "armv5t", "none", ARM::AEK_NONE, "5T"),
-        ARMCPUTestParams("arm1020t", "armv5t", "none", ARM::AEK_NONE, "5T"),
-        ARMCPUTestParams("arm9e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm946e-s", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm966e-s", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm968e-s", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm10e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm1020e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm1022e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
-        ARMCPUTestParams("arm926ej-s", "armv5tej", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TEJ"),
-        ARMCPUTestParams("arm1136j-s", "armv6", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6"),
-        ARMCPUTestParams("arm1136jf-s", "armv6", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6"),
-        ARMCPUTestParams("arm1176jz-s", "armv6kz", "none",
-                         ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP, "6KZ"),
-        ARMCPUTestParams("mpcore", "armv6k", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
-        ARMCPUTestParams("mpcorenovfp", "armv6k", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
-        ARMCPUTestParams("arm1176jzf-s", "armv6kz", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP, "6KZ"),
-        ARMCPUTestParams("arm1156t2-s", "armv6t2", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
-        ARMCPUTestParams("arm1156t2f-s", "armv6t2", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
-        ARMCPUTestParams("cortex-m0", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
-        ARMCPUTestParams("cortex-m0plus", "armv6-m", "none", ARM::AEK_NONE,
-                         "6-M"),
-        ARMCPUTestParams("cortex-m1", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
-        ARMCPUTestParams("sc000", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
-        ARMCPUTestParams("cortex-a5", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A"),
-        ARMCPUTestParams("cortex-a7", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_HWDIVARM | ARM::AEK_MP |
-                             ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_DSP,
-                         "7-A"),
-        ARMCPUTestParams("cortex-a8", "armv7-a", "neon",
-                         ARM::AEK_SEC | ARM::AEK_DSP, "7-A")));
-
-// gtest in llvm has a limit of 50 test cases when using ::Values so we split
-// them into 2 blocks
-INSTANTIATE_TEST_SUITE_P(
-    ARMCPUTestsPart2, ARMCPUTestFixture,
-    ::testing::Values(
-        ARMCPUTestParams("cortex-a9", "armv7-a", "neon-fp16",
-                         ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A"),
-        ARMCPUTestParams("cortex-a12", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-A"),
-        ARMCPUTestParams("cortex-a15", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-A"),
-        ARMCPUTestParams("cortex-a17", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-A"),
-        ARMCPUTestParams("krait", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-A"),
-        ARMCPUTestParams("cortex-r4", "armv7-r", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-R"),
-        ARMCPUTestParams("cortex-r4f", "armv7-r", "vfpv3-d16",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-R"),
-        ARMCPUTestParams("cortex-r5", "armv7-r", "vfpv3-d16",
-                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-R"),
-        ARMCPUTestParams("cortex-r7", "armv7-r", "vfpv3-d16-fp16",
-                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-R"),
-        ARMCPUTestParams("cortex-r8", "armv7-r", "vfpv3-d16-fp16",
-                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-R"),
-        ARMCPUTestParams("cortex-r52", "armv8-r", "neon-fp-armv8",
-                         ARM::AEK_NONE | ARM::AEK_CRC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-R"),
-        ARMCPUTestParams("sc300", "armv7-m", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
-        ARMCPUTestParams("cortex-m3", "armv7-m", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
-        ARMCPUTestParams("cortex-m4", "armv7e-m", "fpv4-sp-d16",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7E-M"),
-        ARMCPUTestParams("cortex-m7", "armv7e-m", "fpv5-d16",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7E-M"),
-        ARMCPUTestParams("cortex-a32", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
-                             ARM::AEK_FP16 | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a710", "armv9-a", "neon-fp-armv8",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
-                             ARM::AEK_DOTPROD | ARM::AEK_FP16FML |
-                             ARM::AEK_BF16 | ARM::AEK_I8MM | ARM::AEK_SB,
-                         "9-A"),
-        ARMCPUTestParams("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_SEC |
-                             ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC |
-                             ARM::AEK_RAS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD |
-                             ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD |
-                             ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC,
-                         "8.2-A"),
-        ARMCPUTestParams("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_HWDIVARM | ARM::AEK_MP | ARM::AEK_SEC |
-                             ARM::AEK_VIRT | ARM::AEK_DSP | ARM::AEK_BF16 |
-                             ARM::AEK_DOTPROD | ARM::AEK_RAS | ARM::AEK_I8MM |
-                             ARM::AEK_SB,
-                         "8.5-A"),
-        ARMCPUTestParams("neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
-                             ARM::AEK_FP16 | ARM::AEK_BF16 | ARM::AEK_DOTPROD,
-                         "8.4-A"),
-        ARMCPUTestParams("cyclone", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
-                         "8.2-A"),
-        ARMCPUTestParams("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-m23", "armv8-m.base", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "8-M.Baseline"),
-        ARMCPUTestParams("cortex-m33", "armv8-m.main", "fpv5-sp-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline"),
-        ARMCPUTestParams("cortex-m35p", "armv8-m.main", "fpv5-sp-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline"),
-        ARMCPUTestParams("cortex-m55", "armv8.1-m.main",
-                         "fp-armv8-fullfp16-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD |
-                             ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB |
-                             ARM::AEK_FP16,
-                         "8.1-M.Mainline"),
-        ARMCPUTestParams("cortex-m85", "armv8.1-m.main",
-                         "fp-armv8-fullfp16-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD |
-                             ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB |
-                             ARM::AEK_FP16 | ARM::AEK_PACBTI,
-                         "8.1-M.Mainline"),
-        ARMCPUTestParams("iwmmxt", "iwmmxt", "none", ARM::AEK_NONE, "iwmmxt"),
-        ARMCPUTestParams("xscale", "xscale", "none", ARM::AEK_NONE, "xscale"),
-        ARMCPUTestParams("swift", "armv7s", "neon-vfpv4",
-                         ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-S")));
-
-static constexpr unsigned NumARMCPUArchs = 89;
-
-TEST(TargetParserTest, testARMCPUArchList) {
-  SmallVector<StringRef, NumARMCPUArchs> List;
-  ARM::fillValidCPUArchList(List);
-
-  // No list exists for these in this test suite, so ensure all are
-  // valid, and match the expected 'magic' count.
-  EXPECT_EQ(List.size(), NumARMCPUArchs);
-  for(StringRef CPU : List) {
-    EXPECT_NE(ARM::parseCPUArch(CPU), ARM::ArchKind::INVALID);
-  }
-}
-
-TEST(TargetParserTest, testInvalidARMArch) {
-  auto InvalidArchStrings = {"armv", "armv99", "noarm"};
-  for (const char* InvalidArch : InvalidArchStrings)
-    EXPECT_EQ(ARM::parseArch(InvalidArch), ARM::ArchKind::INVALID);
-}
-
-bool testARMArch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
-                 unsigned ArchAttr) {
-  ARM::ArchKind AK = ARM::parseArch(Arch);
-  bool Result = (AK != ARM::ArchKind::INVALID);
-  Result &= ARM::getDefaultCPU(Arch).equals(DefaultCPU);
-  Result &= ARM::getSubArch(AK).equals(SubArch);
-  Result &= (ARM::getArchAttr(AK) == ArchAttr);
-  return Result;
-}
-
-TEST(TargetParserTest, testARMArch) {
-  EXPECT_TRUE(
-      testARMArch("armv4", "strongarm", "v4",
-                          ARMBuildAttrs::CPUArch::v4));
-  EXPECT_TRUE(
-      testARMArch("armv4t", "arm7tdmi", "v4t",
-                          ARMBuildAttrs::CPUArch::v4T));
-  EXPECT_TRUE(
-      testARMArch("armv5t", "arm10tdmi", "v5",
-                          ARMBuildAttrs::CPUArch::v5T));
-  EXPECT_TRUE(
-      testARMArch("armv5te", "arm1022e", "v5e",
-                          ARMBuildAttrs::CPUArch::v5TE));
-  EXPECT_TRUE(
-      testARMArch("armv5tej", "arm926ej-s", "v5e",
-                          ARMBuildAttrs::CPUArch::v5TEJ));
-  EXPECT_TRUE(
-      testARMArch("armv6", "arm1136jf-s", "v6",
-                          ARMBuildAttrs::CPUArch::v6));
-  EXPECT_TRUE(
-      testARMArch("armv6k", "mpcore", "v6k",
-                          ARMBuildAttrs::CPUArch::v6K));
-  EXPECT_TRUE(
-      testARMArch("armv6t2", "arm1156t2-s", "v6t2",
-                          ARMBuildAttrs::CPUArch::v6T2));
-  EXPECT_TRUE(
-      testARMArch("armv6kz", "arm1176jzf-s", "v6kz",
-                          ARMBuildAttrs::CPUArch::v6KZ));
-  EXPECT_TRUE(
-      testARMArch("armv6-m", "cortex-m0", "v6m",
-                          ARMBuildAttrs::CPUArch::v6_M));
-  EXPECT_TRUE(
-      testARMArch("armv7-a", "generic", "v7",
-                          ARMBuildAttrs::CPUArch::v7));
-  EXPECT_TRUE(
-      testARMArch("armv7ve", "generic", "v7ve",
-                          ARMBuildAttrs::CPUArch::v7));
-  EXPECT_TRUE(
-      testARMArch("armv7-r", "cortex-r4", "v7r",
-                          ARMBuildAttrs::CPUArch::v7));
-  EXPECT_TRUE(
-      testARMArch("armv7-m", "cortex-m3", "v7m",
-                          ARMBuildAttrs::CPUArch::v7));
-  EXPECT_TRUE(
-      testARMArch("armv7e-m", "cortex-m4", "v7em",
-                          ARMBuildAttrs::CPUArch::v7E_M));
-  EXPECT_TRUE(
-      testARMArch("armv8-a", "generic", "v8a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.1-a", "generic", "v8.1a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.2-a", "generic", "v8.2a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.3-a", "generic", "v8.3a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.4-a", "generic", "v8.4a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.5-a", "generic", "v8.5a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.6-a", "generic", "v8.6a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.7-a", "generic", "v8.7a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testARMArch("armv8.8-a", "generic", "v8.8a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.9-a", "generic", "v8.9a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv9-a", "generic", "v9a",
-                          ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.1-a", "generic", "v9.1a",
-                          ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.2-a", "generic", "v9.2a",
-                          ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.3-a", "generic", "v9.3a",
-                          ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.4-a", "generic", "v9.4a",
-                          ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv8-r", "cortex-r52", "v8r",
-                          ARMBuildAttrs::CPUArch::v8_R));
-  EXPECT_TRUE(
-      testARMArch("armv8-m.base", "generic", "v8m.base",
-                          ARMBuildAttrs::CPUArch::v8_M_Base));
-  EXPECT_TRUE(
-      testARMArch("armv8-m.main", "generic", "v8m.main",
-                          ARMBuildAttrs::CPUArch::v8_M_Main));
-  EXPECT_TRUE(
-      testARMArch("armv8.1-m.main", "generic", "v8.1m.main",
-                          ARMBuildAttrs::CPUArch::v8_1_M_Main));
-  EXPECT_TRUE(
-      testARMArch("iwmmxt", "iwmmxt", "",
-                          ARMBuildAttrs::CPUArch::v5TE));
-  EXPECT_TRUE(
-      testARMArch("iwmmxt2", "generic", "",
-                          ARMBuildAttrs::CPUArch::v5TE));
-  EXPECT_TRUE(
-      testARMArch("xscale", "xscale", "v5e",
-                          ARMBuildAttrs::CPUArch::v5TE));
-  EXPECT_TRUE(
-      testARMArch("armv7s", "swift", "v7s",
-                          ARMBuildAttrs::CPUArch::v7));
-  EXPECT_TRUE(
-      testARMArch("armv7k", "generic", "v7k",
-                          ARMBuildAttrs::CPUArch::v7));
-}
-
-bool testARMExtension(StringRef CPUName,ARM::ArchKind ArchKind, StringRef ArchExt) {
-  return ARM::getDefaultExtensions(CPUName, ArchKind) &
-         ARM::parseArchExt(ArchExt);
-}
-
-TEST(TargetParserTest, testARMExtension) {
-  EXPECT_FALSE(testARMExtension("strongarm", ARM::ArchKind::INVALID, "dsp"));
-  EXPECT_FALSE(testARMExtension("arm7tdmi", ARM::ArchKind::INVALID, "dsp"));
-  EXPECT_FALSE(testARMExtension("arm10tdmi",
-                                ARM::ArchKind::INVALID, "simd"));
-  EXPECT_FALSE(testARMExtension("arm1022e", ARM::ArchKind::INVALID, "simd"));
-  EXPECT_FALSE(testARMExtension("arm926ej-s",
-                                ARM::ArchKind::INVALID, "simd"));
-  EXPECT_FALSE(testARMExtension("arm1136jf-s",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("arm1156t2-s",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("arm1176jzf-s",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-m0",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-a8",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-r4",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-m3",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-a53",
-                                ARM::ArchKind::INVALID, "ras"));
-  EXPECT_FALSE(testARMExtension("cortex-a53",
-                                ARM::ArchKind::INVALID, "fp16"));
-  EXPECT_TRUE(testARMExtension("cortex-a55",
-                                ARM::ArchKind::INVALID, "fp16"));
-  EXPECT_FALSE(testARMExtension("cortex-a55",
-                                ARM::ArchKind::INVALID, "fp16fml"));
-  EXPECT_TRUE(testARMExtension("cortex-a75",
-                                ARM::ArchKind::INVALID, "fp16"));
-  EXPECT_FALSE(testARMExtension("cortex-a75",
-                                ARM::ArchKind::INVALID, "fp16fml"));
-  EXPECT_FALSE(testARMExtension("cortex-r52",
-                                ARM::ArchKind::INVALID, "ras"));
-  EXPECT_FALSE(testARMExtension("iwmmxt", ARM::ArchKind::INVALID, "crc"));
-  EXPECT_FALSE(testARMExtension("xscale", ARM::ArchKind::INVALID, "crc"));
-  EXPECT_FALSE(testARMExtension("swift", ARM::ArchKind::INVALID, "crc"));
-
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4, "dsp"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4T, "dsp"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5T, "simd"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5TE, "simd"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5TEJ, "simd"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6K, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV6T2, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV6KZ, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6M, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7A, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7R, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7M, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV7EM, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8A, "ras"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_1A, "ras"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "profile"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "fp16"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "fp16fml"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_3A, "fp16"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_3A, "fp16fml"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16fml"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8R, "ras"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV8MBaseline, "crc"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV8MMainline, "crc"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::IWMMXT, "crc"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::IWMMXT2, "crc"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::XSCALE, "crc"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7S, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7K, "crypto"));
-}
-
-TEST(TargetParserTest, ARMFPUVersion) {
-  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
-       FK <= ARM::FPUKind::FK_LAST;
-       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1))
-    if (FK == ARM::FK_LAST || ARM::getFPUName(FK) == "invalid" ||
-        ARM::getFPUName(FK) == "none" || ARM::getFPUName(FK) == "softvfp")
-      EXPECT_EQ(ARM::FPUVersion::NONE, ARM::getFPUVersion(FK));
-    else
-      EXPECT_NE(ARM::FPUVersion::NONE, ARM::getFPUVersion(FK));
-}
-
-TEST(TargetParserTest, ARMFPUNeonSupportLevel) {
-  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
-       FK <= ARM::FPUKind::FK_LAST;
-       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1))
-    if (FK == ARM::FK_LAST ||
-        ARM::getFPUName(FK).find("neon") == std::string::npos)
-      EXPECT_EQ(ARM::NeonSupportLevel::None,
-                 ARM::getFPUNeonSupportLevel(FK));
-    else
-      EXPECT_NE(ARM::NeonSupportLevel::None,
-                ARM::getFPUNeonSupportLevel(FK));
-}
-
-TEST(TargetParserTest, ARMFPURestriction) {
-  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
-       FK <= ARM::FPUKind::FK_LAST;
-       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1)) {
-    if (FK == ARM::FK_LAST ||
-        (ARM::getFPUName(FK).find("d16") == std::string::npos &&
-         ARM::getFPUName(FK).find("vfpv3xd") == std::string::npos))
-      EXPECT_EQ(ARM::FPURestriction::None, ARM::getFPURestriction(FK));
-    else
-      EXPECT_NE(ARM::FPURestriction::None, ARM::getFPURestriction(FK));
-  }
-}
-
-TEST(TargetParserTest, ARMExtensionFeatures) {
-  std::map<uint64_t, std::vector<StringRef>> Extensions;
-
-  for (auto &Ext : ARM::ARCHExtNames) {
-    if (!Ext.Feature.empty() && !Ext.NegFeature.empty())
-      Extensions[Ext.ID] = {Ext.Feature, Ext.NegFeature};
-  }
-
-  Extensions[ARM::AEK_HWDIVARM]   = { "+hwdiv-arm", "-hwdiv-arm" };
-  Extensions[ARM::AEK_HWDIVTHUMB] = { "+hwdiv",     "-hwdiv" };
-
-  std::vector<StringRef> Features;
-
-  EXPECT_FALSE(ARM::getExtensionFeatures(ARM::AEK_INVALID, Features));
-
-  for (auto &E : Extensions) {
-    // test +extension
-    Features.clear();
-    ARM::getExtensionFeatures(E.first, Features);
-    EXPECT_TRUE(llvm::is_contained(Features, E.second.at(0)));
-    EXPECT_EQ(Extensions.size(), Features.size());
-
-    // test -extension
-    Features.clear();
-    ARM::getExtensionFeatures(~E.first, Features);
-    EXPECT_TRUE(llvm::is_contained(Features, E.second.at(1)));
-    EXPECT_EQ(Extensions.size(), Features.size());
-  }
-}
-
-TEST(TargetParserTest, ARMFPUFeatures) {
-  std::vector<StringRef> Features;
-  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
-       FK <= ARM::FPUKind::FK_LAST;
-       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1)) {
-    if (FK == ARM::FK_INVALID || FK >= ARM::FK_LAST)
-      EXPECT_FALSE(ARM::getFPUFeatures(FK, Features));
-    else
-      EXPECT_TRUE(ARM::getFPUFeatures(FK, Features));
-  }
-}
-
-TEST(TargetParserTest, ARMArchExtFeature) {
-  const char *ArchExt[][4] = {{"crc", "nocrc", "+crc", "-crc"},
-                              {"crypto", "nocrypto", "+crypto", "-crypto"},
-                              {"dsp", "nodsp", "+dsp", "-dsp"},
-                              {"fp", "nofp", nullptr, nullptr},
-                              {"idiv", "noidiv", nullptr, nullptr},
-                              {"mp", "nomp", nullptr, nullptr},
-                              {"simd", "nosimd", nullptr, nullptr},
-                              {"sec", "nosec", nullptr, nullptr},
-                              {"virt", "novirt", nullptr, nullptr},
-                              {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
-                              {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
-                              {"ras", "noras", "+ras", "-ras"},
-                              {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
-                              {"os", "noos", nullptr, nullptr},
-                              {"iwmmxt", "noiwmmxt", nullptr, nullptr},
-                              {"iwmmxt2", "noiwmmxt2", nullptr, nullptr},
-                              {"maverick", "maverick", nullptr, nullptr},
-                              {"xscale", "noxscale", nullptr, nullptr},
-                              {"sb", "nosb", "+sb", "-sb"},
-                              {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
-                              {"mve", "nomve", "+mve", "-mve"},
-                              {"mve.fp", "nomve.fp", "+mve.fp", "-mve.fp"}};
-
-  for (unsigned i = 0; i < std::size(ArchExt); i++) {
-    EXPECT_EQ(StringRef(ArchExt[i][2]), ARM::getArchExtFeature(ArchExt[i][0]));
-    EXPECT_EQ(StringRef(ArchExt[i][3]), ARM::getArchExtFeature(ArchExt[i][1]));
-  }
-}
-
-static bool
-testArchExtDependency(const char *ArchExt,
-                      const std::initializer_list<const char *> &Expected) {
-  std::vector<StringRef> Features;
-  ARM::FPUKind FPUKind;
-
-  if (!ARM::appendArchExtFeatures("", ARM::ArchKind::ARMV8_1MMainline, ArchExt,
-                                  Features, FPUKind))
-    return false;
-
-  return llvm::all_of(Expected, [&](StringRef Ext) {
-    return llvm::is_contained(Features, Ext);
-  });
-}
-
-TEST(TargetParserTest, ARMArchExtDependencies) {
-  EXPECT_TRUE(testArchExtDependency("mve", {"+mve", "+dsp"}));
-  EXPECT_TRUE(testArchExtDependency("mve.fp", {"+mve.fp", "+mve", "+dsp"}));
-  EXPECT_TRUE(testArchExtDependency("nodsp", {"-dsp", "-mve", "-mve.fp"}));
-  EXPECT_TRUE(testArchExtDependency("nomve", {"-mve", "-mve.fp"}));
-}
-
-TEST(TargetParserTest, ARMparseHWDiv) {
-  const char *hwdiv[] = {"thumb", "arm", "arm,thumb", "thumb,arm"};
-
-  for (unsigned i = 0; i < std::size(hwdiv); i++)
-    EXPECT_NE(ARM::AEK_INVALID, ARM::parseHWDiv((StringRef)hwdiv[i]));
-}
-
-TEST(TargetParserTest, ARMparseArchEndianAndISA) {
-  const char *Arch[] = {
-      "v2",        "v2a",    "v3",    "v3m",    "v4",       "v4t",
-      "v5",        "v5t",    "v5e",   "v5te",   "v5tej",    "v6",
-      "v6j",       "v6k",    "v6hl",  "v6t2",   "v6kz",     "v6z",
-      "v6zk",      "v6-m",   "v6m",   "v6sm",   "v6s-m",    "v7-a",
-      "v7",        "v7a",    "v7ve",  "v7hl",   "v7l",      "v7-r",
-      "v7r",       "v7-m",   "v7m",   "v7k",    "v7s",      "v7e-m",
-      "v7em",      "v8-a",   "v8",    "v8a",    "v8l",      "v8.1-a",
-      "v8.1a",     "v8.2-a", "v8.2a", "v8.3-a", "v8.3a",    "v8.4-a",
-      "v8.4a",     "v8.5-a", "v8.5a", "v8.6-a", "v8.6a",    "v8.7-a",
-      "v8.7a",     "v8.8-a", "v8.8a", "v8-r",   "v8m.base", "v8m.main",
-      "v8.1m.main"};
-
-  for (unsigned i = 0; i < std::size(Arch); i++) {
-    std::string arm_1 = "armeb" + (std::string)(Arch[i]);
-    std::string arm_2 = "arm" + (std::string)(Arch[i]) + "eb";
-    std::string arm_3 = "arm" + (std::string)(Arch[i]);
-    std::string thumb_1 = "thumbeb" + (std::string)(Arch[i]);
-    std::string thumb_2 = "thumb" + (std::string)(Arch[i]) + "eb";
-    std::string thumb_3 = "thumb" + (std::string)(Arch[i]);
-
-    EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(arm_1));
-    EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(arm_2));
-    EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian(arm_3));
-
-    EXPECT_EQ(ARM::ISAKind::ARM, ARM::parseArchISA(arm_1));
-    EXPECT_EQ(ARM::ISAKind::ARM, ARM::parseArchISA(arm_2));
-    EXPECT_EQ(ARM::ISAKind::ARM, ARM::parseArchISA(arm_3));
-    if (i >= 4) {
-      EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(thumb_1));
-      EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(thumb_2));
-      EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian(thumb_3));
-
-      EXPECT_EQ(ARM::ISAKind::THUMB, ARM::parseArchISA(thumb_1));
-      EXPECT_EQ(ARM::ISAKind::THUMB, ARM::parseArchISA(thumb_2));
-      EXPECT_EQ(ARM::ISAKind::THUMB, ARM::parseArchISA(thumb_3));
-    }
-  }
-
-  EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian("aarch64"));
-  EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian("arm64_32"));
-  EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian("aarch64_be"));
-
-  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("aarch64"));
-  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("aarch64_be"));
-  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("arm64"));
-  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("arm64_be"));
-  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("arm64_32"));
-  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("aarch64_32"));
-}
-
-TEST(TargetParserTest, ARMparseArchProfile) {
-  for (unsigned i = 0; i < std::size(ARMArch); i++) {
-    switch (ARM::parseArch(ARMArch[i])) {
-    case ARM::ArchKind::ARMV6M:
-    case ARM::ArchKind::ARMV7M:
-    case ARM::ArchKind::ARMV7EM:
-    case ARM::ArchKind::ARMV8MMainline:
-    case ARM::ArchKind::ARMV8MBaseline:
-    case ARM::ArchKind::ARMV8_1MMainline:
-      EXPECT_EQ(ARM::ProfileKind::M, ARM::parseArchProfile(ARMArch[i]));
-      break;
-    case ARM::ArchKind::ARMV7R:
-    case ARM::ArchKind::ARMV8R:
-      EXPECT_EQ(ARM::ProfileKind::R, ARM::parseArchProfile(ARMArch[i]));
-      break;
-    case ARM::ArchKind::ARMV7A:
-    case ARM::ArchKind::ARMV7VE:
-    case ARM::ArchKind::ARMV7K:
-    case ARM::ArchKind::ARMV8A:
-    case ARM::ArchKind::ARMV8_1A:
-    case ARM::ArchKind::ARMV8_2A:
-    case ARM::ArchKind::ARMV8_3A:
-    case ARM::ArchKind::ARMV8_4A:
-    case ARM::ArchKind::ARMV8_5A:
-    case ARM::ArchKind::ARMV8_6A:
-    case ARM::ArchKind::ARMV8_7A:
-    case ARM::ArchKind::ARMV8_8A:
-    case ARM::ArchKind::ARMV8_9A:
-    case ARM::ArchKind::ARMV9A:
-    case ARM::ArchKind::ARMV9_1A:
-    case ARM::ArchKind::ARMV9_2A:
-    case ARM::ArchKind::ARMV9_3A:
-    case ARM::ArchKind::ARMV9_4A:
-      EXPECT_EQ(ARM::ProfileKind::A, ARM::parseArchProfile(ARMArch[i]));
-      break;
-    default:
-      EXPECT_EQ(ARM::ProfileKind::INVALID, ARM::parseArchProfile(ARMArch[i]));
-      break;
-    }
-  }
-}
-
-TEST(TargetParserTest, ARMparseArchVersion) {
-  for (unsigned i = 0; i < std::size(ARMArch); i++)
-    if (((std::string)ARMArch[i]).substr(0, 4) == "armv")
-      EXPECT_EQ((ARMArch[i][4] - 48u), ARM::parseArchVersion(ARMArch[i]));
-    else
-      EXPECT_EQ(5u, ARM::parseArchVersion(ARMArch[i]));
-}
-
-TEST(TargetParserTest, getARMCPUForArch) {
-  // Platform specific defaults.
-  {
-    llvm::Triple Triple("arm--nacl");
-    EXPECT_EQ("cortex-a8", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("arm--openbsd");
-    EXPECT_EQ("cortex-a8", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armv6-unknown-freebsd");
-    EXPECT_EQ("arm1176jzf-s", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("thumbv6-unknown-freebsd");
-    EXPECT_EQ("arm1176jzf-s", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armebv6-unknown-freebsd");
-    EXPECT_EQ("arm1176jzf-s", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("arm--win32");
-    EXPECT_EQ("cortex-a9", ARM::getARMCPUForArch(Triple));
-    EXPECT_EQ("generic", ARM::getARMCPUForArch(Triple, "armv8-a"));
-  }
-  // Some alternative architectures
-  {
-    llvm::Triple Triple("armv7k-apple-ios9");
-    EXPECT_EQ("cortex-a7", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armv7k-apple-watchos3");
-    EXPECT_EQ("cortex-a7", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armv7k-apple-tvos9");
-    EXPECT_EQ("cortex-a7", ARM::getARMCPUForArch(Triple));
-  }
-  // armeb is permitted, but armebeb is not
-  {
-    llvm::Triple Triple("armeb-none-eabi");
-    EXPECT_EQ("arm7tdmi", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armebeb-none-eabi");
-    EXPECT_EQ("", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armebv6eb-none-eabi");
-    EXPECT_EQ("", ARM::getARMCPUForArch(Triple));
-  }
-  // xscaleeb is permitted, but armebxscale is not
-  {
-    llvm::Triple Triple("xscaleeb-none-eabi");
-    EXPECT_EQ("xscale", ARM::getARMCPUForArch(Triple));
-  }
-  {
-    llvm::Triple Triple("armebxscale-none-eabi");
-    EXPECT_EQ("", ARM::getARMCPUForArch(Triple));
-  }
-}
-
-class AArch64CPUTestFixture
-    : public ::testing::TestWithParam<ARMCPUTestParams> {};
-
-TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
-  ARMCPUTestParams params = GetParam();
-
-  const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
-  EXPECT_TRUE(Cpu);
-  EXPECT_EQ(params.ExpectedArch, Cpu->Arch.Name);
-
-  EXPECT_PRED_FORMAT2(
-      AssertSameExtensionFlags<ARM::ISAKind::AARCH64>(params.CPUName),
-      params.ExpectedFlags, Cpu->getImpliedExtensions());
-}
-
-INSTANTIATE_TEST_SUITE_P(
-    AArch64CPUTests, AArch64CPUTestFixture,
-    ::testing::Values(
-        ARMCPUTestParams("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_RAS |
-                             AArch64::AEK_LSE | AArch64::AEK_RDM |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC,
-                         "8.2-A"),
-        ARMCPUTestParams(
-            "cortex-a510", "armv9-a", "neon-fp-armv8",
-            AArch64::AEK_CRC | AArch64::AEK_FP | AArch64::AEK_SIMD |
-                AArch64::AEK_RAS | AArch64::AEK_LSE | AArch64::AEK_RDM |
-                AArch64::AEK_RCPC | AArch64::AEK_DOTPROD | AArch64::AEK_BF16 |
-                AArch64::AEK_I8MM | AArch64::AEK_SVE | AArch64::AEK_SVE2 |
-                AArch64::AEK_SVE2BITPERM | AArch64::AEK_PAUTH |
-                AArch64::AEK_MTE | AArch64::AEK_SSBS | AArch64::AEK_FP16 |
-                AArch64::AEK_FP16FML | AArch64::AEK_SB,
-            "9-A"),
-        ARMCPUTestParams("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_FP16 |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RCPC | AArch64::AEK_RDM |
-                             AArch64::AEK_SIMD | AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_FP16 |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RCPC | AArch64::AEK_RDM |
-                             AArch64::AEK_SIMD | AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_RAS |
-                             AArch64::AEK_LSE | AArch64::AEK_RDM |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC | AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC | AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC | AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-                             AArch64::AEK_PROFILE,
-                         "8.2-A"),
-        ARMCPUTestParams(
-            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
-            AArch64::AEK_RAS | AArch64::AEK_CRC | AArch64::AEK_AES |
-                AArch64::AEK_SHA2 | AArch64::AEK_FP | AArch64::AEK_SIMD |
-                AArch64::AEK_RAS | AArch64::AEK_LSE | AArch64::AEK_RDM |
-                AArch64::AEK_FP16 | AArch64::AEK_DOTPROD | AArch64::AEK_RCPC |
-                AArch64::AEK_SSBS | AArch64::AEK_PROFILE | AArch64::AEK_FLAGM |
-                AArch64::AEK_PAUTH | AArch64::AEK_FP16FML,
-            "8.2-A"),
-        ARMCPUTestParams(
-            "cortex-a710", "armv9-a", "neon-fp-armv8",
-            AArch64::AEK_CRC | AArch64::AEK_FP | AArch64::AEK_SIMD |
-                AArch64::AEK_RAS | AArch64::AEK_LSE | AArch64::AEK_RDM |
-                AArch64::AEK_RCPC | AArch64::AEK_DOTPROD | AArch64::AEK_MTE |
-                AArch64::AEK_FP16 | AArch64::AEK_FP16FML | AArch64::AEK_SVE |
-                AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM |
-                AArch64::AEK_PAUTH | AArch64::AEK_FLAGM | AArch64::AEK_SB |
-                AArch64::AEK_I8MM | AArch64::AEK_BF16,
-            "9-A"),
-        ARMCPUTestParams(
-            "cortex-a715", "armv9-a", "neon-fp-armv8",
-            AArch64::AEK_CRC | AArch64::AEK_FP | AArch64::AEK_BF16 |
-                AArch64::AEK_SIMD | AArch64::AEK_RAS | AArch64::AEK_LSE |
-                AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                AArch64::AEK_MTE | AArch64::AEK_PAUTH | AArch64::AEK_SVE |
-                AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM |
-                AArch64::AEK_SSBS | AArch64::AEK_SB | AArch64::AEK_I8MM |
-                AArch64::AEK_PERFMON | AArch64::AEK_PREDRES |
-                AArch64::AEK_PROFILE | AArch64::AEK_FP16FML |
-                AArch64::AEK_FP16 | AArch64::AEK_FLAGM,
-            "9-A"),
-        ARMCPUTestParams(
-            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
-            AArch64::AEK_RAS | AArch64::AEK_SVE | AArch64::AEK_SSBS |
-                AArch64::AEK_RCPC | AArch64::AEK_CRC | AArch64::AEK_FP |
-                AArch64::AEK_SIMD | AArch64::AEK_RAS | AArch64::AEK_LSE |
-                AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                AArch64::AEK_SM4 | AArch64::AEK_FP16 | AArch64::AEK_BF16 |
-                AArch64::AEK_PROFILE | AArch64::AEK_RAND |
-                AArch64::AEK_FP16FML | AArch64::AEK_I8MM,
-            "8.4-A"),
-        ARMCPUTestParams("neoverse-v2", "armv9-a", "neon-fp-armv8",
-                         AArch64::AEK_RAS | AArch64::AEK_SVE |
-                             AArch64::AEK_SSBS | AArch64::AEK_RCPC |
-                             AArch64::AEK_CRC | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_MTE |
-                             AArch64::AEK_LSE | AArch64::AEK_RDM |
-                             AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP16 | AArch64::AEK_BF16 |
-                             AArch64::AEK_SVE2 | AArch64::AEK_PROFILE |
-                             AArch64::AEK_FP16FML | AArch64::AEK_I8MM |
-                             AArch64::AEK_SVE2BITPERM | AArch64::AEK_RAND,
-                         "9-A"),
-        ARMCPUTestParams("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_RDM |
-                             AArch64::AEK_SSBS | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
-                             AArch64::AEK_RAS | AArch64::AEK_RCPC |
-                             AArch64::AEK_LSE | AArch64::AEK_SB,
-                         "8-R"),
-        ARMCPUTestParams("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-                             AArch64::AEK_PROFILE,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_FP16 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_RCPC | AArch64::AEK_SSBS |
-                             AArch64::AEK_PAUTH | AArch64::AEK_PROFILE,
-                         "8.2-A"),
-        ARMCPUTestParams("cortex-x2", "armv9-a", "neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_RAS |
-                             AArch64::AEK_LSE | AArch64::AEK_RDM |
-                             AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_MTE | AArch64::AEK_PAUTH |
-                             AArch64::AEK_I8MM | AArch64::AEK_BF16 |
-                             AArch64::AEK_SVE | AArch64::AEK_SVE2 |
-                             AArch64::AEK_SVE2BITPERM | AArch64::AEK_SSBS |
-                             AArch64::AEK_SB | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML,
-                         "9-A"),
-        ARMCPUTestParams(
-            "cortex-x3",
-            "armv9-a", "neon-fp-armv8",
-            AArch64::AEK_CRC | AArch64::AEK_FP | AArch64::AEK_BF16 |
-                AArch64::AEK_SIMD | AArch64::AEK_RAS | AArch64::AEK_LSE |
-                AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                AArch64::AEK_MTE | AArch64::AEK_PAUTH | AArch64::AEK_SVE |
-                AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM | AArch64::AEK_SB |
-                AArch64::AEK_PROFILE | AArch64::AEK_PERFMON |
-                AArch64::AEK_I8MM | AArch64::AEK_FP16 | AArch64::AEK_FP16FML |
-                AArch64::AEK_PREDRES | AArch64::AEK_FLAGM | AArch64::AEK_SSBS,
-            "9-A"),
-        ARMCPUTestParams("cyclone", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_NONE | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_NONE | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_NONE | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_NONE | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_FP16,
-                         "8.2-A"),
-        ARMCPUTestParams("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_LSE |
-                             AArch64::AEK_RAS | AArch64::AEK_RDM |
-                             AArch64::AEK_RCPC | AArch64::AEK_FP16,
-                         "8.3-A"),
-        ARMCPUTestParams("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_RCPC |
-                             AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_SHA3,
-                         "8.4-A"),
-        ARMCPUTestParams("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_RCPC |
-                             AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_SHA3,
-                         "8.5-A"),
-        ARMCPUTestParams("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_RCPC |
-                             AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-                             AArch64::AEK_BF16 | AArch64::AEK_I8MM,
-                         "8.5-A"),
-        ARMCPUTestParams("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_RCPC |
-                             AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-                             AArch64::AEK_BF16 | AArch64::AEK_I8MM,
-                         "8.5-A"),
-        ARMCPUTestParams("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_RCPC |
-                             AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_SHA3,
-                         "8.5-A"),
-        ARMCPUTestParams("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                             AArch64::AEK_FP | AArch64::AEK_SIMD |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_RCPC |
-                             AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_SHA3 |
-                             AArch64::AEK_BF16 | AArch64::AEK_I8MM,
-                         "8.5-A"),
-        ARMCPUTestParams("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_LSE |
-                             AArch64::AEK_RAS | AArch64::AEK_RDM |
-                             AArch64::AEK_RCPC | AArch64::AEK_FP16,
-                         "8.3-A"),
-        ARMCPUTestParams("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_LSE |
-                             AArch64::AEK_RAS | AArch64::AEK_RDM |
-                             AArch64::AEK_RCPC | AArch64::AEK_FP16,
-                         "8.3-A"),
-        ARMCPUTestParams("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_FP16 |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD,
-                         "8.2-A"),
-        ARMCPUTestParams("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_FP16 |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD,
-                         "8.2-A"),
-        ARMCPUTestParams("falkor", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_RDM,
-                         "8-A"),
-        ARMCPUTestParams("kryo", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD,
-                         "8-A"),
-        ARMCPUTestParams("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_FP16 |
-                             AArch64::AEK_LSE | AArch64::AEK_RAS |
-                             AArch64::AEK_RCPC | AArch64::AEK_RDM |
-                             AArch64::AEK_SIMD | AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_DOTPROD |
-                             AArch64::AEK_FP | AArch64::AEK_FP16 |
-                             AArch64::AEK_LSE | AArch64::AEK_PROFILE |
-                             AArch64::AEK_RAS | AArch64::AEK_RCPC |
-                             AArch64::AEK_RDM | AArch64::AEK_SIMD |
-                             AArch64::AEK_SSBS,
-                         "8.2-A"),
-        ARMCPUTestParams(
-            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
-            AArch64::AEK_CRC | AArch64::AEK_AES | AArch64::AEK_SHA2 |
-                AArch64::AEK_SHA3 | AArch64::AEK_SM4 | AArch64::AEK_FP |
-                AArch64::AEK_SIMD | AArch64::AEK_FP16 | AArch64::AEK_RAS |
-                AArch64::AEK_LSE | AArch64::AEK_SVE | AArch64::AEK_DOTPROD |
-                AArch64::AEK_RCPC | AArch64::AEK_RDM | AArch64::AEK_MTE |
-                AArch64::AEK_SSBS | AArch64::AEK_SB | AArch64::AEK_SVE2 |
-                AArch64::AEK_SVE2BITPERM | AArch64::AEK_BF16 |
-                AArch64::AEK_I8MM,
-            "8.5-A"),
-        ARMCPUTestParams(
-            "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
-            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_SHA3 | AArch64::AEK_BF16 | AArch64::AEK_SHA2 |
-                AArch64::AEK_AES | AArch64::AEK_I8MM | AArch64::AEK_SSBS |
-                AArch64::AEK_SB | AArch64::AEK_RAND,
-            "8.6-A"),
-        ARMCPUTestParams(
-            "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
-            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_RAND |
-                AArch64::AEK_MTE,
-            "8.6-A"),
-        ARMCPUTestParams(
-            "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
-            AArch64::AEK_RAS | AArch64::AEK_SVE | AArch64::AEK_SSBS |
-                AArch64::AEK_RCPC | AArch64::AEK_CRC | AArch64::AEK_FP |
-                AArch64::AEK_SIMD | AArch64::AEK_RAS | AArch64::AEK_LSE |
-                AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_DOTPROD |
-                AArch64::AEK_AES | AArch64::AEK_SHA2 | AArch64::AEK_SHA3 |
-                AArch64::AEK_SM4 | AArch64::AEK_FP16 | AArch64::AEK_BF16 |
-                AArch64::AEK_PROFILE | AArch64::AEK_RAND |
-                AArch64::AEK_FP16FML | AArch64::AEK_I8MM,
-            "8.4-A"),
-        ARMCPUTestParams("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | 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_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_LSE |
-                             AArch64::AEK_RDM | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_RAS |
-                             AArch64::AEK_RCPC,
-                         "8.3-A"),
-        ARMCPUTestParams("thunderx", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SIMD |
-                             AArch64::AEK_FP,
-                         "8-A"),
-        ARMCPUTestParams("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SIMD |
-                             AArch64::AEK_FP,
-                         "8-A"),
-        ARMCPUTestParams("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SIMD |
-                             AArch64::AEK_FP,
-                         "8-A"),
-        ARMCPUTestParams("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_SIMD |
-                             AArch64::AEK_FP,
-                         "8-A"),
-        ARMCPUTestParams("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_RAS |
-                             AArch64::AEK_LSE | AArch64::AEK_RDM |
-                             AArch64::AEK_PROFILE | AArch64::AEK_FP16 |
-                             AArch64::AEK_FP16FML | AArch64::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_FP16 |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_SVE | AArch64::AEK_RDM,
-                         "8.2-A"),
-        ARMCPUTestParams("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
-                         AArch64::AEK_CRC | AArch64::AEK_AES |
-                             AArch64::AEK_SHA2 | AArch64::AEK_FP |
-                             AArch64::AEK_SIMD | AArch64::AEK_FP16 |
-                             AArch64::AEK_RAS | AArch64::AEK_LSE |
-                             AArch64::AEK_RDM,
-                         "8.2-A")));
-
-// Note: number of CPUs includes aliases.
-static constexpr unsigned NumAArch64CPUArchs = 62;
-
-TEST(TargetParserTest, testAArch64CPUArchList) {
-  SmallVector<StringRef, NumAArch64CPUArchs> List;
-  AArch64::fillValidCPUArchList(List);
-
-  // No list exists for these in this test suite, so ensure all are
-  // valid, and match the expected 'magic' count.
-  EXPECT_EQ(List.size(), NumAArch64CPUArchs);
-  for(StringRef CPU : List) {
-    EXPECT_TRUE(AArch64::parseCpu(CPU));
-  }
-}
-
-bool testAArch64Arch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
-                     unsigned ArchAttr) {
-  const std::optional<AArch64::ArchInfo> AI = AArch64::parseArch(Arch);
-  return AI.has_value();
-}
-
-TEST(TargetParserTest, testAArch64Arch) {
-  EXPECT_TRUE(testAArch64Arch("armv8-a", "cortex-a53", "v8a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.1-a", "generic", "v8.1a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.2-a", "generic", "v8.2a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.3-a", "generic", "v8.3a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.4-a", "generic", "v8.4a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.5-a", "generic", "v8.5a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.6-a", "generic", "v8.6a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.7-a", "generic", "v8.7a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.8-a", "generic", "v8.8a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.9-a", "generic", "v8.9a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9-a", "generic", "v9a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.1-a", "generic", "v9.1a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.2-a", "generic", "v9.2a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.3-a", "generic", "v9.3a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.4-a", "generic", "v9.4a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-}
-
-bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {
-  std::optional<AArch64::ExtensionInfo> Extension =
-      AArch64::parseArchExtension(ArchExt);
-  if (!Extension)
-    return false;
-  std::optional<AArch64::CpuInfo> CpuInfo = AArch64::parseCpu(CPUName);
-  return CpuInfo->getImpliedExtensions() & Extension->ID;
-}
-
-bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {
-  std::optional<AArch64::ExtensionInfo> Extension =
-      AArch64::parseArchExtension(ArchExt);
-  if (!Extension)
-    return false;
-  return AI.DefaultExts & Extension->ID;
-}
-
-TEST(TargetParserTest, testAArch64Extension) {
-  EXPECT_FALSE(testAArch64Extension("cortex-a34", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a35", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a53", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a55", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "dotprod"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a57", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a72", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a73", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a75", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "lse"));
-  EXPECT_FALSE(testAArch64Extension("cyclone", "ras"));
-  EXPECT_FALSE(testAArch64Extension("exynos-m3", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "lse"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "lse"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("falkor", "rdm"));
-  EXPECT_FALSE(testAArch64Extension("kryo", "ras"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "crc"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "lse"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "ras"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "rcpc"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "profile"));
-  EXPECT_FALSE(testAArch64Extension("saphira", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("thunderx2t99", "ras"));
-  EXPECT_FALSE(testAArch64Extension("thunderx", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt81", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt83", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt88", "lse"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "aes"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "sha2"));
-  EXPECT_FALSE(testAArch64Extension("tsv110", "sha3"));
-  EXPECT_FALSE(testAArch64Extension("tsv110", "sm4"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "ras"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "profile"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("a64fx", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("a64fx", "sve"));
-  EXPECT_FALSE(testAArch64Extension("a64fx", "sve2"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "aes"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "sha2"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "fp16"));
-
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8A, "ras"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_1A, "ras"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "profile"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16fml"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16fml"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16fml"));
-}
-
-TEST(TargetParserTest, AArch64ExtensionFeatures) {
-  std::vector<uint64_t> Extensions = {
-      AArch64::AEK_CRC,     AArch64::AEK_LSE,       AArch64::AEK_RDM,
-      AArch64::AEK_CRYPTO,  AArch64::AEK_SM4,       AArch64::AEK_SHA3,
-      AArch64::AEK_SHA2,    AArch64::AEK_AES,       AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP,      AArch64::AEK_SIMD,      AArch64::AEK_FP16,
-      AArch64::AEK_FP16FML, AArch64::AEK_PROFILE,   AArch64::AEK_RAS,
-      AArch64::AEK_SVE,     AArch64::AEK_SVE2,      AArch64::AEK_SVE2AES,
-      AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3,  AArch64::AEK_SVE2BITPERM,
-      AArch64::AEK_RCPC,    AArch64::AEK_RAND,      AArch64::AEK_MTE,
-      AArch64::AEK_SSBS,    AArch64::AEK_SB,        AArch64::AEK_PREDRES,
-      AArch64::AEK_BF16,    AArch64::AEK_I8MM,      AArch64::AEK_F32MM,
-      AArch64::AEK_F64MM,   AArch64::AEK_TME,       AArch64::AEK_LS64,
-      AArch64::AEK_BRBE,    AArch64::AEK_PAUTH,     AArch64::AEK_FLAGM,
-      AArch64::AEK_SME,     AArch64::AEK_SMEF64F64, AArch64::AEK_SMEI16I64,
-      AArch64::AEK_SME2,    AArch64::AEK_HBC,       AArch64::AEK_MOPS,
-      AArch64::AEK_PERFMON, AArch64::AEK_SVE2p1,    AArch64::AEK_SME2p1,
-      AArch64::AEK_B16B16,  AArch64::AEK_SMEF16F16, AArch64::AEK_CSSC,
-      AArch64::AEK_RCPC3,   AArch64::AEK_THE,       AArch64::AEK_D128,
-      AArch64::AEK_LSE128,  AArch64::AEK_SPECRES2,  AArch64::AEK_RASv2,
-      AArch64::AEK_ITE,     AArch64::AEK_GCS,
-  };
-
-  std::vector<StringRef> Features;
-
-  uint64_t ExtVal = 0;
-  for (auto Ext : Extensions)
-    ExtVal |= Ext;
-
-  // NONE has no feature names.
-  // We return True here because NONE is a valid choice.
-  EXPECT_TRUE(AArch64::getExtensionFeatures(AArch64::AEK_NONE, Features));
-  EXPECT_TRUE(!Features.size());
-
-  AArch64::getExtensionFeatures(ExtVal, Features);
-  EXPECT_EQ(Extensions.size(), Features.size());
-
-  EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2p1"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+b16b16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+f64mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+tme"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ls64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+brbe"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+hbc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+mops"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+perfmon"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+cssc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+the"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+gcs"));
-
-  // Assuming we listed every extension above, this should produce the same
-  // result. (note that AEK_NONE doesn't have a name so it won't be in the
-  // result despite its bit being set)
-  std::vector<StringRef> AllFeatures;
-  EXPECT_TRUE(AArch64::getExtensionFeatures(-1, AllFeatures));
-  EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
-}
-
-TEST(TargetParserTest, AArch64ArchFeatures) {
-  EXPECT_EQ(AArch64::ARMV8A.ArchFeature, "+v8a");
-  EXPECT_EQ(AArch64::ARMV8_1A.ArchFeature, "+v8.1a");
-  EXPECT_EQ(AArch64::ARMV8_2A.ArchFeature, "+v8.2a");
-  EXPECT_EQ(AArch64::ARMV8_3A.ArchFeature, "+v8.3a");
-  EXPECT_EQ(AArch64::ARMV8_4A.ArchFeature, "+v8.4a");
-  EXPECT_EQ(AArch64::ARMV8_5A.ArchFeature, "+v8.5a");
-  EXPECT_EQ(AArch64::ARMV8_6A.ArchFeature, "+v8.6a");
-  EXPECT_EQ(AArch64::ARMV8_7A.ArchFeature, "+v8.7a");
-  EXPECT_EQ(AArch64::ARMV8_8A.ArchFeature, "+v8.8a");
-  EXPECT_EQ(AArch64::ARMV8_9A.ArchFeature, "+v8.9a");
-  EXPECT_EQ(AArch64::ARMV9A.ArchFeature, "+v9a");
-  EXPECT_EQ(AArch64::ARMV9_1A.ArchFeature, "+v9.1a");
-  EXPECT_EQ(AArch64::ARMV9_2A.ArchFeature, "+v9.2a");
-  EXPECT_EQ(AArch64::ARMV9_3A.ArchFeature, "+v9.3a");
-  EXPECT_EQ(AArch64::ARMV9_4A.ArchFeature, "+v9.4a");
-  EXPECT_EQ(AArch64::ARMV8R.ArchFeature, "+v8r");
-}
-
-TEST(TargetParserTest, AArch64ArchPartialOrder) {
-  for (const auto *A : AArch64::ArchInfos) {
-    EXPECT_EQ(*A, *A);
-
-    // v8r has no relation to other valid architectures
-    if (*A != AArch64::ARMV8R) {
-      EXPECT_FALSE(A->implies(AArch64::ARMV8R));
-      EXPECT_FALSE(AArch64::ARMV8R.implies(*A));
-    }
-  }
-
-  for (const auto *A : {
-           &AArch64::ARMV8_1A,
-           &AArch64::ARMV8_2A,
-           &AArch64::ARMV8_3A,
-           &AArch64::ARMV8_4A,
-           &AArch64::ARMV8_5A,
-           &AArch64::ARMV8_6A,
-           &AArch64::ARMV8_7A,
-           &AArch64::ARMV8_8A,
-           &AArch64::ARMV8_9A,
-       })
-    EXPECT_TRUE(A->implies(AArch64::ARMV8A));
-
-  for (const auto *A : {&AArch64::ARMV9_1A, &AArch64::ARMV9_2A,
-                        &AArch64::ARMV9_3A, &AArch64::ARMV9_4A})
-    EXPECT_TRUE(A->implies(AArch64::ARMV9A));
-
-  EXPECT_TRUE(AArch64::ARMV8_1A.implies(AArch64::ARMV8A));
-  EXPECT_TRUE(AArch64::ARMV8_2A.implies(AArch64::ARMV8_1A));
-  EXPECT_TRUE(AArch64::ARMV8_3A.implies(AArch64::ARMV8_2A));
-  EXPECT_TRUE(AArch64::ARMV8_4A.implies(AArch64::ARMV8_3A));
-  EXPECT_TRUE(AArch64::ARMV8_5A.implies(AArch64::ARMV8_4A));
-  EXPECT_TRUE(AArch64::ARMV8_6A.implies(AArch64::ARMV8_5A));
-  EXPECT_TRUE(AArch64::ARMV8_7A.implies(AArch64::ARMV8_6A));
-  EXPECT_TRUE(AArch64::ARMV8_8A.implies(AArch64::ARMV8_7A));
-  EXPECT_TRUE(AArch64::ARMV8_9A.implies(AArch64::ARMV8_8A));
-
-  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV9A));
-  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV9_1A));
-  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV9_2A));
-  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV9_3A));
-
-  EXPECT_TRUE(AArch64::ARMV9A.implies(AArch64::ARMV8_5A));
-  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV8_6A));
-  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV8_7A));
-  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV8_8A));
-  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV8_9A));
-}
-
-TEST(TargetParserTest, AArch64ArchExtFeature) {
-  const char *ArchExt[][4] = {
-      {"crc", "nocrc", "+crc", "-crc"},
-      {"crypto", "nocrypto", "+crypto", "-crypto"},
-      {"flagm", "noflagm", "+flagm", "-flagm"},
-      {"fp", "nofp", "+fp-armv8", "-fp-armv8"},
-      {"simd", "nosimd", "+neon", "-neon"},
-      {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
-      {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
-      {"profile", "noprofile", "+spe", "-spe"},
-      {"ras", "noras", "+ras", "-ras"},
-      {"lse", "nolse", "+lse", "-lse"},
-      {"rdm", "nordm", "+rdm", "-rdm"},
-      {"sve", "nosve", "+sve", "-sve"},
-      {"sve2", "nosve2", "+sve2", "-sve2"},
-      {"sve2-aes", "nosve2-aes", "+sve2-aes", "-sve2-aes"},
-      {"sve2-sm4", "nosve2-sm4", "+sve2-sm4", "-sve2-sm4"},
-      {"sve2-sha3", "nosve2-sha3", "+sve2-sha3", "-sve2-sha3"},
-      {"sve2p1", "nosve2p1", "+sve2p1", "-sve2p1"},
-      {"b16b16", "nob16b16", "+b16b16", "-b16b16"},
-      {"sve2-bitperm", "nosve2-bitperm", "+sve2-bitperm", "-sve2-bitperm"},
-      {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
-      {"rcpc", "norcpc", "+rcpc", "-rcpc"},
-      {"rng", "norng", "+rand", "-rand"},
-      {"memtag", "nomemtag", "+mte", "-mte"},
-      {"tme", "notme", "+tme", "-tme"},
-      {"pauth", "nopauth", "+pauth", "-pauth"},
-      {"ssbs", "nossbs", "+ssbs", "-ssbs"},
-      {"sb", "nosb", "+sb", "-sb"},
-      {"predres", "nopredres", "+predres", "-predres"},
-      {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
-      {"f32mm", "nof32mm", "+f32mm", "-f32mm"},
-      {"f64mm", "nof64mm", "+f64mm", "-f64mm"},
-      {"sme", "nosme", "+sme", "-sme"},
-      {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"},
-      {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"},
-      {"sme-f16f16", "nosme-f16f16", "+sme-f16f16", "-sme-f16f16"},
-      {"sme2", "nosme2", "+sme2", "-sme2"},
-      {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"},
-      {"hbc", "nohbc", "+hbc", "-hbc"},
-      {"mops", "nomops", "+mops", "-mops"},
-      {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},
-      {"predres2", "nopredres2", "+specres2", "-specres2"},
-      {"rasv2", "norasv2", "+rasv2", "-rasv2"},
-      {"gcs", "nogcs", "+gcs", "-gcs"},
-  };
-
-  for (unsigned i = 0; i < std::size(ArchExt); i++) {
-    EXPECT_EQ(StringRef(ArchExt[i][2]),
-              AArch64::getArchExtFeature(ArchExt[i][0]));
-    EXPECT_EQ(StringRef(ArchExt[i][3]),
-              AArch64::getArchExtFeature(ArchExt[i][1]));
-  }
-}
-
-} // namespace
diff --git a/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
index c676e06d952978f..728ecf57c07b10a 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
@@ -10,7 +10,8 @@ unittest("TargetParserTests") {
   sources = [
     "CSKYTargetParserTest.cpp",
     "Host.cpp",
-    "TargetParserTest.cpp",
+    "ArmTargetParserTest.cpp",
+    "AArch64TargetParserTest.cpp",
     "TripleTest.cpp",
   ]
 }

>From b238387b033aabcd9ac84efa1000e546c57ca77d Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi <hassnaa.hamdi at arm.com>
Date: Thu, 7 Sep 2023 18:10:19 +0000
Subject: [PATCH 2/3] [AArch64]: Refactor target parser to use Bitset.

Use Bitset instead of BitMasking for the Architecture Extensions,
because the number of extensions will exceed the bitmask max size.

Change-Id: Id869744514ce89b9ecb50bac033b45eda4d8ceac
---
 clang/lib/Basic/Targets/AArch64.cpp           |    2 +-
 clang/lib/Driver/ToolChains/Arch/AArch64.cpp  |    2 +-
 .../llvm/TargetParser/AArch64TargetParser.h   |  315 +--
 llvm/lib/TargetParser/AArch64TargetParser.cpp |    2 +-
 .../TargetParser/AArch64TargetParserTest.cpp  |  965 ---------
 .../TargetParser/ArmTargetParserTest.cpp      |  965 ---------
 llvm/unittests/TargetParser/CMakeLists.txt    |    3 +-
 .../TargetParser/TargetParserTest.cpp         | 1845 +++++++++++++++++
 .../llvm/unittests/TargetParser/BUILD.gn      |    3 +-
 9 files changed, 2008 insertions(+), 2094 deletions(-)
 delete mode 100644 llvm/unittests/TargetParser/AArch64TargetParserTest.cpp
 delete mode 100644 llvm/unittests/TargetParser/ArmTargetParserTest.cpp
 create mode 100644 llvm/unittests/TargetParser/TargetParserTest.cpp

diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index 5956baaefea6954..78884b7dc1ff6fa 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -968,7 +968,7 @@ bool AArch64TargetInfo::initFeatureMap(
   // Parse the CPU and add any implied features.
   std::optional<llvm::AArch64::CpuInfo> CpuInfo = llvm::AArch64::parseCpu(CPU);
   if (CpuInfo) {
-    llvm::BitVector Exts = CpuInfo->getImpliedExtensions();
+    llvm::Bitset Exts = CpuInfo->getImpliedExtensions();
     std::vector<StringRef> CPUFeats;
     llvm::AArch64::getExtensionFeatures(Exts, CPUFeats);
     for (auto F : CPUFeats) {
diff --git a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
index 43b14ddca3010d8..19d454dd8bf3643 100644
--- a/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -158,7 +158,7 @@ static bool DecodeAArch64Mcpu(const Driver &D, StringRef Mcpu, StringRef &CPU,
 
     Features.push_back(ArchInfo->ArchFeature);
 
-    llvm::BitVector Extension = CpuInfo->getImpliedExtensions();
+    llvm::Bitset Extension = CpuInfo->getImpliedExtensions();
     if (!llvm::AArch64::getExtensionFeatures(Extension, Features))
       return false;
   }
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index ddaf60564add0aa..7b9c1eeb3aee25e 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -19,7 +19,7 @@
 #include "llvm/Support/VersionTuple.h"
 #include <array>
 #include <vector>
-#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/Bitset.h"
 
 namespace llvm {
 
@@ -97,7 +97,7 @@ static_assert(FEAT_MAX <= 64,
 // Arch extension modifiers for CPUs. These are labelled with their Arm ARM
 // feature name (though the canonical reference for those is AArch64.td)
 // clang-format off
-enum ArchExtKind : int {
+enum ArchExtKind : unsigned {
   AEK_NONE =          1,
   AEK_CRC =           2,  // FEAT_CRC32
   AEK_CRYPTO =        3,
@@ -155,7 +155,7 @@ enum ArchExtKind : int {
   AEK_RASv2 =         55, // FEAT_RASv2
   AEK_ITE =           56, // FEAT_ITE
   AEK_GCS =           57, // FEAT_GCS
-  AEK_EXTENTIONS_NUM =  58
+  AEK_EXTENTIONS_MAX =  64
 };
 // clang-format on
 
@@ -262,7 +262,7 @@ inline constexpr ExtensionInfo Extensions[] = {
     {"tme", AArch64::AEK_TME, "+tme", "-tme", FEAT_MAX, "", 0},
     {"wfxt", AArch64::AEK_NONE, {}, {}, FEAT_WFXT, "+wfxt", 550},
     {"gcs", AArch64::AEK_GCS, "+gcs", "-gcs", FEAT_MAX, "", 0},
-            // Special cases
+    // Special cases
     {"none", AArch64::AEK_NONE, {}, {}, FEAT_MAX, "", ExtensionInfo::MaxFMVPriority},
 };
 // clang-format on
@@ -275,7 +275,7 @@ struct ArchInfo {
   ArchProfile Profile;   // Architecuture profile
   StringRef Name;        // Human readable name, e.g. "armv8.1-a"
   StringRef ArchFeature; // Command line feature flag, e.g. +v8a
-  BitVector DefaultExts;  // bitfield of default extensions ArchExtKind
+  Bitset<AArch64::AEK_EXTENTIONS_MAX> DefaultExts;  // bitfield of default extensions ArchExtKind
 
   bool operator==(const ArchInfo &Other) const {
     return this->Name == Other.Name;
@@ -317,23 +317,23 @@ struct ArchInfo {
 };
 
 // clang-format off
-inline ArchInfo ARMV8A    = { VersionTuple{8, 0}, AProfile, "armv8-a", "+v8a", (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD)), };
-inline ArchInfo ARMV8_1A  = { VersionTuple{8, 1}, AProfile, "armv8.1-a", "+v8.1a", (BitVector(ARMV8A.DefaultExts).set(AArch64::AEK_CRC).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM))};
-inline ArchInfo ARMV8_2A  = { VersionTuple{8, 2}, AProfile, "armv8.2-a", "+v8.2a", (BitVector(ARMV8_1A.DefaultExts).set(AArch64::AEK_RAS))};
-inline ArchInfo ARMV8_3A  = { VersionTuple{8, 3}, AProfile, "armv8.3-a", "+v8.3a", (BitVector(ARMV8_2A.DefaultExts).set(AArch64::AEK_RCPC))};
-inline ArchInfo ARMV8_4A  = { VersionTuple{8, 4}, AProfile, "armv8.4-a", "+v8.4a", (BitVector(ARMV8_3A.DefaultExts).set(AArch64::AEK_DOTPROD))};
-inline ArchInfo ARMV8_5A  = { VersionTuple{8, 5}, AProfile, "armv8.5-a", "+v8.5a", (BitVector(ARMV8_4A.DefaultExts))};
-inline ArchInfo ARMV8_6A  = { VersionTuple{8, 6}, AProfile, "armv8.6-a", "+v8.6a", (BitVector(ARMV8_5A.DefaultExts).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))};
-inline ArchInfo ARMV8_7A  = { VersionTuple{8, 7}, AProfile, "armv8.7-a", "+v8.7a", (BitVector(ARMV8_6A.DefaultExts))};
-inline ArchInfo ARMV8_8A  = { VersionTuple{8, 8}, AProfile, "armv8.8-a", "+v8.8a", (BitVector(ARMV8_7A.DefaultExts).set(AArch64::AEK_MOPS).set(AArch64::AEK_HBC))};
-inline ArchInfo ARMV8_9A  = { VersionTuple{8, 9}, AProfile, "armv8.9-a", "+v8.9a", (BitVector(ARMV8_8A.DefaultExts).set(AArch64::AEK_SPECRES2).set(AArch64::AEK_CSSC).set(AArch64::AEK_RASv2))};
-inline ArchInfo ARMV9A    = { VersionTuple{9, 0}, AProfile, "armv9-a", "+v9a", (BitVector(ARMV8_5A.DefaultExts).set(AArch64::AEK_FP16).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2))};
-inline ArchInfo ARMV9_1A  = { VersionTuple{9, 1}, AProfile, "armv9.1-a", "+v9.1a", (BitVector(ARMV9A.DefaultExts).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))};
-inline ArchInfo ARMV9_2A  = { VersionTuple{9, 2}, AProfile, "armv9.2-a", "+v9.2a", (BitVector(ARMV9_1A.DefaultExts))};
-inline ArchInfo ARMV9_3A  = { VersionTuple{9, 3}, AProfile, "armv9.3-a", "+v9.3a", (BitVector(ARMV9_2A.DefaultExts).set(AArch64::AEK_MOPS).set(AArch64::AEK_HBC))};
-inline ArchInfo ARMV9_4A  = { VersionTuple{9, 4}, AProfile, "armv9.4-a", "+v9.4a", (BitVector(ARMV9_3A.DefaultExts).set(AArch64::AEK_SPECRES2).set(AArch64::AEK_CSSC).set(AArch64::AEK_RASv2))};
+inline constexpr ArchInfo ARMV8A    = { VersionTuple{8, 0}, AProfile, "armv8-a", "+v8a", (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_FP, AArch64::AEK_SIMD})), };
+inline constexpr ArchInfo ARMV8_1A  = { VersionTuple{8, 1}, AProfile, "armv8.1-a", "+v8.1a", (ARMV8A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({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 | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS}))};
+inline constexpr ArchInfo ARMV8_3A  = { VersionTuple{8, 3}, AProfile, "armv8.3-a", "+v8.3a", (ARMV8_2A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RCPC}))};
+inline constexpr ArchInfo ARMV8_4A  = { VersionTuple{8, 4}, AProfile, "armv8.4-a", "+v8.4a", (ARMV8_3A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_DOTPROD}))};
+inline constexpr ArchInfo ARMV8_5A  = { VersionTuple{8, 5}, AProfile, "armv8.5-a", "+v8.5a", (ARMV8_4A.DefaultExts)};
+inline constexpr ArchInfo ARMV8_6A  = { VersionTuple{8, 6}, AProfile, "armv8.6-a", "+v8.6a", (ARMV8_5A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({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 | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_MOPS, AArch64::AEK_HBC}))};
+inline constexpr ArchInfo ARMV8_9A  = { VersionTuple{8, 9}, AProfile, "armv8.9-a", "+v8.9a", (ARMV8_8A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_SPECRES2, AArch64::AEK_CSSC, AArch64::AEK_RASv2}))};
+inline constexpr ArchInfo ARMV9A    = { VersionTuple{9, 0}, AProfile, "armv9-a", "+v9a", (ARMV8_5A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({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 | Bitset<AArch64::AEK_EXTENTIONS_MAX>({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 | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_MOPS, AArch64::AEK_HBC}))};
+inline constexpr ArchInfo ARMV9_4A  = { VersionTuple{9, 4}, AProfile, "armv9.4-a", "+v9.4a", (ARMV9_3A.DefaultExts | Bitset<AArch64::AEK_EXTENTIONS_MAX>({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 ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", (BitVector(ARMV8_5A.DefaultExts).flip(AArch64::AEK_LSE).set(AArch64::AEK_SSBS).set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SB)), };
+inline constexpr ArchInfo ARMV8R    = { VersionTuple{8, 0}, RProfile, "armv8-r", "+v8r", (Bitset(ARMV8_5A.DefaultExts) | Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_SSBS, AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SB}).flip(AArch64::AEK_LSE))};
 // clang-format on
 
 // The set of all architectures
@@ -347,205 +347,206 @@ static constexpr std::array<const ArchInfo *, 16> ArchInfos = {
 struct CpuInfo {
   StringRef Name; // Name, as written for -mcpu.
   const ArchInfo &Arch;
-  BitVector DefaultExtensions; // Default extensions for this CPU. These will be
+  Bitset<AArch64::AEK_EXTENTIONS_MAX> DefaultExtensions; // Default extensions for this CPU. These will be
                               // ORd with the architecture defaults.
 
-  BitVector getImpliedExtensions() const {
-    BitVector ImpliedExts(DefaultExtensions);
+  Bitset<AArch64::AEK_EXTENTIONS_MAX> getImpliedExtensions() const {
+    Bitset<AArch64::AEK_EXTENTIONS_MAX> ImpliedExts;
+    ImpliedExts |= DefaultExtensions;
     ImpliedExts |= Arch.DefaultExts;
     return ImpliedExts;
   }
 };
 
-inline CpuInfo CpuInfos[] = {
+inline constexpr CpuInfo CpuInfos[] = {
     {"cortex-a34", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a35", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a53", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a55", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC}))},
     {"cortex-a510", ARMV9A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM).set(AArch64::AEK_SB).
-      set(AArch64::AEK_PAUTH).set(AArch64::AEK_MTE).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-      set(AArch64::AEK_FP16FML))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a65", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a65ae", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a72", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a73", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a75", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC}))},
     {"cortex-a76", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a76ae", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a77", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_SSBS}))},
     {"cortex-a78", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_PROFILE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+      AArch64::AEK_PROFILE}))},
     {"cortex-a78c", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_PROFILE).set(AArch64::AEK_FLAGM).set(AArch64::AEK_PAUTH).
-      set(AArch64::AEK_FP16FML))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, 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,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_FLAGM).
-      set(AArch64::AEK_SB).set(AArch64::AEK_I8MM).set(AArch64::AEK_FP16FML).
-      set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-      set(AArch64::AEK_BF16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_FLAGM,
+      AArch64::AEK_SB, AArch64::AEK_I8MM, AArch64::AEK_FP16FML,
+      AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+      AArch64::AEK_BF16}))},
     {"cortex-a715", ARMV9A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_SB).set(AArch64::AEK_SSBS).set(AArch64::AEK_MTE).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_PAUTH).
-      set(AArch64::AEK_I8MM).set(AArch64::AEK_PREDRES).set(AArch64::AEK_PERFMON).
-      set(AArch64::AEK_PROFILE).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2BITPERM).
-      set(AArch64::AEK_BF16).set(AArch64::AEK_FLAGM))},
-    {"cortex-r82", ARMV8R, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_LSE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_SB, AArch64::AEK_SSBS, AArch64::AEK_MTE,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PAUTH,
+      AArch64::AEK_I8MM, AArch64::AEK_PREDRES, AArch64::AEK_PERFMON,
+      AArch64::AEK_PROFILE, AArch64::AEK_SVE, AArch64::AEK_SVE2BITPERM,
+      AArch64::AEK_BF16, AArch64::AEK_FLAGM}))},
+    {"cortex-r82", ARMV8R, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_LSE}))},
     {"cortex-x1", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_PROFILE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+      AArch64::AEK_PROFILE}))},
     {"cortex-x1c", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_PAUTH).set(AArch64::AEK_PROFILE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+      AArch64::AEK_PAUTH, AArch64::AEK_PROFILE}))},
     {"cortex-x2", ARMV9A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_MTE).set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM).
-      set(AArch64::AEK_PAUTH).set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).
-      set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-      set(AArch64::AEK_FP16FML))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_MTE, AArch64::AEK_BF16, AArch64::AEK_I8MM,
+      AArch64::AEK_PAUTH, AArch64::AEK_SSBS, AArch64::AEK_SB,
+      AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+      AArch64::AEK_FP16FML}))},
     {"cortex-x3", ARMV9A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_SVE).set(AArch64::AEK_PERFMON).set(AArch64::AEK_PROFILE).
-      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM).set(AArch64::AEK_MTE).
-      set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SB).set(AArch64::AEK_PAUTH).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_PREDRES).
-      set(AArch64::AEK_FLAGM).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_SVE, AArch64::AEK_PERFMON, AArch64::AEK_PROFILE,
+      AArch64::AEK_BF16, AArch64::AEK_I8MM, AArch64::AEK_MTE,
+      AArch64::AEK_SVE2BITPERM, AArch64::AEK_SB, AArch64::AEK_PAUTH,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PREDRES,
+      AArch64::AEK_FLAGM, AArch64::AEK_SSBS}))},
     {"neoverse-e1", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"neoverse-n1", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_PROFILE).set(AArch64::AEK_RCPC).
-      set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16, AArch64::AEK_PROFILE, AArch64::AEK_RCPC,
+      AArch64::AEK_SSBS}))},
     {"neoverse-n2", ARMV8_5A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_SM4).set(AArch64::AEK_BF16).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_I8MM).set(AArch64::AEK_MTE).
-      set(AArch64::AEK_SB).set(AArch64::AEK_SSBS).set(AArch64::AEK_SVE).
-      set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_SM4, 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,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_SM4).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).set(AArch64::AEK_FP16FML).
-      set(AArch64::AEK_I8MM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_SM4, 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,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_SM4).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).set(AArch64::AEK_FP16FML).
-      set(AArch64::AEK_I8MM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_SM4, 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,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).set(AArch64::AEK_RAND).
-      set(AArch64::AEK_DOTPROD).set(AArch64::AEK_PROFILE).set(AArch64::AEK_SVE2BITPERM).
-      set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM).set(AArch64::AEK_MTE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a7", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a8", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a9", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_NONE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a10", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC).
-      set(AArch64::AEK_RDM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC,
+      AArch64::AEK_RDM}))},
     {"apple-a11", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"apple-a12", ARMV8_3A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"apple-a13", ARMV8_4A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
     {"apple-a14", ARMV8_5A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
     {"apple-a15", ARMV8_5A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+      AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
     {"apple-a16", ARMV8_5A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+      AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
     {"apple-m1", ARMV8_5A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
     {"apple-m2", ARMV8_5A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+      AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
     {"apple-s4", ARMV8_3A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"apple-s5", ARMV8_3A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"exynos-m3", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"exynos-m4", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16}))},
     {"exynos-m5", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16}))},
     {"falkor", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC).
-      set(AArch64::AEK_RDM))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC,
+      AArch64::AEK_RDM}))},
     {"saphira", ARMV8_3A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_PROFILE))},
-    {"kryo", ARMV8A, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
-    {"thunderx2t99", ARMV8_1A, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2))},
-    {"thunderx3t110", ARMV8_3A, (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_PROFILE}))},
+    {"kryo", ARMV8A, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+    {"thunderx2t99", ARMV8_1A, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2}))},
+    {"thunderx3t110", ARMV8_3A, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2}))},
     {"thunderx", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"thunderxt88", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"thunderxt81", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"thunderxt83", ARMV8A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_CRC))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"tsv110", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_PROFILE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PROFILE}))},
     {"a64fx", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16).
-      set(AArch64::AEK_SVE))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+      AArch64::AEK_SVE}))},
     {"carmel", ARMV8_2A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_FP16))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"ampere1", ARMV8_6A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-      set(AArch64::AEK_FP16).set(AArch64::AEK_SB).set(AArch64::AEK_SSBS).
-      set(AArch64::AEK_RAND))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+      AArch64::AEK_FP16, AArch64::AEK_SB, AArch64::AEK_SSBS,
+      AArch64::AEK_RAND}))},
     {"ampere1a", ARMV8_6A,
-     (BitVector(AEK_EXTENTIONS_NUM).set(AArch64::AEK_FP16).set(AArch64::AEK_RAND).set(AArch64::AEK_SM4).
-      set(AArch64::AEK_SHA3).set(AArch64::AEK_SHA2).set(AArch64::AEK_AES).
-      set(AArch64::AEK_MTE).set(AArch64::AEK_SB).set(AArch64::AEK_SSBS))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_FP16, AArch64::AEK_RAND, AArch64::AEK_SM4,
+      AArch64::AEK_SHA3, AArch64::AEK_SHA2, AArch64::AEK_AES,
+      AArch64::AEK_MTE, AArch64::AEK_SB, AArch64::AEK_SSBS}))},
 };
 
 // An alias for a CPU.
@@ -556,7 +557,7 @@ struct CpuAlias {
 
 inline constexpr CpuAlias CpuAliases[] = {{"grace", "neoverse-v2"}};
 
-bool getExtensionFeatures(BitVector Extensions,
+bool getExtensionFeatures(Bitset<AArch64::AEK_EXTENTIONS_MAX> Extensions,
                           std::vector<StringRef> &Features);
 
 StringRef getArchExtFeature(StringRef ArchExt);
diff --git a/llvm/lib/TargetParser/AArch64TargetParser.cpp b/llvm/lib/TargetParser/AArch64TargetParser.cpp
index be78153aa3a55b9..b36922c6e323a9a 100644
--- a/llvm/lib/TargetParser/AArch64TargetParser.cpp
+++ b/llvm/lib/TargetParser/AArch64TargetParser.cpp
@@ -54,7 +54,7 @@ uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs) {
   return FeaturesMask;
 }
 
-bool AArch64::getExtensionFeatures(BitVector InputExts,
+bool AArch64::getExtensionFeatures(Bitset<AArch64::AEK_EXTENTIONS_MAX> InputExts,
                                    std::vector<StringRef> &Features) {
   for (const auto &E : Extensions)
     /* INVALID and NONE have no feature name. */
diff --git a/llvm/unittests/TargetParser/AArch64TargetParserTest.cpp b/llvm/unittests/TargetParser/AArch64TargetParserTest.cpp
deleted file mode 100644
index 89c6295d91a84d4..000000000000000
--- a/llvm/unittests/TargetParser/AArch64TargetParserTest.cpp
+++ /dev/null
@@ -1,965 +0,0 @@
-//===----------- TargetParser.cpp - Target Parser -------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/TargetParser/TargetParser.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/ARMBuildAttributes.h"
-#include "llvm/Support/FormatVariadic.h"
-#include "llvm/TargetParser/AArch64TargetParser.h"
-#include "llvm/TargetParser/ARMTargetParser.h"
-#include "llvm/TargetParser/ARMTargetParserCommon.h"
-#include "llvm/TargetParser/Triple.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include <optional>
-#include <string>
-
-using namespace llvm;
-
-namespace {
-const char *AArch64Arch[] = {
-    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
-    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
-    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
-    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
-    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
-    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
-    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
-    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
-    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
-    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
-    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
-    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
-    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
-    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
-    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
-    "armv9.4a",
-};
-
-std::string FormatExtensionFlags(BitVector Flags) {
-  std::vector<StringRef> Features;
-
-  // AEK_NONE is not meant to be shown to the user so the target parser
-  // does not recognise it. It is relevant here though.
-  if (Flags.test(AArch64::AEK_NONE))
-    Features.push_back("none");
-  AArch64::getExtensionFeatures(Flags, Features);
-
-  // The target parser also includes every extension you don't have.
-  // E.g. if AEK_CRC is not set then it adds "-crc". Not useful here.
-  Features.erase(std::remove_if(Features.begin(), Features.end(),
-                                [](StringRef extension) {
-                                  return extension.startswith("-");
-                                }),
-                 Features.end());
-
-  return llvm::join(Features, ", ");
-}
-
-std::string SerializeExtensionFlags(BitVector Flags) {
-  std::string SerializedFlags;
-
-  for(unsigned int i = 0; i < Flags.size(); i ++)
-    SerializedFlags += (int)Flags[i];
-  return SerializedFlags;
-}
-
-struct AssertSameExtensionFlags {
-  AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
-
-  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
-                                      BitVector ExpectedFlags,
-                                      BitVector GotFlags) {
-    if (ExpectedFlags == GotFlags)
-      return testing::AssertionSuccess();
-
-    return testing::AssertionFailure() << llvm::formatv(
-               "CPU: {4}\n"
-               "Expected extension flags: {0} ({1:x})\n"
-               "     Got extension flags: {2} ({3:x})\n",
-               FormatExtensionFlags(ExpectedFlags), SerializeExtensionFlags(ExpectedFlags),
-               FormatExtensionFlags(GotFlags), SerializeExtensionFlags(GotFlags), CPUName);
-  }
-
-private:
-  StringRef CPUName;
-};
-
-struct AArch64CPUTestParams {
-  AArch64CPUTestParams(StringRef CPUName, StringRef ExpectedArch,
-                   StringRef ExpectedFPU, BitVector ExpectedFlags,
-                   StringRef CPUAttr)
-      : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
-        ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
-
-  friend std::ostream &operator<<(std::ostream &os,
-                                  const AArch64CPUTestParams &params) {
-    return os << "\"" << params.CPUName.str() << "\", \""
-              << params.ExpectedArch.str() << "\", \""
-              << params.ExpectedFPU.str() << "\", 0x" << std::hex
-              << SerializeExtensionFlags(params.ExpectedFlags) << ", \"" << params.CPUAttr.str() << "\"";
-  }
-
-  StringRef CPUName;
-  StringRef ExpectedArch;
-  StringRef ExpectedFPU;
-  BitVector ExpectedFlags;
-  StringRef CPUAttr;
-};
-
-class CPUTestFixture
-    : public ::testing::TestWithParam<AArch64CPUTestParams> {};
-
-TEST_P(CPUTestFixture, testAArch64CPU) {
-  AArch64CPUTestParams params = GetParam();
-
-  const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
-  EXPECT_TRUE(Cpu);
-  EXPECT_EQ(params.ExpectedArch, Cpu->Arch.Name);
-
-  EXPECT_PRED_FORMAT2(
-      AssertSameExtensionFlags(params.CPUName),
-      params.ExpectedFlags, Cpu->getImpliedExtensions());
-}
-
-INSTANTIATE_TEST_SUITE_P(
-    AArch64CPUTests, CPUTestFixture,
-    ::testing::Values(
-        AArch64CPUTestParams("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC)),
-                         "8.2-A"),
-        AArch64CPUTestParams(
-            "cortex-a510", "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_I8MM).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
-                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_PAUTH).
-                set(AArch64::AEK_MTE).set(AArch64::AEK_SSBS).set(AArch64::AEK_FP16).
-                set(AArch64::AEK_FP16FML).set(AArch64::AEK_SB)),
-            "9-A"),
-        AArch64CPUTestParams("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_PROFILE)),
-                         "8.2-A"),
-        AArch64CPUTestParams(
-            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_PROFILE).set(AArch64::AEK_FLAGM).
-                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FP16FML)),
-            "8.2-A"),
-        AArch64CPUTestParams(
-            "cortex-a710", "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_MTE).
-                set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SVE).
-                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SB).
-                set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16)),
-            "9-A"),
-        AArch64CPUTestParams(
-            "cortex-a715", "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
-                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_I8MM).
-                set(AArch64::AEK_PERFMON).set(AArch64::AEK_PREDRES).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16FML).
-                set(AArch64::AEK_FP16).set(AArch64::AEK_FLAGM)),
-            "9-A"),
-        AArch64CPUTestParams(
-            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
-                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
-            "8.4-A"),
-        AArch64CPUTestParams("neoverse-v2", "armv9-a", "neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).
-                             set(AArch64::AEK_SSBS).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_MTE).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
-                             set(AArch64::AEK_SVE2).set(AArch64::AEK_PROFILE).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM).
-                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_RAND)),
-                         "9-A"),
-        AArch64CPUTestParams("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SSBS).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_SB)),
-                         "8-R"),
-        AArch64CPUTestParams("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_PROFILE)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_PAUTH).set(AArch64::AEK_PROFILE)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-x2", "armv9-a", "neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).
-                             set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16).
-                             set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
-                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_SB).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML)),
-                         "9-A"),
-        AArch64CPUTestParams(
-            "cortex-x3",
-            "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
-                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SB).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_PERFMON).
-                set(AArch64::AEK_I8MM).set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
-                set(AArch64::AEK_PREDRES).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SSBS)),
-            "9-A"),
-        AArch64CPUTestParams("cyclone", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP16)),
-                         "8.2-A"),
-        AArch64CPUTestParams("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
-                         "8.3-A"),
-        AArch64CPUTestParams("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
-                         "8.4-A"),
-        AArch64CPUTestParams("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
-                         "8.3-A"),
-        AArch64CPUTestParams("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
-                         "8.3-A"),
-        AArch64CPUTestParams("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
-                         "8.2-A"),
-        AArch64CPUTestParams("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
-                         "8.2-A"),
-        AArch64CPUTestParams("falkor", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RDM)),
-                         "8-A"),
-        AArch64CPUTestParams("kryo", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_PROFILE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams(
-            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).
-                set(AArch64::AEK_SHA3).set(AArch64::AEK_SM4).set(AArch64::AEK_FP).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).set(AArch64::AEK_RAS).
-                set(AArch64::AEK_LSE).set(AArch64::AEK_SVE).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).set(AArch64::AEK_MTE).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_SVE2).
-                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_I8MM)),
-            "8.5-A"),
-        AArch64CPUTestParams(
-            "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).set(AArch64::AEK_SHA2).
-                set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).set(AArch64::AEK_SSBS).
-                set(AArch64::AEK_SB).set(AArch64::AEK_RAND)),
-            "8.6-A"),
-        AArch64CPUTestParams(
-            "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_SM4).set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_SHA2).set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_RAND).
-                set(AArch64::AEK_MTE)),
-            "8.6-A"),
-        AArch64CPUTestParams(
-            "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
-                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
-            "8.4-A"),
-        AArch64CPUTestParams("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8.1-A"),
-        AArch64CPUTestParams("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC)),
-                         "8.3-A"),
-        AArch64CPUTestParams("thunderx", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_DOTPROD)),
-                         "8.2-A"),
-        AArch64CPUTestParams("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_SVE).set(AArch64::AEK_RDM)),
-                         "8.2-A"),
-        AArch64CPUTestParams("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RDM)),
-                         "8.2-A")));
-
-// Note: number of CPUs includes aliases.
-static constexpr unsigned NumAArch64CPUArchs = 62;
-
-TEST(TargetParserTest, testAArch64CPUArchList) {
-  SmallVector<StringRef, NumAArch64CPUArchs> List;
-  AArch64::fillValidCPUArchList(List);
-
-  // No list exists for these in this test suite, so ensure all are
-  // valid, and match the expected 'magic' count.
-  EXPECT_EQ(List.size(), NumAArch64CPUArchs);
-  for(StringRef CPU : List) {
-    EXPECT_TRUE(AArch64::parseCpu(CPU));
-  }
-}
-
-bool testAArch64Arch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
-                     unsigned ArchAttr) {
-  const std::optional<AArch64::ArchInfo> AI = AArch64::parseArch(Arch);
-  return AI.has_value();
-}
-
-TEST(TargetParserTest, testAArch64Arch) {
-  EXPECT_TRUE(testAArch64Arch("armv8-a", "cortex-a53", "v8a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.1-a", "generic", "v8.1a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.2-a", "generic", "v8.2a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.3-a", "generic", "v8.3a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.4-a", "generic", "v8.4a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.5-a", "generic", "v8.5a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.6-a", "generic", "v8.6a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.7-a", "generic", "v8.7a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.8-a", "generic", "v8.8a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.9-a", "generic", "v8.9a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9-a", "generic", "v9a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.1-a", "generic", "v9.1a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.2-a", "generic", "v9.2a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.3-a", "generic", "v9.3a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.4-a", "generic", "v9.4a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-}
-
-bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {
-  std::optional<AArch64::ExtensionInfo> Extension =
-      AArch64::parseArchExtension(ArchExt);
-  if (!Extension)
-    return false;
-  std::optional<AArch64::CpuInfo> CpuInfo = AArch64::parseCpu(CPUName);
-  return CpuInfo->getImpliedExtensions().test(Extension->ID);
-}
-
-bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {
-  std::optional<AArch64::ExtensionInfo> Extension =
-      AArch64::parseArchExtension(ArchExt);
-  if (!Extension)
-    return false;
-  return AI.DefaultExts.test(Extension->ID);
-}
-
-TEST(TargetParserTest, testAArch64Extension) {
-  EXPECT_FALSE(testAArch64Extension("cortex-a34", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a35", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a53", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a55", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "dotprod"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a57", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a72", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a73", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a75", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "lse"));
-  EXPECT_FALSE(testAArch64Extension("cyclone", "ras"));
-  EXPECT_FALSE(testAArch64Extension("exynos-m3", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "lse"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "lse"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("falkor", "rdm"));
-  EXPECT_FALSE(testAArch64Extension("kryo", "ras"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "crc"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "lse"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "ras"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "rcpc"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "profile"));
-  EXPECT_FALSE(testAArch64Extension("saphira", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("thunderx2t99", "ras"));
-  EXPECT_FALSE(testAArch64Extension("thunderx", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt81", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt83", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt88", "lse"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "aes"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "sha2"));
-  EXPECT_FALSE(testAArch64Extension("tsv110", "sha3"));
-  EXPECT_FALSE(testAArch64Extension("tsv110", "sm4"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "ras"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "profile"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("a64fx", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("a64fx", "sve"));
-  EXPECT_FALSE(testAArch64Extension("a64fx", "sve2"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "aes"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "sha2"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "fp16"));
-
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8A, "ras"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_1A, "ras"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "profile"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16fml"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16fml"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16fml"));
-}
-
-TEST(TargetParserTest, AArch64ExtensionFeatures) {
-  std::vector<uint64_t> Extensions = {
-      AArch64::AEK_CRC,           AArch64::AEK_LSE,           AArch64::AEK_RDM,
-      AArch64::AEK_CRYPTO,        AArch64::AEK_SM4,           AArch64::AEK_SHA3,
-      AArch64::AEK_SHA2,          AArch64::AEK_AES,           AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP,            AArch64::AEK_SIMD,          AArch64::AEK_FP16,
-      AArch64::AEK_FP16FML,       AArch64::AEK_PROFILE,       AArch64::AEK_RAS,
-      AArch64::AEK_SVE,           AArch64::AEK_SVE2,          AArch64::AEK_SVE2AES,
-      AArch64::AEK_SVE2SM4,       AArch64::AEK_SVE2SHA3,      AArch64::AEK_SVE2BITPERM,
-      AArch64::AEK_RCPC,          AArch64::AEK_RAND,          AArch64::AEK_MTE,
-      AArch64::AEK_SSBS,          AArch64::AEK_SB,            AArch64::AEK_PREDRES,
-      AArch64::AEK_BF16,          AArch64::AEK_I8MM,          AArch64::AEK_F32MM,
-      AArch64::AEK_F64MM,         AArch64::AEK_TME,           AArch64::AEK_LS64,
-      AArch64::AEK_BRBE,          AArch64::AEK_PAUTH,         AArch64::AEK_FLAGM,
-      AArch64::AEK_SME,           AArch64::AEK_SMEF64F64,     AArch64::AEK_SMEI16I64,
-      AArch64::AEK_SME2,          AArch64::AEK_HBC,           AArch64::AEK_MOPS,
-      AArch64::AEK_PERFMON,       AArch64::AEK_SVE2p1,        AArch64::AEK_SME2p1,
-      AArch64::AEK_B16B16,        AArch64::AEK_SMEF16F16,     AArch64::AEK_CSSC,
-      AArch64::AEK_RCPC3,         AArch64::AEK_THE,           AArch64::AEK_D128,
-      AArch64::AEK_LSE128,        AArch64::AEK_SPECRES2,      AArch64::AEK_RASv2,
-      AArch64::AEK_ITE,           AArch64::AEK_GCS,
-  };
-
-  std::vector<StringRef> Features;
-
-  BitVector ExtVal(AArch64::AEK_EXTENTIONS_NUM);
-  for (auto Ext : Extensions)
-    ExtVal.set(Ext);
-
-  // NONE has no feature names.
-  // We return True here because NONE is a valid choice.
-  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE), Features));
-  EXPECT_TRUE(!Features.size());
-
-  AArch64::getExtensionFeatures(ExtVal, Features);
-  EXPECT_EQ(Extensions.size(), Features.size());
-
-  EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2p1"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+b16b16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+f64mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+tme"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ls64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+brbe"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+hbc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+mops"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+perfmon"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+cssc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+the"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+gcs"));
-
-  // Assuming we listed every extension above, this should produce the same
-  // result. (note that AEK_NONE doesn't have a name so it won't be in the
-  // result despite its bit being set)
-  std::vector<StringRef> AllFeatures;
-  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM, true), AllFeatures));
-  EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
-}
-
-TEST(TargetParserTest, AArch64ArchFeatures) {
-  EXPECT_EQ(AArch64::ARMV8A.ArchFeature, "+v8a");
-  EXPECT_EQ(AArch64::ARMV8_1A.ArchFeature, "+v8.1a");
-  EXPECT_EQ(AArch64::ARMV8_2A.ArchFeature, "+v8.2a");
-  EXPECT_EQ(AArch64::ARMV8_3A.ArchFeature, "+v8.3a");
-  EXPECT_EQ(AArch64::ARMV8_4A.ArchFeature, "+v8.4a");
-  EXPECT_EQ(AArch64::ARMV8_5A.ArchFeature, "+v8.5a");
-  EXPECT_EQ(AArch64::ARMV8_6A.ArchFeature, "+v8.6a");
-  EXPECT_EQ(AArch64::ARMV8_7A.ArchFeature, "+v8.7a");
-  EXPECT_EQ(AArch64::ARMV8_8A.ArchFeature, "+v8.8a");
-  EXPECT_EQ(AArch64::ARMV8_9A.ArchFeature, "+v8.9a");
-  EXPECT_EQ(AArch64::ARMV9A.ArchFeature, "+v9a");
-  EXPECT_EQ(AArch64::ARMV9_1A.ArchFeature, "+v9.1a");
-  EXPECT_EQ(AArch64::ARMV9_2A.ArchFeature, "+v9.2a");
-  EXPECT_EQ(AArch64::ARMV9_3A.ArchFeature, "+v9.3a");
-  EXPECT_EQ(AArch64::ARMV9_4A.ArchFeature, "+v9.4a");
-  EXPECT_EQ(AArch64::ARMV8R.ArchFeature, "+v8r");
-}
-
-TEST(TargetParserTest, AArch64ArchPartialOrder) {
-  for (const auto *A : AArch64::ArchInfos) {
-    EXPECT_EQ(*A, *A);
-
-    // v8r has no relation to other valid architectures
-    if (*A != AArch64::ARMV8R) {
-      EXPECT_FALSE(A->implies(AArch64::ARMV8R));
-      EXPECT_FALSE(AArch64::ARMV8R.implies(*A));
-    }
-  }
-
-  for (const auto *A : {
-           &AArch64::ARMV8_1A,
-           &AArch64::ARMV8_2A,
-           &AArch64::ARMV8_3A,
-           &AArch64::ARMV8_4A,
-           &AArch64::ARMV8_5A,
-           &AArch64::ARMV8_6A,
-           &AArch64::ARMV8_7A,
-           &AArch64::ARMV8_8A,
-           &AArch64::ARMV8_9A,
-       })
-    EXPECT_TRUE(A->implies(AArch64::ARMV8A));
-
-  for (const auto *A : {&AArch64::ARMV9_1A, &AArch64::ARMV9_2A,
-                        &AArch64::ARMV9_3A, &AArch64::ARMV9_4A})
-    EXPECT_TRUE(A->implies(AArch64::ARMV9A));
-
-  EXPECT_TRUE(AArch64::ARMV8_1A.implies(AArch64::ARMV8A));
-  EXPECT_TRUE(AArch64::ARMV8_2A.implies(AArch64::ARMV8_1A));
-  EXPECT_TRUE(AArch64::ARMV8_3A.implies(AArch64::ARMV8_2A));
-  EXPECT_TRUE(AArch64::ARMV8_4A.implies(AArch64::ARMV8_3A));
-  EXPECT_TRUE(AArch64::ARMV8_5A.implies(AArch64::ARMV8_4A));
-  EXPECT_TRUE(AArch64::ARMV8_6A.implies(AArch64::ARMV8_5A));
-  EXPECT_TRUE(AArch64::ARMV8_7A.implies(AArch64::ARMV8_6A));
-  EXPECT_TRUE(AArch64::ARMV8_8A.implies(AArch64::ARMV8_7A));
-  EXPECT_TRUE(AArch64::ARMV8_9A.implies(AArch64::ARMV8_8A));
-
-  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV9A));
-  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV9_1A));
-  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV9_2A));
-  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV9_3A));
-
-  EXPECT_TRUE(AArch64::ARMV9A.implies(AArch64::ARMV8_5A));
-  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV8_6A));
-  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV8_7A));
-  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV8_8A));
-  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV8_9A));
-}
-
-TEST(TargetParserTest, AArch64ArchExtFeature) {
-  const char *ArchExt[][4] = {
-      {"crc", "nocrc", "+crc", "-crc"},
-      {"crypto", "nocrypto", "+crypto", "-crypto"},
-      {"flagm", "noflagm", "+flagm", "-flagm"},
-      {"fp", "nofp", "+fp-armv8", "-fp-armv8"},
-      {"simd", "nosimd", "+neon", "-neon"},
-      {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
-      {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
-      {"profile", "noprofile", "+spe", "-spe"},
-      {"ras", "noras", "+ras", "-ras"},
-      {"lse", "nolse", "+lse", "-lse"},
-      {"rdm", "nordm", "+rdm", "-rdm"},
-      {"sve", "nosve", "+sve", "-sve"},
-      {"sve2", "nosve2", "+sve2", "-sve2"},
-      {"sve2-aes", "nosve2-aes", "+sve2-aes", "-sve2-aes"},
-      {"sve2-sm4", "nosve2-sm4", "+sve2-sm4", "-sve2-sm4"},
-      {"sve2-sha3", "nosve2-sha3", "+sve2-sha3", "-sve2-sha3"},
-      {"sve2p1", "nosve2p1", "+sve2p1", "-sve2p1"},
-      {"b16b16", "nob16b16", "+b16b16", "-b16b16"},
-      {"sve2-bitperm", "nosve2-bitperm", "+sve2-bitperm", "-sve2-bitperm"},
-      {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
-      {"rcpc", "norcpc", "+rcpc", "-rcpc"},
-      {"rng", "norng", "+rand", "-rand"},
-      {"memtag", "nomemtag", "+mte", "-mte"},
-      {"tme", "notme", "+tme", "-tme"},
-      {"pauth", "nopauth", "+pauth", "-pauth"},
-      {"ssbs", "nossbs", "+ssbs", "-ssbs"},
-      {"sb", "nosb", "+sb", "-sb"},
-      {"predres", "nopredres", "+predres", "-predres"},
-      {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
-      {"f32mm", "nof32mm", "+f32mm", "-f32mm"},
-      {"f64mm", "nof64mm", "+f64mm", "-f64mm"},
-      {"sme", "nosme", "+sme", "-sme"},
-      {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"},
-      {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"},
-      {"sme-f16f16", "nosme-f16f16", "+sme-f16f16", "-sme-f16f16"},
-      {"sme2", "nosme2", "+sme2", "-sme2"},
-      {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"},
-      {"hbc", "nohbc", "+hbc", "-hbc"},
-      {"mops", "nomops", "+mops", "-mops"},
-      {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},
-      {"predres2", "nopredres2", "+specres2", "-specres2"},
-      {"rasv2", "norasv2", "+rasv2", "-rasv2"},
-      {"gcs", "nogcs", "+gcs", "-gcs"},
-  };
-
-  for (unsigned i = 0; i < std::size(ArchExt); i++) {
-    EXPECT_EQ(StringRef(ArchExt[i][2]),
-              AArch64::getArchExtFeature(ArchExt[i][0]));
-    EXPECT_EQ(StringRef(ArchExt[i][3]),
-              AArch64::getArchExtFeature(ArchExt[i][1]));
-  }
-}
-
-} // namespace
diff --git a/llvm/unittests/TargetParser/ArmTargetParserTest.cpp b/llvm/unittests/TargetParser/ArmTargetParserTest.cpp
deleted file mode 100644
index 52611022cd7ffb6..000000000000000
--- a/llvm/unittests/TargetParser/ArmTargetParserTest.cpp
+++ /dev/null
@@ -1,965 +0,0 @@
-//===----------- TargetParser.cpp - Target Parser -------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/TargetParser/TargetParser.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/ARMBuildAttributes.h"
-#include "llvm/Support/FormatVariadic.h"
-#include "llvm/TargetParser/AArch64TargetParser.h"
-#include "llvm/TargetParser/ARMTargetParser.h"
-#include "llvm/TargetParser/ARMTargetParserCommon.h"
-#include "llvm/TargetParser/Triple.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include <optional>
-#include <string>
-
-using namespace llvm;
-
-namespace {
-const char *AArch64Arch[] = {
-    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
-    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
-    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
-    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
-    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
-    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
-    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
-    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
-    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
-    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
-    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
-    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
-    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
-    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
-    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
-    "armv9.4a",
-};
-
-std::string FormatExtensionFlags(BitVector Flags) {
-  std::vector<StringRef> Features;
-
-  // AEK_NONE is not meant to be shown to the user so the target parser
-  // does not recognise it. It is relevant here though.
-  if (Flags.test(AArch64::AEK_NONE))
-    Features.push_back("none");
-  AArch64::getExtensionFeatures(Flags, Features);
-
-  // The target parser also includes every extension you don't have.
-  // E.g. if AEK_CRC is not set then it adds "-crc". Not useful here.
-  Features.erase(std::remove_if(Features.begin(), Features.end(),
-                                [](StringRef extension) {
-                                  return extension.startswith("-");
-                                }),
-                 Features.end());
-
-  return llvm::join(Features, ", ");
-}
-
-std::string SerializeExtensionFlags(BitVector Flags) {
-  std::string SerializedFlags;
-
-  for(int i = 0; i < Flags.size(); i ++)
-    SerializedFlags += (int)Flags[i];
-  return SerializedFlags;
-}
-
-struct AssertSameExtensionFlags {
-  AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
-
-  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
-                                      BitVector ExpectedFlags,
-                                      BitVector GotFlags) {
-    if (ExpectedFlags == GotFlags)
-      return testing::AssertionSuccess();
-
-    return testing::AssertionFailure() << llvm::formatv(
-               "CPU: {4}\n"
-               "Expected extension flags: {0} ({1:x})\n"
-               "     Got extension flags: {2} ({3:x})\n",
-               FormatExtensionFlags(ExpectedFlags), SerializeExtensionFlags(ExpectedFlags),
-               FormatExtensionFlags(GotFlags), SerializeExtensionFlags(GotFlags), CPUName);
-  }
-
-private:
-  StringRef CPUName;
-};
-
-struct AArch64CPUTestParams {
-  AArch64CPUTestParams(StringRef CPUName, StringRef ExpectedArch,
-                   StringRef ExpectedFPU, BitVector ExpectedFlags,
-                   StringRef CPUAttr)
-      : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
-        ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
-
-  friend std::ostream &operator<<(std::ostream &os,
-                                  const AArch64CPUTestParams &params) {
-    return os << "\"" << params.CPUName.str() << "\", \""
-              << params.ExpectedArch.str() << "\", \""
-              << params.ExpectedFPU.str() << "\", 0x" << std::hex
-              << SerializeExtensionFlags(params.ExpectedFlags) << ", \"" << params.CPUAttr.str() << "\"";
-  }
-
-  StringRef CPUName;
-  StringRef ExpectedArch;
-  StringRef ExpectedFPU;
-  BitVector ExpectedFlags;
-  StringRef CPUAttr;
-};
-
-class AArch64CPUTestFixture
-    : public ::testing::TestWithParam<AArch64CPUTestParams> {};
-
-TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
-  AArch64CPUTestParams params = GetParam();
-
-  const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
-  EXPECT_TRUE(Cpu);
-  EXPECT_EQ(params.ExpectedArch, Cpu->Arch.Name);
-
-  EXPECT_PRED_FORMAT2(
-      AssertSameExtensionFlags(params.CPUName),
-      params.ExpectedFlags, Cpu->getImpliedExtensions());
-}
-
-INSTANTIATE_TEST_SUITE_P(
-    AArch64CPUTests, AArch64CPUTestFixture,
-    ::testing::Values(
-        AArch64CPUTestParams("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC)),
-                         "8.2-A"),
-        AArch64CPUTestParams(
-            "cortex-a510", "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_I8MM).set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
-                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_PAUTH).
-                set(AArch64::AEK_MTE).set(AArch64::AEK_SSBS).set(AArch64::AEK_FP16).
-                set(AArch64::AEK_FP16FML).set(AArch64::AEK_SB)),
-            "9-A"),
-        AArch64CPUTestParams("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_PROFILE)),
-                         "8.2-A"),
-        AArch64CPUTestParams(
-            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_RCPC).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_PROFILE).set(AArch64::AEK_FLAGM).
-                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FP16FML)),
-            "8.2-A"),
-        AArch64CPUTestParams(
-            "cortex-a710", "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).set(AArch64::AEK_MTE).
-                set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).set(AArch64::AEK_SVE).
-                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-                set(AArch64::AEK_PAUTH).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SB).
-                set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16)),
-            "9-A"),
-        AArch64CPUTestParams(
-            "cortex-a715", "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
-                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_I8MM).
-                set(AArch64::AEK_PERFMON).set(AArch64::AEK_PREDRES).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16FML).
-                set(AArch64::AEK_FP16).set(AArch64::AEK_FLAGM)),
-            "9-A"),
-        AArch64CPUTestParams(
-            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
-                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
-            "8.4-A"),
-        AArch64CPUTestParams("neoverse-v2", "armv9-a", "neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).
-                             set(AArch64::AEK_SSBS).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_MTE).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
-                             set(AArch64::AEK_SVE2).set(AArch64::AEK_PROFILE).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM).
-                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_RAND)),
-                         "9-A"),
-        AArch64CPUTestParams("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SSBS).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_SB)),
-                         "8-R"),
-        AArch64CPUTestParams("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_PROFILE)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_FP16).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_PAUTH).set(AArch64::AEK_PROFILE)),
-                         "8.2-A"),
-        AArch64CPUTestParams("cortex-x2", "armv9-a", "neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).
-                             set(AArch64::AEK_I8MM).set(AArch64::AEK_BF16).
-                             set(AArch64::AEK_SVE).set(AArch64::AEK_SVE2).
-                             set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SSBS).
-                             set(AArch64::AEK_SB).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML)),
-                         "9-A"),
-        AArch64CPUTestParams(
-            "cortex-x3",
-            "armv9-a", "neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_MTE).set(AArch64::AEK_PAUTH).set(AArch64::AEK_SVE).
-                set(AArch64::AEK_SVE2).set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_SB).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_PERFMON).
-                set(AArch64::AEK_I8MM).set(AArch64::AEK_FP16).set(AArch64::AEK_FP16FML).
-                set(AArch64::AEK_PREDRES).set(AArch64::AEK_FLAGM).set(AArch64::AEK_SSBS)),
-            "9-A"),
-        AArch64CPUTestParams("cyclone", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP16)),
-                         "8.2-A"),
-        AArch64CPUTestParams("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
-                         "8.3-A"),
-        AArch64CPUTestParams("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
-                         "8.4-A"),
-        AArch64CPUTestParams("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_DOTPROD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_SHA3).
-                             set(AArch64::AEK_BF16).set(AArch64::AEK_I8MM)),
-                         "8.5-A"),
-        AArch64CPUTestParams("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
-                         "8.3-A"),
-        AArch64CPUTestParams("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_FP16)),
-                         "8.3-A"),
-        AArch64CPUTestParams("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
-                         "8.2-A"),
-        AArch64CPUTestParams("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD)),
-                         "8.2-A"),
-        AArch64CPUTestParams("falkor", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RDM)),
-                         "8-A"),
-        AArch64CPUTestParams("kryo", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8-A"),
-        AArch64CPUTestParams("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_DOTPROD).
-                             set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_PROFILE).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_RCPC).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_SSBS)),
-                         "8.2-A"),
-        AArch64CPUTestParams(
-            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).
-                set(AArch64::AEK_SHA3).set(AArch64::AEK_SM4).set(AArch64::AEK_FP).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).set(AArch64::AEK_RAS).
-                set(AArch64::AEK_LSE).set(AArch64::AEK_SVE).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_RDM).set(AArch64::AEK_MTE).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_SVE2).
-                set(AArch64::AEK_SVE2BITPERM).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_I8MM)),
-            "8.5-A"),
-        AArch64CPUTestParams(
-            "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).set(AArch64::AEK_SHA2).
-                set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).set(AArch64::AEK_SSBS).
-                set(AArch64::AEK_SB).set(AArch64::AEK_RAND)),
-            "8.6-A"),
-        AArch64CPUTestParams(
-            "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).set(AArch64::AEK_FP16).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_SM4).set(AArch64::AEK_SHA3).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_SHA2).set(AArch64::AEK_AES).set(AArch64::AEK_I8MM).
-                set(AArch64::AEK_SSBS).set(AArch64::AEK_SB).set(AArch64::AEK_RAND).
-                set(AArch64::AEK_MTE)),
-            "8.6-A"),
-        AArch64CPUTestParams(
-            "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
-            (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_RAS).set(AArch64::AEK_SVE).set(AArch64::AEK_SSBS).
-                set(AArch64::AEK_RCPC).set(AArch64::AEK_CRC).set(AArch64::AEK_FP).
-                set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                set(AArch64::AEK_RDM).set(AArch64::AEK_RCPC).set(AArch64::AEK_DOTPROD).
-                set(AArch64::AEK_AES).set(AArch64::AEK_SHA2).set(AArch64::AEK_SHA3).
-                set(AArch64::AEK_SM4).set(AArch64::AEK_FP16).set(AArch64::AEK_BF16).
-                set(AArch64::AEK_PROFILE).set(AArch64::AEK_RAND).
-                set(AArch64::AEK_FP16FML).set(AArch64::AEK_I8MM)),
-            "8.4-A"),
-        AArch64CPUTestParams("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD)),
-                         "8.1-A"),
-        AArch64CPUTestParams("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RDM).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_RCPC)),
-                         "8.3-A"),
-        AArch64CPUTestParams("thunderx", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_SIMD).
-                             set(AArch64::AEK_FP)),
-                         "8-A"),
-        AArch64CPUTestParams("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_RAS).
-                             set(AArch64::AEK_LSE).set(AArch64::AEK_RDM).
-                             set(AArch64::AEK_PROFILE).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_FP16FML).set(AArch64::AEK_DOTPROD)),
-                         "8.2-A"),
-        AArch64CPUTestParams("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_SVE).set(AArch64::AEK_RDM)),
-                         "8.2-A"),
-        AArch64CPUTestParams("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_CRC).set(AArch64::AEK_AES).
-                             set(AArch64::AEK_SHA2).set(AArch64::AEK_FP).
-                             set(AArch64::AEK_SIMD).set(AArch64::AEK_FP16).
-                             set(AArch64::AEK_RAS).set(AArch64::AEK_LSE).
-                             set(AArch64::AEK_RDM)),
-                         "8.2-A")));
-
-// Note: number of CPUs includes aliases.
-static constexpr unsigned NumAArch64CPUArchs = 62;
-
-TEST(TargetParserTest, testAArch64CPUArchList) {
-  SmallVector<StringRef, NumAArch64CPUArchs> List;
-  AArch64::fillValidCPUArchList(List);
-
-  // No list exists for these in this test suite, so ensure all are
-  // valid, and match the expected 'magic' count.
-  EXPECT_EQ(List.size(), NumAArch64CPUArchs);
-  for(StringRef CPU : List) {
-    EXPECT_TRUE(AArch64::parseCpu(CPU));
-  }
-}
-
-bool testAArch64Arch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
-                     unsigned ArchAttr) {
-  const std::optional<AArch64::ArchInfo> AI = AArch64::parseArch(Arch);
-  return AI.has_value();
-}
-
-TEST(TargetParserTest, testAArch64Arch) {
-  EXPECT_TRUE(testAArch64Arch("armv8-a", "cortex-a53", "v8a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.1-a", "generic", "v8.1a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.2-a", "generic", "v8.2a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.3-a", "generic", "v8.3a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.4-a", "generic", "v8.4a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.5-a", "generic", "v8.5a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.6-a", "generic", "v8.6a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.7-a", "generic", "v8.7a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.8-a", "generic", "v8.8a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv8.9-a", "generic", "v8.9a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9-a", "generic", "v9a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.1-a", "generic", "v9.1a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.2-a", "generic", "v9.2a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.3-a", "generic", "v9.3a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(testAArch64Arch("armv9.4-a", "generic", "v9.4a",
-                              ARMBuildAttrs::CPUArch::v8_A));
-}
-
-bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {
-  std::optional<AArch64::ExtensionInfo> Extension =
-      AArch64::parseArchExtension(ArchExt);
-  if (!Extension)
-    return false;
-  std::optional<AArch64::CpuInfo> CpuInfo = AArch64::parseCpu(CPUName);
-  return CpuInfo->getImpliedExtensions().test(Extension->ID);
-}
-
-bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {
-  std::optional<AArch64::ExtensionInfo> Extension =
-      AArch64::parseArchExtension(ArchExt);
-  if (!Extension)
-    return false;
-  return AI.DefaultExts.test(Extension->ID);
-}
-
-TEST(TargetParserTest, testAArch64Extension) {
-  EXPECT_FALSE(testAArch64Extension("cortex-a34", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a35", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a53", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a55", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a55", "dotprod"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a57", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a72", "ras"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a73", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("cortex-a75", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-a75", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "ras"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("cortex-r82", "lse"));
-  EXPECT_FALSE(testAArch64Extension("cyclone", "ras"));
-  EXPECT_FALSE(testAArch64Extension("exynos-m3", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "lse"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m4", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "lse"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "ras"));
-  EXPECT_TRUE(testAArch64Extension("exynos-m5", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("falkor", "rdm"));
-  EXPECT_FALSE(testAArch64Extension("kryo", "ras"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "crc"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "lse"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "rdm"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "ras"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "rcpc"));
-  EXPECT_TRUE(testAArch64Extension("saphira", "profile"));
-  EXPECT_FALSE(testAArch64Extension("saphira", "fp16"));
-  EXPECT_FALSE(testAArch64Extension("thunderx2t99", "ras"));
-  EXPECT_FALSE(testAArch64Extension("thunderx", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt81", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt83", "lse"));
-  EXPECT_FALSE(testAArch64Extension("thunderxt88", "lse"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "aes"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "sha2"));
-  EXPECT_FALSE(testAArch64Extension("tsv110", "sha3"));
-  EXPECT_FALSE(testAArch64Extension("tsv110", "sm4"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "ras"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "profile"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16fml"));
-  EXPECT_TRUE(testAArch64Extension("tsv110", "dotprod"));
-  EXPECT_TRUE(testAArch64Extension("a64fx", "fp16"));
-  EXPECT_TRUE(testAArch64Extension("a64fx", "sve"));
-  EXPECT_FALSE(testAArch64Extension("a64fx", "sve2"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "aes"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "sha2"));
-  EXPECT_TRUE(testAArch64Extension("carmel", "fp16"));
-
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8A, "ras"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_1A, "ras"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "profile"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16fml"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16fml"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16"));
-  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16fml"));
-}
-
-TEST(TargetParserTest, AArch64ExtensionFeatures) {
-  std::vector<uint64_t> Extensions = {
-      AArch64::AEK_CRC,           AArch64::AEK_LSE,           AArch64::AEK_RDM,
-      AArch64::AEK_CRYPTO,        AArch64::AEK_SM4,           AArch64::AEK_SHA3,
-      AArch64::AEK_SHA2,          AArch64::AEK_AES,           AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP,            AArch64::AEK_SIMD,          AArch64::AEK_FP16,
-      AArch64::AEK_FP16FML,       AArch64::AEK_PROFILE,       AArch64::AEK_RAS,
-      AArch64::AEK_SVE,           AArch64::AEK_SVE2,          AArch64::AEK_SVE2AES,
-      AArch64::AEK_SVE2SM4,       AArch64::AEK_SVE2SHA3,      AArch64::AEK_SVE2BITPERM,
-      AArch64::AEK_RCPC,          AArch64::AEK_RAND,          AArch64::AEK_MTE,
-      AArch64::AEK_SSBS,          AArch64::AEK_SB,            AArch64::AEK_PREDRES,
-      AArch64::AEK_BF16,          AArch64::AEK_I8MM,          AArch64::AEK_F32MM,
-      AArch64::AEK_F64MM,         AArch64::AEK_TME,           AArch64::AEK_LS64,
-      AArch64::AEK_BRBE,          AArch64::AEK_PAUTH,         AArch64::AEK_FLAGM,
-      AArch64::AEK_SME,           AArch64::AEK_SMEF64F64,     AArch64::AEK_SMEI16I64,
-      AArch64::AEK_SME2,          AArch64::AEK_HBC,           AArch64::AEK_MOPS,
-      AArch64::AEK_PERFMON,       AArch64::AEK_SVE2p1,        AArch64::AEK_SME2p1,
-      AArch64::AEK_B16B16,        AArch64::AEK_SMEF16F16,     AArch64::AEK_CSSC,
-      AArch64::AEK_RCPC3,         AArch64::AEK_THE,           AArch64::AEK_D128,
-      AArch64::AEK_LSE128,        AArch64::AEK_SPECRES2,      AArch64::AEK_RASv2,
-      AArch64::AEK_ITE,           AArch64::AEK_GCS,
-  };
-
-  std::vector<StringRef> Features;
-
-  BitVector ExtVal(AArch64::AEK_EXTENTIONS_NUM);
-  for (auto Ext : Extensions)
-    ExtVal.set(Ext);
-
-  // NONE has no feature names.
-  // We return True here because NONE is a valid choice.
-  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM).set(AArch64::AEK_NONE), Features));
-  EXPECT_TRUE(!Features.size());
-
-  AArch64::getExtensionFeatures(ExtVal, Features);
-  EXPECT_EQ(Extensions.size(), Features.size());
-
-  EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sve2p1"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+b16b16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+f64mm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+tme"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ls64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+brbe"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+hbc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+mops"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+perfmon"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+cssc"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc3"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+the"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
-  EXPECT_TRUE(llvm::is_contained(Features, "+gcs"));
-
-  // Assuming we listed every extension above, this should produce the same
-  // result. (note that AEK_NONE doesn't have a name so it won't be in the
-  // result despite its bit being set)
-  std::vector<StringRef> AllFeatures;
-  EXPECT_TRUE(AArch64::getExtensionFeatures(BitVector(AArch64::AEK_EXTENTIONS_NUM, true), AllFeatures));
-  EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
-}
-
-TEST(TargetParserTest, AArch64ArchFeatures) {
-  EXPECT_EQ(AArch64::ARMV8A.ArchFeature, "+v8a");
-  EXPECT_EQ(AArch64::ARMV8_1A.ArchFeature, "+v8.1a");
-  EXPECT_EQ(AArch64::ARMV8_2A.ArchFeature, "+v8.2a");
-  EXPECT_EQ(AArch64::ARMV8_3A.ArchFeature, "+v8.3a");
-  EXPECT_EQ(AArch64::ARMV8_4A.ArchFeature, "+v8.4a");
-  EXPECT_EQ(AArch64::ARMV8_5A.ArchFeature, "+v8.5a");
-  EXPECT_EQ(AArch64::ARMV8_6A.ArchFeature, "+v8.6a");
-  EXPECT_EQ(AArch64::ARMV8_7A.ArchFeature, "+v8.7a");
-  EXPECT_EQ(AArch64::ARMV8_8A.ArchFeature, "+v8.8a");
-  EXPECT_EQ(AArch64::ARMV8_9A.ArchFeature, "+v8.9a");
-  EXPECT_EQ(AArch64::ARMV9A.ArchFeature, "+v9a");
-  EXPECT_EQ(AArch64::ARMV9_1A.ArchFeature, "+v9.1a");
-  EXPECT_EQ(AArch64::ARMV9_2A.ArchFeature, "+v9.2a");
-  EXPECT_EQ(AArch64::ARMV9_3A.ArchFeature, "+v9.3a");
-  EXPECT_EQ(AArch64::ARMV9_4A.ArchFeature, "+v9.4a");
-  EXPECT_EQ(AArch64::ARMV8R.ArchFeature, "+v8r");
-}
-
-TEST(TargetParserTest, AArch64ArchPartialOrder) {
-  for (const auto *A : AArch64::ArchInfos) {
-    EXPECT_EQ(*A, *A);
-
-    // v8r has no relation to other valid architectures
-    if (*A != AArch64::ARMV8R) {
-      EXPECT_FALSE(A->implies(AArch64::ARMV8R));
-      EXPECT_FALSE(AArch64::ARMV8R.implies(*A));
-    }
-  }
-
-  for (const auto *A : {
-           &AArch64::ARMV8_1A,
-           &AArch64::ARMV8_2A,
-           &AArch64::ARMV8_3A,
-           &AArch64::ARMV8_4A,
-           &AArch64::ARMV8_5A,
-           &AArch64::ARMV8_6A,
-           &AArch64::ARMV8_7A,
-           &AArch64::ARMV8_8A,
-           &AArch64::ARMV8_9A,
-       })
-    EXPECT_TRUE(A->implies(AArch64::ARMV8A));
-
-  for (const auto *A : {&AArch64::ARMV9_1A, &AArch64::ARMV9_2A,
-                        &AArch64::ARMV9_3A, &AArch64::ARMV9_4A})
-    EXPECT_TRUE(A->implies(AArch64::ARMV9A));
-
-  EXPECT_TRUE(AArch64::ARMV8_1A.implies(AArch64::ARMV8A));
-  EXPECT_TRUE(AArch64::ARMV8_2A.implies(AArch64::ARMV8_1A));
-  EXPECT_TRUE(AArch64::ARMV8_3A.implies(AArch64::ARMV8_2A));
-  EXPECT_TRUE(AArch64::ARMV8_4A.implies(AArch64::ARMV8_3A));
-  EXPECT_TRUE(AArch64::ARMV8_5A.implies(AArch64::ARMV8_4A));
-  EXPECT_TRUE(AArch64::ARMV8_6A.implies(AArch64::ARMV8_5A));
-  EXPECT_TRUE(AArch64::ARMV8_7A.implies(AArch64::ARMV8_6A));
-  EXPECT_TRUE(AArch64::ARMV8_8A.implies(AArch64::ARMV8_7A));
-  EXPECT_TRUE(AArch64::ARMV8_9A.implies(AArch64::ARMV8_8A));
-
-  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV9A));
-  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV9_1A));
-  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV9_2A));
-  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV9_3A));
-
-  EXPECT_TRUE(AArch64::ARMV9A.implies(AArch64::ARMV8_5A));
-  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV8_6A));
-  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV8_7A));
-  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV8_8A));
-  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV8_9A));
-}
-
-TEST(TargetParserTest, AArch64ArchExtFeature) {
-  const char *ArchExt[][4] = {
-      {"crc", "nocrc", "+crc", "-crc"},
-      {"crypto", "nocrypto", "+crypto", "-crypto"},
-      {"flagm", "noflagm", "+flagm", "-flagm"},
-      {"fp", "nofp", "+fp-armv8", "-fp-armv8"},
-      {"simd", "nosimd", "+neon", "-neon"},
-      {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
-      {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
-      {"profile", "noprofile", "+spe", "-spe"},
-      {"ras", "noras", "+ras", "-ras"},
-      {"lse", "nolse", "+lse", "-lse"},
-      {"rdm", "nordm", "+rdm", "-rdm"},
-      {"sve", "nosve", "+sve", "-sve"},
-      {"sve2", "nosve2", "+sve2", "-sve2"},
-      {"sve2-aes", "nosve2-aes", "+sve2-aes", "-sve2-aes"},
-      {"sve2-sm4", "nosve2-sm4", "+sve2-sm4", "-sve2-sm4"},
-      {"sve2-sha3", "nosve2-sha3", "+sve2-sha3", "-sve2-sha3"},
-      {"sve2p1", "nosve2p1", "+sve2p1", "-sve2p1"},
-      {"b16b16", "nob16b16", "+b16b16", "-b16b16"},
-      {"sve2-bitperm", "nosve2-bitperm", "+sve2-bitperm", "-sve2-bitperm"},
-      {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
-      {"rcpc", "norcpc", "+rcpc", "-rcpc"},
-      {"rng", "norng", "+rand", "-rand"},
-      {"memtag", "nomemtag", "+mte", "-mte"},
-      {"tme", "notme", "+tme", "-tme"},
-      {"pauth", "nopauth", "+pauth", "-pauth"},
-      {"ssbs", "nossbs", "+ssbs", "-ssbs"},
-      {"sb", "nosb", "+sb", "-sb"},
-      {"predres", "nopredres", "+predres", "-predres"},
-      {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
-      {"f32mm", "nof32mm", "+f32mm", "-f32mm"},
-      {"f64mm", "nof64mm", "+f64mm", "-f64mm"},
-      {"sme", "nosme", "+sme", "-sme"},
-      {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"},
-      {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"},
-      {"sme-f16f16", "nosme-f16f16", "+sme-f16f16", "-sme-f16f16"},
-      {"sme2", "nosme2", "+sme2", "-sme2"},
-      {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"},
-      {"hbc", "nohbc", "+hbc", "-hbc"},
-      {"mops", "nomops", "+mops", "-mops"},
-      {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},
-      {"predres2", "nopredres2", "+specres2", "-specres2"},
-      {"rasv2", "norasv2", "+rasv2", "-rasv2"},
-      {"gcs", "nogcs", "+gcs", "-gcs"},
-  };
-
-  for (unsigned i = 0; i < std::size(ArchExt); i++) {
-    EXPECT_EQ(StringRef(ArchExt[i][2]),
-              AArch64::getArchExtFeature(ArchExt[i][0]));
-    EXPECT_EQ(StringRef(ArchExt[i][3]),
-              AArch64::getArchExtFeature(ArchExt[i][1]));
-  }
-}
-
-} // namespace
diff --git a/llvm/unittests/TargetParser/CMakeLists.txt b/llvm/unittests/TargetParser/CMakeLists.txt
index 8891ffe54445b21..501acc044687026 100644
--- a/llvm/unittests/TargetParser/CMakeLists.txt
+++ b/llvm/unittests/TargetParser/CMakeLists.txt
@@ -6,8 +6,7 @@ set(LLVM_LINK_COMPONENTS
 add_llvm_unittest(TargetParserTests
   CSKYTargetParserTest.cpp
   Host.cpp
-  ArmTargetParserTest.cpp
-  AArch64TargetParserTest.cpp
+  TargetParserTest.cpp
   TripleTest.cpp
   )
 
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
new file mode 100644
index 000000000000000..638eec94a4baf04
--- /dev/null
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -0,0 +1,1845 @@
+//===----------- TargetParser.cpp - Target Parser -------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/TargetParser/TargetParser.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/FormatVariadic.h"
+#include "llvm/TargetParser/AArch64TargetParser.h"
+#include "llvm/TargetParser/ARMTargetParser.h"
+#include "llvm/TargetParser/ARMTargetParserCommon.h"
+#include "llvm/TargetParser/Triple.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include <optional>
+#include <string>
+#include <sstream>
+
+using namespace llvm;
+
+namespace {
+const char *ARMArch[] = {
+    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
+    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
+    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
+    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
+    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
+    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
+    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
+    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
+    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
+    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
+    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
+    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
+    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
+    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
+    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
+    "armv9.4a",
+};
+
+template <ARM::ISAKind ISAKind, typename T>
+std::string FormatExtensionFlags(T Flags) {
+  std::vector<StringRef> Features;
+
+  if constexpr (ISAKind == ARM::ISAKind::AARCH64) {
+    // AEK_NONE is not meant to be shown to the user so the target parser
+    // does not recognise it. It is relevant here though.
+    if (Flags.test(AArch64::AEK_NONE))
+      Features.push_back("none");
+    AArch64::getExtensionFeatures(Flags, Features);
+  } else {
+    if (Flags & ARM::AEK_NONE)
+      Features.push_back("none");
+    ARM::getExtensionFeatures(Flags, Features);
+  }
+
+  // The target parser also includes every extension you don't have.
+  // E.g. if AEK_CRC is not set then it adds "-crc". Not useful here.
+  Features.erase(std::remove_if(Features.begin(), Features.end(),
+                                [](StringRef extension) {
+                                  return extension.startswith("-");
+                                }),
+                 Features.end());
+
+  return llvm::join(Features, ", ");
+}
+
+std::string SerializeExtensionFlags(Bitset<AArch64::AEK_EXTENTIONS_MAX> Flags) {
+  std::string SerializedFlags;
+  int HexaValue = 0;
+  for(unsigned int i = 0; i < AArch64::AEK_EXTENTIONS_MAX; i ++) {
+    HexaValue <<= 1;
+    HexaValue |= (int)Flags[i];
+    if ((i+1)%4 == 0) {
+      std::ostringstream ss;
+      ss << std::hex << HexaValue;
+      SerializedFlags += ss.str();
+      HexaValue = 0;
+    }
+  }
+  std::reverse(SerializedFlags.begin(), SerializedFlags.end());
+  return SerializedFlags;
+}
+
+
+template <ARM::ISAKind ISAKind> struct AssertSameExtensionFlags {
+  AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
+
+  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
+                                      uint64_t ExpectedFlags,
+                                      uint64_t GotFlags) {
+    if (ExpectedFlags == GotFlags)
+      return testing::AssertionSuccess();
+
+    return testing::AssertionFailure() << llvm::formatv(
+               "CPU: {4}\n"
+               "Expected extension flags: {0} ({1:x})\n"
+               "     Got extension flags: {2} ({3:x})\n",
+               FormatExtensionFlags<ISAKind, uint64_t>(ExpectedFlags), ExpectedFlags,
+               FormatExtensionFlags<ISAKind, uint64_t>(GotFlags), ExpectedFlags, CPUName);
+  }
+
+  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
+                                    Bitset<AArch64::AEK_EXTENTIONS_MAX> ExpectedFlags,
+                                    Bitset<AArch64::AEK_EXTENTIONS_MAX> GotFlags) {
+    if (ExpectedFlags == GotFlags)
+      return testing::AssertionSuccess();
+
+    return testing::AssertionFailure() << llvm::formatv(
+                "CPU: {4}\n"
+                "Expected extension flags: {0} ({1:x})\n"
+                "     Got extension flags: {2} ({3:x})\n",
+                FormatExtensionFlags<ISAKind, Bitset<AArch64::AEK_EXTENTIONS_MAX>>(ExpectedFlags), SerializeExtensionFlags(ExpectedFlags),
+                FormatExtensionFlags<ISAKind, Bitset<AArch64::AEK_EXTENTIONS_MAX>>(GotFlags), SerializeExtensionFlags(ExpectedFlags), CPUName);
+  }
+
+private:
+  StringRef CPUName;
+};
+
+template <typename T>
+struct ARMCPUTestParams {
+  ARMCPUTestParams(StringRef CPUName, StringRef ExpectedArch,
+                   StringRef ExpectedFPU, T ExpectedFlags,
+                   StringRef CPUAttr)
+      : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
+        ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
+
+  friend std::ostream &operator<<(std::ostream &os,
+                                  const ARMCPUTestParams<T> &params) {
+    os << "\"" << params.CPUName.str() << "\", \""
+              << params.ExpectedArch.str() << "\", \""
+              << params.ExpectedFPU.str() << "\", 0x" << std::hex;
+    if constexpr (std::is_same<T, uint64_t>::value)
+        os << params.ExpectedFlags;
+   else
+     os << SerializeExtensionFlags(params.ExpectedFlags);
+    os << ", \"" << params.CPUAttr.str() << "\"";
+    return os;
+  }
+
+  StringRef CPUName;
+  StringRef ExpectedArch;
+  StringRef ExpectedFPU;
+  T ExpectedFlags;
+  StringRef CPUAttr;
+};
+
+class ARMCPUTestFixture : public ::testing::TestWithParam<ARMCPUTestParams<uint64_t>> {};
+
+TEST_P(ARMCPUTestFixture, ARMCPUTests) {
+  auto params = GetParam();
+
+  ARM::ArchKind AK = ARM::parseCPUArch(params.CPUName);
+  EXPECT_EQ(params.ExpectedArch, ARM::getArchName(AK));
+
+  ARM::FPUKind FPUKind = ARM::getDefaultFPU(params.CPUName, AK);
+  EXPECT_EQ(params.ExpectedFPU, ARM::getFPUName(FPUKind));
+
+  uint64_t default_extensions = ARM::getDefaultExtensions(params.CPUName, AK);
+  EXPECT_PRED_FORMAT2(
+      AssertSameExtensionFlags<ARM::ISAKind::ARM>(params.CPUName),
+      params.ExpectedFlags, default_extensions);
+
+  EXPECT_EQ(params.CPUAttr, ARM::getCPUAttr(AK));
+}
+
+// Note that we include ARM::AEK_NONE even when there are other extensions
+// we expect. This is because the default extensions for a CPU are the sum
+// of the default extensions for its architecture and for the CPU.
+// So if a CPU has no extra extensions, it adds AEK_NONE.
+INSTANTIATE_TEST_SUITE_P(
+    ARMCPUTestsPart1, ARMCPUTestFixture,
+    ::testing::Values(
+        ARMCPUTestParams<uint64_t>("invalid", "invalid", "invalid", ARM::AEK_NONE, ""),
+        ARMCPUTestParams<uint64_t>("generic", "invalid", "none", ARM::AEK_NONE, ""),
+
+        ARMCPUTestParams<uint64_t>("arm8", "armv4", "none", ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("arm810", "armv4", "none", ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("strongarm", "armv4", "none", ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("strongarm110", "armv4", "none", ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("strongarm1100", "armv4", "none", ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("strongarm1110", "armv4", "none", ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("arm7tdmi", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm7tdmi-s", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm710t", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm720t", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm9", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm9tdmi", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm920", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm920t", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm922t", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm940t", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("ep9312", "armv4t", "none", ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm10tdmi", "armv5t", "none", ARM::AEK_NONE, "5T"),
+        ARMCPUTestParams<uint64_t>("arm1020t", "armv5t", "none", ARM::AEK_NONE, "5T"),
+        ARMCPUTestParams<uint64_t>("arm9e", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm946e-s", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm966e-s", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm968e-s", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm10e", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm1020e", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm1022e", "armv5te", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+        ARMCPUTestParams<uint64_t>("arm926ej-s", "armv5tej", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "5TEJ"),
+        ARMCPUTestParams<uint64_t>("arm1136j-s", "armv6", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "6"),
+        ARMCPUTestParams<uint64_t>("arm1136jf-s", "armv6", "vfpv2",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "6"),
+        ARMCPUTestParams<uint64_t>("arm1176jz-s", "armv6kz", "none",
+                         ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP, "6KZ"),
+        ARMCPUTestParams<uint64_t>("mpcore", "armv6k", "vfpv2",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
+        ARMCPUTestParams<uint64_t>("mpcorenovfp", "armv6k", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
+        ARMCPUTestParams<uint64_t>("arm1176jzf-s", "armv6kz", "vfpv2",
+                         ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP, "6KZ"),
+        ARMCPUTestParams<uint64_t>("arm1156t2-s", "armv6t2", "none",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
+        ARMCPUTestParams<uint64_t>("arm1156t2f-s", "armv6t2", "vfpv2",
+                         ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
+        ARMCPUTestParams<uint64_t>("cortex-m0", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m0plus", "armv6-m", "none", ARM::AEK_NONE,
+                         "6-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m1", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
+        ARMCPUTestParams<uint64_t>("sc000", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
+        ARMCPUTestParams<uint64_t>("cortex-a5", "armv7-a", "neon-vfpv4",
+                         ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a7", "armv7-a", "neon-vfpv4",
+                         ARM::AEK_HWDIVTHUMB | ARM::AEK_HWDIVARM | ARM::AEK_MP |
+                             ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_DSP,
+                         "7-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a8", "armv7-a", "neon",
+                         ARM::AEK_SEC | ARM::AEK_DSP, "7-A")));
+
+// gtest in llvm has a limit of 50 test cases when using ::Values so we split
+// them into 2 blocks
+INSTANTIATE_TEST_SUITE_P(
+    ARMCPUTestsPart2, ARMCPUTestFixture,
+    ::testing::Values(
+        ARMCPUTestParams<uint64_t>("cortex-a9", "armv7-a", "neon-fp16",
+                         ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a12", "armv7-a", "neon-vfpv4",
+                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP,
+                         "7-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a15", "armv7-a", "neon-vfpv4",
+                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP,
+                         "7-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a17", "armv7-a", "neon-vfpv4",
+                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP,
+                         "7-A"),
+        ARMCPUTestParams<uint64_t>("krait", "armv7-a", "neon-vfpv4",
+                         ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "7-A"),
+        ARMCPUTestParams<uint64_t>("cortex-r4", "armv7-r", "none",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "7-R"),
+        ARMCPUTestParams<uint64_t>("cortex-r4f", "armv7-r", "vfpv3-d16",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "7-R"),
+        ARMCPUTestParams<uint64_t>("cortex-r5", "armv7-r", "vfpv3-d16",
+                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP,
+                         "7-R"),
+        ARMCPUTestParams<uint64_t>("cortex-r7", "armv7-r", "vfpv3-d16-fp16",
+                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP,
+                         "7-R"),
+        ARMCPUTestParams<uint64_t>("cortex-r8", "armv7-r", "vfpv3-d16-fp16",
+                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP,
+                         "7-R"),
+        ARMCPUTestParams<uint64_t>("cortex-r52", "armv8-r", "neon-fp-armv8",
+                         ARM::AEK_NONE | ARM::AEK_CRC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-R"),
+        ARMCPUTestParams<uint64_t>("sc300", "armv7-m", "none",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m3", "armv7-m", "none",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m4", "armv7e-m", "fpv4-sp-d16",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "7E-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m7", "armv7e-m", "fpv5-d16",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "7E-M"),
+        ARMCPUTestParams<uint64_t>("cortex-a32", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
+                             ARM::AEK_FP16 | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a710", "armv9-a", "neon-fp-armv8",
+                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
+                             ARM::AEK_DOTPROD | ARM::AEK_FP16FML |
+                             ARM::AEK_BF16 | ARM::AEK_I8MM | ARM::AEK_SB,
+                         "9-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_SEC |
+                             ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC |
+                             ARM::AEK_RAS,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD |
+                             ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP | ARM::AEK_CRC,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD |
+                             ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP | ARM::AEK_CRC,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_HWDIVARM | ARM::AEK_MP | ARM::AEK_SEC |
+                             ARM::AEK_VIRT | ARM::AEK_DSP | ARM::AEK_BF16 |
+                             ARM::AEK_DOTPROD | ARM::AEK_RAS | ARM::AEK_I8MM |
+                             ARM::AEK_SB,
+                         "8.5-A"),
+        ARMCPUTestParams<uint64_t>("neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
+                             ARM::AEK_FP16 | ARM::AEK_BF16 | ARM::AEK_DOTPROD,
+                         "8.4-A"),
+        ARMCPUTestParams<uint64_t>("cyclone", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "8-A"),
+        ARMCPUTestParams<uint64_t>("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
+                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                             ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
+                         "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-m23", "armv8-m.base", "none",
+                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "8-M.Baseline"),
+        ARMCPUTestParams<uint64_t>("cortex-m33", "armv8-m.main", "fpv5-sp-d16",
+                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline"),
+        ARMCPUTestParams<uint64_t>("cortex-m35p", "armv8-m.main", "fpv5-sp-d16",
+                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline"),
+        ARMCPUTestParams<uint64_t>("cortex-m55", "armv8.1-m.main",
+                         "fp-armv8-fullfp16-d16",
+                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD |
+                             ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB |
+                             ARM::AEK_FP16,
+                         "8.1-M.Mainline"),
+        ARMCPUTestParams<uint64_t>("cortex-m85", "armv8.1-m.main",
+                         "fp-armv8-fullfp16-d16",
+                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD |
+                             ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB |
+                             ARM::AEK_FP16 | ARM::AEK_PACBTI,
+                         "8.1-M.Mainline"),
+        ARMCPUTestParams<uint64_t>("iwmmxt", "iwmmxt", "none", ARM::AEK_NONE, "iwmmxt"),
+        ARMCPUTestParams<uint64_t>("xscale", "xscale", "none", ARM::AEK_NONE, "xscale"),
+        ARMCPUTestParams<uint64_t>("swift", "armv7s", "neon-vfpv4",
+                         ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                         "7-S")));
+
+static constexpr unsigned NumARMCPUArchs = 89;
+
+TEST(TargetParserTest, testARMCPUArchList) {
+  SmallVector<StringRef, NumARMCPUArchs> List;
+  ARM::fillValidCPUArchList(List);
+
+  // No list exists for these in this test suite, so ensure all are
+  // valid, and match the expected 'magic' count.
+  EXPECT_EQ(List.size(), NumARMCPUArchs);
+  for(StringRef CPU : List) {
+    EXPECT_NE(ARM::parseCPUArch(CPU), ARM::ArchKind::INVALID);
+  }
+}
+
+TEST(TargetParserTest, testInvalidARMArch) {
+  auto InvalidArchStrings = {"armv", "armv99", "noarm"};
+  for (const char* InvalidArch : InvalidArchStrings)
+    EXPECT_EQ(ARM::parseArch(InvalidArch), ARM::ArchKind::INVALID);
+}
+
+bool testARMArch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
+                 unsigned ArchAttr) {
+  ARM::ArchKind AK = ARM::parseArch(Arch);
+  bool Result = (AK != ARM::ArchKind::INVALID);
+  Result &= ARM::getDefaultCPU(Arch).equals(DefaultCPU);
+  Result &= ARM::getSubArch(AK).equals(SubArch);
+  Result &= (ARM::getArchAttr(AK) == ArchAttr);
+  return Result;
+}
+
+TEST(TargetParserTest, testARMArch) {
+  EXPECT_TRUE(
+      testARMArch("armv4", "strongarm", "v4",
+                          ARMBuildAttrs::CPUArch::v4));
+  EXPECT_TRUE(
+      testARMArch("armv4t", "arm7tdmi", "v4t",
+                          ARMBuildAttrs::CPUArch::v4T));
+  EXPECT_TRUE(
+      testARMArch("armv5t", "arm10tdmi", "v5",
+                          ARMBuildAttrs::CPUArch::v5T));
+  EXPECT_TRUE(
+      testARMArch("armv5te", "arm1022e", "v5e",
+                          ARMBuildAttrs::CPUArch::v5TE));
+  EXPECT_TRUE(
+      testARMArch("armv5tej", "arm926ej-s", "v5e",
+                          ARMBuildAttrs::CPUArch::v5TEJ));
+  EXPECT_TRUE(
+      testARMArch("armv6", "arm1136jf-s", "v6",
+                          ARMBuildAttrs::CPUArch::v6));
+  EXPECT_TRUE(
+      testARMArch("armv6k", "mpcore", "v6k",
+                          ARMBuildAttrs::CPUArch::v6K));
+  EXPECT_TRUE(
+      testARMArch("armv6t2", "arm1156t2-s", "v6t2",
+                          ARMBuildAttrs::CPUArch::v6T2));
+  EXPECT_TRUE(
+      testARMArch("armv6kz", "arm1176jzf-s", "v6kz",
+                          ARMBuildAttrs::CPUArch::v6KZ));
+  EXPECT_TRUE(
+      testARMArch("armv6-m", "cortex-m0", "v6m",
+                          ARMBuildAttrs::CPUArch::v6_M));
+  EXPECT_TRUE(
+      testARMArch("armv7-a", "generic", "v7",
+                          ARMBuildAttrs::CPUArch::v7));
+  EXPECT_TRUE(
+      testARMArch("armv7ve", "generic", "v7ve",
+                          ARMBuildAttrs::CPUArch::v7));
+  EXPECT_TRUE(
+      testARMArch("armv7-r", "cortex-r4", "v7r",
+                          ARMBuildAttrs::CPUArch::v7));
+  EXPECT_TRUE(
+      testARMArch("armv7-m", "cortex-m3", "v7m",
+                          ARMBuildAttrs::CPUArch::v7));
+  EXPECT_TRUE(
+      testARMArch("armv7e-m", "cortex-m4", "v7em",
+                          ARMBuildAttrs::CPUArch::v7E_M));
+  EXPECT_TRUE(
+      testARMArch("armv8-a", "generic", "v8a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.1-a", "generic", "v8.1a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.2-a", "generic", "v8.2a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.3-a", "generic", "v8.3a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.4-a", "generic", "v8.4a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.5-a", "generic", "v8.5a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.6-a", "generic", "v8.6a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.7-a", "generic", "v8.7a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testARMArch("armv8.8-a", "generic", "v8.8a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv8.9-a", "generic", "v8.9a",
+                          ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(
+      testARMArch("armv9-a", "generic", "v9a",
+                          ARMBuildAttrs::CPUArch::v9_A));
+  EXPECT_TRUE(
+      testARMArch("armv9.1-a", "generic", "v9.1a",
+                          ARMBuildAttrs::CPUArch::v9_A));
+  EXPECT_TRUE(
+      testARMArch("armv9.2-a", "generic", "v9.2a",
+                          ARMBuildAttrs::CPUArch::v9_A));
+  EXPECT_TRUE(
+      testARMArch("armv9.3-a", "generic", "v9.3a",
+                          ARMBuildAttrs::CPUArch::v9_A));
+  EXPECT_TRUE(
+      testARMArch("armv9.4-a", "generic", "v9.4a",
+                          ARMBuildAttrs::CPUArch::v9_A));
+  EXPECT_TRUE(
+      testARMArch("armv8-r", "cortex-r52", "v8r",
+                          ARMBuildAttrs::CPUArch::v8_R));
+  EXPECT_TRUE(
+      testARMArch("armv8-m.base", "generic", "v8m.base",
+                          ARMBuildAttrs::CPUArch::v8_M_Base));
+  EXPECT_TRUE(
+      testARMArch("armv8-m.main", "generic", "v8m.main",
+                          ARMBuildAttrs::CPUArch::v8_M_Main));
+  EXPECT_TRUE(
+      testARMArch("armv8.1-m.main", "generic", "v8.1m.main",
+                          ARMBuildAttrs::CPUArch::v8_1_M_Main));
+  EXPECT_TRUE(
+      testARMArch("iwmmxt", "iwmmxt", "",
+                          ARMBuildAttrs::CPUArch::v5TE));
+  EXPECT_TRUE(
+      testARMArch("iwmmxt2", "generic", "",
+                          ARMBuildAttrs::CPUArch::v5TE));
+  EXPECT_TRUE(
+      testARMArch("xscale", "xscale", "v5e",
+                          ARMBuildAttrs::CPUArch::v5TE));
+  EXPECT_TRUE(
+      testARMArch("armv7s", "swift", "v7s",
+                          ARMBuildAttrs::CPUArch::v7));
+  EXPECT_TRUE(
+      testARMArch("armv7k", "generic", "v7k",
+                          ARMBuildAttrs::CPUArch::v7));
+}
+
+bool testARMExtension(StringRef CPUName,ARM::ArchKind ArchKind, StringRef ArchExt) {
+  return ARM::getDefaultExtensions(CPUName, ArchKind) &
+         ARM::parseArchExt(ArchExt);
+}
+
+TEST(TargetParserTest, testARMExtension) {
+  EXPECT_FALSE(testARMExtension("strongarm", ARM::ArchKind::INVALID, "dsp"));
+  EXPECT_FALSE(testARMExtension("arm7tdmi", ARM::ArchKind::INVALID, "dsp"));
+  EXPECT_FALSE(testARMExtension("arm10tdmi",
+                                ARM::ArchKind::INVALID, "simd"));
+  EXPECT_FALSE(testARMExtension("arm1022e", ARM::ArchKind::INVALID, "simd"));
+  EXPECT_FALSE(testARMExtension("arm926ej-s",
+                                ARM::ArchKind::INVALID, "simd"));
+  EXPECT_FALSE(testARMExtension("arm1136jf-s",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("arm1156t2-s",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("arm1176jzf-s",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-m0",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-a8",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-r4",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-m3",
+                                ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-a53",
+                                ARM::ArchKind::INVALID, "ras"));
+  EXPECT_FALSE(testARMExtension("cortex-a53",
+                                ARM::ArchKind::INVALID, "fp16"));
+  EXPECT_TRUE(testARMExtension("cortex-a55",
+                                ARM::ArchKind::INVALID, "fp16"));
+  EXPECT_FALSE(testARMExtension("cortex-a55",
+                                ARM::ArchKind::INVALID, "fp16fml"));
+  EXPECT_TRUE(testARMExtension("cortex-a75",
+                                ARM::ArchKind::INVALID, "fp16"));
+  EXPECT_FALSE(testARMExtension("cortex-a75",
+                                ARM::ArchKind::INVALID, "fp16fml"));
+  EXPECT_FALSE(testARMExtension("cortex-r52",
+                                ARM::ArchKind::INVALID, "ras"));
+  EXPECT_FALSE(testARMExtension("iwmmxt", ARM::ArchKind::INVALID, "crc"));
+  EXPECT_FALSE(testARMExtension("xscale", ARM::ArchKind::INVALID, "crc"));
+  EXPECT_FALSE(testARMExtension("swift", ARM::ArchKind::INVALID, "crc"));
+
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4, "dsp"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV4T, "dsp"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5T, "simd"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5TE, "simd"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5TEJ, "simd"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6K, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic",
+                                ARM::ArchKind::ARMV6T2, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic",
+                                ARM::ArchKind::ARMV6KZ, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6M, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7A, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7R, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7M, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic",
+                                ARM::ArchKind::ARMV7EM, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8A, "ras"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_1A, "ras"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "profile"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "fp16"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "fp16fml"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_3A, "fp16"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_3A, "fp16fml"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16fml"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8R, "ras"));
+  EXPECT_FALSE(testARMExtension("generic",
+                                ARM::ArchKind::ARMV8MBaseline, "crc"));
+  EXPECT_FALSE(testARMExtension("generic",
+                                ARM::ArchKind::ARMV8MMainline, "crc"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::IWMMXT, "crc"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::IWMMXT2, "crc"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::XSCALE, "crc"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7S, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7K, "crypto"));
+}
+
+TEST(TargetParserTest, ARMFPUVersion) {
+  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
+       FK <= ARM::FPUKind::FK_LAST;
+       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1))
+    if (FK == ARM::FK_LAST || ARM::getFPUName(FK) == "invalid" ||
+        ARM::getFPUName(FK) == "none" || ARM::getFPUName(FK) == "softvfp")
+      EXPECT_EQ(ARM::FPUVersion::NONE, ARM::getFPUVersion(FK));
+    else
+      EXPECT_NE(ARM::FPUVersion::NONE, ARM::getFPUVersion(FK));
+}
+
+TEST(TargetParserTest, ARMFPUNeonSupportLevel) {
+  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
+       FK <= ARM::FPUKind::FK_LAST;
+       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1))
+    if (FK == ARM::FK_LAST ||
+        ARM::getFPUName(FK).find("neon") == std::string::npos)
+      EXPECT_EQ(ARM::NeonSupportLevel::None,
+                 ARM::getFPUNeonSupportLevel(FK));
+    else
+      EXPECT_NE(ARM::NeonSupportLevel::None,
+                ARM::getFPUNeonSupportLevel(FK));
+}
+
+TEST(TargetParserTest, ARMFPURestriction) {
+  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
+       FK <= ARM::FPUKind::FK_LAST;
+       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1)) {
+    if (FK == ARM::FK_LAST ||
+        (ARM::getFPUName(FK).find("d16") == std::string::npos &&
+         ARM::getFPUName(FK).find("vfpv3xd") == std::string::npos))
+      EXPECT_EQ(ARM::FPURestriction::None, ARM::getFPURestriction(FK));
+    else
+      EXPECT_NE(ARM::FPURestriction::None, ARM::getFPURestriction(FK));
+  }
+}
+
+TEST(TargetParserTest, ARMExtensionFeatures) {
+  std::map<uint64_t, std::vector<StringRef>> Extensions;
+
+  for (auto &Ext : ARM::ARCHExtNames) {
+    if (!Ext.Feature.empty() && !Ext.NegFeature.empty())
+      Extensions[Ext.ID] = {Ext.Feature, Ext.NegFeature};
+  }
+
+  Extensions[ARM::AEK_HWDIVARM]   = { "+hwdiv-arm", "-hwdiv-arm" };
+  Extensions[ARM::AEK_HWDIVTHUMB] = { "+hwdiv",     "-hwdiv" };
+
+  std::vector<StringRef> Features;
+
+  EXPECT_FALSE(ARM::getExtensionFeatures(ARM::AEK_INVALID, Features));
+
+  for (auto &E : Extensions) {
+    // test +extension
+    Features.clear();
+    ARM::getExtensionFeatures(E.first, Features);
+    EXPECT_TRUE(llvm::is_contained(Features, E.second.at(0)));
+    EXPECT_EQ(Extensions.size(), Features.size());
+
+    // test -extension
+    Features.clear();
+    ARM::getExtensionFeatures(~E.first, Features);
+    EXPECT_TRUE(llvm::is_contained(Features, E.second.at(1)));
+    EXPECT_EQ(Extensions.size(), Features.size());
+  }
+}
+
+TEST(TargetParserTest, ARMFPUFeatures) {
+  std::vector<StringRef> Features;
+  for (ARM::FPUKind FK = static_cast<ARM::FPUKind>(0);
+       FK <= ARM::FPUKind::FK_LAST;
+       FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1)) {
+    if (FK == ARM::FK_INVALID || FK >= ARM::FK_LAST)
+      EXPECT_FALSE(ARM::getFPUFeatures(FK, Features));
+    else
+      EXPECT_TRUE(ARM::getFPUFeatures(FK, Features));
+  }
+}
+
+TEST(TargetParserTest, ARMArchExtFeature) {
+  const char *ArchExt[][4] = {{"crc", "nocrc", "+crc", "-crc"},
+                              {"crypto", "nocrypto", "+crypto", "-crypto"},
+                              {"dsp", "nodsp", "+dsp", "-dsp"},
+                              {"fp", "nofp", nullptr, nullptr},
+                              {"idiv", "noidiv", nullptr, nullptr},
+                              {"mp", "nomp", nullptr, nullptr},
+                              {"simd", "nosimd", nullptr, nullptr},
+                              {"sec", "nosec", nullptr, nullptr},
+                              {"virt", "novirt", nullptr, nullptr},
+                              {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
+                              {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
+                              {"ras", "noras", "+ras", "-ras"},
+                              {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
+                              {"os", "noos", nullptr, nullptr},
+                              {"iwmmxt", "noiwmmxt", nullptr, nullptr},
+                              {"iwmmxt2", "noiwmmxt2", nullptr, nullptr},
+                              {"maverick", "maverick", nullptr, nullptr},
+                              {"xscale", "noxscale", nullptr, nullptr},
+                              {"sb", "nosb", "+sb", "-sb"},
+                              {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
+                              {"mve", "nomve", "+mve", "-mve"},
+                              {"mve.fp", "nomve.fp", "+mve.fp", "-mve.fp"}};
+
+  for (unsigned i = 0; i < std::size(ArchExt); i++) {
+    EXPECT_EQ(StringRef(ArchExt[i][2]), ARM::getArchExtFeature(ArchExt[i][0]));
+    EXPECT_EQ(StringRef(ArchExt[i][3]), ARM::getArchExtFeature(ArchExt[i][1]));
+  }
+}
+
+static bool
+testArchExtDependency(const char *ArchExt,
+                      const std::initializer_list<const char *> &Expected) {
+  std::vector<StringRef> Features;
+  ARM::FPUKind FPUKind;
+
+  if (!ARM::appendArchExtFeatures("", ARM::ArchKind::ARMV8_1MMainline, ArchExt,
+                                  Features, FPUKind))
+    return false;
+
+  return llvm::all_of(Expected, [&](StringRef Ext) {
+    return llvm::is_contained(Features, Ext);
+  });
+}
+
+TEST(TargetParserTest, ARMArchExtDependencies) {
+  EXPECT_TRUE(testArchExtDependency("mve", {"+mve", "+dsp"}));
+  EXPECT_TRUE(testArchExtDependency("mve.fp", {"+mve.fp", "+mve", "+dsp"}));
+  EXPECT_TRUE(testArchExtDependency("nodsp", {"-dsp", "-mve", "-mve.fp"}));
+  EXPECT_TRUE(testArchExtDependency("nomve", {"-mve", "-mve.fp"}));
+}
+
+TEST(TargetParserTest, ARMparseHWDiv) {
+  const char *hwdiv[] = {"thumb", "arm", "arm,thumb", "thumb,arm"};
+
+  for (unsigned i = 0; i < std::size(hwdiv); i++)
+    EXPECT_NE(ARM::AEK_INVALID, ARM::parseHWDiv((StringRef)hwdiv[i]));
+}
+
+TEST(TargetParserTest, ARMparseArchEndianAndISA) {
+  const char *Arch[] = {
+      "v2",        "v2a",    "v3",    "v3m",    "v4",       "v4t",
+      "v5",        "v5t",    "v5e",   "v5te",   "v5tej",    "v6",
+      "v6j",       "v6k",    "v6hl",  "v6t2",   "v6kz",     "v6z",
+      "v6zk",      "v6-m",   "v6m",   "v6sm",   "v6s-m",    "v7-a",
+      "v7",        "v7a",    "v7ve",  "v7hl",   "v7l",      "v7-r",
+      "v7r",       "v7-m",   "v7m",   "v7k",    "v7s",      "v7e-m",
+      "v7em",      "v8-a",   "v8",    "v8a",    "v8l",      "v8.1-a",
+      "v8.1a",     "v8.2-a", "v8.2a", "v8.3-a", "v8.3a",    "v8.4-a",
+      "v8.4a",     "v8.5-a", "v8.5a", "v8.6-a", "v8.6a",    "v8.7-a",
+      "v8.7a",     "v8.8-a", "v8.8a", "v8-r",   "v8m.base", "v8m.main",
+      "v8.1m.main"};
+
+  for (unsigned i = 0; i < std::size(Arch); i++) {
+    std::string arm_1 = "armeb" + (std::string)(Arch[i]);
+    std::string arm_2 = "arm" + (std::string)(Arch[i]) + "eb";
+    std::string arm_3 = "arm" + (std::string)(Arch[i]);
+    std::string thumb_1 = "thumbeb" + (std::string)(Arch[i]);
+    std::string thumb_2 = "thumb" + (std::string)(Arch[i]) + "eb";
+    std::string thumb_3 = "thumb" + (std::string)(Arch[i]);
+
+    EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(arm_1));
+    EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(arm_2));
+    EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian(arm_3));
+
+    EXPECT_EQ(ARM::ISAKind::ARM, ARM::parseArchISA(arm_1));
+    EXPECT_EQ(ARM::ISAKind::ARM, ARM::parseArchISA(arm_2));
+    EXPECT_EQ(ARM::ISAKind::ARM, ARM::parseArchISA(arm_3));
+    if (i >= 4) {
+      EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(thumb_1));
+      EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian(thumb_2));
+      EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian(thumb_3));
+
+      EXPECT_EQ(ARM::ISAKind::THUMB, ARM::parseArchISA(thumb_1));
+      EXPECT_EQ(ARM::ISAKind::THUMB, ARM::parseArchISA(thumb_2));
+      EXPECT_EQ(ARM::ISAKind::THUMB, ARM::parseArchISA(thumb_3));
+    }
+  }
+
+  EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian("aarch64"));
+  EXPECT_EQ(ARM::EndianKind::LITTLE, ARM::parseArchEndian("arm64_32"));
+  EXPECT_EQ(ARM::EndianKind::BIG, ARM::parseArchEndian("aarch64_be"));
+
+  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("aarch64"));
+  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("aarch64_be"));
+  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("arm64"));
+  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("arm64_be"));
+  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("arm64_32"));
+  EXPECT_EQ(ARM::ISAKind::AARCH64, ARM::parseArchISA("aarch64_32"));
+}
+
+TEST(TargetParserTest, ARMparseArchProfile) {
+  for (unsigned i = 0; i < std::size(ARMArch); i++) {
+    switch (ARM::parseArch(ARMArch[i])) {
+    case ARM::ArchKind::ARMV6M:
+    case ARM::ArchKind::ARMV7M:
+    case ARM::ArchKind::ARMV7EM:
+    case ARM::ArchKind::ARMV8MMainline:
+    case ARM::ArchKind::ARMV8MBaseline:
+    case ARM::ArchKind::ARMV8_1MMainline:
+      EXPECT_EQ(ARM::ProfileKind::M, ARM::parseArchProfile(ARMArch[i]));
+      break;
+    case ARM::ArchKind::ARMV7R:
+    case ARM::ArchKind::ARMV8R:
+      EXPECT_EQ(ARM::ProfileKind::R, ARM::parseArchProfile(ARMArch[i]));
+      break;
+    case ARM::ArchKind::ARMV7A:
+    case ARM::ArchKind::ARMV7VE:
+    case ARM::ArchKind::ARMV7K:
+    case ARM::ArchKind::ARMV8A:
+    case ARM::ArchKind::ARMV8_1A:
+    case ARM::ArchKind::ARMV8_2A:
+    case ARM::ArchKind::ARMV8_3A:
+    case ARM::ArchKind::ARMV8_4A:
+    case ARM::ArchKind::ARMV8_5A:
+    case ARM::ArchKind::ARMV8_6A:
+    case ARM::ArchKind::ARMV8_7A:
+    case ARM::ArchKind::ARMV8_8A:
+    case ARM::ArchKind::ARMV8_9A:
+    case ARM::ArchKind::ARMV9A:
+    case ARM::ArchKind::ARMV9_1A:
+    case ARM::ArchKind::ARMV9_2A:
+    case ARM::ArchKind::ARMV9_3A:
+    case ARM::ArchKind::ARMV9_4A:
+      EXPECT_EQ(ARM::ProfileKind::A, ARM::parseArchProfile(ARMArch[i]));
+      break;
+    default:
+      EXPECT_EQ(ARM::ProfileKind::INVALID, ARM::parseArchProfile(ARMArch[i]));
+      break;
+    }
+  }
+}
+
+TEST(TargetParserTest, ARMparseArchVersion) {
+  for (unsigned i = 0; i < std::size(ARMArch); i++)
+    if (((std::string)ARMArch[i]).substr(0, 4) == "armv")
+      EXPECT_EQ((ARMArch[i][4] - 48u), ARM::parseArchVersion(ARMArch[i]));
+    else
+      EXPECT_EQ(5u, ARM::parseArchVersion(ARMArch[i]));
+}
+
+TEST(TargetParserTest, getARMCPUForArch) {
+  // Platform specific defaults.
+  {
+    llvm::Triple Triple("arm--nacl");
+    EXPECT_EQ("cortex-a8", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("arm--openbsd");
+    EXPECT_EQ("cortex-a8", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armv6-unknown-freebsd");
+    EXPECT_EQ("arm1176jzf-s", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("thumbv6-unknown-freebsd");
+    EXPECT_EQ("arm1176jzf-s", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armebv6-unknown-freebsd");
+    EXPECT_EQ("arm1176jzf-s", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("arm--win32");
+    EXPECT_EQ("cortex-a9", ARM::getARMCPUForArch(Triple));
+    EXPECT_EQ("generic", ARM::getARMCPUForArch(Triple, "armv8-a"));
+  }
+  // Some alternative architectures
+  {
+    llvm::Triple Triple("armv7k-apple-ios9");
+    EXPECT_EQ("cortex-a7", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armv7k-apple-watchos3");
+    EXPECT_EQ("cortex-a7", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armv7k-apple-tvos9");
+    EXPECT_EQ("cortex-a7", ARM::getARMCPUForArch(Triple));
+  }
+  // armeb is permitted, but armebeb is not
+  {
+    llvm::Triple Triple("armeb-none-eabi");
+    EXPECT_EQ("arm7tdmi", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armebeb-none-eabi");
+    EXPECT_EQ("", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armebv6eb-none-eabi");
+    EXPECT_EQ("", ARM::getARMCPUForArch(Triple));
+  }
+  // xscaleeb is permitted, but armebxscale is not
+  {
+    llvm::Triple Triple("xscaleeb-none-eabi");
+    EXPECT_EQ("xscale", ARM::getARMCPUForArch(Triple));
+  }
+  {
+    llvm::Triple Triple("armebxscale-none-eabi");
+    EXPECT_EQ("", ARM::getARMCPUForArch(Triple));
+  }
+}
+
+class AArch64CPUTestFixture
+    : public ::testing::TestWithParam<ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>> {};
+
+TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
+  ARMCPUTestParams params = GetParam();
+
+  const std::optional<AArch64::CpuInfo> Cpu = AArch64::parseCpu(params.CPUName);
+  EXPECT_TRUE(Cpu);
+  EXPECT_EQ(params.ExpectedArch, Cpu->Arch.Name);
+
+  EXPECT_PRED_FORMAT2(
+      AssertSameExtensionFlags<ARM::ISAKind::AARCH64>(params.CPUName),
+      params.ExpectedFlags, Cpu->getImpliedExtensions());
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    AArch64CPUTests, AArch64CPUTestFixture,
+    ::testing::Values(
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP, AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                             AArch64::AEK_LSE, AArch64::AEK_RDM,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a510", "armv9-a", "neon-fp-armv8",
+                        (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP,
+                            AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                            AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_BF16,
+                            AArch64::AEK_I8MM, AArch64::AEK_SVE, AArch64::AEK_SVE2,
+                            AArch64::AEK_SVE2BITPERM, AArch64::AEK_PAUTH,
+                            AArch64::AEK_MTE, AArch64::AEK_SSBS, AArch64::AEK_FP16,
+                            AArch64::AEK_FP16FML, AArch64::AEK_SB})),
+            "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_FP16,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RCPC, AArch64::AEK_RDM,
+                             AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_FP16,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RCPC, AArch64::AEK_RDM,
+                             AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                             AArch64::AEK_LSE, AArch64::AEK_RDM,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+                             AArch64::AEK_PROFILE})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_CRC, AArch64::AEK_AES,
+                AArch64::AEK_SHA2, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                AArch64::AEK_FP16, AArch64::AEK_DOTPROD, AArch64::AEK_RCPC,
+                AArch64::AEK_SSBS, AArch64::AEK_PROFILE, AArch64::AEK_FLAGM,
+                AArch64::AEK_PAUTH, AArch64::AEK_FP16FML})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a710", "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_MTE,
+                AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SVE,
+                AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+                AArch64::AEK_PAUTH, AArch64::AEK_FLAGM, AArch64::AEK_SB,
+                AArch64::AEK_I8MM, AArch64::AEK_BF16})),
+            "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a715", "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_BF16,
+                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
+                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_SVE,
+                AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+                AArch64::AEK_SSBS, AArch64::AEK_SB, AArch64::AEK_I8MM,
+                AArch64::AEK_PERFMON, AArch64::AEK_PREDRES,
+                AArch64::AEK_PROFILE, AArch64::AEK_FP16FML,
+                AArch64::AEK_FP16, AArch64::AEK_FLAGM})),
+            "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_SVE, AArch64::AEK_SSBS,
+                AArch64::AEK_RCPC, AArch64::AEK_CRC, AArch64::AEK_FP,
+                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
+                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                AArch64::AEK_SM4, AArch64::AEK_FP16, AArch64::AEK_BF16,
+                AArch64::AEK_PROFILE, AArch64::AEK_RAND,
+                AArch64::AEK_FP16FML, AArch64::AEK_I8MM})),
+            "8.4-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("neoverse-v2", "armv9-a", "neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_SVE,
+                             AArch64::AEK_SSBS, AArch64::AEK_RCPC,
+                             AArch64::AEK_CRC, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_MTE,
+                             AArch64::AEK_LSE, AArch64::AEK_RDM,
+                             AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP16, AArch64::AEK_BF16,
+                             AArch64::AEK_SVE2, AArch64::AEK_PROFILE,
+                             AArch64::AEK_FP16FML, AArch64::AEK_I8MM,
+                             AArch64::AEK_SVE2BITPERM, AArch64::AEK_RAND})),
+                         "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_RDM,
+                             AArch64::AEK_SSBS, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_FP16, AArch64::AEK_FP16FML,
+                             AArch64::AEK_RAS, AArch64::AEK_RCPC,
+                             AArch64::AEK_LSE, AArch64::AEK_SB})),
+                         "8-R"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+                             AArch64::AEK_PROFILE})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+                             AArch64::AEK_PAUTH, AArch64::AEK_PROFILE})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-x2", "armv9-a", "neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                             AArch64::AEK_LSE, AArch64::AEK_RDM,
+                             AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_MTE, AArch64::AEK_PAUTH,
+                             AArch64::AEK_I8MM, AArch64::AEK_BF16,
+                             AArch64::AEK_SVE, AArch64::AEK_SVE2,
+                             AArch64::AEK_SVE2BITPERM, AArch64::AEK_SSBS,
+                             AArch64::AEK_SB, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML})),
+                         "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-x3",
+            "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_BF16,
+                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
+                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_SVE,
+                AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM, AArch64::AEK_SB,
+                AArch64::AEK_PROFILE, AArch64::AEK_PERFMON,
+                AArch64::AEK_I8MM, AArch64::AEK_FP16, AArch64::AEK_FP16FML,
+                AArch64::AEK_PREDRES, AArch64::AEK_FLAGM, AArch64::AEK_SSBS})),
+            "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cyclone", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_FP16})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_LSE,
+                             AArch64::AEK_RAS, AArch64::AEK_RDM,
+                             AArch64::AEK_RCPC, AArch64::AEK_FP16})),
+                         "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
+                         "8.4-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
+                         "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+                             AArch64::AEK_BF16, AArch64::AEK_I8MM})),
+                         "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+                             AArch64::AEK_BF16, AArch64::AEK_I8MM})),
+                         "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
+                         "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                             AArch64::AEK_FP, AArch64::AEK_SIMD,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+                             AArch64::AEK_BF16, AArch64::AEK_I8MM})),
+                         "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_LSE,
+                             AArch64::AEK_RAS, AArch64::AEK_RDM,
+                             AArch64::AEK_RCPC, AArch64::AEK_FP16})),
+                         "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_LSE,
+                             AArch64::AEK_RAS, AArch64::AEK_RDM,
+                             AArch64::AEK_RCPC, AArch64::AEK_FP16})),
+                         "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_FP16,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_FP16,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("falkor", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_RDM})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("kryo", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_FP16,
+                             AArch64::AEK_LSE, AArch64::AEK_RAS,
+                             AArch64::AEK_RCPC, AArch64::AEK_RDM,
+                             AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+                             AArch64::AEK_FP, AArch64::AEK_FP16,
+                             AArch64::AEK_LSE, AArch64::AEK_PROFILE,
+                             AArch64::AEK_RAS, AArch64::AEK_RCPC,
+                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                             AArch64::AEK_SSBS})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                AArch64::AEK_SHA3, AArch64::AEK_SM4, AArch64::AEK_FP,
+                AArch64::AEK_SIMD, AArch64::AEK_FP16, AArch64::AEK_RAS,
+                AArch64::AEK_LSE, AArch64::AEK_SVE, AArch64::AEK_DOTPROD,
+                AArch64::AEK_RCPC, AArch64::AEK_RDM, AArch64::AEK_MTE,
+                AArch64::AEK_SSBS, AArch64::AEK_SB, AArch64::AEK_SVE2,
+                AArch64::AEK_SVE2BITPERM, AArch64::AEK_BF16,
+                AArch64::AEK_I8MM})),
+            "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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_SHA3, AArch64::AEK_BF16, AArch64::AEK_SHA2,
+                AArch64::AEK_AES, AArch64::AEK_I8MM, AArch64::AEK_SSBS,
+                AArch64::AEK_SB, AArch64::AEK_RAND})),
+            "8.6-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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_RAND,
+                AArch64::AEK_MTE})),
+            "8.6-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_SVE, AArch64::AEK_SSBS,
+                AArch64::AEK_RCPC, AArch64::AEK_CRC, AArch64::AEK_FP,
+                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
+                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                AArch64::AEK_SM4, AArch64::AEK_FP16, AArch64::AEK_BF16,
+                AArch64::AEK_PROFILE, AArch64::AEK_RAND,
+                AArch64::AEK_FP16FML, AArch64::AEK_I8MM})),
+            "8.4-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_LSE,
+                             AArch64::AEK_RDM, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD})),
+                         "8.1-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_LSE,
+                             AArch64::AEK_RDM, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                             AArch64::AEK_RCPC})),
+                         "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderx", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
+                             AArch64::AEK_FP})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
+                             AArch64::AEK_FP})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
+                             AArch64::AEK_FP})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
+                             AArch64::AEK_FP})),
+                         "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                             AArch64::AEK_LSE, AArch64::AEK_RDM,
+                             AArch64::AEK_PROFILE, AArch64::AEK_FP16,
+                             AArch64::AEK_FP16FML, AArch64::AEK_DOTPROD})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_FP16,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_SVE, AArch64::AEK_RDM})),
+                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
+                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
+                             AArch64::AEK_SHA2, AArch64::AEK_FP,
+                             AArch64::AEK_SIMD, AArch64::AEK_FP16,
+                             AArch64::AEK_RAS, AArch64::AEK_LSE,
+                             AArch64::AEK_RDM})),
+                         "8.2-A")));
+
+// Note: number of CPUs includes aliases.
+static constexpr unsigned NumAArch64CPUArchs = 62;
+
+TEST(TargetParserTest, testAArch64CPUArchList) {
+  SmallVector<StringRef, NumAArch64CPUArchs> List;
+  AArch64::fillValidCPUArchList(List);
+
+  // No list exists for these in this test suite, so ensure all are
+  // valid, and match the expected 'magic' count.
+  EXPECT_EQ(List.size(), NumAArch64CPUArchs);
+  for(StringRef CPU : List) {
+    EXPECT_TRUE(AArch64::parseCpu(CPU));
+  }
+}
+
+bool testAArch64Arch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
+                     unsigned ArchAttr) {
+  const std::optional<AArch64::ArchInfo> AI = AArch64::parseArch(Arch);
+  return AI.has_value();
+}
+
+TEST(TargetParserTest, testAArch64Arch) {
+  EXPECT_TRUE(testAArch64Arch("armv8-a", "cortex-a53", "v8a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.1-a", "generic", "v8.1a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.2-a", "generic", "v8.2a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.3-a", "generic", "v8.3a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.4-a", "generic", "v8.4a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.5-a", "generic", "v8.5a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.6-a", "generic", "v8.6a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.7-a", "generic", "v8.7a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.8-a", "generic", "v8.8a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv8.9-a", "generic", "v8.9a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9-a", "generic", "v9a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.1-a", "generic", "v9.1a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.2-a", "generic", "v9.2a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.3-a", "generic", "v9.3a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testAArch64Arch("armv9.4-a", "generic", "v9.4a",
+                              ARMBuildAttrs::CPUArch::v8_A));
+}
+
+bool testAArch64Extension(StringRef CPUName, StringRef ArchExt) {
+  std::optional<AArch64::ExtensionInfo> Extension =
+      AArch64::parseArchExtension(ArchExt);
+  if (!Extension)
+    return false;
+  std::optional<AArch64::CpuInfo> CpuInfo = AArch64::parseCpu(CPUName);
+  return CpuInfo->getImpliedExtensions().test(Extension->ID);
+}
+
+bool testAArch64Extension(const AArch64::ArchInfo &AI, StringRef ArchExt) {
+  std::optional<AArch64::ExtensionInfo> Extension =
+      AArch64::parseArchExtension(ArchExt);
+  if (!Extension)
+    return false;
+  return AI.DefaultExts.test(Extension->ID);
+}
+
+TEST(TargetParserTest, testAArch64Extension) {
+  EXPECT_FALSE(testAArch64Extension("cortex-a34", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a35", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a53", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a55", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a55", "dotprod"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a57", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a72", "ras"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a73", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("cortex-a75", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-a75", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "ras"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("cortex-r82", "lse"));
+  EXPECT_FALSE(testAArch64Extension("cyclone", "ras"));
+  EXPECT_FALSE(testAArch64Extension("exynos-m3", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "lse"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m4", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "lse"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "ras"));
+  EXPECT_TRUE(testAArch64Extension("exynos-m5", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("falkor", "rdm"));
+  EXPECT_FALSE(testAArch64Extension("kryo", "ras"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "crc"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "lse"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "rdm"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "ras"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "rcpc"));
+  EXPECT_TRUE(testAArch64Extension("saphira", "profile"));
+  EXPECT_FALSE(testAArch64Extension("saphira", "fp16"));
+  EXPECT_FALSE(testAArch64Extension("thunderx2t99", "ras"));
+  EXPECT_FALSE(testAArch64Extension("thunderx", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt81", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt83", "lse"));
+  EXPECT_FALSE(testAArch64Extension("thunderxt88", "lse"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "aes"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "sha2"));
+  EXPECT_FALSE(testAArch64Extension("tsv110", "sha3"));
+  EXPECT_FALSE(testAArch64Extension("tsv110", "sm4"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "ras"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "profile"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "fp16fml"));
+  EXPECT_TRUE(testAArch64Extension("tsv110", "dotprod"));
+  EXPECT_TRUE(testAArch64Extension("a64fx", "fp16"));
+  EXPECT_TRUE(testAArch64Extension("a64fx", "sve"));
+  EXPECT_FALSE(testAArch64Extension("a64fx", "sve2"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "aes"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "sha2"));
+  EXPECT_TRUE(testAArch64Extension("carmel", "fp16"));
+
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8A, "ras"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_1A, "ras"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "profile"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_2A, "fp16fml"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_3A, "fp16fml"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16"));
+  EXPECT_FALSE(testAArch64Extension(AArch64::ARMV8_4A, "fp16fml"));
+}
+
+TEST(TargetParserTest, AArch64ExtensionFeatures) {
+  std::vector<uint64_t> Extensions = {
+      AArch64::AEK_CRC,     AArch64::AEK_LSE,       AArch64::AEK_RDM,
+      AArch64::AEK_CRYPTO,  AArch64::AEK_SM4,       AArch64::AEK_SHA3,
+      AArch64::AEK_SHA2,    AArch64::AEK_AES,       AArch64::AEK_DOTPROD,
+      AArch64::AEK_FP,      AArch64::AEK_SIMD,      AArch64::AEK_FP16,
+      AArch64::AEK_FP16FML, AArch64::AEK_PROFILE,   AArch64::AEK_RAS,
+      AArch64::AEK_SVE,     AArch64::AEK_SVE2,      AArch64::AEK_SVE2AES,
+      AArch64::AEK_SVE2SM4, AArch64::AEK_SVE2SHA3,  AArch64::AEK_SVE2BITPERM,
+      AArch64::AEK_RCPC,    AArch64::AEK_RAND,      AArch64::AEK_MTE,
+      AArch64::AEK_SSBS,    AArch64::AEK_SB,        AArch64::AEK_PREDRES,
+      AArch64::AEK_BF16,    AArch64::AEK_I8MM,      AArch64::AEK_F32MM,
+      AArch64::AEK_F64MM,   AArch64::AEK_TME,       AArch64::AEK_LS64,
+      AArch64::AEK_BRBE,    AArch64::AEK_PAUTH,     AArch64::AEK_FLAGM,
+      AArch64::AEK_SME,     AArch64::AEK_SMEF64F64, AArch64::AEK_SMEI16I64,
+      AArch64::AEK_SME2,    AArch64::AEK_HBC,       AArch64::AEK_MOPS,
+      AArch64::AEK_PERFMON, AArch64::AEK_SVE2p1,    AArch64::AEK_SME2p1,
+      AArch64::AEK_B16B16,  AArch64::AEK_SMEF16F16, AArch64::AEK_CSSC,
+      AArch64::AEK_RCPC3,   AArch64::AEK_THE,       AArch64::AEK_D128,
+      AArch64::AEK_LSE128,  AArch64::AEK_SPECRES2,  AArch64::AEK_RASv2,
+      AArch64::AEK_ITE,     AArch64::AEK_GCS,
+  };
+
+  std::vector<StringRef> Features;
+
+  Bitset<AArch64::AEK_EXTENTIONS_MAX> ExtVal;
+  for (auto Ext : Extensions)
+    ExtVal.set(Ext);
+
+  // NONE has no feature names.
+  // We return True here because NONE is a valid choice.
+  EXPECT_TRUE(AArch64::getExtensionFeatures(Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE}), Features));
+  EXPECT_TRUE(!Features.size());
+
+  AArch64::getExtensionFeatures(ExtVal, Features);
+  EXPECT_EQ(Extensions.size(), Features.size());
+
+  EXPECT_TRUE(llvm::is_contained(Features, "+crc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rdm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+crypto"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sha2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+dotprod"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp-armv8"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+neon"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fullfp16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+fp16fml"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+spe"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ras"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-aes"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sm4"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-sha3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2-bitperm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sve2p1"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+b16b16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rand"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mte"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ssbs"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sb"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+predres"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+bf16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+i8mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f32mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+f64mm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+tme"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ls64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+brbe"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+hbc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+mops"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+perfmon"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+cssc"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+rcpc3"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+the"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
+  EXPECT_TRUE(llvm::is_contained(Features, "+gcs"));
+
+  // Assuming we listed every extension above, this should produce the same
+  // result. (note that AEK_NONE doesn't have a name so it won't be in the
+  // result despite its bit being set)
+  std::vector<StringRef> AllFeatures;
+  EXPECT_TRUE(AArch64::getExtensionFeatures(ExtVal, AllFeatures));
+  EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
+}
+
+TEST(TargetParserTest, AArch64ArchFeatures) {
+  EXPECT_EQ(AArch64::ARMV8A.ArchFeature, "+v8a");
+  EXPECT_EQ(AArch64::ARMV8_1A.ArchFeature, "+v8.1a");
+  EXPECT_EQ(AArch64::ARMV8_2A.ArchFeature, "+v8.2a");
+  EXPECT_EQ(AArch64::ARMV8_3A.ArchFeature, "+v8.3a");
+  EXPECT_EQ(AArch64::ARMV8_4A.ArchFeature, "+v8.4a");
+  EXPECT_EQ(AArch64::ARMV8_5A.ArchFeature, "+v8.5a");
+  EXPECT_EQ(AArch64::ARMV8_6A.ArchFeature, "+v8.6a");
+  EXPECT_EQ(AArch64::ARMV8_7A.ArchFeature, "+v8.7a");
+  EXPECT_EQ(AArch64::ARMV8_8A.ArchFeature, "+v8.8a");
+  EXPECT_EQ(AArch64::ARMV8_9A.ArchFeature, "+v8.9a");
+  EXPECT_EQ(AArch64::ARMV9A.ArchFeature, "+v9a");
+  EXPECT_EQ(AArch64::ARMV9_1A.ArchFeature, "+v9.1a");
+  EXPECT_EQ(AArch64::ARMV9_2A.ArchFeature, "+v9.2a");
+  EXPECT_EQ(AArch64::ARMV9_3A.ArchFeature, "+v9.3a");
+  EXPECT_EQ(AArch64::ARMV9_4A.ArchFeature, "+v9.4a");
+  EXPECT_EQ(AArch64::ARMV8R.ArchFeature, "+v8r");
+}
+
+TEST(TargetParserTest, AArch64ArchPartialOrder) {
+  for (const auto *A : AArch64::ArchInfos) {
+    EXPECT_EQ(*A, *A);
+
+    // v8r has no relation to other valid architectures
+    if (*A != AArch64::ARMV8R) {
+      EXPECT_FALSE(A->implies(AArch64::ARMV8R));
+      EXPECT_FALSE(AArch64::ARMV8R.implies(*A));
+    }
+  }
+
+  for (const auto *A : {
+           &AArch64::ARMV8_1A,
+           &AArch64::ARMV8_2A,
+           &AArch64::ARMV8_3A,
+           &AArch64::ARMV8_4A,
+           &AArch64::ARMV8_5A,
+           &AArch64::ARMV8_6A,
+           &AArch64::ARMV8_7A,
+           &AArch64::ARMV8_8A,
+           &AArch64::ARMV8_9A,
+       })
+    EXPECT_TRUE(A->implies(AArch64::ARMV8A));
+
+  for (const auto *A : {&AArch64::ARMV9_1A, &AArch64::ARMV9_2A,
+                        &AArch64::ARMV9_3A, &AArch64::ARMV9_4A})
+    EXPECT_TRUE(A->implies(AArch64::ARMV9A));
+
+  EXPECT_TRUE(AArch64::ARMV8_1A.implies(AArch64::ARMV8A));
+  EXPECT_TRUE(AArch64::ARMV8_2A.implies(AArch64::ARMV8_1A));
+  EXPECT_TRUE(AArch64::ARMV8_3A.implies(AArch64::ARMV8_2A));
+  EXPECT_TRUE(AArch64::ARMV8_4A.implies(AArch64::ARMV8_3A));
+  EXPECT_TRUE(AArch64::ARMV8_5A.implies(AArch64::ARMV8_4A));
+  EXPECT_TRUE(AArch64::ARMV8_6A.implies(AArch64::ARMV8_5A));
+  EXPECT_TRUE(AArch64::ARMV8_7A.implies(AArch64::ARMV8_6A));
+  EXPECT_TRUE(AArch64::ARMV8_8A.implies(AArch64::ARMV8_7A));
+  EXPECT_TRUE(AArch64::ARMV8_9A.implies(AArch64::ARMV8_8A));
+
+  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV9A));
+  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV9_1A));
+  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV9_2A));
+  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV9_3A));
+
+  EXPECT_TRUE(AArch64::ARMV9A.implies(AArch64::ARMV8_5A));
+  EXPECT_TRUE(AArch64::ARMV9_1A.implies(AArch64::ARMV8_6A));
+  EXPECT_TRUE(AArch64::ARMV9_2A.implies(AArch64::ARMV8_7A));
+  EXPECT_TRUE(AArch64::ARMV9_3A.implies(AArch64::ARMV8_8A));
+  EXPECT_TRUE(AArch64::ARMV9_4A.implies(AArch64::ARMV8_9A));
+}
+
+TEST(TargetParserTest, AArch64ArchExtFeature) {
+  const char *ArchExt[][4] = {
+      {"crc", "nocrc", "+crc", "-crc"},
+      {"crypto", "nocrypto", "+crypto", "-crypto"},
+      {"flagm", "noflagm", "+flagm", "-flagm"},
+      {"fp", "nofp", "+fp-armv8", "-fp-armv8"},
+      {"simd", "nosimd", "+neon", "-neon"},
+      {"fp16", "nofp16", "+fullfp16", "-fullfp16"},
+      {"fp16fml", "nofp16fml", "+fp16fml", "-fp16fml"},
+      {"profile", "noprofile", "+spe", "-spe"},
+      {"ras", "noras", "+ras", "-ras"},
+      {"lse", "nolse", "+lse", "-lse"},
+      {"rdm", "nordm", "+rdm", "-rdm"},
+      {"sve", "nosve", "+sve", "-sve"},
+      {"sve2", "nosve2", "+sve2", "-sve2"},
+      {"sve2-aes", "nosve2-aes", "+sve2-aes", "-sve2-aes"},
+      {"sve2-sm4", "nosve2-sm4", "+sve2-sm4", "-sve2-sm4"},
+      {"sve2-sha3", "nosve2-sha3", "+sve2-sha3", "-sve2-sha3"},
+      {"sve2p1", "nosve2p1", "+sve2p1", "-sve2p1"},
+      {"b16b16", "nob16b16", "+b16b16", "-b16b16"},
+      {"sve2-bitperm", "nosve2-bitperm", "+sve2-bitperm", "-sve2-bitperm"},
+      {"dotprod", "nodotprod", "+dotprod", "-dotprod"},
+      {"rcpc", "norcpc", "+rcpc", "-rcpc"},
+      {"rng", "norng", "+rand", "-rand"},
+      {"memtag", "nomemtag", "+mte", "-mte"},
+      {"tme", "notme", "+tme", "-tme"},
+      {"pauth", "nopauth", "+pauth", "-pauth"},
+      {"ssbs", "nossbs", "+ssbs", "-ssbs"},
+      {"sb", "nosb", "+sb", "-sb"},
+      {"predres", "nopredres", "+predres", "-predres"},
+      {"i8mm", "noi8mm", "+i8mm", "-i8mm"},
+      {"f32mm", "nof32mm", "+f32mm", "-f32mm"},
+      {"f64mm", "nof64mm", "+f64mm", "-f64mm"},
+      {"sme", "nosme", "+sme", "-sme"},
+      {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"},
+      {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"},
+      {"sme-f16f16", "nosme-f16f16", "+sme-f16f16", "-sme-f16f16"},
+      {"sme2", "nosme2", "+sme2", "-sme2"},
+      {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"},
+      {"hbc", "nohbc", "+hbc", "-hbc"},
+      {"mops", "nomops", "+mops", "-mops"},
+      {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},
+      {"predres2", "nopredres2", "+specres2", "-specres2"},
+      {"rasv2", "norasv2", "+rasv2", "-rasv2"},
+      {"gcs", "nogcs", "+gcs", "-gcs"},
+  };
+
+  for (unsigned i = 0; i < std::size(ArchExt); i++) {
+    EXPECT_EQ(StringRef(ArchExt[i][2]),
+              AArch64::getArchExtFeature(ArchExt[i][0]));
+    EXPECT_EQ(StringRef(ArchExt[i][3]),
+              AArch64::getArchExtFeature(ArchExt[i][1]));
+  }
+}
+
+} // namespace
diff --git a/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
index 728ecf57c07b10a..c676e06d952978f 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/TargetParser/BUILD.gn
@@ -10,8 +10,7 @@ unittest("TargetParserTests") {
   sources = [
     "CSKYTargetParserTest.cpp",
     "Host.cpp",
-    "ArmTargetParserTest.cpp",
-    "AArch64TargetParserTest.cpp",
+    "TargetParserTest.cpp",
     "TripleTest.cpp",
   ]
 }

>From 618418d97c2e1d154c615ccb90eebba94245f7aa Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi <hassnaa.hamdi at arm.com>
Date: Thu, 7 Sep 2023 23:04:36 +0000
Subject: [PATCH 3/3] Code Format

Change-Id: I746c95d9cf0006044e89be88447a866462df0515
---
 .../llvm/TargetParser/AArch64TargetParser.h   |  336 ++--
 llvm/lib/TargetParser/AArch64TargetParser.cpp |    5 +-
 .../TargetParser/TargetParserTest.cpp         | 1717 +++++++++--------
 3 files changed, 1086 insertions(+), 972 deletions(-)

diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 7b9c1eeb3aee25e..926d95d7a96ce9c 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -15,11 +15,11 @@
 #define LLVM_TARGETPARSER_AARCH64TARGETPARSER_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/Bitset.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/VersionTuple.h"
 #include <array>
 #include <vector>
-#include "llvm/ADT/Bitset.h"
 
 namespace llvm {
 
@@ -275,7 +275,8 @@ struct ArchInfo {
   ArchProfile Profile;   // Architecuture profile
   StringRef Name;        // Human readable name, e.g. "armv8.1-a"
   StringRef ArchFeature; // Command line feature flag, e.g. +v8a
-  Bitset<AArch64::AEK_EXTENTIONS_MAX> DefaultExts;  // bitfield of default extensions ArchExtKind
+  Bitset<AArch64::AEK_EXTENTIONS_MAX>
+      DefaultExts; // bitfield of default extensions ArchExtKind
 
   bool operator==(const ArchInfo &Other) const {
     return this->Name == Other.Name;
@@ -347,8 +348,9 @@ static constexpr std::array<const ArchInfo *, 16> ArchInfos = {
 struct CpuInfo {
   StringRef Name; // Name, as written for -mcpu.
   const ArchInfo &Arch;
-  Bitset<AArch64::AEK_EXTENTIONS_MAX> DefaultExtensions; // Default extensions for this CPU. These will be
-                              // ORd with the architecture defaults.
+  Bitset<AArch64::AEK_EXTENTIONS_MAX>
+      DefaultExtensions; // Default extensions for this CPU. These will be
+                         // ORd with the architecture defaults.
 
   Bitset<AArch64::AEK_EXTENTIONS_MAX> getImpliedExtensions() const {
     Bitset<AArch64::AEK_EXTENTIONS_MAX> ImpliedExts;
@@ -360,193 +362,257 @@ struct CpuInfo {
 
 inline constexpr CpuInfo CpuInfos[] = {
     {"cortex-a34", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a35", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a53", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a55", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC}))},
     {"cortex-a510", ARMV9A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {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,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a65", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+          AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a65ae", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+          AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a72", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a73", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"cortex-a75", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC}))},
     {"cortex-a76", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a76ae", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"cortex-a77", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_SSBS}))},
     {"cortex-a78", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-      AArch64::AEK_PROFILE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+          AArch64::AEK_PROFILE}))},
     {"cortex-a78c", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-      AArch64::AEK_PROFILE, AArch64::AEK_FLAGM, AArch64::AEK_PAUTH,
-      AArch64::AEK_FP16FML}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, 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,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_FLAGM,
-      AArch64::AEK_SB, AArch64::AEK_I8MM, AArch64::AEK_FP16FML,
-      AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
-      AArch64::AEK_BF16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_FLAGM,
+          AArch64::AEK_SB, AArch64::AEK_I8MM, AArch64::AEK_FP16FML,
+          AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+          AArch64::AEK_BF16}))},
     {"cortex-a715", ARMV9A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_SB, AArch64::AEK_SSBS, AArch64::AEK_MTE,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PAUTH,
-      AArch64::AEK_I8MM, AArch64::AEK_PREDRES, AArch64::AEK_PERFMON,
-      AArch64::AEK_PROFILE, AArch64::AEK_SVE, AArch64::AEK_SVE2BITPERM,
-      AArch64::AEK_BF16, AArch64::AEK_FLAGM}))},
-    {"cortex-r82", ARMV8R, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_LSE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_SB, AArch64::AEK_SSBS, AArch64::AEK_MTE,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PAUTH,
+          AArch64::AEK_I8MM, AArch64::AEK_PREDRES, AArch64::AEK_PERFMON,
+          AArch64::AEK_PROFILE, AArch64::AEK_SVE, AArch64::AEK_SVE2BITPERM,
+          AArch64::AEK_BF16, AArch64::AEK_FLAGM}))},
+    {"cortex-r82", ARMV8R,
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_LSE}))},
     {"cortex-x1", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-      AArch64::AEK_PROFILE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+          AArch64::AEK_PROFILE}))},
     {"cortex-x1c", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-      AArch64::AEK_PAUTH, AArch64::AEK_PROFILE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
+          AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+          AArch64::AEK_PAUTH, AArch64::AEK_PROFILE}))},
     {"cortex-x2", ARMV9A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_MTE, AArch64::AEK_BF16, AArch64::AEK_I8MM,
-      AArch64::AEK_PAUTH, AArch64::AEK_SSBS, AArch64::AEK_SB,
-      AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
-      AArch64::AEK_FP16FML}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_MTE, AArch64::AEK_BF16, AArch64::AEK_I8MM,
+          AArch64::AEK_PAUTH, AArch64::AEK_SSBS, AArch64::AEK_SB,
+          AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+          AArch64::AEK_FP16FML}))},
     {"cortex-x3", ARMV9A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_SVE, AArch64::AEK_PERFMON, AArch64::AEK_PROFILE,
-      AArch64::AEK_BF16, AArch64::AEK_I8MM, AArch64::AEK_MTE,
-      AArch64::AEK_SVE2BITPERM, AArch64::AEK_SB, AArch64::AEK_PAUTH,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PREDRES,
-      AArch64::AEK_FLAGM, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_SVE, AArch64::AEK_PERFMON, AArch64::AEK_PROFILE,
+          AArch64::AEK_BF16, AArch64::AEK_I8MM, AArch64::AEK_MTE,
+          AArch64::AEK_SVE2BITPERM, AArch64::AEK_SB, AArch64::AEK_PAUTH,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PREDRES,
+          AArch64::AEK_FLAGM, AArch64::AEK_SSBS}))},
     {"neoverse-e1", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+          AArch64::AEK_FP16, AArch64::AEK_RCPC, AArch64::AEK_SSBS}))},
     {"neoverse-n1", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16, AArch64::AEK_PROFILE, AArch64::AEK_RCPC,
-      AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+          AArch64::AEK_FP16, AArch64::AEK_PROFILE, AArch64::AEK_RCPC,
+          AArch64::AEK_SSBS}))},
     {"neoverse-n2", ARMV8_5A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_SM4, 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}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_SM4, 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,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_SM4, 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}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_SM4, 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,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_SM4, 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}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_SM4, 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,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {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,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a7", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a8", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a9", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_NONE}))},
     {"apple-a10", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC,
-      AArch64::AEK_RDM}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2,
+                                           AArch64::AEK_CRC,
+                                           AArch64::AEK_RDM}))},
     {"apple-a11", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"apple-a12", ARMV8_3A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"apple-a13", ARMV8_4A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
     {"apple-a14", ARMV8_5A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
     {"apple-a15", ARMV8_5A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
-      AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+          AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
     {"apple-a16", ARMV8_5A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
-      AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+          AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
     {"apple-m1", ARMV8_5A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3}))},
     {"apple-m2", ARMV8_5A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
-      AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
+          AArch64::AEK_BF16, AArch64::AEK_I8MM}))},
     {"apple-s4", ARMV8_3A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"apple-s5", ARMV8_3A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"exynos-m3", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"exynos-m4", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2,
+                                           AArch64::AEK_DOTPROD,
+                                           AArch64::AEK_FP16}))},
     {"exynos-m5", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2,
+                                           AArch64::AEK_DOTPROD,
+                                           AArch64::AEK_FP16}))},
     {"falkor", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC,
-      AArch64::AEK_RDM}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2,
+                                           AArch64::AEK_CRC,
+                                           AArch64::AEK_RDM}))},
     {"saphira", ARMV8_3A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_PROFILE}))},
-    {"kryo", ARMV8A, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
-    {"thunderx2t99", ARMV8_1A, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2}))},
-    {"thunderx3t110", ARMV8_3A, (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_PROFILE}))},
+    {"kryo", ARMV8A,
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+    {"thunderx2t99", ARMV8_1A,
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2}))},
+    {"thunderx3t110", ARMV8_3A,
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2}))},
     {"thunderx", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"thunderxt88", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"thunderxt81", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"thunderxt83", ARMV8A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_CRC}))},
     {"tsv110", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-      AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PROFILE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
+          AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_PROFILE}))},
     {"a64fx", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16,
-      AArch64::AEK_SVE}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2,
+                                           AArch64::AEK_FP16,
+                                           AArch64::AEK_SVE}))},
     {"carmel", ARMV8_2A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_FP16}))},
     {"ampere1", ARMV8_6A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-      AArch64::AEK_FP16, AArch64::AEK_SB, AArch64::AEK_SSBS,
-      AArch64::AEK_RAND}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_AES, AArch64::AEK_SHA2,
+                                           AArch64::AEK_SHA3, AArch64::AEK_FP16,
+                                           AArch64::AEK_SB, AArch64::AEK_SSBS,
+                                           AArch64::AEK_RAND}))},
     {"ampere1a", ARMV8_6A,
-     (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_FP16, AArch64::AEK_RAND, AArch64::AEK_SM4,
-      AArch64::AEK_SHA3, AArch64::AEK_SHA2, AArch64::AEK_AES,
-      AArch64::AEK_MTE, AArch64::AEK_SB, AArch64::AEK_SSBS}))},
+     (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+         {AArch64::AEK_FP16, AArch64::AEK_RAND, AArch64::AEK_SM4,
+          AArch64::AEK_SHA3, AArch64::AEK_SHA2, AArch64::AEK_AES,
+          AArch64::AEK_MTE, AArch64::AEK_SB, AArch64::AEK_SSBS}))},
 };
 
 // An alias for a CPU.
diff --git a/llvm/lib/TargetParser/AArch64TargetParser.cpp b/llvm/lib/TargetParser/AArch64TargetParser.cpp
index b36922c6e323a9a..ba8456c4590d71d 100644
--- a/llvm/lib/TargetParser/AArch64TargetParser.cpp
+++ b/llvm/lib/TargetParser/AArch64TargetParser.cpp
@@ -54,8 +54,9 @@ uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs) {
   return FeaturesMask;
 }
 
-bool AArch64::getExtensionFeatures(Bitset<AArch64::AEK_EXTENTIONS_MAX> InputExts,
-                                   std::vector<StringRef> &Features) {
+bool AArch64::getExtensionFeatures(
+    Bitset<AArch64::AEK_EXTENTIONS_MAX> InputExts,
+    std::vector<StringRef> &Features) {
   for (const auto &E : Extensions)
     /* INVALID and NONE have no feature name. */
     if (InputExts.test(E.ID) && !E.Feature.empty())
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index 638eec94a4baf04..e93ce9890755834 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -18,28 +18,28 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include <optional>
-#include <string>
 #include <sstream>
+#include <string>
 
 using namespace llvm;
 
 namespace {
 const char *ARMArch[] = {
-    "armv4",        "armv4t",      "armv5",          "armv5t",      "armv5e",
-    "armv5te",      "armv5tej",    "armv6",          "armv6j",      "armv6k",
-    "armv6hl",      "armv6t2",     "armv6kz",        "armv6z",      "armv6zk",
-    "armv6-m",      "armv6m",      "armv6sm",        "armv6s-m",    "armv7-a",
-    "armv7",        "armv7a",      "armv7ve",        "armv7hl",     "armv7l",
-    "armv7-r",      "armv7r",      "armv7-m",        "armv7m",      "armv7k",
-    "armv7s",       "armv7e-m",    "armv7em",        "armv8-a",     "armv8",
-    "armv8a",       "armv8l",      "armv8.1-a",      "armv8.1a",    "armv8.2-a",
-    "armv8.2a",     "armv8.3-a",   "armv8.3a",       "armv8.4-a",   "armv8.4a",
-    "armv8.5-a",    "armv8.5a",    "armv8.6-a",      "armv8.6a",    "armv8.7-a",
-    "armv8.7a",     "armv8.8-a",   "armv8.8a",       "armv8.9-a",   "armv8.9a",
-    "armv8-r",      "armv8r",      "armv8-m.base",   "armv8m.base", "armv8-m.main",
-    "armv8m.main",  "iwmmxt",      "iwmmxt2",        "xscale",      "armv8.1-m.main",
-    "armv9-a",      "armv9",       "armv9a",         "armv9.1-a",   "armv9.1a",
-    "armv9.2-a",    "armv9.2a",    "armv9.3-a",      "armv9.3a",    "armv9.4-a",
+    "armv4",       "armv4t",    "armv5",        "armv5t",      "armv5e",
+    "armv5te",     "armv5tej",  "armv6",        "armv6j",      "armv6k",
+    "armv6hl",     "armv6t2",   "armv6kz",      "armv6z",      "armv6zk",
+    "armv6-m",     "armv6m",    "armv6sm",      "armv6s-m",    "armv7-a",
+    "armv7",       "armv7a",    "armv7ve",      "armv7hl",     "armv7l",
+    "armv7-r",     "armv7r",    "armv7-m",      "armv7m",      "armv7k",
+    "armv7s",      "armv7e-m",  "armv7em",      "armv8-a",     "armv8",
+    "armv8a",      "armv8l",    "armv8.1-a",    "armv8.1a",    "armv8.2-a",
+    "armv8.2a",    "armv8.3-a", "armv8.3a",     "armv8.4-a",   "armv8.4a",
+    "armv8.5-a",   "armv8.5a",  "armv8.6-a",    "armv8.6a",    "armv8.7-a",
+    "armv8.7a",    "armv8.8-a", "armv8.8a",     "armv8.9-a",   "armv8.9a",
+    "armv8-r",     "armv8r",    "armv8-m.base", "armv8m.base", "armv8-m.main",
+    "armv8m.main", "iwmmxt",    "iwmmxt2",      "xscale",      "armv8.1-m.main",
+    "armv9-a",     "armv9",     "armv9a",       "armv9.1-a",   "armv9.1a",
+    "armv9.2-a",   "armv9.2a",  "armv9.3-a",    "armv9.3a",    "armv9.4-a",
     "armv9.4a",
 };
 
@@ -73,10 +73,10 @@ std::string FormatExtensionFlags(T Flags) {
 std::string SerializeExtensionFlags(Bitset<AArch64::AEK_EXTENTIONS_MAX> Flags) {
   std::string SerializedFlags;
   int HexaValue = 0;
-  for(unsigned int i = 0; i < AArch64::AEK_EXTENTIONS_MAX; i ++) {
+  for (unsigned int i = 0; i < AArch64::AEK_EXTENTIONS_MAX; i++) {
     HexaValue <<= 1;
     HexaValue |= (int)Flags[i];
-    if ((i+1)%4 == 0) {
+    if ((i + 1) % 4 == 0) {
       std::ostringstream ss;
       ss << std::hex << HexaValue;
       SerializedFlags += ss.str();
@@ -87,7 +87,6 @@ std::string SerializeExtensionFlags(Bitset<AArch64::AEK_EXTENTIONS_MAX> Flags) {
   return SerializedFlags;
 }
 
-
 template <ARM::ISAKind ISAKind> struct AssertSameExtensionFlags {
   AssertSameExtensionFlags(StringRef CPUName) : CPUName(CPUName) {}
 
@@ -101,45 +100,50 @@ template <ARM::ISAKind ISAKind> struct AssertSameExtensionFlags {
                "CPU: {4}\n"
                "Expected extension flags: {0} ({1:x})\n"
                "     Got extension flags: {2} ({3:x})\n",
-               FormatExtensionFlags<ISAKind, uint64_t>(ExpectedFlags), ExpectedFlags,
-               FormatExtensionFlags<ISAKind, uint64_t>(GotFlags), ExpectedFlags, CPUName);
+               FormatExtensionFlags<ISAKind, uint64_t>(ExpectedFlags),
+               ExpectedFlags, FormatExtensionFlags<ISAKind, uint64_t>(GotFlags),
+               ExpectedFlags, CPUName);
   }
 
-  testing::AssertionResult operator()(const char *m_expr, const char *n_expr,
-                                    Bitset<AArch64::AEK_EXTENTIONS_MAX> ExpectedFlags,
-                                    Bitset<AArch64::AEK_EXTENTIONS_MAX> GotFlags) {
+  testing::AssertionResult
+  operator()(const char *m_expr, const char *n_expr,
+             Bitset<AArch64::AEK_EXTENTIONS_MAX> ExpectedFlags,
+             Bitset<AArch64::AEK_EXTENTIONS_MAX> GotFlags) {
     if (ExpectedFlags == GotFlags)
       return testing::AssertionSuccess();
 
     return testing::AssertionFailure() << llvm::formatv(
-                "CPU: {4}\n"
-                "Expected extension flags: {0} ({1:x})\n"
-                "     Got extension flags: {2} ({3:x})\n",
-                FormatExtensionFlags<ISAKind, Bitset<AArch64::AEK_EXTENTIONS_MAX>>(ExpectedFlags), SerializeExtensionFlags(ExpectedFlags),
-                FormatExtensionFlags<ISAKind, Bitset<AArch64::AEK_EXTENTIONS_MAX>>(GotFlags), SerializeExtensionFlags(ExpectedFlags), CPUName);
+               "CPU: {4}\n"
+               "Expected extension flags: {0} ({1:x})\n"
+               "     Got extension flags: {2} ({3:x})\n",
+               FormatExtensionFlags<ISAKind,
+                                    Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+                   ExpectedFlags),
+               SerializeExtensionFlags(ExpectedFlags),
+               FormatExtensionFlags<ISAKind,
+                                    Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+                   GotFlags),
+               SerializeExtensionFlags(ExpectedFlags), CPUName);
   }
 
 private:
   StringRef CPUName;
 };
 
-template <typename T>
-struct ARMCPUTestParams {
+template <typename T> struct ARMCPUTestParams {
   ARMCPUTestParams(StringRef CPUName, StringRef ExpectedArch,
-                   StringRef ExpectedFPU, T ExpectedFlags,
-                   StringRef CPUAttr)
+                   StringRef ExpectedFPU, T ExpectedFlags, StringRef CPUAttr)
       : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU),
         ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {}
 
   friend std::ostream &operator<<(std::ostream &os,
                                   const ARMCPUTestParams<T> &params) {
-    os << "\"" << params.CPUName.str() << "\", \""
-              << params.ExpectedArch.str() << "\", \""
-              << params.ExpectedFPU.str() << "\", 0x" << std::hex;
+    os << "\"" << params.CPUName.str() << "\", \"" << params.ExpectedArch.str()
+       << "\", \"" << params.ExpectedFPU.str() << "\", 0x" << std::hex;
     if constexpr (std::is_same<T, uint64_t>::value)
-        os << params.ExpectedFlags;
-   else
-     os << SerializeExtensionFlags(params.ExpectedFlags);
+      os << params.ExpectedFlags;
+    else
+      os << SerializeExtensionFlags(params.ExpectedFlags);
     os << ", \"" << params.CPUAttr.str() << "\"";
     return os;
   }
@@ -151,7 +155,8 @@ struct ARMCPUTestParams {
   StringRef CPUAttr;
 };
 
-class ARMCPUTestFixture : public ::testing::TestWithParam<ARMCPUTestParams<uint64_t>> {};
+class ARMCPUTestFixture
+    : public ::testing::TestWithParam<ARMCPUTestParams<uint64_t>> {};
 
 TEST_P(ARMCPUTestFixture, ARMCPUTests) {
   auto params = GetParam();
@@ -177,73 +182,100 @@ TEST_P(ARMCPUTestFixture, ARMCPUTests) {
 INSTANTIATE_TEST_SUITE_P(
     ARMCPUTestsPart1, ARMCPUTestFixture,
     ::testing::Values(
-        ARMCPUTestParams<uint64_t>("invalid", "invalid", "invalid", ARM::AEK_NONE, ""),
-        ARMCPUTestParams<uint64_t>("generic", "invalid", "none", ARM::AEK_NONE, ""),
+        ARMCPUTestParams<uint64_t>("invalid", "invalid", "invalid",
+                                   ARM::AEK_NONE, ""),
+        ARMCPUTestParams<uint64_t>("generic", "invalid", "none", ARM::AEK_NONE,
+                                   ""),
 
         ARMCPUTestParams<uint64_t>("arm8", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams<uint64_t>("arm810", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams<uint64_t>("strongarm", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams<uint64_t>("strongarm110", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams<uint64_t>("strongarm1100", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams<uint64_t>("strongarm1110", "armv4", "none", ARM::AEK_NONE, "4"),
-        ARMCPUTestParams<uint64_t>("arm7tdmi", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm7tdmi-s", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm710t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm720t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm9", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm9tdmi", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm920", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm920t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm922t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm940t", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("ep9312", "armv4t", "none", ARM::AEK_NONE, "4T"),
-        ARMCPUTestParams<uint64_t>("arm10tdmi", "armv5t", "none", ARM::AEK_NONE, "5T"),
-        ARMCPUTestParams<uint64_t>("arm1020t", "armv5t", "none", ARM::AEK_NONE, "5T"),
+        ARMCPUTestParams<uint64_t>("arm810", "armv4", "none", ARM::AEK_NONE,
+                                   "4"),
+        ARMCPUTestParams<uint64_t>("strongarm", "armv4", "none", ARM::AEK_NONE,
+                                   "4"),
+        ARMCPUTestParams<uint64_t>("strongarm110", "armv4", "none",
+                                   ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("strongarm1100", "armv4", "none",
+                                   ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("strongarm1110", "armv4", "none",
+                                   ARM::AEK_NONE, "4"),
+        ARMCPUTestParams<uint64_t>("arm7tdmi", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm7tdmi-s", "armv4t", "none",
+                                   ARM::AEK_NONE, "4T"),
+        ARMCPUTestParams<uint64_t>("arm710t", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm720t", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm9", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm9tdmi", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm920", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm920t", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm922t", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm940t", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("ep9312", "armv4t", "none", ARM::AEK_NONE,
+                                   "4T"),
+        ARMCPUTestParams<uint64_t>("arm10tdmi", "armv5t", "none", ARM::AEK_NONE,
+                                   "5T"),
+        ARMCPUTestParams<uint64_t>("arm1020t", "armv5t", "none", ARM::AEK_NONE,
+                                   "5T"),
         ARMCPUTestParams<uint64_t>("arm9e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm946e-s", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm966e-s", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm968e-s", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm10e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm1020e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm1022e", "armv5te", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TE"),
         ARMCPUTestParams<uint64_t>("arm926ej-s", "armv5tej", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "5TEJ"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "5TEJ"),
         ARMCPUTestParams<uint64_t>("arm1136j-s", "armv6", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "6"),
         ARMCPUTestParams<uint64_t>("arm1136jf-s", "armv6", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "6"),
         ARMCPUTestParams<uint64_t>("arm1176jz-s", "armv6kz", "none",
-                         ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP, "6KZ"),
+                                   ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP,
+                                   "6KZ"),
         ARMCPUTestParams<uint64_t>("mpcore", "armv6k", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
         ARMCPUTestParams<uint64_t>("mpcorenovfp", "armv6k", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "6K"),
         ARMCPUTestParams<uint64_t>("arm1176jzf-s", "armv6kz", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP, "6KZ"),
+                                   ARM::AEK_NONE | ARM::AEK_SEC | ARM::AEK_DSP,
+                                   "6KZ"),
         ARMCPUTestParams<uint64_t>("arm1156t2-s", "armv6t2", "none",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
         ARMCPUTestParams<uint64_t>("arm1156t2f-s", "armv6t2", "vfpv2",
-                         ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
-        ARMCPUTestParams<uint64_t>("cortex-m0", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
-        ARMCPUTestParams<uint64_t>("cortex-m0plus", "armv6-m", "none", ARM::AEK_NONE,
-                         "6-M"),
-        ARMCPUTestParams<uint64_t>("cortex-m1", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
-        ARMCPUTestParams<uint64_t>("sc000", "armv6-m", "none", ARM::AEK_NONE, "6-M"),
+                                   ARM::AEK_NONE | ARM::AEK_DSP, "6T2"),
+        ARMCPUTestParams<uint64_t>("cortex-m0", "armv6-m", "none",
+                                   ARM::AEK_NONE, "6-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m0plus", "armv6-m", "none",
+                                   ARM::AEK_NONE, "6-M"),
+        ARMCPUTestParams<uint64_t>("cortex-m1", "armv6-m", "none",
+                                   ARM::AEK_NONE, "6-M"),
+        ARMCPUTestParams<uint64_t>("sc000", "armv6-m", "none", ARM::AEK_NONE,
+                                   "6-M"),
         ARMCPUTestParams<uint64_t>("cortex-a5", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A"),
+                                   ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("cortex-a7", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_HWDIVARM | ARM::AEK_MP |
-                             ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_DSP,
-                         "7-A"),
+                                   ARM::AEK_HWDIVTHUMB | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_MP | ARM::AEK_SEC |
+                                       ARM::AEK_VIRT | ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("cortex-a8", "armv7-a", "neon",
-                         ARM::AEK_SEC | ARM::AEK_DSP, "7-A")));
+                                   ARM::AEK_SEC | ARM::AEK_DSP, "7-A")));
 
 // gtest in llvm has a limit of 50 test cases when using ::Values so we split
 // them into 2 blocks
@@ -251,213 +283,231 @@ INSTANTIATE_TEST_SUITE_P(
     ARMCPUTestsPart2, ARMCPUTestFixture,
     ::testing::Values(
         ARMCPUTestParams<uint64_t>("cortex-a9", "armv7-a", "neon-fp16",
-                         ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A"),
+                                   ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("cortex-a12", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-A"),
+                                   ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                                       ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("cortex-a15", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-A"),
+                                   ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                                       ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("cortex-a17", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-A"),
+                                   ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                                       ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("krait", "armv7-a", "neon-vfpv4",
-                         ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-A"),
+                                   ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-A"),
         ARMCPUTestParams<uint64_t>("cortex-r4", "armv7-r", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-R"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-R"),
         ARMCPUTestParams<uint64_t>("cortex-r4f", "armv7-r", "vfpv3-d16",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-R"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-R"),
         ARMCPUTestParams<uint64_t>("cortex-r5", "armv7-r", "vfpv3-d16",
-                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-R"),
+                                   ARM::AEK_MP | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "7-R"),
         ARMCPUTestParams<uint64_t>("cortex-r7", "armv7-r", "vfpv3-d16-fp16",
-                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-R"),
+                                   ARM::AEK_MP | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "7-R"),
         ARMCPUTestParams<uint64_t>("cortex-r8", "armv7-r", "vfpv3-d16-fp16",
-                         ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP,
-                         "7-R"),
+                                   ARM::AEK_MP | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "7-R"),
         ARMCPUTestParams<uint64_t>("cortex-r52", "armv8-r", "neon-fp-armv8",
-                         ARM::AEK_NONE | ARM::AEK_CRC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-R"),
+                                   ARM::AEK_NONE | ARM::AEK_CRC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-R"),
         ARMCPUTestParams<uint64_t>("sc300", "armv7-m", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
         ARMCPUTestParams<uint64_t>("cortex-m3", "armv7-m", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "7-M"),
         ARMCPUTestParams<uint64_t>("cortex-m4", "armv7e-m", "fpv4-sp-d16",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7E-M"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7E-M"),
         ARMCPUTestParams<uint64_t>("cortex-m7", "armv7e-m", "fpv5-d16",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7E-M"),
-        ARMCPUTestParams<uint64_t>("cortex-a32", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
-                             ARM::AEK_FP16 | ARM::AEK_DOTPROD,
-                         "8.2-A"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7E-M"),
+        ARMCPUTestParams<uint64_t>("cortex-a32", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a35", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a53", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a57", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a72", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>("cortex-a73", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC |
+                ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD,
+            "8.2-A"),
         ARMCPUTestParams<uint64_t>("cortex-a710", "armv9-a", "neon-fp-armv8",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
-                             ARM::AEK_DOTPROD | ARM::AEK_FP16FML |
-                             ARM::AEK_BF16 | ARM::AEK_I8MM | ARM::AEK_SB,
-                         "9-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_SEC |
-                             ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC |
-                             ARM::AEK_RAS,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD |
-                             ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD |
-                             ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_HWDIVARM | ARM::AEK_MP | ARM::AEK_SEC |
-                             ARM::AEK_VIRT | ARM::AEK_DSP | ARM::AEK_BF16 |
-                             ARM::AEK_DOTPROD | ARM::AEK_RAS | ARM::AEK_I8MM |
-                             ARM::AEK_SB,
-                         "8.5-A"),
-        ARMCPUTestParams<uint64_t>("neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
-                             ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
-                             ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
-                             ARM::AEK_FP16 | ARM::AEK_BF16 | ARM::AEK_DOTPROD,
-                         "8.4-A"),
+                                   ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                                       ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP | ARM::AEK_CRC |
+                                       ARM::AEK_RAS | ARM::AEK_DOTPROD |
+                                       ARM::AEK_FP16FML | ARM::AEK_BF16 |
+                                       ARM::AEK_I8MM | ARM::AEK_SB,
+                                   "9-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_SEC | ARM::AEK_MP |
+                ARM::AEK_VIRT | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD | ARM::AEK_SEC |
+                ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_DOTPROD | ARM::AEK_SEC |
+                ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_FP16 | ARM::AEK_RAS | ARM::AEK_DOTPROD,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_HWDIVTHUMB | ARM::AEK_HWDIVARM |
+                ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_DSP |
+                ARM::AEK_BF16 | ARM::AEK_DOTPROD | ARM::AEK_RAS |
+                ARM::AEK_I8MM | ARM::AEK_SB,
+            "8.5-A"),
+        ARMCPUTestParams<uint64_t>(
+            "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
+            ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC |
+                ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_BF16 | ARM::AEK_DOTPROD,
+            "8.4-A"),
         ARMCPUTestParams<uint64_t>("cyclone", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "8-A"),
-        ARMCPUTestParams<uint64_t>("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
-                         "8.2-A"),
-        ARMCPUTestParams<uint64_t>("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
-                         ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
-                             ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
-                             ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
-                             ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
-                         "8.2-A"),
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>("exynos-m3", "armv8-a",
+                                   "crypto-neon-fp-armv8",
+                                   ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP |
+                                       ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
+                                       ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-A"),
+        ARMCPUTestParams<uint64_t>(
+            "exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
+            "8.2-A"),
+        ARMCPUTestParams<uint64_t>(
+            "exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
+            ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
+                ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP |
+                ARM::AEK_DOTPROD | ARM::AEK_FP16 | ARM::AEK_RAS,
+            "8.2-A"),
         ARMCPUTestParams<uint64_t>("cortex-m23", "armv8-m.base", "none",
-                         ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB, "8-M.Baseline"),
+                                   ARM::AEK_NONE | ARM::AEK_HWDIVTHUMB,
+                                   "8-M.Baseline"),
         ARMCPUTestParams<uint64_t>("cortex-m33", "armv8-m.main", "fpv5-sp-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline"),
+                                   ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-M.Mainline"),
         ARMCPUTestParams<uint64_t>("cortex-m35p", "armv8-m.main", "fpv5-sp-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline"),
-        ARMCPUTestParams<uint64_t>("cortex-m55", "armv8.1-m.main",
-                         "fp-armv8-fullfp16-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD |
-                             ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB |
-                             ARM::AEK_FP16,
-                         "8.1-M.Mainline"),
-        ARMCPUTestParams<uint64_t>("cortex-m85", "armv8.1-m.main",
-                         "fp-armv8-fullfp16-d16",
-                         ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD |
-                             ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB |
-                             ARM::AEK_FP16 | ARM::AEK_PACBTI,
-                         "8.1-M.Mainline"),
-        ARMCPUTestParams<uint64_t>("iwmmxt", "iwmmxt", "none", ARM::AEK_NONE, "iwmmxt"),
-        ARMCPUTestParams<uint64_t>("xscale", "xscale", "none", ARM::AEK_NONE, "xscale"),
+                                   ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
+                                   "8-M.Mainline"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-m55", "armv8.1-m.main", "fp-armv8-fullfp16-d16",
+            ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD | ARM::AEK_FP |
+                ARM::AEK_RAS | ARM::AEK_LOB | ARM::AEK_FP16,
+            "8.1-M.Mainline"),
+        ARMCPUTestParams<uint64_t>(
+            "cortex-m85", "armv8.1-m.main", "fp-armv8-fullfp16-d16",
+            ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_SIMD | ARM::AEK_FP |
+                ARM::AEK_RAS | ARM::AEK_LOB | ARM::AEK_FP16 | ARM::AEK_PACBTI,
+            "8.1-M.Mainline"),
+        ARMCPUTestParams<uint64_t>("iwmmxt", "iwmmxt", "none", ARM::AEK_NONE,
+                                   "iwmmxt"),
+        ARMCPUTestParams<uint64_t>("xscale", "xscale", "none", ARM::AEK_NONE,
+                                   "xscale"),
         ARMCPUTestParams<uint64_t>("swift", "armv7s", "neon-vfpv4",
-                         ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP,
-                         "7-S")));
+                                   ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
+                                       ARM::AEK_DSP,
+                                   "7-S")));
 
 static constexpr unsigned NumARMCPUArchs = 89;
 
@@ -468,14 +518,14 @@ TEST(TargetParserTest, testARMCPUArchList) {
   // No list exists for these in this test suite, so ensure all are
   // valid, and match the expected 'magic' count.
   EXPECT_EQ(List.size(), NumARMCPUArchs);
-  for(StringRef CPU : List) {
+  for (StringRef CPU : List) {
     EXPECT_NE(ARM::parseCPUArch(CPU), ARM::ArchKind::INVALID);
   }
 }
 
 TEST(TargetParserTest, testInvalidARMArch) {
   auto InvalidArchStrings = {"armv", "armv99", "noarm"};
-  for (const char* InvalidArch : InvalidArchStrings)
+  for (const char *InvalidArch : InvalidArchStrings)
     EXPECT_EQ(ARM::parseArch(InvalidArch), ARM::ArchKind::INVALID);
 }
 
@@ -491,124 +541,87 @@ bool testARMArch(StringRef Arch, StringRef DefaultCPU, StringRef SubArch,
 
 TEST(TargetParserTest, testARMArch) {
   EXPECT_TRUE(
-      testARMArch("armv4", "strongarm", "v4",
-                          ARMBuildAttrs::CPUArch::v4));
-  EXPECT_TRUE(
-      testARMArch("armv4t", "arm7tdmi", "v4t",
-                          ARMBuildAttrs::CPUArch::v4T));
+      testARMArch("armv4", "strongarm", "v4", ARMBuildAttrs::CPUArch::v4));
   EXPECT_TRUE(
-      testARMArch("armv5t", "arm10tdmi", "v5",
-                          ARMBuildAttrs::CPUArch::v5T));
+      testARMArch("armv4t", "arm7tdmi", "v4t", ARMBuildAttrs::CPUArch::v4T));
   EXPECT_TRUE(
-      testARMArch("armv5te", "arm1022e", "v5e",
-                          ARMBuildAttrs::CPUArch::v5TE));
+      testARMArch("armv5t", "arm10tdmi", "v5", ARMBuildAttrs::CPUArch::v5T));
   EXPECT_TRUE(
-      testARMArch("armv5tej", "arm926ej-s", "v5e",
+      testARMArch("armv5te", "arm1022e", "v5e", ARMBuildAttrs::CPUArch::v5TE));
+  EXPECT_TRUE(testARMArch("armv5tej", "arm926ej-s", "v5e",
                           ARMBuildAttrs::CPUArch::v5TEJ));
   EXPECT_TRUE(
-      testARMArch("armv6", "arm1136jf-s", "v6",
-                          ARMBuildAttrs::CPUArch::v6));
+      testARMArch("armv6", "arm1136jf-s", "v6", ARMBuildAttrs::CPUArch::v6));
   EXPECT_TRUE(
-      testARMArch("armv6k", "mpcore", "v6k",
-                          ARMBuildAttrs::CPUArch::v6K));
-  EXPECT_TRUE(
-      testARMArch("armv6t2", "arm1156t2-s", "v6t2",
+      testARMArch("armv6k", "mpcore", "v6k", ARMBuildAttrs::CPUArch::v6K));
+  EXPECT_TRUE(testARMArch("armv6t2", "arm1156t2-s", "v6t2",
                           ARMBuildAttrs::CPUArch::v6T2));
-  EXPECT_TRUE(
-      testARMArch("armv6kz", "arm1176jzf-s", "v6kz",
+  EXPECT_TRUE(testARMArch("armv6kz", "arm1176jzf-s", "v6kz",
                           ARMBuildAttrs::CPUArch::v6KZ));
   EXPECT_TRUE(
-      testARMArch("armv6-m", "cortex-m0", "v6m",
-                          ARMBuildAttrs::CPUArch::v6_M));
+      testARMArch("armv6-m", "cortex-m0", "v6m", ARMBuildAttrs::CPUArch::v6_M));
   EXPECT_TRUE(
-      testARMArch("armv7-a", "generic", "v7",
-                          ARMBuildAttrs::CPUArch::v7));
+      testARMArch("armv7-a", "generic", "v7", ARMBuildAttrs::CPUArch::v7));
   EXPECT_TRUE(
-      testARMArch("armv7ve", "generic", "v7ve",
-                          ARMBuildAttrs::CPUArch::v7));
+      testARMArch("armv7ve", "generic", "v7ve", ARMBuildAttrs::CPUArch::v7));
   EXPECT_TRUE(
-      testARMArch("armv7-r", "cortex-r4", "v7r",
-                          ARMBuildAttrs::CPUArch::v7));
+      testARMArch("armv7-r", "cortex-r4", "v7r", ARMBuildAttrs::CPUArch::v7));
   EXPECT_TRUE(
-      testARMArch("armv7-m", "cortex-m3", "v7m",
-                          ARMBuildAttrs::CPUArch::v7));
-  EXPECT_TRUE(
-      testARMArch("armv7e-m", "cortex-m4", "v7em",
+      testARMArch("armv7-m", "cortex-m3", "v7m", ARMBuildAttrs::CPUArch::v7));
+  EXPECT_TRUE(testARMArch("armv7e-m", "cortex-m4", "v7em",
                           ARMBuildAttrs::CPUArch::v7E_M));
   EXPECT_TRUE(
-      testARMArch("armv8-a", "generic", "v8a",
-                          ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.1-a", "generic", "v8.1a",
+      testARMArch("armv8-a", "generic", "v8a", ARMBuildAttrs::CPUArch::v8_A));
+  EXPECT_TRUE(testARMArch("armv8.1-a", "generic", "v8.1a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.2-a", "generic", "v8.2a",
+  EXPECT_TRUE(testARMArch("armv8.2-a", "generic", "v8.2a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.3-a", "generic", "v8.3a",
+  EXPECT_TRUE(testARMArch("armv8.3-a", "generic", "v8.3a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.4-a", "generic", "v8.4a",
+  EXPECT_TRUE(testARMArch("armv8.4-a", "generic", "v8.4a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.5-a", "generic", "v8.5a",
+  EXPECT_TRUE(testARMArch("armv8.5-a", "generic", "v8.5a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.6-a", "generic", "v8.6a",
+  EXPECT_TRUE(testARMArch("armv8.6-a", "generic", "v8.6a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.7-a", "generic", "v8.7a",
+  EXPECT_TRUE(testARMArch("armv8.7-a", "generic", "v8.7a",
                           ARMBuildAttrs::CPUArch::v8_A));
   EXPECT_TRUE(testARMArch("armv8.8-a", "generic", "v8.8a",
                           ARMBuildAttrs::CPUArch::v8_A));
-  EXPECT_TRUE(
-      testARMArch("armv8.9-a", "generic", "v8.9a",
+  EXPECT_TRUE(testARMArch("armv8.9-a", "generic", "v8.9a",
                           ARMBuildAttrs::CPUArch::v8_A));
   EXPECT_TRUE(
-      testARMArch("armv9-a", "generic", "v9a",
-                          ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.1-a", "generic", "v9.1a",
+      testARMArch("armv9-a", "generic", "v9a", ARMBuildAttrs::CPUArch::v9_A));
+  EXPECT_TRUE(testARMArch("armv9.1-a", "generic", "v9.1a",
                           ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.2-a", "generic", "v9.2a",
+  EXPECT_TRUE(testARMArch("armv9.2-a", "generic", "v9.2a",
                           ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.3-a", "generic", "v9.3a",
+  EXPECT_TRUE(testARMArch("armv9.3-a", "generic", "v9.3a",
                           ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv9.4-a", "generic", "v9.4a",
+  EXPECT_TRUE(testARMArch("armv9.4-a", "generic", "v9.4a",
                           ARMBuildAttrs::CPUArch::v9_A));
-  EXPECT_TRUE(
-      testARMArch("armv8-r", "cortex-r52", "v8r",
+  EXPECT_TRUE(testARMArch("armv8-r", "cortex-r52", "v8r",
                           ARMBuildAttrs::CPUArch::v8_R));
-  EXPECT_TRUE(
-      testARMArch("armv8-m.base", "generic", "v8m.base",
+  EXPECT_TRUE(testARMArch("armv8-m.base", "generic", "v8m.base",
                           ARMBuildAttrs::CPUArch::v8_M_Base));
-  EXPECT_TRUE(
-      testARMArch("armv8-m.main", "generic", "v8m.main",
+  EXPECT_TRUE(testARMArch("armv8-m.main", "generic", "v8m.main",
                           ARMBuildAttrs::CPUArch::v8_M_Main));
-  EXPECT_TRUE(
-      testARMArch("armv8.1-m.main", "generic", "v8.1m.main",
+  EXPECT_TRUE(testARMArch("armv8.1-m.main", "generic", "v8.1m.main",
                           ARMBuildAttrs::CPUArch::v8_1_M_Main));
   EXPECT_TRUE(
-      testARMArch("iwmmxt", "iwmmxt", "",
-                          ARMBuildAttrs::CPUArch::v5TE));
+      testARMArch("iwmmxt", "iwmmxt", "", ARMBuildAttrs::CPUArch::v5TE));
   EXPECT_TRUE(
-      testARMArch("iwmmxt2", "generic", "",
-                          ARMBuildAttrs::CPUArch::v5TE));
+      testARMArch("iwmmxt2", "generic", "", ARMBuildAttrs::CPUArch::v5TE));
   EXPECT_TRUE(
-      testARMArch("xscale", "xscale", "v5e",
-                          ARMBuildAttrs::CPUArch::v5TE));
+      testARMArch("xscale", "xscale", "v5e", ARMBuildAttrs::CPUArch::v5TE));
   EXPECT_TRUE(
-      testARMArch("armv7s", "swift", "v7s",
-                          ARMBuildAttrs::CPUArch::v7));
+      testARMArch("armv7s", "swift", "v7s", ARMBuildAttrs::CPUArch::v7));
   EXPECT_TRUE(
-      testARMArch("armv7k", "generic", "v7k",
-                          ARMBuildAttrs::CPUArch::v7));
+      testARMArch("armv7k", "generic", "v7k", ARMBuildAttrs::CPUArch::v7));
 }
 
-bool testARMExtension(StringRef CPUName,ARM::ArchKind ArchKind, StringRef ArchExt) {
+bool testARMExtension(StringRef CPUName, ARM::ArchKind ArchKind,
+                      StringRef ArchExt) {
   return ARM::getDefaultExtensions(CPUName, ArchKind) &
          ARM::parseArchExt(ArchExt);
 }
@@ -616,39 +629,28 @@ bool testARMExtension(StringRef CPUName,ARM::ArchKind ArchKind, StringRef ArchEx
 TEST(TargetParserTest, testARMExtension) {
   EXPECT_FALSE(testARMExtension("strongarm", ARM::ArchKind::INVALID, "dsp"));
   EXPECT_FALSE(testARMExtension("arm7tdmi", ARM::ArchKind::INVALID, "dsp"));
-  EXPECT_FALSE(testARMExtension("arm10tdmi",
-                                ARM::ArchKind::INVALID, "simd"));
+  EXPECT_FALSE(testARMExtension("arm10tdmi", ARM::ArchKind::INVALID, "simd"));
   EXPECT_FALSE(testARMExtension("arm1022e", ARM::ArchKind::INVALID, "simd"));
-  EXPECT_FALSE(testARMExtension("arm926ej-s",
-                                ARM::ArchKind::INVALID, "simd"));
-  EXPECT_FALSE(testARMExtension("arm1136jf-s",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("arm1156t2-s",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("arm1176jzf-s",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-m0",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-a8",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-r4",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-m3",
-                                ARM::ArchKind::INVALID, "crypto"));
-  EXPECT_FALSE(testARMExtension("cortex-a53",
-                                ARM::ArchKind::INVALID, "ras"));
-  EXPECT_FALSE(testARMExtension("cortex-a53",
-                                ARM::ArchKind::INVALID, "fp16"));
-  EXPECT_TRUE(testARMExtension("cortex-a55",
-                                ARM::ArchKind::INVALID, "fp16"));
-  EXPECT_FALSE(testARMExtension("cortex-a55",
-                                ARM::ArchKind::INVALID, "fp16fml"));
-  EXPECT_TRUE(testARMExtension("cortex-a75",
-                                ARM::ArchKind::INVALID, "fp16"));
-  EXPECT_FALSE(testARMExtension("cortex-a75",
-                                ARM::ArchKind::INVALID, "fp16fml"));
-  EXPECT_FALSE(testARMExtension("cortex-r52",
-                                ARM::ArchKind::INVALID, "ras"));
+  EXPECT_FALSE(testARMExtension("arm926ej-s", ARM::ArchKind::INVALID, "simd"));
+  EXPECT_FALSE(
+      testARMExtension("arm1136jf-s", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(
+      testARMExtension("arm1156t2-s", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(
+      testARMExtension("arm1176jzf-s", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-m0", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-a8", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-r4", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-m3", ARM::ArchKind::INVALID, "crypto"));
+  EXPECT_FALSE(testARMExtension("cortex-a53", ARM::ArchKind::INVALID, "ras"));
+  EXPECT_FALSE(testARMExtension("cortex-a53", ARM::ArchKind::INVALID, "fp16"));
+  EXPECT_TRUE(testARMExtension("cortex-a55", ARM::ArchKind::INVALID, "fp16"));
+  EXPECT_FALSE(
+      testARMExtension("cortex-a55", ARM::ArchKind::INVALID, "fp16fml"));
+  EXPECT_TRUE(testARMExtension("cortex-a75", ARM::ArchKind::INVALID, "fp16"));
+  EXPECT_FALSE(
+      testARMExtension("cortex-a75", ARM::ArchKind::INVALID, "fp16fml"));
+  EXPECT_FALSE(testARMExtension("cortex-r52", ARM::ArchKind::INVALID, "ras"));
   EXPECT_FALSE(testARMExtension("iwmmxt", ARM::ArchKind::INVALID, "crc"));
   EXPECT_FALSE(testARMExtension("xscale", ARM::ArchKind::INVALID, "crc"));
   EXPECT_FALSE(testARMExtension("swift", ARM::ArchKind::INVALID, "crc"));
@@ -660,16 +662,13 @@ TEST(TargetParserTest, testARMExtension) {
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV5TEJ, "simd"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6, "crypto"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6K, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV6T2, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV6KZ, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6T2, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6KZ, "crypto"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV6M, "crypto"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7A, "crypto"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7R, "crypto"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7M, "crypto"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV7EM, "crypto"));
+  EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV7EM, "crypto"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8A, "ras"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_1A, "ras"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "profile"));
@@ -680,10 +679,10 @@ TEST(TargetParserTest, testARMExtension) {
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16fml"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8R, "ras"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV8MBaseline, "crc"));
-  EXPECT_FALSE(testARMExtension("generic",
-                                ARM::ArchKind::ARMV8MMainline, "crc"));
+  EXPECT_FALSE(
+      testARMExtension("generic", ARM::ArchKind::ARMV8MBaseline, "crc"));
+  EXPECT_FALSE(
+      testARMExtension("generic", ARM::ArchKind::ARMV8MMainline, "crc"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::IWMMXT, "crc"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::IWMMXT2, "crc"));
   EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::XSCALE, "crc"));
@@ -708,11 +707,9 @@ TEST(TargetParserTest, ARMFPUNeonSupportLevel) {
        FK = static_cast<ARM::FPUKind>(static_cast<unsigned>(FK) + 1))
     if (FK == ARM::FK_LAST ||
         ARM::getFPUName(FK).find("neon") == std::string::npos)
-      EXPECT_EQ(ARM::NeonSupportLevel::None,
-                 ARM::getFPUNeonSupportLevel(FK));
+      EXPECT_EQ(ARM::NeonSupportLevel::None, ARM::getFPUNeonSupportLevel(FK));
     else
-      EXPECT_NE(ARM::NeonSupportLevel::None,
-                ARM::getFPUNeonSupportLevel(FK));
+      EXPECT_NE(ARM::NeonSupportLevel::None, ARM::getFPUNeonSupportLevel(FK));
 }
 
 TEST(TargetParserTest, ARMFPURestriction) {
@@ -736,8 +733,8 @@ TEST(TargetParserTest, ARMExtensionFeatures) {
       Extensions[Ext.ID] = {Ext.Feature, Ext.NegFeature};
   }
 
-  Extensions[ARM::AEK_HWDIVARM]   = { "+hwdiv-arm", "-hwdiv-arm" };
-  Extensions[ARM::AEK_HWDIVTHUMB] = { "+hwdiv",     "-hwdiv" };
+  Extensions[ARM::AEK_HWDIVARM] = {"+hwdiv-arm", "-hwdiv-arm"};
+  Extensions[ARM::AEK_HWDIVTHUMB] = {"+hwdiv", "-hwdiv"};
 
   std::vector<StringRef> Features;
 
@@ -996,7 +993,8 @@ TEST(TargetParserTest, getARMCPUForArch) {
 }
 
 class AArch64CPUTestFixture
-    : public ::testing::TestWithParam<ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>> {};
+    : public ::testing::TestWithParam<
+          ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>> {};
 
 TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
   ARMCPUTestParams params = GetParam();
@@ -1013,465 +1011,513 @@ TEST_P(AArch64CPUTestFixture, testAArch64CPU) {
 INSTANTIATE_TEST_SUITE_P(
     AArch64CPUTests, AArch64CPUTestFixture,
     ::testing::Values(
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP, AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
-                             AArch64::AEK_LSE, AArch64::AEK_RDM,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a510", "armv9-a", "neon-fp-armv8",
-                        (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP,
-                            AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-                            AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_BF16,
-                            AArch64::AEK_I8MM, AArch64::AEK_SVE, AArch64::AEK_SVE2,
-                            AArch64::AEK_SVE2BITPERM, AArch64::AEK_PAUTH,
-                            AArch64::AEK_MTE, AArch64::AEK_SSBS, AArch64::AEK_FP16,
-                            AArch64::AEK_FP16FML, AArch64::AEK_SB})),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a34", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                 AArch64::AEK_LSE, AArch64::AEK_RDM, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a510", "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_BF16,
+                 AArch64::AEK_I8MM, AArch64::AEK_SVE, AArch64::AEK_SVE2,
+                 AArch64::AEK_SVE2BITPERM, AArch64::AEK_PAUTH, AArch64::AEK_MTE,
+                 AArch64::AEK_SSBS, AArch64::AEK_FP16, AArch64::AEK_FP16FML,
+                 AArch64::AEK_SB})),
             "9-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_FP16,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RCPC, AArch64::AEK_RDM,
-                             AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_FP16,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RCPC, AArch64::AEK_RDM,
-                             AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
-                             AArch64::AEK_LSE, AArch64::AEK_RDM,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-                             AArch64::AEK_PROFILE})),
-                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_FP16,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RCPC,
+                 AArch64::AEK_RDM, AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_FP16,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RCPC,
+                 AArch64::AEK_RDM, AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                 AArch64::AEK_LSE, AArch64::AEK_RDM, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+                 AArch64::AEK_PROFILE})),
+            "8.2-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "cortex-a78c", "armv8.2-a", "crypto-neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_CRC, AArch64::AEK_AES,
-                AArch64::AEK_SHA2, AArch64::AEK_FP, AArch64::AEK_SIMD,
-                AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-                AArch64::AEK_FP16, AArch64::AEK_DOTPROD, AArch64::AEK_RCPC,
-                AArch64::AEK_SSBS, AArch64::AEK_PROFILE, AArch64::AEK_FLAGM,
-                AArch64::AEK_PAUTH, AArch64::AEK_FP16FML})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_RAS, AArch64::AEK_CRC, AArch64::AEK_AES,
+                 AArch64::AEK_SHA2, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                 AArch64::AEK_FP16, AArch64::AEK_DOTPROD, AArch64::AEK_RCPC,
+                 AArch64::AEK_SSBS, AArch64::AEK_PROFILE, AArch64::AEK_FLAGM,
+                 AArch64::AEK_PAUTH, AArch64::AEK_FP16FML})),
             "8.2-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "cortex-a710", "armv9-a", "neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_SIMD,
-                AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
-                AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_MTE,
-                AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SVE,
-                AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
-                AArch64::AEK_PAUTH, AArch64::AEK_FLAGM, AArch64::AEK_SB,
-                AArch64::AEK_I8MM, AArch64::AEK_BF16})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_MTE,
+                 AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_SVE,
+                 AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+                 AArch64::AEK_PAUTH, AArch64::AEK_FLAGM, AArch64::AEK_SB,
+                 AArch64::AEK_I8MM, AArch64::AEK_BF16})),
             "9-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "cortex-a715", "armv9-a", "neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_BF16,
-                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
-                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
-                AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_SVE,
-                AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
-                AArch64::AEK_SSBS, AArch64::AEK_SB, AArch64::AEK_I8MM,
-                AArch64::AEK_PERFMON, AArch64::AEK_PREDRES,
-                AArch64::AEK_PROFILE, AArch64::AEK_FP16FML,
-                AArch64::AEK_FP16, AArch64::AEK_FLAGM})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC,     AArch64::AEK_FP,
+                 AArch64::AEK_BF16,    AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS,     AArch64::AEK_LSE,
+                 AArch64::AEK_RDM,     AArch64::AEK_RCPC,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_MTE,
+                 AArch64::AEK_PAUTH,   AArch64::AEK_SVE,
+                 AArch64::AEK_SVE2,    AArch64::AEK_SVE2BITPERM,
+                 AArch64::AEK_SSBS,    AArch64::AEK_SB,
+                 AArch64::AEK_I8MM,    AArch64::AEK_PERFMON,
+                 AArch64::AEK_PREDRES, AArch64::AEK_PROFILE,
+                 AArch64::AEK_FP16FML, AArch64::AEK_FP16,
+                 AArch64::AEK_FLAGM})),
             "9-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_SVE, AArch64::AEK_SSBS,
-                AArch64::AEK_RCPC, AArch64::AEK_CRC, AArch64::AEK_FP,
-                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
-                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
-                AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                AArch64::AEK_SM4, AArch64::AEK_FP16, AArch64::AEK_BF16,
-                AArch64::AEK_PROFILE, AArch64::AEK_RAND,
-                AArch64::AEK_FP16FML, AArch64::AEK_I8MM})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_RAS,     AArch64::AEK_SVE,  AArch64::AEK_SSBS,
+                 AArch64::AEK_RCPC,    AArch64::AEK_CRC,  AArch64::AEK_FP,
+                 AArch64::AEK_SIMD,    AArch64::AEK_RAS,  AArch64::AEK_LSE,
+                 AArch64::AEK_RDM,     AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                 AArch64::AEK_AES,     AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                 AArch64::AEK_SM4,     AArch64::AEK_FP16, AArch64::AEK_BF16,
+                 AArch64::AEK_PROFILE, AArch64::AEK_RAND, AArch64::AEK_FP16FML,
+                 AArch64::AEK_I8MM})),
             "8.4-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("neoverse-v2", "armv9-a", "neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_SVE,
-                             AArch64::AEK_SSBS, AArch64::AEK_RCPC,
-                             AArch64::AEK_CRC, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_MTE,
-                             AArch64::AEK_LSE, AArch64::AEK_RDM,
-                             AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP16, AArch64::AEK_BF16,
-                             AArch64::AEK_SVE2, AArch64::AEK_PROFILE,
-                             AArch64::AEK_FP16FML, AArch64::AEK_I8MM,
-                             AArch64::AEK_SVE2BITPERM, AArch64::AEK_RAND})),
-                         "9-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_RDM,
-                             AArch64::AEK_SSBS, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_FP16, AArch64::AEK_FP16FML,
-                             AArch64::AEK_RAS, AArch64::AEK_RCPC,
-                             AArch64::AEK_LSE, AArch64::AEK_SB})),
-                         "8-R"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-                             AArch64::AEK_PROFILE})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_FP16, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_RCPC, AArch64::AEK_SSBS,
-                             AArch64::AEK_PAUTH, AArch64::AEK_PROFILE})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cortex-x2", "armv9-a", "neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
-                             AArch64::AEK_LSE, AArch64::AEK_RDM,
-                             AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_MTE, AArch64::AEK_PAUTH,
-                             AArch64::AEK_I8MM, AArch64::AEK_BF16,
-                             AArch64::AEK_SVE, AArch64::AEK_SVE2,
-                             AArch64::AEK_SVE2BITPERM, AArch64::AEK_SSBS,
-                             AArch64::AEK_SB, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML})),
-                         "9-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
-            "cortex-x3",
-            "armv9-a", "neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_BF16,
-                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
-                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
-                AArch64::AEK_MTE, AArch64::AEK_PAUTH, AArch64::AEK_SVE,
-                AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM, AArch64::AEK_SB,
-                AArch64::AEK_PROFILE, AArch64::AEK_PERFMON,
-                AArch64::AEK_I8MM, AArch64::AEK_FP16, AArch64::AEK_FP16FML,
-                AArch64::AEK_PREDRES, AArch64::AEK_FLAGM, AArch64::AEK_SSBS})),
+            "neoverse-v2", "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_RAS,         AArch64::AEK_SVE,
+                 AArch64::AEK_SSBS,        AArch64::AEK_RCPC,
+                 AArch64::AEK_CRC,         AArch64::AEK_FP,
+                 AArch64::AEK_SIMD,        AArch64::AEK_MTE,
+                 AArch64::AEK_LSE,         AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC,        AArch64::AEK_DOTPROD,
+                 AArch64::AEK_FP16,        AArch64::AEK_BF16,
+                 AArch64::AEK_SVE2,        AArch64::AEK_PROFILE,
+                 AArch64::AEK_FP16FML,     AArch64::AEK_I8MM,
+                 AArch64::AEK_SVE2BITPERM, AArch64::AEK_RAND})),
             "9-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("cyclone", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a7", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a8", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a9", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a10", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_FP16})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_LSE,
-                             AArch64::AEK_RAS, AArch64::AEK_RDM,
-                             AArch64::AEK_RCPC, AArch64::AEK_FP16})),
-                         "8.3-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
-                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
-                         "8.4-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
-                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
-                         "8.5-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
-                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
-                             AArch64::AEK_BF16, AArch64::AEK_I8MM})),
-                         "8.5-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
-                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
-                             AArch64::AEK_BF16, AArch64::AEK_I8MM})),
-                         "8.5-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
-                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
-                         "8.5-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                             AArch64::AEK_FP, AArch64::AEK_SIMD,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_RCPC,
-                             AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_SHA3,
-                             AArch64::AEK_BF16, AArch64::AEK_I8MM})),
-                         "8.5-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_LSE,
-                             AArch64::AEK_RAS, AArch64::AEK_RDM,
-                             AArch64::AEK_RCPC, AArch64::AEK_FP16})),
-                         "8.3-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_LSE,
-                             AArch64::AEK_RAS, AArch64::AEK_RDM,
-                             AArch64::AEK_RCPC, AArch64::AEK_FP16})),
-                         "8.3-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_FP16,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_FP16,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("falkor", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_RDM})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("kryo", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_FP16,
-                             AArch64::AEK_LSE, AArch64::AEK_RAS,
-                             AArch64::AEK_RCPC, AArch64::AEK_RDM,
-                             AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_DOTPROD,
-                             AArch64::AEK_FP, AArch64::AEK_FP16,
-                             AArch64::AEK_LSE, AArch64::AEK_PROFILE,
-                             AArch64::AEK_RAS, AArch64::AEK_RCPC,
-                             AArch64::AEK_RDM, AArch64::AEK_SIMD,
-                             AArch64::AEK_SSBS})),
-                         "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-r82", "armv8-r", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_RDM, AArch64::AEK_SSBS,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_FP16, AArch64::AEK_FP16FML, AArch64::AEK_RAS,
+                 AArch64::AEK_RCPC, AArch64::AEK_LSE, AArch64::AEK_SB})),
+            "8-R"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+                 AArch64::AEK_PROFILE})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-x1c", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_FP16,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_RCPC, AArch64::AEK_SSBS,
+                 AArch64::AEK_PAUTH, AArch64::AEK_PROFILE})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-x2", "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_MTE,
+                 AArch64::AEK_PAUTH, AArch64::AEK_I8MM, AArch64::AEK_BF16,
+                 AArch64::AEK_SVE, AArch64::AEK_SVE2, AArch64::AEK_SVE2BITPERM,
+                 AArch64::AEK_SSBS, AArch64::AEK_SB, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML})),
+            "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cortex-x3", "armv9-a", "neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC,     AArch64::AEK_FP,
+                 AArch64::AEK_BF16,    AArch64::AEK_SIMD,
+                 AArch64::AEK_RAS,     AArch64::AEK_LSE,
+                 AArch64::AEK_RDM,     AArch64::AEK_RCPC,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_MTE,
+                 AArch64::AEK_PAUTH,   AArch64::AEK_SVE,
+                 AArch64::AEK_SVE2,    AArch64::AEK_SVE2BITPERM,
+                 AArch64::AEK_SB,      AArch64::AEK_PROFILE,
+                 AArch64::AEK_PERFMON, AArch64::AEK_I8MM,
+                 AArch64::AEK_FP16,    AArch64::AEK_FP16FML,
+                 AArch64::AEK_PREDRES, AArch64::AEK_FLAGM,
+                 AArch64::AEK_SSBS})),
+            "9-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "cyclone", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_NONE, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a7", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_NONE, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a8", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_NONE, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a9", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_NONE, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a10", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_RDM, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a11", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_LSE, AArch64::AEK_RAS,
+                 AArch64::AEK_RDM, AArch64::AEK_SIMD, AArch64::AEK_FP16})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a12", "armv8.3-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_LSE,
+                 AArch64::AEK_RAS, AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                 AArch64::AEK_FP16})),
+            "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a13", "armv8.4-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SHA3, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
+            "8.4-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a14", "armv8.5-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SHA3, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
+            "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a15", "armv8.5-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SHA3, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML, AArch64::AEK_SHA3, AArch64::AEK_BF16,
+                 AArch64::AEK_I8MM})),
+            "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-a16", "armv8.5-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SHA3, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML, AArch64::AEK_SHA3, AArch64::AEK_BF16,
+                 AArch64::AEK_I8MM})),
+            "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-m1", "armv8.5-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SHA3, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML, AArch64::AEK_SHA3})),
+            "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-m2", "armv8.5-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SHA3, AArch64::AEK_FP, AArch64::AEK_SIMD,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_RCPC, AArch64::AEK_DOTPROD, AArch64::AEK_FP16,
+                 AArch64::AEK_FP16FML, AArch64::AEK_SHA3, AArch64::AEK_BF16,
+                 AArch64::AEK_I8MM})),
+            "8.5-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-s4", "armv8.3-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_LSE,
+                 AArch64::AEK_RAS, AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                 AArch64::AEK_FP16})),
+            "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "apple-s5", "armv8.3-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_LSE,
+                 AArch64::AEK_RAS, AArch64::AEK_RDM, AArch64::AEK_RCPC,
+                 AArch64::AEK_FP16})),
+            "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_FP16,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_SIMD})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_FP16,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RDM,
+                 AArch64::AEK_SIMD})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "falkor", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_RDM})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "kryo", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_FP16,
+                 AArch64::AEK_LSE, AArch64::AEK_RAS, AArch64::AEK_RCPC,
+                 AArch64::AEK_RDM, AArch64::AEK_SIMD, AArch64::AEK_SSBS})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_DOTPROD, AArch64::AEK_FP, AArch64::AEK_FP16,
+                 AArch64::AEK_LSE, AArch64::AEK_PROFILE, AArch64::AEK_RAS,
+                 AArch64::AEK_RCPC, AArch64::AEK_RDM, AArch64::AEK_SIMD,
+                 AArch64::AEK_SSBS})),
+            "8.2-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
-                AArch64::AEK_SHA3, AArch64::AEK_SM4, AArch64::AEK_FP,
-                AArch64::AEK_SIMD, AArch64::AEK_FP16, AArch64::AEK_RAS,
-                AArch64::AEK_LSE, AArch64::AEK_SVE, AArch64::AEK_DOTPROD,
-                AArch64::AEK_RCPC, AArch64::AEK_RDM, AArch64::AEK_MTE,
-                AArch64::AEK_SSBS, AArch64::AEK_SB, AArch64::AEK_SVE2,
-                AArch64::AEK_SVE2BITPERM, AArch64::AEK_BF16,
-                AArch64::AEK_I8MM})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC,         AArch64::AEK_AES,
+                 AArch64::AEK_SHA2,        AArch64::AEK_SHA3,
+                 AArch64::AEK_SM4,         AArch64::AEK_FP,
+                 AArch64::AEK_SIMD,        AArch64::AEK_FP16,
+                 AArch64::AEK_RAS,         AArch64::AEK_LSE,
+                 AArch64::AEK_SVE,         AArch64::AEK_DOTPROD,
+                 AArch64::AEK_RCPC,        AArch64::AEK_RDM,
+                 AArch64::AEK_MTE,         AArch64::AEK_SSBS,
+                 AArch64::AEK_SB,          AArch64::AEK_SVE2,
+                 AArch64::AEK_SVE2BITPERM, AArch64::AEK_BF16,
+                 AArch64::AEK_I8MM})),
             "8.5-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "ampere1", "armv8.6-a", "crypto-neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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_SHA3, AArch64::AEK_BF16, AArch64::AEK_SHA2,
-                AArch64::AEK_AES, AArch64::AEK_I8MM, AArch64::AEK_SSBS,
-                AArch64::AEK_SB, AArch64::AEK_RAND})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {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_SHA3, AArch64::AEK_BF16, AArch64::AEK_SHA2,
+                 AArch64::AEK_AES, AArch64::AEK_I8MM, AArch64::AEK_SSBS,
+                 AArch64::AEK_SB, AArch64::AEK_RAND})),
             "8.6-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "ampere1a", "armv8.6-a", "crypto-neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({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_RAND,
-                AArch64::AEK_MTE})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {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_RAND,
+                 AArch64::AEK_MTE})),
             "8.6-A"),
         ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
             "neoverse-512tvb", "armv8.4-a", "crypto-neon-fp-armv8",
-            (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_RAS, AArch64::AEK_SVE, AArch64::AEK_SSBS,
-                AArch64::AEK_RCPC, AArch64::AEK_CRC, AArch64::AEK_FP,
-                AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_LSE,
-                AArch64::AEK_RDM, AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
-                AArch64::AEK_AES, AArch64::AEK_SHA2, AArch64::AEK_SHA3,
-                AArch64::AEK_SM4, AArch64::AEK_FP16, AArch64::AEK_BF16,
-                AArch64::AEK_PROFILE, AArch64::AEK_RAND,
-                AArch64::AEK_FP16FML, AArch64::AEK_I8MM})),
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_RAS,     AArch64::AEK_SVE,  AArch64::AEK_SSBS,
+                 AArch64::AEK_RCPC,    AArch64::AEK_CRC,  AArch64::AEK_FP,
+                 AArch64::AEK_SIMD,    AArch64::AEK_RAS,  AArch64::AEK_LSE,
+                 AArch64::AEK_RDM,     AArch64::AEK_RCPC, AArch64::AEK_DOTPROD,
+                 AArch64::AEK_AES,     AArch64::AEK_SHA2, AArch64::AEK_SHA3,
+                 AArch64::AEK_SM4,     AArch64::AEK_FP16, AArch64::AEK_BF16,
+                 AArch64::AEK_PROFILE, AArch64::AEK_RAND, AArch64::AEK_FP16FML,
+                 AArch64::AEK_I8MM})),
             "8.4-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_LSE,
-                             AArch64::AEK_RDM, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD})),
-                         "8.1-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_LSE,
-                             AArch64::AEK_RDM, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
-                             AArch64::AEK_RCPC})),
-                         "8.3-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderx", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
-                             AArch64::AEK_FP})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
-                             AArch64::AEK_FP})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
-                             AArch64::AEK_FP})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_SIMD,
-                             AArch64::AEK_FP})),
-                         "8-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_RAS,
-                             AArch64::AEK_LSE, AArch64::AEK_RDM,
-                             AArch64::AEK_PROFILE, AArch64::AEK_FP16,
-                             AArch64::AEK_FP16FML, AArch64::AEK_DOTPROD})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_FP16,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_SVE, AArch64::AEK_RDM})),
-                         "8.2-A"),
-        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>("carmel", "armv8.2-a", "crypto-neon-fp-armv8",
-                         (Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_CRC, AArch64::AEK_AES,
-                             AArch64::AEK_SHA2, AArch64::AEK_FP,
-                             AArch64::AEK_SIMD, AArch64::AEK_FP16,
-                             AArch64::AEK_RAS, AArch64::AEK_LSE,
-                             AArch64::AEK_RDM})),
-                         "8.2-A")));
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_LSE, AArch64::AEK_RDM, AArch64::AEK_FP,
+                 AArch64::AEK_SIMD})),
+            "8.1-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_LSE, AArch64::AEK_RDM, AArch64::AEK_FP,
+                 AArch64::AEK_SIMD, AArch64::AEK_RAS, AArch64::AEK_RCPC})),
+            "8.3-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "thunderx", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SIMD, AArch64::AEK_FP})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "thunderxt81", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SIMD, AArch64::AEK_FP})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "thunderxt83", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SIMD, AArch64::AEK_FP})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "thunderxt88", "armv8-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_SIMD, AArch64::AEK_FP})),
+            "8-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "tsv110", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_RAS,
+                 AArch64::AEK_LSE, AArch64::AEK_RDM, AArch64::AEK_PROFILE,
+                 AArch64::AEK_FP16, AArch64::AEK_FP16FML,
+                 AArch64::AEK_DOTPROD})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "a64fx", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_FP16,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_SVE,
+                 AArch64::AEK_RDM})),
+            "8.2-A"),
+        ARMCPUTestParams<Bitset<AArch64::AEK_EXTENTIONS_MAX>>(
+            "carmel", "armv8.2-a", "crypto-neon-fp-armv8",
+            (Bitset<AArch64::AEK_EXTENTIONS_MAX>(
+                {AArch64::AEK_CRC, AArch64::AEK_AES, AArch64::AEK_SHA2,
+                 AArch64::AEK_FP, AArch64::AEK_SIMD, AArch64::AEK_FP16,
+                 AArch64::AEK_RAS, AArch64::AEK_LSE, AArch64::AEK_RDM})),
+            "8.2-A")));
 
 // Note: number of CPUs includes aliases.
 static constexpr unsigned NumAArch64CPUArchs = 62;
@@ -1483,7 +1529,7 @@ TEST(TargetParserTest, testAArch64CPUArchList) {
   // No list exists for these in this test suite, so ensure all are
   // valid, and match the expected 'magic' count.
   EXPECT_EQ(List.size(), NumAArch64CPUArchs);
-  for(StringRef CPU : List) {
+  for (StringRef CPU : List) {
     EXPECT_TRUE(AArch64::parseCpu(CPU));
   }
 }
@@ -1648,7 +1694,8 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
 
   // NONE has no feature names.
   // We return True here because NONE is a valid choice.
-  EXPECT_TRUE(AArch64::getExtensionFeatures(Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE}), Features));
+  EXPECT_TRUE(AArch64::getExtensionFeatures(
+      Bitset<AArch64::AEK_EXTENTIONS_MAX>({AArch64::AEK_NONE}), Features));
   EXPECT_TRUE(!Features.size());
 
   AArch64::getExtensionFeatures(ExtVal, Features);



More information about the cfe-commits mailing list