xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 8a4dda33d67586ca2624f2a38417baa03a533a7f)
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
1305ffd83dbSDimitry Andric// This flag is currently still labeled as Experimental, but when fully
1315ffd83dbSDimitry Andric// implemented this should tell the compiler to use the zeroing pseudos to
1325ffd83dbSDimitry Andric// benefit from the reverse instructions (e.g. SUB vs SUBR) if the inactive
1335ffd83dbSDimitry Andric// lanes are known to be zero. The pseudos will then be expanded using the
1345ffd83dbSDimitry Andric// MOVPRFX instruction to zero the inactive lanes. This feature should only be
1355ffd83dbSDimitry Andric// enabled if MOVPRFX instructions are known to merge with the destructive
1365ffd83dbSDimitry Andric// operations they prefix.
1375ffd83dbSDimitry Andric//
1385ffd83dbSDimitry Andric// This feature could similarly be extended to support cheap merging of _any_
1395ffd83dbSDimitry Andric// value into the inactive lanes using the MOVPRFX instruction that uses
1405ffd83dbSDimitry Andric// merging-predication.
1415ffd83dbSDimitry Andricdef FeatureExperimentalZeroingPseudos
1425ffd83dbSDimitry Andric    : SubtargetFeature<"use-experimental-zeroing-pseudos",
1435ffd83dbSDimitry Andric                       "UseExperimentalZeroingPseudos", "true",
1445ffd83dbSDimitry Andric                       "Hint to the compiler that the MOVPRFX instruction is "
1455ffd83dbSDimitry Andric                       "merged with destructive operations",
1465ffd83dbSDimitry Andric                       []>;
1470b57cec5SDimitry Andric
148349cc55cSDimitry Andricdef FeatureUseScalarIncVL : SubtargetFeature<"use-scalar-inc-vl",
149349cc55cSDimitry Andric  "UseScalarIncVL", "true", "Prefer inc/dec over add+cnt">;
150349cc55cSDimitry Andric
151*8a4dda33SDimitry Andricdef FeatureNoSVEFPLD1R : SubtargetFeature<"no-sve-fp-ld1r",
152*8a4dda33SDimitry Andric  "NoSVEFPLD1R", "true", "Avoid using LD1RX instructions for FP">;
153*8a4dda33SDimitry Andric
1540b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
155bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions (FEAT_SVE2)",
156349cc55cSDimitry Andric  [FeatureSVE, FeatureUseScalarIncVL]>;
1570b57cec5SDimitry Andric
1580b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
159bdd1243dSDimitry Andric  "Enable AES SVE2 instructions (FEAT_SVE_AES, FEAT_SVE_PMULL128)",
160bdd1243dSDimitry Andric  [FeatureSVE2, FeatureAES]>;
1610b57cec5SDimitry Andric
1620b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
163bdd1243dSDimitry Andric  "Enable SM4 SVE2 instructions (FEAT_SVE_SM4)", [FeatureSVE2, FeatureSM4]>;
1640b57cec5SDimitry Andric
1650b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
166bdd1243dSDimitry Andric  "Enable SHA3 SVE2 instructions (FEAT_SVE_SHA3)", [FeatureSVE2, FeatureSHA3]>;
1670b57cec5SDimitry Andric
1680b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
169bdd1243dSDimitry Andric  "Enable bit permutation SVE2 instructions (FEAT_SVE_BitPerm)", [FeatureSVE2]>;
170bdd1243dSDimitry Andric
171bdd1243dSDimitry Andricdef FeatureSVE2p1: SubtargetFeature<"sve2p1", "HasSVE2p1", "true",
172bdd1243dSDimitry Andric  "Enable Scalable Vector Extension 2.1 instructions", [FeatureSVE2]>;
173bdd1243dSDimitry Andric
174bdd1243dSDimitry Andricdef FeatureB16B16 : SubtargetFeature<"b16b16", "HasB16B16", "true",
175bdd1243dSDimitry Andric  "Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions (FEAT_B16B16)", []>;
1760b57cec5SDimitry Andric
1770b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
1780b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
1798bcb0991SDimitry Andric
1800b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
1810b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
1820b57cec5SDimitry Andric
18381ad6265SDimitry Andric// It is generally beneficial to rewrite "fmov s0, wzr" to "movi d0, #0".
18481ad6265SDimitry Andric// as movi is more efficient across all cores. Newer cores can eliminate
18581ad6265SDimitry Andric// fmovs early and there is no difference with movi, but this not true for
18681ad6265SDimitry Andric// all implementations.
187fe6060f1SDimitry Andricdef FeatureNoZCZeroingFP : SubtargetFeature<"no-zcz-fp", "HasZeroCycleZeroingFP", "false",
188fe6060f1SDimitry Andric                                        "Has no zero-cycle zeroing instructions for FP registers">;
1890b57cec5SDimitry Andric
1900b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
1910b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
192fe6060f1SDimitry Andric                                        [FeatureZCZeroingGP]>;
1930b57cec5SDimitry Andric
1940b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
1950b57cec5SDimitry Andric/// CPUs.
1960b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
1970b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
1980b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
1990b57cec5SDimitry Andric
2000b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
20181ad6265SDimitry Andric                                          "RequiresStrictAlign", "true",
2020b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
2030b57cec5SDimitry Andric                                          "access">;
2040b57cec5SDimitry Andric
2055ffd83dbSDimitry Andricforeach i = {1-7,9-15,18,20-28,30} in
2060b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
2070b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
2080b57cec5SDimitry Andric                                             "as a GPR">;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricforeach i = {8-15,18} in
2110b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
2120b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
2130b57cec5SDimitry Andric
2140b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
2150b57cec5SDimitry Andric    "true",
2160b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
2170b57cec5SDimitry Andric
2180b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
2190b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
2200b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
2210b57cec5SDimitry Andric
222bdd1243dSDimitry Andricdef FeatureEnableSelectOptimize : SubtargetFeature<
223bdd1243dSDimitry Andric    "enable-select-opt", "EnableSelectOptimize", "true",
224bdd1243dSDimitry Andric    "Enable the select optimize pass for select loop heuristics">;
225bdd1243dSDimitry Andric
2260b57cec5SDimitry Andricdef FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
22781ad6265SDimitry Andric    "HasCustomCheapAsMoveHandling", "true",
2280b57cec5SDimitry Andric    "Use custom handling of cheap instructions">;
2290b57cec5SDimitry Andric
2300b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
23181ad6265SDimitry Andric    "HasExynosCheapAsMoveHandling", "true",
2320b57cec5SDimitry Andric    "Use Exynos specific handling of cheap instructions",
2330b57cec5SDimitry Andric    [FeatureCustomCheapAsMoveHandling]>;
2340b57cec5SDimitry Andric
2350b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
2360b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
2370b57cec5SDimitry Andric
2380b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
23981ad6265SDimitry Andric    "IsMisaligned128StoreSlow", "true", "Misaligned 128 bit stores are slow">;
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
24281ad6265SDimitry Andric    "IsPaired128Slow", "true", "Paired 128 bit loads and stores are slow">;
2430b57cec5SDimitry Andric
24481ad6265SDimitry Andricdef FeatureAscendStoreAddress : SubtargetFeature<"ascend-store-address",
245fcaf7f86SDimitry Andric    "IsStoreAddressAscend", "true",
24681ad6265SDimitry Andric    "Schedule vector stores by ascending address">;
24781ad6265SDimitry Andric
24881ad6265SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "IsSTRQroSlow",
2490b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
2500b57cec5SDimitry Andric
2510b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
2520b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
2530b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
2540b57cec5SDimitry Andric
2550b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
2560b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
2570b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
2580b57cec5SDimitry Andric
2590b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
2600b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
2610b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
2620b57cec5SDimitry Andric
263e8d8bef9SDimitry Andricdef FeatureCmpBccFusion : SubtargetFeature<
264e8d8bef9SDimitry Andric    "cmp-bcc-fusion", "HasCmpBccFusion", "true",
265e8d8bef9SDimitry Andric    "CPU fuses cmp+bcc operations">;
266e8d8bef9SDimitry Andric
2670b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
2680b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
2690b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
2700b57cec5SDimitry Andric
2710b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
2720b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
2730b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
2740b57cec5SDimitry Andric
2750b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
2760b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
2770b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
2780b57cec5SDimitry Andric
2790b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
2800b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
2810b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
2820b57cec5SDimitry Andric
2830b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
2840b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
2850b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
2860b57cec5SDimitry Andric
28781ad6265SDimitry Andricdef FeatureFuseAdrpAdd : SubtargetFeature<
28881ad6265SDimitry Andric    "fuse-adrp-add", "HasFuseAdrpAdd", "true",
28981ad6265SDimitry Andric    "CPU fuses adrp+add operations">;
29081ad6265SDimitry Andric
2910b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
2920b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
2930b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
2940b57cec5SDimitry Andric
29506c3fb27SDimitry Andricdef FeatureFuseAddSub2RegAndConstOne : SubtargetFeature<
29606c3fb27SDimitry Andric   "fuse-addsub-2reg-const1", "HasFuseAddSub2RegAndConstOne", "true",
29706c3fb27SDimitry Andric   "CPU fuses (a + b + 1) and (a - b - 1)">;
29806c3fb27SDimitry Andric
2990b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
3000b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
3010b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
3020b57cec5SDimitry Andric
3030b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
3040b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
3050b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
3060b57cec5SDimitry Andric
3070b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
308bdd1243dSDimitry Andric                                   "Enable support for RCPC extension (FEAT_LRCPC)">;
3090b57cec5SDimitry Andric
3100b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
3110b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
3120b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
3130b57cec5SDimitry Andric
3140b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
3150b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
316bdd1243dSDimitry Andric    "Enable dot product support (FEAT_DotProd)">;
3170b57cec5SDimitry Andric
318e8d8bef9SDimitry Andricdef FeaturePAuth : SubtargetFeature<
319e8d8bef9SDimitry Andric    "pauth", "HasPAuth", "true",
320bdd1243dSDimitry Andric    "Enable v8.3-A Pointer Authentication extension (FEAT_PAuth)">;
3210b57cec5SDimitry Andric
3220b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
3230b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
324bdd1243dSDimitry Andric    "Enable v8.3-A JavaScript FP conversion instructions (FEAT_JSCVT)",
3250b57cec5SDimitry Andric    [FeatureFPARMv8]>;
3260b57cec5SDimitry Andric
3270b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
3280b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
329bdd1243dSDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets (FEAT_CCIDX)">;
3300b57cec5SDimitry Andric
3310b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
3320b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
333bdd1243dSDimitry Andric    "Enable v8.3-A Floating-point complex number support (FEAT_FCMA)",
3340b57cec5SDimitry Andric    [FeatureNEON]>;
3350b57cec5SDimitry Andric
3360b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
3370b57cec5SDimitry Andric    "nv", "HasNV", "true",
338bdd1243dSDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement (FEAT_NV, FEAT_NV2)">;
3390b57cec5SDimitry Andric
3400b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
3410b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
342bdd1243dSDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension (FEAT_MPAM)">;
3430b57cec5SDimitry Andric
3440b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
3450b57cec5SDimitry Andric    "dit", "HasDIT", "true",
346bdd1243dSDimitry Andric    "Enable v8.4-A Data Independent Timing instructions (FEAT_DIT)">;
3470b57cec5SDimitry Andric
3480b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
3490b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
350bdd1243dSDimitry Andric    "Enable v8.4-A Trace extension (FEAT_TRF)">;
3510b57cec5SDimitry Andric
3520b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
3530b57cec5SDimitry Andric    "am", "HasAM", "true",
354bdd1243dSDimitry Andric    "Enable v8.4-A Activity Monitors extension (FEAT_AMUv1)">;
3550b57cec5SDimitry Andric
3565ffd83dbSDimitry Andricdef FeatureAMVS : SubtargetFeature<
3575ffd83dbSDimitry Andric    "amvs", "HasAMVS", "true",
358bdd1243dSDimitry Andric    "Enable v8.6-A Activity Monitors Virtualization support (FEAT_AMUv1p1)",
3595ffd83dbSDimitry Andric    [FeatureAM]>;
3605ffd83dbSDimitry Andric
3610b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
3620b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
363bdd1243dSDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension (FEAT_SEL2)">;
3640b57cec5SDimitry Andric
3650b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
3660b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
367bdd1243dSDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions (FEAT_TLBIOS, FEAT_TLBIRANGE)">;
3680b57cec5SDimitry Andric
369e8d8bef9SDimitry Andricdef FeatureFlagM : SubtargetFeature<
370e8d8bef9SDimitry Andric    "flagm", "HasFlagM", "true",
371bdd1243dSDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions (FEAT_FlagM)">;
3720b57cec5SDimitry Andric
3730b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3740b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
375bdd1243dSDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets (FEAT_LRCPC2)",
3760b57cec5SDimitry Andric    [FeatureRCPC]>;
3770b57cec5SDimitry Andric
3780b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3790b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3800b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3810b57cec5SDimitry Andric                                        "to their negated or complemented "
3820b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3830b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3840b57cec5SDimitry Andric
3850b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
3860b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
3870b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
3880b57cec5SDimitry Andric
3890b57cec5SDimitry Andricdef FeatureAggressiveFMA :
3900b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
3910b57cec5SDimitry Andric                   "HasAggressiveFMA",
3920b57cec5SDimitry Andric                   "true",
3930b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
3940b57cec5SDimitry Andric
3950b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
396bdd1243dSDimitry Andric  "Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)">;
3970b57cec5SDimitry Andric
3980b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
3990b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
400bdd1243dSDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int (FEAT_FRINTTS)" >;
4010b57cec5SDimitry Andric
4020b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
403bdd1243dSDimitry Andric  "true", "Enable architectural speculation restriction (FEAT_CSV2_2)">;
4040b57cec5SDimitry Andric
4050b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
406bdd1243dSDimitry Andric  "true", "Enable v8.5 Speculation Barrier (FEAT_SB)" >;
4070b57cec5SDimitry Andric
4080b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
409bdd1243dSDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit (FEAT_SSBS, FEAT_SSBS2)" >;
4100b57cec5SDimitry Andric
4110b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
412bdd1243dSDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions (FEAT_SPECRES)" >;
4130b57cec5SDimitry Andric
4140b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
415bdd1243dSDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)" >;
4160b57cec5SDimitry Andric
4170b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
418bdd1243dSDimitry Andric    "true", "Enable Branch Target Identification (FEAT_BTI)" >;
4190b57cec5SDimitry Andric
4200b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
421bdd1243dSDimitry Andric    "true", "Enable Random Number generation instructions (FEAT_RNG)" >;
4220b57cec5SDimitry Andric
4230b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
424bdd1243dSDimitry Andric    "true", "Enable Memory Tagging Extension (FEAT_MTE, FEAT_MTE2)" >;
4250b57cec5SDimitry Andric
4268bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
427bdd1243dSDimitry Andric    "true", "Enable Trace Buffer Extension (FEAT_TRBE)">;
4288bcb0991SDimitry Andric
4298bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
430bdd1243dSDimitry Andric    "true", "Enable Embedded Trace Extension (FEAT_ETE)",
4318bcb0991SDimitry Andric    [FeatureTRBE]>;
4328bcb0991SDimitry Andric
4338bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
434bdd1243dSDimitry Andric    "true", "Enable Transactional Memory Extension (FEAT_TME)" >;
4358bcb0991SDimitry Andric
4368bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
4378bcb0991SDimitry Andric    "AllowTaggedGlobals",
4388bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
4398bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
4408bcb0991SDimitry Andric
4415ffd83dbSDimitry Andricdef FeatureBF16 : SubtargetFeature<"bf16", "HasBF16",
442bdd1243dSDimitry Andric    "true", "Enable BFloat16 Extension (FEAT_BF16)" >;
4435ffd83dbSDimitry Andric
4445ffd83dbSDimitry Andricdef FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
445bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply Int8 Extension (FEAT_I8MM)">;
4465ffd83dbSDimitry Andric
4475ffd83dbSDimitry Andricdef FeatureMatMulFP32 : SubtargetFeature<"f32mm", "HasMatMulFP32",
448bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP32 Extension (FEAT_F32MM)", [FeatureSVE]>;
4495ffd83dbSDimitry Andric
4505ffd83dbSDimitry Andricdef FeatureMatMulFP64 : SubtargetFeature<"f64mm", "HasMatMulFP64",
451bdd1243dSDimitry Andric    "true", "Enable Matrix Multiply FP64 Extension (FEAT_F64MM)", [FeatureSVE]>;
4525ffd83dbSDimitry Andric
453e8d8bef9SDimitry Andricdef FeatureXS : SubtargetFeature<"xs", "HasXS",
454bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A limited-TLB-maintenance instruction (FEAT_XS)">;
455e8d8bef9SDimitry Andric
456e8d8bef9SDimitry Andricdef FeatureWFxT : SubtargetFeature<"wfxt", "HasWFxT",
457bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A WFET and WFIT instruction (FEAT_WFxT)">;
458e8d8bef9SDimitry Andric
459e8d8bef9SDimitry Andricdef FeatureHCX : SubtargetFeature<
460bdd1243dSDimitry Andric    "hcx", "HasHCX", "true", "Enable Armv8.7-A HCRX_EL2 system register (FEAT_HCX)">;
461e8d8bef9SDimitry Andric
462e8d8bef9SDimitry Andricdef FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
463bdd1243dSDimitry Andric    "true", "Enable Armv8.7-A LD64B/ST64B Accelerator Extension (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)">;
464e8d8bef9SDimitry Andric
46504eeddc0SDimitry Andricdef FeatureHBC : SubtargetFeature<"hbc", "HasHBC",
466bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Hinted Conditional Branches Extension (FEAT_HBC)">;
46704eeddc0SDimitry Andric
46804eeddc0SDimitry Andricdef FeatureMOPS : SubtargetFeature<"mops", "HasMOPS",
469bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A memcpy and memset acceleration instructions (FEAT_MOPS)">;
470bdd1243dSDimitry Andric
471bdd1243dSDimitry Andricdef FeatureNMI : SubtargetFeature<"nmi", "HasNMI",
472bdd1243dSDimitry Andric    "true", "Enable Armv8.8-A Non-maskable Interrupts (FEAT_NMI, FEAT_GICv3_NMI)">;
47304eeddc0SDimitry Andric
474e8d8bef9SDimitry Andricdef FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
475bdd1243dSDimitry Andric    "true", "Enable Branch Record Buffer Extension (FEAT_BRBE)">;
476e8d8bef9SDimitry Andric
477e8d8bef9SDimitry Andricdef FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
478bdd1243dSDimitry Andric    "true", "Enable extra register in the Statistical Profiling Extension (FEAT_SPEv1p2)">;
479e8d8bef9SDimitry Andric
4805ffd83dbSDimitry Andricdef FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
481bdd1243dSDimitry Andric    "true", "Enable fine grained virtualization traps extension (FEAT_FGT)">;
4825ffd83dbSDimitry Andric
4835ffd83dbSDimitry Andricdef FeatureEnhancedCounterVirtualization :
4845ffd83dbSDimitry Andric      SubtargetFeature<"ecv", "HasEnhancedCounterVirtualization",
485bdd1243dSDimitry Andric      "true", "Enable enhanced counter virtualization extension (FEAT_ECV)">;
4865ffd83dbSDimitry Andric
487fe6060f1SDimitry Andricdef FeatureRME : SubtargetFeature<"rme", "HasRME",
488bdd1243dSDimitry Andric    "true", "Enable Realm Management Extension (FEAT_RME)">;
489fe6060f1SDimitry Andric
490fe6060f1SDimitry Andricdef FeatureSME : SubtargetFeature<"sme", "HasSME", "true",
491bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) (FEAT_SME)", [FeatureBF16, FeatureUseScalarIncVL]>;
492fe6060f1SDimitry Andric
493bdd1243dSDimitry Andricdef FeatureSMEF64F64 : SubtargetFeature<"sme-f64f64", "HasSMEF64F64", "true",
494bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) F64F64 instructions (FEAT_SME_F64F64)", [FeatureSME]>;
495fe6060f1SDimitry Andric
496bdd1243dSDimitry Andricdef FeatureSMEI16I64 : SubtargetFeature<"sme-i16i64", "HasSMEI16I64", "true",
497bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension (SME) I16I64 instructions (FEAT_SME_I16I64)", [FeatureSME]>;
498bdd1243dSDimitry Andric
499bdd1243dSDimitry Andricdef FeatureSMEF16F16 : SubtargetFeature<"sme-f16f16", "HasSMEF16F16", "true",
500bdd1243dSDimitry Andric  "Enable SME2.1 non-widening Float16 instructions (FEAT_SME_F16F16)", []>;
501bdd1243dSDimitry Andric
502bdd1243dSDimitry Andricdef FeatureSME2 : SubtargetFeature<"sme2", "HasSME2", "true",
503bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2 (SME2) instructions", [FeatureSME]>;
504bdd1243dSDimitry Andric
505bdd1243dSDimitry Andricdef FeatureSME2p1 : SubtargetFeature<"sme2p1", "HasSME2p1", "true",
506bdd1243dSDimitry Andric  "Enable Scalable Matrix Extension 2.1 (FEAT_SME2p1) instructions", [FeatureSME2]>;
507fe6060f1SDimitry Andric
508349cc55cSDimitry Andricdef FeatureAppleA7SysReg  : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
509349cc55cSDimitry Andric  "Apple A7 (the CPU formerly known as Cyclone)">;
510349cc55cSDimitry Andric
511349cc55cSDimitry Andricdef FeatureEL2VMSA : SubtargetFeature<"el2vmsa", "HasEL2VMSA", "true",
512349cc55cSDimitry Andric  "Enable Exception Level 2 Virtual Memory System Architecture">;
513349cc55cSDimitry Andric
514349cc55cSDimitry Andricdef FeatureEL3 : SubtargetFeature<"el3", "HasEL3", "true",
515349cc55cSDimitry Andric  "Enable Exception Level 3">;
516349cc55cSDimitry Andric
517bdd1243dSDimitry Andricdef FeatureCSSC : SubtargetFeature<"cssc", "HasCSSC", "true",
518bdd1243dSDimitry Andric  "Enable Common Short Sequence Compression (CSSC) instructions (FEAT_CSSC)">;
519bdd1243dSDimitry Andric
5200eae32dcSDimitry Andricdef FeatureFixCortexA53_835769 : SubtargetFeature<"fix-cortex-a53-835769",
5210eae32dcSDimitry Andric  "FixCortexA53_835769", "true", "Mitigate Cortex-A53 Erratum 835769">;
5220eae32dcSDimitry Andric
5233a9a9c0cSDimitry Andricdef FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice",
5243a9a9c0cSDimitry Andric                                                 "NoBTIAtReturnTwice", "true",
5253a9a9c0cSDimitry Andric                                                 "Don't place a BTI instruction "
5263a9a9c0cSDimitry Andric                                                 "after a return-twice">;
5273a9a9c0cSDimitry Andric
52806c3fb27SDimitry Andricdef FeatureCHK : SubtargetFeature<"chk", "HasCHK",
52906c3fb27SDimitry Andric    "true", "Enable Armv8.0-A Check Feature Status Extension (FEAT_CHK)">;
53006c3fb27SDimitry Andric
53106c3fb27SDimitry Andricdef FeatureGCS : SubtargetFeature<"gcs", "HasGCS",
53206c3fb27SDimitry Andric    "true", "Enable Armv9.4-A Guarded Call Stack Extension", [FeatureCHK]>;
53306c3fb27SDimitry Andric
534bdd1243dSDimitry Andricdef FeatureCLRBHB : SubtargetFeature<"clrbhb", "HasCLRBHB",
535bdd1243dSDimitry Andric    "true", "Enable Clear BHB instruction (FEAT_CLRBHB)">;
536bdd1243dSDimitry Andric
537bdd1243dSDimitry Andricdef FeaturePRFM_SLC : SubtargetFeature<"prfm-slc-target", "HasPRFM_SLC",
538bdd1243dSDimitry Andric    "true", "Enable SLC target for PRFM instruction">;
539bdd1243dSDimitry Andric
540bdd1243dSDimitry Andricdef FeatureSPECRES2 : SubtargetFeature<"specres2", "HasSPECRES2",
541bdd1243dSDimitry Andric    "true", "Enable Speculation Restriction Instruction (FEAT_SPECRES2)",
542bdd1243dSDimitry Andric    [FeaturePredRes]>;
543bdd1243dSDimitry Andric
544bdd1243dSDimitry Andricdef FeatureMEC : SubtargetFeature<"mec", "HasMEC",
545bdd1243dSDimitry Andric    "true", "Enable Memory Encryption Contexts Extension", [FeatureRME]>;
546bdd1243dSDimitry Andric
547bdd1243dSDimitry Andricdef FeatureITE : SubtargetFeature<"ite", "HasITE",
548bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A Instrumentation Extension FEAT_ITE", [FeatureETE,
549bdd1243dSDimitry Andric    FeatureTRBE]>;
550bdd1243dSDimitry Andric
551bdd1243dSDimitry Andricdef FeatureRCPC3 : SubtargetFeature<"rcpc3", "HasRCPC3",
552bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A RCPC instructions for A64 and Advanced SIMD and floating-point instruction set (FEAT_LRCPC3)",
553bdd1243dSDimitry Andric    [FeatureRCPC_IMMO]>;
554bdd1243dSDimitry Andric
555bdd1243dSDimitry Andricdef FeatureTHE : SubtargetFeature<"the", "HasTHE",
556bdd1243dSDimitry Andric    "true", "Enable Armv8.9-A Translation Hardening Extension (FEAT_THE)">;
557bdd1243dSDimitry Andric
558bdd1243dSDimitry Andricdef FeatureLSE128 : SubtargetFeature<"lse128", "HasLSE128",
559bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Atomic Instructions (FEAT_LSE128)",
560bdd1243dSDimitry Andric    [FeatureLSE]>;
561bdd1243dSDimitry Andric
562bdd1243dSDimitry Andric// FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, and FEAT_SYSINSTR128 are mutually implicit.
563bdd1243dSDimitry Andric// Therefore group them all under a single feature flag, d128:
564bdd1243dSDimitry Andricdef FeatureD128 : SubtargetFeature<"d128", "HasD128",
565bdd1243dSDimitry Andric    "true", "Enable Armv9.4-A 128-bit Page Table Descriptors, System Registers "
566bdd1243dSDimitry Andric    "and Instructions (FEAT_D128, FEAT_LVA3, FEAT_SYSREG128, FEAT_SYSINSTR128)",
567bdd1243dSDimitry Andric    [FeatureLSE128]>;
568bdd1243dSDimitry Andric
5690b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5700b57cec5SDimitry Andric// Architectures.
5710b57cec5SDimitry Andric//
572349cc55cSDimitry Andricdef HasV8_0aOps : SubtargetFeature<"v8a", "HasV8_0aOps", "true",
573349cc55cSDimitry Andric  "Support ARM v8.0a instructions", [FeatureEL2VMSA, FeatureEL3]>;
5740b57cec5SDimitry Andric
5750b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
576349cc55cSDimitry Andric  "Support ARM v8.1a instructions", [HasV8_0aOps, FeatureCRC, FeatureLSE,
577349cc55cSDimitry Andric  FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH]>;
5780b57cec5SDimitry Andric
5790b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
5800b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
5810b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
5820b57cec5SDimitry Andric
5830b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
584e8d8bef9SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePAuth,
5850b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
5860b57cec5SDimitry Andric
5870b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
5880b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
589e8d8bef9SDimitry Andric  FeatureNV, FeatureMPAM, FeatureDIT,
590349cc55cSDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
591349cc55cSDimitry Andric  FeatureFlagM, FeatureRCPC_IMMO, FeatureLSE2]>;
5920b57cec5SDimitry Andric
5930b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
5940b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
5950b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
5960b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
5975ffd83dbSDimitry Andric   FeatureBranchTargetId]>;
5985ffd83dbSDimitry Andric
5995ffd83dbSDimitry Andricdef HasV8_6aOps : SubtargetFeature<
6005ffd83dbSDimitry Andric  "v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions",
6015ffd83dbSDimitry Andric  [HasV8_5aOps, FeatureAMVS, FeatureBF16, FeatureFineGrainedTraps,
6025ffd83dbSDimitry Andric   FeatureEnhancedCounterVirtualization, FeatureMatMulInt8]>;
6030b57cec5SDimitry Andric
604e8d8bef9SDimitry Andricdef HasV8_7aOps : SubtargetFeature<
605e8d8bef9SDimitry Andric  "v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions",
606e8d8bef9SDimitry Andric  [HasV8_6aOps, FeatureXS, FeatureWFxT, FeatureHCX]>;
607e8d8bef9SDimitry Andric
60804eeddc0SDimitry Andricdef HasV8_8aOps : SubtargetFeature<
60904eeddc0SDimitry Andric  "v8.8a", "HasV8_8aOps", "true", "Support ARM v8.8a instructions",
610bdd1243dSDimitry Andric  [HasV8_7aOps, FeatureHBC, FeatureMOPS, FeatureNMI]>;
611bdd1243dSDimitry Andric
612bdd1243dSDimitry Andricdef HasV8_9aOps : SubtargetFeature<
613bdd1243dSDimitry Andric  "v8.9a", "HasV8_9aOps", "true", "Support ARM v8.9a instructions",
614bdd1243dSDimitry Andric  [HasV8_8aOps, FeatureCLRBHB, FeaturePRFM_SLC, FeatureSPECRES2,
61506c3fb27SDimitry Andric   FeatureCSSC, FeatureRASv2, FeatureCHK]>;
61604eeddc0SDimitry Andric
617349cc55cSDimitry Andricdef HasV9_0aOps : SubtargetFeature<
618349cc55cSDimitry Andric  "v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions",
619bdd1243dSDimitry Andric  [HasV8_5aOps, FeatureMEC, FeatureSVE2]>;
620349cc55cSDimitry Andric
621349cc55cSDimitry Andricdef HasV9_1aOps : SubtargetFeature<
622349cc55cSDimitry Andric  "v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions",
623349cc55cSDimitry Andric  [HasV8_6aOps, HasV9_0aOps]>;
624349cc55cSDimitry Andric
625349cc55cSDimitry Andricdef HasV9_2aOps : SubtargetFeature<
626349cc55cSDimitry Andric  "v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions",
627349cc55cSDimitry Andric  [HasV8_7aOps, HasV9_1aOps]>;
628349cc55cSDimitry Andric
62904eeddc0SDimitry Andricdef HasV9_3aOps : SubtargetFeature<
63004eeddc0SDimitry Andric  "v9.3a", "HasV9_3aOps", "true", "Support ARM v9.3a instructions",
63104eeddc0SDimitry Andric  [HasV8_8aOps, HasV9_2aOps]>;
63204eeddc0SDimitry Andric
633bdd1243dSDimitry Andricdef HasV9_4aOps : SubtargetFeature<
634bdd1243dSDimitry Andric  "v9.4a", "HasV9_4aOps", "true", "Support ARM v9.4a instructions",
635bdd1243dSDimitry Andric  [HasV8_9aOps, HasV9_3aOps]>;
636bdd1243dSDimitry Andric
637e8d8bef9SDimitry Andricdef HasV8_0rOps : SubtargetFeature<
638e8d8bef9SDimitry Andric  "v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
639e8d8bef9SDimitry Andric  [//v8.1
640e8d8bef9SDimitry Andric  FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
641e8d8bef9SDimitry Andric  //v8.2
64204eeddc0SDimitry Andric  FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
643e8d8bef9SDimitry Andric  //v8.3
644e8d8bef9SDimitry Andric  FeatureComplxNum, FeatureCCIDX, FeatureJS,
645e8d8bef9SDimitry Andric  FeaturePAuth, FeatureRCPC,
646e8d8bef9SDimitry Andric  //v8.4
64704eeddc0SDimitry Andric  FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
64881ad6265SDimitry Andric  FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO,
64981ad6265SDimitry Andric  // Not mandatory in v8.0-R, but included here on the grounds that it
65081ad6265SDimitry Andric  // only enables names of system registers
65181ad6265SDimitry Andric  FeatureSpecRestrict
65281ad6265SDimitry Andric  ]>;
65381ad6265SDimitry Andric
65481ad6265SDimitry Andric// Only intended to be used by disassemblers.
65581ad6265SDimitry Andricdef FeatureAll
65681ad6265SDimitry Andric    : SubtargetFeature<"all", "IsAll", "true", "Enable all instructions", []>;
65781ad6265SDimitry Andric
65881ad6265SDimitry Andricclass AssemblerPredicateWithAll<dag cond, string name="">
65981ad6265SDimitry Andric    : AssemblerPredicate<(any_of FeatureAll, cond), name>;
660e8d8bef9SDimitry Andric
6610b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6620b57cec5SDimitry Andric// Register File Description
6630b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6640b57cec5SDimitry Andric
6650b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
6660b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
6670b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
6680b57cec5SDimitry Andric
6690b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6700b57cec5SDimitry Andric// Instruction Descriptions
6710b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6720b57cec5SDimitry Andric
6730b57cec5SDimitry Andricinclude "AArch64Schedule.td"
6740b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
6750b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
6760b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
67706c3fb27SDimitry Andricinclude "AArch64SchedPredNeoverse.td"
6788bcb0991SDimitry Andricinclude "AArch64Combine.td"
6790b57cec5SDimitry Andric
6800b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
6810b57cec5SDimitry Andric
6820b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6830b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
6840b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6850b57cec5SDimitry Andric
6860b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
6870b57cec5SDimitry Andric
6880b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6890b57cec5SDimitry Andric// Access to privileged registers
6900b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6910b57cec5SDimitry Andric
6920b57cec5SDimitry Andricforeach i = 1-3 in
6930b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
6940b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
69506c3fb27SDimitry Andricdef FeatureUseROEL0ForTP : SubtargetFeature<"tpidrro-el0", "UseROEL0ForTP",
69606c3fb27SDimitry Andric  "true", "Permit use of TPIDRRO_EL0 for the TLS base">;
6970b57cec5SDimitry Andric
6980b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
6995ffd83dbSDimitry Andric// Control codegen mitigation against Straight Line Speculation vulnerability.
7005ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
7015ffd83dbSDimitry Andric
7025ffd83dbSDimitry Andricdef FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
7035ffd83dbSDimitry Andric  "HardenSlsRetBr", "true",
7045ffd83dbSDimitry Andric  "Harden against straight line speculation across RET and BR instructions">;
7055ffd83dbSDimitry Andricdef FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
7065ffd83dbSDimitry Andric  "HardenSlsBlr", "true",
7075ffd83dbSDimitry Andric  "Harden against straight line speculation across BLR instructions">;
708fe6060f1SDimitry Andricdef FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
709fe6060f1SDimitry Andric  "HardenSlsNoComdat", "true",
710fe6060f1SDimitry Andric  "Generate thunk code for SLS mitigation in the normal text section">;
7115ffd83dbSDimitry Andric
7125ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
7130b57cec5SDimitry Andric// AArch64 Processors supported.
7140b57cec5SDimitry Andric//
7150b57cec5SDimitry Andric
7160b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7170b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
7180b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7190b57cec5SDimitry Andric
7200b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
7210b57cec5SDimitry Andric
72206c3fb27SDimitry Andriclet F = [HasSVE2p1, HasSVE2p1_or_HasSME2, HasSVE2p1_or_HasSME2p1] in
72306c3fb27SDimitry Andricdef SVE2p1Unsupported : AArch64Unsupported;
72406c3fb27SDimitry Andric
72506c3fb27SDimitry Andricdef SVE2Unsupported : AArch64Unsupported {
72606c3fb27SDimitry Andric  let F = !listconcat([HasSVE2, HasSVE2orSME,
72706c3fb27SDimitry Andric                       HasSVE2AES, HasSVE2SHA3, HasSVE2SM4, HasSVE2BitPerm],
72806c3fb27SDimitry Andric                       SVE2p1Unsupported.F);
7290b57cec5SDimitry Andric}
7300b57cec5SDimitry Andric
73106c3fb27SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
73206c3fb27SDimitry Andric  let F = !listconcat([HasSVE, HasSVEorSME],
73306c3fb27SDimitry Andric                      SVE2Unsupported.F);
73406c3fb27SDimitry Andric}
73506c3fb27SDimitry Andric
73606c3fb27SDimitry Andriclet F = [HasSME2p1, HasSVE2p1_or_HasSME2p1] in
73706c3fb27SDimitry Andricdef SME2p1Unsupported : AArch64Unsupported;
73806c3fb27SDimitry Andric
73906c3fb27SDimitry Andricdef SME2Unsupported : AArch64Unsupported {
74006c3fb27SDimitry Andric  let F = !listconcat([HasSME2, HasSVE2p1_or_HasSME2],
74106c3fb27SDimitry Andric                      SME2p1Unsupported.F);
742e837bb5cSDimitry Andric}
743e837bb5cSDimitry Andric
744fe6060f1SDimitry Andricdef SMEUnsupported : AArch64Unsupported {
74506c3fb27SDimitry Andric  let F = !listconcat([HasSME, HasSMEI16I64, HasSMEF16F16, HasSMEF64F64],
74606c3fb27SDimitry Andric                      SME2Unsupported.F);
747fe6060f1SDimitry Andric}
748fe6060f1SDimitry Andric
74906c3fb27SDimitry Andriclet F = [HasPAuth] in
75006c3fb27SDimitry Andricdef PAUnsupported : AArch64Unsupported;
75106c3fb27SDimitry Andric
7520b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
753e8d8bef9SDimitry Andricinclude "AArch64SchedA55.td"
75406c3fb27SDimitry Andricinclude "AArch64SchedA510.td"
7550b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
7560b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
7570b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
7580b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
7590b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
7600b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
761480093f4SDimitry Andricinclude "AArch64SchedExynosM5.td"
7620b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
7630b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
764e8d8bef9SDimitry Andricinclude "AArch64SchedA64FX.td"
765e837bb5cSDimitry Andricinclude "AArch64SchedThunderX3T110.td"
766e8d8bef9SDimitry Andricinclude "AArch64SchedTSV110.td"
7672a66634dSDimitry Andricinclude "AArch64SchedAmpere1.td"
76806c3fb27SDimitry Andricinclude "AArch64SchedNeoverseN1.td"
769753f127fSDimitry Andricinclude "AArch64SchedNeoverseN2.td"
77006c3fb27SDimitry Andricinclude "AArch64SchedNeoverseV1.td"
77106c3fb27SDimitry Andricinclude "AArch64SchedNeoverseV2.td"
7720b57cec5SDimitry Andric
773349cc55cSDimitry Andricdef TuneA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
774349cc55cSDimitry Andric                                "Cortex-A35 ARM processors">;
7750b57cec5SDimitry Andric
776349cc55cSDimitry Andricdef TuneA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
7770b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
7780b57cec5SDimitry Andric                                   FeatureFuseAES,
779bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
780349cc55cSDimitry Andric                                   FeatureBalanceFPOps,
781349cc55cSDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
782349cc55cSDimitry Andric                                   FeaturePostRAScheduler]>;
7830b57cec5SDimitry Andric
784349cc55cSDimitry Andricdef TuneA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
7850b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
7860b57cec5SDimitry Andric                                   FeatureFuseAES,
787bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
788fe6060f1SDimitry Andric                                   FeaturePostRAScheduler,
789349cc55cSDimitry Andric                                   FeatureFuseAddress]>;
790349cc55cSDimitry Andric
791349cc55cSDimitry Andricdef TuneA510    : SubtargetFeature<"a510", "ARMProcFamily", "CortexA510",
792349cc55cSDimitry Andric                                   "Cortex-A510 ARM processors", [
793349cc55cSDimitry Andric                                   FeatureFuseAES,
794bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
795349cc55cSDimitry Andric                                   FeaturePostRAScheduler
7960b57cec5SDimitry Andric                                   ]>;
7970b57cec5SDimitry Andric
798349cc55cSDimitry Andricdef TuneA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
7990b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
800349cc55cSDimitry Andric                                   FeatureFuseAES,
8010b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
8020b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
80381ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
8040b57cec5SDimitry Andric                                   FeatureFuseLiterals,
8050b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
806bdd1243dSDimitry Andric                                   FeatureEnableSelectOptimize,
807349cc55cSDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8080b57cec5SDimitry Andric
809349cc55cSDimitry Andricdef TuneA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
8108bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
811349cc55cSDimitry Andric                                   FeatureFuseAES,
812e8d8bef9SDimitry Andric                                   FeatureFuseAddress,
81381ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
814bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
81506c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
81606c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8178bcb0991SDimitry Andric
818349cc55cSDimitry Andricdef TuneA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
8190b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
8200b57cec5SDimitry Andric                                   FeatureFuseAES,
82181ad6265SDimitry Andric                                   FeatureFuseAdrpAdd,
822bdd1243dSDimitry Andric                                   FeatureFuseLiterals,
82306c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
82406c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8250b57cec5SDimitry Andric
826349cc55cSDimitry Andricdef TuneA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
8270b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
828bdd1243dSDimitry Andric                                   FeatureFuseAES,
829bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
83006c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
83106c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8320b57cec5SDimitry Andric
833349cc55cSDimitry Andricdef TuneA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
8340b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
835bdd1243dSDimitry Andric                                   FeatureFuseAES,
836bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
83706c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
83806c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8390b57cec5SDimitry Andric
840349cc55cSDimitry Andricdef TuneA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
8410b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
842bdd1243dSDimitry Andric                                   FeatureFuseAES,
843bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
844bdd1243dSDimitry Andric                                   FeatureLSLFast,
84506c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
84606c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8470b57cec5SDimitry Andric
848349cc55cSDimitry Andricdef TuneA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
8495ffd83dbSDimitry Andric                                   "Cortex-A77 ARM processors", [
850e8d8bef9SDimitry Andric                                   FeatureCmpBccFusion,
851bdd1243dSDimitry Andric                                   FeatureFuseAES,
852bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
853bdd1243dSDimitry Andric                                   FeatureLSLFast,
85406c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
85506c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
8565ffd83dbSDimitry Andric
857349cc55cSDimitry Andricdef TuneA78 : SubtargetFeature<"a78", "ARMProcFamily", "CortexA78",
8585ffd83dbSDimitry Andric                               "Cortex-A78 ARM processors", [
859e8d8bef9SDimitry Andric                               FeatureCmpBccFusion,
8605ffd83dbSDimitry Andric                               FeatureFuseAES,
861bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
862bdd1243dSDimitry Andric                               FeatureLSLFast,
863bdd1243dSDimitry Andric                               FeaturePostRAScheduler,
86406c3fb27SDimitry Andric                               FeatureEnableSelectOptimize,
86506c3fb27SDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
8665ffd83dbSDimitry Andric
867349cc55cSDimitry Andricdef TuneA78C : SubtargetFeature<"a78c", "ARMProcFamily",
868e8d8bef9SDimitry Andric                                "CortexA78C",
869e8d8bef9SDimitry Andric                                "Cortex-A78C ARM processors", [
870e8d8bef9SDimitry Andric                                FeatureCmpBccFusion,
871e8d8bef9SDimitry Andric                                FeatureFuseAES,
872bdd1243dSDimitry Andric                                FeatureFuseAdrpAdd,
873bdd1243dSDimitry Andric                                FeatureLSLFast,
874bdd1243dSDimitry Andric                                FeaturePostRAScheduler,
87506c3fb27SDimitry Andric                                FeatureEnableSelectOptimize,
87606c3fb27SDimitry Andric                                FeaturePredictableSelectIsExpensive]>;
877e8d8bef9SDimitry Andric
878349cc55cSDimitry Andricdef TuneA710    : SubtargetFeature<"a710", "ARMProcFamily", "CortexA710",
879349cc55cSDimitry Andric                                   "Cortex-A710 ARM processors", [
880bdd1243dSDimitry Andric                                   FeatureCmpBccFusion,
881bdd1243dSDimitry Andric                                   FeatureFuseAES,
882bdd1243dSDimitry Andric                                   FeatureFuseAdrpAdd,
883bdd1243dSDimitry Andric                                   FeatureLSLFast,
884bdd1243dSDimitry Andric                                   FeaturePostRAScheduler,
88506c3fb27SDimitry Andric                                   FeatureEnableSelectOptimize,
88606c3fb27SDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
887bdd1243dSDimitry Andric
888bdd1243dSDimitry Andricdef TuneA715 : SubtargetFeature<"a715", "ARMProcFamily", "CortexA715",
889bdd1243dSDimitry Andric                                 "Cortex-A715 ARM processors", [
890349cc55cSDimitry Andric                                 FeatureFuseAES,
891349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
892bdd1243dSDimitry Andric                                 FeatureCmpBccFusion,
893bdd1243dSDimitry Andric                                 FeatureLSLFast,
894bdd1243dSDimitry Andric                                 FeatureFuseAdrpAdd,
89506c3fb27SDimitry Andric                                 FeatureEnableSelectOptimize,
89606c3fb27SDimitry Andric                                 FeaturePredictableSelectIsExpensive]>;
897349cc55cSDimitry Andric
898349cc55cSDimitry Andricdef TuneR82 : SubtargetFeature<"cortex-r82", "ARMProcFamily",
899e8d8bef9SDimitry Andric                               "CortexR82",
900349cc55cSDimitry Andric                               "Cortex-R82 ARM processors", [
901349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
902e8d8bef9SDimitry Andric
903349cc55cSDimitry Andricdef TuneX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
9045ffd83dbSDimitry Andric                                  "Cortex-X1 ARM processors", [
905e8d8bef9SDimitry Andric                                  FeatureCmpBccFusion,
9065ffd83dbSDimitry Andric                                  FeatureFuseAES,
907bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
908bdd1243dSDimitry Andric                                  FeatureLSLFast,
909bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
91006c3fb27SDimitry Andric                                  FeatureEnableSelectOptimize,
91106c3fb27SDimitry Andric                                  FeaturePredictableSelectIsExpensive]>;
9125ffd83dbSDimitry Andric
913349cc55cSDimitry Andricdef TuneX2 : SubtargetFeature<"cortex-x2", "ARMProcFamily", "CortexX2",
914349cc55cSDimitry Andric                                  "Cortex-X2 ARM processors", [
915bdd1243dSDimitry Andric                                  FeatureCmpBccFusion,
916bdd1243dSDimitry Andric                                  FeatureFuseAES,
917bdd1243dSDimitry Andric                                  FeatureFuseAdrpAdd,
918bdd1243dSDimitry Andric                                  FeatureLSLFast,
919bdd1243dSDimitry Andric                                  FeaturePostRAScheduler,
92006c3fb27SDimitry Andric                                  FeatureEnableSelectOptimize,
92106c3fb27SDimitry Andric                                  FeaturePredictableSelectIsExpensive]>;
922bdd1243dSDimitry Andric
923bdd1243dSDimitry Andricdef TuneX3 : SubtargetFeature<"cortex-x3", "ARMProcFamily", "CortexX3",
924bdd1243dSDimitry Andric                              "Cortex-X3 ARM processors", [
925bdd1243dSDimitry Andric                               FeatureLSLFast,
926bdd1243dSDimitry Andric                               FeatureFuseAdrpAdd,
927349cc55cSDimitry Andric                               FeatureFuseAES,
9285ffd83dbSDimitry Andric                               FeaturePostRAScheduler,
92906c3fb27SDimitry Andric                               FeatureEnableSelectOptimize,
93006c3fb27SDimitry Andric                               FeaturePredictableSelectIsExpensive]>;
931349cc55cSDimitry Andric
932349cc55cSDimitry Andricdef TuneA64FX : SubtargetFeature<"a64fx", "ARMProcFamily", "A64FX",
933349cc55cSDimitry Andric                                 "Fujitsu A64FX processors", [
934349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
935e8d8bef9SDimitry Andric                                 FeatureAggressiveFMA,
936e8d8bef9SDimitry Andric                                 FeatureArithmeticBccFusion,
937e8d8bef9SDimitry Andric                                 FeaturePredictableSelectIsExpensive
9385ffd83dbSDimitry Andric                                 ]>;
9395ffd83dbSDimitry Andric
940349cc55cSDimitry Andricdef TuneCarmel : SubtargetFeature<"carmel", "ARMProcFamily", "Carmel",
941349cc55cSDimitry Andric                                  "Nvidia Carmel processors">;
9425ffd83dbSDimitry Andric
9430b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
9440b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
945349cc55cSDimitry Andricdef TuneAppleA7  : SubtargetFeature<"apple-a7", "ARMProcFamily", "AppleA7",
946480093f4SDimitry Andric                                    "Apple A7 (the CPU formerly known as Cyclone)", [
9470b57cec5SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
9480b57cec5SDimitry Andric                                    FeatureArithmeticBccFusion,
9490b57cec5SDimitry Andric                                    FeatureArithmeticCbzFusion,
9500b57cec5SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
951349cc55cSDimitry Andric                                    FeatureFuseAES, FeatureFuseCryptoEOR,
9520b57cec5SDimitry Andric                                    FeatureZCRegMove,
9530b57cec5SDimitry Andric                                    FeatureZCZeroing,
954349cc55cSDimitry Andric                                    FeatureZCZeroingFPWorkaround]
955349cc55cSDimitry Andric                                    >;
9560b57cec5SDimitry Andric
957349cc55cSDimitry Andricdef TuneAppleA10 : SubtargetFeature<"apple-a10", "ARMProcFamily", "AppleA10",
958480093f4SDimitry Andric                                    "Apple A10", [
959480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
960480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
961480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
962480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
9630b57cec5SDimitry Andric                                    FeatureFuseAES,
964480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
965480093f4SDimitry Andric                                    FeatureZCRegMove,
966349cc55cSDimitry Andric                                    FeatureZCZeroing]
967349cc55cSDimitry Andric                                    >;
9680b57cec5SDimitry Andric
969349cc55cSDimitry Andricdef TuneAppleA11 : SubtargetFeature<"apple-a11", "ARMProcFamily", "AppleA11",
970480093f4SDimitry Andric                                    "Apple A11", [
971480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
972480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
973480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
974480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
9750b57cec5SDimitry Andric                                    FeatureFuseAES,
976480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
977480093f4SDimitry Andric                                    FeatureZCRegMove,
978349cc55cSDimitry Andric                                    FeatureZCZeroing]
979349cc55cSDimitry Andric                                    >;
980480093f4SDimitry Andric
981349cc55cSDimitry Andricdef TuneAppleA12 : SubtargetFeature<"apple-a12", "ARMProcFamily", "AppleA12",
982480093f4SDimitry Andric                                    "Apple A12", [
983480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
984480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
985480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
986480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
987480093f4SDimitry Andric                                    FeatureFuseAES,
988480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
989480093f4SDimitry Andric                                    FeatureZCRegMove,
990349cc55cSDimitry Andric                                    FeatureZCZeroing]
991349cc55cSDimitry Andric                                    >;
992480093f4SDimitry Andric
993349cc55cSDimitry Andricdef TuneAppleA13 : SubtargetFeature<"apple-a13", "ARMProcFamily", "AppleA13",
994480093f4SDimitry Andric                                    "Apple A13", [
995480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
996480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
997480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
998480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
999480093f4SDimitry Andric                                    FeatureFuseAES,
1000480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
1001480093f4SDimitry Andric                                    FeatureZCRegMove,
1002349cc55cSDimitry Andric                                    FeatureZCZeroing]
1003349cc55cSDimitry Andric                                    >;
10040b57cec5SDimitry Andric
1005349cc55cSDimitry Andricdef TuneAppleA14 : SubtargetFeature<"apple-a14", "ARMProcFamily", "AppleA14",
1006e8d8bef9SDimitry Andric                                    "Apple A14", [
1007e8d8bef9SDimitry Andric                                    FeatureAggressiveFMA,
1008e8d8bef9SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1009e8d8bef9SDimitry Andric                                    FeatureArithmeticBccFusion,
1010e8d8bef9SDimitry Andric                                    FeatureArithmeticCbzFusion,
1011e8d8bef9SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1012e8d8bef9SDimitry Andric                                    FeatureFuseAddress,
1013e8d8bef9SDimitry Andric                                    FeatureFuseAES,
1014e8d8bef9SDimitry Andric                                    FeatureFuseArithmeticLogic,
1015e8d8bef9SDimitry Andric                                    FeatureFuseCCSelect,
1016e8d8bef9SDimitry Andric                                    FeatureFuseCryptoEOR,
101781ad6265SDimitry Andric                                    FeatureFuseAdrpAdd,
1018e8d8bef9SDimitry Andric                                    FeatureFuseLiterals,
1019e8d8bef9SDimitry Andric                                    FeatureZCRegMove,
1020349cc55cSDimitry Andric                                    FeatureZCZeroing]>;
1021e8d8bef9SDimitry Andric
1022bdd1243dSDimitry Andricdef TuneAppleA15 : SubtargetFeature<"apple-a15", "ARMProcFamily", "AppleA15",
1023bdd1243dSDimitry Andric                                    "Apple A15", [
1024bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1025bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1026bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
1027bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1028bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1029bdd1243dSDimitry Andric                                    FeatureFuseAES,
1030bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
1031bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1032bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1033bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1034bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1035bdd1243dSDimitry Andric                                    FeatureZCZeroing
1036bdd1243dSDimitry Andric                                    ]>;
1037bdd1243dSDimitry Andric
1038bdd1243dSDimitry Andricdef TuneAppleA16 : SubtargetFeature<"apple-a16", "ARMProcFamily", "AppleA16",
1039bdd1243dSDimitry Andric                                    "Apple A16", [
1040bdd1243dSDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
1041bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1042bdd1243dSDimitry Andric                                    FeatureArithmeticCbzFusion,
1043bdd1243dSDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
1044bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1045bdd1243dSDimitry Andric                                    FeatureFuseAES,
1046bdd1243dSDimitry Andric                                    FeatureFuseArithmeticLogic,
1047bdd1243dSDimitry Andric                                    FeatureFuseCCSelect,
1048bdd1243dSDimitry Andric                                    FeatureFuseCryptoEOR,
1049bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1050bdd1243dSDimitry Andric                                    FeatureZCRegMove,
1051bdd1243dSDimitry Andric                                    FeatureZCZeroing
1052bdd1243dSDimitry Andric                                    ]>;
1053bdd1243dSDimitry Andric
1054349cc55cSDimitry Andricdef TuneExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
10550b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
1056349cc55cSDimitry Andric                                    [FeatureExynosCheapAsMoveHandling,
10570b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
10580b57cec5SDimitry Andric                                     FeatureFuseAddress,
10590b57cec5SDimitry Andric                                     FeatureFuseAES,
10600b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
106181ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
10620b57cec5SDimitry Andric                                     FeatureFuseLiterals,
10630b57cec5SDimitry Andric                                     FeatureLSLFast,
10640b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
1065fe6060f1SDimitry Andric                                     FeaturePredictableSelectIsExpensive]>;
10660b57cec5SDimitry Andric
106781ad6265SDimitry Andric// Re-uses some scheduling and tunings from the ExynosM3 proc family.
106881ad6265SDimitry Andricdef TuneExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3",
106981ad6265SDimitry Andric                                    "Samsung Exynos-M4 processors",
1070349cc55cSDimitry Andric                                    [FeatureArithmeticBccFusion,
10710b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
10720b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
10730b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
10740b57cec5SDimitry Andric                                     FeatureFuseAddress,
10750b57cec5SDimitry Andric                                     FeatureFuseAES,
10760b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
10770b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
107881ad6265SDimitry Andric                                     FeatureFuseAdrpAdd,
10790b57cec5SDimitry Andric                                     FeatureFuseLiterals,
10800b57cec5SDimitry Andric                                     FeatureLSLFast,
10810b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
10820b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
10830b57cec5SDimitry Andric
1084349cc55cSDimitry Andricdef TuneKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
10850b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
10860b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
10870b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
10880b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
10890b57cec5SDimitry Andric                                   FeatureZCZeroing,
1090349cc55cSDimitry Andric                                   FeatureLSLFast]
1091349cc55cSDimitry Andric                                   >;
10920b57cec5SDimitry Andric
1093349cc55cSDimitry Andricdef TuneFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
10940b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
10950b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
10960b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
10970b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
10980b57cec5SDimitry Andric                                   FeatureZCZeroing,
10990b57cec5SDimitry Andric                                   FeatureLSLFast,
11000b57cec5SDimitry Andric                                   FeatureSlowSTRQro
11010b57cec5SDimitry Andric                                   ]>;
11020b57cec5SDimitry Andric
1103349cc55cSDimitry Andricdef TuneNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily", "NeoverseE1",
11048bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
1105bdd1243dSDimitry Andric                                      FeatureFuseAES,
1106bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1107bdd1243dSDimitry Andric                                      FeaturePostRAScheduler]>;
11088bcb0991SDimitry Andric
1109349cc55cSDimitry Andricdef TuneNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily", "NeoverseN1",
11108bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
1111bdd1243dSDimitry Andric                                      FeatureFuseAES,
1112bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1113bdd1243dSDimitry Andric                                      FeatureLSLFast,
1114fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
111506c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
111606c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
11178bcb0991SDimitry Andric
1118349cc55cSDimitry Andricdef TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2",
1119e8d8bef9SDimitry Andric                                      "Neoverse N2 ARM processors", [
1120bdd1243dSDimitry Andric                                      FeatureFuseAES,
1121bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1122bdd1243dSDimitry Andric                                      FeatureLSLFast,
1123fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
112406c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
112506c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1126bdd1243dSDimitry Andric
1127349cc55cSDimitry Andricdef TuneNeoverse512TVB : SubtargetFeature<"neoverse512tvb", "ARMProcFamily", "Neoverse512TVB",
1128349cc55cSDimitry Andric                                      "Neoverse 512-TVB ARM processors", [
1129bdd1243dSDimitry Andric                                      FeatureFuseAES,
1130bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1131bdd1243dSDimitry Andric                                      FeatureLSLFast,
1132349cc55cSDimitry Andric                                      FeaturePostRAScheduler,
113306c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
113406c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1135e8d8bef9SDimitry Andric
1136349cc55cSDimitry Andricdef TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1",
1137e8d8bef9SDimitry Andric                                      "Neoverse V1 ARM processors", [
1138e8d8bef9SDimitry Andric                                      FeatureFuseAES,
1139bdd1243dSDimitry Andric                                      FeatureFuseAdrpAdd,
1140bdd1243dSDimitry Andric                                      FeatureLSLFast,
1141bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
114206c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
1143*8a4dda33SDimitry Andric                                      FeaturePredictableSelectIsExpensive,
1144*8a4dda33SDimitry Andric                                      FeatureNoSVEFPLD1R]>;
1145bdd1243dSDimitry Andric
1146bdd1243dSDimitry Andricdef TuneNeoverseV2 : SubtargetFeature<"neoversev2", "ARMProcFamily", "NeoverseV2",
1147bdd1243dSDimitry Andric                                      "Neoverse V2 ARM processors", [
1148bdd1243dSDimitry Andric                                      FeatureFuseAES,
1149bdd1243dSDimitry Andric                                      FeatureLSLFast,
1150bdd1243dSDimitry Andric                                      FeaturePostRAScheduler,
115106c3fb27SDimitry Andric                                      FeatureEnableSelectOptimize,
115206c3fb27SDimitry Andric                                      FeaturePredictableSelectIsExpensive]>;
1153e8d8bef9SDimitry Andric
1154349cc55cSDimitry Andricdef TuneSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
11550b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
11560b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
11570b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
11580b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
11590b57cec5SDimitry Andric                                   FeatureZCZeroing,
1160349cc55cSDimitry Andric                                   FeatureLSLFast]>;
11610b57cec5SDimitry Andric
1162349cc55cSDimitry Andricdef TuneThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily", "ThunderX2T99",
11630b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
11640b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
11650b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
11660b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
1167349cc55cSDimitry Andric                                          FeaturePredictableSelectIsExpensive]>;
11680b57cec5SDimitry Andric
1169349cc55cSDimitry Andricdef TuneThunderX3T110  : SubtargetFeature<"thunderx3t110", "ARMProcFamily",
1170e837bb5cSDimitry Andric                                          "ThunderX3T110",
1171e837bb5cSDimitry Andric                                          "Marvell ThunderX3 processors", [
1172e837bb5cSDimitry Andric                                           FeatureAggressiveFMA,
1173e837bb5cSDimitry Andric                                           FeatureArithmeticBccFusion,
1174e837bb5cSDimitry Andric                                           FeaturePostRAScheduler,
1175e837bb5cSDimitry Andric                                           FeaturePredictableSelectIsExpensive,
1176e837bb5cSDimitry Andric                                           FeatureBalanceFPOps,
1177349cc55cSDimitry Andric                                           FeatureStrictAlign]>;
1178e837bb5cSDimitry Andric
1179349cc55cSDimitry Andricdef TuneThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
11800b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
11810b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
1182349cc55cSDimitry Andric                                    FeaturePredictableSelectIsExpensive]>;
11830b57cec5SDimitry Andric
1184349cc55cSDimitry Andricdef TuneThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
11850b57cec5SDimitry Andric                                       "ThunderXT88",
11860b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11870b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1188349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11890b57cec5SDimitry Andric
1190349cc55cSDimitry Andricdef TuneThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
11910b57cec5SDimitry Andric                                       "ThunderXT81",
11920b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11930b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1194349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
11950b57cec5SDimitry Andric
1196349cc55cSDimitry Andricdef TuneThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
11970b57cec5SDimitry Andric                                       "ThunderXT83",
11980b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
11990b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
1200349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
12010b57cec5SDimitry Andric
1202349cc55cSDimitry Andricdef TuneTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
12030b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
12040b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
12050b57cec5SDimitry Andric                                  FeatureFuseAES,
1206349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
12070b57cec5SDimitry Andric
12082a66634dSDimitry Andricdef TuneAmpere1 : SubtargetFeature<"ampere1", "ARMProcFamily", "Ampere1",
12092a66634dSDimitry Andric                                   "Ampere Computing Ampere-1 processors", [
12102a66634dSDimitry Andric                                   FeaturePostRAScheduler,
12112a66634dSDimitry Andric                                   FeatureFuseAES,
12122a66634dSDimitry Andric                                   FeatureLSLFast,
12132a66634dSDimitry Andric                                   FeatureAggressiveFMA,
12142a66634dSDimitry Andric                                   FeatureArithmeticBccFusion,
12152a66634dSDimitry Andric                                   FeatureCmpBccFusion,
12162a66634dSDimitry Andric                                   FeatureFuseAddress,
12172a66634dSDimitry Andric                                   FeatureFuseLiterals]>;
1218349cc55cSDimitry Andric
1219bdd1243dSDimitry Andricdef TuneAmpere1A : SubtargetFeature<"ampere1a", "ARMProcFamily", "Ampere1A",
1220bdd1243dSDimitry Andric                                    "Ampere Computing Ampere-1A processors", [
1221bdd1243dSDimitry Andric                                    FeaturePostRAScheduler,
1222bdd1243dSDimitry Andric                                    FeatureFuseAES,
1223bdd1243dSDimitry Andric                                    FeatureLSLFast,
1224bdd1243dSDimitry Andric                                    FeatureAggressiveFMA,
1225bdd1243dSDimitry Andric                                    FeatureArithmeticBccFusion,
1226bdd1243dSDimitry Andric                                    FeatureCmpBccFusion,
1227bdd1243dSDimitry Andric                                    FeatureFuseAddress,
1228bdd1243dSDimitry Andric                                    FeatureFuseLiterals,
1229bdd1243dSDimitry Andric                                    FeatureFuseLiterals]>;
1230bdd1243dSDimitry Andric
1231349cc55cSDimitry Andricdef ProcessorFeatures {
1232349cc55cSDimitry Andric  list<SubtargetFeature> A53  = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1233349cc55cSDimitry Andric                                 FeatureFPARMv8, FeatureNEON, FeaturePerfMon];
1234349cc55cSDimitry Andric  list<SubtargetFeature> A55  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1235349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1236349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon];
1237349cc55cSDimitry Andric  list<SubtargetFeature> A510 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1238349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1239349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1240349cc55cSDimitry Andric                                 FeatureFP16FML];
1241349cc55cSDimitry Andric  list<SubtargetFeature> A65  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1242349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
124381ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeatureRAS,
124481ad6265SDimitry Andric                                 FeaturePerfMon];
1245349cc55cSDimitry Andric  list<SubtargetFeature> A76  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1246349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
124781ad6265SDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1248349cc55cSDimitry Andric  list<SubtargetFeature> A77  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1249349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
125081ad6265SDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSSBS];
1251349cc55cSDimitry Andric  list<SubtargetFeature> A78  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1252349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1253349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSPE,
1254349cc55cSDimitry Andric                                 FeatureSSBS];
1255349cc55cSDimitry Andric  list<SubtargetFeature> A78C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1256349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
1257349cc55cSDimitry Andric                                 FeatureFlagM, FeatureFP16FML, FeaturePAuth,
1258349cc55cSDimitry Andric                                 FeaturePerfMon, FeatureRCPC, FeatureSPE,
1259349cc55cSDimitry Andric                                 FeatureSSBS];
1260349cc55cSDimitry Andric  list<SubtargetFeature> A710 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1261349cc55cSDimitry Andric                                 FeatureETE, FeatureMTE, FeatureFP16FML,
1262349cc55cSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureMatMulInt8];
1263bdd1243dSDimitry Andric  list<SubtargetFeature> A715 = [HasV9_0aOps, FeatureNEON, FeatureMTE,
1264bdd1243dSDimitry Andric                                 FeatureFP16FML, FeatureSVE, FeatureTRBE,
1265bdd1243dSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureETE,
1266bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureMatMulInt8, FeatureSPE];
126704eeddc0SDimitry Andric  list<SubtargetFeature> R82  = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
126804eeddc0SDimitry Andric                                 FeatureFP16FML, FeatureSSBS, FeaturePredRes,
126981ad6265SDimitry Andric                                 FeatureSB];
1270349cc55cSDimitry Andric  list<SubtargetFeature> X1   = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1271349cc55cSDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
12723a9a9c0cSDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
12733a9a9c0cSDimitry Andric                                 FeatureSSBS];
12741fd87a68SDimitry Andric  list<SubtargetFeature> X1C  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1275bdd1243dSDimitry Andric                                 FeatureNEON, FeatureRCPC_IMMO, FeaturePerfMon,
12761fd87a68SDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
1277bdd1243dSDimitry Andric                                 FeaturePAuth, FeatureSSBS, FeatureFlagM,
1278bdd1243dSDimitry Andric                                 FeatureLSE2];
1279349cc55cSDimitry Andric  list<SubtargetFeature> X2   = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
1280349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
1281349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
1282349cc55cSDimitry Andric                                 FeatureFP16FML];
1283bdd1243dSDimitry Andric  list<SubtargetFeature> X3 =   [HasV9_0aOps, FeatureSVE, FeatureNEON,
1284bdd1243dSDimitry Andric                                 FeaturePerfMon, FeatureETE, FeatureTRBE,
1285bdd1243dSDimitry Andric                                 FeatureSPE, FeatureBF16, FeatureMatMulInt8,
1286bdd1243dSDimitry Andric                                 FeatureMTE, FeatureSVE2BitPerm, FeatureFullFP16,
1287bdd1243dSDimitry Andric                                 FeatureFP16FML];
1288349cc55cSDimitry Andric  list<SubtargetFeature> A64FX    = [HasV8_2aOps, FeatureFPARMv8, FeatureNEON,
1289349cc55cSDimitry Andric                                     FeatureSHA2, FeaturePerfMon, FeatureFullFP16,
1290349cc55cSDimitry Andric                                     FeatureSVE, FeatureComplxNum];
1291349cc55cSDimitry Andric  list<SubtargetFeature> Carmel   = [HasV8_2aOps, FeatureNEON, FeatureCrypto,
1292349cc55cSDimitry Andric                                     FeatureFullFP16];
1293349cc55cSDimitry Andric  list<SubtargetFeature> AppleA7  = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1294349cc55cSDimitry Andric                                     FeatureNEON,FeaturePerfMon, FeatureAppleA7SysReg];
1295349cc55cSDimitry Andric  list<SubtargetFeature> AppleA10 = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
1296349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureCRC,
1297349cc55cSDimitry Andric                                     FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH];
1298349cc55cSDimitry Andric  list<SubtargetFeature> AppleA11 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1299349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1300349cc55cSDimitry Andric  list<SubtargetFeature> AppleA12 = [HasV8_3aOps, FeatureCrypto, FeatureFPARMv8,
1301349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
1302349cc55cSDimitry Andric  list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1303349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16,
1304349cc55cSDimitry Andric                                     FeatureFP16FML, FeatureSHA3];
1305349cc55cSDimitry Andric  list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1306349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
1307349cc55cSDimitry Andric                                     FeatureSpecRestrict, FeatureSSBS, FeatureSB,
1308349cc55cSDimitry Andric                                     FeaturePredRes, FeatureCacheDeepPersist,
1309349cc55cSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML, FeatureSHA3,
1310349cc55cSDimitry Andric                                     FeatureAltFPCmp];
1311bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA15 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1312bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1313bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML];
1314bdd1243dSDimitry Andric  list<SubtargetFeature> AppleA16 = [HasV8_6aOps, FeatureCrypto, FeatureFPARMv8,
1315bdd1243dSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureSHA3,
1316bdd1243dSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML,
1317bdd1243dSDimitry Andric                                     FeatureHCX];
1318349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM3 = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1319349cc55cSDimitry Andric                                     FeaturePerfMon];
1320349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM4 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1321349cc55cSDimitry Andric                                     FeatureFullFP16, FeaturePerfMon];
1322349cc55cSDimitry Andric  list<SubtargetFeature> Falkor   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1323349cc55cSDimitry Andric                                     FeatureFPARMv8, FeatureNEON, FeaturePerfMon,
1324349cc55cSDimitry Andric                                     FeatureRDM];
1325349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseE1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1326349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
132781ad6265SDimitry Andric                                       FeatureRCPC, FeatureSSBS, FeaturePerfMon];
1328349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1329349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
133081ad6265SDimitry Andric                                       FeatureRCPC, FeatureSPE, FeatureSSBS,
133181ad6265SDimitry Andric                                       FeaturePerfMon];
1332349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN2 = [HasV8_5aOps, FeatureBF16, FeatureETE,
1333349cc55cSDimitry Andric                                       FeatureMatMulInt8, FeatureMTE, FeatureSVE2,
133481ad6265SDimitry Andric                                       FeatureSVE2BitPerm, FeatureTRBE, FeatureCrypto,
133581ad6265SDimitry Andric                                       FeaturePerfMon];
1336349cc55cSDimitry Andric  list<SubtargetFeature> Neoverse512TVB = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1337349cc55cSDimitry Andric                                           FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1338349cc55cSDimitry Andric                                           FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1339349cc55cSDimitry Andric                                           FeaturePerfMon, FeatureRandGen, FeatureSPE,
1340349cc55cSDimitry Andric                                           FeatureSSBS, FeatureSVE];
1341349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseV1 = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1342349cc55cSDimitry Andric                                       FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1343349cc55cSDimitry Andric                                       FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1344349cc55cSDimitry Andric                                       FeaturePerfMon, FeatureRandGen, FeatureSPE,
1345349cc55cSDimitry Andric                                       FeatureSSBS, FeatureSVE];
1346bdd1243dSDimitry Andric  list<SubtargetFeature> NeoverseV2 = [HasV9_0aOps, FeatureBF16, FeatureSPE,
1347bdd1243dSDimitry Andric                                       FeaturePerfMon, FeatureETE, FeatureMatMulInt8,
1348bdd1243dSDimitry Andric                                       FeatureNEON, FeatureSVE2BitPerm, FeatureFP16FML,
1349bdd1243dSDimitry Andric                                       FeatureMTE, FeatureRandGen];
1350349cc55cSDimitry Andric  list<SubtargetFeature> Saphira    = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1351349cc55cSDimitry Andric                                       FeatureNEON, FeatureSPE, FeaturePerfMon];
1352349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1353349cc55cSDimitry Andric                                       FeatureFPARMv8, FeaturePerfMon, FeatureNEON];
1354349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX2T99  = [HasV8_1aOps, FeatureCRC, FeatureCrypto,
1355349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE];
1356349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX3T110 = [HasV8_3aOps, FeatureCRC, FeatureCrypto,
1357349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE,
1358349cc55cSDimitry Andric                                          FeaturePAuth, FeaturePerfMon];
1359349cc55cSDimitry Andric  list<SubtargetFeature> TSV110 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1360349cc55cSDimitry Andric                                   FeatureNEON, FeaturePerfMon, FeatureSPE,
1361349cc55cSDimitry Andric                                   FeatureFullFP16, FeatureFP16FML, FeatureDotProd];
13622a66634dSDimitry Andric  list<SubtargetFeature> Ampere1 = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1363bdd1243dSDimitry Andric                                    FeatureSSBS, FeatureRandGen, FeatureSB,
1364bdd1243dSDimitry Andric                                    FeatureSHA2, FeatureSHA3, FeatureAES];
1365bdd1243dSDimitry Andric  list<SubtargetFeature> Ampere1A = [HasV8_6aOps, FeatureNEON, FeaturePerfMon,
1366bdd1243dSDimitry Andric                                     FeatureMTE, FeatureSSBS, FeatureRandGen,
1367bdd1243dSDimitry Andric                                     FeatureSB, FeatureSM4, FeatureSHA2,
1368bdd1243dSDimitry Andric                                     FeatureSHA3, FeatureAES];
1369349cc55cSDimitry Andric
13705ffd83dbSDimitry Andric  // ETE and TRBE are future architecture extensions. We temporarily enable them
1371349cc55cSDimitry Andric  // by default for users targeting generic AArch64. The extensions do not
13728bcb0991SDimitry Andric  // affect code generated by the compiler and can be used only by explicitly
13738bcb0991SDimitry Andric  // mentioning the new system register names in assembly.
137481ad6265SDimitry Andric  list<SubtargetFeature> Generic = [FeatureFPARMv8, FeatureNEON, FeatureETE];
1375349cc55cSDimitry Andric}
13760b57cec5SDimitry Andric
137781ad6265SDimitry Andric// FeatureFuseAdrpAdd is enabled under Generic to allow linker merging
137881ad6265SDimitry Andric// optimizations.
1379349cc55cSDimitry Andricdef : ProcessorModel<"generic", CortexA55Model, ProcessorFeatures.Generic,
1380bdd1243dSDimitry Andric                     [FeatureFuseAES, FeatureFuseAdrpAdd, FeaturePostRAScheduler,
1381bdd1243dSDimitry Andric                      FeatureEnableSelectOptimize]>;
1382349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, ProcessorFeatures.A53,
1383349cc55cSDimitry Andric                     [TuneA35]>;
1384349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a34", CortexA53Model, ProcessorFeatures.A53,
1385349cc55cSDimitry Andric                     [TuneA35]>;
1386349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, ProcessorFeatures.A53,
1387349cc55cSDimitry Andric                     [TuneA53]>;
1388349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA55Model, ProcessorFeatures.A55,
1389349cc55cSDimitry Andric                     [TuneA55]>;
139006c3fb27SDimitry Andricdef : ProcessorModel<"cortex-a510", CortexA510Model, ProcessorFeatures.A510,
1391349cc55cSDimitry Andric                     [TuneA510]>;
1392349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, ProcessorFeatures.A53,
1393349cc55cSDimitry Andric                     [TuneA57]>;
1394349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, ProcessorFeatures.A65,
1395349cc55cSDimitry Andric                     [TuneA65]>;
1396349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, ProcessorFeatures.A65,
1397349cc55cSDimitry Andric                     [TuneA65]>;
1398349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, ProcessorFeatures.A53,
1399349cc55cSDimitry Andric                     [TuneA72]>;
1400349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, ProcessorFeatures.A53,
1401349cc55cSDimitry Andric                     [TuneA73]>;
1402349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, ProcessorFeatures.A55,
1403349cc55cSDimitry Andric                     [TuneA75]>;
1404349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, ProcessorFeatures.A76,
1405349cc55cSDimitry Andric                     [TuneA76]>;
1406349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, ProcessorFeatures.A76,
1407349cc55cSDimitry Andric                     [TuneA76]>;
1408349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a77", CortexA57Model, ProcessorFeatures.A77,
1409349cc55cSDimitry Andric                     [TuneA77]>;
1410349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78", CortexA57Model, ProcessorFeatures.A78,
1411349cc55cSDimitry Andric                     [TuneA78]>;
1412349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78c", CortexA57Model, ProcessorFeatures.A78C,
1413349cc55cSDimitry Andric                     [TuneA78C]>;
1414753f127fSDimitry Andricdef : ProcessorModel<"cortex-a710", NeoverseN2Model, ProcessorFeatures.A710,
1415349cc55cSDimitry Andric                     [TuneA710]>;
1416bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-a715", NeoverseN2Model, ProcessorFeatures.A715,
1417bdd1243dSDimitry Andric                     [TuneA715]>;
1418349cc55cSDimitry Andricdef : ProcessorModel<"cortex-r82", CortexA55Model, ProcessorFeatures.R82,
1419349cc55cSDimitry Andric                     [TuneR82]>;
1420349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x1", CortexA57Model, ProcessorFeatures.X1,
1421349cc55cSDimitry Andric                     [TuneX1]>;
14221fd87a68SDimitry Andricdef : ProcessorModel<"cortex-x1c", CortexA57Model, ProcessorFeatures.X1C,
14231fd87a68SDimitry Andric                     [TuneX1]>;
1424753f127fSDimitry Andricdef : ProcessorModel<"cortex-x2", NeoverseN2Model, ProcessorFeatures.X2,
1425349cc55cSDimitry Andric                     [TuneX2]>;
1426bdd1243dSDimitry Andricdef : ProcessorModel<"cortex-x3", NeoverseN2Model, ProcessorFeatures.X3,
1427bdd1243dSDimitry Andric                     [TuneX3]>;
1428349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model,
1429349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
143006c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-n1", NeoverseN1Model,
1431349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
1432753f127fSDimitry Andricdef : ProcessorModel<"neoverse-n2", NeoverseN2Model,
1433349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
143406c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-512tvb", NeoverseV1Model,
1435349cc55cSDimitry Andric                     ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
143606c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-v1", NeoverseV1Model,
1437349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseV1, [TuneNeoverseV1]>;
143806c3fb27SDimitry Andricdef : ProcessorModel<"neoverse-v2", NeoverseV2Model,
1439bdd1243dSDimitry Andric                     ProcessorFeatures.NeoverseV2, [TuneNeoverseV2]>;
1440349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, ProcessorFeatures.ExynosM3,
1441349cc55cSDimitry Andric                     [TuneExynosM3]>;
1442349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, ProcessorFeatures.ExynosM4,
1443349cc55cSDimitry Andric                     [TuneExynosM4]>;
1444349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM5Model, ProcessorFeatures.ExynosM4,
1445349cc55cSDimitry Andric                     [TuneExynosM4]>;
1446349cc55cSDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, ProcessorFeatures.Falkor,
1447349cc55cSDimitry Andric                     [TuneFalkor]>;
1448349cc55cSDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, ProcessorFeatures.Saphira,
1449349cc55cSDimitry Andric                     [TuneSaphira]>;
1450349cc55cSDimitry Andricdef : ProcessorModel<"kryo", KryoModel, ProcessorFeatures.A53, [TuneKryo]>;
1451349cc55cSDimitry Andric
14520b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
1453349cc55cSDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  ProcessorFeatures.ThunderX,
1454349cc55cSDimitry Andric                     [TuneThunderX]>;
1455349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,
1456349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT88]>;
1457349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,
1458349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT81]>;
1459349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,
1460349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT83]>;
14610b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
1462349cc55cSDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model,
1463349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX2T99, [TuneThunderX2T99]>;
1464e837bb5cSDimitry Andric// Marvell ThunderX3T110 Processors.
1465349cc55cSDimitry Andricdef : ProcessorModel<"thunderx3t110", ThunderX3T110Model,
1466349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX3T110, [TuneThunderX3T110]>;
1467349cc55cSDimitry Andricdef : ProcessorModel<"tsv110", TSV110Model, ProcessorFeatures.TSV110,
1468349cc55cSDimitry Andric                     [TuneTSV110]>;
14690b57cec5SDimitry Andric
1470480093f4SDimitry Andric// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
1471349cc55cSDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
1472349cc55cSDimitry Andric                     [TuneAppleA7]>;
1473480093f4SDimitry Andric
1474480093f4SDimitry Andric// iPhone and iPad CPUs
1475349cc55cSDimitry Andricdef : ProcessorModel<"apple-a7", CycloneModel, ProcessorFeatures.AppleA7,
1476349cc55cSDimitry Andric                     [TuneAppleA7]>;
1477349cc55cSDimitry Andricdef : ProcessorModel<"apple-a8", CycloneModel, ProcessorFeatures.AppleA7,
1478349cc55cSDimitry Andric                     [TuneAppleA7]>;
1479349cc55cSDimitry Andricdef : ProcessorModel<"apple-a9", CycloneModel, ProcessorFeatures.AppleA7,
1480349cc55cSDimitry Andric                     [TuneAppleA7]>;
1481349cc55cSDimitry Andricdef : ProcessorModel<"apple-a10", CycloneModel, ProcessorFeatures.AppleA10,
1482349cc55cSDimitry Andric                     [TuneAppleA10]>;
1483349cc55cSDimitry Andricdef : ProcessorModel<"apple-a11", CycloneModel, ProcessorFeatures.AppleA11,
1484349cc55cSDimitry Andric                     [TuneAppleA11]>;
1485349cc55cSDimitry Andricdef : ProcessorModel<"apple-a12", CycloneModel, ProcessorFeatures.AppleA12,
1486349cc55cSDimitry Andric                     [TuneAppleA12]>;
1487349cc55cSDimitry Andricdef : ProcessorModel<"apple-a13", CycloneModel, ProcessorFeatures.AppleA13,
1488349cc55cSDimitry Andric                     [TuneAppleA13]>;
1489349cc55cSDimitry Andricdef : ProcessorModel<"apple-a14", CycloneModel, ProcessorFeatures.AppleA14,
1490349cc55cSDimitry Andric                     [TuneAppleA14]>;
1491bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a15", CycloneModel, ProcessorFeatures.AppleA15,
1492bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1493bdd1243dSDimitry Andricdef : ProcessorModel<"apple-a16", CycloneModel, ProcessorFeatures.AppleA16,
1494bdd1243dSDimitry Andric                     [TuneAppleA16]>;
1495480093f4SDimitry Andric
1496fe6060f1SDimitry Andric// Mac CPUs
1497349cc55cSDimitry Andricdef : ProcessorModel<"apple-m1", CycloneModel, ProcessorFeatures.AppleA14,
1498349cc55cSDimitry Andric                     [TuneAppleA14]>;
1499bdd1243dSDimitry Andricdef : ProcessorModel<"apple-m2", CycloneModel, ProcessorFeatures.AppleA15,
1500bdd1243dSDimitry Andric                     [TuneAppleA15]>;
1501fe6060f1SDimitry Andric
1502480093f4SDimitry Andric// watch CPUs.
1503349cc55cSDimitry Andricdef : ProcessorModel<"apple-s4", CycloneModel, ProcessorFeatures.AppleA12,
1504349cc55cSDimitry Andric                     [TuneAppleA12]>;
1505349cc55cSDimitry Andricdef : ProcessorModel<"apple-s5", CycloneModel, ProcessorFeatures.AppleA12,
1506349cc55cSDimitry Andric                     [TuneAppleA12]>;
1507480093f4SDimitry Andric
15080b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
1509bdd1243dSDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, ProcessorFeatures.AppleA16,
1510bdd1243dSDimitry Andric                     [TuneAppleA16]>;
15110b57cec5SDimitry Andric
15125ffd83dbSDimitry Andric// Fujitsu A64FX
1513349cc55cSDimitry Andricdef : ProcessorModel<"a64fx", A64FXModel, ProcessorFeatures.A64FX,
1514349cc55cSDimitry Andric                     [TuneA64FX]>;
15155ffd83dbSDimitry Andric
15165ffd83dbSDimitry Andric// Nvidia Carmel
1517349cc55cSDimitry Andricdef : ProcessorModel<"carmel", NoSchedModel, ProcessorFeatures.Carmel,
1518349cc55cSDimitry Andric                     [TuneCarmel]>;
15195ffd83dbSDimitry Andric
15202a66634dSDimitry Andric// Ampere Computing
15212a66634dSDimitry Andricdef : ProcessorModel<"ampere1", Ampere1Model, ProcessorFeatures.Ampere1,
15222a66634dSDimitry Andric                     [TuneAmpere1]>;
15232a66634dSDimitry Andric
1524bdd1243dSDimitry Andricdef : ProcessorModel<"ampere1a", Ampere1Model, ProcessorFeatures.Ampere1A,
1525bdd1243dSDimitry Andric                     [TuneAmpere1A]>;
1526bdd1243dSDimitry Andric
15270b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15280b57cec5SDimitry Andric// Assembly parser
15290b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15300b57cec5SDimitry Andric
15310b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
15320b57cec5SDimitry Andric  int Variant = 0;
15330b57cec5SDimitry Andric  string Name = "generic";
15340b57cec5SDimitry Andric  string BreakCharacters = ".";
15350b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
15360b57cec5SDimitry Andric}
15370b57cec5SDimitry Andric
15380b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
15390b57cec5SDimitry Andric  int Variant = 1;
15400b57cec5SDimitry Andric  string Name = "apple-neon";
15410b57cec5SDimitry Andric  string BreakCharacters = ".";
15420b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
15430b57cec5SDimitry Andric}
15440b57cec5SDimitry Andric
15450b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15460b57cec5SDimitry Andric// Assembly printer
15470b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15480b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
15490b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
15500b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
15510b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
15520b57cec5SDimitry Andric  int PassSubtarget = 1;
15530b57cec5SDimitry Andric  int Variant = 0;
15540b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
15550b57cec5SDimitry Andric}
15560b57cec5SDimitry Andric
15570b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
15580b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
15590b57cec5SDimitry Andric  int PassSubtarget = 1;
15600b57cec5SDimitry Andric  int Variant = 1;
15610b57cec5SDimitry Andric  int isMCAsmWriter = 1;
15620b57cec5SDimitry Andric}
15630b57cec5SDimitry Andric
15640b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15650b57cec5SDimitry Andric// Target Declaration
15660b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15670b57cec5SDimitry Andric
15680b57cec5SDimitry Andricdef AArch64 : Target {
15690b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
15700b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
15710b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
15720b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
15730b57cec5SDimitry Andric}
15740b57cec5SDimitry Andric
15750b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15760b57cec5SDimitry Andric// Pfm Counters
15770b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15780b57cec5SDimitry Andric
15790b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
1580