diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 13a35857512..6e2957f3c32 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -104,6 +104,7 @@ public: enum SubArchType { NoSubArch, + ARMSubArch_v8_7a, ARMSubArch_v8_6a, ARMSubArch_v8_5a, ARMSubArch_v8_4a, diff --git a/include/llvm/Support/ARMTargetParser.def b/include/llvm/Support/ARMTargetParser.def index 75ab539762d..76341a051db 100644 --- a/include/llvm/Support/ARMTargetParser.def +++ b/include/llvm/Support/ARMTargetParser.def @@ -118,6 +118,12 @@ ARM_ARCH("armv8.6-a", ARMV8_6A, "8.6-A", "v8.6a", ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS | ARM::AEK_DOTPROD | ARM::AEK_BF16 | ARM::AEK_SHA2 | ARM::AEK_AES | ARM::AEK_I8MM)) +ARM_ARCH("armv8.7-a", ARMV8_7A, "8.7-A", "v8.7a", + ARMBuildAttrs::CPUArch::v8_A, FK_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_DOTPROD | ARM::AEK_BF16 | ARM::AEK_SHA2 | ARM::AEK_AES | + ARM::AEK_I8MM)) ARM_ARCH("armv8-r", ARMV8R, "8-R", "v8r", ARMBuildAttrs::CPUArch::v8_R, FK_NEON_FP_ARMV8, (ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | diff --git a/lib/Support/ARMTargetParser.cpp b/lib/Support/ARMTargetParser.cpp index ce86fe5c119..eb425cbb1d2 100644 --- a/lib/Support/ARMTargetParser.cpp +++ b/lib/Support/ARMTargetParser.cpp @@ -76,6 +76,7 @@ unsigned ARM::parseArchVersion(StringRef Arch) { case ArchKind::ARMV8_4A: case ArchKind::ARMV8_5A: case ArchKind::ARMV8_6A: + case ArchKind::ARMV8_7A: case ArchKind::ARMV8R: case ArchKind::ARMV8MBaseline: case ArchKind::ARMV8MMainline: @@ -111,6 +112,7 @@ ARM::ProfileKind ARM::parseArchProfile(StringRef Arch) { case ArchKind::ARMV8_4A: case ArchKind::ARMV8_5A: case ArchKind::ARMV8_6A: + case ArchKind::ARMV8_7A: return ProfileKind::A; case ArchKind::ARMV2: case ArchKind::ARMV2A: diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index afc93c37141..fb1e84f44f6 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -636,6 +636,8 @@ static Triple::SubArchType parseSubArch(StringRef SubArchName) { return Triple::ARMSubArch_v8_5a; case ARM::ArchKind::ARMV8_6A: return Triple::ARMSubArch_v8_6a; + case ARM::ArchKind::ARMV8_7A: + return Triple::ARMSubArch_v8_7a; case ARM::ArchKind::ARMV8R: return Triple::ARMSubArch_v8r; case ARM::ArchKind::ARMV8MBaseline: diff --git a/lib/Target/ARM/ARM.td b/lib/Target/ARM/ARM.td index 3080152be55..3fa65289744 100644 --- a/lib/Target/ARM/ARM.td +++ b/lib/Target/ARM/ARM.td @@ -535,6 +535,10 @@ def HasV8_6aOps : SubtargetFeature<"v8.6a", "HasV8_6aOps", "true", [HasV8_5aOps, FeatureBF16, FeatureMatMulInt8]>; +def HasV8_7aOps : SubtargetFeature<"v8.7a", "HasV8_7aOps", "true", + "Support ARM v8.7a instructions", + [HasV8_6aOps]>; + def HasV8_1MMainlineOps : SubtargetFeature< "v8.1m.main", "HasV8_1MMainlineOps", "true", "Support ARM v8-1M Mainline instructions", @@ -831,6 +835,19 @@ def ARMv86a : Architecture<"armv8.6-a", "ARMv86a", [HasV8_6aOps, FeatureCRC, FeatureRAS, FeatureDotProd]>; +def ARMv87a : Architecture<"armv8.7-a", "ARMv86a", [HasV8_7aOps, + FeatureAClass, + FeatureDB, + FeatureFPARMv8, + FeatureNEON, + FeatureDSP, + FeatureTrustZone, + FeatureMP, + FeatureVirtualization, + FeatureCrypto, + FeatureCRC, + FeatureRAS, + FeatureDotProd]>; def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops, FeatureRClass, diff --git a/lib/Target/ARM/ARMPredicates.td b/lib/Target/ARM/ARMPredicates.td index 1ae71be9f76..240cdb08acd 100644 --- a/lib/Target/ARM/ARMPredicates.td +++ b/lib/Target/ARM/ARMPredicates.td @@ -77,6 +77,8 @@ def HasV8_5a : Predicate<"Subtarget->hasV8_5aOps()">, AssemblerPredicate<(all_of HasV8_5aOps), "armv8.5a">; def HasV8_6a : Predicate<"Subtarget->hasV8_6aOps()">, AssemblerPredicate<(all_of HasV8_6aOps), "armv8.6a">; +def HasV8_7a : Predicate<"Subtarget->hasV8_7aOps()">, + AssemblerPredicate<(all_of HasV8_7aOps), "armv8.7a">; def NoVFP : Predicate<"!Subtarget->hasVFP2Base()">; def HasVFP2 : Predicate<"Subtarget->hasVFP2Base()">, AssemblerPredicate<(all_of FeatureVFP2_SP), "VFP2">; diff --git a/unittests/Support/TargetParserTest.cpp b/unittests/Support/TargetParserTest.cpp index 282a5efa1a8..8407397e4ed 100644 --- a/unittests/Support/TargetParserTest.cpp +++ b/unittests/Support/TargetParserTest.cpp @@ -26,9 +26,9 @@ const char *ARMArch[] = { "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-r", "armv8r", - "armv8-m.base", "armv8m.base", "armv8-m.main", "armv8m.main", "iwmmxt", - "iwmmxt2", "xscale", "armv8.1-m.main", + "armv8.5a", "armv8.6-a", "armv8.6a", "armv8.7-a", "armv8.7a", + "armv8-r", "armv8r", "armv8-m.base","armv8m.base", "armv8-m.main", + "armv8m.main", "iwmmxt", "iwmmxt2", "xscale", "armv8.1-m.main", }; bool testARMCPU(StringRef CPUName, StringRef ExpectedArch, @@ -443,6 +443,9 @@ TEST(TargetParserTest, testARMArch) { 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-r", "cortex-r52", "v8r", ARMBuildAttrs::CPUArch::v8_R)); @@ -710,7 +713,8 @@ TEST(TargetParserTest, ARMparseArchEndianAndISA) { "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-r", "v8m.base", "v8m.main", "v8.1m.main" + "v8.4a", "v8.5-a","v8.5a", "v8.6-a", "v8.6a", "v8.7-a", "v8.7a", "v8-r", + "v8m.base", "v8m.main", "v8.1m.main" }; for (unsigned i = 0; i < array_lengthof(Arch); i++) { @@ -776,6 +780,7 @@ TEST(TargetParserTest, ARMparseArchProfile) { case ARM::ArchKind::ARMV8_4A: case ARM::ArchKind::ARMV8_5A: case ARM::ArchKind::ARMV8_6A: + case ARM::ArchKind::ARMV8_7A: EXPECT_EQ(ARM::ProfileKind::A, ARM::parseArchProfile(ARMArch[i])); break; default: