xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
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
22*bdd1243dSDimitry Andric// Each SubtargetFeature which corresponds to an Arm Architecture feature should
23*bdd1243dSDimitry Andric// be annotated with the respective FEAT_ feature name from the Architecture
24*bdd1243dSDimitry Andric// Reference Manual. If a SubtargetFeature enables instructions from multiple
25*bdd1243dSDimitry Andric// Arm Architecture Features, it should list all the relevant features. Not all
26*bdd1243dSDimitry Andric// FEAT_ features have a corresponding SubtargetFeature.
27*bdd1243dSDimitry Andric
280b57cec5SDimitry Andricdef FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
29*bdd1243dSDimitry Andric                                       "Enable ARMv8 FP (FEAT_FP)">;
300b57cec5SDimitry Andric
310b57cec5SDimitry Andricdef FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
32*bdd1243dSDimitry Andric  "Enable Advanced SIMD instructions (FEAT_AdvSIMD)", [FeatureFPARMv8]>;
330b57cec5SDimitry Andric
340b57cec5SDimitry Andricdef FeatureSM4 : SubtargetFeature<
350b57cec5SDimitry Andric    "sm4", "HasSM4", "true",
36*bdd1243dSDimitry Andric    "Enable SM3 and SM4 support (FEAT_SM4, FEAT_SM3)", [FeatureNEON]>;
370b57cec5SDimitry Andric
380b57cec5SDimitry Andricdef FeatureSHA2 : SubtargetFeature<
390b57cec5SDimitry Andric    "sha2", "HasSHA2", "true",
40*bdd1243dSDimitry Andric    "Enable SHA1 and SHA256 support (FEAT_SHA1, FEAT_SHA256)", [FeatureNEON]>;
410b57cec5SDimitry Andric
420b57cec5SDimitry Andricdef FeatureSHA3 : SubtargetFeature<
430b57cec5SDimitry Andric    "sha3", "HasSHA3", "true",
44*bdd1243dSDimitry Andric    "Enable SHA512 and SHA3 support (FEAT_SHA3, FEAT_SHA512)", [FeatureNEON, FeatureSHA2]>;
450b57cec5SDimitry Andric
460b57cec5SDimitry Andricdef FeatureAES : SubtargetFeature<
470b57cec5SDimitry Andric    "aes", "HasAES", "true",
48*bdd1243dSDimitry Andric    "Enable AES support (FEAT_AES, FEAT_PMULL)", [FeatureNEON]>;
490b57cec5SDimitry Andric
500b57cec5SDimitry Andric// Crypto has been split up and any combination is now valid (see the
515ffd83dbSDimitry Andric// crypto definitions above). Also, crypto is now context sensitive:
520b57cec5SDimitry Andric// it has a different meaning for e.g. Armv8.4 than it has for Armv8.2.
530b57cec5SDimitry Andric// Therefore, we rely on Clang, the user interacing tool, to pass on the
540b57cec5SDimitry Andric// appropriate crypto options. But here in the backend, crypto has very little
555ffd83dbSDimitry Andric// meaning anymore. We kept the Crypto definition here for backward
560b57cec5SDimitry Andric// compatibility, and now imply features SHA2 and AES, which was the
570b57cec5SDimitry Andric// "traditional" meaning of Crypto.
580b57cec5SDimitry Andricdef FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
590b57cec5SDimitry Andric  "Enable cryptographic instructions", [FeatureNEON, FeatureSHA2, FeatureAES]>;
600b57cec5SDimitry Andric
610b57cec5SDimitry Andricdef FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
62*bdd1243dSDimitry Andric  "Enable ARMv8 CRC-32 checksum instructions (FEAT_CRC32)">;
630b57cec5SDimitry Andric
640b57cec5SDimitry Andricdef FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
65*bdd1243dSDimitry Andric  "Enable ARMv8 Reliability, Availability and Serviceability Extensions (FEAT_RAS, FEAT_RASv1p1)">;
66*bdd1243dSDimitry Andric
67*bdd1243dSDimitry Andricdef FeatureRASv2 : SubtargetFeature<"rasv2", "HasRASv2", "true",
68*bdd1243dSDimitry Andric  "Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions (FEAT_RASv2)",
69*bdd1243dSDimitry Andric  [FeatureRAS]>;
700b57cec5SDimitry Andric
710b57cec5SDimitry Andricdef FeatureLSE : SubtargetFeature<"lse", "HasLSE", "true",
72*bdd1243dSDimitry Andric  "Enable ARMv8.1 Large System Extension (LSE) atomic instructions (FEAT_LSE)">;
730b57cec5SDimitry Andric
74349cc55cSDimitry Andricdef FeatureLSE2 : SubtargetFeature<"lse2", "HasLSE2", "true",
75*bdd1243dSDimitry Andric  "Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules (FEAT_LSE2)">;
7681ad6265SDimitry Andric
77e8d8bef9SDimitry Andricdef FeatureOutlineAtomics : SubtargetFeature<"outline-atomics", "OutlineAtomics", "true",
78e8d8bef9SDimitry Andric  "Enable out of line atomics to support LSE instructions">;
79e8d8bef9SDimitry Andric
80*bdd1243dSDimitry Andricdef FeatureFMV : SubtargetFeature<"fmv", "HasFMV", "true",
81*bdd1243dSDimitry Andric  "Enable Function Multi Versioning support.">;
82*bdd1243dSDimitry Andric
830b57cec5SDimitry Andricdef FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
84*bdd1243dSDimitry Andric  "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions (FEAT_RDM)">;
850b57cec5SDimitry Andric
860b57cec5SDimitry Andricdef FeaturePAN : SubtargetFeature<
870b57cec5SDimitry Andric    "pan", "HasPAN", "true",
88*bdd1243dSDimitry Andric    "Enables ARM v8.1 Privileged Access-Never extension (FEAT_PAN)">;
890b57cec5SDimitry Andric
900b57cec5SDimitry Andricdef FeatureLOR : SubtargetFeature<
910b57cec5SDimitry Andric    "lor", "HasLOR", "true",
92*bdd1243dSDimitry Andric    "Enables ARM v8.1 Limited Ordering Regions extension (FEAT_LOR)">;
930b57cec5SDimitry Andric
94e8d8bef9SDimitry Andricdef FeatureCONTEXTIDREL2 : SubtargetFeature<"CONTEXTIDREL2", "HasCONTEXTIDREL2",
95e8d8bef9SDimitry Andric    "true", "Enable RW operand CONTEXTIDR_EL2" >;
96e8d8bef9SDimitry Andric
97e8d8bef9SDimitry Andricdef FeatureVH : SubtargetFeature<"vh", "HasVH", "true",
98*bdd1243dSDimitry Andric    "Enables ARM v8.1 Virtual Host extension (FEAT_VHE)", [FeatureCONTEXTIDREL2] >;
990b57cec5SDimitry Andric
100*bdd1243dSDimitry Andric// This SubtargetFeature is special. It controls only whether codegen will turn
101*bdd1243dSDimitry Andric// `llvm.readcyclecounter()` into an access to a PMUv3 System Register. The
102*bdd1243dSDimitry Andric// `FEAT_PMUv3*` system registers are always available for assembly/disassembly.
1030b57cec5SDimitry Andricdef FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
104*bdd1243dSDimitry Andric  "Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension (FEAT_PMUv3)">;
1050b57cec5SDimitry Andric
1060b57cec5SDimitry Andricdef FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
107*bdd1243dSDimitry Andric  "Full FP16 (FEAT_FP16)", [FeatureFPARMv8]>;
1080b57cec5SDimitry Andric
1090b57cec5SDimitry Andricdef FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
110*bdd1243dSDimitry Andric  "Enable FP16 FML instructions (FEAT_FHM)", [FeatureFullFP16]>;
1110b57cec5SDimitry Andric
1120b57cec5SDimitry Andricdef FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
113*bdd1243dSDimitry Andric  "Enable Statistical Profiling extension (FEAT_SPE)">;
1140b57cec5SDimitry Andric
1150b57cec5SDimitry Andricdef FeaturePAN_RWV : SubtargetFeature<
1160b57cec5SDimitry Andric    "pan-rwv", "HasPAN_RWV", "true",
117*bdd1243dSDimitry Andric    "Enable v8.2 PAN s1e1R and s1e1W Variants (FEAT_PAN2)",
1180b57cec5SDimitry Andric    [FeaturePAN]>;
1190b57cec5SDimitry Andric
1200b57cec5SDimitry Andric// UAO PState
1210b57cec5SDimitry Andricdef FeaturePsUAO : SubtargetFeature< "uaops", "HasPsUAO", "true",
122*bdd1243dSDimitry Andric    "Enable v8.2 UAO PState (FEAT_UAO)">;
1230b57cec5SDimitry Andric
1240b57cec5SDimitry Andricdef FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
125*bdd1243dSDimitry Andric    "true", "Enable v8.2 data Cache Clean to Point of Persistence (FEAT_DPB)" >;
1260b57cec5SDimitry Andric
1270b57cec5SDimitry Andricdef FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
128*bdd1243dSDimitry Andric  "Enable Scalable Vector Extension (SVE) instructions (FEAT_SVE)", [FeatureFullFP16]>;
1295ffd83dbSDimitry Andric
1305ffd83dbSDimitry Andric// This flag is currently still labeled as Experimental, but when fully
1315ffd83dbSDimitry Andric// implemented this should tell the compiler to use the zeroing pseudos to
1325ffd83dbSDimitry Andric// benefit from the reverse instructions (e.g. SUB vs SUBR) if the inactive
1335ffd83dbSDimitry Andric// lanes are known to be zero. The pseudos will then be expanded using the
1345ffd83dbSDimitry Andric// MOVPRFX instruction to zero the inactive lanes. This feature should only be
1355ffd83dbSDimitry Andric// enabled if MOVPRFX instructions are known to merge with the destructive
1365ffd83dbSDimitry Andric// operations they prefix.
1375ffd83dbSDimitry Andric//
1385ffd83dbSDimitry Andric// This feature could similarly be extended to support cheap merging of _any_
1395ffd83dbSDimitry Andric// value into the inactive lanes using the MOVPRFX instruction that uses
1405ffd83dbSDimitry Andric// merging-predication.
1415ffd83dbSDimitry Andricdef FeatureExperimentalZeroingPseudos
1425ffd83dbSDimitry Andric    : SubtargetFeature<"use-experimental-zeroing-pseudos",
1435ffd83dbSDimitry Andric                       "UseExperimentalZeroingPseudos", "true",
1445ffd83dbSDimitry Andric                       "Hint to the compiler that the MOVPRFX instruction is "
1455ffd83dbSDimitry Andric                       "merged with destructive operations",
1465ffd83dbSDimitry Andric                       []>;
1470b57cec5SDimitry Andric
148349cc55cSDimitry Andricdef FeatureUseScalarIncVL : SubtargetFeature<"use-scalar-inc-vl",
149349cc55cSDimitry Andric  "UseScalarIncVL", "true", "Prefer inc/dec over add+cnt">;
150349cc55cSDimitry Andric
1510b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
152*bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions (FEAT_SVE2)",
153349cc55cSDimitry Andric  [FeatureSVE, FeatureUseScalarIncVL]>;
1540b57cec5SDimitry Andric
1550b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
156*bdd1243dSDimitry Andric  "Enable AES SVE2 instructions (FEAT_SVE_AES, FEAT_SVE_PMULL128)",
157*bdd1243dSDimitry Andric  [FeatureSVE2, FeatureAES]>;
1580b57cec5SDimitry Andric
1590b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
160*bdd1243dSDimitry Andric  "Enable SM4 SVE2 instructions (FEAT_SVE_SM4)", [FeatureSVE2, FeatureSM4]>;
1610b57cec5SDimitry Andric
1620b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
163*bdd1243dSDimitry Andric  "Enable SHA3 SVE2 instructions (FEAT_SVE_SHA3)", [FeatureSVE2, FeatureSHA3]>;
1640b57cec5SDimitry Andric
1650b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
166*bdd1243dSDimitry Andric  "Enable bit permutation SVE2 instructions (FEAT_SVE_BitPerm)", [FeatureSVE2]>;
167*bdd1243dSDimitry Andric
168*bdd1243dSDimitry Andricdef FeatureSVE2p1: SubtargetFeature<"sve2p1", "HasSVE2p1", "true",
169*bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2.1 instructions", [FeatureSVE2]>;
170*bdd1243dSDimitry Andric
171*bdd1243dSDimitry Andricdef FeatureB16B16 : SubtargetFeature<"b16b16", "HasB16B16", "true",
172*bdd1243dSDimitry Andric  "Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions (FEAT_B16B16)", []>;
1730b57cec5SDimitry Andric
1740b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
1750b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
1768bcb0991SDimitry Andric
1770b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
1780b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
1790b57cec5SDimitry Andric
18081ad6265SDimitry Andric// It is generally beneficial to rewrite "fmov s0, wzr" to "movi d0, #0".
18181ad6265SDimitry Andric// as movi is more efficient across all cores. Newer cores can eliminate
18281ad6265SDimitry Andric// fmovs early and there is no difference with movi, but this not true for
18381ad6265SDimitry Andric// all implementations.
184fe6060f1SDimitry Andricdef FeatureNoZCZeroingFP : SubtargetFeature<"no-zcz-fp", "HasZeroCycleZeroingFP", "false",
185fe6060f1SDimitry Andric                                        "Has no zero-cycle zeroing instructions for FP registers">;
1860b57cec5SDimitry Andric
1870b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
1880b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
189fe6060f1SDimitry Andric                                        [FeatureZCZeroingGP]>;
1900b57cec5SDimitry Andric
1910b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
1920b57cec5SDimitry Andric/// CPUs.
1930b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
1940b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
1950b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
1960b57cec5SDimitry Andric
1970b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
19881ad6265SDimitry Andric                                          "RequiresStrictAlign", "true",
1990b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
2000b57cec5SDimitry Andric                                          "access">;
2010b57cec5SDimitry Andric
2025ffd83dbSDimitry Andricforeach i = {1-7,9-15,18,20-28,30} in
2030b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
2040b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
2050b57cec5SDimitry Andric                                             "as a GPR">;
2060b57cec5SDimitry Andric
2070b57cec5SDimitry Andricforeach i = {8-15,18} in
2080b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
2090b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
2100b57cec5SDimitry Andric
2110b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
2120b57cec5SDimitry Andric    "true",
2130b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
2140b57cec5SDimitry Andric
2150b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
2160b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
2170b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
2180b57cec5SDimitry Andric
219*bdd1243dSDimitry Andricdef FeatureEnableSelectOptimize : SubtargetFeature<
220*bdd1243dSDimitry Andric    "enable-select-opt", "EnableSelectOptimize", "true",
221*bdd1243dSDimitry Andric    "Enable the select optimize pass for select loop heuristics">;
222*bdd1243dSDimitry Andric
2230b57cec5SDimitry Andricdef FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
22481ad6265SDimitry Andric    "HasCustomCheapAsMoveHandling", "true",
2250b57cec5SDimitry Andric    "Use custom handling of cheap instructions">;
2260b57cec5SDimitry Andric
2270b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
22881ad6265SDimitry Andric    "HasExynosCheapAsMoveHandling", "true",
2290b57cec5SDimitry Andric    "Use Exynos specific handling of cheap instructions",
2300b57cec5SDimitry Andric    [FeatureCustomCheapAsMoveHandling]>;
2310b57cec5SDimitry Andric
2320b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
2330b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
2340b57cec5SDimitry Andric
2350b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
23681ad6265SDimitry Andric    "IsMisaligned128StoreSlow", "true", "Misaligned 128 bit stores are slow">;
2370b57cec5SDimitry Andric
2380b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
23981ad6265SDimitry Andric    "IsPaired128Slow", "true", "Paired 128 bit loads and stores are slow">;
2400b57cec5SDimitry Andric
24181ad6265SDimitry Andricdef FeatureAscendStoreAddress : SubtargetFeature<"ascend-store-address",
242fcaf7f86SDimitry Andric    "IsStoreAddressAscend", "true",
24381ad6265SDimitry Andric    "Schedule vector stores by ascending address">;
24481ad6265SDimitry Andric
24581ad6265SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "IsSTRQroSlow",
2460b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
2470b57cec5SDimitry Andric
2480b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
2490b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
2500b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
2510b57cec5SDimitry Andric
2520b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
2530b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
2540b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
2550b57cec5SDimitry Andric
2560b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
2570b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
2580b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
2590b57cec5SDimitry Andric
260e8d8bef9SDimitry Andricdef FeatureCmpBccFusion : SubtargetFeature<
261e8d8bef9SDimitry Andric    "cmp-bcc-fusion", "HasCmpBccFusion", "true",
262e8d8bef9SDimitry Andric    "CPU fuses cmp+bcc operations">;
263e8d8bef9SDimitry Andric
2640b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
2650b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
2660b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
2670b57cec5SDimitry Andric
2680b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
2690b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
2700b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
2710b57cec5SDimitry Andric
2720b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
2730b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
2740b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
2750b57cec5SDimitry Andric
2760b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
2770b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
2780b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
2790b57cec5SDimitry Andric
2800b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
2810b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
2820b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
2830b57cec5SDimitry Andric
28481ad6265SDimitry Andricdef FeatureFuseAdrpAdd : SubtargetFeature<
28581ad6265SDimitry Andric    "fuse-adrp-add", "HasFuseAdrpAdd", "true",
28681ad6265SDimitry Andric    "CPU fuses adrp+add operations">;
28781ad6265SDimitry Andric
2880b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
2890b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
2900b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
2910b57cec5SDimitry Andric
2920b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
2930b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
2940b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
2950b57cec5SDimitry Andric
2960b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
2970b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
2980b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
2990b57cec5SDimitry Andric
3000b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
301*bdd1243dSDimitry Andric                                   "Enable support for RCPC extension (FEAT_LRCPC)">;
3020b57cec5SDimitry Andric
3030b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
3040b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
3050b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
3060b57cec5SDimitry Andric
3070b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
3080b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
309*bdd1243dSDimitry Andric    "Enable dot product support (FEAT_DotProd)">;
3100b57cec5SDimitry Andric
311e8d8bef9SDimitry Andricdef FeaturePAuth : SubtargetFeature<
312e8d8bef9SDimitry Andric    "pauth", "HasPAuth", "true",
313*bdd1243dSDimitry Andric    "Enable v8.3-A Pointer Authentication extension (FEAT_PAuth)">;
3140b57cec5SDimitry Andric
3150b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
3160b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
317*bdd1243dSDimitry Andric    "Enable v8.3-A JavaScript FP conversion instructions (FEAT_JSCVT)",
3180b57cec5SDimitry Andric    [FeatureFPARMv8]>;
3190b57cec5SDimitry Andric
3200b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
3210b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
322*bdd1243dSDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets (FEAT_CCIDX)">;
3230b57cec5SDimitry Andric
3240b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
3250b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
326*bdd1243dSDimitry Andric    "Enable v8.3-A Floating-point complex number support (FEAT_FCMA)",
3270b57cec5SDimitry Andric    [FeatureNEON]>;
3280b57cec5SDimitry Andric
3290b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
3300b57cec5SDimitry Andric    "nv", "HasNV", "true",
331*bdd1243dSDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement (FEAT_NV, FEAT_NV2)">;
3320b57cec5SDimitry Andric
3330b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
3340b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
335*bdd1243dSDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension (FEAT_MPAM)">;
3360b57cec5SDimitry Andric
3370b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
3380b57cec5SDimitry Andric    "dit", "HasDIT", "true",
339*bdd1243dSDimitry Andric    "Enable v8.4-A Data Independent Timing instructions (FEAT_DIT)">;
3400b57cec5SDimitry Andric
3410b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
3420b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
343*bdd1243dSDimitry Andric    "Enable v8.4-A Trace extension (FEAT_TRF)">;
3440b57cec5SDimitry Andric
3450b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
3460b57cec5SDimitry Andric    "am", "HasAM", "true",
347*bdd1243dSDimitry Andric    "Enable v8.4-A Activity Monitors extension (FEAT_AMUv1)">;
3480b57cec5SDimitry Andric
3495ffd83dbSDimitry Andricdef FeatureAMVS : SubtargetFeature<
3505ffd83dbSDimitry Andric    "amvs", "HasAMVS", "true",
351*bdd1243dSDimitry Andric    "Enable v8.6-A Activity Monitors Virtualization support (FEAT_AMUv1p1)",
3525ffd83dbSDimitry Andric    [FeatureAM]>;
3535ffd83dbSDimitry Andric
3540b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
3550b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
356*bdd1243dSDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension (FEAT_SEL2)">;
3570b57cec5SDimitry Andric
3580b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
3590b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
360*bdd1243dSDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions (FEAT_TLBIOS, FEAT_TLBIRANGE)">;
3610b57cec5SDimitry Andric
362e8d8bef9SDimitry Andricdef FeatureFlagM : SubtargetFeature<
363e8d8bef9SDimitry Andric    "flagm", "HasFlagM", "true",
364*bdd1243dSDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions (FEAT_FlagM)">;
3650b57cec5SDimitry Andric
3660b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3670b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
368*bdd1243dSDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets (FEAT_LRCPC2)",
3690b57cec5SDimitry Andric    [FeatureRCPC]>;
3700b57cec5SDimitry Andric
3710b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3720b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3730b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3740b57cec5SDimitry Andric                                        "to their negated or complemented "
3750b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3760b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3770b57cec5SDimitry Andric
3780b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
3790b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
3800b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
3810b57cec5SDimitry Andric
3820b57cec5SDimitry Andricdef FeatureAggressiveFMA :
3830b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
3840b57cec5SDimitry Andric                   "HasAggressiveFMA",
3850b57cec5SDimitry Andric                   "true",
3860b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
3870b57cec5SDimitry Andric
3880b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
389*bdd1243dSDimitry Andric  "Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)">;
3900b57cec5SDimitry Andric
3910b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
3920b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
393*bdd1243dSDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int (FEAT_FRINTTS)" >;
3940b57cec5SDimitry Andric
3950b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
396*bdd1243dSDimitry Andric  "true", "Enable architectural speculation restriction (FEAT_CSV2_2)">;
3970b57cec5SDimitry Andric
3980b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
399*bdd1243dSDimitry Andric  "true", "Enable v8.5 Speculation Barrier (FEAT_SB)" >;
4000b57cec5SDimitry Andric
4010b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
402*bdd1243dSDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit (FEAT_SSBS, FEAT_SSBS2)" >;
4030b57cec5SDimitry Andric
4040b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
405*bdd1243dSDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions (FEAT_SPECRES)" >;
4060b57cec5SDimitry Andric
4070b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
408*bdd1243dSDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)" >;
4090b57cec5SDimitry Andric
4100b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
411*bdd1243dSDimitry Andric    "true", "Enable Branch Target Identification (FEAT_BTI)" >;
4120b57cec5SDimitry Andric
4130b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
414*bdd1243dSDimitry Andric    "true", "Enable Random Number generation instructions (FEAT_RNG)" >;
4150b57cec5SDimitry Andric
4160b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
417*bdd1243dSDimitry Andric    "true", "Enable Memory Tagging Extension (FEAT_MTE, FEAT_MTE2)" >;
4180b57cec5SDimitry Andric
4198bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
420*bdd1243dSDimitry Andric    "true", "Enable Trace Buffer Extension (FEAT_TRBE)">;
4218bcb0991SDimitry Andric
4228bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
423*bdd1243dSDimitry Andric    "true", "Enable Embedded Trace Extension (FEAT_ETE)",
4248bcb0991SDimitry Andric    [FeatureTRBE]>;
4258bcb0991SDimitry Andric
4268bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
427*bdd1243dSDimitry Andric    "true", "Enable Transactional Memory Extension (FEAT_TME)" >;
4288bcb0991SDimitry Andric
4298bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
4308bcb0991SDimitry Andric    "AllowTaggedGlobals",
4318bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
4328bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
4338bcb0991SDimitry Andric
4345ffd83dbSDimitry Andricdef FeatureBF16 : SubtargetFeature<"bf16", "HasBF16",
435*bdd1243dSDimitry Andric    "true", "Enable BFloat16 Extension (FEAT_BF16)" >;
4365ffd83dbSDimitry Andric
4375ffd83dbSDimitry Andricdef FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
438*bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply Int8 Extension (FEAT_I8MM)">;
4395ffd83dbSDimitry Andric
4405ffd83dbSDimitry Andricdef FeatureMatMulFP32 : SubtargetFeature<"f32mm", "HasMatMulFP32",
441*bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP32 Extension (FEAT_F32MM)", [FeatureSVE]>;
4425ffd83dbSDimitry Andric
4435ffd83dbSDimitry Andricdef FeatureMatMulFP64 : SubtargetFeature<"f64mm", "HasMatMulFP64",
444*bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP64 Extension (FEAT_F64MM)", [FeatureSVE]>;
4455ffd83dbSDimitry Andric
446e8d8bef9SDimitry Andricdef FeatureXS : SubtargetFeature<"xs", "HasXS",
447*bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A limited-TLB-maintenance instruction (FEAT_XS)">;
448e8d8bef9SDimitry Andric
449e8d8bef9SDimitry Andricdef FeatureWFxT : SubtargetFeature<"wfxt", "HasWFxT",
450*bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A WFET and WFIT instruction (FEAT_WFxT)">;
451e8d8bef9SDimitry Andric
452e8d8bef9SDimitry Andricdef FeatureHCX : SubtargetFeature<
453*bdd1243dSDimitry Andric    "hcx", "HasHCX", "true", "Enable Armv8.7-A HCRX_EL2 system register (FEAT_HCX)">;
454e8d8bef9SDimitry Andric
455e8d8bef9SDimitry Andricdef FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
456*bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A LD64B/ST64B Accelerator Extension (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)">;
457e8d8bef9SDimitry Andric
45804eeddc0SDimitry Andricdef FeatureHBC : SubtargetFeature<"hbc", "HasHBC",
459*bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Hinted Conditional Branches Extension (FEAT_HBC)">;
46004eeddc0SDimitry Andric
46104eeddc0SDimitry Andricdef FeatureMOPS : SubtargetFeature<"mops", "HasMOPS",
462*bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A memcpy and memset acceleration instructions (FEAT_MOPS)">;
463*bdd1243dSDimitry Andric
464*bdd1243dSDimitry Andricdef FeatureNMI : SubtargetFeature<"nmi", "HasNMI",
465*bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Non-maskable Interrupts (FEAT_NMI, FEAT_GICv3_NMI)">;
46604eeddc0SDimitry Andric
467e8d8bef9SDimitry Andricdef FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
468*bdd1243dSDimitry Andric    "true", "Enable Branch Record Buffer Extension (FEAT_BRBE)">;
469e8d8bef9SDimitry Andric
470e8d8bef9SDimitry Andricdef FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
471*bdd1243dSDimitry Andric    "true", "Enable extra register in the Statistical Profiling Extension (FEAT_SPEv1p2)">;
472e8d8bef9SDimitry Andric
4735ffd83dbSDimitry Andricdef FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
474*bdd1243dSDimitry Andric    "true", "Enable fine grained virtualization traps extension (FEAT_FGT)">;
4755ffd83dbSDimitry Andric
4765ffd83dbSDimitry Andricdef FeatureEnhancedCounterVirtualization :
4775ffd83dbSDimitry Andric      SubtargetFeature<"ecv", "HasEnhancedCounterVirtualization",
478*bdd1243dSDimitry Andric      "true", "Enable enhanced counter virtualization extension (FEAT_ECV)">;
4795ffd83dbSDimitry Andric
480fe6060f1SDimitry Andricdef FeatureRME : SubtargetFeature<"rme", "HasRME",
481*bdd1243dSDimitry Andric    "true", "Enable Realm Management Extension (FEAT_RME)">;
482fe6060f1SDimitry Andric
483fe6060f1SDimitry Andricdef FeatureSME : SubtargetFeature<"sme", "HasSME", "true",
484*bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) (FEAT_SME)", [FeatureBF16, FeatureUseScalarIncVL]>;
485fe6060f1SDimitry Andric
486*bdd1243dSDimitry Andricdef FeatureSMEF64F64 : SubtargetFeature<"sme-f64f64", "HasSMEF64F64", "true",
487*bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) F64F64 instructions (FEAT_SME_F64F64)", [FeatureSME]>;
488fe6060f1SDimitry Andric
489*bdd1243dSDimitry Andricdef FeatureSMEI16I64 : SubtargetFeature<"sme-i16i64", "HasSMEI16I64", "true",
490*bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) I16I64 instructions (FEAT_SME_I16I64)", [FeatureSME]>;
491*bdd1243dSDimitry Andric
492*bdd1243dSDimitry Andricdef FeatureSMEF16F16 : SubtargetFeature<"sme-f16f16", "HasSMEF16F16", "true",
493*bdd1243dSDimitry Andric  "Enable SME2.1 non-widening Float16 instructions (FEAT_SME_F16F16)", []>;
494*bdd1243dSDimitry Andric
495*bdd1243dSDimitry Andricdef FeatureSME2 : SubtargetFeature<"sme2", "HasSME2", "true",
496*bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2 (SME2) instructions", [FeatureSME]>;
497*bdd1243dSDimitry Andric
498*bdd1243dSDimitry Andricdef FeatureSME2p1 : SubtargetFeature<"sme2p1", "HasSME2p1", "true",
499*bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2.1 (FEAT_SME2p1) instructions", [FeatureSME2]>;
500fe6060f1SDimitry Andric
501349cc55cSDimitry Andricdef FeatureAppleA7SysReg  : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
502349cc55cSDimitry Andric  "Apple A7 (the CPU formerly known as Cyclone)">;
503349cc55cSDimitry Andric
504349cc55cSDimitry Andricdef FeatureEL2VMSA : SubtargetFeature<"el2vmsa", "HasEL2VMSA", "true",
505349cc55cSDimitry Andric  "Enable Exception Level 2 Virtual Memory System Architecture">;
506349cc55cSDimitry Andric
507349cc55cSDimitry Andricdef FeatureEL3 : SubtargetFeature<"el3", "HasEL3", "true",
508349cc55cSDimitry Andric  "Enable Exception Level 3">;
509349cc55cSDimitry Andric
510*bdd1243dSDimitry Andricdef FeatureCSSC : SubtargetFeature<"cssc", "HasCSSC", "true",
511*bdd1243dSDimitry Andric  "Enable Common Short Sequence Compression (CSSC) instructions (FEAT_CSSC)">;
512*bdd1243dSDimitry Andric
5130eae32dcSDimitry Andricdef FeatureFixCortexA53_835769 : SubtargetFeature<"fix-cortex-a53-835769",
5140eae32dcSDimitry Andric  "FixCortexA53_835769", "true", "Mitigate Cortex-A53 Erratum 835769">;
5150eae32dcSDimitry Andric
5163a9a9c0cSDimitry Andricdef FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice",
5173a9a9c0cSDimitry Andric                                                 "NoBTIAtReturnTwice", "true",
5183a9a9c0cSDimitry Andric                                                 "Don't place a BTI instruction "
5193a9a9c0cSDimitry Andric                                                 "after a return-twice">;
5203a9a9c0cSDimitry Andric
521*bdd1243dSDimitry Andricdef FeatureCLRBHB : SubtargetFeature<"clrbhb", "HasCLRBHB",
522*bdd1243dSDimitry Andric    "true", "Enable Clear BHB instruction (FEAT_CLRBHB)">;
523*bdd1243dSDimitry Andric
524*bdd1243dSDimitry Andricdef FeaturePRFM_SLC : SubtargetFeature<"prfm-slc-target", "HasPRFM_SLC",
525*bdd1243dSDimitry Andric    "true", "Enable SLC target for PRFM instruction">;
526*bdd1243dSDimitry Andric
527*bdd1243dSDimitry Andricdef FeatureSPECRES2 : SubtargetFeature<"specres2", "HasSPECRES2",
528*bdd1243dSDimitry Andric    "true", "Enable Speculation Restriction Instruction (FEAT_SPECRES2)",
529*bdd1243dSDimitry Andric    [FeaturePredRes]>;
530*bdd1243dSDimitry Andric
531*bdd1243dSDimitry Andricdef FeatureMEC : SubtargetFeature<"mec", "HasMEC",
532*bdd1243dSDimitry Andric    "true", "Enable Memory Encryption Contexts Extension", [FeatureRME]>;
533*bdd1243dSDimitry Andric
534*bdd1243dSDimitry Andricdef FeatureITE : SubtargetFeature<"ite", "HasITE",
535*bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A Instrumentation Extension FEAT_ITE", [FeatureETE,
536*bdd1243dSDimitry Andric    FeatureTRBE]>;
537*bdd1243dSDimitry Andric
538*bdd1243dSDimitry Andricdef FeatureRCPC3 : SubtargetFeature<"rcpc3", "HasRCPC3",
539*bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set (FEAT_LRCPC3)",
540*bdd1243dSDimitry Andric    [FeatureRCPC_IMMO]>;
541*bdd1243dSDimitry Andric
542*bdd1243dSDimitry Andricdef FeatureTHE : SubtargetFeature<"the", "HasTHE",
543*bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A Translation Hardening Extension (FEAT_THE)">;
544*bdd1243dSDimitry Andric
545*bdd1243dSDimitry Andricdef FeatureLSE128 : SubtargetFeature<"lse128", "HasLSE128",
546*bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Atomic Instructions (FEAT_LSE128)",
547*bdd1243dSDimitry Andric    [FeatureLSE]>;
548*bdd1243dSDimitry Andric
549*bdd1243dSDimitry Andric// FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, and FEAT_SYSINSTR128 are mutually implicit.
550*bdd1243dSDimitry Andric// Therefore group them all under a single feature flag, d128:
551*bdd1243dSDimitry Andricdef FeatureD128 : SubtargetFeature<"d128", "HasD128",
552*bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Page Table Descriptors, System Registers "
553*bdd1243dSDimitry Andric    "and Instructions (FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, FEAT_SYSINSTR128)",
554*bdd1243dSDimitry Andric    [FeatureLSE128]>;
555*bdd1243dSDimitry Andric
5560b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5570b57cec5SDimitry Andric// Architectures.
5580b57cec5SDimitry Andric//
559349cc55cSDimitry Andricdef HasV8_0aOps : SubtargetFeature<"v8a", "HasV8_0aOps", "true",
560349cc55cSDimitry Andric  "Support ARM v8.0a instructions", [FeatureEL2VMSA, FeatureEL3]>;
5610b57cec5SDimitry Andric
5620b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
563349cc55cSDimitry Andric  "Support ARM v8.1a instructions", [HasV8_0aOps, FeatureCRC, FeatureLSE,
564349cc55cSDimitry Andric  FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH]>;
5650b57cec5SDimitry Andric
5660b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
5670b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
5680b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
5690b57cec5SDimitry Andric
5700b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
571e8d8bef9SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePAuth,
5720b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
5730b57cec5SDimitry Andric
5740b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
5750b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
576e8d8bef9SDimitry Andric  FeatureNV, FeatureMPAM, FeatureDIT,
577349cc55cSDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
578349cc55cSDimitry Andric  FeatureFlagM, FeatureRCPC_IMMO, FeatureLSE2]>;
5790b57cec5SDimitry Andric
5800b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
5810b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
5820b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
5830b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
5845ffd83dbSDimitry Andric   FeatureBranchTargetId]>;
5855ffd83dbSDimitry Andric
5865ffd83dbSDimitry Andricdef HasV8_6aOps : SubtargetFeature<
5875ffd83dbSDimitry Andric  "v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions",
5885ffd83dbSDimitry Andric  [HasV8_5aOps, FeatureAMVS, FeatureBF16, FeatureFineGrainedTraps,
5895ffd83dbSDimitry Andric   FeatureEnhancedCounterVirtualization, FeatureMatMulInt8]>;
5900b57cec5SDimitry Andric
591e8d8bef9SDimitry Andricdef HasV8_7aOps : SubtargetFeature<
592e8d8bef9SDimitry Andric  "v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions",
593e8d8bef9SDimitry Andric  [HasV8_6aOps, FeatureXS, FeatureWFxT, FeatureHCX]>;
594e8d8bef9SDimitry Andric
59504eeddc0SDimitry Andricdef HasV8_8aOps : SubtargetFeature<
59604eeddc0SDimitry Andric  "v8.8a", "HasV8_8aOps", "true", "Support ARM v8.8a instructions",
597*bdd1243dSDimitry Andric  [HasV8_7aOps, FeatureHBC, FeatureMOPS, FeatureNMI]>;
598*bdd1243dSDimitry Andric
599*bdd1243dSDimitry Andricdef HasV8_9aOps : SubtargetFeature<
600*bdd1243dSDimitry Andric  "v8.9a", "HasV8_9aOps", "true", "Support ARM v8.9a instructions",
601*bdd1243dSDimitry Andric  [HasV8_8aOps, FeatureCLRBHB, FeaturePRFM_SLC, FeatureSPECRES2,
602*bdd1243dSDimitry Andric   FeatureCSSC, FeatureRASv2]>;
60304eeddc0SDimitry Andric
604349cc55cSDimitry Andricdef HasV9_0aOps : SubtargetFeature<
605349cc55cSDimitry Andric  "v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions",
606*bdd1243dSDimitry Andric  [HasV8_5aOps, FeatureMEC, FeatureSVE2]>;
607349cc55cSDimitry Andric
608349cc55cSDimitry Andricdef HasV9_1aOps : SubtargetFeature<
609349cc55cSDimitry Andric  "v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions",
610349cc55cSDimitry Andric  [HasV8_6aOps, HasV9_0aOps]>;
611349cc55cSDimitry Andric
612349cc55cSDimitry Andricdef HasV9_2aOps : SubtargetFeature<
613349cc55cSDimitry Andric  "v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions",
614349cc55cSDimitry Andric  [HasV8_7aOps, HasV9_1aOps]>;
615349cc55cSDimitry Andric
61604eeddc0SDimitry Andricdef HasV9_3aOps : SubtargetFeature<
61704eeddc0SDimitry Andric  "v9.3a", "HasV9_3aOps", "true", "Support ARM v9.3a instructions",
61804eeddc0SDimitry Andric  [HasV8_8aOps, HasV9_2aOps]>;
61904eeddc0SDimitry Andric
620*bdd1243dSDimitry Andricdef HasV9_4aOps : SubtargetFeature<
621*bdd1243dSDimitry Andric  "v9.4a", "HasV9_4aOps", "true", "Support ARM v9.4a instructions",
622*bdd1243dSDimitry Andric  [HasV8_9aOps, HasV9_3aOps]>;
623*bdd1243dSDimitry Andric
624e8d8bef9SDimitry Andricdef HasV8_0rOps : SubtargetFeature<
625e8d8bef9SDimitry Andric  "v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
626e8d8bef9SDimitry Andric  [//v8.1
627e8d8bef9SDimitry Andric  FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
628e8d8bef9SDimitry Andric  //v8.2
62904eeddc0SDimitry Andric  FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
630e8d8bef9SDimitry Andric  //v8.3
631e8d8bef9SDimitry Andric  FeatureComplxNum, FeatureCCIDX, FeatureJS,
632e8d8bef9SDimitry Andric  FeaturePAuth, FeatureRCPC,
633e8d8bef9SDimitry Andric  //v8.4
63404eeddc0SDimitry Andric  FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
63581ad6265SDimitry Andric  FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO,
63681ad6265SDimitry Andric  // Not mandatory in v8.0-R, but included here on the grounds that it
63781ad6265SDimitry Andric  // only enables names of system registers
63881ad6265SDimitry Andric  FeatureSpecRestrict
63981ad6265SDimitry Andric  ]>;
64081ad6265SDimitry Andric
64181ad6265SDimitry Andric// Only intended to be used by disassemblers.
64281ad6265SDimitry Andricdef FeatureAll
64381ad6265SDimitry Andric    : SubtargetFeature<"all", "IsAll", "true", "Enable all instructions", []>;
64481ad6265SDimitry Andric
64581ad6265SDimitry Andricclass AssemblerPredicateWithAll<dag cond, string name="">
64681ad6265SDimitry Andric    : AssemblerPredicate<(any_of FeatureAll, cond), name>;
647e8d8bef9SDimitry Andric
6480b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6490b57cec5SDimitry Andric// Register File Description
6500b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6510b57cec5SDimitry Andric
6520b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
6530b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
6540b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
6550b57cec5SDimitry Andric
6560b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6570b57cec5SDimitry Andric// Instruction Descriptions
6580b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6590b57cec5SDimitry Andric
6600b57cec5SDimitry Andricinclude "AArch64Schedule.td"
6610b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
6620b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
6630b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
6642a66634dSDimitry Andricinclude "AArch64SchedPredAmpere.td"
6658bcb0991SDimitry Andricinclude "AArch64Combine.td"
6660b57cec5SDimitry Andric
6670b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
6680b57cec5SDimitry Andric
6690b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6700b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
6710b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6720b57cec5SDimitry Andric
6730b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
6740b57cec5SDimitry Andric
6750b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6760b57cec5SDimitry Andric// Access to privileged registers
6770b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6780b57cec5SDimitry Andric
6790b57cec5SDimitry Andricforeach i = 1-3 in
6800b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
6810b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
6820b57cec5SDimitry Andric
6830b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6845ffd83dbSDimitry Andric// Control codegen mitigation against Straight Line Speculation vulnerability.
6855ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
6865ffd83dbSDimitry Andric
6875ffd83dbSDimitry Andricdef FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
6885ffd83dbSDimitry Andric  "HardenSlsRetBr", "true",
6895ffd83dbSDimitry Andric  "Harden against straight line speculation across RET and BR instructions">;
6905ffd83dbSDimitry Andricdef FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
6915ffd83dbSDimitry Andric  "HardenSlsBlr", "true",
6925ffd83dbSDimitry Andric  "Harden against straight line speculation across BLR instructions">;
693fe6060f1SDimitry Andricdef FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
694fe6060f1SDimitry Andric  "HardenSlsNoComdat", "true",
695fe6060f1SDimitry Andric  "Generate thunk code for SLS mitigation in the normal text section">;
6965ffd83dbSDimitry Andric
6975ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
6980b57cec5SDimitry Andric// AArch64 Processors supported.
6990b57cec5SDimitry Andric//
7000b57cec5SDimitry Andric
7010b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7020b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
7030b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7040b57cec5SDimitry Andric
7050b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
7060b57cec5SDimitry Andric
7070b57cec5SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
7080b57cec5SDimitry Andric  let F = [HasSVE, HasSVE2, HasSVE2AES, HasSVE2SM4, HasSVE2SHA3,
709*bdd1243dSDimitry Andric           HasSVE2BitPerm, HasSVEorSME, HasSVE2p1, HasSVE2orSME, HasSVE2p1_or_HasSME2p1];
7100b57cec5SDimitry Andric}
7110b57cec5SDimitry Andric
712e837bb5cSDimitry Andricdef PAUnsupported : AArch64Unsupported {
713e8d8bef9SDimitry Andric  let F = [HasPAuth];
714e837bb5cSDimitry Andric}
715e837bb5cSDimitry Andric
716fe6060f1SDimitry Andricdef SMEUnsupported : AArch64Unsupported {
717*bdd1243dSDimitry Andric  let F = [HasSME, HasSMEF64F64, HasSMEI16I64, HasSME2, HasSVE2p1_or_HasSME2,
718*bdd1243dSDimitry Andric           HasSVE2p1_or_HasSME2p1, HasSME2p1, HasSMEF16F16];
719fe6060f1SDimitry Andric}
720fe6060f1SDimitry Andric
7210b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
722e8d8bef9SDimitry Andricinclude "AArch64SchedA55.td"
7230b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
7240b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
7250b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
7260b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
7270b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
7280b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
729480093f4SDimitry Andricinclude "AArch64SchedExynosM5.td"
7300b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
7310b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
732e8d8bef9SDimitry Andricinclude "AArch64SchedA64FX.td"
733e837bb5cSDimitry Andricinclude "AArch64SchedThunderX3T110.td"
734e8d8bef9SDimitry Andricinclude "AArch64SchedTSV110.td"
7352a66634dSDimitry Andricinclude "AArch64SchedAmpere1.td"
736753f127fSDimitry Andricinclude "AArch64SchedNeoverseN2.td"
7370b57cec5SDimitry Andric
738349cc55cSDimitry Andricdef TuneA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
739349cc55cSDimitry Andric                                "Cortex-A35 ARM processors">;
7400b57cec5SDimitry Andric
741349cc55cSDimitry Andricdef TuneA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
7420b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
7430b57cec5SDimitry Andric                                   FeatureFuseAES,
744*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
745349cc55cSDimitry Andric                                   FeatureBalanceFPOps,
746349cc55cSDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
747349cc55cSDimitry Andric                                   FeaturePostRAScheduler]>;
7480b57cec5SDimitry Andric
749349cc55cSDimitry Andricdef TuneA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
7500b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
7510b57cec5SDimitry Andric                                   FeatureFuseAES,
752*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
753fe6060f1SDimitry Andric                                   FeaturePostRAScheduler,
754349cc55cSDimitry Andric                                   FeatureFuseAddress]>;
755349cc55cSDimitry Andric
756349cc55cSDimitry Andricdef TuneA510    : SubtargetFeature<"a510", "ARMProcFamily", "CortexA510",
757349cc55cSDimitry Andric                                   "Cortex-A510 ARM processors", [
758349cc55cSDimitry Andric                                   FeatureFuseAES,
759*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
760349cc55cSDimitry Andric                                   FeaturePostRAScheduler
7610b57cec5SDimitry Andric                                   ]>;
7620b57cec5SDimitry Andric
763349cc55cSDimitry Andricdef TuneA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
7640b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
765349cc55cSDimitry Andric                                   FeatureFuseAES,
7660b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
7670b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
76881ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
7690b57cec5SDimitry Andric                                   FeatureFuseLiterals,
7700b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
771*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize,
772349cc55cSDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
7730b57cec5SDimitry Andric
774349cc55cSDimitry Andricdef TuneA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
7758bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
776349cc55cSDimitry Andric                                   FeatureFuseAES,
777e8d8bef9SDimitry Andric                                   FeatureFuseAddress,
77881ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
779*bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
780*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
7818bcb0991SDimitry Andric
782349cc55cSDimitry Andricdef TuneA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
7830b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
7840b57cec5SDimitry Andric                                   FeatureFuseAES,
78581ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
786*bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
787*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
7880b57cec5SDimitry Andric
789349cc55cSDimitry Andricdef TuneA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
7900b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
791*bdd1243dSDimitry Andric                                   FeatureFuseAES,
792*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
793*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
7940b57cec5SDimitry Andric
795349cc55cSDimitry Andricdef TuneA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
7960b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
797*bdd1243dSDimitry Andric                                   FeatureFuseAES,
798*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
799*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
8000b57cec5SDimitry Andric
801349cc55cSDimitry Andricdef TuneA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
8020b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
803*bdd1243dSDimitry Andric                                   FeatureFuseAES,
804*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
805*bdd1243dSDimitry Andric                                   FeatureLSLFast,
806*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
8070b57cec5SDimitry Andric
808349cc55cSDimitry Andricdef TuneA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
8095ffd83dbSDimitry Andric                                   "Cortex-A77 ARM processors", [
810e8d8bef9SDimitry Andric                                   FeatureCmpBccFusion,
811*bdd1243dSDimitry Andric                                   FeatureFuseAES,
812*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
813*bdd1243dSDimitry Andric                                   FeatureLSLFast,
814*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
8155ffd83dbSDimitry Andric
816349cc55cSDimitry Andricdef TuneA78 : SubtargetFeature<"a78", "ARMProcFamily", "CortexA78",
8175ffd83dbSDimitry Andric                               "Cortex-A78 ARM processors", [
818e8d8bef9SDimitry Andric                               FeatureCmpBccFusion,
8195ffd83dbSDimitry Andric                               FeatureFuseAES,
820*bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
821*bdd1243dSDimitry Andric                               FeatureLSLFast,
822*bdd1243dSDimitry Andric                               FeaturePostRAScheduler,
823*bdd1243dSDimitry Andric                               FeatureEnableSelectOptimize]>;
8245ffd83dbSDimitry Andric
825349cc55cSDimitry Andricdef TuneA78C : SubtargetFeature<"a78c", "ARMProcFamily",
826e8d8bef9SDimitry Andric                                "CortexA78C",
827e8d8bef9SDimitry Andric                                "Cortex-A78C ARM processors", [
828e8d8bef9SDimitry Andric                                FeatureCmpBccFusion,
829e8d8bef9SDimitry Andric                                FeatureFuseAES,
830*bdd1243dSDimitry Andric                                FeatureFuseAdrpAdd,
831*bdd1243dSDimitry Andric                                FeatureLSLFast,
832*bdd1243dSDimitry Andric                                FeaturePostRAScheduler,
833*bdd1243dSDimitry Andric                                FeatureEnableSelectOptimize]>;
834e8d8bef9SDimitry Andric
835349cc55cSDimitry Andricdef TuneA710    : SubtargetFeature<"a710", "ARMProcFamily", "CortexA710",
836349cc55cSDimitry Andric                                   "Cortex-A710 ARM processors", [
837*bdd1243dSDimitry Andric                                   FeatureCmpBccFusion,
838*bdd1243dSDimitry Andric                                   FeatureFuseAES,
839*bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
840*bdd1243dSDimitry Andric                                   FeatureLSLFast,
841*bdd1243dSDimitry Andric                                   FeaturePostRAScheduler,
842*bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize]>;
843*bdd1243dSDimitry Andric
844*bdd1243dSDimitry Andricdef TuneA715 : SubtargetFeature<"a715", "ARMProcFamily", "CortexA715",
845*bdd1243dSDimitry Andric                                 "Cortex-A715 ARM processors", [
846349cc55cSDimitry Andric                                 FeatureFuseAES,
847349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
848*bdd1243dSDimitry Andric                                 FeatureCmpBccFusion,
849*bdd1243dSDimitry Andric                                 FeatureLSLFast,
850*bdd1243dSDimitry Andric                                 FeatureFuseAdrpAdd,
851*bdd1243dSDimitry Andric                                 FeatureEnableSelectOptimize]>;
852349cc55cSDimitry Andric
853349cc55cSDimitry Andricdef TuneR82 : SubtargetFeature<"cortex-r82", "ARMProcFamily",
854e8d8bef9SDimitry Andric                               "CortexR82",
855349cc55cSDimitry Andric                               "Cortex-R82 ARM processors", [
856349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
857e8d8bef9SDimitry Andric
858349cc55cSDimitry Andricdef TuneX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
8595ffd83dbSDimitry Andric                                  "Cortex-X1 ARM processors", [
860e8d8bef9SDimitry Andric                                  FeatureCmpBccFusion,
8615ffd83dbSDimitry Andric                                  FeatureFuseAES,
862*bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
863*bdd1243dSDimitry Andric                                  FeatureLSLFast,
864*bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
865*bdd1243dSDimitry Andric                                  FeatureEnableSelectOptimize]>;
8665ffd83dbSDimitry Andric
867349cc55cSDimitry Andricdef TuneX2 : SubtargetFeature<"cortex-x2", "ARMProcFamily", "CortexX2",
868349cc55cSDimitry Andric                                  "Cortex-X2 ARM processors", [
869*bdd1243dSDimitry Andric                                  FeatureCmpBccFusion,
870*bdd1243dSDimitry Andric                                  FeatureFuseAES,
871*bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
872*bdd1243dSDimitry Andric                                  FeatureLSLFast,
873*bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
874*bdd1243dSDimitry Andric                                  FeatureEnableSelectOptimize]>;
875*bdd1243dSDimitry Andric
876*bdd1243dSDimitry Andricdef TuneX3 : SubtargetFeature<"cortex-x3", "ARMProcFamily", "CortexX3",
877*bdd1243dSDimitry Andric                              "Cortex-X3 ARM processors", [
878*bdd1243dSDimitry Andric                               FeatureLSLFast,
879*bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
880349cc55cSDimitry Andric                               FeatureFuseAES,
8815ffd83dbSDimitry Andric                               FeaturePostRAScheduler,
882*bdd1243dSDimitry Andric                               FeatureEnableSelectOptimize]>;
883349cc55cSDimitry Andric
884349cc55cSDimitry Andricdef TuneA64FX : SubtargetFeature<"a64fx", "ARMProcFamily", "A64FX",
885349cc55cSDimitry Andric                                 "Fujitsu A64FX processors", [
886349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
887e8d8bef9SDimitry Andric                                 FeatureAggressiveFMA,
888e8d8bef9SDimitry Andric                                 FeatureArithmeticBccFusion,
889e8d8bef9SDimitry Andric                                 FeaturePredictableSelectIsExpensive
8905ffd83dbSDimitry Andric                                 ]>;
8915ffd83dbSDimitry Andric
892349cc55cSDimitry Andricdef TuneCarmel : SubtargetFeature<"carmel", "ARMProcFamily", "Carmel",
893349cc55cSDimitry Andric                                  "Nvidia Carmel processors">;
8945ffd83dbSDimitry Andric
8950b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
8960b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
897349cc55cSDimitry Andricdef TuneAppleA7  : SubtargetFeature<"apple-a7", "ARMProcFamily", "AppleA7",
898480093f4SDimitry Andric                                    "Apple A7 (the CPU formerly known as Cyclone)", [
8990b57cec5SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
9000b57cec5SDimitry Andric                                    FeatureArithmeticBccFusion,
9010b57cec5SDimitry Andric                                    FeatureArithmeticCbzFusion,
9020b57cec5SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
903349cc55cSDimitry Andric                                    FeatureFuseAES, FeatureFuseCryptoEOR,
9040b57cec5SDimitry Andric                                    FeatureZCRegMove,
9050b57cec5SDimitry Andric                                    FeatureZCZeroing,
906349cc55cSDimitry Andric                                    FeatureZCZeroingFPWorkaround]
907349cc55cSDimitry Andric                                    >;
9080b57cec5SDimitry Andric
909349cc55cSDimitry Andricdef TuneAppleA10 : SubtargetFeature<"apple-a10", "ARMProcFamily", "AppleA10",
910480093f4SDimitry Andric                                    "Apple A10", [
911480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
912480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
913480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
914480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
9150b57cec5SDimitry Andric                                    FeatureFuseAES,
916480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
917480093f4SDimitry Andric                                    FeatureZCRegMove,
918349cc55cSDimitry Andric                                    FeatureZCZeroing]
919349cc55cSDimitry Andric                                    >;
9200b57cec5SDimitry Andric
921349cc55cSDimitry Andricdef TuneAppleA11 : SubtargetFeature<"apple-a11", "ARMProcFamily", "AppleA11",
922480093f4SDimitry Andric                                    "Apple A11", [
923480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
924480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
925480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
926480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
9270b57cec5SDimitry Andric                                    FeatureFuseAES,
928480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
929480093f4SDimitry Andric                                    FeatureZCRegMove,
930349cc55cSDimitry Andric                                    FeatureZCZeroing]
931349cc55cSDimitry Andric                                    >;
932480093f4SDimitry Andric
933349cc55cSDimitry Andricdef TuneAppleA12 : SubtargetFeature<"apple-a12", "ARMProcFamily", "AppleA12",
934480093f4SDimitry Andric                                    "Apple A12", [
935480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
936480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
937480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
938480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
939480093f4SDimitry Andric                                    FeatureFuseAES,
940480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
941480093f4SDimitry Andric                                    FeatureZCRegMove,
942349cc55cSDimitry Andric                                    FeatureZCZeroing]
943349cc55cSDimitry Andric                                    >;
944480093f4SDimitry Andric
945349cc55cSDimitry Andricdef TuneAppleA13 : SubtargetFeature<"apple-a13", "ARMProcFamily", "AppleA13",
946480093f4SDimitry Andric                                    "Apple A13", [
947480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
948480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
949480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
950480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
951480093f4SDimitry Andric                                    FeatureFuseAES,
952480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
953480093f4SDimitry Andric                                    FeatureZCRegMove,
954349cc55cSDimitry Andric                                    FeatureZCZeroing]
955349cc55cSDimitry Andric                                    >;
9560b57cec5SDimitry Andric
957349cc55cSDimitry Andricdef TuneAppleA14 : SubtargetFeature<"apple-a14", "ARMProcFamily", "AppleA14",
958e8d8bef9SDimitry Andric                                    "Apple A14", [
959e8d8bef9SDimitry Andric                                    FeatureAggressiveFMA,
960e8d8bef9SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
961e8d8bef9SDimitry Andric                                    FeatureArithmeticBccFusion,
962e8d8bef9SDimitry Andric                                    FeatureArithmeticCbzFusion,
963e8d8bef9SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
964e8d8bef9SDimitry Andric                                    FeatureFuseAddress,
965e8d8bef9SDimitry Andric                                    FeatureFuseAES,
966e8d8bef9SDimitry Andric                                    FeatureFuseArithmeticLogic,
967e8d8bef9SDimitry Andric                                    FeatureFuseCCSelect,
968e8d8bef9SDimitry Andric                                    FeatureFuseCryptoEOR,
96981ad6265SDimitry Andric                                    FeatureFuseAdrpAdd,
970e8d8bef9SDimitry Andric                                    FeatureFuseLiterals,
971e8d8bef9SDimitry Andric                                    FeatureZCRegMove,
972349cc55cSDimitry Andric                                    FeatureZCZeroing]>;
973e8d8bef9SDimitry Andric
974*bdd1243dSDimitry Andricdef TuneAppleA15 : SubtargetFeature<"apple-a15", "ARMProcFamily", "AppleA15",
975*bdd1243dSDimitry Andric                                    "Apple A15", [
976*bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
977*bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
978*bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
979*bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
980*bdd1243dSDimitry Andric                                    FeatureFuseAddress,
981*bdd1243dSDimitry Andric                                    FeatureFuseAES,
982*bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
983*bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
984*bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
985*bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
986*bdd1243dSDimitry Andric                                    FeatureZCRegMove,
987*bdd1243dSDimitry Andric                                    FeatureZCZeroing
988*bdd1243dSDimitry Andric                                    ]>;
989*bdd1243dSDimitry Andric
990*bdd1243dSDimitry Andricdef TuneAppleA16 : SubtargetFeature<"apple-a16", "ARMProcFamily", "AppleA16",
991*bdd1243dSDimitry Andric                                    "Apple A16", [
992*bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
993*bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
994*bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
995*bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
996*bdd1243dSDimitry Andric                                    FeatureFuseAddress,
997*bdd1243dSDimitry Andric                                    FeatureFuseAES,
998*bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
999*bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1000*bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1001*bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1002*bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1003*bdd1243dSDimitry Andric                                    FeatureZCZeroing
1004*bdd1243dSDimitry Andric                                    ]>;
1005*bdd1243dSDimitry Andric
1006349cc55cSDimitry Andricdef TuneExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
10070b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
1008349cc55cSDimitry Andric                                    [FeatureExynosCheapAsMoveHandling,
10090b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
10100b57cec5SDimitry Andric                                     FeatureFuseAddress,
10110b57cec5SDimitry Andric                                     FeatureFuseAES,
10120b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
101381ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
10140b57cec5SDimitry Andric                                     FeatureFuseLiterals,
10150b57cec5SDimitry Andric                                     FeatureLSLFast,
10160b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
1017fe6060f1SDimitry Andric                                     FeaturePredictableSelectIsExpensive]>;
10180b57cec5SDimitry Andric
101981ad6265SDimitry Andric// Re-uses some scheduling and tunings from the ExynosM3 proc family.
102081ad6265SDimitry Andricdef TuneExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3",
102181ad6265SDimitry Andric                                    "Samsung Exynos-M4 processors",
1022349cc55cSDimitry Andric                                    [FeatureArithmeticBccFusion,
10230b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
10240b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
10250b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
10260b57cec5SDimitry Andric                                     FeatureFuseAddress,
10270b57cec5SDimitry Andric                                     FeatureFuseAES,
10280b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
10290b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
103081ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
10310b57cec5SDimitry Andric                                     FeatureFuseLiterals,
10320b57cec5SDimitry Andric                                     FeatureLSLFast,
10330b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
10340b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
10350b57cec5SDimitry Andric
1036349cc55cSDimitry Andricdef TuneKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
10370b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
10380b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
10390b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
10400b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
10410b57cec5SDimitry Andric                                   FeatureZCZeroing,
1042349cc55cSDimitry Andric                                   FeatureLSLFast]
1043349cc55cSDimitry Andric                                   >;
10440b57cec5SDimitry Andric
1045349cc55cSDimitry Andricdef TuneFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
10460b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
10470b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
10480b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
10490b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
10500b57cec5SDimitry Andric                                   FeatureZCZeroing,
10510b57cec5SDimitry Andric                                   FeatureLSLFast,
10520b57cec5SDimitry Andric                                   FeatureSlowSTRQro
10530b57cec5SDimitry Andric                                   ]>;
10540b57cec5SDimitry Andric
1055349cc55cSDimitry Andricdef TuneNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily", "NeoverseE1",
10568bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
1057*bdd1243dSDimitry Andric                                      FeatureFuseAES,
1058*bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1059*bdd1243dSDimitry Andric                                      FeaturePostRAScheduler]>;
10608bcb0991SDimitry Andric
1061349cc55cSDimitry Andricdef TuneNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily", "NeoverseN1",
10628bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
1063*bdd1243dSDimitry Andric                                      FeatureFuseAES,
1064*bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1065*bdd1243dSDimitry Andric                                      FeatureLSLFast,
1066fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
1067*bdd1243dSDimitry Andric                                      FeatureEnableSelectOptimize]>;
10688bcb0991SDimitry Andric
1069349cc55cSDimitry Andricdef TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2",
1070e8d8bef9SDimitry Andric                                      "Neoverse N2 ARM processors", [
1071*bdd1243dSDimitry Andric                                      FeatureFuseAES,
1072*bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1073*bdd1243dSDimitry Andric                                      FeatureLSLFast,
1074fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
1075*bdd1243dSDimitry Andric                                      FeatureEnableSelectOptimize]>;
1076*bdd1243dSDimitry Andric
1077349cc55cSDimitry Andricdef TuneNeoverse512TVB : SubtargetFeature<"neoverse512tvb", "ARMProcFamily", "Neoverse512TVB",
1078349cc55cSDimitry Andric                                      "Neoverse 512-TVB ARM processors", [
1079*bdd1243dSDimitry Andric                                      FeatureFuseAES,
1080*bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1081*bdd1243dSDimitry Andric                                      FeatureLSLFast,
1082349cc55cSDimitry Andric                                      FeaturePostRAScheduler,
1083*bdd1243dSDimitry Andric                                      FeatureEnableSelectOptimize]>;
1084e8d8bef9SDimitry Andric
1085349cc55cSDimitry Andricdef TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1",
1086e8d8bef9SDimitry Andric                                      "Neoverse V1 ARM processors", [
1087e8d8bef9SDimitry Andric                                      FeatureFuseAES,
1088*bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1089*bdd1243dSDimitry Andric                                      FeatureLSLFast,
1090*bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
1091*bdd1243dSDimitry Andric                                      FeatureEnableSelectOptimize]>;
1092*bdd1243dSDimitry Andric
1093*bdd1243dSDimitry Andricdef TuneNeoverseV2 : SubtargetFeature<"neoversev2", "ARMProcFamily", "NeoverseV2",
1094*bdd1243dSDimitry Andric                                      "Neoverse V2 ARM processors", [
1095*bdd1243dSDimitry Andric                                      FeatureFuseAES,
1096*bdd1243dSDimitry Andric                                      FeatureLSLFast,
1097*bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
1098*bdd1243dSDimitry Andric                                      FeatureEnableSelectOptimize]>;
1099e8d8bef9SDimitry Andric
1100349cc55cSDimitry Andricdef TuneSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
11010b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
11020b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
11030b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
11040b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
11050b57cec5SDimitry Andric                                   FeatureZCZeroing,
1106349cc55cSDimitry Andric                                   FeatureLSLFast]>;
11070b57cec5SDimitry Andric
1108349cc55cSDimitry Andricdef TuneThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily", "ThunderX2T99",
11090b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
11100b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
11110b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
11120b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
1113349cc55cSDimitry Andric                                          FeaturePredictableSelectIsExpensive]>;
11140b57cec5SDimitry Andric
1115349cc55cSDimitry Andricdef TuneThunderX3T110  : SubtargetFeature<"thunderx3t110", "ARMProcFamily",
1116e837bb5cSDimitry Andric                                          "ThunderX3T110",
1117e837bb5cSDimitry Andric                                          "Marvell ThunderX3 processors", [
1118e837bb5cSDimitry Andric                                           FeatureAggressiveFMA,
1119e837bb5cSDimitry Andric                                           FeatureArithmeticBccFusion,
1120e837bb5cSDimitry Andric                                           FeaturePostRAScheduler,
1121e837bb5cSDimitry Andric                                           FeaturePredictableSelectIsExpensive,
1122e837bb5cSDimitry Andric                                           FeatureBalanceFPOps,
1123349cc55cSDimitry Andric                                           FeatureStrictAlign]>;
1124e837bb5cSDimitry Andric
1125349cc55cSDimitry Andricdef TuneThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
11260b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
11270b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
1128349cc55cSDimitry Andric                                    FeaturePredictableSelectIsExpensive]>;
11290b57cec5SDimitry Andric
1130349cc55cSDimitry Andricdef TuneThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
11310b57cec5SDimitry Andric                                       "ThunderXT88",
11320b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11330b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1134349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11350b57cec5SDimitry Andric
1136349cc55cSDimitry Andricdef TuneThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
11370b57cec5SDimitry Andric                                       "ThunderXT81",
11380b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11390b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1140349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11410b57cec5SDimitry Andric
1142349cc55cSDimitry Andricdef TuneThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
11430b57cec5SDimitry Andric                                       "ThunderXT83",
11440b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11450b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1146349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11470b57cec5SDimitry Andric
1148349cc55cSDimitry Andricdef TuneTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
11490b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
11500b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
11510b57cec5SDimitry Andric                                  FeatureFuseAES,
1152349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
11530b57cec5SDimitry Andric
11542a66634dSDimitry Andricdef TuneAmpere1 : SubtargetFeature<"ampere1", "ARMProcFamily", "Ampere1",
11552a66634dSDimitry Andric                                   "Ampere Computing Ampere-1 processors", [
11562a66634dSDimitry Andric                                   FeaturePostRAScheduler,
11572a66634dSDimitry Andric                                   FeatureFuseAES,
11582a66634dSDimitry Andric                                   FeatureLSLFast,
11592a66634dSDimitry Andric                                   FeatureAggressiveFMA,
11602a66634dSDimitry Andric                                   FeatureArithmeticBccFusion,
11612a66634dSDimitry Andric                                   FeatureCmpBccFusion,
11622a66634dSDimitry Andric                                   FeatureFuseAddress,
11632a66634dSDimitry Andric                                   FeatureFuseLiterals]>;
1164349cc55cSDimitry Andric
1165*bdd1243dSDimitry Andricdef TuneAmpere1A : SubtargetFeature<"ampere1a", "ARMProcFamily", "Ampere1A",
1166*bdd1243dSDimitry Andric                                    "Ampere Computing Ampere-1A processors", [
1167*bdd1243dSDimitry Andric                                    FeaturePostRAScheduler,
1168*bdd1243dSDimitry Andric                                    FeatureFuseAES,
1169*bdd1243dSDimitry Andric                                    FeatureLSLFast,
1170*bdd1243dSDimitry Andric                                    FeatureAggressiveFMA,
1171*bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1172*bdd1243dSDimitry Andric                                    FeatureCmpBccFusion,
1173*bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1174*bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1175*bdd1243dSDimitry Andric                                    FeatureFuseLiterals]>;
1176*bdd1243dSDimitry Andric
1177349cc55cSDimitry Andricdef ProcessorFeatures {
1178349cc55cSDimitry Andric  list<SubtargetFeature> A53  = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1179349cc55cSDimitry Andric                                 FeatureFPARMv8, FeatureNEON, FeaturePerfMon];
1180349cc55cSDimitry Andric  list<SubtargetFeature> A55  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1181349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1182349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon];
1183349cc55cSDimitry Andric  list<SubtargetFeature> A510 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1184349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1185349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1186349cc55cSDimitry Andric                                 FeatureFP16FML];
1187349cc55cSDimitry Andric  list<SubtargetFeature> A65  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1188349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
118981ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeatureRAS,
119081ad6265SDimitry Andric                                 FeaturePerfMon];
1191349cc55cSDimitry Andric  list<SubtargetFeature> A76  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1192349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
119381ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1194349cc55cSDimitry Andric  list<SubtargetFeature> A77  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1195349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
119681ad6265SDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSSBS];
1197349cc55cSDimitry Andric  list<SubtargetFeature> A78  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1198349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1199349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSPE,
1200349cc55cSDimitry Andric                                 FeatureSSBS];
1201349cc55cSDimitry Andric  list<SubtargetFeature> A78C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1202349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1203349cc55cSDimitry Andric                                 FeatureFlagM, FeatureFP16FML, FeaturePAuth,
1204349cc55cSDimitry Andric                                 FeaturePerfMon, FeatureRCPC, FeatureSPE,
1205349cc55cSDimitry Andric                                 FeatureSSBS];
1206349cc55cSDimitry Andric  list<SubtargetFeature> A710 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1207349cc55cSDimitry Andric                                 FeatureETE, FeatureMTE, FeatureFP16FML,
1208349cc55cSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureMatMulInt8];
1209*bdd1243dSDimitry Andric  list<SubtargetFeature> A715 = [HasV9_0aOps, FeatureNEON, FeatureMTE,
1210*bdd1243dSDimitry Andric                                 FeatureFP16FML, FeatureSVE, FeatureTRBE,
1211*bdd1243dSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureETE,
1212*bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureMatMulInt8, FeatureSPE];
121304eeddc0SDimitry Andric  list<SubtargetFeature> R82  = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
121404eeddc0SDimitry Andric                                 FeatureFP16FML, FeatureSSBS, FeaturePredRes,
121581ad6265SDimitry Andric                                 FeatureSB];
1216349cc55cSDimitry Andric  list<SubtargetFeature> X1   = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1217349cc55cSDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
12183a9a9c0cSDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
12193a9a9c0cSDimitry Andric                                 FeatureSSBS];
12201fd87a68SDimitry Andric  list<SubtargetFeature> X1C  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1221*bdd1243dSDimitry Andric                                 FeatureNEON, FeatureRCPC_IMMO, FeaturePerfMon,
12221fd87a68SDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
1223*bdd1243dSDimitry Andric                                 FeaturePAuth, FeatureSSBS, FeatureFlagM,
1224*bdd1243dSDimitry Andric                                 FeatureLSE2];
1225349cc55cSDimitry Andric  list<SubtargetFeature> X2   = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1226349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1227349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1228349cc55cSDimitry Andric                                 FeatureFP16FML];
1229*bdd1243dSDimitry Andric  list<SubtargetFeature> X3 =   [HasV9_0aOps, FeatureSVE, FeatureNEON,
1230*bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureETE, FeatureTRBE,
1231*bdd1243dSDimitry Andric                                 FeatureSPE, FeatureBF16, FeatureMatMulInt8,
1232*bdd1243dSDimitry Andric                                 FeatureMTE, FeatureSVE2BitPerm, FeatureFullFP16,
1233*bdd1243dSDimitry Andric                                 FeatureFP16FML];
1234349cc55cSDimitry Andric  list<SubtargetFeature> A64FX    = [HasV8_2aOps, FeatureFPARMv8, FeatureNEON,
1235349cc55cSDimitry Andric                                     FeatureSHA2, FeaturePerfMon, FeatureFullFP16,
1236349cc55cSDimitry Andric                                     FeatureSVE, FeatureComplxNum];
1237349cc55cSDimitry Andric  list<SubtargetFeature> Carmel   = [HasV8_2aOps, FeatureNEON, FeatureCrypto,
1238349cc55cSDimitry Andric                                     FeatureFullFP16];
1239349cc55cSDimitry Andric  list<SubtargetFeature> AppleA7  = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1240349cc55cSDimitry Andric                                     FeatureNEON,FeaturePerfMon, FeatureAppleA7SysReg];
1241349cc55cSDimitry Andric  list<SubtargetFeature> AppleA10 = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1242349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureCRC,
1243349cc55cSDimitry Andric                                     FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH];
1244349cc55cSDimitry Andric  list<SubtargetFeature> AppleA11 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1245349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1246349cc55cSDimitry Andric  list<SubtargetFeature> AppleA12 = [HasV8_3aOps, FeatureCrypto, FeatureFPARMv8,
1247349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1248349cc55cSDimitry Andric  list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1249349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16,
1250349cc55cSDimitry Andric                                     FeatureFP16FML, FeatureSHA3];
1251349cc55cSDimitry Andric  list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1252349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
1253349cc55cSDimitry Andric                                     FeatureSpecRestrict, FeatureSSBS, FeatureSB,
1254349cc55cSDimitry Andric                                     FeaturePredRes, FeatureCacheDeepPersist,
1255349cc55cSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML, FeatureSHA3,
1256349cc55cSDimitry Andric                                     FeatureAltFPCmp];
1257*bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA15 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1258*bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1259*bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML];
1260*bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA16 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1261*bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1262*bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML,
1263*bdd1243dSDimitry Andric                                     FeatureHCX];
1264349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM3 = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1265349cc55cSDimitry Andric                                     FeaturePerfMon];
1266349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM4 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1267349cc55cSDimitry Andric                                     FeatureFullFP16, FeaturePerfMon];
1268349cc55cSDimitry Andric  list<SubtargetFeature> Falkor   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1269349cc55cSDimitry Andric                                     FeatureFPARMv8, FeatureNEON, FeaturePerfMon,
1270349cc55cSDimitry Andric                                     FeatureRDM];
1271349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseE1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1272349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
127381ad6265SDimitry Andric                                       FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1274349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1275349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
127681ad6265SDimitry Andric                                       FeatureRCPC, FeatureSPE, FeatureSSBS,
127781ad6265SDimitry Andric                                       FeaturePerfMon];
1278349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN2 = [HasV8_5aOps, FeatureBF16, FeatureETE,
1279349cc55cSDimitry Andric                                       FeatureMatMulInt8, FeatureMTE, FeatureSVE2,
128081ad6265SDimitry Andric                                       FeatureSVE2BitPerm, FeatureTRBE, FeatureCrypto,
128181ad6265SDimitry Andric                                       FeaturePerfMon];
1282349cc55cSDimitry Andric  list<SubtargetFeature> Neoverse512TVB = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1283349cc55cSDimitry Andric                                           FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1284349cc55cSDimitry Andric                                           FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1285349cc55cSDimitry Andric                                           FeaturePerfMon, FeatureRandGen, FeatureSPE,
1286349cc55cSDimitry Andric                                           FeatureSSBS, FeatureSVE];
1287349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseV1 = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1288349cc55cSDimitry Andric                                       FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1289349cc55cSDimitry Andric                                       FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1290349cc55cSDimitry Andric                                       FeaturePerfMon, FeatureRandGen, FeatureSPE,
1291349cc55cSDimitry Andric                                       FeatureSSBS, FeatureSVE];
1292*bdd1243dSDimitry Andric  list<SubtargetFeature> NeoverseV2 = [HasV9_0aOps, FeatureBF16, FeatureSPE,
1293*bdd1243dSDimitry Andric                                       FeaturePerfMon, FeatureETE, FeatureMatMulInt8,
1294*bdd1243dSDimitry Andric                                       FeatureNEON, FeatureSVE2BitPerm, FeatureFP16FML,
1295*bdd1243dSDimitry Andric                                       FeatureMTE, FeatureRandGen];
1296349cc55cSDimitry Andric  list<SubtargetFeature> Saphira    = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1297349cc55cSDimitry Andric                                       FeatureNEON, FeatureSPE, FeaturePerfMon];
1298349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1299349cc55cSDimitry Andric                                       FeatureFPARMv8, FeaturePerfMon, FeatureNEON];
1300349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX2T99  = [HasV8_1aOps, FeatureCRC, FeatureCrypto,
1301349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE];
1302349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX3T110 = [HasV8_3aOps, FeatureCRC, FeatureCrypto,
1303349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE,
1304349cc55cSDimitry Andric                                          FeaturePAuth, FeaturePerfMon];
1305349cc55cSDimitry Andric  list<SubtargetFeature> TSV110 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1306349cc55cSDimitry Andric                                   FeatureNEON, FeaturePerfMon, FeatureSPE,
1307349cc55cSDimitry Andric                                   FeatureFullFP16, FeatureFP16FML, FeatureDotProd];
13082a66634dSDimitry Andric  list<SubtargetFeature> Ampere1 = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1309*bdd1243dSDimitry Andric                                    FeatureSSBS, FeatureRandGen, FeatureSB,
1310*bdd1243dSDimitry Andric                                    FeatureSHA2, FeatureSHA3, FeatureAES];
1311*bdd1243dSDimitry Andric  list<SubtargetFeature> Ampere1A = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1312*bdd1243dSDimitry Andric                                     FeatureMTE, FeatureSSBS, FeatureRandGen,
1313*bdd1243dSDimitry Andric                                     FeatureSB, FeatureSM4, FeatureSHA2,
1314*bdd1243dSDimitry Andric                                     FeatureSHA3, FeatureAES];
1315349cc55cSDimitry Andric
13165ffd83dbSDimitry Andric  // ETE and TRBE are future architecture extensions. We temporarily enable them
1317349cc55cSDimitry Andric  // by default for users targeting generic AArch64. The extensions do not
13188bcb0991SDimitry Andric  // affect code generated by the compiler and can be used only by explicitly
13198bcb0991SDimitry Andric  // mentioning the new system register names in assembly.
132081ad6265SDimitry Andric  list<SubtargetFeature> Generic = [FeatureFPARMv8, FeatureNEON, FeatureETE];
1321349cc55cSDimitry Andric}
13220b57cec5SDimitry Andric
132381ad6265SDimitry Andric// FeatureFuseAdrpAdd is enabled under Generic to allow linker merging
132481ad6265SDimitry Andric// optimizations.
1325349cc55cSDimitry Andricdef : ProcessorModel<"generic", CortexA55Model, ProcessorFeatures.Generic,
1326*bdd1243dSDimitry Andric                     [FeatureFuseAES, FeatureFuseAdrpAdd, FeaturePostRAScheduler,
1327*bdd1243dSDimitry Andric                      FeatureEnableSelectOptimize]>;
1328349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, ProcessorFeatures.A53,
1329349cc55cSDimitry Andric                     [TuneA35]>;
1330349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a34", CortexA53Model, ProcessorFeatures.A53,
1331349cc55cSDimitry Andric                     [TuneA35]>;
1332349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, ProcessorFeatures.A53,
1333349cc55cSDimitry Andric                     [TuneA53]>;
1334349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA55Model, ProcessorFeatures.A55,
1335349cc55cSDimitry Andric                     [TuneA55]>;
1336349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a510", CortexA55Model, ProcessorFeatures.A510,
1337349cc55cSDimitry Andric                     [TuneA510]>;
1338349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, ProcessorFeatures.A53,
1339349cc55cSDimitry Andric                     [TuneA57]>;
1340349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, ProcessorFeatures.A65,
1341349cc55cSDimitry Andric                     [TuneA65]>;
1342349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, ProcessorFeatures.A65,
1343349cc55cSDimitry Andric                     [TuneA65]>;
1344349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, ProcessorFeatures.A53,
1345349cc55cSDimitry Andric                     [TuneA72]>;
1346349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, ProcessorFeatures.A53,
1347349cc55cSDimitry Andric                     [TuneA73]>;
1348349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, ProcessorFeatures.A55,
1349349cc55cSDimitry Andric                     [TuneA75]>;
1350349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, ProcessorFeatures.A76,
1351349cc55cSDimitry Andric                     [TuneA76]>;
1352349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, ProcessorFeatures.A76,
1353349cc55cSDimitry Andric                     [TuneA76]>;
1354349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a77", CortexA57Model, ProcessorFeatures.A77,
1355349cc55cSDimitry Andric                     [TuneA77]>;
1356349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78", CortexA57Model, ProcessorFeatures.A78,
1357349cc55cSDimitry Andric                     [TuneA78]>;
1358349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78c", CortexA57Model, ProcessorFeatures.A78C,
1359349cc55cSDimitry Andric                     [TuneA78C]>;
1360753f127fSDimitry Andricdef : ProcessorModel<"cortex-a710", NeoverseN2Model, ProcessorFeatures.A710,
1361349cc55cSDimitry Andric                     [TuneA710]>;
1362*bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-a715", NeoverseN2Model, ProcessorFeatures.A715,
1363*bdd1243dSDimitry Andric                     [TuneA715]>;
1364349cc55cSDimitry Andricdef : ProcessorModel<"cortex-r82", CortexA55Model, ProcessorFeatures.R82,
1365349cc55cSDimitry Andric                     [TuneR82]>;
1366349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x1", CortexA57Model, ProcessorFeatures.X1,
1367349cc55cSDimitry Andric                     [TuneX1]>;
13681fd87a68SDimitry Andricdef : ProcessorModel<"cortex-x1c", CortexA57Model, ProcessorFeatures.X1C,
13691fd87a68SDimitry Andric                     [TuneX1]>;
1370753f127fSDimitry Andricdef : ProcessorModel<"cortex-x2", NeoverseN2Model, ProcessorFeatures.X2,
1371349cc55cSDimitry Andric                     [TuneX2]>;
1372*bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-x3", NeoverseN2Model, ProcessorFeatures.X3,
1373*bdd1243dSDimitry Andric                     [TuneX3]>;
1374349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model,
1375349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
1376349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-n1", CortexA57Model,
1377349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
1378753f127fSDimitry Andricdef : ProcessorModel<"neoverse-n2", NeoverseN2Model,
1379349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
1380753f127fSDimitry Andricdef : ProcessorModel<"neoverse-512tvb", NeoverseN2Model,
1381349cc55cSDimitry Andric                     ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
1382753f127fSDimitry Andricdef : ProcessorModel<"neoverse-v1", NeoverseN2Model,
1383349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseV1, [TuneNeoverseV1]>;
1384*bdd1243dSDimitry Andricdef : ProcessorModel<"neoverse-v2", NeoverseN2Model,
1385*bdd1243dSDimitry Andric                     ProcessorFeatures.NeoverseV2, [TuneNeoverseV2]>;
1386349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, ProcessorFeatures.ExynosM3,
1387349cc55cSDimitry Andric                     [TuneExynosM3]>;
1388349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, ProcessorFeatures.ExynosM4,
1389349cc55cSDimitry Andric                     [TuneExynosM4]>;
1390349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM5Model, ProcessorFeatures.ExynosM4,
1391349cc55cSDimitry Andric                     [TuneExynosM4]>;
1392349cc55cSDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, ProcessorFeatures.Falkor,
1393349cc55cSDimitry Andric                     [TuneFalkor]>;
1394349cc55cSDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, ProcessorFeatures.Saphira,
1395349cc55cSDimitry Andric                     [TuneSaphira]>;
1396349cc55cSDimitry Andricdef : ProcessorModel<"kryo", KryoModel, ProcessorFeatures.A53, [TuneKryo]>;
1397349cc55cSDimitry Andric
13980b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
1399349cc55cSDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  ProcessorFeatures.ThunderX,
1400349cc55cSDimitry Andric                     [TuneThunderX]>;
1401349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,
1402349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT88]>;
1403349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,
1404349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT81]>;
1405349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,
1406349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT83]>;
14070b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
1408349cc55cSDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model,
1409349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX2T99, [TuneThunderX2T99]>;
1410e837bb5cSDimitry Andric// Marvell ThunderX3T110 Processors.
1411349cc55cSDimitry Andricdef : ProcessorModel<"thunderx3t110", ThunderX3T110Model,
1412349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX3T110, [TuneThunderX3T110]>;
1413349cc55cSDimitry Andricdef : ProcessorModel<"tsv110", TSV110Model, ProcessorFeatures.TSV110,
1414349cc55cSDimitry Andric                     [TuneTSV110]>;
14150b57cec5SDimitry Andric
1416480093f4SDimitry Andric// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
1417349cc55cSDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
1418349cc55cSDimitry Andric                     [TuneAppleA7]>;
1419480093f4SDimitry Andric
1420480093f4SDimitry Andric// iPhone and iPad CPUs
1421349cc55cSDimitry Andricdef : ProcessorModel<"apple-a7", CycloneModel, ProcessorFeatures.AppleA7,
1422349cc55cSDimitry Andric                     [TuneAppleA7]>;
1423349cc55cSDimitry Andricdef : ProcessorModel<"apple-a8", CycloneModel, ProcessorFeatures.AppleA7,
1424349cc55cSDimitry Andric                     [TuneAppleA7]>;
1425349cc55cSDimitry Andricdef : ProcessorModel<"apple-a9", CycloneModel, ProcessorFeatures.AppleA7,
1426349cc55cSDimitry Andric                     [TuneAppleA7]>;
1427349cc55cSDimitry Andricdef : ProcessorModel<"apple-a10", CycloneModel, ProcessorFeatures.AppleA10,
1428349cc55cSDimitry Andric                     [TuneAppleA10]>;
1429349cc55cSDimitry Andricdef : ProcessorModel<"apple-a11", CycloneModel, ProcessorFeatures.AppleA11,
1430349cc55cSDimitry Andric                     [TuneAppleA11]>;
1431349cc55cSDimitry Andricdef : ProcessorModel<"apple-a12", CycloneModel, ProcessorFeatures.AppleA12,
1432349cc55cSDimitry Andric                     [TuneAppleA12]>;
1433349cc55cSDimitry Andricdef : ProcessorModel<"apple-a13", CycloneModel, ProcessorFeatures.AppleA13,
1434349cc55cSDimitry Andric                     [TuneAppleA13]>;
1435349cc55cSDimitry Andricdef : ProcessorModel<"apple-a14", CycloneModel, ProcessorFeatures.AppleA14,
1436349cc55cSDimitry Andric                     [TuneAppleA14]>;
1437*bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a15", CycloneModel, ProcessorFeatures.AppleA15,
1438*bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1439*bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16,
1440*bdd1243dSDimitry Andric                     [TuneAppleA16]>;
1441480093f4SDimitry Andric
1442fe6060f1SDimitry Andric// Mac CPUs
1443349cc55cSDimitry Andricdef : ProcessorModel<"apple-m1", CycloneModel, ProcessorFeatures.AppleA14,
1444349cc55cSDimitry Andric                     [TuneAppleA14]>;
1445*bdd1243dSDimitry Andricdef : ProcessorModel<"apple-m2", CycloneModel, ProcessorFeatures.AppleA15,
1446*bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1447fe6060f1SDimitry Andric
1448480093f4SDimitry Andric// watch CPUs.
1449349cc55cSDimitry Andricdef : ProcessorModel<"apple-s4", CycloneModel, ProcessorFeatures.AppleA12,
1450349cc55cSDimitry Andric                     [TuneAppleA12]>;
1451349cc55cSDimitry Andricdef : ProcessorModel<"apple-s5", CycloneModel, ProcessorFeatures.AppleA12,
1452349cc55cSDimitry Andric                     [TuneAppleA12]>;
1453480093f4SDimitry Andric
14540b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
1455*bdd1243dSDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, ProcessorFeatures.AppleA16,
1456*bdd1243dSDimitry Andric                     [TuneAppleA16]>;
14570b57cec5SDimitry Andric
14585ffd83dbSDimitry Andric// Fujitsu A64FX
1459349cc55cSDimitry Andricdef : ProcessorModel<"a64fx", A64FXModel, ProcessorFeatures.A64FX,
1460349cc55cSDimitry Andric                     [TuneA64FX]>;
14615ffd83dbSDimitry Andric
14625ffd83dbSDimitry Andric// Nvidia Carmel
1463349cc55cSDimitry Andricdef : ProcessorModel<"carmel", NoSchedModel, ProcessorFeatures.Carmel,
1464349cc55cSDimitry Andric                     [TuneCarmel]>;
14655ffd83dbSDimitry Andric
14662a66634dSDimitry Andric// Ampere Computing
14672a66634dSDimitry Andricdef : ProcessorModel<"ampere1", Ampere1Model, ProcessorFeatures.Ampere1,
14682a66634dSDimitry Andric                     [TuneAmpere1]>;
14692a66634dSDimitry Andric
1470*bdd1243dSDimitry Andricdef : ProcessorModel<"ampere1a", Ampere1Model, ProcessorFeatures.Ampere1A,
1471*bdd1243dSDimitry Andric                     [TuneAmpere1A]>;
1472*bdd1243dSDimitry Andric
14730b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
14740b57cec5SDimitry Andric// Assembly parser
14750b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
14760b57cec5SDimitry Andric
14770b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
14780b57cec5SDimitry Andric  int Variant = 0;
14790b57cec5SDimitry Andric  string Name = "generic";
14800b57cec5SDimitry Andric  string BreakCharacters = ".";
14810b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
14820b57cec5SDimitry Andric}
14830b57cec5SDimitry Andric
14840b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
14850b57cec5SDimitry Andric  int Variant = 1;
14860b57cec5SDimitry Andric  string Name = "apple-neon";
14870b57cec5SDimitry Andric  string BreakCharacters = ".";
14880b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
14890b57cec5SDimitry Andric}
14900b57cec5SDimitry Andric
14910b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
14920b57cec5SDimitry Andric// Assembly printer
14930b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
14940b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
14950b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
14960b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
14970b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
14980b57cec5SDimitry Andric  int PassSubtarget = 1;
14990b57cec5SDimitry Andric  int Variant = 0;
15000b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
15010b57cec5SDimitry Andric}
15020b57cec5SDimitry Andric
15030b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
15040b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
15050b57cec5SDimitry Andric  int PassSubtarget = 1;
15060b57cec5SDimitry Andric  int Variant = 1;
15070b57cec5SDimitry Andric  int isMCAsmWriter = 1;
15080b57cec5SDimitry Andric}
15090b57cec5SDimitry Andric
15100b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15110b57cec5SDimitry Andric// Target Declaration
15120b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15130b57cec5SDimitry Andric
15140b57cec5SDimitry Andricdef AArch64 : Target {
15150b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
15160b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
15170b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
15180b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
15190b57cec5SDimitry Andric}
15200b57cec5SDimitry Andric
15210b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15220b57cec5SDimitry Andric// Pfm Counters
15230b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15240b57cec5SDimitry Andric
15250b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
1526