xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
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.
5306c3fb27SDimitry 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
130*5f757f3fSDimitry Andricdef FeatureFPMR : SubtargetFeature<"fpmr", "HasFPMR", "true",
131*5f757f3fSDimitry Andric  "Enable FPMR Register (FEAT_FPMR)">;
132*5f757f3fSDimitry Andric
133*5f757f3fSDimitry Andricdef FeatureFP8 : SubtargetFeature<"fp8", "HasFP8", "true",
134*5f757f3fSDimitry Andric  "Enable FP8 instructions (FEAT_FP8)">;
135*5f757f3fSDimitry Andric
1365ffd83dbSDimitry Andric// This flag is currently still labeled as Experimental, but when fully
1375ffd83dbSDimitry Andric// implemented this should tell the compiler to use the zeroing pseudos to
1385ffd83dbSDimitry Andric// benefit from the reverse instructions (e.g. SUB vs SUBR) if the inactive
1395ffd83dbSDimitry Andric// lanes are known to be zero. The pseudos will then be expanded using the
1405ffd83dbSDimitry Andric// MOVPRFX instruction to zero the inactive lanes. This feature should only be
1415ffd83dbSDimitry Andric// enabled if MOVPRFX instructions are known to merge with the destructive
1425ffd83dbSDimitry Andric// operations they prefix.
1435ffd83dbSDimitry Andric//
1445ffd83dbSDimitry Andric// This feature could similarly be extended to support cheap merging of _any_
1455ffd83dbSDimitry Andric// value into the inactive lanes using the MOVPRFX instruction that uses
1465ffd83dbSDimitry Andric// merging-predication.
1475ffd83dbSDimitry Andricdef FeatureExperimentalZeroingPseudos
1485ffd83dbSDimitry Andric    : SubtargetFeature<"use-experimental-zeroing-pseudos",
1495ffd83dbSDimitry Andric                       "UseExperimentalZeroingPseudos", "true",
1505ffd83dbSDimitry Andric                       "Hint to the compiler that the MOVPRFX instruction is "
1515ffd83dbSDimitry Andric                       "merged with destructive operations",
1525ffd83dbSDimitry Andric                       []>;
1530b57cec5SDimitry Andric
154349cc55cSDimitry Andricdef FeatureUseScalarIncVL : SubtargetFeature<"use-scalar-inc-vl",
155349cc55cSDimitry Andric  "UseScalarIncVL", "true", "Prefer inc/dec over add+cnt">;
156349cc55cSDimitry Andric
157*5f757f3fSDimitry Andricdef FeatureBF16 : SubtargetFeature<"bf16", "HasBF16",
158*5f757f3fSDimitry Andric    "true", "Enable BFloat16 Extension (FEAT_BF16)" >;
159*5f757f3fSDimitry Andric
1608a4dda33SDimitry Andricdef FeatureNoSVEFPLD1R : SubtargetFeature<"no-sve-fp-ld1r",
1618a4dda33SDimitry Andric  "NoSVEFPLD1R", "true", "Avoid using LD1RX instructions for FP">;
1628a4dda33SDimitry Andric
1630b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
164bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions (FEAT_SVE2)",
165349cc55cSDimitry Andric  [FeatureSVE, FeatureUseScalarIncVL]>;
1660b57cec5SDimitry Andric
1670b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
168bdd1243dSDimitry Andric  "Enable AES SVE2 instructions (FEAT_SVE_AES, FEAT_SVE_PMULL128)",
169bdd1243dSDimitry Andric  [FeatureSVE2, FeatureAES]>;
1700b57cec5SDimitry Andric
1710b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
172bdd1243dSDimitry Andric  "Enable SM4 SVE2 instructions (FEAT_SVE_SM4)", [FeatureSVE2, FeatureSM4]>;
1730b57cec5SDimitry Andric
1740b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
175bdd1243dSDimitry Andric  "Enable SHA3 SVE2 instructions (FEAT_SVE_SHA3)", [FeatureSVE2, FeatureSHA3]>;
1760b57cec5SDimitry Andric
1770b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
178bdd1243dSDimitry Andric  "Enable bit permutation SVE2 instructions (FEAT_SVE_BitPerm)", [FeatureSVE2]>;
179bdd1243dSDimitry Andric
180bdd1243dSDimitry Andricdef FeatureSVE2p1: SubtargetFeature<"sve2p1", "HasSVE2p1", "true",
181bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2.1 instructions", [FeatureSVE2]>;
182bdd1243dSDimitry Andric
183bdd1243dSDimitry Andricdef FeatureB16B16 : SubtargetFeature<"b16b16", "HasB16B16", "true",
184*5f757f3fSDimitry Andric  "Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions (FEAT_B16B16)", [FeatureBF16]>;
1850b57cec5SDimitry Andric
1860b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
1870b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
1888bcb0991SDimitry Andric
1890b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
1900b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
1910b57cec5SDimitry Andric
19281ad6265SDimitry Andric// It is generally beneficial to rewrite "fmov s0, wzr" to "movi d0, #0".
19381ad6265SDimitry Andric// as movi is more efficient across all cores. Newer cores can eliminate
19481ad6265SDimitry Andric// fmovs early and there is no difference with movi, but this not true for
19581ad6265SDimitry Andric// all implementations.
196fe6060f1SDimitry Andricdef FeatureNoZCZeroingFP : SubtargetFeature<"no-zcz-fp", "HasZeroCycleZeroingFP", "false",
197fe6060f1SDimitry Andric                                        "Has no zero-cycle zeroing instructions for FP registers">;
1980b57cec5SDimitry Andric
1990b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
2000b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
201fe6060f1SDimitry Andric                                        [FeatureZCZeroingGP]>;
2020b57cec5SDimitry Andric
2030b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
2040b57cec5SDimitry Andric/// CPUs.
2050b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
2060b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
2070b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
2080b57cec5SDimitry Andric
2090b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
21081ad6265SDimitry Andric                                          "RequiresStrictAlign", "true",
2110b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
2120b57cec5SDimitry Andric                                          "access">;
2130b57cec5SDimitry Andric
2145ffd83dbSDimitry Andricforeach i = {1-7,9-15,18,20-28,30} in
2150b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
2160b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
2170b57cec5SDimitry Andric                                             "as a GPR">;
2180b57cec5SDimitry Andric
2190b57cec5SDimitry Andricforeach i = {8-15,18} in
2200b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
2210b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
2220b57cec5SDimitry Andric
2230b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
2240b57cec5SDimitry Andric    "true",
2250b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
2260b57cec5SDimitry Andric
2270b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
2280b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
2290b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
2300b57cec5SDimitry Andric
231bdd1243dSDimitry Andricdef FeatureEnableSelectOptimize : SubtargetFeature<
232bdd1243dSDimitry Andric    "enable-select-opt", "EnableSelectOptimize", "true",
233bdd1243dSDimitry Andric    "Enable the select optimize pass for select loop heuristics">;
234bdd1243dSDimitry Andric
2350b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
23681ad6265SDimitry Andric    "HasExynosCheapAsMoveHandling", "true",
237*5f757f3fSDimitry Andric    "Use Exynos specific handling of cheap instructions">;
2380b57cec5SDimitry Andric
2390b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
2400b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
2410b57cec5SDimitry Andric
2420b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
24381ad6265SDimitry Andric    "IsMisaligned128StoreSlow", "true", "Misaligned 128 bit stores are slow">;
2440b57cec5SDimitry Andric
2450b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
24681ad6265SDimitry Andric    "IsPaired128Slow", "true", "Paired 128 bit loads and stores are slow">;
2470b57cec5SDimitry Andric
24881ad6265SDimitry Andricdef FeatureAscendStoreAddress : SubtargetFeature<"ascend-store-address",
249fcaf7f86SDimitry Andric    "IsStoreAddressAscend", "true",
25081ad6265SDimitry Andric    "Schedule vector stores by ascending address">;
25181ad6265SDimitry Andric
25281ad6265SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "IsSTRQroSlow",
2530b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
2540b57cec5SDimitry Andric
2550b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
2560b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
2570b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
2580b57cec5SDimitry Andric
2590b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
2600b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
2610b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
2620b57cec5SDimitry Andric
2630b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
2640b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
2650b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
2660b57cec5SDimitry Andric
267e8d8bef9SDimitry Andricdef FeatureCmpBccFusion : SubtargetFeature<
268e8d8bef9SDimitry Andric    "cmp-bcc-fusion", "HasCmpBccFusion", "true",
269e8d8bef9SDimitry Andric    "CPU fuses cmp+bcc operations">;
270e8d8bef9SDimitry Andric
2710b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
2720b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
2730b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
2740b57cec5SDimitry Andric
2750b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
2760b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
2770b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
2780b57cec5SDimitry Andric
2790b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
2800b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
2810b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
2820b57cec5SDimitry Andric
2830b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
2840b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
2850b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
2860b57cec5SDimitry Andric
2870b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
2880b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
2890b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
2900b57cec5SDimitry Andric
29181ad6265SDimitry Andricdef FeatureFuseAdrpAdd : SubtargetFeature<
29281ad6265SDimitry Andric    "fuse-adrp-add", "HasFuseAdrpAdd", "true",
29381ad6265SDimitry Andric    "CPU fuses adrp+add operations">;
29481ad6265SDimitry Andric
2950b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
2960b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
2970b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
2980b57cec5SDimitry Andric
29906c3fb27SDimitry Andricdef FeatureFuseAddSub2RegAndConstOne : SubtargetFeature<
30006c3fb27SDimitry Andric   "fuse-addsub-2reg-const1", "HasFuseAddSub2RegAndConstOne", "true",
30106c3fb27SDimitry Andric   "CPU fuses (a + b + 1) and (a - b - 1)">;
30206c3fb27SDimitry Andric
3030b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
3040b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
3050b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
3060b57cec5SDimitry Andric
307*5f757f3fSDimitry Andricdef FeatureStorePairSuppress : SubtargetFeature<
308*5f757f3fSDimitry Andric    "store-pair-suppress", "EnableStorePairSuppress", "true",
309*5f757f3fSDimitry Andric    "Enable Store Pair Suppression heuristics">;
310*5f757f3fSDimitry Andric
3110b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
3120b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
3130b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
3140b57cec5SDimitry Andric
3150b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
316bdd1243dSDimitry Andric                                   "Enable support for RCPC extension (FEAT_LRCPC)">;
3170b57cec5SDimitry Andric
3180b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
3190b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
3200b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
3210b57cec5SDimitry Andric
3220b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
3230b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
324bdd1243dSDimitry Andric    "Enable dot product support (FEAT_DotProd)">;
3250b57cec5SDimitry Andric
326e8d8bef9SDimitry Andricdef FeaturePAuth : SubtargetFeature<
327e8d8bef9SDimitry Andric    "pauth", "HasPAuth", "true",
328bdd1243dSDimitry Andric    "Enable v8.3-A Pointer Authentication extension (FEAT_PAuth)">;
3290b57cec5SDimitry Andric
3300b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
3310b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
332bdd1243dSDimitry Andric    "Enable v8.3-A JavaScript FP conversion instructions (FEAT_JSCVT)",
3330b57cec5SDimitry Andric    [FeatureFPARMv8]>;
3340b57cec5SDimitry Andric
3350b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
3360b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
337bdd1243dSDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets (FEAT_CCIDX)">;
3380b57cec5SDimitry Andric
3390b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
3400b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
341bdd1243dSDimitry Andric    "Enable v8.3-A Floating-point complex number support (FEAT_FCMA)",
3420b57cec5SDimitry Andric    [FeatureNEON]>;
3430b57cec5SDimitry Andric
3440b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
3450b57cec5SDimitry Andric    "nv", "HasNV", "true",
346bdd1243dSDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement (FEAT_NV, FEAT_NV2)">;
3470b57cec5SDimitry Andric
3480b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
3490b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
350bdd1243dSDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension (FEAT_MPAM)">;
3510b57cec5SDimitry Andric
3520b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
3530b57cec5SDimitry Andric    "dit", "HasDIT", "true",
354bdd1243dSDimitry Andric    "Enable v8.4-A Data Independent Timing instructions (FEAT_DIT)">;
3550b57cec5SDimitry Andric
3560b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
3570b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
358bdd1243dSDimitry Andric    "Enable v8.4-A Trace extension (FEAT_TRF)">;
3590b57cec5SDimitry Andric
3600b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
3610b57cec5SDimitry Andric    "am", "HasAM", "true",
362bdd1243dSDimitry Andric    "Enable v8.4-A Activity Monitors extension (FEAT_AMUv1)">;
3630b57cec5SDimitry Andric
3645ffd83dbSDimitry Andricdef FeatureAMVS : SubtargetFeature<
3655ffd83dbSDimitry Andric    "amvs", "HasAMVS", "true",
366bdd1243dSDimitry Andric    "Enable v8.6-A Activity Monitors Virtualization support (FEAT_AMUv1p1)",
3675ffd83dbSDimitry Andric    [FeatureAM]>;
3685ffd83dbSDimitry Andric
3690b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
3700b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
371bdd1243dSDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension (FEAT_SEL2)">;
3720b57cec5SDimitry Andric
3730b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
3740b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
375bdd1243dSDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions (FEAT_TLBIOS, FEAT_TLBIRANGE)">;
3760b57cec5SDimitry Andric
377e8d8bef9SDimitry Andricdef FeatureFlagM : SubtargetFeature<
378e8d8bef9SDimitry Andric    "flagm", "HasFlagM", "true",
379bdd1243dSDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions (FEAT_FlagM)">;
3800b57cec5SDimitry Andric
3810b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3820b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
383bdd1243dSDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets (FEAT_LRCPC2)",
3840b57cec5SDimitry Andric    [FeatureRCPC]>;
3850b57cec5SDimitry Andric
3860b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3870b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3880b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3890b57cec5SDimitry Andric                                        "to their negated or complemented "
3900b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3910b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3920b57cec5SDimitry Andric
393*5f757f3fSDimitry Andricdef FeatureAddrLSLFast : SubtargetFeature<
394*5f757f3fSDimitry Andric    "addr-lsl-fast", "HasAddrLSLFast", "true",
395*5f757f3fSDimitry Andric    "Address operands with logical shift of up to 3 places are cheap">;
396*5f757f3fSDimitry Andric
397*5f757f3fSDimitry Andricdef FeatureALULSLFast : SubtargetFeature<
398*5f757f3fSDimitry Andric    "alu-lsl-fast", "HasALULSLFast", "true",
399*5f757f3fSDimitry Andric    "Add/Sub operations with lsl shift <= 4 are cheap">;
4000b57cec5SDimitry Andric
4010b57cec5SDimitry Andricdef FeatureAggressiveFMA :
4020b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
4030b57cec5SDimitry Andric                   "HasAggressiveFMA",
4040b57cec5SDimitry Andric                   "true",
4050b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
4060b57cec5SDimitry Andric
4070b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
408bdd1243dSDimitry Andric  "Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)">;
4090b57cec5SDimitry Andric
4100b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
4110b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
412bdd1243dSDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int (FEAT_FRINTTS)" >;
4130b57cec5SDimitry Andric
4140b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
415bdd1243dSDimitry Andric  "true", "Enable architectural speculation restriction (FEAT_CSV2_2)">;
4160b57cec5SDimitry Andric
4170b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
418bdd1243dSDimitry Andric  "true", "Enable v8.5 Speculation Barrier (FEAT_SB)" >;
4190b57cec5SDimitry Andric
4200b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
421bdd1243dSDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit (FEAT_SSBS, FEAT_SSBS2)" >;
4220b57cec5SDimitry Andric
4230b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
424bdd1243dSDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions (FEAT_SPECRES)" >;
4250b57cec5SDimitry Andric
4260b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
427bdd1243dSDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)" >;
4280b57cec5SDimitry Andric
4290b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
430bdd1243dSDimitry Andric    "true", "Enable Branch Target Identification (FEAT_BTI)" >;
4310b57cec5SDimitry Andric
4320b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
433bdd1243dSDimitry Andric    "true", "Enable Random Number generation instructions (FEAT_RNG)" >;
4340b57cec5SDimitry Andric
4350b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
436bdd1243dSDimitry Andric    "true", "Enable Memory Tagging Extension (FEAT_MTE, FEAT_MTE2)" >;
4370b57cec5SDimitry Andric
4388bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
439bdd1243dSDimitry Andric    "true", "Enable Trace Buffer Extension (FEAT_TRBE)">;
4408bcb0991SDimitry Andric
4418bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
442bdd1243dSDimitry Andric    "true", "Enable Embedded Trace Extension (FEAT_ETE)",
4438bcb0991SDimitry Andric    [FeatureTRBE]>;
4448bcb0991SDimitry Andric
4458bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
446bdd1243dSDimitry Andric    "true", "Enable Transactional Memory Extension (FEAT_TME)" >;
4478bcb0991SDimitry Andric
4488bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
4498bcb0991SDimitry Andric    "AllowTaggedGlobals",
4508bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
4518bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
4528bcb0991SDimitry Andric
4535ffd83dbSDimitry Andricdef FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
454bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply Int8 Extension (FEAT_I8MM)">;
4555ffd83dbSDimitry Andric
4565ffd83dbSDimitry Andricdef FeatureMatMulFP32 : SubtargetFeature<"f32mm", "HasMatMulFP32",
457bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP32 Extension (FEAT_F32MM)", [FeatureSVE]>;
4585ffd83dbSDimitry Andric
4595ffd83dbSDimitry Andricdef FeatureMatMulFP64 : SubtargetFeature<"f64mm", "HasMatMulFP64",
460bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP64 Extension (FEAT_F64MM)", [FeatureSVE]>;
4615ffd83dbSDimitry Andric
462e8d8bef9SDimitry Andricdef FeatureXS : SubtargetFeature<"xs", "HasXS",
463bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A limited-TLB-maintenance instruction (FEAT_XS)">;
464e8d8bef9SDimitry Andric
465e8d8bef9SDimitry Andricdef FeatureWFxT : SubtargetFeature<"wfxt", "HasWFxT",
466bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A WFET and WFIT instruction (FEAT_WFxT)">;
467e8d8bef9SDimitry Andric
468e8d8bef9SDimitry Andricdef FeatureHCX : SubtargetFeature<
469bdd1243dSDimitry Andric    "hcx", "HasHCX", "true", "Enable Armv8.7-A HCRX_EL2 system register (FEAT_HCX)">;
470e8d8bef9SDimitry Andric
471e8d8bef9SDimitry Andricdef FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
472bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A LD64B/ST64B Accelerator Extension (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)">;
473e8d8bef9SDimitry Andric
47404eeddc0SDimitry Andricdef FeatureHBC : SubtargetFeature<"hbc", "HasHBC",
475bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Hinted Conditional Branches Extension (FEAT_HBC)">;
47604eeddc0SDimitry Andric
47704eeddc0SDimitry Andricdef FeatureMOPS : SubtargetFeature<"mops", "HasMOPS",
478bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A memcpy and memset acceleration instructions (FEAT_MOPS)">;
479bdd1243dSDimitry Andric
480bdd1243dSDimitry Andricdef FeatureNMI : SubtargetFeature<"nmi", "HasNMI",
481bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Non-maskable Interrupts (FEAT_NMI, FEAT_GICv3_NMI)">;
48204eeddc0SDimitry Andric
483e8d8bef9SDimitry Andricdef FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
484bdd1243dSDimitry Andric    "true", "Enable Branch Record Buffer Extension (FEAT_BRBE)">;
485e8d8bef9SDimitry Andric
486e8d8bef9SDimitry Andricdef FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
487bdd1243dSDimitry Andric    "true", "Enable extra register in the Statistical Profiling Extension (FEAT_SPEv1p2)">;
488e8d8bef9SDimitry Andric
4895ffd83dbSDimitry Andricdef FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
490bdd1243dSDimitry Andric    "true", "Enable fine grained virtualization traps extension (FEAT_FGT)">;
4915ffd83dbSDimitry Andric
4925ffd83dbSDimitry Andricdef FeatureEnhancedCounterVirtualization :
4935ffd83dbSDimitry Andric      SubtargetFeature<"ecv", "HasEnhancedCounterVirtualization",
494bdd1243dSDimitry Andric      "true", "Enable enhanced counter virtualization extension (FEAT_ECV)">;
4955ffd83dbSDimitry Andric
496fe6060f1SDimitry Andricdef FeatureRME : SubtargetFeature<"rme", "HasRME",
497bdd1243dSDimitry Andric    "true", "Enable Realm Management Extension (FEAT_RME)">;
498fe6060f1SDimitry Andric
499fe6060f1SDimitry Andricdef FeatureSME : SubtargetFeature<"sme", "HasSME", "true",
500bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) (FEAT_SME)", [FeatureBF16, FeatureUseScalarIncVL]>;
501fe6060f1SDimitry Andric
502bdd1243dSDimitry Andricdef FeatureSMEF64F64 : SubtargetFeature<"sme-f64f64", "HasSMEF64F64", "true",
503bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) F64F64 instructions (FEAT_SME_F64F64)", [FeatureSME]>;
504fe6060f1SDimitry Andric
505bdd1243dSDimitry Andricdef FeatureSMEI16I64 : SubtargetFeature<"sme-i16i64", "HasSMEI16I64", "true",
506bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) I16I64 instructions (FEAT_SME_I16I64)", [FeatureSME]>;
507bdd1243dSDimitry Andric
508bdd1243dSDimitry Andricdef FeatureSMEF16F16 : SubtargetFeature<"sme-f16f16", "HasSMEF16F16", "true",
509bdd1243dSDimitry Andric  "Enable SME2.1 non-widening Float16 instructions (FEAT_SME_F16F16)", []>;
510bdd1243dSDimitry Andric
511*5f757f3fSDimitry Andricdef FeatureSMEFA64 : SubtargetFeature<"sme-fa64", "HasSMEFA64", "true",
512*5f757f3fSDimitry Andric  "Enable the full A64 instruction set in streaming SVE mode (FEAT_SME_FA64)", [FeatureSME, FeatureSVE2]>;
513*5f757f3fSDimitry Andric
514bdd1243dSDimitry Andricdef FeatureSME2 : SubtargetFeature<"sme2", "HasSME2", "true",
515bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2 (SME2) instructions", [FeatureSME]>;
516bdd1243dSDimitry Andric
517bdd1243dSDimitry Andricdef FeatureSME2p1 : SubtargetFeature<"sme2p1", "HasSME2p1", "true",
518bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2.1 (FEAT_SME2p1) instructions", [FeatureSME2]>;
519fe6060f1SDimitry Andric
520*5f757f3fSDimitry Andricdef FeatureFAMINMAX: SubtargetFeature<"faminmax", "HasFAMINMAX", "true",
521*5f757f3fSDimitry Andric   "Enable FAMIN and FAMAX instructions (FEAT_FAMINMAX)">;
522*5f757f3fSDimitry Andric
523*5f757f3fSDimitry Andricdef FeatureFP8FMA : SubtargetFeature<"fp8fma", "HasFP8FMA", "true",
524*5f757f3fSDimitry Andric  "Enable fp8 multiply-add instructions (FEAT_FP8FMA)">;
525*5f757f3fSDimitry Andric
526*5f757f3fSDimitry Andricdef FeatureSSVE_FP8FMA : SubtargetFeature<"ssve-fp8fma", "HasSSVE_FP8FMA", "true",
527*5f757f3fSDimitry Andric  "Enable SVE2 fp8 multiply-add instructions (FEAT_SSVE_FP8FMA)", [FeatureSME2]>;
528*5f757f3fSDimitry Andric
529*5f757f3fSDimitry Andricdef FeatureFP8DOT2: SubtargetFeature<"fp8dot2", "HasFP8DOT2", "true",
530*5f757f3fSDimitry Andric   "Enable fp8 2-way dot instructions (FEAT_FP8DOT2)">;
531*5f757f3fSDimitry Andric
532*5f757f3fSDimitry Andricdef FeatureSSVE_FP8DOT2 : SubtargetFeature<"ssve-fp8dot2", "HasSSVE_FP8DOT2", "true",
533*5f757f3fSDimitry Andric  "Enable SVE2 fp8 2-way dot product instructions (FEAT_SSVE_FP8DOT2)", [FeatureSME2]>;
534*5f757f3fSDimitry Andric
535*5f757f3fSDimitry Andricdef FeatureFP8DOT4: SubtargetFeature<"fp8dot4", "HasFP8DOT4", "true",
536*5f757f3fSDimitry Andric   "Enable fp8 4-way dot instructions (FEAT_FP8DOT4)">;
537*5f757f3fSDimitry Andric
538*5f757f3fSDimitry Andricdef FeatureSSVE_FP8DOT4 : SubtargetFeature<"ssve-fp8dot4", "HasSSVE_FP8DOT4", "true",
539*5f757f3fSDimitry Andric  "Enable SVE2 fp8 4-way dot product instructions (FEAT_SSVE_FP8DOT4)", [FeatureSME2]>;
540*5f757f3fSDimitry Andricdef FeatureLUT: SubtargetFeature<"lut", "HasLUT", "true",
541*5f757f3fSDimitry Andric   "Enable Lookup Table instructions (FEAT_LUT)">;
542*5f757f3fSDimitry Andric
543*5f757f3fSDimitry Andricdef FeatureSME_LUTv2 : SubtargetFeature<"sme-lutv2", "HasSME_LUTv2", "true",
544*5f757f3fSDimitry Andric  "Enable Scalable Matrix Extension (SME) LUTv2 instructions (FEAT_SME_LUTv2)">;
545*5f757f3fSDimitry Andric
546*5f757f3fSDimitry Andricdef FeatureSMEF8F16 : SubtargetFeature<"sme-f8f16", "HasSMEF8F16", "true",
547*5f757f3fSDimitry Andric  "Enable Scalable Matrix Extension (SME) F8F16 instructions(FEAT_SME_F8F16)", [FeatureSME2, FeatureFP8]>;
548*5f757f3fSDimitry Andric
549*5f757f3fSDimitry Andricdef FeatureSMEF8F32 : SubtargetFeature<"sme-f8f32", "HasSMEF8F32", "true",
550*5f757f3fSDimitry Andric  "Enable Scalable Matrix Extension (SME) F8F32 instructions (FEAT_SME_F8F32)", [FeatureSME2, FeatureFP8]>;
551*5f757f3fSDimitry Andric
552349cc55cSDimitry Andricdef FeatureAppleA7SysReg  : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
553349cc55cSDimitry Andric  "Apple A7 (the CPU formerly known as Cyclone)">;
554349cc55cSDimitry Andric
555349cc55cSDimitry Andricdef FeatureEL2VMSA : SubtargetFeature<"el2vmsa", "HasEL2VMSA", "true",
556349cc55cSDimitry Andric  "Enable Exception Level 2 Virtual Memory System Architecture">;
557349cc55cSDimitry Andric
558349cc55cSDimitry Andricdef FeatureEL3 : SubtargetFeature<"el3", "HasEL3", "true",
559349cc55cSDimitry Andric  "Enable Exception Level 3">;
560349cc55cSDimitry Andric
561bdd1243dSDimitry Andricdef FeatureCSSC : SubtargetFeature<"cssc", "HasCSSC", "true",
562bdd1243dSDimitry Andric  "Enable Common Short Sequence Compression (CSSC) instructions (FEAT_CSSC)">;
563bdd1243dSDimitry Andric
5640eae32dcSDimitry Andricdef FeatureFixCortexA53_835769 : SubtargetFeature<"fix-cortex-a53-835769",
5650eae32dcSDimitry Andric  "FixCortexA53_835769", "true", "Mitigate Cortex-A53 Erratum 835769">;
5660eae32dcSDimitry Andric
5673a9a9c0cSDimitry Andricdef FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice",
5683a9a9c0cSDimitry Andric                                                 "NoBTIAtReturnTwice", "true",
5693a9a9c0cSDimitry Andric                                                 "Don't place a BTI instruction "
5703a9a9c0cSDimitry Andric                                                 "after a return-twice">;
5713a9a9c0cSDimitry Andric
57206c3fb27SDimitry Andricdef FeatureCHK : SubtargetFeature<"chk", "HasCHK",
57306c3fb27SDimitry Andric    "true", "Enable Armv8.0-A Check Feature Status Extension (FEAT_CHK)">;
57406c3fb27SDimitry Andric
57506c3fb27SDimitry Andricdef FeatureGCS : SubtargetFeature<"gcs", "HasGCS",
57606c3fb27SDimitry Andric    "true", "Enable Armv9.4-A Guarded Call Stack Extension", [FeatureCHK]>;
57706c3fb27SDimitry Andric
578bdd1243dSDimitry Andricdef FeatureCLRBHB : SubtargetFeature<"clrbhb", "HasCLRBHB",
579bdd1243dSDimitry Andric    "true", "Enable Clear BHB instruction (FEAT_CLRBHB)">;
580bdd1243dSDimitry Andric
581bdd1243dSDimitry Andricdef FeaturePRFM_SLC : SubtargetFeature<"prfm-slc-target", "HasPRFM_SLC",
582bdd1243dSDimitry Andric    "true", "Enable SLC target for PRFM instruction">;
583bdd1243dSDimitry Andric
584bdd1243dSDimitry Andricdef FeatureSPECRES2 : SubtargetFeature<"specres2", "HasSPECRES2",
585bdd1243dSDimitry Andric    "true", "Enable Speculation Restriction Instruction (FEAT_SPECRES2)",
586bdd1243dSDimitry Andric    [FeaturePredRes]>;
587bdd1243dSDimitry Andric
588bdd1243dSDimitry Andricdef FeatureMEC : SubtargetFeature<"mec", "HasMEC",
589bdd1243dSDimitry Andric    "true", "Enable Memory Encryption Contexts Extension", [FeatureRME]>;
590bdd1243dSDimitry Andric
591bdd1243dSDimitry Andricdef FeatureITE : SubtargetFeature<"ite", "HasITE",
592bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A Instrumentation Extension FEAT_ITE", [FeatureETE,
593bdd1243dSDimitry Andric    FeatureTRBE]>;
594bdd1243dSDimitry Andric
595bdd1243dSDimitry Andricdef FeatureRCPC3 : SubtargetFeature<"rcpc3", "HasRCPC3",
596bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set (FEAT_LRCPC3)",
597bdd1243dSDimitry Andric    [FeatureRCPC_IMMO]>;
598bdd1243dSDimitry Andric
599bdd1243dSDimitry Andricdef FeatureTHE : SubtargetFeature<"the", "HasTHE",
600bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A Translation Hardening Extension (FEAT_THE)">;
601bdd1243dSDimitry Andric
602bdd1243dSDimitry Andricdef FeatureLSE128 : SubtargetFeature<"lse128", "HasLSE128",
603bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Atomic Instructions (FEAT_LSE128)",
604bdd1243dSDimitry Andric    [FeatureLSE]>;
605bdd1243dSDimitry Andric
606bdd1243dSDimitry Andric// FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, and FEAT_SYSINSTR128 are mutually implicit.
607bdd1243dSDimitry Andric// Therefore group them all under a single feature flag, d128:
608bdd1243dSDimitry Andricdef FeatureD128 : SubtargetFeature<"d128", "HasD128",
609bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Page Table Descriptors, System Registers "
610bdd1243dSDimitry Andric    "and Instructions (FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, FEAT_SYSINSTR128)",
611bdd1243dSDimitry Andric    [FeatureLSE128]>;
612bdd1243dSDimitry Andric
613*5f757f3fSDimitry Andricdef FeatureDisableLdp : SubtargetFeature<"disable-ldp", "HasDisableLdp",
614*5f757f3fSDimitry Andric    "true", "Do not emit ldp">;
615*5f757f3fSDimitry Andric
616*5f757f3fSDimitry Andricdef FeatureDisableStp : SubtargetFeature<"disable-stp", "HasDisableStp",
617*5f757f3fSDimitry Andric    "true", "Do not emit stp">;
618*5f757f3fSDimitry Andric
619*5f757f3fSDimitry Andricdef FeatureLdpAlignedOnly : SubtargetFeature<"ldp-aligned-only", "HasLdpAlignedOnly",
620*5f757f3fSDimitry Andric    "true", "In order to emit ldp, first check if the load will be aligned to 2 * element_size">;
621*5f757f3fSDimitry Andric
622*5f757f3fSDimitry Andricdef FeatureStpAlignedOnly : SubtargetFeature<"stp-aligned-only", "HasStpAlignedOnly",
623*5f757f3fSDimitry Andric    "true", "In order to emit stp, first check if the store will be aligned to 2 * element_size">;
624*5f757f3fSDimitry Andric
6250b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6260b57cec5SDimitry Andric// Architectures.
6270b57cec5SDimitry Andric//
628349cc55cSDimitry Andricdef HasV8_0aOps : SubtargetFeature<"v8a", "HasV8_0aOps", "true",
629349cc55cSDimitry Andric  "Support ARM v8.0a instructions", [FeatureEL2VMSA, FeatureEL3]>;
6300b57cec5SDimitry Andric
6310b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
632349cc55cSDimitry Andric  "Support ARM v8.1a instructions", [HasV8_0aOps, FeatureCRC, FeatureLSE,
633349cc55cSDimitry Andric  FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH]>;
6340b57cec5SDimitry Andric
6350b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
6360b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
6370b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
6380b57cec5SDimitry Andric
6390b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
640e8d8bef9SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePAuth,
6410b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
6420b57cec5SDimitry Andric
6430b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
6440b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
645e8d8bef9SDimitry Andric  FeatureNV, FeatureMPAM, FeatureDIT,
646349cc55cSDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
647349cc55cSDimitry Andric  FeatureFlagM, FeatureRCPC_IMMO, FeatureLSE2]>;
6480b57cec5SDimitry Andric
6490b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
6500b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
6510b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
6520b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
6535ffd83dbSDimitry Andric   FeatureBranchTargetId]>;
6545ffd83dbSDimitry Andric
6555ffd83dbSDimitry Andricdef HasV8_6aOps : SubtargetFeature<
6565ffd83dbSDimitry Andric  "v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions",
6575ffd83dbSDimitry Andric  [HasV8_5aOps, FeatureAMVS, FeatureBF16, FeatureFineGrainedTraps,
6585ffd83dbSDimitry Andric   FeatureEnhancedCounterVirtualization, FeatureMatMulInt8]>;
6590b57cec5SDimitry Andric
660e8d8bef9SDimitry Andricdef HasV8_7aOps : SubtargetFeature<
661e8d8bef9SDimitry Andric  "v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions",
662e8d8bef9SDimitry Andric  [HasV8_6aOps, FeatureXS, FeatureWFxT, FeatureHCX]>;
663e8d8bef9SDimitry Andric
66404eeddc0SDimitry Andricdef HasV8_8aOps : SubtargetFeature<
66504eeddc0SDimitry Andric  "v8.8a", "HasV8_8aOps", "true", "Support ARM v8.8a instructions",
666bdd1243dSDimitry Andric  [HasV8_7aOps, FeatureHBC, FeatureMOPS, FeatureNMI]>;
667bdd1243dSDimitry Andric
668bdd1243dSDimitry Andricdef HasV8_9aOps : SubtargetFeature<
669bdd1243dSDimitry Andric  "v8.9a", "HasV8_9aOps", "true", "Support ARM v8.9a instructions",
670bdd1243dSDimitry Andric  [HasV8_8aOps, FeatureCLRBHB, FeaturePRFM_SLC, FeatureSPECRES2,
67106c3fb27SDimitry Andric   FeatureCSSC, FeatureRASv2, FeatureCHK]>;
67204eeddc0SDimitry Andric
673349cc55cSDimitry Andricdef HasV9_0aOps : SubtargetFeature<
674349cc55cSDimitry Andric  "v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions",
675bdd1243dSDimitry Andric  [HasV8_5aOps, FeatureMEC, FeatureSVE2]>;
676349cc55cSDimitry Andric
677349cc55cSDimitry Andricdef HasV9_1aOps : SubtargetFeature<
678349cc55cSDimitry Andric  "v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions",
679349cc55cSDimitry Andric  [HasV8_6aOps, HasV9_0aOps]>;
680349cc55cSDimitry Andric
681349cc55cSDimitry Andricdef HasV9_2aOps : SubtargetFeature<
682349cc55cSDimitry Andric  "v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions",
683349cc55cSDimitry Andric  [HasV8_7aOps, HasV9_1aOps]>;
684349cc55cSDimitry Andric
68504eeddc0SDimitry Andricdef HasV9_3aOps : SubtargetFeature<
68604eeddc0SDimitry Andric  "v9.3a", "HasV9_3aOps", "true", "Support ARM v9.3a instructions",
68704eeddc0SDimitry Andric  [HasV8_8aOps, HasV9_2aOps]>;
68804eeddc0SDimitry Andric
689bdd1243dSDimitry Andricdef HasV9_4aOps : SubtargetFeature<
690bdd1243dSDimitry Andric  "v9.4a", "HasV9_4aOps", "true", "Support ARM v9.4a instructions",
691bdd1243dSDimitry Andric  [HasV8_9aOps, HasV9_3aOps]>;
692bdd1243dSDimitry Andric
693*5f757f3fSDimitry Andricdef HasV9_5aOps : SubtargetFeature<
694*5f757f3fSDimitry Andric  "v9.5a", "HasV9_5aOps", "true", "Support ARM v9.5a instructions",
695*5f757f3fSDimitry Andric  [HasV9_4aOps]>;
696*5f757f3fSDimitry Andric
697e8d8bef9SDimitry Andricdef HasV8_0rOps : SubtargetFeature<
698e8d8bef9SDimitry Andric  "v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
699e8d8bef9SDimitry Andric  [//v8.1
700e8d8bef9SDimitry Andric  FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
701e8d8bef9SDimitry Andric  //v8.2
70204eeddc0SDimitry Andric  FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
703e8d8bef9SDimitry Andric  //v8.3
704e8d8bef9SDimitry Andric  FeatureComplxNum, FeatureCCIDX, FeatureJS,
705e8d8bef9SDimitry Andric  FeaturePAuth, FeatureRCPC,
706e8d8bef9SDimitry Andric  //v8.4
70704eeddc0SDimitry Andric  FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
70881ad6265SDimitry Andric  FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO,
70981ad6265SDimitry Andric  // Not mandatory in v8.0-R, but included here on the grounds that it
71081ad6265SDimitry Andric  // only enables names of system registers
71181ad6265SDimitry Andric  FeatureSpecRestrict
71281ad6265SDimitry Andric  ]>;
71381ad6265SDimitry Andric
71481ad6265SDimitry Andric// Only intended to be used by disassemblers.
71581ad6265SDimitry Andricdef FeatureAll
71681ad6265SDimitry Andric    : SubtargetFeature<"all", "IsAll", "true", "Enable all instructions", []>;
71781ad6265SDimitry Andric
71881ad6265SDimitry Andricclass AssemblerPredicateWithAll<dag cond, string name="">
71981ad6265SDimitry Andric    : AssemblerPredicate<(any_of FeatureAll, cond), name>;
720e8d8bef9SDimitry Andric
7210b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7220b57cec5SDimitry Andric// Register File Description
7230b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7240b57cec5SDimitry Andric
7250b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
7260b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
7270b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
7280b57cec5SDimitry Andric
7290b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7300b57cec5SDimitry Andric// Instruction Descriptions
7310b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7320b57cec5SDimitry Andric
7330b57cec5SDimitry Andricinclude "AArch64Schedule.td"
7340b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
7350b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
7360b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
73706c3fb27SDimitry Andricinclude "AArch64SchedPredNeoverse.td"
7388bcb0991SDimitry Andricinclude "AArch64Combine.td"
7390b57cec5SDimitry Andric
7400b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
7410b57cec5SDimitry Andric
7420b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7430b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
7440b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7450b57cec5SDimitry Andric
7460b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
7470b57cec5SDimitry Andric
7480b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7490b57cec5SDimitry Andric// Access to privileged registers
7500b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7510b57cec5SDimitry Andric
7520b57cec5SDimitry Andricforeach i = 1-3 in
7530b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
7540b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
75506c3fb27SDimitry Andricdef FeatureUseROEL0ForTP : SubtargetFeature<"tpidrro-el0", "UseROEL0ForTP",
75606c3fb27SDimitry Andric  "true", "Permit use of TPIDRRO_EL0 for the TLS base">;
7570b57cec5SDimitry Andric
7580b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7595ffd83dbSDimitry Andric// Control codegen mitigation against Straight Line Speculation vulnerability.
7605ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
7615ffd83dbSDimitry Andric
7625ffd83dbSDimitry Andricdef FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
7635ffd83dbSDimitry Andric  "HardenSlsRetBr", "true",
7645ffd83dbSDimitry Andric  "Harden against straight line speculation across RET and BR instructions">;
7655ffd83dbSDimitry Andricdef FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
7665ffd83dbSDimitry Andric  "HardenSlsBlr", "true",
7675ffd83dbSDimitry Andric  "Harden against straight line speculation across BLR instructions">;
768fe6060f1SDimitry Andricdef FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
769fe6060f1SDimitry Andric  "HardenSlsNoComdat", "true",
770fe6060f1SDimitry Andric  "Generate thunk code for SLS mitigation in the normal text section">;
7715ffd83dbSDimitry Andric
7725ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
7730b57cec5SDimitry Andric// AArch64 Processors supported.
7740b57cec5SDimitry Andric//
7750b57cec5SDimitry Andric
7760b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7770b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
7780b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7790b57cec5SDimitry Andric
7800b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
7810b57cec5SDimitry Andric
78206c3fb27SDimitry Andriclet F = [HasSVE2p1, HasSVE2p1_or_HasSME2, HasSVE2p1_or_HasSME2p1] in
78306c3fb27SDimitry Andricdef SVE2p1Unsupported : AArch64Unsupported;
78406c3fb27SDimitry Andric
78506c3fb27SDimitry Andricdef SVE2Unsupported : AArch64Unsupported {
786*5f757f3fSDimitry Andric  let F = !listconcat([HasSVE2, HasSVE2orSME, HasSSVE_FP8FMA, HasSMEF8F16,
787*5f757f3fSDimitry Andric                       HasSMEF8F32, HasSVE2AES, HasSVE2SHA3, HasSVE2SM4, HasSVE2BitPerm],
78806c3fb27SDimitry Andric                       SVE2p1Unsupported.F);
7890b57cec5SDimitry Andric}
7900b57cec5SDimitry Andric
79106c3fb27SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
79206c3fb27SDimitry Andric  let F = !listconcat([HasSVE, HasSVEorSME],
79306c3fb27SDimitry Andric                      SVE2Unsupported.F);
79406c3fb27SDimitry Andric}
79506c3fb27SDimitry Andric
79606c3fb27SDimitry Andriclet F = [HasSME2p1, HasSVE2p1_or_HasSME2p1] in
79706c3fb27SDimitry Andricdef SME2p1Unsupported : AArch64Unsupported;
79806c3fb27SDimitry Andric
79906c3fb27SDimitry Andricdef SME2Unsupported : AArch64Unsupported {
800*5f757f3fSDimitry Andric  let F = !listconcat([HasSME2, HasSVE2p1_or_HasSME2, HasSSVE_FP8FMA,
801*5f757f3fSDimitry Andric                      HasSMEF8F16, HasSMEF8F32],
80206c3fb27SDimitry Andric                      SME2p1Unsupported.F);
803e837bb5cSDimitry Andric}
804e837bb5cSDimitry Andric
805fe6060f1SDimitry Andricdef SMEUnsupported : AArch64Unsupported {
806*5f757f3fSDimitry Andric  let F = !listconcat([HasSME, HasSMEI16I64, HasSMEF16F16, HasSMEF64F64, HasSMEFA64],
80706c3fb27SDimitry Andric                      SME2Unsupported.F);
808fe6060f1SDimitry Andric}
809fe6060f1SDimitry Andric
81006c3fb27SDimitry Andriclet F = [HasPAuth] in
81106c3fb27SDimitry Andricdef PAUnsupported : AArch64Unsupported;
81206c3fb27SDimitry Andric
8130b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
814e8d8bef9SDimitry Andricinclude "AArch64SchedA55.td"
81506c3fb27SDimitry Andricinclude "AArch64SchedA510.td"
8160b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
8170b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
8180b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
8190b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
8200b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
8210b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
822480093f4SDimitry Andricinclude "AArch64SchedExynosM5.td"
8230b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
8240b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
825e8d8bef9SDimitry Andricinclude "AArch64SchedA64FX.td"
826e837bb5cSDimitry Andricinclude "AArch64SchedThunderX3T110.td"
827e8d8bef9SDimitry Andricinclude "AArch64SchedTSV110.td"
8282a66634dSDimitry Andricinclude "AArch64SchedAmpere1.td"
82906c3fb27SDimitry Andricinclude "AArch64SchedNeoverseN1.td"
830753f127fSDimitry Andricinclude "AArch64SchedNeoverseN2.td"
83106c3fb27SDimitry Andricinclude "AArch64SchedNeoverseV1.td"
83206c3fb27SDimitry Andricinclude "AArch64SchedNeoverseV2.td"
8330b57cec5SDimitry Andric
834349cc55cSDimitry Andricdef TuneA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
835349cc55cSDimitry Andric                                "Cortex-A35 ARM processors">;
8360b57cec5SDimitry Andric
837349cc55cSDimitry Andricdef TuneA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
8380b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
8390b57cec5SDimitry Andric                                   FeatureFuseAES,
840bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
841349cc55cSDimitry Andric                                   FeatureBalanceFPOps,
842349cc55cSDimitry Andric                                   FeaturePostRAScheduler]>;
8430b57cec5SDimitry Andric
844349cc55cSDimitry Andricdef TuneA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
8450b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
8460b57cec5SDimitry Andric                                   FeatureFuseAES,
847bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
848fe6060f1SDimitry Andric                                   FeaturePostRAScheduler,
849349cc55cSDimitry Andric                                   FeatureFuseAddress]>;
850349cc55cSDimitry Andric
851349cc55cSDimitry Andricdef TuneA510    : SubtargetFeature<"a510", "ARMProcFamily", "CortexA510",
852349cc55cSDimitry Andric                                   "Cortex-A510 ARM processors", [
853349cc55cSDimitry Andric                                   FeatureFuseAES,
854bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
855349cc55cSDimitry Andric                                   FeaturePostRAScheduler
8560b57cec5SDimitry Andric                                   ]>;
8570b57cec5SDimitry Andric
858*5f757f3fSDimitry Andricdef TuneA520    : SubtargetFeature<"a520", "ARMProcFamily", "CortexA520",
859*5f757f3fSDimitry Andric                                   "Cortex-A520 ARM processors", [
860*5f757f3fSDimitry Andric                                   FeatureFuseAES,
861*5f757f3fSDimitry Andric                                   FeatureFuseAdrpAdd,
862*5f757f3fSDimitry Andric                                   FeaturePostRAScheduler]>;
863*5f757f3fSDimitry Andric
864349cc55cSDimitry Andricdef TuneA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
8650b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
866349cc55cSDimitry Andric                                   FeatureFuseAES,
8670b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
86881ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
8690b57cec5SDimitry Andric                                   FeatureFuseLiterals,
8700b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
871bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize,
872349cc55cSDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8730b57cec5SDimitry Andric
874349cc55cSDimitry Andricdef TuneA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
8758bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
876349cc55cSDimitry Andric                                   FeatureFuseAES,
877e8d8bef9SDimitry Andric                                   FeatureFuseAddress,
87881ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
879bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
88006c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
88106c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8828bcb0991SDimitry Andric
883349cc55cSDimitry Andricdef TuneA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
8840b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
8850b57cec5SDimitry Andric                                   FeatureFuseAES,
88681ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
887bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
88806c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
88906c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8900b57cec5SDimitry Andric
891349cc55cSDimitry Andricdef TuneA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
8920b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
893bdd1243dSDimitry Andric                                   FeatureFuseAES,
894bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
89506c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
89606c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8970b57cec5SDimitry Andric
898349cc55cSDimitry Andricdef TuneA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
8990b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
900bdd1243dSDimitry Andric                                   FeatureFuseAES,
901bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
90206c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
90306c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
9040b57cec5SDimitry Andric
905349cc55cSDimitry Andricdef TuneA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
9060b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
907bdd1243dSDimitry Andric                                   FeatureFuseAES,
908bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
909*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
910*5f757f3fSDimitry Andric                                   FeatureALULSLFast,
91106c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
91206c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
9130b57cec5SDimitry Andric
914349cc55cSDimitry Andricdef TuneA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
9155ffd83dbSDimitry Andric                                   "Cortex-A77 ARM processors", [
916e8d8bef9SDimitry Andric                                   FeatureCmpBccFusion,
917bdd1243dSDimitry Andric                                   FeatureFuseAES,
918bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
919*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
920*5f757f3fSDimitry Andric                                   FeatureALULSLFast,
92106c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
92206c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
9235ffd83dbSDimitry Andric
924349cc55cSDimitry Andricdef TuneA78 : SubtargetFeature<"a78", "ARMProcFamily", "CortexA78",
9255ffd83dbSDimitry Andric                               "Cortex-A78 ARM processors", [
926e8d8bef9SDimitry Andric                               FeatureCmpBccFusion,
9275ffd83dbSDimitry Andric                               FeatureFuseAES,
928bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
929*5f757f3fSDimitry Andric                               FeatureAddrLSLFast,
930*5f757f3fSDimitry Andric                               FeatureALULSLFast,
931bdd1243dSDimitry Andric                               FeaturePostRAScheduler,
93206c3fb27SDimitry Andric                               FeatureEnableSelectOptimize,
93306c3fb27SDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
9345ffd83dbSDimitry Andric
935349cc55cSDimitry Andricdef TuneA78C : SubtargetFeature<"a78c", "ARMProcFamily",
936e8d8bef9SDimitry Andric                                "CortexA78C",
937e8d8bef9SDimitry Andric                                "Cortex-A78C ARM processors", [
938e8d8bef9SDimitry Andric                                FeatureCmpBccFusion,
939e8d8bef9SDimitry Andric                                FeatureFuseAES,
940bdd1243dSDimitry Andric                                FeatureFuseAdrpAdd,
941*5f757f3fSDimitry Andric                                FeatureAddrLSLFast,
942*5f757f3fSDimitry Andric                                FeatureALULSLFast,
943bdd1243dSDimitry Andric                                FeaturePostRAScheduler,
94406c3fb27SDimitry Andric                                FeatureEnableSelectOptimize,
94506c3fb27SDimitry Andric                                FeaturePredictableSelectIsExpensive]>;
946e8d8bef9SDimitry Andric
947349cc55cSDimitry Andricdef TuneA710    : SubtargetFeature<"a710", "ARMProcFamily", "CortexA710",
948349cc55cSDimitry Andric                                   "Cortex-A710 ARM processors", [
949bdd1243dSDimitry Andric                                   FeatureCmpBccFusion,
950bdd1243dSDimitry Andric                                   FeatureFuseAES,
951bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
952*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
953*5f757f3fSDimitry Andric                                   FeatureALULSLFast,
954bdd1243dSDimitry Andric                                   FeaturePostRAScheduler,
95506c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
95606c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
957bdd1243dSDimitry Andric
958bdd1243dSDimitry Andricdef TuneA715 : SubtargetFeature<"a715", "ARMProcFamily", "CortexA715",
959bdd1243dSDimitry Andric                                 "Cortex-A715 ARM processors", [
960349cc55cSDimitry Andric                                 FeatureFuseAES,
961349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
962bdd1243dSDimitry Andric                                 FeatureCmpBccFusion,
963*5f757f3fSDimitry Andric                                 FeatureAddrLSLFast,
964*5f757f3fSDimitry Andric                                 FeatureALULSLFast,
965*5f757f3fSDimitry Andric                                 FeatureFuseAdrpAdd,
966*5f757f3fSDimitry Andric                                 FeatureEnableSelectOptimize,
967*5f757f3fSDimitry Andric                                 FeaturePredictableSelectIsExpensive]>;
968*5f757f3fSDimitry Andric
969*5f757f3fSDimitry Andricdef TuneA720 : SubtargetFeature<"a720", "ARMProcFamily", "CortexA720",
970*5f757f3fSDimitry Andric                                "Cortex-A720 ARM processors", [
971*5f757f3fSDimitry Andric                                 FeatureFuseAES,
972*5f757f3fSDimitry Andric                                 FeaturePostRAScheduler,
973*5f757f3fSDimitry Andric                                 FeatureCmpBccFusion,
974*5f757f3fSDimitry Andric                                 FeatureAddrLSLFast,
975*5f757f3fSDimitry Andric                                 FeatureALULSLFast,
976bdd1243dSDimitry Andric                                 FeatureFuseAdrpAdd,
97706c3fb27SDimitry Andric                                 FeatureEnableSelectOptimize,
97806c3fb27SDimitry Andric                                 FeaturePredictableSelectIsExpensive]>;
979349cc55cSDimitry Andric
980349cc55cSDimitry Andricdef TuneR82 : SubtargetFeature<"cortex-r82", "ARMProcFamily",
981e8d8bef9SDimitry Andric                               "CortexR82",
982349cc55cSDimitry Andric                               "Cortex-R82 ARM processors", [
983349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
984e8d8bef9SDimitry Andric
985349cc55cSDimitry Andricdef TuneX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
9865ffd83dbSDimitry Andric                                  "Cortex-X1 ARM processors", [
987e8d8bef9SDimitry Andric                                  FeatureCmpBccFusion,
9885ffd83dbSDimitry Andric                                  FeatureFuseAES,
989bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
990*5f757f3fSDimitry Andric                                  FeatureAddrLSLFast,
991*5f757f3fSDimitry Andric                                  FeatureALULSLFast,
992bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
99306c3fb27SDimitry Andric                                  FeatureEnableSelectOptimize,
99406c3fb27SDimitry Andric                                  FeaturePredictableSelectIsExpensive]>;
9955ffd83dbSDimitry Andric
996349cc55cSDimitry Andricdef TuneX2 : SubtargetFeature<"cortex-x2", "ARMProcFamily", "CortexX2",
997349cc55cSDimitry Andric                                  "Cortex-X2 ARM processors", [
998bdd1243dSDimitry Andric                                  FeatureCmpBccFusion,
999bdd1243dSDimitry Andric                                  FeatureFuseAES,
1000bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
1001*5f757f3fSDimitry Andric                                  FeatureAddrLSLFast,
1002*5f757f3fSDimitry Andric                                  FeatureALULSLFast,
1003bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
100406c3fb27SDimitry Andric                                  FeatureEnableSelectOptimize,
100506c3fb27SDimitry Andric                                  FeaturePredictableSelectIsExpensive]>;
1006bdd1243dSDimitry Andric
1007bdd1243dSDimitry Andricdef TuneX3 : SubtargetFeature<"cortex-x3", "ARMProcFamily", "CortexX3",
1008bdd1243dSDimitry Andric                              "Cortex-X3 ARM processors", [
1009*5f757f3fSDimitry Andric                               FeatureAddrLSLFast,
1010*5f757f3fSDimitry Andric                               FeatureALULSLFast,
1011*5f757f3fSDimitry Andric                               FeatureFuseAdrpAdd,
1012*5f757f3fSDimitry Andric                               FeatureFuseAES,
1013*5f757f3fSDimitry Andric                               FeaturePostRAScheduler,
1014*5f757f3fSDimitry Andric                               FeatureEnableSelectOptimize,
1015*5f757f3fSDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
1016*5f757f3fSDimitry Andric
1017*5f757f3fSDimitry Andricdef TuneX4 : SubtargetFeature<"cortex-x4", "ARMProcFamily", "CortexX4",
1018*5f757f3fSDimitry Andric                              "Cortex-X4 ARM processors", [
1019*5f757f3fSDimitry Andric                               FeatureAddrLSLFast,
1020*5f757f3fSDimitry Andric                               FeatureALULSLFast,
1021bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
1022349cc55cSDimitry Andric                               FeatureFuseAES,
10235ffd83dbSDimitry Andric                               FeaturePostRAScheduler,
102406c3fb27SDimitry Andric                               FeatureEnableSelectOptimize,
102506c3fb27SDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
1026349cc55cSDimitry Andric
1027349cc55cSDimitry Andricdef TuneA64FX : SubtargetFeature<"a64fx", "ARMProcFamily", "A64FX",
1028349cc55cSDimitry Andric                                 "Fujitsu A64FX processors", [
1029349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
1030e8d8bef9SDimitry Andric                                 FeatureAggressiveFMA,
1031e8d8bef9SDimitry Andric                                 FeatureArithmeticBccFusion,
1032*5f757f3fSDimitry Andric                                 FeatureStorePairSuppress,
1033*5f757f3fSDimitry Andric                                 FeaturePredictableSelectIsExpensive]>;
10345ffd83dbSDimitry Andric
1035349cc55cSDimitry Andricdef TuneCarmel : SubtargetFeature<"carmel", "ARMProcFamily", "Carmel",
1036349cc55cSDimitry Andric                                  "Nvidia Carmel processors">;
10375ffd83dbSDimitry Andric
10380b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
10390b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
1040349cc55cSDimitry Andricdef TuneAppleA7  : SubtargetFeature<"apple-a7", "ARMProcFamily", "AppleA7",
1041480093f4SDimitry Andric                                    "Apple A7 (the CPU formerly known as Cyclone)", [
10420b57cec5SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
10430b57cec5SDimitry Andric                                    FeatureArithmeticBccFusion,
10440b57cec5SDimitry Andric                                    FeatureArithmeticCbzFusion,
10450b57cec5SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1046349cc55cSDimitry Andric                                    FeatureFuseAES, FeatureFuseCryptoEOR,
1047*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
10480b57cec5SDimitry Andric                                    FeatureZCRegMove,
10490b57cec5SDimitry Andric                                    FeatureZCZeroing,
1050*5f757f3fSDimitry Andric                                    FeatureZCZeroingFPWorkaround]>;
10510b57cec5SDimitry Andric
1052349cc55cSDimitry Andricdef TuneAppleA10 : SubtargetFeature<"apple-a10", "ARMProcFamily", "AppleA10",
1053480093f4SDimitry Andric                                    "Apple A10", [
1054480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1055480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
1056480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
1057480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
10580b57cec5SDimitry Andric                                    FeatureFuseAES,
1059480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
1060*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1061480093f4SDimitry Andric                                    FeatureZCRegMove,
1062*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
10630b57cec5SDimitry Andric
1064349cc55cSDimitry Andricdef TuneAppleA11 : SubtargetFeature<"apple-a11", "ARMProcFamily", "AppleA11",
1065480093f4SDimitry Andric                                    "Apple A11", [
1066480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1067480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
1068480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
1069480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
10700b57cec5SDimitry Andric                                    FeatureFuseAES,
1071480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
1072*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1073480093f4SDimitry Andric                                    FeatureZCRegMove,
1074*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
1075480093f4SDimitry Andric
1076349cc55cSDimitry Andricdef TuneAppleA12 : SubtargetFeature<"apple-a12", "ARMProcFamily", "AppleA12",
1077480093f4SDimitry Andric                                    "Apple A12", [
1078480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1079480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
1080480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
1081480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1082480093f4SDimitry Andric                                    FeatureFuseAES,
1083480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
1084*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1085480093f4SDimitry Andric                                    FeatureZCRegMove,
1086*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
1087480093f4SDimitry Andric
1088349cc55cSDimitry Andricdef TuneAppleA13 : SubtargetFeature<"apple-a13", "ARMProcFamily", "AppleA13",
1089480093f4SDimitry Andric                                    "Apple A13", [
1090480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1091480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
1092480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
1093480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1094480093f4SDimitry Andric                                    FeatureFuseAES,
1095480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
1096*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1097480093f4SDimitry Andric                                    FeatureZCRegMove,
1098*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
10990b57cec5SDimitry Andric
1100349cc55cSDimitry Andricdef TuneAppleA14 : SubtargetFeature<"apple-a14", "ARMProcFamily", "AppleA14",
1101e8d8bef9SDimitry Andric                                    "Apple A14", [
1102e8d8bef9SDimitry Andric                                    FeatureAggressiveFMA,
1103e8d8bef9SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1104e8d8bef9SDimitry Andric                                    FeatureArithmeticBccFusion,
1105e8d8bef9SDimitry Andric                                    FeatureArithmeticCbzFusion,
1106e8d8bef9SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1107e8d8bef9SDimitry Andric                                    FeatureFuseAddress,
1108e8d8bef9SDimitry Andric                                    FeatureFuseAES,
1109e8d8bef9SDimitry Andric                                    FeatureFuseArithmeticLogic,
1110e8d8bef9SDimitry Andric                                    FeatureFuseCCSelect,
1111e8d8bef9SDimitry Andric                                    FeatureFuseCryptoEOR,
111281ad6265SDimitry Andric                                    FeatureFuseAdrpAdd,
1113e8d8bef9SDimitry Andric                                    FeatureFuseLiterals,
1114*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1115e8d8bef9SDimitry Andric                                    FeatureZCRegMove,
1116349cc55cSDimitry Andric                                    FeatureZCZeroing]>;
1117e8d8bef9SDimitry Andric
1118bdd1243dSDimitry Andricdef TuneAppleA15 : SubtargetFeature<"apple-a15", "ARMProcFamily", "AppleA15",
1119bdd1243dSDimitry Andric                                    "Apple A15", [
1120bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1121bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1122bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
1123bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1124bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1125bdd1243dSDimitry Andric                                    FeatureFuseAES,
1126bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
1127bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1128bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1129bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1130*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1131bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1132*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
1133bdd1243dSDimitry Andric
1134bdd1243dSDimitry Andricdef TuneAppleA16 : SubtargetFeature<"apple-a16", "ARMProcFamily", "AppleA16",
1135bdd1243dSDimitry Andric                                    "Apple A16", [
1136bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1137bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1138bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
1139bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1140bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1141bdd1243dSDimitry Andric                                    FeatureFuseAES,
1142bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
1143bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1144bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1145bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1146*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1147bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1148*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
1149*5f757f3fSDimitry Andric
1150*5f757f3fSDimitry Andricdef TuneAppleA17 : SubtargetFeature<"apple-a17", "ARMProcFamily", "AppleA17",
1151*5f757f3fSDimitry Andric                                    "Apple A17", [
1152*5f757f3fSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1153*5f757f3fSDimitry Andric                                    FeatureArithmeticBccFusion,
1154*5f757f3fSDimitry Andric                                    FeatureArithmeticCbzFusion,
1155*5f757f3fSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1156*5f757f3fSDimitry Andric                                    FeatureFuseAddress,
1157*5f757f3fSDimitry Andric                                    FeatureFuseAES,
1158*5f757f3fSDimitry Andric                                    FeatureFuseArithmeticLogic,
1159*5f757f3fSDimitry Andric                                    FeatureFuseCCSelect,
1160*5f757f3fSDimitry Andric                                    FeatureFuseCryptoEOR,
1161*5f757f3fSDimitry Andric                                    FeatureFuseLiterals,
1162*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1163*5f757f3fSDimitry Andric                                    FeatureZCRegMove,
1164*5f757f3fSDimitry Andric                                    FeatureZCZeroing]>;
1165bdd1243dSDimitry Andric
1166349cc55cSDimitry Andricdef TuneExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
11670b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
1168349cc55cSDimitry Andric                                    [FeatureExynosCheapAsMoveHandling,
11690b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
11700b57cec5SDimitry Andric                                     FeatureFuseAddress,
11710b57cec5SDimitry Andric                                     FeatureFuseAES,
11720b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
117381ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
11740b57cec5SDimitry Andric                                     FeatureFuseLiterals,
1175*5f757f3fSDimitry Andric                                     FeatureStorePairSuppress,
1176*5f757f3fSDimitry Andric                                     FeatureAddrLSLFast,
1177*5f757f3fSDimitry Andric                                     FeatureALULSLFast,
11780b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
1179fe6060f1SDimitry Andric                                     FeaturePredictableSelectIsExpensive]>;
11800b57cec5SDimitry Andric
118181ad6265SDimitry Andric// Re-uses some scheduling and tunings from the ExynosM3 proc family.
118281ad6265SDimitry Andricdef TuneExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3",
118381ad6265SDimitry Andric                                    "Samsung Exynos-M4 processors",
1184349cc55cSDimitry Andric                                    [FeatureArithmeticBccFusion,
11850b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
11860b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
11870b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
11880b57cec5SDimitry Andric                                     FeatureFuseAddress,
11890b57cec5SDimitry Andric                                     FeatureFuseAES,
11900b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
11910b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
119281ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
11930b57cec5SDimitry Andric                                     FeatureFuseLiterals,
1194*5f757f3fSDimitry Andric                                     FeatureStorePairSuppress,
1195*5f757f3fSDimitry Andric                                     FeatureAddrLSLFast,
1196*5f757f3fSDimitry Andric                                     FeatureALULSLFast,
11970b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
11980b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
11990b57cec5SDimitry Andric
1200349cc55cSDimitry Andricdef TuneKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
12010b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
12020b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
12030b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
12040b57cec5SDimitry Andric                                   FeatureZCZeroing,
1205*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
1206*5f757f3fSDimitry Andric                                   FeatureALULSLFast,
1207*5f757f3fSDimitry Andric                                   FeatureStorePairSuppress]>;
12080b57cec5SDimitry Andric
1209349cc55cSDimitry Andricdef TuneFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
12100b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
12110b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
12120b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
12130b57cec5SDimitry Andric                                   FeatureZCZeroing,
1214*5f757f3fSDimitry Andric                                   FeatureStorePairSuppress,
1215*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
1216*5f757f3fSDimitry Andric                                   FeatureALULSLFast,
1217*5f757f3fSDimitry Andric                                   FeatureSlowSTRQro]>;
12180b57cec5SDimitry Andric
1219349cc55cSDimitry Andricdef TuneNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily", "NeoverseE1",
12208bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
1221bdd1243dSDimitry Andric                                      FeatureFuseAES,
1222bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1223bdd1243dSDimitry Andric                                      FeaturePostRAScheduler]>;
12248bcb0991SDimitry Andric
1225349cc55cSDimitry Andricdef TuneNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily", "NeoverseN1",
12268bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
1227bdd1243dSDimitry Andric                                      FeatureFuseAES,
1228bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1229*5f757f3fSDimitry Andric                                      FeatureAddrLSLFast,
1230*5f757f3fSDimitry Andric                                      FeatureALULSLFast,
1231fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
123206c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
123306c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
12348bcb0991SDimitry Andric
1235349cc55cSDimitry Andricdef TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2",
1236e8d8bef9SDimitry Andric                                      "Neoverse N2 ARM processors", [
1237bdd1243dSDimitry Andric                                      FeatureFuseAES,
1238bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1239*5f757f3fSDimitry Andric                                      FeatureAddrLSLFast,
1240*5f757f3fSDimitry Andric                                      FeatureALULSLFast,
1241fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
124206c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
124306c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1244bdd1243dSDimitry Andric
1245349cc55cSDimitry Andricdef TuneNeoverse512TVB : SubtargetFeature<"neoverse512tvb", "ARMProcFamily", "Neoverse512TVB",
1246349cc55cSDimitry Andric                                      "Neoverse 512-TVB ARM processors", [
1247bdd1243dSDimitry Andric                                      FeatureFuseAES,
1248bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1249*5f757f3fSDimitry Andric                                      FeatureAddrLSLFast,
1250*5f757f3fSDimitry Andric                                      FeatureALULSLFast,
1251349cc55cSDimitry Andric                                      FeaturePostRAScheduler,
125206c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
125306c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1254e8d8bef9SDimitry Andric
1255349cc55cSDimitry Andricdef TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1",
1256e8d8bef9SDimitry Andric                                      "Neoverse V1 ARM processors", [
1257e8d8bef9SDimitry Andric                                      FeatureFuseAES,
1258bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1259*5f757f3fSDimitry Andric                                      FeatureAddrLSLFast,
1260*5f757f3fSDimitry Andric                                      FeatureALULSLFast,
1261bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
126206c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
12638a4dda33SDimitry Andric                                      FeaturePredictableSelectIsExpensive,
12648a4dda33SDimitry Andric                                      FeatureNoSVEFPLD1R]>;
1265bdd1243dSDimitry Andric
1266bdd1243dSDimitry Andricdef TuneNeoverseV2 : SubtargetFeature<"neoversev2", "ARMProcFamily", "NeoverseV2",
1267bdd1243dSDimitry Andric                                      "Neoverse V2 ARM processors", [
1268bdd1243dSDimitry Andric                                      FeatureFuseAES,
1269*5f757f3fSDimitry Andric                                      FeatureFuseAdrpAdd,
1270*5f757f3fSDimitry Andric                                      FeatureAddrLSLFast,
1271*5f757f3fSDimitry Andric                                      FeatureALULSLFast,
1272bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
127306c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
127406c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1275e8d8bef9SDimitry Andric
1276349cc55cSDimitry Andricdef TuneSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
12770b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
12780b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
12790b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
12800b57cec5SDimitry Andric                                   FeatureZCZeroing,
1281*5f757f3fSDimitry Andric                                   FeatureStorePairSuppress,
1282*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
1283*5f757f3fSDimitry Andric                                   FeatureALULSLFast]>;
12840b57cec5SDimitry Andric
1285349cc55cSDimitry Andricdef TuneThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily", "ThunderX2T99",
12860b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
12870b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
12880b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
12890b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
1290*5f757f3fSDimitry Andric                                          FeatureStorePairSuppress,
1291349cc55cSDimitry Andric                                          FeaturePredictableSelectIsExpensive]>;
12920b57cec5SDimitry Andric
1293349cc55cSDimitry Andricdef TuneThunderX3T110  : SubtargetFeature<"thunderx3t110", "ARMProcFamily",
1294e837bb5cSDimitry Andric                                          "ThunderX3T110",
1295e837bb5cSDimitry Andric                                          "Marvell ThunderX3 processors", [
1296e837bb5cSDimitry Andric                                           FeatureAggressiveFMA,
1297e837bb5cSDimitry Andric                                           FeatureArithmeticBccFusion,
1298e837bb5cSDimitry Andric                                           FeaturePostRAScheduler,
1299e837bb5cSDimitry Andric                                           FeaturePredictableSelectIsExpensive,
1300e837bb5cSDimitry Andric                                           FeatureBalanceFPOps,
1301*5f757f3fSDimitry Andric                                           FeatureStorePairSuppress,
1302349cc55cSDimitry Andric                                           FeatureStrictAlign]>;
1303e837bb5cSDimitry Andric
1304349cc55cSDimitry Andricdef TuneThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
13050b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
13060b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
1307*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1308349cc55cSDimitry Andric                                    FeaturePredictableSelectIsExpensive]>;
13090b57cec5SDimitry Andric
1310349cc55cSDimitry Andricdef TuneThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
13110b57cec5SDimitry Andric                                       "ThunderXT88",
13120b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
13130b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1314*5f757f3fSDimitry Andric                                       FeatureStorePairSuppress,
1315349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
13160b57cec5SDimitry Andric
1317349cc55cSDimitry Andricdef TuneThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
13180b57cec5SDimitry Andric                                       "ThunderXT81",
13190b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
13200b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1321*5f757f3fSDimitry Andric                                       FeatureStorePairSuppress,
1322349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
13230b57cec5SDimitry Andric
1324349cc55cSDimitry Andricdef TuneThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
13250b57cec5SDimitry Andric                                       "ThunderXT83",
13260b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
13270b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1328*5f757f3fSDimitry Andric                                       FeatureStorePairSuppress,
1329349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
13300b57cec5SDimitry Andric
1331349cc55cSDimitry Andricdef TuneTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
13320b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
13330b57cec5SDimitry Andric                                  FeatureFuseAES,
1334*5f757f3fSDimitry Andric                                  FeatureStorePairSuppress,
1335349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
13360b57cec5SDimitry Andric
13372a66634dSDimitry Andricdef TuneAmpere1 : SubtargetFeature<"ampere1", "ARMProcFamily", "Ampere1",
13382a66634dSDimitry Andric                                   "Ampere Computing Ampere-1 processors", [
13392a66634dSDimitry Andric                                   FeaturePostRAScheduler,
13402a66634dSDimitry Andric                                   FeatureFuseAES,
1341*5f757f3fSDimitry Andric                                   FeatureAddrLSLFast,
1342*5f757f3fSDimitry Andric                                   FeatureALULSLFast,
1343bdd1243dSDimitry Andric                                   FeatureAggressiveFMA,
1344bdd1243dSDimitry Andric                                   FeatureArithmeticBccFusion,
1345bdd1243dSDimitry Andric                                   FeatureCmpBccFusion,
1346bdd1243dSDimitry Andric                                   FeatureFuseAddress,
1347bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
1348*5f757f3fSDimitry Andric                                   FeatureStorePairSuppress,
1349*5f757f3fSDimitry Andric                                   FeatureLdpAlignedOnly,
1350*5f757f3fSDimitry Andric                                   FeatureStpAlignedOnly]>;
1351*5f757f3fSDimitry Andric
1352*5f757f3fSDimitry Andricdef TuneAmpere1A : SubtargetFeature<"ampere1a", "ARMProcFamily", "Ampere1A",
1353*5f757f3fSDimitry Andric                                    "Ampere Computing Ampere-1A processors", [
1354*5f757f3fSDimitry Andric                                    FeaturePostRAScheduler,
1355*5f757f3fSDimitry Andric                                    FeatureFuseAES,
1356*5f757f3fSDimitry Andric                                    FeatureAddrLSLFast,
1357*5f757f3fSDimitry Andric                                    FeatureALULSLFast,
1358*5f757f3fSDimitry Andric                                    FeatureAggressiveFMA,
1359*5f757f3fSDimitry Andric                                    FeatureArithmeticBccFusion,
1360*5f757f3fSDimitry Andric                                    FeatureCmpBccFusion,
1361*5f757f3fSDimitry Andric                                    FeatureFuseAddress,
1362*5f757f3fSDimitry Andric                                    FeatureFuseLiterals,
1363*5f757f3fSDimitry Andric                                    FeatureFuseLiterals,
1364*5f757f3fSDimitry Andric                                    FeatureStorePairSuppress,
1365*5f757f3fSDimitry Andric                                    FeatureLdpAlignedOnly,
1366*5f757f3fSDimitry Andric                                    FeatureStpAlignedOnly]>;
1367bdd1243dSDimitry Andric
1368349cc55cSDimitry Andricdef ProcessorFeatures {
1369349cc55cSDimitry Andric  list<SubtargetFeature> A53  = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1370349cc55cSDimitry Andric                                 FeatureFPARMv8, FeatureNEON, FeaturePerfMon];
1371349cc55cSDimitry Andric  list<SubtargetFeature> A55  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1372349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1373349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon];
1374349cc55cSDimitry Andric  list<SubtargetFeature> A510 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1375349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1376349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1377349cc55cSDimitry Andric                                 FeatureFP16FML];
1378*5f757f3fSDimitry Andric  list<SubtargetFeature> A520 = [HasV9_2aOps, FeaturePerfMon, FeatureAM,
1379*5f757f3fSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1380*5f757f3fSDimitry Andric                                 FeatureFP16FML];
1381349cc55cSDimitry Andric  list<SubtargetFeature> A65  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1382349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
138381ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeatureRAS,
138481ad6265SDimitry Andric                                 FeaturePerfMon];
1385349cc55cSDimitry Andric  list<SubtargetFeature> A76  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1386349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
138781ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1388349cc55cSDimitry Andric  list<SubtargetFeature> A77  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1389349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
139081ad6265SDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSSBS];
1391349cc55cSDimitry Andric  list<SubtargetFeature> A78  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1392349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1393349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSPE,
1394349cc55cSDimitry Andric                                 FeatureSSBS];
1395349cc55cSDimitry Andric  list<SubtargetFeature> A78C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1396349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1397349cc55cSDimitry Andric                                 FeatureFlagM, FeatureFP16FML, FeaturePAuth,
1398349cc55cSDimitry Andric                                 FeaturePerfMon, FeatureRCPC, FeatureSPE,
1399349cc55cSDimitry Andric                                 FeatureSSBS];
1400349cc55cSDimitry Andric  list<SubtargetFeature> A710 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1401349cc55cSDimitry Andric                                 FeatureETE, FeatureMTE, FeatureFP16FML,
1402349cc55cSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureMatMulInt8];
1403bdd1243dSDimitry Andric  list<SubtargetFeature> A715 = [HasV9_0aOps, FeatureNEON, FeatureMTE,
1404bdd1243dSDimitry Andric                                 FeatureFP16FML, FeatureSVE, FeatureTRBE,
1405bdd1243dSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureETE,
1406bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureMatMulInt8, FeatureSPE];
1407*5f757f3fSDimitry Andric  list<SubtargetFeature> A720 = [HasV9_2aOps, FeatureMTE, FeatureFP16FML,
1408*5f757f3fSDimitry Andric                                 FeatureTRBE, FeatureSVE2BitPerm, FeatureETE,
1409*5f757f3fSDimitry Andric                                 FeaturePerfMon, FeatureSPE, FeatureSPE_EEF];
141004eeddc0SDimitry Andric  list<SubtargetFeature> R82  = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
141104eeddc0SDimitry Andric                                 FeatureFP16FML, FeatureSSBS, FeaturePredRes,
141281ad6265SDimitry Andric                                 FeatureSB];
1413349cc55cSDimitry Andric  list<SubtargetFeature> X1   = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1414349cc55cSDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
14153a9a9c0cSDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
14163a9a9c0cSDimitry Andric                                 FeatureSSBS];
14171fd87a68SDimitry Andric  list<SubtargetFeature> X1C  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1418bdd1243dSDimitry Andric                                 FeatureNEON, FeatureRCPC_IMMO, FeaturePerfMon,
14191fd87a68SDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
1420bdd1243dSDimitry Andric                                 FeaturePAuth, FeatureSSBS, FeatureFlagM,
1421bdd1243dSDimitry Andric                                 FeatureLSE2];
1422349cc55cSDimitry Andric  list<SubtargetFeature> X2   = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1423349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1424349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1425349cc55cSDimitry Andric                                 FeatureFP16FML];
1426bdd1243dSDimitry Andric  list<SubtargetFeature> X3 =   [HasV9_0aOps, FeatureSVE, FeatureNEON,
1427bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureETE, FeatureTRBE,
1428bdd1243dSDimitry Andric                                 FeatureSPE, FeatureBF16, FeatureMatMulInt8,
1429bdd1243dSDimitry Andric                                 FeatureMTE, FeatureSVE2BitPerm, FeatureFullFP16,
1430bdd1243dSDimitry Andric                                 FeatureFP16FML];
1431*5f757f3fSDimitry Andric  list<SubtargetFeature> X4 =   [HasV9_2aOps,
1432*5f757f3fSDimitry Andric                                 FeaturePerfMon, FeatureETE, FeatureTRBE,
1433*5f757f3fSDimitry Andric                                 FeatureSPE, FeatureMTE, FeatureSVE2BitPerm,
1434*5f757f3fSDimitry Andric                                 FeatureFP16FML, FeatureSPE_EEF];
1435349cc55cSDimitry Andric  list<SubtargetFeature> A64FX    = [HasV8_2aOps, FeatureFPARMv8, FeatureNEON,
1436349cc55cSDimitry Andric                                     FeatureSHA2, FeaturePerfMon, FeatureFullFP16,
1437349cc55cSDimitry Andric                                     FeatureSVE, FeatureComplxNum];
1438349cc55cSDimitry Andric  list<SubtargetFeature> Carmel   = [HasV8_2aOps, FeatureNEON, FeatureCrypto,
1439349cc55cSDimitry Andric                                     FeatureFullFP16];
1440349cc55cSDimitry Andric  list<SubtargetFeature> AppleA7  = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1441349cc55cSDimitry Andric                                     FeatureNEON,FeaturePerfMon, FeatureAppleA7SysReg];
1442349cc55cSDimitry Andric  list<SubtargetFeature> AppleA10 = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1443349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureCRC,
1444349cc55cSDimitry Andric                                     FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH];
1445349cc55cSDimitry Andric  list<SubtargetFeature> AppleA11 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1446349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1447349cc55cSDimitry Andric  list<SubtargetFeature> AppleA12 = [HasV8_3aOps, FeatureCrypto, FeatureFPARMv8,
1448349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1449349cc55cSDimitry Andric  list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1450349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16,
1451349cc55cSDimitry Andric                                     FeatureFP16FML, FeatureSHA3];
1452349cc55cSDimitry Andric  list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1453349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
1454349cc55cSDimitry Andric                                     FeatureSpecRestrict, FeatureSSBS, FeatureSB,
1455349cc55cSDimitry Andric                                     FeaturePredRes, FeatureCacheDeepPersist,
1456349cc55cSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML, FeatureSHA3,
1457349cc55cSDimitry Andric                                     FeatureAltFPCmp];
1458bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA15 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1459bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1460bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML];
1461bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA16 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1462bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1463bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML,
1464bdd1243dSDimitry Andric                                     FeatureHCX];
1465*5f757f3fSDimitry Andric  list<SubtargetFeature> AppleA17 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1466*5f757f3fSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1467*5f757f3fSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML,
1468*5f757f3fSDimitry Andric                                     FeatureHCX];
1469349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM3 = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1470349cc55cSDimitry Andric                                     FeaturePerfMon];
1471349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM4 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1472349cc55cSDimitry Andric                                     FeatureFullFP16, FeaturePerfMon];
1473349cc55cSDimitry Andric  list<SubtargetFeature> Falkor   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1474349cc55cSDimitry Andric                                     FeatureFPARMv8, FeatureNEON, FeaturePerfMon,
1475349cc55cSDimitry Andric                                     FeatureRDM];
1476349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseE1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1477349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
147881ad6265SDimitry Andric                                       FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1479349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1480349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
148181ad6265SDimitry Andric                                       FeatureRCPC, FeatureSPE, FeatureSSBS,
148281ad6265SDimitry Andric                                       FeaturePerfMon];
1483*5f757f3fSDimitry Andric  list<SubtargetFeature> NeoverseN2 = [HasV9_0aOps, FeatureBF16, FeatureETE,
1484349cc55cSDimitry Andric                                       FeatureMatMulInt8, FeatureMTE, FeatureSVE2,
1485*5f757f3fSDimitry Andric                                       FeatureSVE2BitPerm, FeatureTRBE,
148681ad6265SDimitry Andric                                       FeaturePerfMon];
1487349cc55cSDimitry Andric  list<SubtargetFeature> Neoverse512TVB = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1488349cc55cSDimitry Andric                                           FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1489349cc55cSDimitry Andric                                           FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1490349cc55cSDimitry Andric                                           FeaturePerfMon, FeatureRandGen, FeatureSPE,
1491349cc55cSDimitry Andric                                           FeatureSSBS, FeatureSVE];
1492349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseV1 = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1493349cc55cSDimitry Andric                                       FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1494349cc55cSDimitry Andric                                       FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1495349cc55cSDimitry Andric                                       FeaturePerfMon, FeatureRandGen, FeatureSPE,
1496349cc55cSDimitry Andric                                       FeatureSSBS, FeatureSVE];
1497bdd1243dSDimitry Andric  list<SubtargetFeature> NeoverseV2 = [HasV9_0aOps, FeatureBF16, FeatureSPE,
1498bdd1243dSDimitry Andric                                       FeaturePerfMon, FeatureETE, FeatureMatMulInt8,
1499bdd1243dSDimitry Andric                                       FeatureNEON, FeatureSVE2BitPerm, FeatureFP16FML,
1500bdd1243dSDimitry Andric                                       FeatureMTE, FeatureRandGen];
1501349cc55cSDimitry Andric  list<SubtargetFeature> Saphira    = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1502349cc55cSDimitry Andric                                       FeatureNEON, FeatureSPE, FeaturePerfMon];
1503349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1504349cc55cSDimitry Andric                                       FeatureFPARMv8, FeaturePerfMon, FeatureNEON];
1505349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX2T99  = [HasV8_1aOps, FeatureCRC, FeatureCrypto,
1506349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE];
1507349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX3T110 = [HasV8_3aOps, FeatureCRC, FeatureCrypto,
1508349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE,
1509349cc55cSDimitry Andric                                          FeaturePAuth, FeaturePerfMon];
1510349cc55cSDimitry Andric  list<SubtargetFeature> TSV110 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1511349cc55cSDimitry Andric                                   FeatureNEON, FeaturePerfMon, FeatureSPE,
1512349cc55cSDimitry Andric                                   FeatureFullFP16, FeatureFP16FML, FeatureDotProd];
15132a66634dSDimitry Andric  list<SubtargetFeature> Ampere1 = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1514bdd1243dSDimitry Andric                                    FeatureSSBS, FeatureRandGen, FeatureSB,
1515bdd1243dSDimitry Andric                                    FeatureSHA2, FeatureSHA3, FeatureAES];
1516bdd1243dSDimitry Andric  list<SubtargetFeature> Ampere1A = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1517bdd1243dSDimitry Andric                                     FeatureMTE, FeatureSSBS, FeatureRandGen,
1518bdd1243dSDimitry Andric                                     FeatureSB, FeatureSM4, FeatureSHA2,
1519bdd1243dSDimitry Andric                                     FeatureSHA3, FeatureAES];
1520349cc55cSDimitry Andric
15215ffd83dbSDimitry Andric  // ETE and TRBE are future architecture extensions. We temporarily enable them
1522349cc55cSDimitry Andric  // by default for users targeting generic AArch64. The extensions do not
15238bcb0991SDimitry Andric  // affect code generated by the compiler and can be used only by explicitly
15248bcb0991SDimitry Andric  // mentioning the new system register names in assembly.
152581ad6265SDimitry Andric  list<SubtargetFeature> Generic = [FeatureFPARMv8, FeatureNEON, FeatureETE];
1526349cc55cSDimitry Andric}
15270b57cec5SDimitry Andric
152881ad6265SDimitry Andric// FeatureFuseAdrpAdd is enabled under Generic to allow linker merging
152981ad6265SDimitry Andric// optimizations.
1530*5f757f3fSDimitry Andricdef : ProcessorModel<"generic", CortexA510Model, ProcessorFeatures.Generic,
1531bdd1243dSDimitry Andric                     [FeatureFuseAES, FeatureFuseAdrpAdd, FeaturePostRAScheduler,
1532bdd1243dSDimitry Andric                      FeatureEnableSelectOptimize]>;
1533349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, ProcessorFeatures.A53,
1534349cc55cSDimitry Andric                     [TuneA35]>;
1535349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a34", CortexA53Model, ProcessorFeatures.A53,
1536349cc55cSDimitry Andric                     [TuneA35]>;
1537349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, ProcessorFeatures.A53,
1538349cc55cSDimitry Andric                     [TuneA53]>;
1539349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA55Model, ProcessorFeatures.A55,
1540349cc55cSDimitry Andric                     [TuneA55]>;
154106c3fb27SDimitry Andricdef : ProcessorModel<"cortex-a510", CortexA510Model, ProcessorFeatures.A510,
1542349cc55cSDimitry Andric                     [TuneA510]>;
1543*5f757f3fSDimitry Andricdef : ProcessorModel<"cortex-a520", CortexA510Model, ProcessorFeatures.A520,
1544*5f757f3fSDimitry Andric                     [TuneA520]>;
1545349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, ProcessorFeatures.A53,
1546349cc55cSDimitry Andric                     [TuneA57]>;
1547349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, ProcessorFeatures.A65,
1548349cc55cSDimitry Andric                     [TuneA65]>;
1549349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, ProcessorFeatures.A65,
1550349cc55cSDimitry Andric                     [TuneA65]>;
1551349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, ProcessorFeatures.A53,
1552349cc55cSDimitry Andric                     [TuneA72]>;
1553349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, ProcessorFeatures.A53,
1554349cc55cSDimitry Andric                     [TuneA73]>;
1555349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, ProcessorFeatures.A55,
1556349cc55cSDimitry Andric                     [TuneA75]>;
1557349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, ProcessorFeatures.A76,
1558349cc55cSDimitry Andric                     [TuneA76]>;
1559349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, ProcessorFeatures.A76,
1560349cc55cSDimitry Andric                     [TuneA76]>;
1561349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a77", CortexA57Model, ProcessorFeatures.A77,
1562349cc55cSDimitry Andric                     [TuneA77]>;
1563349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78", CortexA57Model, ProcessorFeatures.A78,
1564349cc55cSDimitry Andric                     [TuneA78]>;
1565349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78c", CortexA57Model, ProcessorFeatures.A78C,
1566349cc55cSDimitry Andric                     [TuneA78C]>;
1567753f127fSDimitry Andricdef : ProcessorModel<"cortex-a710", NeoverseN2Model, ProcessorFeatures.A710,
1568349cc55cSDimitry Andric                     [TuneA710]>;
1569bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-a715", NeoverseN2Model, ProcessorFeatures.A715,
1570bdd1243dSDimitry Andric                     [TuneA715]>;
1571*5f757f3fSDimitry Andricdef : ProcessorModel<"cortex-a720", NeoverseN2Model, ProcessorFeatures.A720,
1572*5f757f3fSDimitry Andric                     [TuneA720]>;
1573349cc55cSDimitry Andricdef : ProcessorModel<"cortex-r82", CortexA55Model, ProcessorFeatures.R82,
1574349cc55cSDimitry Andric                     [TuneR82]>;
1575349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x1", CortexA57Model, ProcessorFeatures.X1,
1576349cc55cSDimitry Andric                     [TuneX1]>;
15771fd87a68SDimitry Andricdef : ProcessorModel<"cortex-x1c", CortexA57Model, ProcessorFeatures.X1C,
15781fd87a68SDimitry Andric                     [TuneX1]>;
1579753f127fSDimitry Andricdef : ProcessorModel<"cortex-x2", NeoverseN2Model, ProcessorFeatures.X2,
1580349cc55cSDimitry Andric                     [TuneX2]>;
1581bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-x3", NeoverseN2Model, ProcessorFeatures.X3,
1582bdd1243dSDimitry Andric                     [TuneX3]>;
1583*5f757f3fSDimitry Andricdef : ProcessorModel<"cortex-x4", NeoverseN2Model, ProcessorFeatures.X4,
1584*5f757f3fSDimitry Andric                     [TuneX4]>;
1585349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model,
1586349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
158706c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-n1", NeoverseN1Model,
1588349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
1589753f127fSDimitry Andricdef : ProcessorModel<"neoverse-n2", NeoverseN2Model,
1590349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
159106c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-512tvb", NeoverseV1Model,
1592349cc55cSDimitry Andric                     ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
159306c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-v1", NeoverseV1Model,
1594349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseV1, [TuneNeoverseV1]>;
159506c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-v2", NeoverseV2Model,
1596bdd1243dSDimitry Andric                     ProcessorFeatures.NeoverseV2, [TuneNeoverseV2]>;
1597349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, ProcessorFeatures.ExynosM3,
1598349cc55cSDimitry Andric                     [TuneExynosM3]>;
1599349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, ProcessorFeatures.ExynosM4,
1600349cc55cSDimitry Andric                     [TuneExynosM4]>;
1601349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM5Model, ProcessorFeatures.ExynosM4,
1602349cc55cSDimitry Andric                     [TuneExynosM4]>;
1603349cc55cSDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, ProcessorFeatures.Falkor,
1604349cc55cSDimitry Andric                     [TuneFalkor]>;
1605349cc55cSDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, ProcessorFeatures.Saphira,
1606349cc55cSDimitry Andric                     [TuneSaphira]>;
1607349cc55cSDimitry Andricdef : ProcessorModel<"kryo", KryoModel, ProcessorFeatures.A53, [TuneKryo]>;
1608349cc55cSDimitry Andric
16090b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
1610349cc55cSDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  ProcessorFeatures.ThunderX,
1611349cc55cSDimitry Andric                     [TuneThunderX]>;
1612349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,
1613349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT88]>;
1614349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,
1615349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT81]>;
1616349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,
1617349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT83]>;
16180b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
1619349cc55cSDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model,
1620349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX2T99, [TuneThunderX2T99]>;
1621e837bb5cSDimitry Andric// Marvell ThunderX3T110 Processors.
1622349cc55cSDimitry Andricdef : ProcessorModel<"thunderx3t110", ThunderX3T110Model,
1623349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX3T110, [TuneThunderX3T110]>;
1624349cc55cSDimitry Andricdef : ProcessorModel<"tsv110", TSV110Model, ProcessorFeatures.TSV110,
1625349cc55cSDimitry Andric                     [TuneTSV110]>;
16260b57cec5SDimitry Andric
1627480093f4SDimitry Andric// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
1628349cc55cSDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
1629349cc55cSDimitry Andric                     [TuneAppleA7]>;
1630480093f4SDimitry Andric
1631480093f4SDimitry Andric// iPhone and iPad CPUs
1632349cc55cSDimitry Andricdef : ProcessorModel<"apple-a7", CycloneModel, ProcessorFeatures.AppleA7,
1633349cc55cSDimitry Andric                     [TuneAppleA7]>;
1634349cc55cSDimitry Andricdef : ProcessorModel<"apple-a8", CycloneModel, ProcessorFeatures.AppleA7,
1635349cc55cSDimitry Andric                     [TuneAppleA7]>;
1636349cc55cSDimitry Andricdef : ProcessorModel<"apple-a9", CycloneModel, ProcessorFeatures.AppleA7,
1637349cc55cSDimitry Andric                     [TuneAppleA7]>;
1638349cc55cSDimitry Andricdef : ProcessorModel<"apple-a10", CycloneModel, ProcessorFeatures.AppleA10,
1639349cc55cSDimitry Andric                     [TuneAppleA10]>;
1640349cc55cSDimitry Andricdef : ProcessorModel<"apple-a11", CycloneModel, ProcessorFeatures.AppleA11,
1641349cc55cSDimitry Andric                     [TuneAppleA11]>;
1642349cc55cSDimitry Andricdef : ProcessorModel<"apple-a12", CycloneModel, ProcessorFeatures.AppleA12,
1643349cc55cSDimitry Andric                     [TuneAppleA12]>;
1644349cc55cSDimitry Andricdef : ProcessorModel<"apple-a13", CycloneModel, ProcessorFeatures.AppleA13,
1645349cc55cSDimitry Andric                     [TuneAppleA13]>;
1646349cc55cSDimitry Andricdef : ProcessorModel<"apple-a14", CycloneModel, ProcessorFeatures.AppleA14,
1647349cc55cSDimitry Andric                     [TuneAppleA14]>;
1648bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a15", CycloneModel, ProcessorFeatures.AppleA15,
1649bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1650bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16,
1651bdd1243dSDimitry Andric                     [TuneAppleA16]>;
1652*5f757f3fSDimitry Andricdef : ProcessorModel<"apple-a17", CycloneModel, ProcessorFeatures.AppleA17,
1653*5f757f3fSDimitry Andric                     [TuneAppleA17]>;
1654fe6060f1SDimitry Andric// Mac CPUs
1655349cc55cSDimitry Andricdef : ProcessorModel<"apple-m1", CycloneModel, ProcessorFeatures.AppleA14,
1656349cc55cSDimitry Andric                     [TuneAppleA14]>;
1657bdd1243dSDimitry Andricdef : ProcessorModel<"apple-m2", CycloneModel, ProcessorFeatures.AppleA15,
1658bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1659*5f757f3fSDimitry Andricdef : ProcessorModel<"apple-m3", CycloneModel, ProcessorFeatures.AppleA16,
1660*5f757f3fSDimitry Andric                     [TuneAppleA16]>;
1661fe6060f1SDimitry Andric
1662480093f4SDimitry Andric// watch CPUs.
1663349cc55cSDimitry Andricdef : ProcessorModel<"apple-s4", CycloneModel, ProcessorFeatures.AppleA12,
1664349cc55cSDimitry Andric                     [TuneAppleA12]>;
1665349cc55cSDimitry Andricdef : ProcessorModel<"apple-s5", CycloneModel, ProcessorFeatures.AppleA12,
1666349cc55cSDimitry Andric                     [TuneAppleA12]>;
1667480093f4SDimitry Andric
16680b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
1669bdd1243dSDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, ProcessorFeatures.AppleA16,
1670bdd1243dSDimitry Andric                     [TuneAppleA16]>;
16710b57cec5SDimitry Andric
16725ffd83dbSDimitry Andric// Fujitsu A64FX
1673349cc55cSDimitry Andricdef : ProcessorModel<"a64fx", A64FXModel, ProcessorFeatures.A64FX,
1674349cc55cSDimitry Andric                     [TuneA64FX]>;
16755ffd83dbSDimitry Andric
16765ffd83dbSDimitry Andric// Nvidia Carmel
1677349cc55cSDimitry Andricdef : ProcessorModel<"carmel", NoSchedModel, ProcessorFeatures.Carmel,
1678349cc55cSDimitry Andric                     [TuneCarmel]>;
16795ffd83dbSDimitry Andric
16802a66634dSDimitry Andric// Ampere Computing
16812a66634dSDimitry Andricdef : ProcessorModel<"ampere1", Ampere1Model, ProcessorFeatures.Ampere1,
16822a66634dSDimitry Andric                     [TuneAmpere1]>;
16832a66634dSDimitry Andric
1684bdd1243dSDimitry Andricdef : ProcessorModel<"ampere1a", Ampere1Model, ProcessorFeatures.Ampere1A,
1685bdd1243dSDimitry Andric                     [TuneAmpere1A]>;
1686bdd1243dSDimitry Andric
16870b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
16880b57cec5SDimitry Andric// Assembly parser
16890b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
16900b57cec5SDimitry Andric
16910b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
16920b57cec5SDimitry Andric  int Variant = 0;
16930b57cec5SDimitry Andric  string Name = "generic";
16940b57cec5SDimitry Andric  string BreakCharacters = ".";
16950b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
16960b57cec5SDimitry Andric}
16970b57cec5SDimitry Andric
16980b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
16990b57cec5SDimitry Andric  int Variant = 1;
17000b57cec5SDimitry Andric  string Name = "apple-neon";
17010b57cec5SDimitry Andric  string BreakCharacters = ".";
17020b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
17030b57cec5SDimitry Andric}
17040b57cec5SDimitry Andric
17050b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17060b57cec5SDimitry Andric// Assembly printer
17070b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17080b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
17090b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
17100b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
17110b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
17120b57cec5SDimitry Andric  int PassSubtarget = 1;
17130b57cec5SDimitry Andric  int Variant = 0;
17140b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
17150b57cec5SDimitry Andric}
17160b57cec5SDimitry Andric
17170b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
17180b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
17190b57cec5SDimitry Andric  int PassSubtarget = 1;
17200b57cec5SDimitry Andric  int Variant = 1;
17210b57cec5SDimitry Andric  int isMCAsmWriter = 1;
17220b57cec5SDimitry Andric}
17230b57cec5SDimitry Andric
17240b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17250b57cec5SDimitry Andric// Target Declaration
17260b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17270b57cec5SDimitry Andric
17280b57cec5SDimitry Andricdef AArch64 : Target {
17290b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
17300b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
17310b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
17320b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
17330b57cec5SDimitry Andric}
17340b57cec5SDimitry Andric
17350b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17360b57cec5SDimitry Andric// Pfm Counters
17370b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
17380b57cec5SDimitry Andric
17390b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
1740