llvm.org GIT mirror llvm / af93d17
[ARM][AArch64] ARMv8.3-A enablement The beta ARMv8.3 ISA specifications have been released for AArch64 and AArch32, these can be found at: https://developer.arm.com/products/architecture/a-profile/exploration-tools An introduction to this architecture update can be found at: https://community.arm.com/processors/b/blog/posts/armv8-a-architecture-2016-additions This patch is the first in a series which will add ARM v8.3-A support in LLVM and Clang. It adds the necessary changes that create targets for both the ARM and AArch64 backends. Differential Revision: https://reviews.llvm.org/D36514 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310561 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Parker 2 years ago
11 changed file(s) with 44 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9999 enum SubArchType {
100100 NoSubArch,
101101
102 ARMSubArch_v8_3a,
102103 ARMSubArch_v8_2a,
103104 ARMSubArch_v8_1a,
104105 ARMSubArch_v8,
2929 (AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
3030 AArch64::AEK_SIMD | AArch64::AEK_RAS | AArch64::AEK_LSE |
3131 AArch64::AEK_DOTPROD))
32 AARCH64_ARCH("armv8.3-a", ARMV8_3A, "8.3-A", "v8.3a",
33 ARMBuildAttrs::CPUArch::v8_A, FK_CRYPTO_NEON_FP_ARMV8,
34 (AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
35 AArch64::AEK_SIMD | AArch64::AEK_RAS | AArch64::AEK_LSE))
3236 #undef AARCH64_ARCH
3337
3438 #ifndef AARCH64_ARCH_EXT_NAME
9393 (ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
9494 ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC))
9595 ARM_ARCH("armv8.2-a", ARMV8_2A, "8.2-A", "v8.2a",
96 ARMBuildAttrs::CPUArch::v8_A, FK_CRYPTO_NEON_FP_ARMV8,
97 (ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
98 ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS))
99 ARM_ARCH("armv8.3-a", ARMV8_3A, "8.3-A", "v8.3a",
96100 ARMBuildAttrs::CPUArch::v8_A, FK_CRYPTO_NEON_FP_ARMV8,
97101 (ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM |
98102 ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_CRC | ARM::AEK_RAS))
462462 Features.push_back("+v8.1a");
463463 if (AK == AArch64::ArchKind::ARMV8_2A)
464464 Features.push_back("+v8.2a");
465 if (AK == AArch64::ArchKind::ARMV8_3A)
466 Features.push_back("+v8.3a");
465467
466468 return AK != AArch64::ArchKind::INVALID;
467469 }
566568 .Cases("v8", "v8a", "aarch64", "arm64", "v8-a")
567569 .Case("v8.1a", "v8.1-a")
568570 .Case("v8.2a", "v8.2-a")
571 .Case("v8.3a", "v8.3-a")
569572 .Case("v8r", "v8-r")
570573 .Case("v8m.base", "v8-m.base")
571574 .Case("v8m.main", "v8-m.main")
718721 case ARM::ArchKind::ARMV8A:
719722 case ARM::ArchKind::ARMV8_1A:
720723 case ARM::ArchKind::ARMV8_2A:
724 case ARM::ArchKind::ARMV8_3A:
721725 return ARM::ProfileKind::A;
722726 LLVM_FALLTHROUGH;
723727 case ARM::ArchKind::ARMV2:
780784 case ARM::ArchKind::ARMV8A:
781785 case ARM::ArchKind::ARMV8_1A:
782786 case ARM::ArchKind::ARMV8_2A:
787 case ARM::ArchKind::ARMV8_3A:
783788 case ARM::ArchKind::ARMV8R:
784789 case ARM::ArchKind::ARMV8MBaseline:
785790 case ARM::ArchKind::ARMV8MMainline:
580580 return Triple::ARMSubArch_v8_1a;
581581 case ARM::ArchKind::ARMV8_2A:
582582 return Triple::ARMSubArch_v8_2a;
583 case ARM::ArchKind::ARMV8_3A:
584 return Triple::ARMSubArch_v8_3a;
583585 case ARM::ArchKind::ARMV8R:
584586 return Triple::ARMSubArch_v8r;
585587 case ARM::ArchKind::ARMV8MBaseline:
144144
145145 def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
146146 "Support ARM v8.2a instructions", [HasV8_1aOps, FeatureRAS]>;
147
148 def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
149 "Support ARM v8.3a instructions", [HasV8_2aOps]>;
147150
148151 //===----------------------------------------------------------------------===//
149152 // Register File Description
1717 AssemblerPredicate<"HasV8_1aOps", "armv8.1a">;
1818 def HasV8_2a : Predicate<"Subtarget->hasV8_2aOps()">,
1919 AssemblerPredicate<"HasV8_2aOps", "armv8.2a">;
20 def HasV8_3a : Predicate<"Subtarget->hasV8_3aOps()">,
21 AssemblerPredicate<"HasV8_3aOps", "armv8.3a">;
2022 def HasFPARMv8 : Predicate<"Subtarget->hasFPARMv8()">,
2123 AssemblerPredicate<"FeatureFPARMv8", "fp-armv8">;
2224 def HasNEON : Predicate<"Subtarget->hasNEON()">,
5757
5858 bool HasV8_1aOps = false;
5959 bool HasV8_2aOps = false;
60 bool HasV8_3aOps = false;
6061
6162 bool HasFPARMv8 = false;
6263 bool HasNEON = false;
184185
185186 bool hasV8_1aOps() const { return HasV8_1aOps; }
186187 bool hasV8_2aOps() const { return HasV8_2aOps; }
188 bool hasV8_3aOps() const { return HasV8_3aOps; }
187189
188190 bool hasZeroCycleRegMove() const { return HasZeroCycleRegMove; }
189191
400400 "Support ARM v8.2a instructions",
401401 [HasV8_1aOps]>;
402402
403 def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
404 "Support ARM v8.3a instructions",
405 [HasV8_2aOps]>;
403406
404407 //===----------------------------------------------------------------------===//
405408 // ARM Processor subtarget features.
586589 FeatureCRC,
587590 FeatureRAS]>;
588591
592 def ARMv83a : Architecture<"armv8.3-a", "ARMv83a", [HasV8_3aOps,
593 FeatureAClass,
594 FeatureDB,
595 FeatureFPARMv8,
596 FeatureNEON,
597 FeatureDSP,
598 FeatureTrustZone,
599 FeatureMP,
600 FeatureVirtualization,
601 FeatureCrypto,
602 FeatureCRC,
603 FeatureRAS]>;
604
589605 def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops,
590606 FeatureRClass,
591607 FeatureDB,
240240 AssemblerPredicate<"HasV8_1aOps", "armv8.1a">;
241241 def HasV8_2a : Predicate<"Subtarget->hasV8_2aOps()">,
242242 AssemblerPredicate<"HasV8_2aOps", "armv8.2a">;
243 def HasV8_3a : Predicate<"Subtarget->hasV8_3aOps()">,
244 AssemblerPredicate<"HasV8_3aOps", "armv8.3a">;
243245 def NoVFP : Predicate<"!Subtarget->hasVFP2()">;
244246 def HasVFP2 : Predicate<"Subtarget->hasVFP2()">,
245247 AssemblerPredicate<"FeatureVFP2", "VFP2">;
9797 ARMv7ve,
9898 ARMv81a,
9999 ARMv82a,
100 ARMv83a,
100101 ARMv8a,
101102 ARMv8mBaseline,
102103 ARMv8mMainline,
142143 bool HasV8Ops = false;
143144 bool HasV8_1aOps = false;
144145 bool HasV8_2aOps = false;
146 bool HasV8_3aOps = false;
145147 bool HasV8MBaselineOps = false;
146148 bool HasV8MMainlineOps = false;
147149
491493 bool hasV8Ops() const { return HasV8Ops; }
492494 bool hasV8_1aOps() const { return HasV8_1aOps; }
493495 bool hasV8_2aOps() const { return HasV8_2aOps; }
496 bool hasV8_3aOps() const { return HasV8_3aOps; }
494497 bool hasV8MBaselineOps() const { return HasV8MBaselineOps; }
495498 bool hasV8MMainlineOps() const { return HasV8MMainlineOps; }
496499