xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 2a66634d1bc6d7401adafad4a3be7b9ac6bab8b3)
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
455ffd83dbSDimitry Andric// crypto definitions 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
495ffd83dbSDimitry Andric// meaning anymore. We kept the Crypto definition 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
64349cc55cSDimitry Andricdef FeatureLSE2 : SubtargetFeature<"lse2", "HasLSE2", "true",
65349cc55cSDimitry Andric  "Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules">;
66349cc55cSDimitry Andric
67e8d8bef9SDimitry Andricdef FeatureOutlineAtomics : SubtargetFeature<"outline-atomics", "OutlineAtomics", "true",
68e8d8bef9SDimitry Andric  "Enable out of line atomics to support LSE instructions">;
69e8d8bef9SDimitry Andric
700b57cec5SDimitry Andricdef FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
710b57cec5SDimitry Andric  "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions">;
720b57cec5SDimitry Andric
730b57cec5SDimitry Andricdef FeaturePAN : SubtargetFeature<
740b57cec5SDimitry Andric    "pan", "HasPAN", "true",
750b57cec5SDimitry Andric    "Enables ARM v8.1 Privileged Access-Never extension">;
760b57cec5SDimitry Andric
770b57cec5SDimitry Andricdef FeatureLOR : SubtargetFeature<
780b57cec5SDimitry Andric    "lor", "HasLOR", "true",
790b57cec5SDimitry Andric    "Enables ARM v8.1 Limited Ordering Regions extension">;
800b57cec5SDimitry Andric
81e8d8bef9SDimitry Andricdef FeatureCONTEXTIDREL2 : SubtargetFeature<"CONTEXTIDREL2", "HasCONTEXTIDREL2",
82e8d8bef9SDimitry Andric    "true", "Enable RW operand CONTEXTIDR_EL2" >;
83e8d8bef9SDimitry Andric
84e8d8bef9SDimitry Andricdef FeatureVH : SubtargetFeature<"vh", "HasVH", "true",
85e8d8bef9SDimitry Andric    "Enables ARM v8.1 Virtual Host extension", [FeatureCONTEXTIDREL2] >;
860b57cec5SDimitry Andric
870b57cec5SDimitry Andricdef FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
880b57cec5SDimitry Andric  "Enable ARMv8 PMUv3 Performance Monitors extension">;
890b57cec5SDimitry Andric
900b57cec5SDimitry Andricdef FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
910b57cec5SDimitry Andric  "Full FP16", [FeatureFPARMv8]>;
920b57cec5SDimitry Andric
930b57cec5SDimitry Andricdef FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
940b57cec5SDimitry Andric  "Enable FP16 FML instructions", [FeatureFullFP16]>;
950b57cec5SDimitry Andric
960b57cec5SDimitry Andricdef FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
970b57cec5SDimitry Andric  "Enable Statistical Profiling extension">;
980b57cec5SDimitry Andric
990b57cec5SDimitry Andricdef FeaturePAN_RWV : SubtargetFeature<
1000b57cec5SDimitry Andric    "pan-rwv", "HasPAN_RWV", "true",
1010b57cec5SDimitry Andric    "Enable v8.2 PAN s1e1R and s1e1W Variants",
1020b57cec5SDimitry Andric    [FeaturePAN]>;
1030b57cec5SDimitry Andric
1040b57cec5SDimitry Andric// UAO PState
1050b57cec5SDimitry Andricdef FeaturePsUAO : SubtargetFeature< "uaops", "HasPsUAO", "true",
1060b57cec5SDimitry Andric    "Enable v8.2 UAO PState">;
1070b57cec5SDimitry Andric
1080b57cec5SDimitry Andricdef FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
1090b57cec5SDimitry Andric    "true", "Enable v8.2 data Cache Clean to Point of Persistence" >;
1100b57cec5SDimitry Andric
1110b57cec5SDimitry Andricdef FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
1125ffd83dbSDimitry Andric  "Enable Scalable Vector Extension (SVE) instructions", [FeatureFullFP16]>;
1135ffd83dbSDimitry Andric
1145ffd83dbSDimitry Andric// This flag is currently still labeled as Experimental, but when fully
1155ffd83dbSDimitry Andric// implemented this should tell the compiler to use the zeroing pseudos to
1165ffd83dbSDimitry Andric// benefit from the reverse instructions (e.g. SUB vs SUBR) if the inactive
1175ffd83dbSDimitry Andric// lanes are known to be zero. The pseudos will then be expanded using the
1185ffd83dbSDimitry Andric// MOVPRFX instruction to zero the inactive lanes. This feature should only be
1195ffd83dbSDimitry Andric// enabled if MOVPRFX instructions are known to merge with the destructive
1205ffd83dbSDimitry Andric// operations they prefix.
1215ffd83dbSDimitry Andric//
1225ffd83dbSDimitry Andric// This feature could similarly be extended to support cheap merging of _any_
1235ffd83dbSDimitry Andric// value into the inactive lanes using the MOVPRFX instruction that uses
1245ffd83dbSDimitry Andric// merging-predication.
1255ffd83dbSDimitry Andricdef FeatureExperimentalZeroingPseudos
1265ffd83dbSDimitry Andric    : SubtargetFeature<"use-experimental-zeroing-pseudos",
1275ffd83dbSDimitry Andric                       "UseExperimentalZeroingPseudos", "true",
1285ffd83dbSDimitry Andric                       "Hint to the compiler that the MOVPRFX instruction is "
1295ffd83dbSDimitry Andric                       "merged with destructive operations",
1305ffd83dbSDimitry Andric                       []>;
1310b57cec5SDimitry Andric
132349cc55cSDimitry Andricdef FeatureUseScalarIncVL : SubtargetFeature<"use-scalar-inc-vl",
133349cc55cSDimitry Andric  "UseScalarIncVL", "true", "Prefer inc/dec over add+cnt">;
134349cc55cSDimitry Andric
1350b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
136349cc55cSDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions",
137349cc55cSDimitry Andric  [FeatureSVE, FeatureUseScalarIncVL]>;
1380b57cec5SDimitry Andric
1390b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
1400b57cec5SDimitry Andric  "Enable AES SVE2 instructions", [FeatureSVE2, FeatureAES]>;
1410b57cec5SDimitry Andric
1420b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
1430b57cec5SDimitry Andric  "Enable SM4 SVE2 instructions", [FeatureSVE2, FeatureSM4]>;
1440b57cec5SDimitry Andric
1450b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
1460b57cec5SDimitry Andric  "Enable SHA3 SVE2 instructions", [FeatureSVE2, FeatureSHA3]>;
1470b57cec5SDimitry Andric
1480b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
1490b57cec5SDimitry Andric  "Enable bit permutation SVE2 instructions", [FeatureSVE2]>;
1500b57cec5SDimitry Andric
1510b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
1520b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
1538bcb0991SDimitry Andric
1540b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
1550b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
1560b57cec5SDimitry Andric
157fe6060f1SDimitry Andricdef FeatureNoZCZeroingFP : SubtargetFeature<"no-zcz-fp", "HasZeroCycleZeroingFP", "false",
158fe6060f1SDimitry Andric                                        "Has no zero-cycle zeroing instructions for FP registers">;
1590b57cec5SDimitry Andric
1600b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
1610b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
162fe6060f1SDimitry Andric                                        [FeatureZCZeroingGP]>;
1630b57cec5SDimitry Andric
1640b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
1650b57cec5SDimitry Andric/// CPUs.
1660b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
1670b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
1680b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
1690b57cec5SDimitry Andric
1700b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
1710b57cec5SDimitry Andric                                          "StrictAlign", "true",
1720b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
1730b57cec5SDimitry Andric                                          "access">;
1740b57cec5SDimitry Andric
1755ffd83dbSDimitry Andricforeach i = {1-7,9-15,18,20-28,30} in
1760b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
1770b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
1780b57cec5SDimitry Andric                                             "as a GPR">;
1790b57cec5SDimitry Andric
1800b57cec5SDimitry Andricforeach i = {8-15,18} in
1810b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
1820b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
1830b57cec5SDimitry Andric
1840b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
1850b57cec5SDimitry Andric    "true",
1860b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
1870b57cec5SDimitry Andric
1880b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
1890b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
1900b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
1910b57cec5SDimitry Andric
1920b57cec5SDimitry Andricdef FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
1930b57cec5SDimitry Andric    "CustomAsCheapAsMove", "true",
1940b57cec5SDimitry Andric    "Use custom handling of cheap instructions">;
1950b57cec5SDimitry Andric
1960b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
1970b57cec5SDimitry Andric    "ExynosAsCheapAsMove", "true",
1980b57cec5SDimitry Andric    "Use Exynos specific handling of cheap instructions",
1990b57cec5SDimitry Andric    [FeatureCustomCheapAsMoveHandling]>;
2000b57cec5SDimitry Andric
2010b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
2020b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
2030b57cec5SDimitry Andric
2040b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
2050b57cec5SDimitry Andric    "Misaligned128StoreIsSlow", "true", "Misaligned 128 bit stores are slow">;
2060b57cec5SDimitry Andric
2070b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
2080b57cec5SDimitry Andric    "Paired128IsSlow", "true", "Paired 128 bit loads and stores are slow">;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "STRQroIsSlow",
2110b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
2120b57cec5SDimitry Andric
2130b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
2140b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
2150b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
2160b57cec5SDimitry Andric
2170b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
2180b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
2190b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
2200b57cec5SDimitry Andric
2210b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
2220b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
2230b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
2240b57cec5SDimitry Andric
225e8d8bef9SDimitry Andricdef FeatureCmpBccFusion : SubtargetFeature<
226e8d8bef9SDimitry Andric    "cmp-bcc-fusion", "HasCmpBccFusion", "true",
227e8d8bef9SDimitry Andric    "CPU fuses cmp+bcc operations">;
228e8d8bef9SDimitry Andric
2290b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
2300b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
2310b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
2320b57cec5SDimitry Andric
2330b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
2340b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
2350b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
2360b57cec5SDimitry Andric
2370b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
2380b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
2390b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
2420b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
2430b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
2440b57cec5SDimitry Andric
2450b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
2460b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
2470b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
2480b57cec5SDimitry Andric
2490b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
2500b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
2510b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
2520b57cec5SDimitry Andric
2530b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
2540b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
2550b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
2560b57cec5SDimitry Andric
2570b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
2580b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
2590b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
2600b57cec5SDimitry Andric
2610b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
2620b57cec5SDimitry Andric                                   "Enable support for RCPC extension">;
2630b57cec5SDimitry Andric
2640b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
2650b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
2660b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
2670b57cec5SDimitry Andric
2680b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
2690b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
2700b57cec5SDimitry Andric    "Enable dot product support">;
2710b57cec5SDimitry Andric
272e8d8bef9SDimitry Andricdef FeaturePAuth : SubtargetFeature<
273e8d8bef9SDimitry Andric    "pauth", "HasPAuth", "true",
2745ffd83dbSDimitry Andric    "Enable v8.3-A Pointer Authentication extension">;
2750b57cec5SDimitry Andric
2760b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
2770b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
2785ffd83dbSDimitry Andric    "Enable v8.3-A JavaScript FP conversion instructions",
2790b57cec5SDimitry Andric    [FeatureFPARMv8]>;
2800b57cec5SDimitry Andric
2810b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
2820b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
2830b57cec5SDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets">;
2840b57cec5SDimitry Andric
2850b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
2860b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
2870b57cec5SDimitry Andric    "Enable v8.3-A Floating-point complex number support",
2880b57cec5SDimitry Andric    [FeatureNEON]>;
2890b57cec5SDimitry Andric
2900b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
2910b57cec5SDimitry Andric    "nv", "HasNV", "true",
2920b57cec5SDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement">;
2930b57cec5SDimitry Andric
2940b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
2950b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
2960b57cec5SDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension">;
2970b57cec5SDimitry Andric
2980b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
2990b57cec5SDimitry Andric    "dit", "HasDIT", "true",
3000b57cec5SDimitry Andric    "Enable v8.4-A Data Independent Timing instructions">;
3010b57cec5SDimitry Andric
3020b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
3030b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
3040b57cec5SDimitry Andric    "Enable v8.4-A Trace extension">;
3050b57cec5SDimitry Andric
3060b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
3070b57cec5SDimitry Andric    "am", "HasAM", "true",
3080b57cec5SDimitry Andric    "Enable v8.4-A Activity Monitors extension">;
3090b57cec5SDimitry Andric
3105ffd83dbSDimitry Andricdef FeatureAMVS : SubtargetFeature<
3115ffd83dbSDimitry Andric    "amvs", "HasAMVS", "true",
3125ffd83dbSDimitry Andric    "Enable v8.6-A Activity Monitors Virtualization support",
3135ffd83dbSDimitry Andric    [FeatureAM]>;
3145ffd83dbSDimitry Andric
3150b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
3160b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
3170b57cec5SDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension">;
3180b57cec5SDimitry Andric
3190b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
3200b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
3210b57cec5SDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions">;
3220b57cec5SDimitry Andric
323e8d8bef9SDimitry Andricdef FeatureFlagM : SubtargetFeature<
324e8d8bef9SDimitry Andric    "flagm", "HasFlagM", "true",
3250b57cec5SDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions">;
3260b57cec5SDimitry Andric
3270b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3280b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
3290b57cec5SDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets",
3300b57cec5SDimitry Andric    [FeatureRCPC]>;
3310b57cec5SDimitry Andric
3320b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3330b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3340b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3350b57cec5SDimitry Andric                                        "to their negated or complemented "
3360b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3370b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3380b57cec5SDimitry Andric
3390b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
3400b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
3410b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
3420b57cec5SDimitry Andric
3430b57cec5SDimitry Andricdef FeatureAggressiveFMA :
3440b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
3450b57cec5SDimitry Andric                   "HasAggressiveFMA",
3460b57cec5SDimitry Andric                   "true",
3470b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
3480b57cec5SDimitry Andric
3490b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
3500b57cec5SDimitry Andric  "Enable alternative NZCV format for floating point comparisons">;
3510b57cec5SDimitry Andric
3520b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
3530b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
3540b57cec5SDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int" >;
3550b57cec5SDimitry Andric
3560b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
3570b57cec5SDimitry Andric  "true", "Enable architectural speculation restriction" >;
3580b57cec5SDimitry Andric
3590b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
3600b57cec5SDimitry Andric  "true", "Enable v8.5 Speculation Barrier" >;
3610b57cec5SDimitry Andric
3620b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
3630b57cec5SDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit" >;
3640b57cec5SDimitry Andric
3650b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
3660b57cec5SDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions" >;
3670b57cec5SDimitry Andric
3680b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
3690b57cec5SDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence" >;
3700b57cec5SDimitry Andric
3710b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
3720b57cec5SDimitry Andric    "true", "Enable Branch Target Identification" >;
3730b57cec5SDimitry Andric
3740b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
3750b57cec5SDimitry Andric    "true", "Enable Random Number generation instructions" >;
3760b57cec5SDimitry Andric
3770b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
3780b57cec5SDimitry Andric    "true", "Enable Memory Tagging Extension" >;
3790b57cec5SDimitry Andric
3808bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
3818bcb0991SDimitry Andric    "true", "Enable Trace Buffer Extension">;
3828bcb0991SDimitry Andric
3838bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
3848bcb0991SDimitry Andric    "true", "Enable Embedded Trace Extension",
3858bcb0991SDimitry Andric    [FeatureTRBE]>;
3868bcb0991SDimitry Andric
3878bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
3888bcb0991SDimitry Andric    "true", "Enable Transactional Memory Extension" >;
3898bcb0991SDimitry Andric
3908bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
3918bcb0991SDimitry Andric    "AllowTaggedGlobals",
3928bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
3938bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
3948bcb0991SDimitry Andric
3955ffd83dbSDimitry Andricdef FeatureBF16 : SubtargetFeature<"bf16", "HasBF16",
3965ffd83dbSDimitry Andric    "true", "Enable BFloat16 Extension" >;
3975ffd83dbSDimitry Andric
3985ffd83dbSDimitry Andricdef FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
3995ffd83dbSDimitry Andric    "true", "Enable Matrix Multiply Int8 Extension">;
4005ffd83dbSDimitry Andric
4015ffd83dbSDimitry Andricdef FeatureMatMulFP32 : SubtargetFeature<"f32mm", "HasMatMulFP32",
4025ffd83dbSDimitry Andric    "true", "Enable Matrix Multiply FP32 Extension", [FeatureSVE]>;
4035ffd83dbSDimitry Andric
4045ffd83dbSDimitry Andricdef FeatureMatMulFP64 : SubtargetFeature<"f64mm", "HasMatMulFP64",
4055ffd83dbSDimitry Andric    "true", "Enable Matrix Multiply FP64 Extension", [FeatureSVE]>;
4065ffd83dbSDimitry Andric
407e8d8bef9SDimitry Andricdef FeatureXS : SubtargetFeature<"xs", "HasXS",
408e8d8bef9SDimitry Andric    "true", "Enable Armv8.7-A limited-TLB-maintenance instruction">;
409e8d8bef9SDimitry Andric
410e8d8bef9SDimitry Andricdef FeatureWFxT : SubtargetFeature<"wfxt", "HasWFxT",
411e8d8bef9SDimitry Andric    "true", "Enable Armv8.7-A WFET and WFIT instruction">;
412e8d8bef9SDimitry Andric
413e8d8bef9SDimitry Andricdef FeatureHCX : SubtargetFeature<
414e8d8bef9SDimitry Andric    "hcx", "HasHCX", "true", "Enable Armv8.7-A HCRX_EL2 system register">;
415e8d8bef9SDimitry Andric
416e8d8bef9SDimitry Andricdef FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
417e8d8bef9SDimitry Andric    "true", "Enable Armv8.7-A LD64B/ST64B Accelerator Extension">;
418e8d8bef9SDimitry Andric
41904eeddc0SDimitry Andricdef FeatureHBC : SubtargetFeature<"hbc", "HasHBC",
42004eeddc0SDimitry Andric    "true", "Enable Armv8.8-A Hinted Conditional Branches Extension">;
42104eeddc0SDimitry Andric
42204eeddc0SDimitry Andricdef FeatureMOPS : SubtargetFeature<"mops", "HasMOPS",
42304eeddc0SDimitry Andric    "true", "Enable Armv8.8-A memcpy and memset acceleration instructions">;
42404eeddc0SDimitry Andric
425e8d8bef9SDimitry Andricdef FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
426e8d8bef9SDimitry Andric    "true", "Enable Branch Record Buffer Extension">;
427e8d8bef9SDimitry Andric
428e8d8bef9SDimitry Andricdef FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
429e8d8bef9SDimitry Andric    "true", "Enable extra register in the Statistical Profiling Extension">;
430e8d8bef9SDimitry Andric
4315ffd83dbSDimitry Andricdef FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
4325ffd83dbSDimitry Andric    "true", "Enable fine grained virtualization traps extension">;
4335ffd83dbSDimitry Andric
4345ffd83dbSDimitry Andricdef FeatureEnhancedCounterVirtualization :
4355ffd83dbSDimitry Andric      SubtargetFeature<"ecv", "HasEnhancedCounterVirtualization",
4365ffd83dbSDimitry Andric      "true", "Enable enhanced counter virtualization extension">;
4375ffd83dbSDimitry Andric
438fe6060f1SDimitry Andricdef FeatureRME : SubtargetFeature<"rme", "HasRME",
439fe6060f1SDimitry Andric    "true", "Enable Realm Management Extension">;
440fe6060f1SDimitry Andric
441349cc55cSDimitry Andric// A subset of SVE(2) instructions are legal in Streaming SVE execution mode
442349cc55cSDimitry Andric// defined by SME.
443349cc55cSDimitry Andricdef FeatureStreamingSVE : SubtargetFeature<"streaming-sve",
444349cc55cSDimitry Andric                                           "HasStreamingSVE", "true",
445349cc55cSDimitry Andric  "Enable subset of SVE(2) instructions for Streaming SVE execution mode">;
446fe6060f1SDimitry Andricdef FeatureSME : SubtargetFeature<"sme", "HasSME", "true",
447349cc55cSDimitry Andric  "Enable Scalable Matrix Extension (SME)", [FeatureStreamingSVE, FeatureBF16]>;
448fe6060f1SDimitry Andric
449fe6060f1SDimitry Andricdef FeatureSMEF64 : SubtargetFeature<"sme-f64", "HasSMEF64", "true",
450fe6060f1SDimitry Andric  "Enable Scalable Matrix Extension (SME) F64F64 instructions", [FeatureSME]>;
451fe6060f1SDimitry Andric
452fe6060f1SDimitry Andricdef FeatureSMEI64 : SubtargetFeature<"sme-i64", "HasSMEI64", "true",
453fe6060f1SDimitry Andric  "Enable Scalable Matrix Extension (SME) I16I64 instructions", [FeatureSME]>;
454fe6060f1SDimitry Andric
455349cc55cSDimitry Andricdef FeatureAppleA7SysReg  : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
456349cc55cSDimitry Andric  "Apple A7 (the CPU formerly known as Cyclone)">;
457349cc55cSDimitry Andric
458349cc55cSDimitry Andricdef FeatureEL2VMSA : SubtargetFeature<"el2vmsa", "HasEL2VMSA", "true",
459349cc55cSDimitry Andric  "Enable Exception Level 2 Virtual Memory System Architecture">;
460349cc55cSDimitry Andric
461349cc55cSDimitry Andricdef FeatureEL3 : SubtargetFeature<"el3", "HasEL3", "true",
462349cc55cSDimitry Andric  "Enable Exception Level 3">;
463349cc55cSDimitry Andric
4640eae32dcSDimitry Andricdef FeatureFixCortexA53_835769 : SubtargetFeature<"fix-cortex-a53-835769",
4650eae32dcSDimitry Andric  "FixCortexA53_835769", "true", "Mitigate Cortex-A53 Erratum 835769">;
4660eae32dcSDimitry Andric
4673a9a9c0cSDimitry Andricdef FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice",
4683a9a9c0cSDimitry Andric                                                 "NoBTIAtReturnTwice", "true",
4693a9a9c0cSDimitry Andric                                                 "Don't place a BTI instruction "
4703a9a9c0cSDimitry Andric                                                 "after a return-twice">;
4713a9a9c0cSDimitry Andric
4720b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4730b57cec5SDimitry Andric// Architectures.
4740b57cec5SDimitry Andric//
475349cc55cSDimitry Andricdef HasV8_0aOps : SubtargetFeature<"v8a", "HasV8_0aOps", "true",
476349cc55cSDimitry Andric  "Support ARM v8.0a instructions", [FeatureEL2VMSA, FeatureEL3]>;
4770b57cec5SDimitry Andric
4780b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
479349cc55cSDimitry Andric  "Support ARM v8.1a instructions", [HasV8_0aOps, FeatureCRC, FeatureLSE,
480349cc55cSDimitry Andric  FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH]>;
4810b57cec5SDimitry Andric
4820b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
4830b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
4840b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
4850b57cec5SDimitry Andric
4860b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
487e8d8bef9SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePAuth,
4880b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
4890b57cec5SDimitry Andric
4900b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
4910b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
492e8d8bef9SDimitry Andric  FeatureNV, FeatureMPAM, FeatureDIT,
493349cc55cSDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
494349cc55cSDimitry Andric  FeatureFlagM, FeatureRCPC_IMMO, FeatureLSE2]>;
4950b57cec5SDimitry Andric
4960b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
4970b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
4980b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
4990b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
5005ffd83dbSDimitry Andric   FeatureBranchTargetId]>;
5015ffd83dbSDimitry Andric
5025ffd83dbSDimitry Andricdef HasV8_6aOps : SubtargetFeature<
5035ffd83dbSDimitry Andric  "v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions",
5045ffd83dbSDimitry Andric  [HasV8_5aOps, FeatureAMVS, FeatureBF16, FeatureFineGrainedTraps,
5055ffd83dbSDimitry Andric   FeatureEnhancedCounterVirtualization, FeatureMatMulInt8]>;
5060b57cec5SDimitry Andric
507e8d8bef9SDimitry Andricdef HasV8_7aOps : SubtargetFeature<
508e8d8bef9SDimitry Andric  "v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions",
509e8d8bef9SDimitry Andric  [HasV8_6aOps, FeatureXS, FeatureWFxT, FeatureHCX]>;
510e8d8bef9SDimitry Andric
51104eeddc0SDimitry Andricdef HasV8_8aOps : SubtargetFeature<
51204eeddc0SDimitry Andric  "v8.8a", "HasV8_8aOps", "true", "Support ARM v8.8a instructions",
51304eeddc0SDimitry Andric  [HasV8_7aOps, FeatureHBC, FeatureMOPS]>;
51404eeddc0SDimitry Andric
515349cc55cSDimitry Andricdef HasV9_0aOps : SubtargetFeature<
516349cc55cSDimitry Andric  "v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions",
517349cc55cSDimitry Andric  [HasV8_5aOps, FeatureSVE2]>;
518349cc55cSDimitry Andric
519349cc55cSDimitry Andricdef HasV9_1aOps : SubtargetFeature<
520349cc55cSDimitry Andric  "v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions",
521349cc55cSDimitry Andric  [HasV8_6aOps, HasV9_0aOps]>;
522349cc55cSDimitry Andric
523349cc55cSDimitry Andricdef HasV9_2aOps : SubtargetFeature<
524349cc55cSDimitry Andric  "v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions",
525349cc55cSDimitry Andric  [HasV8_7aOps, HasV9_1aOps]>;
526349cc55cSDimitry Andric
52704eeddc0SDimitry Andricdef HasV9_3aOps : SubtargetFeature<
52804eeddc0SDimitry Andric  "v9.3a", "HasV9_3aOps", "true", "Support ARM v9.3a instructions",
52904eeddc0SDimitry Andric  [HasV8_8aOps, HasV9_2aOps]>;
53004eeddc0SDimitry Andric
531e8d8bef9SDimitry Andricdef HasV8_0rOps : SubtargetFeature<
532e8d8bef9SDimitry Andric  "v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
533e8d8bef9SDimitry Andric  [//v8.1
534e8d8bef9SDimitry Andric  FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
535e8d8bef9SDimitry Andric  //v8.2
53604eeddc0SDimitry Andric  FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
537e8d8bef9SDimitry Andric  //v8.3
538e8d8bef9SDimitry Andric  FeatureComplxNum, FeatureCCIDX, FeatureJS,
539e8d8bef9SDimitry Andric  FeaturePAuth, FeatureRCPC,
540e8d8bef9SDimitry Andric  //v8.4
54104eeddc0SDimitry Andric  FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
54204eeddc0SDimitry Andric  FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO]>;
543e8d8bef9SDimitry Andric
5440b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5450b57cec5SDimitry Andric// Register File Description
5460b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5470b57cec5SDimitry Andric
5480b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
5490b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
5500b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
5510b57cec5SDimitry Andric
5520b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5530b57cec5SDimitry Andric// Instruction Descriptions
5540b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5550b57cec5SDimitry Andric
5560b57cec5SDimitry Andricinclude "AArch64Schedule.td"
5570b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
5580b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
5590b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
560*2a66634dSDimitry Andricinclude "AArch64SchedPredAmpere.td"
5618bcb0991SDimitry Andricinclude "AArch64Combine.td"
5620b57cec5SDimitry Andric
5630b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
5640b57cec5SDimitry Andric
5650b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5660b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
5670b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5680b57cec5SDimitry Andric
5690b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
5700b57cec5SDimitry Andric
5710b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5720b57cec5SDimitry Andric// Access to privileged registers
5730b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5740b57cec5SDimitry Andric
5750b57cec5SDimitry Andricforeach i = 1-3 in
5760b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
5770b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
5780b57cec5SDimitry Andric
5790b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5805ffd83dbSDimitry Andric// Control codegen mitigation against Straight Line Speculation vulnerability.
5815ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
5825ffd83dbSDimitry Andric
5835ffd83dbSDimitry Andricdef FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
5845ffd83dbSDimitry Andric  "HardenSlsRetBr", "true",
5855ffd83dbSDimitry Andric  "Harden against straight line speculation across RET and BR instructions">;
5865ffd83dbSDimitry Andricdef FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
5875ffd83dbSDimitry Andric  "HardenSlsBlr", "true",
5885ffd83dbSDimitry Andric  "Harden against straight line speculation across BLR instructions">;
589fe6060f1SDimitry Andricdef FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
590fe6060f1SDimitry Andric  "HardenSlsNoComdat", "true",
591fe6060f1SDimitry Andric  "Generate thunk code for SLS mitigation in the normal text section">;
5925ffd83dbSDimitry Andric
5935ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
5940b57cec5SDimitry Andric// AArch64 Processors supported.
5950b57cec5SDimitry Andric//
5960b57cec5SDimitry Andric
5970b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5980b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
5990b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6000b57cec5SDimitry Andric
6010b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
6020b57cec5SDimitry Andric
6030b57cec5SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
6040b57cec5SDimitry Andric  let F = [HasSVE, HasSVE2, HasSVE2AES, HasSVE2SM4, HasSVE2SHA3,
605349cc55cSDimitry Andric           HasSVE2BitPerm, HasSVEorStreamingSVE, HasSVE2orStreamingSVE];
6060b57cec5SDimitry Andric}
6070b57cec5SDimitry Andric
608e837bb5cSDimitry Andricdef PAUnsupported : AArch64Unsupported {
609e8d8bef9SDimitry Andric  let F = [HasPAuth];
610e837bb5cSDimitry Andric}
611e837bb5cSDimitry Andric
612fe6060f1SDimitry Andricdef SMEUnsupported : AArch64Unsupported {
613fe6060f1SDimitry Andric  let F = [HasSME, HasSMEF64, HasSMEI64];
614fe6060f1SDimitry Andric}
615fe6060f1SDimitry Andric
6160b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
617e8d8bef9SDimitry Andricinclude "AArch64SchedA55.td"
6180b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
6190b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
6200b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
6210b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
6220b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
6230b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
624480093f4SDimitry Andricinclude "AArch64SchedExynosM5.td"
6250b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
6260b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
627e8d8bef9SDimitry Andricinclude "AArch64SchedA64FX.td"
628e837bb5cSDimitry Andricinclude "AArch64SchedThunderX3T110.td"
629e8d8bef9SDimitry Andricinclude "AArch64SchedTSV110.td"
630*2a66634dSDimitry Andricinclude "AArch64SchedAmpere1.td"
6310b57cec5SDimitry Andric
632349cc55cSDimitry Andricdef TuneA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
633349cc55cSDimitry Andric                                "Cortex-A35 ARM processors">;
6340b57cec5SDimitry Andric
635349cc55cSDimitry Andricdef TuneA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
6360b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
6370b57cec5SDimitry Andric                                   FeatureFuseAES,
638349cc55cSDimitry Andric                                   FeatureBalanceFPOps,
639349cc55cSDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
640349cc55cSDimitry Andric                                   FeaturePostRAScheduler]>;
6410b57cec5SDimitry Andric
642349cc55cSDimitry Andricdef TuneA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
6430b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
6440b57cec5SDimitry Andric                                   FeatureFuseAES,
645fe6060f1SDimitry Andric                                   FeaturePostRAScheduler,
646349cc55cSDimitry Andric                                   FeatureFuseAddress]>;
647349cc55cSDimitry Andric
648349cc55cSDimitry Andricdef TuneA510    : SubtargetFeature<"a510", "ARMProcFamily", "CortexA510",
649349cc55cSDimitry Andric                                   "Cortex-A510 ARM processors", [
650349cc55cSDimitry Andric                                   FeatureFuseAES,
651349cc55cSDimitry Andric                                   FeaturePostRAScheduler
6520b57cec5SDimitry Andric                                   ]>;
6530b57cec5SDimitry Andric
654349cc55cSDimitry Andricdef TuneA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
6550b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
656349cc55cSDimitry Andric                                   FeatureFuseAES,
6570b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
6580b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
6590b57cec5SDimitry Andric                                   FeatureFuseLiterals,
6600b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
661349cc55cSDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
6620b57cec5SDimitry Andric
663349cc55cSDimitry Andricdef TuneA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
6648bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
665349cc55cSDimitry Andric                                   FeatureFuseAES,
666e8d8bef9SDimitry Andric                                   FeatureFuseAddress,
667349cc55cSDimitry Andric                                   FeatureFuseLiterals]>;
6688bcb0991SDimitry Andric
669349cc55cSDimitry Andricdef TuneA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
6700b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
6710b57cec5SDimitry Andric                                   FeatureFuseAES,
672349cc55cSDimitry Andric                                   FeatureFuseLiterals]>;
6730b57cec5SDimitry Andric
674349cc55cSDimitry Andricdef TuneA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
6750b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
676349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6770b57cec5SDimitry Andric
678349cc55cSDimitry Andricdef TuneA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
6790b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
680349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6810b57cec5SDimitry Andric
682349cc55cSDimitry Andricdef TuneA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
6830b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
684349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6850b57cec5SDimitry Andric
686349cc55cSDimitry Andricdef TuneA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
6875ffd83dbSDimitry Andric                                   "Cortex-A77 ARM processors", [
688e8d8bef9SDimitry Andric                                   FeatureCmpBccFusion,
689349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6905ffd83dbSDimitry Andric
691349cc55cSDimitry Andricdef TuneA78 : SubtargetFeature<"a78", "ARMProcFamily", "CortexA78",
6925ffd83dbSDimitry Andric                               "Cortex-A78 ARM processors", [
693e8d8bef9SDimitry Andric                               FeatureCmpBccFusion,
6945ffd83dbSDimitry Andric                               FeatureFuseAES,
695349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
6965ffd83dbSDimitry Andric
697349cc55cSDimitry Andricdef TuneA78C : SubtargetFeature<"a78c", "ARMProcFamily",
698e8d8bef9SDimitry Andric                                "CortexA78C",
699e8d8bef9SDimitry Andric                                "Cortex-A78C ARM processors", [
700e8d8bef9SDimitry Andric                                FeatureCmpBccFusion,
701e8d8bef9SDimitry Andric                                FeatureFuseAES,
702349cc55cSDimitry Andric                                FeaturePostRAScheduler]>;
703e8d8bef9SDimitry Andric
704349cc55cSDimitry Andricdef TuneA710    : SubtargetFeature<"a710", "ARMProcFamily", "CortexA710",
705349cc55cSDimitry Andric                                   "Cortex-A710 ARM processors", [
706349cc55cSDimitry Andric                                   FeatureFuseAES,
707349cc55cSDimitry Andric                                   FeaturePostRAScheduler,
708349cc55cSDimitry Andric                                   FeatureCmpBccFusion]>;
709349cc55cSDimitry Andric
710349cc55cSDimitry Andricdef TuneR82 : SubtargetFeature<"cortex-r82", "ARMProcFamily",
711e8d8bef9SDimitry Andric                               "CortexR82",
712349cc55cSDimitry Andric                               "Cortex-R82 ARM processors", [
713349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
714e8d8bef9SDimitry Andric
715349cc55cSDimitry Andricdef TuneX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
7165ffd83dbSDimitry Andric                                  "Cortex-X1 ARM processors", [
717e8d8bef9SDimitry Andric                                  FeatureCmpBccFusion,
7185ffd83dbSDimitry Andric                                  FeatureFuseAES,
719349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
7205ffd83dbSDimitry Andric
721349cc55cSDimitry Andricdef TuneX2 : SubtargetFeature<"cortex-x2", "ARMProcFamily", "CortexX2",
722349cc55cSDimitry Andric                                  "Cortex-X2 ARM processors", [
723349cc55cSDimitry Andric                                  FeatureFuseAES,
7245ffd83dbSDimitry Andric                                  FeaturePostRAScheduler,
725349cc55cSDimitry Andric                                  FeatureCmpBccFusion]>;
726349cc55cSDimitry Andric
727349cc55cSDimitry Andricdef TuneA64FX : SubtargetFeature<"a64fx", "ARMProcFamily", "A64FX",
728349cc55cSDimitry Andric                                 "Fujitsu A64FX processors", [
729349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
730e8d8bef9SDimitry Andric                                 FeatureAggressiveFMA,
731e8d8bef9SDimitry Andric                                 FeatureArithmeticBccFusion,
732e8d8bef9SDimitry Andric                                 FeaturePredictableSelectIsExpensive
7335ffd83dbSDimitry Andric                                 ]>;
7345ffd83dbSDimitry Andric
735349cc55cSDimitry Andricdef TuneCarmel : SubtargetFeature<"carmel", "ARMProcFamily", "Carmel",
736349cc55cSDimitry Andric                                  "Nvidia Carmel processors">;
7375ffd83dbSDimitry Andric
7380b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
7390b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
740349cc55cSDimitry Andricdef TuneAppleA7  : SubtargetFeature<"apple-a7", "ARMProcFamily", "AppleA7",
741480093f4SDimitry Andric                                    "Apple A7 (the CPU formerly known as Cyclone)", [
7420b57cec5SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
7430b57cec5SDimitry Andric                                    FeatureArithmeticBccFusion,
7440b57cec5SDimitry Andric                                    FeatureArithmeticCbzFusion,
7450b57cec5SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
746349cc55cSDimitry Andric                                    FeatureFuseAES, FeatureFuseCryptoEOR,
7470b57cec5SDimitry Andric                                    FeatureZCRegMove,
7480b57cec5SDimitry Andric                                    FeatureZCZeroing,
749349cc55cSDimitry Andric                                    FeatureZCZeroingFPWorkaround]
750349cc55cSDimitry Andric                                    >;
7510b57cec5SDimitry Andric
752349cc55cSDimitry Andricdef TuneAppleA10 : SubtargetFeature<"apple-a10", "ARMProcFamily", "AppleA10",
753480093f4SDimitry Andric                                    "Apple A10", [
754480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
755480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
756480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
757480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
7580b57cec5SDimitry Andric                                    FeatureFuseAES,
759480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
760480093f4SDimitry Andric                                    FeatureZCRegMove,
761349cc55cSDimitry Andric                                    FeatureZCZeroing]
762349cc55cSDimitry Andric                                    >;
7630b57cec5SDimitry Andric
764349cc55cSDimitry Andricdef TuneAppleA11 : SubtargetFeature<"apple-a11", "ARMProcFamily", "AppleA11",
765480093f4SDimitry Andric                                    "Apple A11", [
766480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
767480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
768480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
769480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
7700b57cec5SDimitry Andric                                    FeatureFuseAES,
771480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
772480093f4SDimitry Andric                                    FeatureZCRegMove,
773349cc55cSDimitry Andric                                    FeatureZCZeroing]
774349cc55cSDimitry Andric                                    >;
775480093f4SDimitry Andric
776349cc55cSDimitry Andricdef TuneAppleA12 : SubtargetFeature<"apple-a12", "ARMProcFamily", "AppleA12",
777480093f4SDimitry Andric                                    "Apple A12", [
778480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
779480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
780480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
781480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
782480093f4SDimitry Andric                                    FeatureFuseAES,
783480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
784480093f4SDimitry Andric                                    FeatureZCRegMove,
785349cc55cSDimitry Andric                                    FeatureZCZeroing]
786349cc55cSDimitry Andric                                    >;
787480093f4SDimitry Andric
788349cc55cSDimitry Andricdef TuneAppleA13 : SubtargetFeature<"apple-a13", "ARMProcFamily", "AppleA13",
789480093f4SDimitry Andric                                    "Apple A13", [
790480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
791480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
792480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
793480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
794480093f4SDimitry Andric                                    FeatureFuseAES,
795480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
796480093f4SDimitry Andric                                    FeatureZCRegMove,
797349cc55cSDimitry Andric                                    FeatureZCZeroing]
798349cc55cSDimitry Andric                                    >;
7990b57cec5SDimitry Andric
800349cc55cSDimitry Andricdef TuneAppleA14 : SubtargetFeature<"apple-a14", "ARMProcFamily", "AppleA14",
801e8d8bef9SDimitry Andric                                    "Apple A14", [
802e8d8bef9SDimitry Andric                                    FeatureAggressiveFMA,
803e8d8bef9SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
804e8d8bef9SDimitry Andric                                    FeatureArithmeticBccFusion,
805e8d8bef9SDimitry Andric                                    FeatureArithmeticCbzFusion,
806e8d8bef9SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
807e8d8bef9SDimitry Andric                                    FeatureFuseAddress,
808e8d8bef9SDimitry Andric                                    FeatureFuseAES,
809e8d8bef9SDimitry Andric                                    FeatureFuseArithmeticLogic,
810e8d8bef9SDimitry Andric                                    FeatureFuseCCSelect,
811e8d8bef9SDimitry Andric                                    FeatureFuseCryptoEOR,
812e8d8bef9SDimitry Andric                                    FeatureFuseLiterals,
813e8d8bef9SDimitry Andric                                    FeatureZCRegMove,
814349cc55cSDimitry Andric                                    FeatureZCZeroing]>;
815e8d8bef9SDimitry Andric
816349cc55cSDimitry Andricdef TuneExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
8170b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
818349cc55cSDimitry Andric                                    [FeatureExynosCheapAsMoveHandling,
8190b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
8200b57cec5SDimitry Andric                                     FeatureFuseAddress,
8210b57cec5SDimitry Andric                                     FeatureFuseAES,
8220b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
8230b57cec5SDimitry Andric                                     FeatureFuseLiterals,
8240b57cec5SDimitry Andric                                     FeatureLSLFast,
8250b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
826fe6060f1SDimitry Andric                                     FeaturePredictableSelectIsExpensive]>;
8270b57cec5SDimitry Andric
828349cc55cSDimitry Andricdef TuneExynosM4 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
829349cc55cSDimitry Andric                                    "Samsung Exynos-M3 processors",
830349cc55cSDimitry Andric                                    [FeatureArithmeticBccFusion,
8310b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
8320b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
8330b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
8340b57cec5SDimitry Andric                                     FeatureFuseAddress,
8350b57cec5SDimitry Andric                                     FeatureFuseAES,
8360b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
8370b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
8380b57cec5SDimitry Andric                                     FeatureFuseLiterals,
8390b57cec5SDimitry Andric                                     FeatureLSLFast,
8400b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
8410b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
8420b57cec5SDimitry Andric
843349cc55cSDimitry Andricdef TuneKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
8440b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
8450b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
8460b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
8470b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
8480b57cec5SDimitry Andric                                   FeatureZCZeroing,
849349cc55cSDimitry Andric                                   FeatureLSLFast]
850349cc55cSDimitry Andric                                   >;
8510b57cec5SDimitry Andric
852349cc55cSDimitry Andricdef TuneFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
8530b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
8540b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
8550b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
8560b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
8570b57cec5SDimitry Andric                                   FeatureZCZeroing,
8580b57cec5SDimitry Andric                                   FeatureLSLFast,
8590b57cec5SDimitry Andric                                   FeatureSlowSTRQro
8600b57cec5SDimitry Andric                                   ]>;
8610b57cec5SDimitry Andric
862349cc55cSDimitry Andricdef TuneNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily", "NeoverseE1",
8638bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
864fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
865349cc55cSDimitry Andric                                      FeatureFuseAES
8668bcb0991SDimitry Andric                                      ]>;
8678bcb0991SDimitry Andric
868349cc55cSDimitry Andricdef TuneNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily", "NeoverseN1",
8698bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
870fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
871349cc55cSDimitry Andric                                      FeatureFuseAES
8728bcb0991SDimitry Andric                                      ]>;
8738bcb0991SDimitry Andric
874349cc55cSDimitry Andricdef TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2",
875e8d8bef9SDimitry Andric                                      "Neoverse N2 ARM processors", [
876fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
877349cc55cSDimitry Andric                                      FeatureFuseAES
878349cc55cSDimitry Andric                                      ]>;
879349cc55cSDimitry Andricdef TuneNeoverse512TVB : SubtargetFeature<"neoverse512tvb", "ARMProcFamily", "Neoverse512TVB",
880349cc55cSDimitry Andric                                      "Neoverse 512-TVB ARM processors", [
881349cc55cSDimitry Andric                                      FeaturePostRAScheduler,
882349cc55cSDimitry Andric                                      FeatureFuseAES
883fe6060f1SDimitry Andric                                      ]>;
884e8d8bef9SDimitry Andric
885349cc55cSDimitry Andricdef TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1",
886e8d8bef9SDimitry Andric                                      "Neoverse V1 ARM processors", [
887e8d8bef9SDimitry Andric                                      FeatureFuseAES,
888349cc55cSDimitry Andric                                      FeaturePostRAScheduler]>;
889e8d8bef9SDimitry Andric
890349cc55cSDimitry Andricdef TuneSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
8910b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
8920b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
8930b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
8940b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
8950b57cec5SDimitry Andric                                   FeatureZCZeroing,
896349cc55cSDimitry Andric                                   FeatureLSLFast]>;
8970b57cec5SDimitry Andric
898349cc55cSDimitry Andricdef TuneThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily", "ThunderX2T99",
8990b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
9000b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
9010b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
9020b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
903349cc55cSDimitry Andric                                          FeaturePredictableSelectIsExpensive]>;
9040b57cec5SDimitry Andric
905349cc55cSDimitry Andricdef TuneThunderX3T110  : SubtargetFeature<"thunderx3t110", "ARMProcFamily",
906e837bb5cSDimitry Andric                                          "ThunderX3T110",
907e837bb5cSDimitry Andric                                          "Marvell ThunderX3 processors", [
908e837bb5cSDimitry Andric                                           FeatureAggressiveFMA,
909e837bb5cSDimitry Andric                                           FeatureArithmeticBccFusion,
910e837bb5cSDimitry Andric                                           FeaturePostRAScheduler,
911e837bb5cSDimitry Andric                                           FeaturePredictableSelectIsExpensive,
912e837bb5cSDimitry Andric                                           FeatureBalanceFPOps,
913349cc55cSDimitry Andric                                           FeatureStrictAlign]>;
914e837bb5cSDimitry Andric
915349cc55cSDimitry Andricdef TuneThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
9160b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
9170b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
918349cc55cSDimitry Andric                                    FeaturePredictableSelectIsExpensive]>;
9190b57cec5SDimitry Andric
920349cc55cSDimitry Andricdef TuneThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
9210b57cec5SDimitry Andric                                       "ThunderXT88",
9220b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
9230b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
924349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
9250b57cec5SDimitry Andric
926349cc55cSDimitry Andricdef TuneThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
9270b57cec5SDimitry Andric                                       "ThunderXT81",
9280b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
9290b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
930349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
9310b57cec5SDimitry Andric
932349cc55cSDimitry Andricdef TuneThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
9330b57cec5SDimitry Andric                                       "ThunderXT83",
9340b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
9350b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
936349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
9370b57cec5SDimitry Andric
938349cc55cSDimitry Andricdef TuneTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
9390b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
9400b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
9410b57cec5SDimitry Andric                                  FeatureFuseAES,
942349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
9430b57cec5SDimitry Andric
944*2a66634dSDimitry Andricdef TuneAmpere1 : SubtargetFeature<"ampere1", "ARMProcFamily", "Ampere1",
945*2a66634dSDimitry Andric                                   "Ampere Computing Ampere-1 processors", [
946*2a66634dSDimitry Andric                                   FeaturePostRAScheduler,
947*2a66634dSDimitry Andric                                   FeatureFuseAES,
948*2a66634dSDimitry Andric                                   FeatureLSLFast,
949*2a66634dSDimitry Andric                                   FeatureAggressiveFMA,
950*2a66634dSDimitry Andric                                   FeatureArithmeticBccFusion,
951*2a66634dSDimitry Andric                                   FeatureCmpBccFusion,
952*2a66634dSDimitry Andric                                   FeatureFuseAddress,
953*2a66634dSDimitry Andric                                   FeatureFuseLiterals]>;
954349cc55cSDimitry Andric
955349cc55cSDimitry Andricdef ProcessorFeatures {
956349cc55cSDimitry Andric  list<SubtargetFeature> A53  = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
957349cc55cSDimitry Andric                                 FeatureFPARMv8, FeatureNEON, FeaturePerfMon];
958349cc55cSDimitry Andric  list<SubtargetFeature> A55  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
959349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
960349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon];
961349cc55cSDimitry Andric  list<SubtargetFeature> A510 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
962349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
963349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
964349cc55cSDimitry Andric                                 FeatureFP16FML];
965349cc55cSDimitry Andric  list<SubtargetFeature> A65  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
966349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
967349cc55cSDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeatureRAS];
968349cc55cSDimitry Andric  list<SubtargetFeature> A76  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
969349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
970349cc55cSDimitry Andric                                 FeatureRCPC, FeatureSSBS];
971349cc55cSDimitry Andric  list<SubtargetFeature> A77  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
972349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
9733a9a9c0cSDimitry Andric                                 FeatureRCPC, FeatureSSBS];
974349cc55cSDimitry Andric  list<SubtargetFeature> A78  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
975349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
976349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSPE,
977349cc55cSDimitry Andric                                 FeatureSSBS];
978349cc55cSDimitry Andric  list<SubtargetFeature> A78C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
979349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
980349cc55cSDimitry Andric                                 FeatureFlagM, FeatureFP16FML, FeaturePAuth,
981349cc55cSDimitry Andric                                 FeaturePerfMon, FeatureRCPC, FeatureSPE,
982349cc55cSDimitry Andric                                 FeatureSSBS];
983349cc55cSDimitry Andric  list<SubtargetFeature> A710 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
984349cc55cSDimitry Andric                                 FeatureETE, FeatureMTE, FeatureFP16FML,
985349cc55cSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureMatMulInt8];
98604eeddc0SDimitry Andric  list<SubtargetFeature> R82  = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
98704eeddc0SDimitry Andric                                 FeatureFP16FML, FeatureSSBS, FeaturePredRes,
98804eeddc0SDimitry Andric                                 FeatureSB, FeatureSpecRestrict];
989349cc55cSDimitry Andric  list<SubtargetFeature> X1   = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
990349cc55cSDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
9913a9a9c0cSDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
9923a9a9c0cSDimitry Andric                                 FeatureSSBS];
9931fd87a68SDimitry Andric  list<SubtargetFeature> X1C  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
9941fd87a68SDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
9951fd87a68SDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
9963a9a9c0cSDimitry Andric                                 FeaturePAuth, FeatureSSBS];
997349cc55cSDimitry Andric  list<SubtargetFeature> X2   = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
998349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
999349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1000349cc55cSDimitry Andric                                 FeatureFP16FML];
1001349cc55cSDimitry Andric  list<SubtargetFeature> A64FX    = [HasV8_2aOps, FeatureFPARMv8, FeatureNEON,
1002349cc55cSDimitry Andric                                     FeatureSHA2, FeaturePerfMon, FeatureFullFP16,
1003349cc55cSDimitry Andric                                     FeatureSVE, FeatureComplxNum];
1004349cc55cSDimitry Andric  list<SubtargetFeature> Carmel   = [HasV8_2aOps, FeatureNEON, FeatureCrypto,
1005349cc55cSDimitry Andric                                     FeatureFullFP16];
1006349cc55cSDimitry Andric  list<SubtargetFeature> AppleA7  = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1007349cc55cSDimitry Andric                                     FeatureNEON,FeaturePerfMon, FeatureAppleA7SysReg];
1008349cc55cSDimitry Andric  list<SubtargetFeature> AppleA10 = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1009349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureCRC,
1010349cc55cSDimitry Andric                                     FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH];
1011349cc55cSDimitry Andric  list<SubtargetFeature> AppleA11 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1012349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1013349cc55cSDimitry Andric  list<SubtargetFeature> AppleA12 = [HasV8_3aOps, FeatureCrypto, FeatureFPARMv8,
1014349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1015349cc55cSDimitry Andric  list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1016349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16,
1017349cc55cSDimitry Andric                                     FeatureFP16FML, FeatureSHA3];
1018349cc55cSDimitry Andric  list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1019349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
1020349cc55cSDimitry Andric                                     FeatureSpecRestrict, FeatureSSBS, FeatureSB,
1021349cc55cSDimitry Andric                                     FeaturePredRes, FeatureCacheDeepPersist,
1022349cc55cSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML, FeatureSHA3,
1023349cc55cSDimitry Andric                                     FeatureAltFPCmp];
1024349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM3 = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1025349cc55cSDimitry Andric                                     FeaturePerfMon];
1026349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM4 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1027349cc55cSDimitry Andric                                     FeatureFullFP16, FeaturePerfMon];
1028349cc55cSDimitry Andric  list<SubtargetFeature> Falkor   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1029349cc55cSDimitry Andric                                     FeatureFPARMv8, FeatureNEON, FeaturePerfMon,
1030349cc55cSDimitry Andric                                     FeatureRDM];
1031349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseE1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1032349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
1033349cc55cSDimitry Andric                                       FeatureRCPC, FeatureSSBS];
1034349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1035349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
1036349cc55cSDimitry Andric                                       FeatureRCPC, FeatureSPE, FeatureSSBS];
1037349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN2 = [HasV8_5aOps, FeatureBF16, FeatureETE,
1038349cc55cSDimitry Andric                                       FeatureMatMulInt8, FeatureMTE, FeatureSVE2,
1039349cc55cSDimitry Andric                                       FeatureSVE2BitPerm, FeatureTRBE, FeatureCrypto];
1040349cc55cSDimitry Andric  list<SubtargetFeature> Neoverse512TVB = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1041349cc55cSDimitry Andric                                           FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1042349cc55cSDimitry Andric                                           FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1043349cc55cSDimitry Andric                                           FeaturePerfMon, FeatureRandGen, FeatureSPE,
1044349cc55cSDimitry Andric                                           FeatureSSBS, FeatureSVE];
1045349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseV1 = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1046349cc55cSDimitry Andric                                       FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1047349cc55cSDimitry Andric                                       FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1048349cc55cSDimitry Andric                                       FeaturePerfMon, FeatureRandGen, FeatureSPE,
1049349cc55cSDimitry Andric                                       FeatureSSBS, FeatureSVE];
1050349cc55cSDimitry Andric  list<SubtargetFeature> Saphira    = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1051349cc55cSDimitry Andric                                       FeatureNEON, FeatureSPE, FeaturePerfMon];
1052349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1053349cc55cSDimitry Andric                                       FeatureFPARMv8, FeaturePerfMon, FeatureNEON];
1054349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX2T99  = [HasV8_1aOps, FeatureCRC, FeatureCrypto,
1055349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE];
1056349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX3T110 = [HasV8_3aOps, FeatureCRC, FeatureCrypto,
1057349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE,
1058349cc55cSDimitry Andric                                          FeaturePAuth, FeaturePerfMon];
1059349cc55cSDimitry Andric  list<SubtargetFeature> TSV110 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1060349cc55cSDimitry Andric                                   FeatureNEON, FeaturePerfMon, FeatureSPE,
1061349cc55cSDimitry Andric                                   FeatureFullFP16, FeatureFP16FML, FeatureDotProd];
1062*2a66634dSDimitry Andric  list<SubtargetFeature> Ampere1 = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1063*2a66634dSDimitry Andric                                    FeatureMTE, FeatureSSBS];
1064349cc55cSDimitry Andric
10655ffd83dbSDimitry Andric  // ETE and TRBE are future architecture extensions. We temporarily enable them
1066349cc55cSDimitry Andric  // by default for users targeting generic AArch64. The extensions do not
10678bcb0991SDimitry Andric  // affect code generated by the compiler and can be used only by explicitly
10688bcb0991SDimitry Andric  // mentioning the new system register names in assembly.
1069349cc55cSDimitry Andric  list<SubtargetFeature> Generic = [FeatureFPARMv8, FeatureNEON, FeaturePerfMon, FeatureETE];
1070349cc55cSDimitry Andric}
10710b57cec5SDimitry Andric
1072349cc55cSDimitry Andric
1073349cc55cSDimitry Andricdef : ProcessorModel<"generic", CortexA55Model, ProcessorFeatures.Generic,
1074349cc55cSDimitry Andric                     [FeatureFuseAES, FeaturePostRAScheduler]>;
1075349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, ProcessorFeatures.A53,
1076349cc55cSDimitry Andric                     [TuneA35]>;
1077349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a34", CortexA53Model, ProcessorFeatures.A53,
1078349cc55cSDimitry Andric                     [TuneA35]>;
1079349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, ProcessorFeatures.A53,
1080349cc55cSDimitry Andric                     [TuneA53]>;
1081349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA55Model, ProcessorFeatures.A55,
1082349cc55cSDimitry Andric                     [TuneA55]>;
1083349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a510", CortexA55Model, ProcessorFeatures.A510,
1084349cc55cSDimitry Andric                     [TuneA510]>;
1085349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, ProcessorFeatures.A53,
1086349cc55cSDimitry Andric                     [TuneA57]>;
1087349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, ProcessorFeatures.A65,
1088349cc55cSDimitry Andric                     [TuneA65]>;
1089349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, ProcessorFeatures.A65,
1090349cc55cSDimitry Andric                     [TuneA65]>;
1091349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, ProcessorFeatures.A53,
1092349cc55cSDimitry Andric                     [TuneA72]>;
1093349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, ProcessorFeatures.A53,
1094349cc55cSDimitry Andric                     [TuneA73]>;
1095349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, ProcessorFeatures.A55,
1096349cc55cSDimitry Andric                     [TuneA75]>;
1097349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, ProcessorFeatures.A76,
1098349cc55cSDimitry Andric                     [TuneA76]>;
1099349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, ProcessorFeatures.A76,
1100349cc55cSDimitry Andric                     [TuneA76]>;
1101349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a77", CortexA57Model, ProcessorFeatures.A77,
1102349cc55cSDimitry Andric                     [TuneA77]>;
1103349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78", CortexA57Model, ProcessorFeatures.A78,
1104349cc55cSDimitry Andric                     [TuneA78]>;
1105349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78c", CortexA57Model, ProcessorFeatures.A78C,
1106349cc55cSDimitry Andric                     [TuneA78C]>;
1107349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a710", CortexA57Model, ProcessorFeatures.A710,
1108349cc55cSDimitry Andric                     [TuneA710]>;
1109349cc55cSDimitry Andricdef : ProcessorModel<"cortex-r82", CortexA55Model, ProcessorFeatures.R82,
1110349cc55cSDimitry Andric                     [TuneR82]>;
1111349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x1", CortexA57Model, ProcessorFeatures.X1,
1112349cc55cSDimitry Andric                     [TuneX1]>;
11131fd87a68SDimitry Andricdef : ProcessorModel<"cortex-x1c", CortexA57Model, ProcessorFeatures.X1C,
11141fd87a68SDimitry Andric                     [TuneX1]>;
1115349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x2", CortexA57Model, ProcessorFeatures.X2,
1116349cc55cSDimitry Andric                     [TuneX2]>;
1117349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model,
1118349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
1119349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-n1", CortexA57Model,
1120349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
1121349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-n2", CortexA57Model,
1122349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
1123349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-512tvb", CortexA57Model,
1124349cc55cSDimitry Andric                     ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
1125349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-v1", CortexA57Model,
1126349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseV1, [TuneNeoverseV1]>;
1127349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, ProcessorFeatures.ExynosM3,
1128349cc55cSDimitry Andric                     [TuneExynosM3]>;
1129349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, ProcessorFeatures.ExynosM4,
1130349cc55cSDimitry Andric                     [TuneExynosM4]>;
1131349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM5Model, ProcessorFeatures.ExynosM4,
1132349cc55cSDimitry Andric                     [TuneExynosM4]>;
1133349cc55cSDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, ProcessorFeatures.Falkor,
1134349cc55cSDimitry Andric                     [TuneFalkor]>;
1135349cc55cSDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, ProcessorFeatures.Saphira,
1136349cc55cSDimitry Andric                     [TuneSaphira]>;
1137349cc55cSDimitry Andricdef : ProcessorModel<"kryo", KryoModel, ProcessorFeatures.A53, [TuneKryo]>;
1138349cc55cSDimitry Andric
11390b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
1140349cc55cSDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  ProcessorFeatures.ThunderX,
1141349cc55cSDimitry Andric                     [TuneThunderX]>;
1142349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,
1143349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT88]>;
1144349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,
1145349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT81]>;
1146349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,
1147349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT83]>;
11480b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
1149349cc55cSDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model,
1150349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX2T99, [TuneThunderX2T99]>;
1151e837bb5cSDimitry Andric// Marvell ThunderX3T110 Processors.
1152349cc55cSDimitry Andricdef : ProcessorModel<"thunderx3t110", ThunderX3T110Model,
1153349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX3T110, [TuneThunderX3T110]>;
1154349cc55cSDimitry Andricdef : ProcessorModel<"tsv110", TSV110Model, ProcessorFeatures.TSV110,
1155349cc55cSDimitry Andric                     [TuneTSV110]>;
11560b57cec5SDimitry Andric
1157480093f4SDimitry Andric// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
1158349cc55cSDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
1159349cc55cSDimitry Andric                     [TuneAppleA7]>;
1160480093f4SDimitry Andric
1161480093f4SDimitry Andric// iPhone and iPad CPUs
1162349cc55cSDimitry Andricdef : ProcessorModel<"apple-a7", CycloneModel, ProcessorFeatures.AppleA7,
1163349cc55cSDimitry Andric                     [TuneAppleA7]>;
1164349cc55cSDimitry Andricdef : ProcessorModel<"apple-a8", CycloneModel, ProcessorFeatures.AppleA7,
1165349cc55cSDimitry Andric                     [TuneAppleA7]>;
1166349cc55cSDimitry Andricdef : ProcessorModel<"apple-a9", CycloneModel, ProcessorFeatures.AppleA7,
1167349cc55cSDimitry Andric                     [TuneAppleA7]>;
1168349cc55cSDimitry Andricdef : ProcessorModel<"apple-a10", CycloneModel, ProcessorFeatures.AppleA10,
1169349cc55cSDimitry Andric                     [TuneAppleA10]>;
1170349cc55cSDimitry Andricdef : ProcessorModel<"apple-a11", CycloneModel, ProcessorFeatures.AppleA11,
1171349cc55cSDimitry Andric                     [TuneAppleA11]>;
1172349cc55cSDimitry Andricdef : ProcessorModel<"apple-a12", CycloneModel, ProcessorFeatures.AppleA12,
1173349cc55cSDimitry Andric                     [TuneAppleA12]>;
1174349cc55cSDimitry Andricdef : ProcessorModel<"apple-a13", CycloneModel, ProcessorFeatures.AppleA13,
1175349cc55cSDimitry Andric                     [TuneAppleA13]>;
1176349cc55cSDimitry Andricdef : ProcessorModel<"apple-a14", CycloneModel, ProcessorFeatures.AppleA14,
1177349cc55cSDimitry Andric                     [TuneAppleA14]>;
1178480093f4SDimitry Andric
1179fe6060f1SDimitry Andric// Mac CPUs
1180349cc55cSDimitry Andricdef : ProcessorModel<"apple-m1", CycloneModel, ProcessorFeatures.AppleA14,
1181349cc55cSDimitry Andric                     [TuneAppleA14]>;
1182fe6060f1SDimitry Andric
1183480093f4SDimitry Andric// watch CPUs.
1184349cc55cSDimitry Andricdef : ProcessorModel<"apple-s4", CycloneModel, ProcessorFeatures.AppleA12,
1185349cc55cSDimitry Andric                     [TuneAppleA12]>;
1186349cc55cSDimitry Andricdef : ProcessorModel<"apple-s5", CycloneModel, ProcessorFeatures.AppleA12,
1187349cc55cSDimitry Andric                     [TuneAppleA12]>;
1188480093f4SDimitry Andric
11890b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
1190349cc55cSDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, ProcessorFeatures.AppleA14,
1191349cc55cSDimitry Andric                     [TuneAppleA14]>;
11920b57cec5SDimitry Andric
11935ffd83dbSDimitry Andric// Fujitsu A64FX
1194349cc55cSDimitry Andricdef : ProcessorModel<"a64fx", A64FXModel, ProcessorFeatures.A64FX,
1195349cc55cSDimitry Andric                     [TuneA64FX]>;
11965ffd83dbSDimitry Andric
11975ffd83dbSDimitry Andric// Nvidia Carmel
1198349cc55cSDimitry Andricdef : ProcessorModel<"carmel", NoSchedModel, ProcessorFeatures.Carmel,
1199349cc55cSDimitry Andric                     [TuneCarmel]>;
12005ffd83dbSDimitry Andric
1201*2a66634dSDimitry Andric// Ampere Computing
1202*2a66634dSDimitry Andricdef : ProcessorModel<"ampere1", Ampere1Model, ProcessorFeatures.Ampere1,
1203*2a66634dSDimitry Andric                     [TuneAmpere1]>;
1204*2a66634dSDimitry Andric
12050b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12060b57cec5SDimitry Andric// Assembly parser
12070b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12080b57cec5SDimitry Andric
12090b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
12100b57cec5SDimitry Andric  int Variant = 0;
12110b57cec5SDimitry Andric  string Name = "generic";
12120b57cec5SDimitry Andric  string BreakCharacters = ".";
12130b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
12140b57cec5SDimitry Andric}
12150b57cec5SDimitry Andric
12160b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
12170b57cec5SDimitry Andric  int Variant = 1;
12180b57cec5SDimitry Andric  string Name = "apple-neon";
12190b57cec5SDimitry Andric  string BreakCharacters = ".";
12200b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
12210b57cec5SDimitry Andric}
12220b57cec5SDimitry Andric
12230b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12240b57cec5SDimitry Andric// Assembly printer
12250b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12260b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
12270b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
12280b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
12290b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
12300b57cec5SDimitry Andric  int PassSubtarget = 1;
12310b57cec5SDimitry Andric  int Variant = 0;
12320b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
12330b57cec5SDimitry Andric}
12340b57cec5SDimitry Andric
12350b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
12360b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
12370b57cec5SDimitry Andric  int PassSubtarget = 1;
12380b57cec5SDimitry Andric  int Variant = 1;
12390b57cec5SDimitry Andric  int isMCAsmWriter = 1;
12400b57cec5SDimitry Andric}
12410b57cec5SDimitry Andric
12420b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12430b57cec5SDimitry Andric// Target Declaration
12440b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12450b57cec5SDimitry Andric
12460b57cec5SDimitry Andricdef AArch64 : Target {
12470b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
12480b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
12490b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
12500b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
12510b57cec5SDimitry Andric}
12520b57cec5SDimitry Andric
12530b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12540b57cec5SDimitry Andric// Pfm Counters
12550b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12560b57cec5SDimitry Andric
12570b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
1258