1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[ARM] Adding v8.7-A command-line support for the ARM target

This extends the command-line support for the 'armv8.7-a' architecture
name to the ARM target.

Based on a patch written by Momchil Velikov.

Reviewed By: ostannard

Differential Revision: https://reviews.llvm.org/D93231
This commit is contained in:
Lucas Prates 2020-12-09 16:13:36 +00:00
parent 4d5426f96a
commit c7222c149c
7 changed files with 39 additions and 4 deletions

View File

@ -104,6 +104,7 @@ public:
enum SubArchType { enum SubArchType {
NoSubArch, NoSubArch,
ARMSubArch_v8_7a,
ARMSubArch_v8_6a, ARMSubArch_v8_6a,
ARMSubArch_v8_5a, ARMSubArch_v8_5a,
ARMSubArch_v8_4a, ARMSubArch_v8_4a,

View File

@ -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_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS |
ARM::AEK_DOTPROD | ARM::AEK_BF16 | ARM::AEK_SHA2 | ARM::AEK_AES | ARM::AEK_DOTPROD | ARM::AEK_BF16 | ARM::AEK_SHA2 | ARM::AEK_AES |
ARM::AEK_I8MM)) 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, ARM_ARCH("armv8-r", ARMV8R, "8-R", "v8r", ARMBuildAttrs::CPUArch::v8_R,
FK_NEON_FP_ARMV8, FK_NEON_FP_ARMV8,
(ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | (ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |

View File

@ -76,6 +76,7 @@ unsigned ARM::parseArchVersion(StringRef Arch) {
case ArchKind::ARMV8_4A: case ArchKind::ARMV8_4A:
case ArchKind::ARMV8_5A: case ArchKind::ARMV8_5A:
case ArchKind::ARMV8_6A: case ArchKind::ARMV8_6A:
case ArchKind::ARMV8_7A:
case ArchKind::ARMV8R: case ArchKind::ARMV8R:
case ArchKind::ARMV8MBaseline: case ArchKind::ARMV8MBaseline:
case ArchKind::ARMV8MMainline: case ArchKind::ARMV8MMainline:
@ -111,6 +112,7 @@ ARM::ProfileKind ARM::parseArchProfile(StringRef Arch) {
case ArchKind::ARMV8_4A: case ArchKind::ARMV8_4A:
case ArchKind::ARMV8_5A: case ArchKind::ARMV8_5A:
case ArchKind::ARMV8_6A: case ArchKind::ARMV8_6A:
case ArchKind::ARMV8_7A:
return ProfileKind::A; return ProfileKind::A;
case ArchKind::ARMV2: case ArchKind::ARMV2:
case ArchKind::ARMV2A: case ArchKind::ARMV2A:

View File

@ -636,6 +636,8 @@ static Triple::SubArchType parseSubArch(StringRef SubArchName) {
return Triple::ARMSubArch_v8_5a; return Triple::ARMSubArch_v8_5a;
case ARM::ArchKind::ARMV8_6A: case ARM::ArchKind::ARMV8_6A:
return Triple::ARMSubArch_v8_6a; return Triple::ARMSubArch_v8_6a;
case ARM::ArchKind::ARMV8_7A:
return Triple::ARMSubArch_v8_7a;
case ARM::ArchKind::ARMV8R: case ARM::ArchKind::ARMV8R:
return Triple::ARMSubArch_v8r; return Triple::ARMSubArch_v8r;
case ARM::ArchKind::ARMV8MBaseline: case ARM::ArchKind::ARMV8MBaseline:

View File

@ -535,6 +535,10 @@ def HasV8_6aOps : SubtargetFeature<"v8.6a", "HasV8_6aOps", "true",
[HasV8_5aOps, FeatureBF16, [HasV8_5aOps, FeatureBF16,
FeatureMatMulInt8]>; FeatureMatMulInt8]>;
def HasV8_7aOps : SubtargetFeature<"v8.7a", "HasV8_7aOps", "true",
"Support ARM v8.7a instructions",
[HasV8_6aOps]>;
def HasV8_1MMainlineOps : SubtargetFeature< def HasV8_1MMainlineOps : SubtargetFeature<
"v8.1m.main", "HasV8_1MMainlineOps", "true", "v8.1m.main", "HasV8_1MMainlineOps", "true",
"Support ARM v8-1M Mainline instructions", "Support ARM v8-1M Mainline instructions",
@ -831,6 +835,19 @@ def ARMv86a : Architecture<"armv8.6-a", "ARMv86a", [HasV8_6aOps,
FeatureCRC, FeatureCRC,
FeatureRAS, FeatureRAS,
FeatureDotProd]>; 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, def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops,
FeatureRClass, FeatureRClass,

View File

@ -77,6 +77,8 @@ def HasV8_5a : Predicate<"Subtarget->hasV8_5aOps()">,
AssemblerPredicate<(all_of HasV8_5aOps), "armv8.5a">; AssemblerPredicate<(all_of HasV8_5aOps), "armv8.5a">;
def HasV8_6a : Predicate<"Subtarget->hasV8_6aOps()">, def HasV8_6a : Predicate<"Subtarget->hasV8_6aOps()">,
AssemblerPredicate<(all_of HasV8_6aOps), "armv8.6a">; 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 NoVFP : Predicate<"!Subtarget->hasVFP2Base()">;
def HasVFP2 : Predicate<"Subtarget->hasVFP2Base()">, def HasVFP2 : Predicate<"Subtarget->hasVFP2Base()">,
AssemblerPredicate<(all_of FeatureVFP2_SP), "VFP2">; AssemblerPredicate<(all_of FeatureVFP2_SP), "VFP2">;

View File

@ -26,9 +26,9 @@ const char *ARMArch[] = {
"armv7e-m", "armv7em", "armv8-a", "armv8", "armv8a", "armv7e-m", "armv7em", "armv8-a", "armv8", "armv8a",
"armv8l", "armv8.1-a", "armv8.1a", "armv8.2-a", "armv8.2a", "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.3-a", "armv8.3a", "armv8.4-a", "armv8.4a", "armv8.5-a",
"armv8.5a", "armv8.6-a", "armv8.6a", "armv8-r", "armv8r", "armv8.5a", "armv8.6-a", "armv8.6a", "armv8.7-a", "armv8.7a",
"armv8-m.base", "armv8m.base", "armv8-m.main", "armv8m.main", "iwmmxt", "armv8-r", "armv8r", "armv8-m.base","armv8m.base", "armv8-m.main",
"iwmmxt2", "xscale", "armv8.1-m.main", "armv8m.main", "iwmmxt", "iwmmxt2", "xscale", "armv8.1-m.main",
}; };
bool testARMCPU(StringRef CPUName, StringRef ExpectedArch, bool testARMCPU(StringRef CPUName, StringRef ExpectedArch,
@ -443,6 +443,9 @@ TEST(TargetParserTest, testARMArch) {
EXPECT_TRUE( EXPECT_TRUE(
testARMArch("armv8.6-a", "generic", "v8.6a", testARMArch("armv8.6-a", "generic", "v8.6a",
ARMBuildAttrs::CPUArch::v8_A)); ARMBuildAttrs::CPUArch::v8_A));
EXPECT_TRUE(
testARMArch("armv8.7-a", "generic", "v8.7a",
ARMBuildAttrs::CPUArch::v8_A));
EXPECT_TRUE( EXPECT_TRUE(
testARMArch("armv8-r", "cortex-r52", "v8r", testARMArch("armv8-r", "cortex-r52", "v8r",
ARMBuildAttrs::CPUArch::v8_R)); ARMBuildAttrs::CPUArch::v8_R));
@ -710,7 +713,8 @@ TEST(TargetParserTest, ARMparseArchEndianAndISA) {
"v7", "v7a", "v7ve", "v7hl", "v7l", "v7-r", "v7r", "v7-m", "v7", "v7a", "v7ve", "v7hl", "v7l", "v7-r", "v7r", "v7-m",
"v7m", "v7k", "v7s", "v7e-m", "v7em", "v8-a", "v8", "v8a", "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", "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++) { 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_4A:
case ARM::ArchKind::ARMV8_5A: case ARM::ArchKind::ARMV8_5A:
case ARM::ArchKind::ARMV8_6A: case ARM::ArchKind::ARMV8_6A:
case ARM::ArchKind::ARMV8_7A:
EXPECT_EQ(ARM::ProfileKind::A, ARM::parseArchProfile(ARMArch[i])); EXPECT_EQ(ARM::ProfileKind::A, ARM::parseArchProfile(ARMArch[i]));
break; break;
default: default: