xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
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
22bdd1243dSDimitry Andric// Each SubtargetFeature which corresponds to an Arm Architecture feature should
23bdd1243dSDimitry Andric// be annotated with the respective FEAT_ feature name from the Architecture
24bdd1243dSDimitry Andric// Reference Manual. If a SubtargetFeature enables instructions from multiple
25bdd1243dSDimitry Andric// Arm Architecture Features, it should list all the relevant features. Not all
26bdd1243dSDimitry Andric// FEAT_ features have a corresponding SubtargetFeature.
27bdd1243dSDimitry Andric
280b57cec5SDimitry Andricdef FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
29bdd1243dSDimitry Andric                                       "Enable ARMv8 FP (FEAT_FP)">;
300b57cec5SDimitry Andric
310b57cec5SDimitry Andricdef FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
32bdd1243dSDimitry Andric  "Enable Advanced SIMD instructions (FEAT_AdvSIMD)", [FeatureFPARMv8]>;
330b57cec5SDimitry Andric
340b57cec5SDimitry Andricdef FeatureSM4 : SubtargetFeature<
350b57cec5SDimitry Andric    "sm4", "HasSM4", "true",
36bdd1243dSDimitry Andric    "Enable SM3 and SM4 support (FEAT_SM4, FEAT_SM3)", [FeatureNEON]>;
370b57cec5SDimitry Andric
380b57cec5SDimitry Andricdef FeatureSHA2 : SubtargetFeature<
390b57cec5SDimitry Andric    "sha2", "HasSHA2", "true",
40bdd1243dSDimitry Andric    "Enable SHA1 and SHA256 support (FEAT_SHA1, FEAT_SHA256)", [FeatureNEON]>;
410b57cec5SDimitry Andric
420b57cec5SDimitry Andricdef FeatureSHA3 : SubtargetFeature<
430b57cec5SDimitry Andric    "sha3", "HasSHA3", "true",
44bdd1243dSDimitry Andric    "Enable SHA512 and SHA3 support (FEAT_SHA3, FEAT_SHA512)", [FeatureNEON, FeatureSHA2]>;
450b57cec5SDimitry Andric
460b57cec5SDimitry Andricdef FeatureAES : SubtargetFeature<
470b57cec5SDimitry Andric    "aes", "HasAES", "true",
48bdd1243dSDimitry 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.
53*06c3fb27SDimitry Andric// Therefore, we rely on Clang, the user interfacing 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",
62bdd1243dSDimitry Andric  "Enable ARMv8 CRC-32 checksum instructions (FEAT_CRC32)">;
630b57cec5SDimitry Andric
640b57cec5SDimitry Andricdef FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
65bdd1243dSDimitry Andric  "Enable ARMv8 Reliability, Availability and Serviceability Extensions (FEAT_RAS, FEAT_RASv1p1)">;
66bdd1243dSDimitry Andric
67bdd1243dSDimitry Andricdef FeatureRASv2 : SubtargetFeature<"rasv2", "HasRASv2", "true",
68bdd1243dSDimitry Andric  "Enable ARMv8.9-A Reliability, Availability and Serviceability Extensions (FEAT_RASv2)",
69bdd1243dSDimitry Andric  [FeatureRAS]>;
700b57cec5SDimitry Andric
710b57cec5SDimitry Andricdef FeatureLSE : SubtargetFeature<"lse", "HasLSE", "true",
72bdd1243dSDimitry Andric  "Enable ARMv8.1 Large System Extension (LSE) atomic instructions (FEAT_LSE)">;
730b57cec5SDimitry Andric
74349cc55cSDimitry Andricdef FeatureLSE2 : SubtargetFeature<"lse2", "HasLSE2", "true",
75bdd1243dSDimitry 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
80bdd1243dSDimitry Andricdef FeatureFMV : SubtargetFeature<"fmv", "HasFMV", "true",
81bdd1243dSDimitry Andric  "Enable Function Multi Versioning support.">;
82bdd1243dSDimitry Andric
830b57cec5SDimitry Andricdef FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
84bdd1243dSDimitry Andric  "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions (FEAT_RDM)">;
850b57cec5SDimitry Andric
860b57cec5SDimitry Andricdef FeaturePAN : SubtargetFeature<
870b57cec5SDimitry Andric    "pan", "HasPAN", "true",
88bdd1243dSDimitry Andric    "Enables ARM v8.1 Privileged Access-Never extension (FEAT_PAN)">;
890b57cec5SDimitry Andric
900b57cec5SDimitry Andricdef FeatureLOR : SubtargetFeature<
910b57cec5SDimitry Andric    "lor", "HasLOR", "true",
92bdd1243dSDimitry 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",
98bdd1243dSDimitry Andric    "Enables ARM v8.1 Virtual Host extension (FEAT_VHE)", [FeatureCONTEXTIDREL2] >;
990b57cec5SDimitry Andric
100bdd1243dSDimitry Andric// This SubtargetFeature is special. It controls only whether codegen will turn
101bdd1243dSDimitry Andric// `llvm.readcyclecounter()` into an access to a PMUv3 System Register. The
102bdd1243dSDimitry Andric// `FEAT_PMUv3*` system registers are always available for assembly/disassembly.
1030b57cec5SDimitry Andricdef FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
104bdd1243dSDimitry Andric  "Enable Code Generation for ARMv8 PMUv3 Performance Monitors extension (FEAT_PMUv3)">;
1050b57cec5SDimitry Andric
1060b57cec5SDimitry Andricdef FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
107bdd1243dSDimitry Andric  "Full FP16 (FEAT_FP16)", [FeatureFPARMv8]>;
1080b57cec5SDimitry Andric
1090b57cec5SDimitry Andricdef FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
110bdd1243dSDimitry Andric  "Enable FP16 FML instructions (FEAT_FHM)", [FeatureFullFP16]>;
1110b57cec5SDimitry Andric
1120b57cec5SDimitry Andricdef FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
113bdd1243dSDimitry Andric  "Enable Statistical Profiling extension (FEAT_SPE)">;
1140b57cec5SDimitry Andric
1150b57cec5SDimitry Andricdef FeaturePAN_RWV : SubtargetFeature<
1160b57cec5SDimitry Andric    "pan-rwv", "HasPAN_RWV", "true",
117bdd1243dSDimitry 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",
122bdd1243dSDimitry Andric    "Enable v8.2 UAO PState (FEAT_UAO)">;
1230b57cec5SDimitry Andric
1240b57cec5SDimitry Andricdef FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
125bdd1243dSDimitry Andric    "true", "Enable v8.2 data Cache Clean to Point of Persistence (FEAT_DPB)" >;
1260b57cec5SDimitry Andric
1270b57cec5SDimitry Andricdef FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
128bdd1243dSDimitry 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",
152bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions (FEAT_SVE2)",
153349cc55cSDimitry Andric  [FeatureSVE, FeatureUseScalarIncVL]>;
1540b57cec5SDimitry Andric
1550b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
156bdd1243dSDimitry Andric  "Enable AES SVE2 instructions (FEAT_SVE_AES, FEAT_SVE_PMULL128)",
157bdd1243dSDimitry Andric  [FeatureSVE2, FeatureAES]>;
1580b57cec5SDimitry Andric
1590b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
160bdd1243dSDimitry Andric  "Enable SM4 SVE2 instructions (FEAT_SVE_SM4)", [FeatureSVE2, FeatureSM4]>;
1610b57cec5SDimitry Andric
1620b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
163bdd1243dSDimitry Andric  "Enable SHA3 SVE2 instructions (FEAT_SVE_SHA3)", [FeatureSVE2, FeatureSHA3]>;
1640b57cec5SDimitry Andric
1650b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
166bdd1243dSDimitry Andric  "Enable bit permutation SVE2 instructions (FEAT_SVE_BitPerm)", [FeatureSVE2]>;
167bdd1243dSDimitry Andric
168bdd1243dSDimitry Andricdef FeatureSVE2p1: SubtargetFeature<"sve2p1", "HasSVE2p1", "true",
169bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2.1 instructions", [FeatureSVE2]>;
170bdd1243dSDimitry Andric
171bdd1243dSDimitry Andricdef FeatureB16B16 : SubtargetFeature<"b16b16", "HasB16B16", "true",
172bdd1243dSDimitry 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
219bdd1243dSDimitry Andricdef FeatureEnableSelectOptimize : SubtargetFeature<
220bdd1243dSDimitry Andric    "enable-select-opt", "EnableSelectOptimize", "true",
221bdd1243dSDimitry Andric    "Enable the select optimize pass for select loop heuristics">;
222bdd1243dSDimitry 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
292*06c3fb27SDimitry Andricdef FeatureFuseAddSub2RegAndConstOne : SubtargetFeature<
293*06c3fb27SDimitry Andric   "fuse-addsub-2reg-const1", "HasFuseAddSub2RegAndConstOne", "true",
294*06c3fb27SDimitry Andric   "CPU fuses (a + b + 1) and (a - b - 1)">;
295*06c3fb27SDimitry Andric
2960b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
2970b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
2980b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
2990b57cec5SDimitry Andric
3000b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
3010b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
3020b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
3030b57cec5SDimitry Andric
3040b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
305bdd1243dSDimitry Andric                                   "Enable support for RCPC extension (FEAT_LRCPC)">;
3060b57cec5SDimitry Andric
3070b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
3080b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
3090b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
3100b57cec5SDimitry Andric
3110b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
3120b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
313bdd1243dSDimitry Andric    "Enable dot product support (FEAT_DotProd)">;
3140b57cec5SDimitry Andric
315e8d8bef9SDimitry Andricdef FeaturePAuth : SubtargetFeature<
316e8d8bef9SDimitry Andric    "pauth", "HasPAuth", "true",
317bdd1243dSDimitry Andric    "Enable v8.3-A Pointer Authentication extension (FEAT_PAuth)">;
3180b57cec5SDimitry Andric
3190b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
3200b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
321bdd1243dSDimitry Andric    "Enable v8.3-A JavaScript FP conversion instructions (FEAT_JSCVT)",
3220b57cec5SDimitry Andric    [FeatureFPARMv8]>;
3230b57cec5SDimitry Andric
3240b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
3250b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
326bdd1243dSDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets (FEAT_CCIDX)">;
3270b57cec5SDimitry Andric
3280b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
3290b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
330bdd1243dSDimitry Andric    "Enable v8.3-A Floating-point complex number support (FEAT_FCMA)",
3310b57cec5SDimitry Andric    [FeatureNEON]>;
3320b57cec5SDimitry Andric
3330b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
3340b57cec5SDimitry Andric    "nv", "HasNV", "true",
335bdd1243dSDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement (FEAT_NV, FEAT_NV2)">;
3360b57cec5SDimitry Andric
3370b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
3380b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
339bdd1243dSDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension (FEAT_MPAM)">;
3400b57cec5SDimitry Andric
3410b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
3420b57cec5SDimitry Andric    "dit", "HasDIT", "true",
343bdd1243dSDimitry Andric    "Enable v8.4-A Data Independent Timing instructions (FEAT_DIT)">;
3440b57cec5SDimitry Andric
3450b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
3460b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
347bdd1243dSDimitry Andric    "Enable v8.4-A Trace extension (FEAT_TRF)">;
3480b57cec5SDimitry Andric
3490b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
3500b57cec5SDimitry Andric    "am", "HasAM", "true",
351bdd1243dSDimitry Andric    "Enable v8.4-A Activity Monitors extension (FEAT_AMUv1)">;
3520b57cec5SDimitry Andric
3535ffd83dbSDimitry Andricdef FeatureAMVS : SubtargetFeature<
3545ffd83dbSDimitry Andric    "amvs", "HasAMVS", "true",
355bdd1243dSDimitry Andric    "Enable v8.6-A Activity Monitors Virtualization support (FEAT_AMUv1p1)",
3565ffd83dbSDimitry Andric    [FeatureAM]>;
3575ffd83dbSDimitry Andric
3580b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
3590b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
360bdd1243dSDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension (FEAT_SEL2)">;
3610b57cec5SDimitry Andric
3620b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
3630b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
364bdd1243dSDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions (FEAT_TLBIOS, FEAT_TLBIRANGE)">;
3650b57cec5SDimitry Andric
366e8d8bef9SDimitry Andricdef FeatureFlagM : SubtargetFeature<
367e8d8bef9SDimitry Andric    "flagm", "HasFlagM", "true",
368bdd1243dSDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions (FEAT_FlagM)">;
3690b57cec5SDimitry Andric
3700b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3710b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
372bdd1243dSDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets (FEAT_LRCPC2)",
3730b57cec5SDimitry Andric    [FeatureRCPC]>;
3740b57cec5SDimitry Andric
3750b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3760b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3770b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3780b57cec5SDimitry Andric                                        "to their negated or complemented "
3790b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3800b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3810b57cec5SDimitry Andric
3820b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
3830b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
3840b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
3850b57cec5SDimitry Andric
3860b57cec5SDimitry Andricdef FeatureAggressiveFMA :
3870b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
3880b57cec5SDimitry Andric                   "HasAggressiveFMA",
3890b57cec5SDimitry Andric                   "true",
3900b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
3910b57cec5SDimitry Andric
3920b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
393bdd1243dSDimitry Andric  "Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)">;
3940b57cec5SDimitry Andric
3950b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
3960b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
397bdd1243dSDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int (FEAT_FRINTTS)" >;
3980b57cec5SDimitry Andric
3990b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
400bdd1243dSDimitry Andric  "true", "Enable architectural speculation restriction (FEAT_CSV2_2)">;
4010b57cec5SDimitry Andric
4020b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
403bdd1243dSDimitry Andric  "true", "Enable v8.5 Speculation Barrier (FEAT_SB)" >;
4040b57cec5SDimitry Andric
4050b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
406bdd1243dSDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit (FEAT_SSBS, FEAT_SSBS2)" >;
4070b57cec5SDimitry Andric
4080b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
409bdd1243dSDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions (FEAT_SPECRES)" >;
4100b57cec5SDimitry Andric
4110b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
412bdd1243dSDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)" >;
4130b57cec5SDimitry Andric
4140b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
415bdd1243dSDimitry Andric    "true", "Enable Branch Target Identification (FEAT_BTI)" >;
4160b57cec5SDimitry Andric
4170b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
418bdd1243dSDimitry Andric    "true", "Enable Random Number generation instructions (FEAT_RNG)" >;
4190b57cec5SDimitry Andric
4200b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
421bdd1243dSDimitry Andric    "true", "Enable Memory Tagging Extension (FEAT_MTE, FEAT_MTE2)" >;
4220b57cec5SDimitry Andric
4238bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
424bdd1243dSDimitry Andric    "true", "Enable Trace Buffer Extension (FEAT_TRBE)">;
4258bcb0991SDimitry Andric
4268bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
427bdd1243dSDimitry Andric    "true", "Enable Embedded Trace Extension (FEAT_ETE)",
4288bcb0991SDimitry Andric    [FeatureTRBE]>;
4298bcb0991SDimitry Andric
4308bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
431bdd1243dSDimitry Andric    "true", "Enable Transactional Memory Extension (FEAT_TME)" >;
4328bcb0991SDimitry Andric
4338bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
4348bcb0991SDimitry Andric    "AllowTaggedGlobals",
4358bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
4368bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
4378bcb0991SDimitry Andric
4385ffd83dbSDimitry Andricdef FeatureBF16 : SubtargetFeature<"bf16", "HasBF16",
439bdd1243dSDimitry Andric    "true", "Enable BFloat16 Extension (FEAT_BF16)" >;
4405ffd83dbSDimitry Andric
4415ffd83dbSDimitry Andricdef FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
442bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply Int8 Extension (FEAT_I8MM)">;
4435ffd83dbSDimitry Andric
4445ffd83dbSDimitry Andricdef FeatureMatMulFP32 : SubtargetFeature<"f32mm", "HasMatMulFP32",
445bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP32 Extension (FEAT_F32MM)", [FeatureSVE]>;
4465ffd83dbSDimitry Andric
4475ffd83dbSDimitry Andricdef FeatureMatMulFP64 : SubtargetFeature<"f64mm", "HasMatMulFP64",
448bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP64 Extension (FEAT_F64MM)", [FeatureSVE]>;
4495ffd83dbSDimitry Andric
450e8d8bef9SDimitry Andricdef FeatureXS : SubtargetFeature<"xs", "HasXS",
451bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A limited-TLB-maintenance instruction (FEAT_XS)">;
452e8d8bef9SDimitry Andric
453e8d8bef9SDimitry Andricdef FeatureWFxT : SubtargetFeature<"wfxt", "HasWFxT",
454bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A WFET and WFIT instruction (FEAT_WFxT)">;
455e8d8bef9SDimitry Andric
456e8d8bef9SDimitry Andricdef FeatureHCX : SubtargetFeature<
457bdd1243dSDimitry Andric    "hcx", "HasHCX", "true", "Enable Armv8.7-A HCRX_EL2 system register (FEAT_HCX)">;
458e8d8bef9SDimitry Andric
459e8d8bef9SDimitry Andricdef FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
460bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A LD64B/ST64B Accelerator Extension (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)">;
461e8d8bef9SDimitry Andric
46204eeddc0SDimitry Andricdef FeatureHBC : SubtargetFeature<"hbc", "HasHBC",
463bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Hinted Conditional Branches Extension (FEAT_HBC)">;
46404eeddc0SDimitry Andric
46504eeddc0SDimitry Andricdef FeatureMOPS : SubtargetFeature<"mops", "HasMOPS",
466bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A memcpy and memset acceleration instructions (FEAT_MOPS)">;
467bdd1243dSDimitry Andric
468bdd1243dSDimitry Andricdef FeatureNMI : SubtargetFeature<"nmi", "HasNMI",
469bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Non-maskable Interrupts (FEAT_NMI, FEAT_GICv3_NMI)">;
47004eeddc0SDimitry Andric
471e8d8bef9SDimitry Andricdef FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
472bdd1243dSDimitry Andric    "true", "Enable Branch Record Buffer Extension (FEAT_BRBE)">;
473e8d8bef9SDimitry Andric
474e8d8bef9SDimitry Andricdef FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
475bdd1243dSDimitry Andric    "true", "Enable extra register in the Statistical Profiling Extension (FEAT_SPEv1p2)">;
476e8d8bef9SDimitry Andric
4775ffd83dbSDimitry Andricdef FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
478bdd1243dSDimitry Andric    "true", "Enable fine grained virtualization traps extension (FEAT_FGT)">;
4795ffd83dbSDimitry Andric
4805ffd83dbSDimitry Andricdef FeatureEnhancedCounterVirtualization :
4815ffd83dbSDimitry Andric      SubtargetFeature<"ecv", "HasEnhancedCounterVirtualization",
482bdd1243dSDimitry Andric      "true", "Enable enhanced counter virtualization extension (FEAT_ECV)">;
4835ffd83dbSDimitry Andric
484fe6060f1SDimitry Andricdef FeatureRME : SubtargetFeature<"rme", "HasRME",
485bdd1243dSDimitry Andric    "true", "Enable Realm Management Extension (FEAT_RME)">;
486fe6060f1SDimitry Andric
487fe6060f1SDimitry Andricdef FeatureSME : SubtargetFeature<"sme", "HasSME", "true",
488bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) (FEAT_SME)", [FeatureBF16, FeatureUseScalarIncVL]>;
489fe6060f1SDimitry Andric
490bdd1243dSDimitry Andricdef FeatureSMEF64F64 : SubtargetFeature<"sme-f64f64", "HasSMEF64F64", "true",
491bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) F64F64 instructions (FEAT_SME_F64F64)", [FeatureSME]>;
492fe6060f1SDimitry Andric
493bdd1243dSDimitry Andricdef FeatureSMEI16I64 : SubtargetFeature<"sme-i16i64", "HasSMEI16I64", "true",
494bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) I16I64 instructions (FEAT_SME_I16I64)", [FeatureSME]>;
495bdd1243dSDimitry Andric
496bdd1243dSDimitry Andricdef FeatureSMEF16F16 : SubtargetFeature<"sme-f16f16", "HasSMEF16F16", "true",
497bdd1243dSDimitry Andric  "Enable SME2.1 non-widening Float16 instructions (FEAT_SME_F16F16)", []>;
498bdd1243dSDimitry Andric
499bdd1243dSDimitry Andricdef FeatureSME2 : SubtargetFeature<"sme2", "HasSME2", "true",
500bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2 (SME2) instructions", [FeatureSME]>;
501bdd1243dSDimitry Andric
502bdd1243dSDimitry Andricdef FeatureSME2p1 : SubtargetFeature<"sme2p1", "HasSME2p1", "true",
503bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2.1 (FEAT_SME2p1) instructions", [FeatureSME2]>;
504fe6060f1SDimitry Andric
505349cc55cSDimitry Andricdef FeatureAppleA7SysReg  : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
506349cc55cSDimitry Andric  "Apple A7 (the CPU formerly known as Cyclone)">;
507349cc55cSDimitry Andric
508349cc55cSDimitry Andricdef FeatureEL2VMSA : SubtargetFeature<"el2vmsa", "HasEL2VMSA", "true",
509349cc55cSDimitry Andric  "Enable Exception Level 2 Virtual Memory System Architecture">;
510349cc55cSDimitry Andric
511349cc55cSDimitry Andricdef FeatureEL3 : SubtargetFeature<"el3", "HasEL3", "true",
512349cc55cSDimitry Andric  "Enable Exception Level 3">;
513349cc55cSDimitry Andric
514bdd1243dSDimitry Andricdef FeatureCSSC : SubtargetFeature<"cssc", "HasCSSC", "true",
515bdd1243dSDimitry Andric  "Enable Common Short Sequence Compression (CSSC) instructions (FEAT_CSSC)">;
516bdd1243dSDimitry Andric
5170eae32dcSDimitry Andricdef FeatureFixCortexA53_835769 : SubtargetFeature<"fix-cortex-a53-835769",
5180eae32dcSDimitry Andric  "FixCortexA53_835769", "true", "Mitigate Cortex-A53 Erratum 835769">;
5190eae32dcSDimitry Andric
5203a9a9c0cSDimitry Andricdef FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice",
5213a9a9c0cSDimitry Andric                                                 "NoBTIAtReturnTwice", "true",
5223a9a9c0cSDimitry Andric                                                 "Don't place a BTI instruction "
5233a9a9c0cSDimitry Andric                                                 "after a return-twice">;
5243a9a9c0cSDimitry Andric
525*06c3fb27SDimitry Andricdef FeatureCHK : SubtargetFeature<"chk", "HasCHK",
526*06c3fb27SDimitry Andric    "true", "Enable Armv8.0-A Check Feature Status Extension (FEAT_CHK)">;
527*06c3fb27SDimitry Andric
528*06c3fb27SDimitry Andricdef FeatureGCS : SubtargetFeature<"gcs", "HasGCS",
529*06c3fb27SDimitry Andric    "true", "Enable Armv9.4-A Guarded Call Stack Extension", [FeatureCHK]>;
530*06c3fb27SDimitry Andric
531bdd1243dSDimitry Andricdef FeatureCLRBHB : SubtargetFeature<"clrbhb", "HasCLRBHB",
532bdd1243dSDimitry Andric    "true", "Enable Clear BHB instruction (FEAT_CLRBHB)">;
533bdd1243dSDimitry Andric
534bdd1243dSDimitry Andricdef FeaturePRFM_SLC : SubtargetFeature<"prfm-slc-target", "HasPRFM_SLC",
535bdd1243dSDimitry Andric    "true", "Enable SLC target for PRFM instruction">;
536bdd1243dSDimitry Andric
537bdd1243dSDimitry Andricdef FeatureSPECRES2 : SubtargetFeature<"specres2", "HasSPECRES2",
538bdd1243dSDimitry Andric    "true", "Enable Speculation Restriction Instruction (FEAT_SPECRES2)",
539bdd1243dSDimitry Andric    [FeaturePredRes]>;
540bdd1243dSDimitry Andric
541bdd1243dSDimitry Andricdef FeatureMEC : SubtargetFeature<"mec", "HasMEC",
542bdd1243dSDimitry Andric    "true", "Enable Memory Encryption Contexts Extension", [FeatureRME]>;
543bdd1243dSDimitry Andric
544bdd1243dSDimitry Andricdef FeatureITE : SubtargetFeature<"ite", "HasITE",
545bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A Instrumentation Extension FEAT_ITE", [FeatureETE,
546bdd1243dSDimitry Andric    FeatureTRBE]>;
547bdd1243dSDimitry Andric
548bdd1243dSDimitry Andricdef FeatureRCPC3 : SubtargetFeature<"rcpc3", "HasRCPC3",
549bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set (FEAT_LRCPC3)",
550bdd1243dSDimitry Andric    [FeatureRCPC_IMMO]>;
551bdd1243dSDimitry Andric
552bdd1243dSDimitry Andricdef FeatureTHE : SubtargetFeature<"the", "HasTHE",
553bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A Translation Hardening Extension (FEAT_THE)">;
554bdd1243dSDimitry Andric
555bdd1243dSDimitry Andricdef FeatureLSE128 : SubtargetFeature<"lse128", "HasLSE128",
556bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Atomic Instructions (FEAT_LSE128)",
557bdd1243dSDimitry Andric    [FeatureLSE]>;
558bdd1243dSDimitry Andric
559bdd1243dSDimitry Andric// FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, and FEAT_SYSINSTR128 are mutually implicit.
560bdd1243dSDimitry Andric// Therefore group them all under a single feature flag, d128:
561bdd1243dSDimitry Andricdef FeatureD128 : SubtargetFeature<"d128", "HasD128",
562bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Page Table Descriptors, System Registers "
563bdd1243dSDimitry Andric    "and Instructions (FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, FEAT_SYSINSTR128)",
564bdd1243dSDimitry Andric    [FeatureLSE128]>;
565bdd1243dSDimitry Andric
5660b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5670b57cec5SDimitry Andric// Architectures.
5680b57cec5SDimitry Andric//
569349cc55cSDimitry Andricdef HasV8_0aOps : SubtargetFeature<"v8a", "HasV8_0aOps", "true",
570349cc55cSDimitry Andric  "Support ARM v8.0a instructions", [FeatureEL2VMSA, FeatureEL3]>;
5710b57cec5SDimitry Andric
5720b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
573349cc55cSDimitry Andric  "Support ARM v8.1a instructions", [HasV8_0aOps, FeatureCRC, FeatureLSE,
574349cc55cSDimitry Andric  FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH]>;
5750b57cec5SDimitry Andric
5760b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
5770b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
5780b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
5790b57cec5SDimitry Andric
5800b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
581e8d8bef9SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePAuth,
5820b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
5830b57cec5SDimitry Andric
5840b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
5850b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
586e8d8bef9SDimitry Andric  FeatureNV, FeatureMPAM, FeatureDIT,
587349cc55cSDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
588349cc55cSDimitry Andric  FeatureFlagM, FeatureRCPC_IMMO, FeatureLSE2]>;
5890b57cec5SDimitry Andric
5900b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
5910b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
5920b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
5930b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
5945ffd83dbSDimitry Andric   FeatureBranchTargetId]>;
5955ffd83dbSDimitry Andric
5965ffd83dbSDimitry Andricdef HasV8_6aOps : SubtargetFeature<
5975ffd83dbSDimitry Andric  "v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions",
5985ffd83dbSDimitry Andric  [HasV8_5aOps, FeatureAMVS, FeatureBF16, FeatureFineGrainedTraps,
5995ffd83dbSDimitry Andric   FeatureEnhancedCounterVirtualization, FeatureMatMulInt8]>;
6000b57cec5SDimitry Andric
601e8d8bef9SDimitry Andricdef HasV8_7aOps : SubtargetFeature<
602e8d8bef9SDimitry Andric  "v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions",
603e8d8bef9SDimitry Andric  [HasV8_6aOps, FeatureXS, FeatureWFxT, FeatureHCX]>;
604e8d8bef9SDimitry Andric
60504eeddc0SDimitry Andricdef HasV8_8aOps : SubtargetFeature<
60604eeddc0SDimitry Andric  "v8.8a", "HasV8_8aOps", "true", "Support ARM v8.8a instructions",
607bdd1243dSDimitry Andric  [HasV8_7aOps, FeatureHBC, FeatureMOPS, FeatureNMI]>;
608bdd1243dSDimitry Andric
609bdd1243dSDimitry Andricdef HasV8_9aOps : SubtargetFeature<
610bdd1243dSDimitry Andric  "v8.9a", "HasV8_9aOps", "true", "Support ARM v8.9a instructions",
611bdd1243dSDimitry Andric  [HasV8_8aOps, FeatureCLRBHB, FeaturePRFM_SLC, FeatureSPECRES2,
612*06c3fb27SDimitry Andric   FeatureCSSC, FeatureRASv2, FeatureCHK]>;
61304eeddc0SDimitry Andric
614349cc55cSDimitry Andricdef HasV9_0aOps : SubtargetFeature<
615349cc55cSDimitry Andric  "v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions",
616bdd1243dSDimitry Andric  [HasV8_5aOps, FeatureMEC, FeatureSVE2]>;
617349cc55cSDimitry Andric
618349cc55cSDimitry Andricdef HasV9_1aOps : SubtargetFeature<
619349cc55cSDimitry Andric  "v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions",
620349cc55cSDimitry Andric  [HasV8_6aOps, HasV9_0aOps]>;
621349cc55cSDimitry Andric
622349cc55cSDimitry Andricdef HasV9_2aOps : SubtargetFeature<
623349cc55cSDimitry Andric  "v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions",
624349cc55cSDimitry Andric  [HasV8_7aOps, HasV9_1aOps]>;
625349cc55cSDimitry Andric
62604eeddc0SDimitry Andricdef HasV9_3aOps : SubtargetFeature<
62704eeddc0SDimitry Andric  "v9.3a", "HasV9_3aOps", "true", "Support ARM v9.3a instructions",
62804eeddc0SDimitry Andric  [HasV8_8aOps, HasV9_2aOps]>;
62904eeddc0SDimitry Andric
630bdd1243dSDimitry Andricdef HasV9_4aOps : SubtargetFeature<
631bdd1243dSDimitry Andric  "v9.4a", "HasV9_4aOps", "true", "Support ARM v9.4a instructions",
632bdd1243dSDimitry Andric  [HasV8_9aOps, HasV9_3aOps]>;
633bdd1243dSDimitry Andric
634e8d8bef9SDimitry Andricdef HasV8_0rOps : SubtargetFeature<
635e8d8bef9SDimitry Andric  "v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
636e8d8bef9SDimitry Andric  [//v8.1
637e8d8bef9SDimitry Andric  FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
638e8d8bef9SDimitry Andric  //v8.2
63904eeddc0SDimitry Andric  FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
640e8d8bef9SDimitry Andric  //v8.3
641e8d8bef9SDimitry Andric  FeatureComplxNum, FeatureCCIDX, FeatureJS,
642e8d8bef9SDimitry Andric  FeaturePAuth, FeatureRCPC,
643e8d8bef9SDimitry Andric  //v8.4
64404eeddc0SDimitry Andric  FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
64581ad6265SDimitry Andric  FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO,
64681ad6265SDimitry Andric  // Not mandatory in v8.0-R, but included here on the grounds that it
64781ad6265SDimitry Andric  // only enables names of system registers
64881ad6265SDimitry Andric  FeatureSpecRestrict
64981ad6265SDimitry Andric  ]>;
65081ad6265SDimitry Andric
65181ad6265SDimitry Andric// Only intended to be used by disassemblers.
65281ad6265SDimitry Andricdef FeatureAll
65381ad6265SDimitry Andric    : SubtargetFeature<"all", "IsAll", "true", "Enable all instructions", []>;
65481ad6265SDimitry Andric
65581ad6265SDimitry Andricclass AssemblerPredicateWithAll<dag cond, string name="">
65681ad6265SDimitry Andric    : AssemblerPredicate<(any_of FeatureAll, cond), name>;
657e8d8bef9SDimitry Andric
6580b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6590b57cec5SDimitry Andric// Register File Description
6600b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6610b57cec5SDimitry Andric
6620b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
6630b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
6640b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
6650b57cec5SDimitry Andric
6660b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6670b57cec5SDimitry Andric// Instruction Descriptions
6680b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6690b57cec5SDimitry Andric
6700b57cec5SDimitry Andricinclude "AArch64Schedule.td"
6710b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
6720b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
6730b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
674*06c3fb27SDimitry Andricinclude "AArch64SchedPredNeoverse.td"
6758bcb0991SDimitry Andricinclude "AArch64Combine.td"
6760b57cec5SDimitry Andric
6770b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
6780b57cec5SDimitry Andric
6790b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6800b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
6810b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6820b57cec5SDimitry Andric
6830b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
6840b57cec5SDimitry Andric
6850b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6860b57cec5SDimitry Andric// Access to privileged registers
6870b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6880b57cec5SDimitry Andric
6890b57cec5SDimitry Andricforeach i = 1-3 in
6900b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
6910b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
692*06c3fb27SDimitry Andricdef FeatureUseROEL0ForTP : SubtargetFeature<"tpidrro-el0", "UseROEL0ForTP",
693*06c3fb27SDimitry Andric  "true", "Permit use of TPIDRRO_EL0 for the TLS base">;
6940b57cec5SDimitry Andric
6950b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6965ffd83dbSDimitry Andric// Control codegen mitigation against Straight Line Speculation vulnerability.
6975ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
6985ffd83dbSDimitry Andric
6995ffd83dbSDimitry Andricdef FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
7005ffd83dbSDimitry Andric  "HardenSlsRetBr", "true",
7015ffd83dbSDimitry Andric  "Harden against straight line speculation across RET and BR instructions">;
7025ffd83dbSDimitry Andricdef FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
7035ffd83dbSDimitry Andric  "HardenSlsBlr", "true",
7045ffd83dbSDimitry Andric  "Harden against straight line speculation across BLR instructions">;
705fe6060f1SDimitry Andricdef FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
706fe6060f1SDimitry Andric  "HardenSlsNoComdat", "true",
707fe6060f1SDimitry Andric  "Generate thunk code for SLS mitigation in the normal text section">;
7085ffd83dbSDimitry Andric
7095ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
7100b57cec5SDimitry Andric// AArch64 Processors supported.
7110b57cec5SDimitry Andric//
7120b57cec5SDimitry Andric
7130b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7140b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
7150b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7160b57cec5SDimitry Andric
7170b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
7180b57cec5SDimitry Andric
719*06c3fb27SDimitry Andriclet F = [HasSVE2p1, HasSVE2p1_or_HasSME2, HasSVE2p1_or_HasSME2p1] in
720*06c3fb27SDimitry Andricdef SVE2p1Unsupported : AArch64Unsupported;
721*06c3fb27SDimitry Andric
722*06c3fb27SDimitry Andricdef SVE2Unsupported : AArch64Unsupported {
723*06c3fb27SDimitry Andric  let F = !listconcat([HasSVE2, HasSVE2orSME,
724*06c3fb27SDimitry Andric                       HasSVE2AES, HasSVE2SHA3, HasSVE2SM4, HasSVE2BitPerm],
725*06c3fb27SDimitry Andric                       SVE2p1Unsupported.F);
7260b57cec5SDimitry Andric}
7270b57cec5SDimitry Andric
728*06c3fb27SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
729*06c3fb27SDimitry Andric  let F = !listconcat([HasSVE, HasSVEorSME],
730*06c3fb27SDimitry Andric                      SVE2Unsupported.F);
731*06c3fb27SDimitry Andric}
732*06c3fb27SDimitry Andric
733*06c3fb27SDimitry Andriclet F = [HasSME2p1, HasSVE2p1_or_HasSME2p1] in
734*06c3fb27SDimitry Andricdef SME2p1Unsupported : AArch64Unsupported;
735*06c3fb27SDimitry Andric
736*06c3fb27SDimitry Andricdef SME2Unsupported : AArch64Unsupported {
737*06c3fb27SDimitry Andric  let F = !listconcat([HasSME2, HasSVE2p1_or_HasSME2],
738*06c3fb27SDimitry Andric                      SME2p1Unsupported.F);
739e837bb5cSDimitry Andric}
740e837bb5cSDimitry Andric
741fe6060f1SDimitry Andricdef SMEUnsupported : AArch64Unsupported {
742*06c3fb27SDimitry Andric  let F = !listconcat([HasSME, HasSMEI16I64, HasSMEF16F16, HasSMEF64F64],
743*06c3fb27SDimitry Andric                      SME2Unsupported.F);
744fe6060f1SDimitry Andric}
745fe6060f1SDimitry Andric
746*06c3fb27SDimitry Andriclet F = [HasPAuth] in
747*06c3fb27SDimitry Andricdef PAUnsupported : AArch64Unsupported;
748*06c3fb27SDimitry Andric
7490b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
750e8d8bef9SDimitry Andricinclude "AArch64SchedA55.td"
751*06c3fb27SDimitry Andricinclude "AArch64SchedA510.td"
7520b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
7530b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
7540b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
7550b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
7560b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
7570b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
758480093f4SDimitry Andricinclude "AArch64SchedExynosM5.td"
7590b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
7600b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
761e8d8bef9SDimitry Andricinclude "AArch64SchedA64FX.td"
762e837bb5cSDimitry Andricinclude "AArch64SchedThunderX3T110.td"
763e8d8bef9SDimitry Andricinclude "AArch64SchedTSV110.td"
7642a66634dSDimitry Andricinclude "AArch64SchedAmpere1.td"
765*06c3fb27SDimitry Andricinclude "AArch64SchedNeoverseN1.td"
766753f127fSDimitry Andricinclude "AArch64SchedNeoverseN2.td"
767*06c3fb27SDimitry Andricinclude "AArch64SchedNeoverseV1.td"
768*06c3fb27SDimitry Andricinclude "AArch64SchedNeoverseV2.td"
7690b57cec5SDimitry Andric
770349cc55cSDimitry Andricdef TuneA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
771349cc55cSDimitry Andric                                "Cortex-A35 ARM processors">;
7720b57cec5SDimitry Andric
773349cc55cSDimitry Andricdef TuneA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
7740b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
7750b57cec5SDimitry Andric                                   FeatureFuseAES,
776bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
777349cc55cSDimitry Andric                                   FeatureBalanceFPOps,
778349cc55cSDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
779349cc55cSDimitry Andric                                   FeaturePostRAScheduler]>;
7800b57cec5SDimitry Andric
781349cc55cSDimitry Andricdef TuneA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
7820b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
7830b57cec5SDimitry Andric                                   FeatureFuseAES,
784bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
785fe6060f1SDimitry Andric                                   FeaturePostRAScheduler,
786349cc55cSDimitry Andric                                   FeatureFuseAddress]>;
787349cc55cSDimitry Andric
788349cc55cSDimitry Andricdef TuneA510    : SubtargetFeature<"a510", "ARMProcFamily", "CortexA510",
789349cc55cSDimitry Andric                                   "Cortex-A510 ARM processors", [
790349cc55cSDimitry Andric                                   FeatureFuseAES,
791bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
792349cc55cSDimitry Andric                                   FeaturePostRAScheduler
7930b57cec5SDimitry Andric                                   ]>;
7940b57cec5SDimitry Andric
795349cc55cSDimitry Andricdef TuneA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
7960b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
797349cc55cSDimitry Andric                                   FeatureFuseAES,
7980b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
7990b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
80081ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
8010b57cec5SDimitry Andric                                   FeatureFuseLiterals,
8020b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
803bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize,
804349cc55cSDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8050b57cec5SDimitry Andric
806349cc55cSDimitry Andricdef TuneA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
8078bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
808349cc55cSDimitry Andric                                   FeatureFuseAES,
809e8d8bef9SDimitry Andric                                   FeatureFuseAddress,
81081ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
811bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
812*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
813*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8148bcb0991SDimitry Andric
815349cc55cSDimitry Andricdef TuneA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
8160b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
8170b57cec5SDimitry Andric                                   FeatureFuseAES,
81881ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
819bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
820*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
821*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8220b57cec5SDimitry Andric
823349cc55cSDimitry Andricdef TuneA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
8240b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
825bdd1243dSDimitry Andric                                   FeatureFuseAES,
826bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
827*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
828*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8290b57cec5SDimitry Andric
830349cc55cSDimitry Andricdef TuneA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
8310b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
832bdd1243dSDimitry Andric                                   FeatureFuseAES,
833bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
834*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
835*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8360b57cec5SDimitry Andric
837349cc55cSDimitry Andricdef TuneA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
8380b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
839bdd1243dSDimitry Andric                                   FeatureFuseAES,
840bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
841bdd1243dSDimitry Andric                                   FeatureLSLFast,
842*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
843*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8440b57cec5SDimitry Andric
845349cc55cSDimitry Andricdef TuneA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
8465ffd83dbSDimitry Andric                                   "Cortex-A77 ARM processors", [
847e8d8bef9SDimitry Andric                                   FeatureCmpBccFusion,
848bdd1243dSDimitry Andric                                   FeatureFuseAES,
849bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
850bdd1243dSDimitry Andric                                   FeatureLSLFast,
851*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
852*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8535ffd83dbSDimitry Andric
854349cc55cSDimitry Andricdef TuneA78 : SubtargetFeature<"a78", "ARMProcFamily", "CortexA78",
8555ffd83dbSDimitry Andric                               "Cortex-A78 ARM processors", [
856e8d8bef9SDimitry Andric                               FeatureCmpBccFusion,
8575ffd83dbSDimitry Andric                               FeatureFuseAES,
858bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
859bdd1243dSDimitry Andric                               FeatureLSLFast,
860bdd1243dSDimitry Andric                               FeaturePostRAScheduler,
861*06c3fb27SDimitry Andric                               FeatureEnableSelectOptimize,
862*06c3fb27SDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
8635ffd83dbSDimitry Andric
864349cc55cSDimitry Andricdef TuneA78C : SubtargetFeature<"a78c", "ARMProcFamily",
865e8d8bef9SDimitry Andric                                "CortexA78C",
866e8d8bef9SDimitry Andric                                "Cortex-A78C ARM processors", [
867e8d8bef9SDimitry Andric                                FeatureCmpBccFusion,
868e8d8bef9SDimitry Andric                                FeatureFuseAES,
869bdd1243dSDimitry Andric                                FeatureFuseAdrpAdd,
870bdd1243dSDimitry Andric                                FeatureLSLFast,
871bdd1243dSDimitry Andric                                FeaturePostRAScheduler,
872*06c3fb27SDimitry Andric                                FeatureEnableSelectOptimize,
873*06c3fb27SDimitry Andric                                FeaturePredictableSelectIsExpensive]>;
874e8d8bef9SDimitry Andric
875349cc55cSDimitry Andricdef TuneA710    : SubtargetFeature<"a710", "ARMProcFamily", "CortexA710",
876349cc55cSDimitry Andric                                   "Cortex-A710 ARM processors", [
877bdd1243dSDimitry Andric                                   FeatureCmpBccFusion,
878bdd1243dSDimitry Andric                                   FeatureFuseAES,
879bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
880bdd1243dSDimitry Andric                                   FeatureLSLFast,
881bdd1243dSDimitry Andric                                   FeaturePostRAScheduler,
882*06c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
883*06c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
884bdd1243dSDimitry Andric
885bdd1243dSDimitry Andricdef TuneA715 : SubtargetFeature<"a715", "ARMProcFamily", "CortexA715",
886bdd1243dSDimitry Andric                                 "Cortex-A715 ARM processors", [
887349cc55cSDimitry Andric                                 FeatureFuseAES,
888349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
889bdd1243dSDimitry Andric                                 FeatureCmpBccFusion,
890bdd1243dSDimitry Andric                                 FeatureLSLFast,
891bdd1243dSDimitry Andric                                 FeatureFuseAdrpAdd,
892*06c3fb27SDimitry Andric                                 FeatureEnableSelectOptimize,
893*06c3fb27SDimitry Andric                                 FeaturePredictableSelectIsExpensive]>;
894349cc55cSDimitry Andric
895349cc55cSDimitry Andricdef TuneR82 : SubtargetFeature<"cortex-r82", "ARMProcFamily",
896e8d8bef9SDimitry Andric                               "CortexR82",
897349cc55cSDimitry Andric                               "Cortex-R82 ARM processors", [
898349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
899e8d8bef9SDimitry Andric
900349cc55cSDimitry Andricdef TuneX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
9015ffd83dbSDimitry Andric                                  "Cortex-X1 ARM processors", [
902e8d8bef9SDimitry Andric                                  FeatureCmpBccFusion,
9035ffd83dbSDimitry Andric                                  FeatureFuseAES,
904bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
905bdd1243dSDimitry Andric                                  FeatureLSLFast,
906bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
907*06c3fb27SDimitry Andric                                  FeatureEnableSelectOptimize,
908*06c3fb27SDimitry Andric                                  FeaturePredictableSelectIsExpensive]>;
9095ffd83dbSDimitry Andric
910349cc55cSDimitry Andricdef TuneX2 : SubtargetFeature<"cortex-x2", "ARMProcFamily", "CortexX2",
911349cc55cSDimitry Andric                                  "Cortex-X2 ARM processors", [
912bdd1243dSDimitry Andric                                  FeatureCmpBccFusion,
913bdd1243dSDimitry Andric                                  FeatureFuseAES,
914bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
915bdd1243dSDimitry Andric                                  FeatureLSLFast,
916bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
917*06c3fb27SDimitry Andric                                  FeatureEnableSelectOptimize,
918*06c3fb27SDimitry Andric                                  FeaturePredictableSelectIsExpensive]>;
919bdd1243dSDimitry Andric
920bdd1243dSDimitry Andricdef TuneX3 : SubtargetFeature<"cortex-x3", "ARMProcFamily", "CortexX3",
921bdd1243dSDimitry Andric                              "Cortex-X3 ARM processors", [
922bdd1243dSDimitry Andric                               FeatureLSLFast,
923bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
924349cc55cSDimitry Andric                               FeatureFuseAES,
9255ffd83dbSDimitry Andric                               FeaturePostRAScheduler,
926*06c3fb27SDimitry Andric                               FeatureEnableSelectOptimize,
927*06c3fb27SDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
928349cc55cSDimitry Andric
929349cc55cSDimitry Andricdef TuneA64FX : SubtargetFeature<"a64fx", "ARMProcFamily", "A64FX",
930349cc55cSDimitry Andric                                 "Fujitsu A64FX processors", [
931349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
932e8d8bef9SDimitry Andric                                 FeatureAggressiveFMA,
933e8d8bef9SDimitry Andric                                 FeatureArithmeticBccFusion,
934e8d8bef9SDimitry Andric                                 FeaturePredictableSelectIsExpensive
9355ffd83dbSDimitry Andric                                 ]>;
9365ffd83dbSDimitry Andric
937349cc55cSDimitry Andricdef TuneCarmel : SubtargetFeature<"carmel", "ARMProcFamily", "Carmel",
938349cc55cSDimitry Andric                                  "Nvidia Carmel processors">;
9395ffd83dbSDimitry Andric
9400b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
9410b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
942349cc55cSDimitry Andricdef TuneAppleA7  : SubtargetFeature<"apple-a7", "ARMProcFamily", "AppleA7",
943480093f4SDimitry Andric                                    "Apple A7 (the CPU formerly known as Cyclone)", [
9440b57cec5SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
9450b57cec5SDimitry Andric                                    FeatureArithmeticBccFusion,
9460b57cec5SDimitry Andric                                    FeatureArithmeticCbzFusion,
9470b57cec5SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
948349cc55cSDimitry Andric                                    FeatureFuseAES, FeatureFuseCryptoEOR,
9490b57cec5SDimitry Andric                                    FeatureZCRegMove,
9500b57cec5SDimitry Andric                                    FeatureZCZeroing,
951349cc55cSDimitry Andric                                    FeatureZCZeroingFPWorkaround]
952349cc55cSDimitry Andric                                    >;
9530b57cec5SDimitry Andric
954349cc55cSDimitry Andricdef TuneAppleA10 : SubtargetFeature<"apple-a10", "ARMProcFamily", "AppleA10",
955480093f4SDimitry Andric                                    "Apple A10", [
956480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
957480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
958480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
959480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
9600b57cec5SDimitry Andric                                    FeatureFuseAES,
961480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
962480093f4SDimitry Andric                                    FeatureZCRegMove,
963349cc55cSDimitry Andric                                    FeatureZCZeroing]
964349cc55cSDimitry Andric                                    >;
9650b57cec5SDimitry Andric
966349cc55cSDimitry Andricdef TuneAppleA11 : SubtargetFeature<"apple-a11", "ARMProcFamily", "AppleA11",
967480093f4SDimitry Andric                                    "Apple A11", [
968480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
969480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
970480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
971480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
9720b57cec5SDimitry Andric                                    FeatureFuseAES,
973480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
974480093f4SDimitry Andric                                    FeatureZCRegMove,
975349cc55cSDimitry Andric                                    FeatureZCZeroing]
976349cc55cSDimitry Andric                                    >;
977480093f4SDimitry Andric
978349cc55cSDimitry Andricdef TuneAppleA12 : SubtargetFeature<"apple-a12", "ARMProcFamily", "AppleA12",
979480093f4SDimitry Andric                                    "Apple A12", [
980480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
981480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
982480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
983480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
984480093f4SDimitry Andric                                    FeatureFuseAES,
985480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
986480093f4SDimitry Andric                                    FeatureZCRegMove,
987349cc55cSDimitry Andric                                    FeatureZCZeroing]
988349cc55cSDimitry Andric                                    >;
989480093f4SDimitry Andric
990349cc55cSDimitry Andricdef TuneAppleA13 : SubtargetFeature<"apple-a13", "ARMProcFamily", "AppleA13",
991480093f4SDimitry Andric                                    "Apple A13", [
992480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
993480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
994480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
995480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
996480093f4SDimitry Andric                                    FeatureFuseAES,
997480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
998480093f4SDimitry Andric                                    FeatureZCRegMove,
999349cc55cSDimitry Andric                                    FeatureZCZeroing]
1000349cc55cSDimitry Andric                                    >;
10010b57cec5SDimitry Andric
1002349cc55cSDimitry Andricdef TuneAppleA14 : SubtargetFeature<"apple-a14", "ARMProcFamily", "AppleA14",
1003e8d8bef9SDimitry Andric                                    "Apple A14", [
1004e8d8bef9SDimitry Andric                                    FeatureAggressiveFMA,
1005e8d8bef9SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1006e8d8bef9SDimitry Andric                                    FeatureArithmeticBccFusion,
1007e8d8bef9SDimitry Andric                                    FeatureArithmeticCbzFusion,
1008e8d8bef9SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1009e8d8bef9SDimitry Andric                                    FeatureFuseAddress,
1010e8d8bef9SDimitry Andric                                    FeatureFuseAES,
1011e8d8bef9SDimitry Andric                                    FeatureFuseArithmeticLogic,
1012e8d8bef9SDimitry Andric                                    FeatureFuseCCSelect,
1013e8d8bef9SDimitry Andric                                    FeatureFuseCryptoEOR,
101481ad6265SDimitry Andric                                    FeatureFuseAdrpAdd,
1015e8d8bef9SDimitry Andric                                    FeatureFuseLiterals,
1016e8d8bef9SDimitry Andric                                    FeatureZCRegMove,
1017349cc55cSDimitry Andric                                    FeatureZCZeroing]>;
1018e8d8bef9SDimitry Andric
1019bdd1243dSDimitry Andricdef TuneAppleA15 : SubtargetFeature<"apple-a15", "ARMProcFamily", "AppleA15",
1020bdd1243dSDimitry Andric                                    "Apple A15", [
1021bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1022bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1023bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
1024bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1025bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1026bdd1243dSDimitry Andric                                    FeatureFuseAES,
1027bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
1028bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1029bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1030bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1031bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1032bdd1243dSDimitry Andric                                    FeatureZCZeroing
1033bdd1243dSDimitry Andric                                    ]>;
1034bdd1243dSDimitry Andric
1035bdd1243dSDimitry Andricdef TuneAppleA16 : SubtargetFeature<"apple-a16", "ARMProcFamily", "AppleA16",
1036bdd1243dSDimitry Andric                                    "Apple A16", [
1037bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1038bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1039bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
1040bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1041bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1042bdd1243dSDimitry Andric                                    FeatureFuseAES,
1043bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
1044bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1045bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1046bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1047bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1048bdd1243dSDimitry Andric                                    FeatureZCZeroing
1049bdd1243dSDimitry Andric                                    ]>;
1050bdd1243dSDimitry Andric
1051349cc55cSDimitry Andricdef TuneExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
10520b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
1053349cc55cSDimitry Andric                                    [FeatureExynosCheapAsMoveHandling,
10540b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
10550b57cec5SDimitry Andric                                     FeatureFuseAddress,
10560b57cec5SDimitry Andric                                     FeatureFuseAES,
10570b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
105881ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
10590b57cec5SDimitry Andric                                     FeatureFuseLiterals,
10600b57cec5SDimitry Andric                                     FeatureLSLFast,
10610b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
1062fe6060f1SDimitry Andric                                     FeaturePredictableSelectIsExpensive]>;
10630b57cec5SDimitry Andric
106481ad6265SDimitry Andric// Re-uses some scheduling and tunings from the ExynosM3 proc family.
106581ad6265SDimitry Andricdef TuneExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3",
106681ad6265SDimitry Andric                                    "Samsung Exynos-M4 processors",
1067349cc55cSDimitry Andric                                    [FeatureArithmeticBccFusion,
10680b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
10690b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
10700b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
10710b57cec5SDimitry Andric                                     FeatureFuseAddress,
10720b57cec5SDimitry Andric                                     FeatureFuseAES,
10730b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
10740b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
107581ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
10760b57cec5SDimitry Andric                                     FeatureFuseLiterals,
10770b57cec5SDimitry Andric                                     FeatureLSLFast,
10780b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
10790b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
10800b57cec5SDimitry Andric
1081349cc55cSDimitry Andricdef TuneKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
10820b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
10830b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
10840b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
10850b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
10860b57cec5SDimitry Andric                                   FeatureZCZeroing,
1087349cc55cSDimitry Andric                                   FeatureLSLFast]
1088349cc55cSDimitry Andric                                   >;
10890b57cec5SDimitry Andric
1090349cc55cSDimitry Andricdef TuneFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
10910b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
10920b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
10930b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
10940b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
10950b57cec5SDimitry Andric                                   FeatureZCZeroing,
10960b57cec5SDimitry Andric                                   FeatureLSLFast,
10970b57cec5SDimitry Andric                                   FeatureSlowSTRQro
10980b57cec5SDimitry Andric                                   ]>;
10990b57cec5SDimitry Andric
1100349cc55cSDimitry Andricdef TuneNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily", "NeoverseE1",
11018bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
1102bdd1243dSDimitry Andric                                      FeatureFuseAES,
1103bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1104bdd1243dSDimitry Andric                                      FeaturePostRAScheduler]>;
11058bcb0991SDimitry Andric
1106349cc55cSDimitry Andricdef TuneNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily", "NeoverseN1",
11078bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
1108bdd1243dSDimitry Andric                                      FeatureFuseAES,
1109bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1110bdd1243dSDimitry Andric                                      FeatureLSLFast,
1111fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
1112*06c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
1113*06c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
11148bcb0991SDimitry Andric
1115349cc55cSDimitry Andricdef TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2",
1116e8d8bef9SDimitry Andric                                      "Neoverse N2 ARM processors", [
1117bdd1243dSDimitry Andric                                      FeatureFuseAES,
1118bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1119bdd1243dSDimitry Andric                                      FeatureLSLFast,
1120fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
1121*06c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
1122*06c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1123bdd1243dSDimitry Andric
1124349cc55cSDimitry Andricdef TuneNeoverse512TVB : SubtargetFeature<"neoverse512tvb", "ARMProcFamily", "Neoverse512TVB",
1125349cc55cSDimitry Andric                                      "Neoverse 512-TVB ARM processors", [
1126bdd1243dSDimitry Andric                                      FeatureFuseAES,
1127bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1128bdd1243dSDimitry Andric                                      FeatureLSLFast,
1129349cc55cSDimitry Andric                                      FeaturePostRAScheduler,
1130*06c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
1131*06c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1132e8d8bef9SDimitry Andric
1133349cc55cSDimitry Andricdef TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1",
1134e8d8bef9SDimitry Andric                                      "Neoverse V1 ARM processors", [
1135e8d8bef9SDimitry Andric                                      FeatureFuseAES,
1136bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1137bdd1243dSDimitry Andric                                      FeatureLSLFast,
1138bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
1139*06c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
1140*06c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1141bdd1243dSDimitry Andric
1142bdd1243dSDimitry Andricdef TuneNeoverseV2 : SubtargetFeature<"neoversev2", "ARMProcFamily", "NeoverseV2",
1143bdd1243dSDimitry Andric                                      "Neoverse V2 ARM processors", [
1144bdd1243dSDimitry Andric                                      FeatureFuseAES,
1145bdd1243dSDimitry Andric                                      FeatureLSLFast,
1146bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
1147*06c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
1148*06c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1149e8d8bef9SDimitry Andric
1150349cc55cSDimitry Andricdef TuneSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
11510b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
11520b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
11530b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
11540b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
11550b57cec5SDimitry Andric                                   FeatureZCZeroing,
1156349cc55cSDimitry Andric                                   FeatureLSLFast]>;
11570b57cec5SDimitry Andric
1158349cc55cSDimitry Andricdef TuneThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily", "ThunderX2T99",
11590b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
11600b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
11610b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
11620b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
1163349cc55cSDimitry Andric                                          FeaturePredictableSelectIsExpensive]>;
11640b57cec5SDimitry Andric
1165349cc55cSDimitry Andricdef TuneThunderX3T110  : SubtargetFeature<"thunderx3t110", "ARMProcFamily",
1166e837bb5cSDimitry Andric                                          "ThunderX3T110",
1167e837bb5cSDimitry Andric                                          "Marvell ThunderX3 processors", [
1168e837bb5cSDimitry Andric                                           FeatureAggressiveFMA,
1169e837bb5cSDimitry Andric                                           FeatureArithmeticBccFusion,
1170e837bb5cSDimitry Andric                                           FeaturePostRAScheduler,
1171e837bb5cSDimitry Andric                                           FeaturePredictableSelectIsExpensive,
1172e837bb5cSDimitry Andric                                           FeatureBalanceFPOps,
1173349cc55cSDimitry Andric                                           FeatureStrictAlign]>;
1174e837bb5cSDimitry Andric
1175349cc55cSDimitry Andricdef TuneThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
11760b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
11770b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
1178349cc55cSDimitry Andric                                    FeaturePredictableSelectIsExpensive]>;
11790b57cec5SDimitry Andric
1180349cc55cSDimitry Andricdef TuneThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
11810b57cec5SDimitry Andric                                       "ThunderXT88",
11820b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11830b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1184349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11850b57cec5SDimitry Andric
1186349cc55cSDimitry Andricdef TuneThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
11870b57cec5SDimitry Andric                                       "ThunderXT81",
11880b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11890b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1190349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11910b57cec5SDimitry Andric
1192349cc55cSDimitry Andricdef TuneThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
11930b57cec5SDimitry Andric                                       "ThunderXT83",
11940b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11950b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1196349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11970b57cec5SDimitry Andric
1198349cc55cSDimitry Andricdef TuneTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
11990b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
12000b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
12010b57cec5SDimitry Andric                                  FeatureFuseAES,
1202349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
12030b57cec5SDimitry Andric
12042a66634dSDimitry Andricdef TuneAmpere1 : SubtargetFeature<"ampere1", "ARMProcFamily", "Ampere1",
12052a66634dSDimitry Andric                                   "Ampere Computing Ampere-1 processors", [
12062a66634dSDimitry Andric                                   FeaturePostRAScheduler,
12072a66634dSDimitry Andric                                   FeatureFuseAES,
12082a66634dSDimitry Andric                                   FeatureLSLFast,
12092a66634dSDimitry Andric                                   FeatureAggressiveFMA,
12102a66634dSDimitry Andric                                   FeatureArithmeticBccFusion,
12112a66634dSDimitry Andric                                   FeatureCmpBccFusion,
12122a66634dSDimitry Andric                                   FeatureFuseAddress,
12132a66634dSDimitry Andric                                   FeatureFuseLiterals]>;
1214349cc55cSDimitry Andric
1215bdd1243dSDimitry Andricdef TuneAmpere1A : SubtargetFeature<"ampere1a", "ARMProcFamily", "Ampere1A",
1216bdd1243dSDimitry Andric                                    "Ampere Computing Ampere-1A processors", [
1217bdd1243dSDimitry Andric                                    FeaturePostRAScheduler,
1218bdd1243dSDimitry Andric                                    FeatureFuseAES,
1219bdd1243dSDimitry Andric                                    FeatureLSLFast,
1220bdd1243dSDimitry Andric                                    FeatureAggressiveFMA,
1221bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1222bdd1243dSDimitry Andric                                    FeatureCmpBccFusion,
1223bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1224bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1225bdd1243dSDimitry Andric                                    FeatureFuseLiterals]>;
1226bdd1243dSDimitry Andric
1227349cc55cSDimitry Andricdef ProcessorFeatures {
1228349cc55cSDimitry Andric  list<SubtargetFeature> A53  = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1229349cc55cSDimitry Andric                                 FeatureFPARMv8, FeatureNEON, FeaturePerfMon];
1230349cc55cSDimitry Andric  list<SubtargetFeature> A55  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1231349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1232349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon];
1233349cc55cSDimitry Andric  list<SubtargetFeature> A510 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1234349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1235349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1236349cc55cSDimitry Andric                                 FeatureFP16FML];
1237349cc55cSDimitry Andric  list<SubtargetFeature> A65  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1238349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
123981ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeatureRAS,
124081ad6265SDimitry Andric                                 FeaturePerfMon];
1241349cc55cSDimitry Andric  list<SubtargetFeature> A76  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1242349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
124381ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1244349cc55cSDimitry Andric  list<SubtargetFeature> A77  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1245349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
124681ad6265SDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSSBS];
1247349cc55cSDimitry Andric  list<SubtargetFeature> A78  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1248349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1249349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSPE,
1250349cc55cSDimitry Andric                                 FeatureSSBS];
1251349cc55cSDimitry Andric  list<SubtargetFeature> A78C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1252349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1253349cc55cSDimitry Andric                                 FeatureFlagM, FeatureFP16FML, FeaturePAuth,
1254349cc55cSDimitry Andric                                 FeaturePerfMon, FeatureRCPC, FeatureSPE,
1255349cc55cSDimitry Andric                                 FeatureSSBS];
1256349cc55cSDimitry Andric  list<SubtargetFeature> A710 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1257349cc55cSDimitry Andric                                 FeatureETE, FeatureMTE, FeatureFP16FML,
1258349cc55cSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureMatMulInt8];
1259bdd1243dSDimitry Andric  list<SubtargetFeature> A715 = [HasV9_0aOps, FeatureNEON, FeatureMTE,
1260bdd1243dSDimitry Andric                                 FeatureFP16FML, FeatureSVE, FeatureTRBE,
1261bdd1243dSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureETE,
1262bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureMatMulInt8, FeatureSPE];
126304eeddc0SDimitry Andric  list<SubtargetFeature> R82  = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
126404eeddc0SDimitry Andric                                 FeatureFP16FML, FeatureSSBS, FeaturePredRes,
126581ad6265SDimitry Andric                                 FeatureSB];
1266349cc55cSDimitry Andric  list<SubtargetFeature> X1   = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1267349cc55cSDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
12683a9a9c0cSDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
12693a9a9c0cSDimitry Andric                                 FeatureSSBS];
12701fd87a68SDimitry Andric  list<SubtargetFeature> X1C  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1271bdd1243dSDimitry Andric                                 FeatureNEON, FeatureRCPC_IMMO, FeaturePerfMon,
12721fd87a68SDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
1273bdd1243dSDimitry Andric                                 FeaturePAuth, FeatureSSBS, FeatureFlagM,
1274bdd1243dSDimitry Andric                                 FeatureLSE2];
1275349cc55cSDimitry Andric  list<SubtargetFeature> X2   = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1276349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1277349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1278349cc55cSDimitry Andric                                 FeatureFP16FML];
1279bdd1243dSDimitry Andric  list<SubtargetFeature> X3 =   [HasV9_0aOps, FeatureSVE, FeatureNEON,
1280bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureETE, FeatureTRBE,
1281bdd1243dSDimitry Andric                                 FeatureSPE, FeatureBF16, FeatureMatMulInt8,
1282bdd1243dSDimitry Andric                                 FeatureMTE, FeatureSVE2BitPerm, FeatureFullFP16,
1283bdd1243dSDimitry Andric                                 FeatureFP16FML];
1284349cc55cSDimitry Andric  list<SubtargetFeature> A64FX    = [HasV8_2aOps, FeatureFPARMv8, FeatureNEON,
1285349cc55cSDimitry Andric                                     FeatureSHA2, FeaturePerfMon, FeatureFullFP16,
1286349cc55cSDimitry Andric                                     FeatureSVE, FeatureComplxNum];
1287349cc55cSDimitry Andric  list<SubtargetFeature> Carmel   = [HasV8_2aOps, FeatureNEON, FeatureCrypto,
1288349cc55cSDimitry Andric                                     FeatureFullFP16];
1289349cc55cSDimitry Andric  list<SubtargetFeature> AppleA7  = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1290349cc55cSDimitry Andric                                     FeatureNEON,FeaturePerfMon, FeatureAppleA7SysReg];
1291349cc55cSDimitry Andric  list<SubtargetFeature> AppleA10 = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1292349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureCRC,
1293349cc55cSDimitry Andric                                     FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH];
1294349cc55cSDimitry Andric  list<SubtargetFeature> AppleA11 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1295349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1296349cc55cSDimitry Andric  list<SubtargetFeature> AppleA12 = [HasV8_3aOps, FeatureCrypto, FeatureFPARMv8,
1297349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1298349cc55cSDimitry Andric  list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1299349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16,
1300349cc55cSDimitry Andric                                     FeatureFP16FML, FeatureSHA3];
1301349cc55cSDimitry Andric  list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1302349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
1303349cc55cSDimitry Andric                                     FeatureSpecRestrict, FeatureSSBS, FeatureSB,
1304349cc55cSDimitry Andric                                     FeaturePredRes, FeatureCacheDeepPersist,
1305349cc55cSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML, FeatureSHA3,
1306349cc55cSDimitry Andric                                     FeatureAltFPCmp];
1307bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA15 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1308bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1309bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML];
1310bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA16 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1311bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1312bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML,
1313bdd1243dSDimitry Andric                                     FeatureHCX];
1314349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM3 = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1315349cc55cSDimitry Andric                                     FeaturePerfMon];
1316349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM4 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1317349cc55cSDimitry Andric                                     FeatureFullFP16, FeaturePerfMon];
1318349cc55cSDimitry Andric  list<SubtargetFeature> Falkor   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1319349cc55cSDimitry Andric                                     FeatureFPARMv8, FeatureNEON, FeaturePerfMon,
1320349cc55cSDimitry Andric                                     FeatureRDM];
1321349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseE1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1322349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
132381ad6265SDimitry Andric                                       FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1324349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1325349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
132681ad6265SDimitry Andric                                       FeatureRCPC, FeatureSPE, FeatureSSBS,
132781ad6265SDimitry Andric                                       FeaturePerfMon];
1328349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN2 = [HasV8_5aOps, FeatureBF16, FeatureETE,
1329349cc55cSDimitry Andric                                       FeatureMatMulInt8, FeatureMTE, FeatureSVE2,
133081ad6265SDimitry Andric                                       FeatureSVE2BitPerm, FeatureTRBE, FeatureCrypto,
133181ad6265SDimitry Andric                                       FeaturePerfMon];
1332349cc55cSDimitry Andric  list<SubtargetFeature> Neoverse512TVB = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1333349cc55cSDimitry Andric                                           FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1334349cc55cSDimitry Andric                                           FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1335349cc55cSDimitry Andric                                           FeaturePerfMon, FeatureRandGen, FeatureSPE,
1336349cc55cSDimitry Andric                                           FeatureSSBS, FeatureSVE];
1337349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseV1 = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1338349cc55cSDimitry Andric                                       FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1339349cc55cSDimitry Andric                                       FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1340349cc55cSDimitry Andric                                       FeaturePerfMon, FeatureRandGen, FeatureSPE,
1341349cc55cSDimitry Andric                                       FeatureSSBS, FeatureSVE];
1342bdd1243dSDimitry Andric  list<SubtargetFeature> NeoverseV2 = [HasV9_0aOps, FeatureBF16, FeatureSPE,
1343bdd1243dSDimitry Andric                                       FeaturePerfMon, FeatureETE, FeatureMatMulInt8,
1344bdd1243dSDimitry Andric                                       FeatureNEON, FeatureSVE2BitPerm, FeatureFP16FML,
1345bdd1243dSDimitry Andric                                       FeatureMTE, FeatureRandGen];
1346349cc55cSDimitry Andric  list<SubtargetFeature> Saphira    = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1347349cc55cSDimitry Andric                                       FeatureNEON, FeatureSPE, FeaturePerfMon];
1348349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1349349cc55cSDimitry Andric                                       FeatureFPARMv8, FeaturePerfMon, FeatureNEON];
1350349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX2T99  = [HasV8_1aOps, FeatureCRC, FeatureCrypto,
1351349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE];
1352349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX3T110 = [HasV8_3aOps, FeatureCRC, FeatureCrypto,
1353349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE,
1354349cc55cSDimitry Andric                                          FeaturePAuth, FeaturePerfMon];
1355349cc55cSDimitry Andric  list<SubtargetFeature> TSV110 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1356349cc55cSDimitry Andric                                   FeatureNEON, FeaturePerfMon, FeatureSPE,
1357349cc55cSDimitry Andric                                   FeatureFullFP16, FeatureFP16FML, FeatureDotProd];
13582a66634dSDimitry Andric  list<SubtargetFeature> Ampere1 = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1359bdd1243dSDimitry Andric                                    FeatureSSBS, FeatureRandGen, FeatureSB,
1360bdd1243dSDimitry Andric                                    FeatureSHA2, FeatureSHA3, FeatureAES];
1361bdd1243dSDimitry Andric  list<SubtargetFeature> Ampere1A = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1362bdd1243dSDimitry Andric                                     FeatureMTE, FeatureSSBS, FeatureRandGen,
1363bdd1243dSDimitry Andric                                     FeatureSB, FeatureSM4, FeatureSHA2,
1364bdd1243dSDimitry Andric                                     FeatureSHA3, FeatureAES];
1365349cc55cSDimitry Andric
13665ffd83dbSDimitry Andric  // ETE and TRBE are future architecture extensions. We temporarily enable them
1367349cc55cSDimitry Andric  // by default for users targeting generic AArch64. The extensions do not
13688bcb0991SDimitry Andric  // affect code generated by the compiler and can be used only by explicitly
13698bcb0991SDimitry Andric  // mentioning the new system register names in assembly.
137081ad6265SDimitry Andric  list<SubtargetFeature> Generic = [FeatureFPARMv8, FeatureNEON, FeatureETE];
1371349cc55cSDimitry Andric}
13720b57cec5SDimitry Andric
137381ad6265SDimitry Andric// FeatureFuseAdrpAdd is enabled under Generic to allow linker merging
137481ad6265SDimitry Andric// optimizations.
1375349cc55cSDimitry Andricdef : ProcessorModel<"generic", CortexA55Model, ProcessorFeatures.Generic,
1376bdd1243dSDimitry Andric                     [FeatureFuseAES, FeatureFuseAdrpAdd, FeaturePostRAScheduler,
1377bdd1243dSDimitry Andric                      FeatureEnableSelectOptimize]>;
1378349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, ProcessorFeatures.A53,
1379349cc55cSDimitry Andric                     [TuneA35]>;
1380349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a34", CortexA53Model, ProcessorFeatures.A53,
1381349cc55cSDimitry Andric                     [TuneA35]>;
1382349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, ProcessorFeatures.A53,
1383349cc55cSDimitry Andric                     [TuneA53]>;
1384349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA55Model, ProcessorFeatures.A55,
1385349cc55cSDimitry Andric                     [TuneA55]>;
1386*06c3fb27SDimitry Andricdef : ProcessorModel<"cortex-a510", CortexA510Model, ProcessorFeatures.A510,
1387349cc55cSDimitry Andric                     [TuneA510]>;
1388349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, ProcessorFeatures.A53,
1389349cc55cSDimitry Andric                     [TuneA57]>;
1390349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, ProcessorFeatures.A65,
1391349cc55cSDimitry Andric                     [TuneA65]>;
1392349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, ProcessorFeatures.A65,
1393349cc55cSDimitry Andric                     [TuneA65]>;
1394349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, ProcessorFeatures.A53,
1395349cc55cSDimitry Andric                     [TuneA72]>;
1396349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, ProcessorFeatures.A53,
1397349cc55cSDimitry Andric                     [TuneA73]>;
1398349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, ProcessorFeatures.A55,
1399349cc55cSDimitry Andric                     [TuneA75]>;
1400349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, ProcessorFeatures.A76,
1401349cc55cSDimitry Andric                     [TuneA76]>;
1402349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, ProcessorFeatures.A76,
1403349cc55cSDimitry Andric                     [TuneA76]>;
1404349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a77", CortexA57Model, ProcessorFeatures.A77,
1405349cc55cSDimitry Andric                     [TuneA77]>;
1406349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78", CortexA57Model, ProcessorFeatures.A78,
1407349cc55cSDimitry Andric                     [TuneA78]>;
1408349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78c", CortexA57Model, ProcessorFeatures.A78C,
1409349cc55cSDimitry Andric                     [TuneA78C]>;
1410753f127fSDimitry Andricdef : ProcessorModel<"cortex-a710", NeoverseN2Model, ProcessorFeatures.A710,
1411349cc55cSDimitry Andric                     [TuneA710]>;
1412bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-a715", NeoverseN2Model, ProcessorFeatures.A715,
1413bdd1243dSDimitry Andric                     [TuneA715]>;
1414349cc55cSDimitry Andricdef : ProcessorModel<"cortex-r82", CortexA55Model, ProcessorFeatures.R82,
1415349cc55cSDimitry Andric                     [TuneR82]>;
1416349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x1", CortexA57Model, ProcessorFeatures.X1,
1417349cc55cSDimitry Andric                     [TuneX1]>;
14181fd87a68SDimitry Andricdef : ProcessorModel<"cortex-x1c", CortexA57Model, ProcessorFeatures.X1C,
14191fd87a68SDimitry Andric                     [TuneX1]>;
1420753f127fSDimitry Andricdef : ProcessorModel<"cortex-x2", NeoverseN2Model, ProcessorFeatures.X2,
1421349cc55cSDimitry Andric                     [TuneX2]>;
1422bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-x3", NeoverseN2Model, ProcessorFeatures.X3,
1423bdd1243dSDimitry Andric                     [TuneX3]>;
1424349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model,
1425349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
1426*06c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-n1", NeoverseN1Model,
1427349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
1428753f127fSDimitry Andricdef : ProcessorModel<"neoverse-n2", NeoverseN2Model,
1429349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
1430*06c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-512tvb", NeoverseV1Model,
1431349cc55cSDimitry Andric                     ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
1432*06c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-v1", NeoverseV1Model,
1433349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseV1, [TuneNeoverseV1]>;
1434*06c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-v2", NeoverseV2Model,
1435bdd1243dSDimitry Andric                     ProcessorFeatures.NeoverseV2, [TuneNeoverseV2]>;
1436349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, ProcessorFeatures.ExynosM3,
1437349cc55cSDimitry Andric                     [TuneExynosM3]>;
1438349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, ProcessorFeatures.ExynosM4,
1439349cc55cSDimitry Andric                     [TuneExynosM4]>;
1440349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM5Model, ProcessorFeatures.ExynosM4,
1441349cc55cSDimitry Andric                     [TuneExynosM4]>;
1442349cc55cSDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, ProcessorFeatures.Falkor,
1443349cc55cSDimitry Andric                     [TuneFalkor]>;
1444349cc55cSDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, ProcessorFeatures.Saphira,
1445349cc55cSDimitry Andric                     [TuneSaphira]>;
1446349cc55cSDimitry Andricdef : ProcessorModel<"kryo", KryoModel, ProcessorFeatures.A53, [TuneKryo]>;
1447349cc55cSDimitry Andric
14480b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
1449349cc55cSDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  ProcessorFeatures.ThunderX,
1450349cc55cSDimitry Andric                     [TuneThunderX]>;
1451349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,
1452349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT88]>;
1453349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,
1454349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT81]>;
1455349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,
1456349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT83]>;
14570b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
1458349cc55cSDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model,
1459349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX2T99, [TuneThunderX2T99]>;
1460e837bb5cSDimitry Andric// Marvell ThunderX3T110 Processors.
1461349cc55cSDimitry Andricdef : ProcessorModel<"thunderx3t110", ThunderX3T110Model,
1462349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX3T110, [TuneThunderX3T110]>;
1463349cc55cSDimitry Andricdef : ProcessorModel<"tsv110", TSV110Model, ProcessorFeatures.TSV110,
1464349cc55cSDimitry Andric                     [TuneTSV110]>;
14650b57cec5SDimitry Andric
1466480093f4SDimitry Andric// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
1467349cc55cSDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
1468349cc55cSDimitry Andric                     [TuneAppleA7]>;
1469480093f4SDimitry Andric
1470480093f4SDimitry Andric// iPhone and iPad CPUs
1471349cc55cSDimitry Andricdef : ProcessorModel<"apple-a7", CycloneModel, ProcessorFeatures.AppleA7,
1472349cc55cSDimitry Andric                     [TuneAppleA7]>;
1473349cc55cSDimitry Andricdef : ProcessorModel<"apple-a8", CycloneModel, ProcessorFeatures.AppleA7,
1474349cc55cSDimitry Andric                     [TuneAppleA7]>;
1475349cc55cSDimitry Andricdef : ProcessorModel<"apple-a9", CycloneModel, ProcessorFeatures.AppleA7,
1476349cc55cSDimitry Andric                     [TuneAppleA7]>;
1477349cc55cSDimitry Andricdef : ProcessorModel<"apple-a10", CycloneModel, ProcessorFeatures.AppleA10,
1478349cc55cSDimitry Andric                     [TuneAppleA10]>;
1479349cc55cSDimitry Andricdef : ProcessorModel<"apple-a11", CycloneModel, ProcessorFeatures.AppleA11,
1480349cc55cSDimitry Andric                     [TuneAppleA11]>;
1481349cc55cSDimitry Andricdef : ProcessorModel<"apple-a12", CycloneModel, ProcessorFeatures.AppleA12,
1482349cc55cSDimitry Andric                     [TuneAppleA12]>;
1483349cc55cSDimitry Andricdef : ProcessorModel<"apple-a13", CycloneModel, ProcessorFeatures.AppleA13,
1484349cc55cSDimitry Andric                     [TuneAppleA13]>;
1485349cc55cSDimitry Andricdef : ProcessorModel<"apple-a14", CycloneModel, ProcessorFeatures.AppleA14,
1486349cc55cSDimitry Andric                     [TuneAppleA14]>;
1487bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a15", CycloneModel, ProcessorFeatures.AppleA15,
1488bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1489bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16,
1490bdd1243dSDimitry Andric                     [TuneAppleA16]>;
1491480093f4SDimitry Andric
1492fe6060f1SDimitry Andric// Mac CPUs
1493349cc55cSDimitry Andricdef : ProcessorModel<"apple-m1", CycloneModel, ProcessorFeatures.AppleA14,
1494349cc55cSDimitry Andric                     [TuneAppleA14]>;
1495bdd1243dSDimitry Andricdef : ProcessorModel<"apple-m2", CycloneModel, ProcessorFeatures.AppleA15,
1496bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1497fe6060f1SDimitry Andric
1498480093f4SDimitry Andric// watch CPUs.
1499349cc55cSDimitry Andricdef : ProcessorModel<"apple-s4", CycloneModel, ProcessorFeatures.AppleA12,
1500349cc55cSDimitry Andric                     [TuneAppleA12]>;
1501349cc55cSDimitry Andricdef : ProcessorModel<"apple-s5", CycloneModel, ProcessorFeatures.AppleA12,
1502349cc55cSDimitry Andric                     [TuneAppleA12]>;
1503480093f4SDimitry Andric
15040b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
1505bdd1243dSDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, ProcessorFeatures.AppleA16,
1506bdd1243dSDimitry Andric                     [TuneAppleA16]>;
15070b57cec5SDimitry Andric
15085ffd83dbSDimitry Andric// Fujitsu A64FX
1509349cc55cSDimitry Andricdef : ProcessorModel<"a64fx", A64FXModel, ProcessorFeatures.A64FX,
1510349cc55cSDimitry Andric                     [TuneA64FX]>;
15115ffd83dbSDimitry Andric
15125ffd83dbSDimitry Andric// Nvidia Carmel
1513349cc55cSDimitry Andricdef : ProcessorModel<"carmel", NoSchedModel, ProcessorFeatures.Carmel,
1514349cc55cSDimitry Andric                     [TuneCarmel]>;
15155ffd83dbSDimitry Andric
15162a66634dSDimitry Andric// Ampere Computing
15172a66634dSDimitry Andricdef : ProcessorModel<"ampere1", Ampere1Model, ProcessorFeatures.Ampere1,
15182a66634dSDimitry Andric                     [TuneAmpere1]>;
15192a66634dSDimitry Andric
1520bdd1243dSDimitry Andricdef : ProcessorModel<"ampere1a", Ampere1Model, ProcessorFeatures.Ampere1A,
1521bdd1243dSDimitry Andric                     [TuneAmpere1A]>;
1522bdd1243dSDimitry Andric
15230b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15240b57cec5SDimitry Andric// Assembly parser
15250b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15260b57cec5SDimitry Andric
15270b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
15280b57cec5SDimitry Andric  int Variant = 0;
15290b57cec5SDimitry Andric  string Name = "generic";
15300b57cec5SDimitry Andric  string BreakCharacters = ".";
15310b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
15320b57cec5SDimitry Andric}
15330b57cec5SDimitry Andric
15340b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
15350b57cec5SDimitry Andric  int Variant = 1;
15360b57cec5SDimitry Andric  string Name = "apple-neon";
15370b57cec5SDimitry Andric  string BreakCharacters = ".";
15380b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
15390b57cec5SDimitry Andric}
15400b57cec5SDimitry Andric
15410b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15420b57cec5SDimitry Andric// Assembly printer
15430b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15440b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
15450b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
15460b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
15470b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
15480b57cec5SDimitry Andric  int PassSubtarget = 1;
15490b57cec5SDimitry Andric  int Variant = 0;
15500b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
15510b57cec5SDimitry Andric}
15520b57cec5SDimitry Andric
15530b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
15540b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
15550b57cec5SDimitry Andric  int PassSubtarget = 1;
15560b57cec5SDimitry Andric  int Variant = 1;
15570b57cec5SDimitry Andric  int isMCAsmWriter = 1;
15580b57cec5SDimitry Andric}
15590b57cec5SDimitry Andric
15600b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15610b57cec5SDimitry Andric// Target Declaration
15620b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15630b57cec5SDimitry Andric
15640b57cec5SDimitry Andricdef AArch64 : Target {
15650b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
15660b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
15670b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
15680b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
15690b57cec5SDimitry Andric}
15700b57cec5SDimitry Andric
15710b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15720b57cec5SDimitry Andric// Pfm Counters
15730b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15740b57cec5SDimitry Andric
15750b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
1576