llvm.org GIT mirror llvm / f007e3a
[AArch64] Make the TargetParser add CPU exts provided by the arch. Otherwise, each CPU has to manually specify the extensions it supports, even though they have to be a superset of the base arch extensions. And when there's redundant data there's stale data, so most of the CPUs lie about the features they support (almost none lists AEK_FP). Instead, do the saner thing: add the optional extensions on top of the base extensions provided by the architecture. The ARM TargetParser has the same behavior. Differential Revision: https://reviews.llvm.org/D32780 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302078 91177308-0d34-0410-b5e6-96231b3b80d8 Ahmed Bougacha 3 years ago
3 changed file(s) with 40 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
5050 #define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT)
5151 #endif
5252 AARCH64_CPU_NAME("cortex-a35", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
53 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
53 (AArch64::AEK_CRC))
5454 AARCH64_CPU_NAME("cortex-a53", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, true,
55 ( AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
55 (AArch64::AEK_CRC))
5656 AARCH64_CPU_NAME("cortex-a57", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
57 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
57 (AArch64::AEK_CRC))
5858 AARCH64_CPU_NAME("cortex-a72", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
59 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
59 (AArch64::AEK_CRC))
6060 AARCH64_CPU_NAME("cortex-a73", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
61 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
61 (AArch64::AEK_CRC))
6262 AARCH64_CPU_NAME("cyclone", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
63 (AArch64::AEK_SIMD | AArch64::AEK_CRYPTO))
63 (AArch64::AEK_NONE))
6464 AARCH64_CPU_NAME("exynos-m1", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
65 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
65 (AArch64::AEK_CRC))
6666 AARCH64_CPU_NAME("exynos-m2", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
67 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
67 (AArch64::AEK_CRC))
6868 AARCH64_CPU_NAME("exynos-m3", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
69 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
69 (AArch64::AEK_CRC))
7070 AARCH64_CPU_NAME("falkor", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
71 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
71 (AArch64::AEK_CRC))
7272 AARCH64_CPU_NAME("kryo", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
73 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO))
73 (AArch64::AEK_CRC))
7474 AARCH64_CPU_NAME("thunderx2t99", AK_ARMV8_1A, FK_CRYPTO_NEON_FP_ARMV8, false,
75 (AArch64::AEK_SIMD | AArch64::AEK_LSE | AArch64::AEK_CRC |
76 AArch64::AEK_CRYPTO))
75 (AArch64::AEK_NONE))
7776 AARCH64_CPU_NAME("thunderx", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
78 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_PROFILE))
77 (AArch64::AEK_CRC | AArch64::AEK_PROFILE))
7978 AARCH64_CPU_NAME("thunderxt88", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
80 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_PROFILE))
79 (AArch64::AEK_CRC | AArch64::AEK_PROFILE))
8180 AARCH64_CPU_NAME("thunderxt81", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
82 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_PROFILE))
81 (AArch64::AEK_CRC | AArch64::AEK_PROFILE))
8382 AARCH64_CPU_NAME("thunderxt83", AK_ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false,
84 (AArch64::AEK_SIMD | AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_PROFILE))
83 (AArch64::AEK_CRC | AArch64::AEK_PROFILE))
8584 // Invalid CPU
8685 AARCH64_CPU_NAME("invalid", AK_INVALID, FK_INVALID, true, AArch64::AEK_INVALID)
8786 #undef AARCH64_CPU_NAME
422422
423423 return StringSwitch(CPU)
424424 #define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
425 .Case(NAME, DEFAULT_EXT)
425 .Case(NAME, AArch64ARCHNames[(unsigned)ArchKind::ID].ArchBaseExtensions | DEFAULT_EXT)
426426 #include "llvm/Support/AArch64TargetParser.def"
427427 .Default(AArch64::AEK_INVALID);
428428 }
610610 TEST(TargetParserTest, testAArch64CPU) {
611611 EXPECT_TRUE(testAArch64CPU(
612612 "invalid", "invalid", "invalid",
613 AArch64::AEK_INVALID, ""));
613 AArch64::AEK_NONE, ""));
614614 EXPECT_TRUE(testAArch64CPU(
615615 "generic", "invalid", "none",
616616 AArch64::AEK_NONE, ""));
617617
618618 EXPECT_TRUE(testAArch64CPU(
619619 "cortex-a35", "armv8-a", "crypto-neon-fp-armv8",
620 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
620 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
621 AArch64::AEK_SIMD, "8-A"));
621622 EXPECT_TRUE(testAArch64CPU(
622623 "cortex-a53", "armv8-a", "crypto-neon-fp-armv8",
623 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
624 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
625 AArch64::AEK_SIMD, "8-A"));
624626 EXPECT_TRUE(testAArch64CPU(
625627 "cortex-a57", "armv8-a", "crypto-neon-fp-armv8",
626 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
628 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
629 AArch64::AEK_SIMD, "8-A"));
627630 EXPECT_TRUE(testAArch64CPU(
628631 "cortex-a72", "armv8-a", "crypto-neon-fp-armv8",
629 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
632 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
633 AArch64::AEK_SIMD, "8-A"));
630634 EXPECT_TRUE(testAArch64CPU(
631635 "cortex-a73", "armv8-a", "crypto-neon-fp-armv8",
632 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
636 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
637 AArch64::AEK_SIMD, "8-A"));
633638 EXPECT_TRUE(testAArch64CPU(
634639 "cyclone", "armv8-a", "crypto-neon-fp-armv8",
635 AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
640 AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD, "8-A"));
636641 EXPECT_TRUE(testAArch64CPU(
637642 "exynos-m1", "armv8-a", "crypto-neon-fp-armv8",
638 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
643 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
644 AArch64::AEK_SIMD, "8-A"));
639645 EXPECT_TRUE(testAArch64CPU(
640646 "exynos-m2", "armv8-a", "crypto-neon-fp-armv8",
641 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
647 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
648 AArch64::AEK_SIMD, "8-A"));
642649 EXPECT_TRUE(testAArch64CPU(
643650 "exynos-m3", "armv8-a", "crypto-neon-fp-armv8",
644 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
651 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
652 AArch64::AEK_SIMD, "8-A"));
645653 EXPECT_TRUE(testAArch64CPU(
646654 "falkor", "armv8-a", "crypto-neon-fp-armv8",
647 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
655 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
656 AArch64::AEK_SIMD, "8-A"));
648657 EXPECT_TRUE(testAArch64CPU(
649658 "kryo", "armv8-a", "crypto-neon-fp-armv8",
650 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD, "8-A"));
659 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
660 AArch64::AEK_SIMD, "8-A"));
651661 EXPECT_TRUE(testAArch64CPU(
652662 "thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
653663 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
654 AArch64::AEK_SIMD, "8.1-A"));
664 AArch64::AEK_FP | AArch64::AEK_SIMD, "8.1-A"));
655665 EXPECT_TRUE(testAArch64CPU(
656666 "thunderx", "armv8-a", "crypto-neon-fp-armv8",
657667 AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_SIMD |