xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 8bcb0991864975618c09697b1aca10683346d9f0)
10b57cec5SDimitry Andric//=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric//
90b57cec5SDimitry Andric//
100b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
110b57cec5SDimitry Andric
120b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
130b57cec5SDimitry Andric// Target-independent interfaces which we are implementing.
140b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
150b57cec5SDimitry Andric
160b57cec5SDimitry Andricinclude "llvm/Target/Target.td"
170b57cec5SDimitry Andric
180b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
190b57cec5SDimitry Andric// AArch64 Subtarget features.
200b57cec5SDimitry Andric//
210b57cec5SDimitry Andric
220b57cec5SDimitry Andricdef FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
230b57cec5SDimitry Andric                                       "Enable ARMv8 FP">;
240b57cec5SDimitry Andric
250b57cec5SDimitry Andricdef FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
260b57cec5SDimitry Andric  "Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
270b57cec5SDimitry Andric
280b57cec5SDimitry Andricdef FeatureSM4 : SubtargetFeature<
290b57cec5SDimitry Andric    "sm4", "HasSM4", "true",
300b57cec5SDimitry Andric    "Enable SM3 and SM4 support", [FeatureNEON]>;
310b57cec5SDimitry Andric
320b57cec5SDimitry Andricdef FeatureSHA2 : SubtargetFeature<
330b57cec5SDimitry Andric    "sha2", "HasSHA2", "true",
340b57cec5SDimitry Andric    "Enable SHA1 and SHA256 support", [FeatureNEON]>;
350b57cec5SDimitry Andric
360b57cec5SDimitry Andricdef FeatureSHA3 : SubtargetFeature<
370b57cec5SDimitry Andric    "sha3", "HasSHA3", "true",
380b57cec5SDimitry Andric    "Enable SHA512 and SHA3 support", [FeatureNEON, FeatureSHA2]>;
390b57cec5SDimitry Andric
400b57cec5SDimitry Andricdef FeatureAES : SubtargetFeature<
410b57cec5SDimitry Andric    "aes", "HasAES", "true",
420b57cec5SDimitry Andric    "Enable AES support", [FeatureNEON]>;
430b57cec5SDimitry Andric
440b57cec5SDimitry Andric// Crypto has been split up and any combination is now valid (see the
450b57cec5SDimitry Andric// crypto defintions above). Also, crypto is now context sensitive:
460b57cec5SDimitry Andric// it has a different meaning for e.g. Armv8.4 than it has for Armv8.2.
470b57cec5SDimitry Andric// Therefore, we rely on Clang, the user interacing tool, to pass on the
480b57cec5SDimitry Andric// appropriate crypto options. But here in the backend, crypto has very little
490b57cec5SDimitry Andric// meaning anymore. We kept the Crypto defintion here for backward
500b57cec5SDimitry Andric// compatibility, and now imply features SHA2 and AES, which was the
510b57cec5SDimitry Andric// "traditional" meaning of Crypto.
520b57cec5SDimitry Andricdef FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
530b57cec5SDimitry Andric  "Enable cryptographic instructions", [FeatureNEON, FeatureSHA2, FeatureAES]>;
540b57cec5SDimitry Andric
550b57cec5SDimitry Andricdef FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
560b57cec5SDimitry Andric  "Enable ARMv8 CRC-32 checksum instructions">;
570b57cec5SDimitry Andric
580b57cec5SDimitry Andricdef FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
590b57cec5SDimitry Andric  "Enable ARMv8 Reliability, Availability and Serviceability Extensions">;
600b57cec5SDimitry Andric
610b57cec5SDimitry Andricdef FeatureLSE : SubtargetFeature<"lse", "HasLSE", "true",
620b57cec5SDimitry Andric  "Enable ARMv8.1 Large System Extension (LSE) atomic instructions">;
630b57cec5SDimitry Andric
640b57cec5SDimitry Andricdef FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
650b57cec5SDimitry Andric  "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions">;
660b57cec5SDimitry Andric
670b57cec5SDimitry Andricdef FeaturePAN : SubtargetFeature<
680b57cec5SDimitry Andric    "pan", "HasPAN", "true",
690b57cec5SDimitry Andric    "Enables ARM v8.1 Privileged Access-Never extension">;
700b57cec5SDimitry Andric
710b57cec5SDimitry Andricdef FeatureLOR : SubtargetFeature<
720b57cec5SDimitry Andric    "lor", "HasLOR", "true",
730b57cec5SDimitry Andric    "Enables ARM v8.1 Limited Ordering Regions extension">;
740b57cec5SDimitry Andric
750b57cec5SDimitry Andricdef FeatureVH : SubtargetFeature<
760b57cec5SDimitry Andric    "vh", "HasVH", "true",
770b57cec5SDimitry Andric    "Enables ARM v8.1 Virtual Host extension">;
780b57cec5SDimitry Andric
790b57cec5SDimitry Andricdef FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
800b57cec5SDimitry Andric  "Enable ARMv8 PMUv3 Performance Monitors extension">;
810b57cec5SDimitry Andric
820b57cec5SDimitry Andricdef FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
830b57cec5SDimitry Andric  "Full FP16", [FeatureFPARMv8]>;
840b57cec5SDimitry Andric
850b57cec5SDimitry Andricdef FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
860b57cec5SDimitry Andric  "Enable FP16 FML instructions", [FeatureFullFP16]>;
870b57cec5SDimitry Andric
880b57cec5SDimitry Andricdef FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
890b57cec5SDimitry Andric  "Enable Statistical Profiling extension">;
900b57cec5SDimitry Andric
910b57cec5SDimitry Andricdef FeaturePAN_RWV : SubtargetFeature<
920b57cec5SDimitry Andric    "pan-rwv", "HasPAN_RWV", "true",
930b57cec5SDimitry Andric    "Enable v8.2 PAN s1e1R and s1e1W Variants",
940b57cec5SDimitry Andric    [FeaturePAN]>;
950b57cec5SDimitry Andric
960b57cec5SDimitry Andric// UAO PState
970b57cec5SDimitry Andricdef FeaturePsUAO : SubtargetFeature< "uaops", "HasPsUAO", "true",
980b57cec5SDimitry Andric    "Enable v8.2 UAO PState">;
990b57cec5SDimitry Andric
1000b57cec5SDimitry Andricdef FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
1010b57cec5SDimitry Andric    "true", "Enable v8.2 data Cache Clean to Point of Persistence" >;
1020b57cec5SDimitry Andric
1030b57cec5SDimitry Andricdef FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
1040b57cec5SDimitry Andric  "Enable Scalable Vector Extension (SVE) instructions">;
1050b57cec5SDimitry Andric
1060b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
1070b57cec5SDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions", [FeatureSVE]>;
1080b57cec5SDimitry Andric
1090b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
1100b57cec5SDimitry Andric  "Enable AES SVE2 instructions", [FeatureSVE2, FeatureAES]>;
1110b57cec5SDimitry Andric
1120b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
1130b57cec5SDimitry Andric  "Enable SM4 SVE2 instructions", [FeatureSVE2, FeatureSM4]>;
1140b57cec5SDimitry Andric
1150b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
1160b57cec5SDimitry Andric  "Enable SHA3 SVE2 instructions", [FeatureSVE2, FeatureSHA3]>;
1170b57cec5SDimitry Andric
1180b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
1190b57cec5SDimitry Andric  "Enable bit permutation SVE2 instructions", [FeatureSVE2]>;
1200b57cec5SDimitry Andric
1210b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
1220b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
123*8bcb0991SDimitry Andric
1240b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
1250b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
1260b57cec5SDimitry Andric
1270b57cec5SDimitry Andricdef FeatureZCZeroingFP : SubtargetFeature<"zcz-fp", "HasZeroCycleZeroingFP", "true",
1280b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for FP registers">;
1290b57cec5SDimitry Andric
1300b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
1310b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
1320b57cec5SDimitry Andric                                        [FeatureZCZeroingGP, FeatureZCZeroingFP]>;
1330b57cec5SDimitry Andric
1340b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
1350b57cec5SDimitry Andric/// CPUs.
1360b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
1370b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
1380b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
1390b57cec5SDimitry Andric
1400b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
1410b57cec5SDimitry Andric                                          "StrictAlign", "true",
1420b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
1430b57cec5SDimitry Andric                                          "access">;
1440b57cec5SDimitry Andric
1450b57cec5SDimitry Andricforeach i = {1-7,9-15,18,20-28} in
1460b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
1470b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
1480b57cec5SDimitry Andric                                             "as a GPR">;
1490b57cec5SDimitry Andric
1500b57cec5SDimitry Andricforeach i = {8-15,18} in
1510b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
1520b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
1530b57cec5SDimitry Andric
1540b57cec5SDimitry Andricdef FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
1550b57cec5SDimitry Andric                                    "Use alias analysis during codegen">;
1560b57cec5SDimitry Andric
1570b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
1580b57cec5SDimitry Andric    "true",
1590b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
1600b57cec5SDimitry Andric
1610b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
1620b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
1630b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
1640b57cec5SDimitry Andric
1650b57cec5SDimitry Andricdef FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
1660b57cec5SDimitry Andric    "CustomAsCheapAsMove", "true",
1670b57cec5SDimitry Andric    "Use custom handling of cheap instructions">;
1680b57cec5SDimitry Andric
1690b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
1700b57cec5SDimitry Andric    "ExynosAsCheapAsMove", "true",
1710b57cec5SDimitry Andric    "Use Exynos specific handling of cheap instructions",
1720b57cec5SDimitry Andric    [FeatureCustomCheapAsMoveHandling]>;
1730b57cec5SDimitry Andric
1740b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
1750b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
1760b57cec5SDimitry Andric
1770b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
1780b57cec5SDimitry Andric    "Misaligned128StoreIsSlow", "true", "Misaligned 128 bit stores are slow">;
1790b57cec5SDimitry Andric
1800b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
1810b57cec5SDimitry Andric    "Paired128IsSlow", "true", "Paired 128 bit loads and stores are slow">;
1820b57cec5SDimitry Andric
1830b57cec5SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "STRQroIsSlow",
1840b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
1850b57cec5SDimitry Andric
1860b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
1870b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
1880b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
1890b57cec5SDimitry Andric
1900b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
1910b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
1920b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
1930b57cec5SDimitry Andric
1940b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
1950b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
1960b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
1970b57cec5SDimitry Andric
1980b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
1990b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
2000b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
2010b57cec5SDimitry Andric
2020b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
2030b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
2040b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
2050b57cec5SDimitry Andric
2060b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
2070b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
2080b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
2110b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
2120b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
2130b57cec5SDimitry Andric
2140b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
2150b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
2160b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
2170b57cec5SDimitry Andric
2180b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
2190b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
2200b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
2210b57cec5SDimitry Andric
2220b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
2230b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
2240b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
2250b57cec5SDimitry Andric
2260b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
2270b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
2280b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
2290b57cec5SDimitry Andric
2300b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
2310b57cec5SDimitry Andric                                   "Enable support for RCPC extension">;
2320b57cec5SDimitry Andric
2330b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
2340b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
2350b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
2360b57cec5SDimitry Andric
2370b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
2380b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
2390b57cec5SDimitry Andric    "Enable dot product support">;
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andricdef FeaturePA : SubtargetFeature<
2420b57cec5SDimitry Andric    "pa", "HasPA", "true",
2430b57cec5SDimitry Andric    "Enable v8.3-A Pointer Authentication enchancement">;
2440b57cec5SDimitry Andric
2450b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
2460b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
2470b57cec5SDimitry Andric    "Enable v8.3-A JavaScript FP conversion enchancement",
2480b57cec5SDimitry Andric    [FeatureFPARMv8]>;
2490b57cec5SDimitry Andric
2500b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
2510b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
2520b57cec5SDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets">;
2530b57cec5SDimitry Andric
2540b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
2550b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
2560b57cec5SDimitry Andric    "Enable v8.3-A Floating-point complex number support",
2570b57cec5SDimitry Andric    [FeatureNEON]>;
2580b57cec5SDimitry Andric
2590b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
2600b57cec5SDimitry Andric    "nv", "HasNV", "true",
2610b57cec5SDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement">;
2620b57cec5SDimitry Andric
2630b57cec5SDimitry Andricdef FeatureRASv8_4 : SubtargetFeature<
2640b57cec5SDimitry Andric    "rasv8_4", "HasRASv8_4", "true",
2650b57cec5SDimitry Andric    "Enable v8.4-A Reliability, Availability and Serviceability extension",
2660b57cec5SDimitry Andric    [FeatureRAS]>;
2670b57cec5SDimitry Andric
2680b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
2690b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
2700b57cec5SDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension">;
2710b57cec5SDimitry Andric
2720b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
2730b57cec5SDimitry Andric    "dit", "HasDIT", "true",
2740b57cec5SDimitry Andric    "Enable v8.4-A Data Independent Timing instructions">;
2750b57cec5SDimitry Andric
2760b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
2770b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
2780b57cec5SDimitry Andric    "Enable v8.4-A Trace extension">;
2790b57cec5SDimitry Andric
2800b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
2810b57cec5SDimitry Andric    "am", "HasAM", "true",
2820b57cec5SDimitry Andric    "Enable v8.4-A Activity Monitors extension">;
2830b57cec5SDimitry Andric
2840b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
2850b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
2860b57cec5SDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension">;
2870b57cec5SDimitry Andric
288*8bcb0991SDimitry Andricdef FeaturePMU : SubtargetFeature<
289*8bcb0991SDimitry Andric    "pmu", "HasPMU", "true",
290*8bcb0991SDimitry Andric    "Enable v8.4-A PMU extension">;
291*8bcb0991SDimitry Andric
2920b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
2930b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
2940b57cec5SDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions">;
2950b57cec5SDimitry Andric
2960b57cec5SDimitry Andricdef FeatureFMI : SubtargetFeature<
2970b57cec5SDimitry Andric    "fmi", "HasFMI", "true",
2980b57cec5SDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions">;
2990b57cec5SDimitry Andric
3000b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3010b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
3020b57cec5SDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets",
3030b57cec5SDimitry Andric    [FeatureRCPC]>;
3040b57cec5SDimitry Andric
3050b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3060b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3070b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3080b57cec5SDimitry Andric                                        "to their negated or complemented "
3090b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3100b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3110b57cec5SDimitry Andric
3120b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
3130b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
3140b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
3150b57cec5SDimitry Andric
3160b57cec5SDimitry Andricdef FeatureAggressiveFMA :
3170b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
3180b57cec5SDimitry Andric                   "HasAggressiveFMA",
3190b57cec5SDimitry Andric                   "true",
3200b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
3210b57cec5SDimitry Andric
3220b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
3230b57cec5SDimitry Andric  "Enable alternative NZCV format for floating point comparisons">;
3240b57cec5SDimitry Andric
3250b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
3260b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
3270b57cec5SDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int" >;
3280b57cec5SDimitry Andric
3290b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
3300b57cec5SDimitry Andric  "true", "Enable architectural speculation restriction" >;
3310b57cec5SDimitry Andric
3320b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
3330b57cec5SDimitry Andric  "true", "Enable v8.5 Speculation Barrier" >;
3340b57cec5SDimitry Andric
3350b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
3360b57cec5SDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit" >;
3370b57cec5SDimitry Andric
3380b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
3390b57cec5SDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions" >;
3400b57cec5SDimitry Andric
3410b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
3420b57cec5SDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence" >;
3430b57cec5SDimitry Andric
3440b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
3450b57cec5SDimitry Andric    "true", "Enable Branch Target Identification" >;
3460b57cec5SDimitry Andric
3470b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
3480b57cec5SDimitry Andric    "true", "Enable Random Number generation instructions" >;
3490b57cec5SDimitry Andric
3500b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
3510b57cec5SDimitry Andric    "true", "Enable Memory Tagging Extension" >;
3520b57cec5SDimitry Andric
353*8bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
354*8bcb0991SDimitry Andric    "true", "Enable Trace Buffer Extension">;
355*8bcb0991SDimitry Andric
356*8bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
357*8bcb0991SDimitry Andric    "true", "Enable Embedded Trace Extension",
358*8bcb0991SDimitry Andric    [FeatureTRBE]>;
359*8bcb0991SDimitry Andric
360*8bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
361*8bcb0991SDimitry Andric    "true", "Enable Transactional Memory Extension" >;
362*8bcb0991SDimitry Andric
363*8bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
364*8bcb0991SDimitry Andric    "AllowTaggedGlobals",
365*8bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
366*8bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
367*8bcb0991SDimitry Andric
3680b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
3690b57cec5SDimitry Andric// Architectures.
3700b57cec5SDimitry Andric//
3710b57cec5SDimitry Andric
3720b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
3730b57cec5SDimitry Andric  "Support ARM v8.1a instructions", [FeatureCRC, FeatureLSE, FeatureRDM,
3740b57cec5SDimitry Andric  FeaturePAN, FeatureLOR, FeatureVH]>;
3750b57cec5SDimitry Andric
3760b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
3770b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
3780b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
3790b57cec5SDimitry Andric
3800b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
3810b57cec5SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePA,
3820b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
3830b57cec5SDimitry Andric
3840b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
3850b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
3860b57cec5SDimitry Andric  FeatureNV, FeatureRASv8_4, FeatureMPAM, FeatureDIT,
387*8bcb0991SDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeaturePMU, FeatureTLB_RMI,
3880b57cec5SDimitry Andric  FeatureFMI, FeatureRCPC_IMMO]>;
3890b57cec5SDimitry Andric
3900b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
3910b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
3920b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
3930b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
3940b57cec5SDimitry Andric   FeatureBranchTargetId]
3950b57cec5SDimitry Andric>;
3960b57cec5SDimitry Andric
3970b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
3980b57cec5SDimitry Andric// Register File Description
3990b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4000b57cec5SDimitry Andric
4010b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
4020b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
4030b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
4040b57cec5SDimitry Andric
4050b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4060b57cec5SDimitry Andric// Instruction Descriptions
4070b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4080b57cec5SDimitry Andric
4090b57cec5SDimitry Andricinclude "AArch64Schedule.td"
4100b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
4110b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
4120b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
413*8bcb0991SDimitry Andricinclude "AArch64Combine.td"
4140b57cec5SDimitry Andric
4150b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
4160b57cec5SDimitry Andric
4170b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4180b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
4190b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4200b57cec5SDimitry Andric
4210b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
4220b57cec5SDimitry Andric
4230b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4240b57cec5SDimitry Andric// Access to privileged registers
4250b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4260b57cec5SDimitry Andric
4270b57cec5SDimitry Andricforeach i = 1-3 in
4280b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
4290b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
4300b57cec5SDimitry Andric
4310b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4320b57cec5SDimitry Andric// AArch64 Processors supported.
4330b57cec5SDimitry Andric//
4340b57cec5SDimitry Andric
4350b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4360b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
4370b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4380b57cec5SDimitry Andric
4390b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
4400b57cec5SDimitry Andric
4410b57cec5SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
4420b57cec5SDimitry Andric  let F = [HasSVE, HasSVE2, HasSVE2AES, HasSVE2SM4, HasSVE2SHA3,
4430b57cec5SDimitry Andric           HasSVE2BitPerm];
4440b57cec5SDimitry Andric}
4450b57cec5SDimitry Andric
4460b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
4470b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
4480b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
4490b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
4500b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
4510b57cec5SDimitry Andricinclude "AArch64SchedExynosM1.td"
4520b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
4530b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
4540b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
4550b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
4560b57cec5SDimitry Andric
4570b57cec5SDimitry Andricdef ProcA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
4580b57cec5SDimitry Andric                                   "Cortex-A35 ARM processors", [
4590b57cec5SDimitry Andric                                   FeatureCRC,
4600b57cec5SDimitry Andric                                   FeatureCrypto,
4610b57cec5SDimitry Andric                                   FeatureFPARMv8,
4620b57cec5SDimitry Andric                                   FeatureNEON,
4630b57cec5SDimitry Andric                                   FeaturePerfMon
4640b57cec5SDimitry Andric                                   ]>;
4650b57cec5SDimitry Andric
4660b57cec5SDimitry Andricdef ProcA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
4670b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
4680b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
4690b57cec5SDimitry Andric                                   FeatureCRC,
4700b57cec5SDimitry Andric                                   FeatureCrypto,
4710b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
4720b57cec5SDimitry Andric                                   FeatureFPARMv8,
4730b57cec5SDimitry Andric                                   FeatureFuseAES,
4740b57cec5SDimitry Andric                                   FeatureNEON,
4750b57cec5SDimitry Andric                                   FeaturePerfMon,
4760b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
4770b57cec5SDimitry Andric                                   FeatureUseAA
4780b57cec5SDimitry Andric                                   ]>;
4790b57cec5SDimitry Andric
4800b57cec5SDimitry Andricdef ProcA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
4810b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
4820b57cec5SDimitry Andric                                   HasV8_2aOps,
4830b57cec5SDimitry Andric                                   FeatureCrypto,
4840b57cec5SDimitry Andric                                   FeatureFPARMv8,
4850b57cec5SDimitry Andric                                   FeatureFuseAES,
4860b57cec5SDimitry Andric                                   FeatureNEON,
4870b57cec5SDimitry Andric                                   FeatureFullFP16,
4880b57cec5SDimitry Andric                                   FeatureDotProd,
4890b57cec5SDimitry Andric                                   FeatureRCPC,
4900b57cec5SDimitry Andric                                   FeaturePerfMon
4910b57cec5SDimitry Andric                                   ]>;
4920b57cec5SDimitry Andric
4930b57cec5SDimitry Andricdef ProcA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
4940b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
4950b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
4960b57cec5SDimitry Andric                                   FeatureCRC,
4970b57cec5SDimitry Andric                                   FeatureCrypto,
4980b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
4990b57cec5SDimitry Andric                                   FeatureFPARMv8,
5000b57cec5SDimitry Andric                                   FeatureFuseAES,
5010b57cec5SDimitry Andric                                   FeatureFuseLiterals,
5020b57cec5SDimitry Andric                                   FeatureNEON,
5030b57cec5SDimitry Andric                                   FeaturePerfMon,
5040b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
5050b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive
5060b57cec5SDimitry Andric                                   ]>;
5070b57cec5SDimitry Andric
508*8bcb0991SDimitry Andricdef ProcA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
509*8bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
510*8bcb0991SDimitry Andric                                   HasV8_2aOps,
511*8bcb0991SDimitry Andric                                   FeatureCrypto,
512*8bcb0991SDimitry Andric                                   FeatureDotProd,
513*8bcb0991SDimitry Andric                                   FeatureFPARMv8,
514*8bcb0991SDimitry Andric                                   FeatureFullFP16,
515*8bcb0991SDimitry Andric                                   FeatureNEON,
516*8bcb0991SDimitry Andric                                   FeatureRAS,
517*8bcb0991SDimitry Andric                                   FeatureRCPC,
518*8bcb0991SDimitry Andric                                   FeatureSSBS,
519*8bcb0991SDimitry Andric                                   ]>;
520*8bcb0991SDimitry Andric
5210b57cec5SDimitry Andricdef ProcA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
5220b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
5230b57cec5SDimitry Andric                                   FeatureCRC,
5240b57cec5SDimitry Andric                                   FeatureCrypto,
5250b57cec5SDimitry Andric                                   FeatureFPARMv8,
5260b57cec5SDimitry Andric                                   FeatureFuseAES,
5270b57cec5SDimitry Andric                                   FeatureNEON,
5280b57cec5SDimitry Andric                                   FeaturePerfMon
5290b57cec5SDimitry Andric                                   ]>;
5300b57cec5SDimitry Andric
5310b57cec5SDimitry Andricdef ProcA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
5320b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
5330b57cec5SDimitry Andric                                   FeatureCRC,
5340b57cec5SDimitry Andric                                   FeatureCrypto,
5350b57cec5SDimitry Andric                                   FeatureFPARMv8,
5360b57cec5SDimitry Andric                                   FeatureFuseAES,
5370b57cec5SDimitry Andric                                   FeatureNEON,
5380b57cec5SDimitry Andric                                   FeaturePerfMon
5390b57cec5SDimitry Andric                                   ]>;
5400b57cec5SDimitry Andric
5410b57cec5SDimitry Andricdef ProcA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
5420b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
5430b57cec5SDimitry Andric                                   HasV8_2aOps,
5440b57cec5SDimitry Andric                                   FeatureCrypto,
5450b57cec5SDimitry Andric                                   FeatureFPARMv8,
5460b57cec5SDimitry Andric                                   FeatureFuseAES,
5470b57cec5SDimitry Andric                                   FeatureNEON,
5480b57cec5SDimitry Andric                                   FeatureFullFP16,
5490b57cec5SDimitry Andric                                   FeatureDotProd,
5500b57cec5SDimitry Andric                                   FeatureRCPC,
5510b57cec5SDimitry Andric                                   FeaturePerfMon
5520b57cec5SDimitry Andric                                   ]>;
5530b57cec5SDimitry Andric
5540b57cec5SDimitry Andricdef ProcA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
5550b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
5560b57cec5SDimitry Andric                                    HasV8_2aOps,
5570b57cec5SDimitry Andric                                    FeatureFPARMv8,
5580b57cec5SDimitry Andric                                    FeatureNEON,
5590b57cec5SDimitry Andric                                    FeatureRCPC,
5600b57cec5SDimitry Andric                                    FeatureCrypto,
5610b57cec5SDimitry Andric                                    FeatureFullFP16,
5620b57cec5SDimitry Andric                                    FeatureDotProd,
5630b57cec5SDimitry Andric                                    FeatureSSBS
5640b57cec5SDimitry Andric                                    ]>;
5650b57cec5SDimitry Andric
5660b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
5670b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
5680b57cec5SDimitry Andricdef ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
5690b57cec5SDimitry Andric                                   "Cyclone", [
5700b57cec5SDimitry Andric                                   FeatureAlternateSExtLoadCVTF32Pattern,
5710b57cec5SDimitry Andric                                   FeatureArithmeticBccFusion,
5720b57cec5SDimitry Andric                                   FeatureArithmeticCbzFusion,
5730b57cec5SDimitry Andric                                   FeatureCrypto,
5740b57cec5SDimitry Andric                                   FeatureDisableLatencySchedHeuristic,
5750b57cec5SDimitry Andric                                   FeatureFPARMv8,
5760b57cec5SDimitry Andric                                   FeatureFuseAES,
5770b57cec5SDimitry Andric                                   FeatureFuseCryptoEOR,
5780b57cec5SDimitry Andric                                   FeatureNEON,
5790b57cec5SDimitry Andric                                   FeaturePerfMon,
5800b57cec5SDimitry Andric                                   FeatureZCRegMove,
5810b57cec5SDimitry Andric                                   FeatureZCZeroing,
5820b57cec5SDimitry Andric                                   FeatureZCZeroingFPWorkaround
5830b57cec5SDimitry Andric                                   ]>;
5840b57cec5SDimitry Andric
5850b57cec5SDimitry Andricdef ProcExynosM1 : SubtargetFeature<"exynosm1", "ARMProcFamily", "ExynosM1",
5860b57cec5SDimitry Andric                                    "Samsung Exynos-M1 processors",
5870b57cec5SDimitry Andric                                    [FeatureSlowPaired128,
5880b57cec5SDimitry Andric                                     FeatureCRC,
5890b57cec5SDimitry Andric                                     FeatureCrypto,
5900b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
5910b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
5920b57cec5SDimitry Andric                                     FeatureFuseAES,
5930b57cec5SDimitry Andric                                     FeaturePerfMon,
5940b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
5950b57cec5SDimitry Andric                                     FeatureSlowMisaligned128Store,
5960b57cec5SDimitry Andric                                     FeatureUseRSqrt,
5970b57cec5SDimitry Andric                                     FeatureZCZeroingFP]>;
5980b57cec5SDimitry Andric
5990b57cec5SDimitry Andricdef ProcExynosM2 : SubtargetFeature<"exynosm2", "ARMProcFamily", "ExynosM1",
6000b57cec5SDimitry Andric                                    "Samsung Exynos-M2 processors",
6010b57cec5SDimitry Andric                                    [FeatureSlowPaired128,
6020b57cec5SDimitry Andric                                     FeatureCRC,
6030b57cec5SDimitry Andric                                     FeatureCrypto,
6040b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
6050b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
6060b57cec5SDimitry Andric                                     FeatureFuseAES,
6070b57cec5SDimitry Andric                                     FeaturePerfMon,
6080b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
6090b57cec5SDimitry Andric                                     FeatureSlowMisaligned128Store,
6100b57cec5SDimitry Andric                                     FeatureZCZeroingFP]>;
6110b57cec5SDimitry Andric
6120b57cec5SDimitry Andricdef ProcExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
6130b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
6140b57cec5SDimitry Andric                                    [FeatureCRC,
6150b57cec5SDimitry Andric                                     FeatureCrypto,
6160b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
6170b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
6180b57cec5SDimitry Andric                                     FeatureFuseAddress,
6190b57cec5SDimitry Andric                                     FeatureFuseAES,
6200b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
6210b57cec5SDimitry Andric                                     FeatureFuseLiterals,
6220b57cec5SDimitry Andric                                     FeatureLSLFast,
6230b57cec5SDimitry Andric                                     FeaturePerfMon,
6240b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
6250b57cec5SDimitry Andric                                     FeaturePredictableSelectIsExpensive,
6260b57cec5SDimitry Andric                                     FeatureZCZeroingFP]>;
6270b57cec5SDimitry Andric
6280b57cec5SDimitry Andricdef ProcExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3",
6290b57cec5SDimitry Andric                                    "Samsung Exynos-M4 processors",
6300b57cec5SDimitry Andric                                    [HasV8_2aOps,
6310b57cec5SDimitry Andric                                     FeatureArithmeticBccFusion,
6320b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
6330b57cec5SDimitry Andric                                     FeatureCrypto,
6340b57cec5SDimitry Andric                                     FeatureDotProd,
6350b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
6360b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
6370b57cec5SDimitry Andric                                     FeatureFullFP16,
6380b57cec5SDimitry Andric                                     FeatureFuseAddress,
6390b57cec5SDimitry Andric                                     FeatureFuseAES,
6400b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
6410b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
6420b57cec5SDimitry Andric                                     FeatureFuseLiterals,
6430b57cec5SDimitry Andric                                     FeatureLSLFast,
6440b57cec5SDimitry Andric                                     FeaturePerfMon,
6450b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
6460b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
6470b57cec5SDimitry Andric
6480b57cec5SDimitry Andricdef ProcKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
6490b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
6500b57cec5SDimitry Andric                                   FeatureCRC,
6510b57cec5SDimitry Andric                                   FeatureCrypto,
6520b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
6530b57cec5SDimitry Andric                                   FeatureFPARMv8,
6540b57cec5SDimitry Andric                                   FeatureNEON,
6550b57cec5SDimitry Andric                                   FeaturePerfMon,
6560b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
6570b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
6580b57cec5SDimitry Andric                                   FeatureZCZeroing,
6590b57cec5SDimitry Andric                                   FeatureLSLFast
6600b57cec5SDimitry Andric                                   ]>;
6610b57cec5SDimitry Andric
6620b57cec5SDimitry Andricdef ProcFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
6630b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
6640b57cec5SDimitry Andric                                   FeatureCRC,
6650b57cec5SDimitry Andric                                   FeatureCrypto,
6660b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
6670b57cec5SDimitry Andric                                   FeatureFPARMv8,
6680b57cec5SDimitry Andric                                   FeatureNEON,
6690b57cec5SDimitry Andric                                   FeaturePerfMon,
6700b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
6710b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
6720b57cec5SDimitry Andric                                   FeatureRDM,
6730b57cec5SDimitry Andric                                   FeatureZCZeroing,
6740b57cec5SDimitry Andric                                   FeatureLSLFast,
6750b57cec5SDimitry Andric                                   FeatureSlowSTRQro
6760b57cec5SDimitry Andric                                   ]>;
6770b57cec5SDimitry Andric
678*8bcb0991SDimitry Andricdef ProcNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily",
679*8bcb0991SDimitry Andric                                      "NeoverseE1",
680*8bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
681*8bcb0991SDimitry Andric                                      HasV8_2aOps,
682*8bcb0991SDimitry Andric                                      FeatureCrypto,
683*8bcb0991SDimitry Andric                                      FeatureDotProd,
684*8bcb0991SDimitry Andric                                      FeatureFPARMv8,
685*8bcb0991SDimitry Andric                                      FeatureFullFP16,
686*8bcb0991SDimitry Andric                                      FeatureNEON,
687*8bcb0991SDimitry Andric                                      FeatureRCPC,
688*8bcb0991SDimitry Andric                                      FeatureSSBS,
689*8bcb0991SDimitry Andric                                      ]>;
690*8bcb0991SDimitry Andric
691*8bcb0991SDimitry Andricdef ProcNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily",
692*8bcb0991SDimitry Andric                                      "NeoverseN1",
693*8bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
694*8bcb0991SDimitry Andric                                      HasV8_2aOps,
695*8bcb0991SDimitry Andric                                      FeatureCrypto,
696*8bcb0991SDimitry Andric                                      FeatureDotProd,
697*8bcb0991SDimitry Andric                                      FeatureFPARMv8,
698*8bcb0991SDimitry Andric                                      FeatureFullFP16,
699*8bcb0991SDimitry Andric                                      FeatureNEON,
700*8bcb0991SDimitry Andric                                      FeatureRCPC,
701*8bcb0991SDimitry Andric                                      FeatureSPE,
702*8bcb0991SDimitry Andric                                      FeatureSSBS,
703*8bcb0991SDimitry Andric                                      ]>;
704*8bcb0991SDimitry Andric
7050b57cec5SDimitry Andricdef ProcSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
7060b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
7070b57cec5SDimitry Andric                                   FeatureCrypto,
7080b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
7090b57cec5SDimitry Andric                                   FeatureFPARMv8,
7100b57cec5SDimitry Andric                                   FeatureNEON,
7110b57cec5SDimitry Andric                                   FeatureSPE,
7120b57cec5SDimitry Andric                                   FeaturePerfMon,
7130b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
7140b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
7150b57cec5SDimitry Andric                                   FeatureZCZeroing,
7160b57cec5SDimitry Andric                                   FeatureLSLFast,
7170b57cec5SDimitry Andric                                   HasV8_4aOps]>;
7180b57cec5SDimitry Andric
7190b57cec5SDimitry Andricdef ProcThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily",
7200b57cec5SDimitry Andric                                         "ThunderX2T99",
7210b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
7220b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
7230b57cec5SDimitry Andric                                          FeatureCRC,
7240b57cec5SDimitry Andric                                          FeatureCrypto,
7250b57cec5SDimitry Andric                                          FeatureFPARMv8,
7260b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
7270b57cec5SDimitry Andric                                          FeatureNEON,
7280b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
7290b57cec5SDimitry Andric                                          FeaturePredictableSelectIsExpensive,
7300b57cec5SDimitry Andric                                          FeatureLSE,
7310b57cec5SDimitry Andric                                          HasV8_1aOps]>;
7320b57cec5SDimitry Andric
7330b57cec5SDimitry Andricdef ProcThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
7340b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
7350b57cec5SDimitry Andric                                    FeatureCRC,
7360b57cec5SDimitry Andric                                    FeatureCrypto,
7370b57cec5SDimitry Andric                                    FeatureFPARMv8,
7380b57cec5SDimitry Andric                                    FeaturePerfMon,
7390b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
7400b57cec5SDimitry Andric                                    FeaturePredictableSelectIsExpensive,
7410b57cec5SDimitry Andric                                    FeatureNEON]>;
7420b57cec5SDimitry Andric
7430b57cec5SDimitry Andricdef ProcThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
7440b57cec5SDimitry Andric                                       "ThunderXT88",
7450b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
7460b57cec5SDimitry Andric                                       FeatureCRC,
7470b57cec5SDimitry Andric                                       FeatureCrypto,
7480b57cec5SDimitry Andric                                       FeatureFPARMv8,
7490b57cec5SDimitry Andric                                       FeaturePerfMon,
7500b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
7510b57cec5SDimitry Andric                                       FeaturePredictableSelectIsExpensive,
7520b57cec5SDimitry Andric                                       FeatureNEON]>;
7530b57cec5SDimitry Andric
7540b57cec5SDimitry Andricdef ProcThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
7550b57cec5SDimitry Andric                                       "ThunderXT81",
7560b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
7570b57cec5SDimitry Andric                                       FeatureCRC,
7580b57cec5SDimitry Andric                                       FeatureCrypto,
7590b57cec5SDimitry Andric                                       FeatureFPARMv8,
7600b57cec5SDimitry Andric                                       FeaturePerfMon,
7610b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
7620b57cec5SDimitry Andric                                       FeaturePredictableSelectIsExpensive,
7630b57cec5SDimitry Andric                                       FeatureNEON]>;
7640b57cec5SDimitry Andric
7650b57cec5SDimitry Andricdef ProcThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
7660b57cec5SDimitry Andric                                       "ThunderXT83",
7670b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
7680b57cec5SDimitry Andric                                       FeatureCRC,
7690b57cec5SDimitry Andric                                       FeatureCrypto,
7700b57cec5SDimitry Andric                                       FeatureFPARMv8,
7710b57cec5SDimitry Andric                                       FeaturePerfMon,
7720b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
7730b57cec5SDimitry Andric                                       FeaturePredictableSelectIsExpensive,
7740b57cec5SDimitry Andric                                       FeatureNEON]>;
7750b57cec5SDimitry Andric
7760b57cec5SDimitry Andricdef ProcTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
7770b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
7780b57cec5SDimitry Andric                                  HasV8_2aOps,
7790b57cec5SDimitry Andric                                  FeatureCrypto,
7800b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
7810b57cec5SDimitry Andric                                  FeatureFPARMv8,
7820b57cec5SDimitry Andric                                  FeatureFuseAES,
7830b57cec5SDimitry Andric                                  FeatureNEON,
7840b57cec5SDimitry Andric                                  FeaturePerfMon,
7850b57cec5SDimitry Andric                                  FeaturePostRAScheduler,
7860b57cec5SDimitry Andric                                  FeatureSPE,
7870b57cec5SDimitry Andric                                  FeatureFullFP16,
7880b57cec5SDimitry Andric                                  FeatureFP16FML,
7890b57cec5SDimitry Andric                                  FeatureDotProd]>;
7900b57cec5SDimitry Andric
7910b57cec5SDimitry Andricdef : ProcessorModel<"generic", NoSchedModel, [
7920b57cec5SDimitry Andric                     FeatureFPARMv8,
7930b57cec5SDimitry Andric                     FeatureFuseAES,
7940b57cec5SDimitry Andric                     FeatureNEON,
7950b57cec5SDimitry Andric                     FeaturePerfMon,
796*8bcb0991SDimitry Andric                     FeaturePostRAScheduler,
797*8bcb0991SDimitry Andric// ETE and TRBE are future architecture extensions. We temporariliy enable them
798*8bcb0991SDimitry Andric// by default for users targeting generic AArch64, until it is decided in which
799*8bcb0991SDimitry Andric// armv8.x-a architecture revision they will end up. The extensions do not
800*8bcb0991SDimitry Andric// affect code generated by the compiler and can be used only by explicitly
801*8bcb0991SDimitry Andric// mentioning the new system register names in assembly.
802*8bcb0991SDimitry Andric                     FeatureETE
8030b57cec5SDimitry Andric                     ]>;
8040b57cec5SDimitry Andric
8050b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, [ProcA35]>;
8060b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
8070b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA53Model, [ProcA55]>;
8080b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
809*8bcb0991SDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, [ProcA65]>;
810*8bcb0991SDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, [ProcA65]>;
8110b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA72]>;
8120b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, [ProcA73]>;
8130b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, [ProcA75]>;
8140b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, [ProcA76]>;
8150b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, [ProcA76]>;
816*8bcb0991SDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model, [ProcNeoverseE1]>;
817*8bcb0991SDimitry Andricdef : ProcessorModel<"neoverse-n1", CortexA57Model, [ProcNeoverseN1]>;
8180b57cec5SDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
8190b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>;
8200b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m2", ExynosM1Model, [ProcExynosM2]>;
8210b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, [ProcExynosM3]>;
8220b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, [ProcExynosM4]>;
8230b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM4Model, [ProcExynosM4]>;
8240b57cec5SDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, [ProcFalkor]>;
8250b57cec5SDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, [ProcSaphira]>;
8260b57cec5SDimitry Andricdef : ProcessorModel<"kryo", KryoModel, [ProcKryo]>;
8270b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
8280b57cec5SDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  [ProcThunderX]>;
8290b57cec5SDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,  [ProcThunderXT88]>;
8300b57cec5SDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,  [ProcThunderXT81]>;
8310b57cec5SDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,  [ProcThunderXT83]>;
8320b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
8330b57cec5SDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model, [ProcThunderX2T99]>;
8340b57cec5SDimitry Andric// FIXME: HiSilicon TSV110 is currently modeled as a Cortex-A57.
8350b57cec5SDimitry Andricdef : ProcessorModel<"tsv110", CortexA57Model, [ProcTSV110]>;
8360b57cec5SDimitry Andric
8370b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
8380b57cec5SDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, [ProcCyclone]>;
8390b57cec5SDimitry Andric
8400b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8410b57cec5SDimitry Andric// Assembly parser
8420b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8430b57cec5SDimitry Andric
8440b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
8450b57cec5SDimitry Andric  int Variant = 0;
8460b57cec5SDimitry Andric  string Name = "generic";
8470b57cec5SDimitry Andric  string BreakCharacters = ".";
8480b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
8490b57cec5SDimitry Andric}
8500b57cec5SDimitry Andric
8510b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
8520b57cec5SDimitry Andric  int Variant = 1;
8530b57cec5SDimitry Andric  string Name = "apple-neon";
8540b57cec5SDimitry Andric  string BreakCharacters = ".";
8550b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
8560b57cec5SDimitry Andric}
8570b57cec5SDimitry Andric
8580b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8590b57cec5SDimitry Andric// Assembly printer
8600b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8610b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
8620b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
8630b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
8640b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
8650b57cec5SDimitry Andric  int PassSubtarget = 1;
8660b57cec5SDimitry Andric  int Variant = 0;
8670b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
8680b57cec5SDimitry Andric}
8690b57cec5SDimitry Andric
8700b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
8710b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
8720b57cec5SDimitry Andric  int PassSubtarget = 1;
8730b57cec5SDimitry Andric  int Variant = 1;
8740b57cec5SDimitry Andric  int isMCAsmWriter = 1;
8750b57cec5SDimitry Andric}
8760b57cec5SDimitry Andric
8770b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8780b57cec5SDimitry Andric// Target Declaration
8790b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8800b57cec5SDimitry Andric
8810b57cec5SDimitry Andricdef AArch64 : Target {
8820b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
8830b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
8840b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
8850b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
8860b57cec5SDimitry Andric}
8870b57cec5SDimitry Andric
8880b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8890b57cec5SDimitry Andric// Pfm Counters
8900b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8910b57cec5SDimitry Andric
8920b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
893