diff --git a/llvm/unittests/Support/TargetParserTest.cpp b/llvm/unittests/Support/TargetParserTest.cpp --- a/llvm/unittests/Support/TargetParserTest.cpp +++ b/llvm/unittests/Support/TargetParserTest.cpp @@ -9,8 +9,10 @@ #include "llvm/Support/TargetParser.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/ARMBuildAttributes.h" +#include "gmock/gmock.h" #include "gtest/gtest.h" #include +#include using namespace llvm; @@ -31,308 +33,307 @@ "iwmmxt2", "xscale", "armv8.1-m.main", }; -bool testARMCPU(StringRef CPUName, StringRef ExpectedArch, - StringRef ExpectedFPU, uint64_t ExpectedFlags, - StringRef CPUAttr) { - ARM::ArchKind AK = ARM::parseCPUArch(CPUName); - bool pass = ARM::getArchName(AK).equals(ExpectedArch); - unsigned FPUKind = ARM::getDefaultFPU(CPUName, AK); - pass &= ARM::getFPUName(FPUKind).equals(ExpectedFPU); - - uint64_t ExtKind = ARM::getDefaultExtensions(CPUName, AK); - if (ExtKind > 1 && (ExtKind & ARM::AEK_NONE)) - pass &= ((ExtKind ^ ARM::AEK_NONE) == ExpectedFlags); - else - pass &= (ExtKind == ExpectedFlags); - pass &= ARM::getCPUAttr(AK).equals(CPUAttr); - - return pass; +struct ARMCPUTestParams { + ARMCPUTestParams(StringRef CPUName, StringRef ExpectedArch, + StringRef ExpectedFPU, uint64_t ExpectedFlags, + StringRef CPUAttr) + : CPUName(CPUName), ExpectedArch(ExpectedArch), ExpectedFPU(ExpectedFPU), + ExpectedFlags(ExpectedFlags), CPUAttr(CPUAttr) {} + + StringRef CPUName; + StringRef ExpectedArch; + StringRef ExpectedFPU; + uint64_t ExpectedFlags; + StringRef CPUAttr; +}; + +class ARMCPUTestFixture : public ::testing::TestWithParam {}; + +TEST_P(ARMCPUTestFixture, ARMCPUTests) { + auto params = GetParam(); + + ARM::ArchKind AK = ARM::parseCPUArch(params.CPUName); + EXPECT_EQ(params.ExpectedArch, ARM::getArchName(AK)); + + unsigned FPUKind = ARM::getDefaultFPU(params.CPUName, AK); + EXPECT_EQ(params.ExpectedFPU, ARM::getFPUName(FPUKind)); + + uint64_t default_extensions = ARM::getDefaultExtensions(params.CPUName, AK); + EXPECT_EQ(params.ExpectedFlags, default_extensions); + + EXPECT_EQ(params.CPUAttr, ARM::getCPUAttr(AK)); } -TEST(TargetParserTest, testARMCPU) { - EXPECT_TRUE(testARMCPU("invalid", "invalid", "invalid", - ARM::AEK_NONE, "")); - EXPECT_TRUE(testARMCPU("generic", "invalid", "none", - ARM::AEK_NONE, "")); - - EXPECT_TRUE(testARMCPU("arm2", "armv2", "none", - ARM::AEK_NONE, "2")); - EXPECT_TRUE(testARMCPU("arm3", "armv2a", "none", - ARM::AEK_NONE, "2A")); - EXPECT_TRUE(testARMCPU("arm6", "armv3", "none", - ARM::AEK_NONE, "3")); - EXPECT_TRUE(testARMCPU("arm7m", "armv3m", "none", - ARM::AEK_NONE, "3M")); - EXPECT_TRUE(testARMCPU("arm8", "armv4", "none", - ARM::AEK_NONE, "4")); - EXPECT_TRUE(testARMCPU("arm810", "armv4", "none", - ARM::AEK_NONE, "4")); - EXPECT_TRUE(testARMCPU("strongarm", "armv4", "none", - ARM::AEK_NONE, "4")); - EXPECT_TRUE(testARMCPU("strongarm110", "armv4", "none", - ARM::AEK_NONE, "4")); - EXPECT_TRUE(testARMCPU("strongarm1100", "armv4", "none", - ARM::AEK_NONE, "4")); - EXPECT_TRUE(testARMCPU("strongarm1110", "armv4", "none", - ARM::AEK_NONE, "4")); - EXPECT_TRUE(testARMCPU("arm7tdmi", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm7tdmi-s", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm710t", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm720t", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm9", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm9tdmi", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm920", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm920t", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm922t", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm9312", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm940t", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("ep9312", "armv4t", "none", - ARM::AEK_NONE, "4T")); - EXPECT_TRUE(testARMCPU("arm10tdmi", "armv5t", "none", - ARM::AEK_NONE, "5T")); - EXPECT_TRUE(testARMCPU("arm1020t", "armv5t", "none", - ARM::AEK_NONE, "5T")); - EXPECT_TRUE(testARMCPU("arm9e", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm946e-s", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm966e-s", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm968e-s", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm10e", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm1020e", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm1022e", "armv5te", "none", - ARM::AEK_DSP, "5TE")); - EXPECT_TRUE(testARMCPU("arm926ej-s", "armv5tej", "none", - ARM::AEK_DSP, "5TEJ")); - EXPECT_TRUE(testARMCPU("arm1136j-s", "armv6", "none", - ARM::AEK_DSP, "6")); - EXPECT_TRUE(testARMCPU("arm1136jf-s", "armv6", "vfpv2", - ARM::AEK_DSP, "6")); - EXPECT_TRUE(testARMCPU("arm1136jz-s", "armv6", "none", - ARM::AEK_DSP, "6")); - EXPECT_TRUE(testARMCPU("arm1176jz-s", "armv6kz", "none", - ARM::AEK_SEC | ARM::AEK_DSP, "6KZ")); - EXPECT_TRUE(testARMCPU("mpcore", "armv6k", "vfpv2", - ARM::AEK_DSP, "6K")); - EXPECT_TRUE(testARMCPU("mpcorenovfp", "armv6k", "none", - ARM::AEK_DSP, "6K")); - EXPECT_TRUE(testARMCPU("arm1176jzf-s", "armv6kz", "vfpv2", - ARM::AEK_SEC | ARM::AEK_DSP, "6KZ")); - EXPECT_TRUE(testARMCPU("arm1156t2-s", "armv6t2", "none", - ARM::AEK_DSP, "6T2")); - EXPECT_TRUE(testARMCPU("arm1156t2f-s", "armv6t2", "vfpv2", - ARM::AEK_DSP, "6T2")); - EXPECT_TRUE(testARMCPU("cortex-m0", "armv6-m", "none", - ARM::AEK_NONE, "6-M")); - EXPECT_TRUE(testARMCPU("cortex-m0plus", "armv6-m", "none", - ARM::AEK_NONE, "6-M")); - EXPECT_TRUE(testARMCPU("cortex-m1", "armv6-m", "none", - ARM::AEK_NONE, "6-M")); - EXPECT_TRUE(testARMCPU("sc000", "armv6-m", "none", - ARM::AEK_NONE, "6-M")); - EXPECT_TRUE(testARMCPU("cortex-a5", "armv7-a", "neon-vfpv4", - ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A")); - EXPECT_TRUE(testARMCPU("cortex-a7", "armv7-a", "neon-vfpv4", +// 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_CASE_P( + ARMCPUTestsPart1, ARMCPUTestFixture, + ::testing::Values( + ARMCPUTestParams("invalid", "invalid", "invalid", ARM::AEK_NONE, ""), + ARMCPUTestParams("generic", "invalid", "none", ARM::AEK_NONE, ""), + + ARMCPUTestParams("arm2", "armv2", "none", ARM::AEK_NONE, "2"), + ARMCPUTestParams("arm3", "armv2a", "none", ARM::AEK_NONE, "2A"), + ARMCPUTestParams("arm6", "armv3", "none", ARM::AEK_NONE, "3"), + ARMCPUTestParams("arm7m", "armv3m", "none", ARM::AEK_NONE, "3M"), + 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("arm9312", "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_NONE | ARM::AEK_DSP, "6"), + ARMCPUTestParams("arm1136jz-s", "armv6", "none", + 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")); - EXPECT_TRUE(testARMCPU("cortex-a8", "armv7-a", "neon", - ARM::AEK_SEC | ARM::AEK_DSP, "7-A")); - EXPECT_TRUE(testARMCPU("cortex-a9", "armv7-a", "neon-fp16", - ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_DSP, "7-A")); - EXPECT_TRUE(testARMCPU("cortex-a12", "armv7-a", "neon-vfpv4", + "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_CASE_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")); - EXPECT_TRUE(testARMCPU("cortex-a15", "armv7-a", "neon-vfpv4", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a17", "armv7-a", "neon-vfpv4", + "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")); - EXPECT_TRUE(testARMCPU("krait", "armv7-a", "neon-vfpv4", + "7-A"), + ARMCPUTestParams("krait", "armv7-a", "neon-vfpv4", ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, - "7-A")); - EXPECT_TRUE(testARMCPU("cortex-r4", "armv7-r", "none", - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "7-R")); - EXPECT_TRUE(testARMCPU("cortex-r4f", "armv7-r", "vfpv3-d16", - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "7-R")); - EXPECT_TRUE(testARMCPU("cortex-r5", "armv7-r", "vfpv3-d16", + "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")); - EXPECT_TRUE(testARMCPU("cortex-r7", "armv7-r", "vfpv3-d16-fp16", + "7-R"), + ARMCPUTestParams("cortex-r7", "armv7-r", "vfpv3-d16-fp16", ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, - "7-R")); - EXPECT_TRUE(testARMCPU("cortex-r8", "armv7-r", "vfpv3-d16-fp16", + "7-R"), + ARMCPUTestParams("cortex-r8", "armv7-r", "vfpv3-d16-fp16", ARM::AEK_MP | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, - "7-R")); - EXPECT_TRUE(testARMCPU("cortex-r52", "armv8-r", "neon-fp-armv8", - ARM::AEK_CRC | ARM::AEK_MP | ARM::AEK_VIRT | - ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | - ARM::AEK_DSP, - "8-R")); - EXPECT_TRUE( - testARMCPU("sc300", "armv7-m", "none", ARM::AEK_HWDIVTHUMB, "7-M")); - EXPECT_TRUE( - testARMCPU("cortex-m3", "armv7-m", "none", ARM::AEK_HWDIVTHUMB, "7-M")); - EXPECT_TRUE(testARMCPU("cortex-m4", "armv7e-m", "fpv4-sp-d16", - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "7E-M")); - EXPECT_TRUE(testARMCPU("cortex-m7", "armv7e-m", "fpv5-d16", - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "7E-M")); - EXPECT_TRUE(testARMCPU("cortex-a32", "armv8-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a35", "armv8-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a53", "armv8-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a57", "armv8-a", "crypto-neon-fp-armv8", + 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")); - EXPECT_TRUE(testARMCPU("cortex-a72", "armv8-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a73", "armv8-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8", + 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")); - EXPECT_TRUE(testARMCPU("cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8", + 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")); - EXPECT_TRUE(testARMCPU("cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8", + 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-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")); - EXPECT_TRUE(testARMCPU("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")); - EXPECT_TRUE(testARMCPU("cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8", + 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 | ARM::AEK_RAS, + "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, - "8.2-A")); - EXPECT_TRUE(testARMCPU("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")); - EXPECT_TRUE(testARMCPU("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")); - EXPECT_TRUE(testARMCPU("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")); - EXPECT_TRUE(testARMCPU("cyclone", "armv8-a", "crypto-neon-fp-armv8", + 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")); - EXPECT_TRUE(testARMCPU("exynos-m3", "armv8-a", "crypto-neon-fp-armv8", + "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")); - EXPECT_TRUE(testARMCPU("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8", + 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")); - EXPECT_TRUE(testARMCPU("exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8", + 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")); - EXPECT_TRUE(testARMCPU("cortex-m23", "armv8-m.base", "none", - ARM::AEK_HWDIVTHUMB, "8-M.Baseline")); - EXPECT_TRUE(testARMCPU("cortex-m33", "armv8-m.main", "fpv5-sp-d16", - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline")); - EXPECT_TRUE(testARMCPU("cortex-m35p", "armv8-m.main", "fpv5-sp-d16", - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-M.Mainline")); - EXPECT_TRUE(testARMCPU("cortex-m55", "armv8.1-m.main", "fp-armv8-fullfp16-d16", + 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")); - EXPECT_TRUE(testARMCPU("iwmmxt", "iwmmxt", "none", - ARM::AEK_NONE, "iwmmxt")); - EXPECT_TRUE(testARMCPU("xscale", "xscale", "none", - ARM::AEK_NONE, "xscale")); - EXPECT_TRUE(testARMCPU("swift", "armv7s", "neon-vfpv4", + ARM::AEK_FP | ARM::AEK_RAS | ARM::AEK_LOB | + ARM::AEK_FP16, + "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")); -} + "7-S")), ); static constexpr unsigned NumARMCPUArchs = 91; @@ -793,278 +794,307 @@ EXPECT_EQ(5u, ARM::parseArchVersion(ARMArch[i])); } -bool testAArch64CPU(StringRef CPUName, StringRef ExpectedArch, - StringRef ExpectedFPU, uint64_t ExpectedFlags, - StringRef CPUAttr) { - AArch64::ArchKind AK = AArch64::parseCPUArch(CPUName); - bool pass = AArch64::getArchName(AK).equals(ExpectedArch); +class AArch64CPUTestFixture + : public ::testing::TestWithParam {}; - uint64_t ExtKind = AArch64::getDefaultExtensions(CPUName, AK); - if (ExtKind > 1 && (ExtKind & AArch64::AEK_NONE)) - pass &= ((ExtKind ^ AArch64::AEK_NONE) == ExpectedFlags); - else - pass &= (ExtKind == ExpectedFlags); +TEST_P(AArch64CPUTestFixture, testAArch64CPU) { + ARMCPUTestParams params = GetParam(); - unsigned FPUKind = AArch64::getDefaultFPU(CPUName, AK); - pass &= ARM::getFPUName(FPUKind).equals(ExpectedFPU); + AArch64::ArchKind AK = AArch64::parseCPUArch(params.CPUName); + EXPECT_EQ(params.ExpectedArch, AArch64::getArchName(AK)); - pass &= AArch64::getCPUAttr(AK).equals(CPUAttr); + uint64_t default_extensions = + AArch64::getDefaultExtensions(params.CPUName, AK); + EXPECT_EQ(params.ExpectedFlags, default_extensions); - return pass; -} + unsigned FPUKind = AArch64::getDefaultFPU(params.CPUName, AK); + EXPECT_EQ(params.ExpectedFPU, ARM::getFPUName(FPUKind)); -TEST(TargetParserTest, testAArch64CPU) { - EXPECT_TRUE(testAArch64CPU( - "invalid", "invalid", "invalid", - AArch64::AEK_NONE, "")); - EXPECT_TRUE(testAArch64CPU( - "generic", "invalid", "none", - AArch64::AEK_NONE, "")); - - EXPECT_TRUE(testAArch64CPU( - "cortex-a34", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a35", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a53", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a57", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a65ae", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a72", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a73", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a76", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a76ae", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a77", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-a78", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "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_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_BF16, - "8.4-A")); - EXPECT_TRUE(testAArch64CPU( - "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")); - EXPECT_TRUE(testAArch64CPU( - "cortex-x1", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "cyclone", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-a7", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-a8", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-a9", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU("apple-a10", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | - AArch64::AEK_FP | AArch64::AEK_RDM | - AArch64::AEK_SIMD, - "8-A")); - EXPECT_TRUE(testAArch64CPU("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | - AArch64::AEK_FP | AArch64::AEK_LSE | - AArch64::AEK_RAS | AArch64::AEK_RDM | - AArch64::AEK_SIMD, - "8.2-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-a12", "armv8.3-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD | AArch64::AEK_LSE | AArch64::AEK_RAS | - AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_FP16, - "8.3-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-a13", "armv8.4-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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, - "8.4-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-s4", "armv8.3-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD | AArch64::AEK_LSE | AArch64::AEK_RAS | - AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_FP16, - "8.3-A")); - EXPECT_TRUE(testAArch64CPU( - "apple-s5", "armv8.3-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD | AArch64::AEK_LSE | AArch64::AEK_RAS | - AArch64::AEK_RDM | AArch64::AEK_RCPC | AArch64::AEK_FP16, - "8.3-A")); - EXPECT_TRUE(testAArch64CPU( - "exynos-m3", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | - AArch64::AEK_DOTPROD | AArch64::AEK_FP | AArch64::AEK_FP16 | - AArch64::AEK_LSE | AArch64::AEK_RAS | AArch64::AEK_RDM | - AArch64::AEK_SIMD, "8.2-A")); - EXPECT_TRUE(testAArch64CPU( - "exynos-m5", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | - AArch64::AEK_DOTPROD | AArch64::AEK_FP | AArch64::AEK_FP16 | - AArch64::AEK_LSE | AArch64::AEK_RAS | AArch64::AEK_RDM | - AArch64::AEK_SIMD, "8.2-A")); - EXPECT_TRUE(testAArch64CPU( - "falkor", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD | AArch64::AEK_RDM, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "kryo", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); - EXPECT_TRUE(testAArch64CPU( - "neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "neoverse-n1", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE | - AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD, "8.1-A")); - EXPECT_TRUE(testAArch64CPU( - "thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE | - AArch64::AEK_RDM | AArch64::AEK_FP | AArch64::AEK_SIMD | - AArch64::AEK_PROFILE | AArch64::AEK_RAS | AArch64::AEK_RAND | - AArch64::AEK_RCPC, - "8.3-A")); - EXPECT_TRUE(testAArch64CPU( - "thunderx", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD | - AArch64::AEK_FP | AArch64::AEK_PROFILE, - "8-A")); - EXPECT_TRUE(testAArch64CPU( - "thunderxt81", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD | - AArch64::AEK_FP | AArch64::AEK_PROFILE, - "8-A")); - EXPECT_TRUE(testAArch64CPU( - "thunderxt83", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD | - AArch64::AEK_FP | AArch64::AEK_PROFILE, - "8-A")); - EXPECT_TRUE(testAArch64CPU( - "thunderxt88", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD | - AArch64::AEK_FP | AArch64::AEK_PROFILE, - "8-A")); - EXPECT_TRUE(testAArch64CPU( - "tsv110", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | 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")); - EXPECT_TRUE(testAArch64CPU( - "a64fx", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD | AArch64::AEK_FP16 | AArch64::AEK_RAS | - AArch64::AEK_LSE | AArch64::AEK_SVE | AArch64::AEK_RDM, - "8.2-A")); - EXPECT_TRUE(testAArch64CPU( - "carmel", "armv8.2-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD | AArch64::AEK_FP16 | AArch64::AEK_RAS | - AArch64::AEK_LSE | AArch64::AEK_RDM, - "8.2-A")); + EXPECT_EQ(params.CPUAttr, AArch64::getCPUAttr(AK)); } +INSTANTIATE_TEST_CASE_P( + AArch64CPUTests, AArch64CPUTestFixture, + ::testing::Values( + ARMCPUTestParams("invalid", "invalid", "invalid", AArch64::AEK_NONE, + ""), + ARMCPUTestParams("generic", "invalid", "none", AArch64::AEK_NONE, ""), + + ARMCPUTestParams("cortex-a34", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("cortex-a35", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("cortex-a53", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("cortex-a55", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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-a57", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("cortex-a65", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("cortex-a73", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("cortex-a75", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + 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( + "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_CRYPTO | AArch64::AEK_FP16 | AArch64::AEK_BF16, + "8.4-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_CRYPTO | + 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("cyclone", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_NONE | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("apple-a7", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_NONE | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("apple-a8", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_NONE | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("apple-a9", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_NONE | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("apple-a10", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_RDM | + AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("apple-a11", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_NONE | AArch64::AEK_CRC | + AArch64::AEK_CRYPTO | AArch64::AEK_FP | + AArch64::AEK_LSE | AArch64::AEK_RAS | + AArch64::AEK_RDM | AArch64::AEK_SIMD, + "8.2-A"), + ARMCPUTestParams("apple-a12", "armv8.3-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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, + "8.4-A"), + ARMCPUTestParams("apple-s4", "armv8.3-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD | + AArch64::AEK_RDM, + "8-A"), + ARMCPUTestParams("kryo", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD, + "8-A"), + ARMCPUTestParams("neoverse-e1", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + 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("thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8", + AArch64::AEK_NONE | AArch64::AEK_CRC | + AArch64::AEK_CRYPTO | AArch64::AEK_LSE | + AArch64::AEK_RDM | AArch64::AEK_FP | + AArch64::AEK_SIMD, + "8.1-A"), + ARMCPUTestParams("thunderx3t110", "armv8.3-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_LSE | AArch64::AEK_RDM | + AArch64::AEK_FP | AArch64::AEK_SIMD | + AArch64::AEK_PROFILE | AArch64::AEK_RAS | + AArch64::AEK_RAND | AArch64::AEK_RCPC, + "8.3-A"), + ARMCPUTestParams("thunderx", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_SIMD | AArch64::AEK_FP | + AArch64::AEK_PROFILE, + "8-A"), + ARMCPUTestParams("thunderxt81", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_SIMD | AArch64::AEK_FP | + AArch64::AEK_PROFILE, + "8-A"), + ARMCPUTestParams("thunderxt83", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_SIMD | AArch64::AEK_FP | + AArch64::AEK_PROFILE, + "8-A"), + ARMCPUTestParams("thunderxt88", "armv8-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_SIMD | AArch64::AEK_FP | + AArch64::AEK_PROFILE, + "8-A"), + ARMCPUTestParams("tsv110", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + 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_CRYPTO | + 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_CRYPTO | + AArch64::AEK_FP | AArch64::AEK_SIMD | + AArch64::AEK_FP16 | AArch64::AEK_RAS | + AArch64::AEK_LSE | AArch64::AEK_RDM, + "8.2-A")), ); + static constexpr unsigned NumAArch64CPUArchs = 45; TEST(TargetParserTest, testAArch64CPUArchList) { @@ -1343,4 +1373,5 @@ AArch64::getArchExtFeature(ArchExt[i][1])); } } -} + +} // namespace