xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 1fd87a682ad7442327078e1eeb63edc4258f9815)
10b57cec5SDimitry Andric//=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric//
90b57cec5SDimitry Andric//
100b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
110b57cec5SDimitry Andric
120b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
130b57cec5SDimitry Andric// Target-independent interfaces which we are implementing.
140b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
150b57cec5SDimitry Andric
160b57cec5SDimitry Andricinclude "llvm/Target/Target.td"
170b57cec5SDimitry Andric
180b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
190b57cec5SDimitry Andric// AArch64 Subtarget features.
200b57cec5SDimitry Andric//
210b57cec5SDimitry Andric
220b57cec5SDimitry Andricdef FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
230b57cec5SDimitry Andric                                       "Enable ARMv8 FP">;
240b57cec5SDimitry Andric
250b57cec5SDimitry Andricdef FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
260b57cec5SDimitry Andric  "Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
270b57cec5SDimitry Andric
280b57cec5SDimitry Andricdef FeatureSM4 : SubtargetFeature<
290b57cec5SDimitry Andric    "sm4", "HasSM4", "true",
300b57cec5SDimitry Andric    "Enable SM3 and SM4 support", [FeatureNEON]>;
310b57cec5SDimitry Andric
320b57cec5SDimitry Andricdef FeatureSHA2 : SubtargetFeature<
330b57cec5SDimitry Andric    "sha2", "HasSHA2", "true",
340b57cec5SDimitry Andric    "Enable SHA1 and SHA256 support", [FeatureNEON]>;
350b57cec5SDimitry Andric
360b57cec5SDimitry Andricdef FeatureSHA3 : SubtargetFeature<
370b57cec5SDimitry Andric    "sha3", "HasSHA3", "true",
380b57cec5SDimitry Andric    "Enable SHA512 and SHA3 support", [FeatureNEON, FeatureSHA2]>;
390b57cec5SDimitry Andric
400b57cec5SDimitry Andricdef FeatureAES : SubtargetFeature<
410b57cec5SDimitry Andric    "aes", "HasAES", "true",
420b57cec5SDimitry Andric    "Enable AES support", [FeatureNEON]>;
430b57cec5SDimitry Andric
440b57cec5SDimitry Andric// Crypto has been split up and any combination is now valid (see the
455ffd83dbSDimitry Andric// crypto definitions above). Also, crypto is now context sensitive:
460b57cec5SDimitry Andric// it has a different meaning for e.g. Armv8.4 than it has for Armv8.2.
470b57cec5SDimitry Andric// Therefore, we rely on Clang, the user interacing tool, to pass on the
480b57cec5SDimitry Andric// appropriate crypto options. But here in the backend, crypto has very little
495ffd83dbSDimitry Andric// meaning anymore. We kept the Crypto definition here for backward
500b57cec5SDimitry Andric// compatibility, and now imply features SHA2 and AES, which was the
510b57cec5SDimitry Andric// "traditional" meaning of Crypto.
520b57cec5SDimitry Andricdef FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
530b57cec5SDimitry Andric  "Enable cryptographic instructions", [FeatureNEON, FeatureSHA2, FeatureAES]>;
540b57cec5SDimitry Andric
550b57cec5SDimitry Andricdef FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
560b57cec5SDimitry Andric  "Enable ARMv8 CRC-32 checksum instructions">;
570b57cec5SDimitry Andric
580b57cec5SDimitry Andricdef FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
590b57cec5SDimitry Andric  "Enable ARMv8 Reliability, Availability and Serviceability Extensions">;
600b57cec5SDimitry Andric
610b57cec5SDimitry Andricdef FeatureLSE : SubtargetFeature<"lse", "HasLSE", "true",
620b57cec5SDimitry Andric  "Enable ARMv8.1 Large System Extension (LSE) atomic instructions">;
630b57cec5SDimitry Andric
64349cc55cSDimitry Andricdef FeatureLSE2 : SubtargetFeature<"lse2", "HasLSE2", "true",
65349cc55cSDimitry Andric  "Enable ARMv8.4 Large System Extension 2 (LSE2) atomicity rules">;
66349cc55cSDimitry Andric
67e8d8bef9SDimitry Andricdef FeatureOutlineAtomics : SubtargetFeature<"outline-atomics", "OutlineAtomics", "true",
68e8d8bef9SDimitry Andric  "Enable out of line atomics to support LSE instructions">;
69e8d8bef9SDimitry Andric
700b57cec5SDimitry Andricdef FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
710b57cec5SDimitry Andric  "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions">;
720b57cec5SDimitry Andric
730b57cec5SDimitry Andricdef FeaturePAN : SubtargetFeature<
740b57cec5SDimitry Andric    "pan", "HasPAN", "true",
750b57cec5SDimitry Andric    "Enables ARM v8.1 Privileged Access-Never extension">;
760b57cec5SDimitry Andric
770b57cec5SDimitry Andricdef FeatureLOR : SubtargetFeature<
780b57cec5SDimitry Andric    "lor", "HasLOR", "true",
790b57cec5SDimitry Andric    "Enables ARM v8.1 Limited Ordering Regions extension">;
800b57cec5SDimitry Andric
81e8d8bef9SDimitry Andricdef FeatureCONTEXTIDREL2 : SubtargetFeature<"CONTEXTIDREL2", "HasCONTEXTIDREL2",
82e8d8bef9SDimitry Andric    "true", "Enable RW operand CONTEXTIDR_EL2" >;
83e8d8bef9SDimitry Andric
84e8d8bef9SDimitry Andricdef FeatureVH : SubtargetFeature<"vh", "HasVH", "true",
85e8d8bef9SDimitry Andric    "Enables ARM v8.1 Virtual Host extension", [FeatureCONTEXTIDREL2] >;
860b57cec5SDimitry Andric
870b57cec5SDimitry Andricdef FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
880b57cec5SDimitry Andric  "Enable ARMv8 PMUv3 Performance Monitors extension">;
890b57cec5SDimitry Andric
900b57cec5SDimitry Andricdef FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
910b57cec5SDimitry Andric  "Full FP16", [FeatureFPARMv8]>;
920b57cec5SDimitry Andric
930b57cec5SDimitry Andricdef FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
940b57cec5SDimitry Andric  "Enable FP16 FML instructions", [FeatureFullFP16]>;
950b57cec5SDimitry Andric
960b57cec5SDimitry Andricdef FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
970b57cec5SDimitry Andric  "Enable Statistical Profiling extension">;
980b57cec5SDimitry Andric
990b57cec5SDimitry Andricdef FeaturePAN_RWV : SubtargetFeature<
1000b57cec5SDimitry Andric    "pan-rwv", "HasPAN_RWV", "true",
1010b57cec5SDimitry Andric    "Enable v8.2 PAN s1e1R and s1e1W Variants",
1020b57cec5SDimitry Andric    [FeaturePAN]>;
1030b57cec5SDimitry Andric
1040b57cec5SDimitry Andric// UAO PState
1050b57cec5SDimitry Andricdef FeaturePsUAO : SubtargetFeature< "uaops", "HasPsUAO", "true",
1060b57cec5SDimitry Andric    "Enable v8.2 UAO PState">;
1070b57cec5SDimitry Andric
1080b57cec5SDimitry Andricdef FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
1090b57cec5SDimitry Andric    "true", "Enable v8.2 data Cache Clean to Point of Persistence" >;
1100b57cec5SDimitry Andric
1110b57cec5SDimitry Andricdef FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
1125ffd83dbSDimitry Andric  "Enable Scalable Vector Extension (SVE) instructions", [FeatureFullFP16]>;
1135ffd83dbSDimitry Andric
1145ffd83dbSDimitry Andric// This flag is currently still labeled as Experimental, but when fully
1155ffd83dbSDimitry Andric// implemented this should tell the compiler to use the zeroing pseudos to
1165ffd83dbSDimitry Andric// benefit from the reverse instructions (e.g. SUB vs SUBR) if the inactive
1175ffd83dbSDimitry Andric// lanes are known to be zero. The pseudos will then be expanded using the
1185ffd83dbSDimitry Andric// MOVPRFX instruction to zero the inactive lanes. This feature should only be
1195ffd83dbSDimitry Andric// enabled if MOVPRFX instructions are known to merge with the destructive
1205ffd83dbSDimitry Andric// operations they prefix.
1215ffd83dbSDimitry Andric//
1225ffd83dbSDimitry Andric// This feature could similarly be extended to support cheap merging of _any_
1235ffd83dbSDimitry Andric// value into the inactive lanes using the MOVPRFX instruction that uses
1245ffd83dbSDimitry Andric// merging-predication.
1255ffd83dbSDimitry Andricdef FeatureExperimentalZeroingPseudos
1265ffd83dbSDimitry Andric    : SubtargetFeature<"use-experimental-zeroing-pseudos",
1275ffd83dbSDimitry Andric                       "UseExperimentalZeroingPseudos", "true",
1285ffd83dbSDimitry Andric                       "Hint to the compiler that the MOVPRFX instruction is "
1295ffd83dbSDimitry Andric                       "merged with destructive operations",
1305ffd83dbSDimitry Andric                       []>;
1310b57cec5SDimitry Andric
132349cc55cSDimitry Andricdef FeatureUseScalarIncVL : SubtargetFeature<"use-scalar-inc-vl",
133349cc55cSDimitry Andric  "UseScalarIncVL", "true", "Prefer inc/dec over add+cnt">;
134349cc55cSDimitry Andric
1350b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
136349cc55cSDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions",
137349cc55cSDimitry Andric  [FeatureSVE, FeatureUseScalarIncVL]>;
1380b57cec5SDimitry Andric
1390b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
1400b57cec5SDimitry Andric  "Enable AES SVE2 instructions", [FeatureSVE2, FeatureAES]>;
1410b57cec5SDimitry Andric
1420b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
1430b57cec5SDimitry Andric  "Enable SM4 SVE2 instructions", [FeatureSVE2, FeatureSM4]>;
1440b57cec5SDimitry Andric
1450b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
1460b57cec5SDimitry Andric  "Enable SHA3 SVE2 instructions", [FeatureSVE2, FeatureSHA3]>;
1470b57cec5SDimitry Andric
1480b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
1490b57cec5SDimitry Andric  "Enable bit permutation SVE2 instructions", [FeatureSVE2]>;
1500b57cec5SDimitry Andric
1510b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
1520b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
1538bcb0991SDimitry Andric
1540b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
1550b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
1560b57cec5SDimitry Andric
157fe6060f1SDimitry Andricdef FeatureNoZCZeroingFP : SubtargetFeature<"no-zcz-fp", "HasZeroCycleZeroingFP", "false",
158fe6060f1SDimitry Andric                                        "Has no zero-cycle zeroing instructions for FP registers">;
1590b57cec5SDimitry Andric
1600b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
1610b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
162fe6060f1SDimitry Andric                                        [FeatureZCZeroingGP]>;
1630b57cec5SDimitry Andric
1640b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
1650b57cec5SDimitry Andric/// CPUs.
1660b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
1670b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
1680b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
1690b57cec5SDimitry Andric
1700b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
1710b57cec5SDimitry Andric                                          "StrictAlign", "true",
1720b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
1730b57cec5SDimitry Andric                                          "access">;
1740b57cec5SDimitry Andric
1755ffd83dbSDimitry Andricforeach i = {1-7,9-15,18,20-28,30} in
1760b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
1770b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
1780b57cec5SDimitry Andric                                             "as a GPR">;
1790b57cec5SDimitry Andric
1800b57cec5SDimitry Andricforeach i = {8-15,18} in
1810b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
1820b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
1830b57cec5SDimitry Andric
1840b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
1850b57cec5SDimitry Andric    "true",
1860b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
1870b57cec5SDimitry Andric
1880b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
1890b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
1900b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
1910b57cec5SDimitry Andric
1920b57cec5SDimitry Andricdef FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
1930b57cec5SDimitry Andric    "CustomAsCheapAsMove", "true",
1940b57cec5SDimitry Andric    "Use custom handling of cheap instructions">;
1950b57cec5SDimitry Andric
1960b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
1970b57cec5SDimitry Andric    "ExynosAsCheapAsMove", "true",
1980b57cec5SDimitry Andric    "Use Exynos specific handling of cheap instructions",
1990b57cec5SDimitry Andric    [FeatureCustomCheapAsMoveHandling]>;
2000b57cec5SDimitry Andric
2010b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
2020b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
2030b57cec5SDimitry Andric
2040b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
2050b57cec5SDimitry Andric    "Misaligned128StoreIsSlow", "true", "Misaligned 128 bit stores are slow">;
2060b57cec5SDimitry Andric
2070b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
2080b57cec5SDimitry Andric    "Paired128IsSlow", "true", "Paired 128 bit loads and stores are slow">;
2090b57cec5SDimitry Andric
2100b57cec5SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "STRQroIsSlow",
2110b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
2120b57cec5SDimitry Andric
2130b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
2140b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
2150b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
2160b57cec5SDimitry Andric
2170b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
2180b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
2190b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
2200b57cec5SDimitry Andric
2210b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
2220b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
2230b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
2240b57cec5SDimitry Andric
225e8d8bef9SDimitry Andricdef FeatureCmpBccFusion : SubtargetFeature<
226e8d8bef9SDimitry Andric    "cmp-bcc-fusion", "HasCmpBccFusion", "true",
227e8d8bef9SDimitry Andric    "CPU fuses cmp+bcc operations">;
228e8d8bef9SDimitry Andric
2290b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
2300b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
2310b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
2320b57cec5SDimitry Andric
2330b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
2340b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
2350b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
2360b57cec5SDimitry Andric
2370b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
2380b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
2390b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
2420b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
2430b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
2440b57cec5SDimitry Andric
2450b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
2460b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
2470b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
2480b57cec5SDimitry Andric
2490b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
2500b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
2510b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
2520b57cec5SDimitry Andric
2530b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
2540b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
2550b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
2560b57cec5SDimitry Andric
2570b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
2580b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
2590b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
2600b57cec5SDimitry Andric
2610b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
2620b57cec5SDimitry Andric                                   "Enable support for RCPC extension">;
2630b57cec5SDimitry Andric
2640b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
2650b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
2660b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
2670b57cec5SDimitry Andric
2680b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
2690b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
2700b57cec5SDimitry Andric    "Enable dot product support">;
2710b57cec5SDimitry Andric
272e8d8bef9SDimitry Andricdef FeaturePAuth : SubtargetFeature<
273e8d8bef9SDimitry Andric    "pauth", "HasPAuth", "true",
2745ffd83dbSDimitry Andric    "Enable v8.3-A Pointer Authentication extension">;
2750b57cec5SDimitry Andric
2760b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
2770b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
2785ffd83dbSDimitry Andric    "Enable v8.3-A JavaScript FP conversion instructions",
2790b57cec5SDimitry Andric    [FeatureFPARMv8]>;
2800b57cec5SDimitry Andric
2810b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
2820b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
2830b57cec5SDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets">;
2840b57cec5SDimitry Andric
2850b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
2860b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
2870b57cec5SDimitry Andric    "Enable v8.3-A Floating-point complex number support",
2880b57cec5SDimitry Andric    [FeatureNEON]>;
2890b57cec5SDimitry Andric
2900b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
2910b57cec5SDimitry Andric    "nv", "HasNV", "true",
2920b57cec5SDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement">;
2930b57cec5SDimitry Andric
2940b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
2950b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
2960b57cec5SDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension">;
2970b57cec5SDimitry Andric
2980b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
2990b57cec5SDimitry Andric    "dit", "HasDIT", "true",
3000b57cec5SDimitry Andric    "Enable v8.4-A Data Independent Timing instructions">;
3010b57cec5SDimitry Andric
3020b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
3030b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
3040b57cec5SDimitry Andric    "Enable v8.4-A Trace extension">;
3050b57cec5SDimitry Andric
3060b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
3070b57cec5SDimitry Andric    "am", "HasAM", "true",
3080b57cec5SDimitry Andric    "Enable v8.4-A Activity Monitors extension">;
3090b57cec5SDimitry Andric
3105ffd83dbSDimitry Andricdef FeatureAMVS : SubtargetFeature<
3115ffd83dbSDimitry Andric    "amvs", "HasAMVS", "true",
3125ffd83dbSDimitry Andric    "Enable v8.6-A Activity Monitors Virtualization support",
3135ffd83dbSDimitry Andric    [FeatureAM]>;
3145ffd83dbSDimitry Andric
3150b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
3160b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
3170b57cec5SDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension">;
3180b57cec5SDimitry Andric
3190b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
3200b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
3210b57cec5SDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions">;
3220b57cec5SDimitry Andric
323e8d8bef9SDimitry Andricdef FeatureFlagM : SubtargetFeature<
324e8d8bef9SDimitry Andric    "flagm", "HasFlagM", "true",
3250b57cec5SDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions">;
3260b57cec5SDimitry Andric
3270b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
3280b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
3290b57cec5SDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets",
3300b57cec5SDimitry Andric    [FeatureRCPC]>;
3310b57cec5SDimitry Andric
3320b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
3330b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
3340b57cec5SDimitry Andric                                        "Convert immediates and instructions "
3350b57cec5SDimitry Andric                                        "to their negated or complemented "
3360b57cec5SDimitry Andric                                        "equivalent when the immediate does "
3370b57cec5SDimitry Andric                                        "not fit in the encoding.">;
3380b57cec5SDimitry Andric
3390b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
3400b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
3410b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
3420b57cec5SDimitry Andric
3430b57cec5SDimitry Andricdef FeatureAggressiveFMA :
3440b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
3450b57cec5SDimitry Andric                   "HasAggressiveFMA",
3460b57cec5SDimitry Andric                   "true",
3470b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
3480b57cec5SDimitry Andric
3490b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
3500b57cec5SDimitry Andric  "Enable alternative NZCV format for floating point comparisons">;
3510b57cec5SDimitry Andric
3520b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
3530b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
3540b57cec5SDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int" >;
3550b57cec5SDimitry Andric
3560b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
3570b57cec5SDimitry Andric  "true", "Enable architectural speculation restriction" >;
3580b57cec5SDimitry Andric
3590b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
3600b57cec5SDimitry Andric  "true", "Enable v8.5 Speculation Barrier" >;
3610b57cec5SDimitry Andric
3620b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
3630b57cec5SDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit" >;
3640b57cec5SDimitry Andric
3650b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
3660b57cec5SDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions" >;
3670b57cec5SDimitry Andric
3680b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
3690b57cec5SDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence" >;
3700b57cec5SDimitry Andric
3710b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
3720b57cec5SDimitry Andric    "true", "Enable Branch Target Identification" >;
3730b57cec5SDimitry Andric
3740b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
3750b57cec5SDimitry Andric    "true", "Enable Random Number generation instructions" >;
3760b57cec5SDimitry Andric
3770b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
3780b57cec5SDimitry Andric    "true", "Enable Memory Tagging Extension" >;
3790b57cec5SDimitry Andric
3808bcb0991SDimitry Andricdef FeatureTRBE : SubtargetFeature<"trbe", "HasTRBE",
3818bcb0991SDimitry Andric    "true", "Enable Trace Buffer Extension">;
3828bcb0991SDimitry Andric
3838bcb0991SDimitry Andricdef FeatureETE : SubtargetFeature<"ete", "HasETE",
3848bcb0991SDimitry Andric    "true", "Enable Embedded Trace Extension",
3858bcb0991SDimitry Andric    [FeatureTRBE]>;
3868bcb0991SDimitry Andric
3878bcb0991SDimitry Andricdef FeatureTME : SubtargetFeature<"tme", "HasTME",
3888bcb0991SDimitry Andric    "true", "Enable Transactional Memory Extension" >;
3898bcb0991SDimitry Andric
3908bcb0991SDimitry Andricdef FeatureTaggedGlobals : SubtargetFeature<"tagged-globals",
3918bcb0991SDimitry Andric    "AllowTaggedGlobals",
3928bcb0991SDimitry Andric    "true", "Use an instruction sequence for taking the address of a global "
3938bcb0991SDimitry Andric    "that allows a memory tag in the upper address bits">;
3948bcb0991SDimitry Andric
3955ffd83dbSDimitry Andricdef FeatureBF16 : SubtargetFeature<"bf16", "HasBF16",
3965ffd83dbSDimitry Andric    "true", "Enable BFloat16 Extension" >;
3975ffd83dbSDimitry Andric
3985ffd83dbSDimitry Andricdef FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
3995ffd83dbSDimitry Andric    "true", "Enable Matrix Multiply Int8 Extension">;
4005ffd83dbSDimitry Andric
4015ffd83dbSDimitry Andricdef FeatureMatMulFP32 : SubtargetFeature<"f32mm", "HasMatMulFP32",
4025ffd83dbSDimitry Andric    "true", "Enable Matrix Multiply FP32 Extension", [FeatureSVE]>;
4035ffd83dbSDimitry Andric
4045ffd83dbSDimitry Andricdef FeatureMatMulFP64 : SubtargetFeature<"f64mm", "HasMatMulFP64",
4055ffd83dbSDimitry Andric    "true", "Enable Matrix Multiply FP64 Extension", [FeatureSVE]>;
4065ffd83dbSDimitry Andric
407e8d8bef9SDimitry Andricdef FeatureXS : SubtargetFeature<"xs", "HasXS",
408e8d8bef9SDimitry Andric    "true", "Enable Armv8.7-A limited-TLB-maintenance instruction">;
409e8d8bef9SDimitry Andric
410e8d8bef9SDimitry Andricdef FeatureWFxT : SubtargetFeature<"wfxt", "HasWFxT",
411e8d8bef9SDimitry Andric    "true", "Enable Armv8.7-A WFET and WFIT instruction">;
412e8d8bef9SDimitry Andric
413e8d8bef9SDimitry Andricdef FeatureHCX : SubtargetFeature<
414e8d8bef9SDimitry Andric    "hcx", "HasHCX", "true", "Enable Armv8.7-A HCRX_EL2 system register">;
415e8d8bef9SDimitry Andric
416e8d8bef9SDimitry Andricdef FeatureLS64 : SubtargetFeature<"ls64", "HasLS64",
417e8d8bef9SDimitry Andric    "true", "Enable Armv8.7-A LD64B/ST64B Accelerator Extension">;
418e8d8bef9SDimitry Andric
41904eeddc0SDimitry Andricdef FeatureHBC : SubtargetFeature<"hbc", "HasHBC",
42004eeddc0SDimitry Andric    "true", "Enable Armv8.8-A Hinted Conditional Branches Extension">;
42104eeddc0SDimitry Andric
42204eeddc0SDimitry Andricdef FeatureMOPS : SubtargetFeature<"mops", "HasMOPS",
42304eeddc0SDimitry Andric    "true", "Enable Armv8.8-A memcpy and memset acceleration instructions">;
42404eeddc0SDimitry Andric
425e8d8bef9SDimitry Andricdef FeatureBRBE : SubtargetFeature<"brbe", "HasBRBE",
426e8d8bef9SDimitry Andric    "true", "Enable Branch Record Buffer Extension">;
427e8d8bef9SDimitry Andric
428e8d8bef9SDimitry Andricdef FeatureSPE_EEF : SubtargetFeature<"spe-eef", "HasSPE_EEF",
429e8d8bef9SDimitry Andric    "true", "Enable extra register in the Statistical Profiling Extension">;
430e8d8bef9SDimitry Andric
4315ffd83dbSDimitry Andricdef FeatureFineGrainedTraps : SubtargetFeature<"fgt", "HasFineGrainedTraps",
4325ffd83dbSDimitry Andric    "true", "Enable fine grained virtualization traps extension">;
4335ffd83dbSDimitry Andric
4345ffd83dbSDimitry Andricdef FeatureEnhancedCounterVirtualization :
4355ffd83dbSDimitry Andric      SubtargetFeature<"ecv", "HasEnhancedCounterVirtualization",
4365ffd83dbSDimitry Andric      "true", "Enable enhanced counter virtualization extension">;
4375ffd83dbSDimitry Andric
438fe6060f1SDimitry Andricdef FeatureRME : SubtargetFeature<"rme", "HasRME",
439fe6060f1SDimitry Andric    "true", "Enable Realm Management Extension">;
440fe6060f1SDimitry Andric
441349cc55cSDimitry Andric// A subset of SVE(2) instructions are legal in Streaming SVE execution mode
442349cc55cSDimitry Andric// defined by SME.
443349cc55cSDimitry Andricdef FeatureStreamingSVE : SubtargetFeature<"streaming-sve",
444349cc55cSDimitry Andric                                           "HasStreamingSVE", "true",
445349cc55cSDimitry Andric  "Enable subset of SVE(2) instructions for Streaming SVE execution mode">;
446fe6060f1SDimitry Andricdef FeatureSME : SubtargetFeature<"sme", "HasSME", "true",
447349cc55cSDimitry Andric  "Enable Scalable Matrix Extension (SME)", [FeatureStreamingSVE, FeatureBF16]>;
448fe6060f1SDimitry Andric
449fe6060f1SDimitry Andricdef FeatureSMEF64 : SubtargetFeature<"sme-f64", "HasSMEF64", "true",
450fe6060f1SDimitry Andric  "Enable Scalable Matrix Extension (SME) F64F64 instructions", [FeatureSME]>;
451fe6060f1SDimitry Andric
452fe6060f1SDimitry Andricdef FeatureSMEI64 : SubtargetFeature<"sme-i64", "HasSMEI64", "true",
453fe6060f1SDimitry Andric  "Enable Scalable Matrix Extension (SME) I16I64 instructions", [FeatureSME]>;
454fe6060f1SDimitry Andric
455349cc55cSDimitry Andricdef FeatureAppleA7SysReg  : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true",
456349cc55cSDimitry Andric  "Apple A7 (the CPU formerly known as Cyclone)">;
457349cc55cSDimitry Andric
458349cc55cSDimitry Andricdef FeatureEL2VMSA : SubtargetFeature<"el2vmsa", "HasEL2VMSA", "true",
459349cc55cSDimitry Andric  "Enable Exception Level 2 Virtual Memory System Architecture">;
460349cc55cSDimitry Andric
461349cc55cSDimitry Andricdef FeatureEL3 : SubtargetFeature<"el3", "HasEL3", "true",
462349cc55cSDimitry Andric  "Enable Exception Level 3">;
463349cc55cSDimitry Andric
4640eae32dcSDimitry Andricdef FeatureFixCortexA53_835769 : SubtargetFeature<"fix-cortex-a53-835769",
4650eae32dcSDimitry Andric  "FixCortexA53_835769", "true", "Mitigate Cortex-A53 Erratum 835769">;
4660eae32dcSDimitry Andric
4670b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4680b57cec5SDimitry Andric// Architectures.
4690b57cec5SDimitry Andric//
470349cc55cSDimitry Andricdef HasV8_0aOps : SubtargetFeature<"v8a", "HasV8_0aOps", "true",
471349cc55cSDimitry Andric  "Support ARM v8.0a instructions", [FeatureEL2VMSA, FeatureEL3]>;
4720b57cec5SDimitry Andric
4730b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
474349cc55cSDimitry Andric  "Support ARM v8.1a instructions", [HasV8_0aOps, FeatureCRC, FeatureLSE,
475349cc55cSDimitry Andric  FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH]>;
4760b57cec5SDimitry Andric
4770b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
4780b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
4790b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
4800b57cec5SDimitry Andric
4810b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
482e8d8bef9SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePAuth,
4830b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
4840b57cec5SDimitry Andric
4850b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
4860b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
487e8d8bef9SDimitry Andric  FeatureNV, FeatureMPAM, FeatureDIT,
488349cc55cSDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
489349cc55cSDimitry Andric  FeatureFlagM, FeatureRCPC_IMMO, FeatureLSE2]>;
4900b57cec5SDimitry Andric
4910b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
4920b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
4930b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
4940b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
4955ffd83dbSDimitry Andric   FeatureBranchTargetId]>;
4965ffd83dbSDimitry Andric
4975ffd83dbSDimitry Andricdef HasV8_6aOps : SubtargetFeature<
4985ffd83dbSDimitry Andric  "v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions",
4995ffd83dbSDimitry Andric  [HasV8_5aOps, FeatureAMVS, FeatureBF16, FeatureFineGrainedTraps,
5005ffd83dbSDimitry Andric   FeatureEnhancedCounterVirtualization, FeatureMatMulInt8]>;
5010b57cec5SDimitry Andric
502e8d8bef9SDimitry Andricdef HasV8_7aOps : SubtargetFeature<
503e8d8bef9SDimitry Andric  "v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions",
504e8d8bef9SDimitry Andric  [HasV8_6aOps, FeatureXS, FeatureWFxT, FeatureHCX]>;
505e8d8bef9SDimitry Andric
50604eeddc0SDimitry Andricdef HasV8_8aOps : SubtargetFeature<
50704eeddc0SDimitry Andric  "v8.8a", "HasV8_8aOps", "true", "Support ARM v8.8a instructions",
50804eeddc0SDimitry Andric  [HasV8_7aOps, FeatureHBC, FeatureMOPS]>;
50904eeddc0SDimitry Andric
510349cc55cSDimitry Andricdef HasV9_0aOps : SubtargetFeature<
511349cc55cSDimitry Andric  "v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions",
512349cc55cSDimitry Andric  [HasV8_5aOps, FeatureSVE2]>;
513349cc55cSDimitry Andric
514349cc55cSDimitry Andricdef HasV9_1aOps : SubtargetFeature<
515349cc55cSDimitry Andric  "v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions",
516349cc55cSDimitry Andric  [HasV8_6aOps, HasV9_0aOps]>;
517349cc55cSDimitry Andric
518349cc55cSDimitry Andricdef HasV9_2aOps : SubtargetFeature<
519349cc55cSDimitry Andric  "v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions",
520349cc55cSDimitry Andric  [HasV8_7aOps, HasV9_1aOps]>;
521349cc55cSDimitry Andric
52204eeddc0SDimitry Andricdef HasV9_3aOps : SubtargetFeature<
52304eeddc0SDimitry Andric  "v9.3a", "HasV9_3aOps", "true", "Support ARM v9.3a instructions",
52404eeddc0SDimitry Andric  [HasV8_8aOps, HasV9_2aOps]>;
52504eeddc0SDimitry Andric
526e8d8bef9SDimitry Andricdef HasV8_0rOps : SubtargetFeature<
527e8d8bef9SDimitry Andric  "v8r", "HasV8_0rOps", "true", "Support ARM v8r instructions",
528e8d8bef9SDimitry Andric  [//v8.1
529e8d8bef9SDimitry Andric  FeatureCRC, FeaturePAN, FeatureRDM, FeatureLSE, FeatureCONTEXTIDREL2,
530e8d8bef9SDimitry Andric  //v8.2
53104eeddc0SDimitry Andric  FeatureRAS, FeaturePsUAO, FeatureCCPP, FeaturePAN_RWV,
532e8d8bef9SDimitry Andric  //v8.3
533e8d8bef9SDimitry Andric  FeatureComplxNum, FeatureCCIDX, FeatureJS,
534e8d8bef9SDimitry Andric  FeaturePAuth, FeatureRCPC,
535e8d8bef9SDimitry Andric  //v8.4
53604eeddc0SDimitry Andric  FeatureDotProd, FeatureTRACEV8_4, FeatureTLB_RMI,
53704eeddc0SDimitry Andric  FeatureFlagM, FeatureDIT, FeatureSEL2, FeatureRCPC_IMMO]>;
538e8d8bef9SDimitry Andric
5390b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5400b57cec5SDimitry Andric// Register File Description
5410b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5420b57cec5SDimitry Andric
5430b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
5440b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
5450b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
5460b57cec5SDimitry Andric
5470b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5480b57cec5SDimitry Andric// Instruction Descriptions
5490b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5500b57cec5SDimitry Andric
5510b57cec5SDimitry Andricinclude "AArch64Schedule.td"
5520b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
5530b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
5540b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
5558bcb0991SDimitry Andricinclude "AArch64Combine.td"
5560b57cec5SDimitry Andric
5570b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
5580b57cec5SDimitry Andric
5590b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5600b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
5610b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5620b57cec5SDimitry Andric
5630b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
5640b57cec5SDimitry Andric
5650b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5660b57cec5SDimitry Andric// Access to privileged registers
5670b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5680b57cec5SDimitry Andric
5690b57cec5SDimitry Andricforeach i = 1-3 in
5700b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
5710b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
5720b57cec5SDimitry Andric
5730b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5745ffd83dbSDimitry Andric// Control codegen mitigation against Straight Line Speculation vulnerability.
5755ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
5765ffd83dbSDimitry Andric
5775ffd83dbSDimitry Andricdef FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
5785ffd83dbSDimitry Andric  "HardenSlsRetBr", "true",
5795ffd83dbSDimitry Andric  "Harden against straight line speculation across RET and BR instructions">;
5805ffd83dbSDimitry Andricdef FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
5815ffd83dbSDimitry Andric  "HardenSlsBlr", "true",
5825ffd83dbSDimitry Andric  "Harden against straight line speculation across BLR instructions">;
583fe6060f1SDimitry Andricdef FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
584fe6060f1SDimitry Andric  "HardenSlsNoComdat", "true",
585fe6060f1SDimitry Andric  "Generate thunk code for SLS mitigation in the normal text section">;
5865ffd83dbSDimitry Andric
5875ffd83dbSDimitry Andric//===----------------------------------------------------------------------===//
5880b57cec5SDimitry Andric// AArch64 Processors supported.
5890b57cec5SDimitry Andric//
5900b57cec5SDimitry Andric
5910b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5920b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
5930b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5940b57cec5SDimitry Andric
5950b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
5960b57cec5SDimitry Andric
5970b57cec5SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
5980b57cec5SDimitry Andric  let F = [HasSVE, HasSVE2, HasSVE2AES, HasSVE2SM4, HasSVE2SHA3,
599349cc55cSDimitry Andric           HasSVE2BitPerm, HasSVEorStreamingSVE, HasSVE2orStreamingSVE];
6000b57cec5SDimitry Andric}
6010b57cec5SDimitry Andric
602e837bb5cSDimitry Andricdef PAUnsupported : AArch64Unsupported {
603e8d8bef9SDimitry Andric  let F = [HasPAuth];
604e837bb5cSDimitry Andric}
605e837bb5cSDimitry Andric
606fe6060f1SDimitry Andricdef SMEUnsupported : AArch64Unsupported {
607fe6060f1SDimitry Andric  let F = [HasSME, HasSMEF64, HasSMEI64];
608fe6060f1SDimitry Andric}
609fe6060f1SDimitry Andric
6100b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
611e8d8bef9SDimitry Andricinclude "AArch64SchedA55.td"
6120b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
6130b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
6140b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
6150b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
6160b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
6170b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
618480093f4SDimitry Andricinclude "AArch64SchedExynosM5.td"
6190b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
6200b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
621e8d8bef9SDimitry Andricinclude "AArch64SchedA64FX.td"
622e837bb5cSDimitry Andricinclude "AArch64SchedThunderX3T110.td"
623e8d8bef9SDimitry Andricinclude "AArch64SchedTSV110.td"
6240b57cec5SDimitry Andric
625349cc55cSDimitry Andricdef TuneA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
626349cc55cSDimitry Andric                                "Cortex-A35 ARM processors">;
6270b57cec5SDimitry Andric
628349cc55cSDimitry Andricdef TuneA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
6290b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
6300b57cec5SDimitry Andric                                   FeatureFuseAES,
631349cc55cSDimitry Andric                                   FeatureBalanceFPOps,
632349cc55cSDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
633349cc55cSDimitry Andric                                   FeaturePostRAScheduler]>;
6340b57cec5SDimitry Andric
635349cc55cSDimitry Andricdef TuneA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
6360b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
6370b57cec5SDimitry Andric                                   FeatureFuseAES,
638fe6060f1SDimitry Andric                                   FeaturePostRAScheduler,
639349cc55cSDimitry Andric                                   FeatureFuseAddress]>;
640349cc55cSDimitry Andric
641349cc55cSDimitry Andricdef TuneA510    : SubtargetFeature<"a510", "ARMProcFamily", "CortexA510",
642349cc55cSDimitry Andric                                   "Cortex-A510 ARM processors", [
643349cc55cSDimitry Andric                                   FeatureFuseAES,
644349cc55cSDimitry Andric                                   FeaturePostRAScheduler
6450b57cec5SDimitry Andric                                   ]>;
6460b57cec5SDimitry Andric
647349cc55cSDimitry Andricdef TuneA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
6480b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
649349cc55cSDimitry Andric                                   FeatureFuseAES,
6500b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
6510b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
6520b57cec5SDimitry Andric                                   FeatureFuseLiterals,
6530b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
654349cc55cSDimitry Andric                                   FeaturePredictableSelectIsExpensive]>;
6550b57cec5SDimitry Andric
656349cc55cSDimitry Andricdef TuneA65     : SubtargetFeature<"a65", "ARMProcFamily", "CortexA65",
6578bcb0991SDimitry Andric                                   "Cortex-A65 ARM processors", [
658349cc55cSDimitry Andric                                   FeatureFuseAES,
659e8d8bef9SDimitry Andric                                   FeatureFuseAddress,
660349cc55cSDimitry Andric                                   FeatureFuseLiterals]>;
6618bcb0991SDimitry Andric
662349cc55cSDimitry Andricdef TuneA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
6630b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
6640b57cec5SDimitry Andric                                   FeatureFuseAES,
665349cc55cSDimitry Andric                                   FeatureFuseLiterals]>;
6660b57cec5SDimitry Andric
667349cc55cSDimitry Andricdef TuneA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
6680b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
669349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6700b57cec5SDimitry Andric
671349cc55cSDimitry Andricdef TuneA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
6720b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
673349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6740b57cec5SDimitry Andric
675349cc55cSDimitry Andricdef TuneA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
6760b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
677349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6780b57cec5SDimitry Andric
679349cc55cSDimitry Andricdef TuneA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
6805ffd83dbSDimitry Andric                                   "Cortex-A77 ARM processors", [
681e8d8bef9SDimitry Andric                                   FeatureCmpBccFusion,
682349cc55cSDimitry Andric                                   FeatureFuseAES]>;
6835ffd83dbSDimitry Andric
684349cc55cSDimitry Andricdef TuneA78 : SubtargetFeature<"a78", "ARMProcFamily", "CortexA78",
6855ffd83dbSDimitry Andric                               "Cortex-A78 ARM processors", [
686e8d8bef9SDimitry Andric                               FeatureCmpBccFusion,
6875ffd83dbSDimitry Andric                               FeatureFuseAES,
688349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
6895ffd83dbSDimitry Andric
690349cc55cSDimitry Andricdef TuneA78C : SubtargetFeature<"a78c", "ARMProcFamily",
691e8d8bef9SDimitry Andric                                "CortexA78C",
692e8d8bef9SDimitry Andric                                "Cortex-A78C ARM processors", [
693e8d8bef9SDimitry Andric                                FeatureCmpBccFusion,
694e8d8bef9SDimitry Andric                                FeatureFuseAES,
695349cc55cSDimitry Andric                                FeaturePostRAScheduler]>;
696e8d8bef9SDimitry Andric
697349cc55cSDimitry Andricdef TuneA710    : SubtargetFeature<"a710", "ARMProcFamily", "CortexA710",
698349cc55cSDimitry Andric                                   "Cortex-A710 ARM processors", [
699349cc55cSDimitry Andric                                   FeatureFuseAES,
700349cc55cSDimitry Andric                                   FeaturePostRAScheduler,
701349cc55cSDimitry Andric                                   FeatureCmpBccFusion]>;
702349cc55cSDimitry Andric
703349cc55cSDimitry Andricdef TuneR82 : SubtargetFeature<"cortex-r82", "ARMProcFamily",
704e8d8bef9SDimitry Andric                               "CortexR82",
705349cc55cSDimitry Andric                               "Cortex-R82 ARM processors", [
706349cc55cSDimitry Andric                               FeaturePostRAScheduler]>;
707e8d8bef9SDimitry Andric
708349cc55cSDimitry Andricdef TuneX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
7095ffd83dbSDimitry Andric                                  "Cortex-X1 ARM processors", [
710e8d8bef9SDimitry Andric                                  FeatureCmpBccFusion,
7115ffd83dbSDimitry Andric                                  FeatureFuseAES,
712349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
7135ffd83dbSDimitry Andric
714349cc55cSDimitry Andricdef TuneX2 : SubtargetFeature<"cortex-x2", "ARMProcFamily", "CortexX2",
715349cc55cSDimitry Andric                                  "Cortex-X2 ARM processors", [
716349cc55cSDimitry Andric                                  FeatureFuseAES,
7175ffd83dbSDimitry Andric                                  FeaturePostRAScheduler,
718349cc55cSDimitry Andric                                  FeatureCmpBccFusion]>;
719349cc55cSDimitry Andric
720349cc55cSDimitry Andricdef TuneA64FX : SubtargetFeature<"a64fx", "ARMProcFamily", "A64FX",
721349cc55cSDimitry Andric                                 "Fujitsu A64FX processors", [
722349cc55cSDimitry Andric                                 FeaturePostRAScheduler,
723e8d8bef9SDimitry Andric                                 FeatureAggressiveFMA,
724e8d8bef9SDimitry Andric                                 FeatureArithmeticBccFusion,
725e8d8bef9SDimitry Andric                                 FeaturePredictableSelectIsExpensive
7265ffd83dbSDimitry Andric                                 ]>;
7275ffd83dbSDimitry Andric
728349cc55cSDimitry Andricdef TuneCarmel : SubtargetFeature<"carmel", "ARMProcFamily", "Carmel",
729349cc55cSDimitry Andric                                  "Nvidia Carmel processors">;
7305ffd83dbSDimitry Andric
7310b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
7320b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
733349cc55cSDimitry Andricdef TuneAppleA7  : SubtargetFeature<"apple-a7", "ARMProcFamily", "AppleA7",
734480093f4SDimitry Andric                                    "Apple A7 (the CPU formerly known as Cyclone)", [
7350b57cec5SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
7360b57cec5SDimitry Andric                                    FeatureArithmeticBccFusion,
7370b57cec5SDimitry Andric                                    FeatureArithmeticCbzFusion,
7380b57cec5SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
739349cc55cSDimitry Andric                                    FeatureFuseAES, FeatureFuseCryptoEOR,
7400b57cec5SDimitry Andric                                    FeatureZCRegMove,
7410b57cec5SDimitry Andric                                    FeatureZCZeroing,
742349cc55cSDimitry Andric                                    FeatureZCZeroingFPWorkaround]
743349cc55cSDimitry Andric                                    >;
7440b57cec5SDimitry Andric
745349cc55cSDimitry Andricdef TuneAppleA10 : SubtargetFeature<"apple-a10", "ARMProcFamily", "AppleA10",
746480093f4SDimitry Andric                                    "Apple A10", [
747480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
748480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
749480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
750480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
7510b57cec5SDimitry Andric                                    FeatureFuseAES,
752480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
753480093f4SDimitry Andric                                    FeatureZCRegMove,
754349cc55cSDimitry Andric                                    FeatureZCZeroing]
755349cc55cSDimitry Andric                                    >;
7560b57cec5SDimitry Andric
757349cc55cSDimitry Andricdef TuneAppleA11 : SubtargetFeature<"apple-a11", "ARMProcFamily", "AppleA11",
758480093f4SDimitry Andric                                    "Apple A11", [
759480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
760480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
761480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
762480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
7630b57cec5SDimitry Andric                                    FeatureFuseAES,
764480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
765480093f4SDimitry Andric                                    FeatureZCRegMove,
766349cc55cSDimitry Andric                                    FeatureZCZeroing]
767349cc55cSDimitry Andric                                    >;
768480093f4SDimitry Andric
769349cc55cSDimitry Andricdef TuneAppleA12 : SubtargetFeature<"apple-a12", "ARMProcFamily", "AppleA12",
770480093f4SDimitry Andric                                    "Apple A12", [
771480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
772480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
773480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
774480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
775480093f4SDimitry Andric                                    FeatureFuseAES,
776480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
777480093f4SDimitry Andric                                    FeatureZCRegMove,
778349cc55cSDimitry Andric                                    FeatureZCZeroing]
779349cc55cSDimitry Andric                                    >;
780480093f4SDimitry Andric
781349cc55cSDimitry Andricdef TuneAppleA13 : SubtargetFeature<"apple-a13", "ARMProcFamily", "AppleA13",
782480093f4SDimitry Andric                                    "Apple A13", [
783480093f4SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
784480093f4SDimitry Andric                                    FeatureArithmeticBccFusion,
785480093f4SDimitry Andric                                    FeatureArithmeticCbzFusion,
786480093f4SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
787480093f4SDimitry Andric                                    FeatureFuseAES,
788480093f4SDimitry Andric                                    FeatureFuseCryptoEOR,
789480093f4SDimitry Andric                                    FeatureZCRegMove,
790349cc55cSDimitry Andric                                    FeatureZCZeroing]
791349cc55cSDimitry Andric                                    >;
7920b57cec5SDimitry Andric
793349cc55cSDimitry Andricdef TuneAppleA14 : SubtargetFeature<"apple-a14", "ARMProcFamily", "AppleA14",
794e8d8bef9SDimitry Andric                                    "Apple A14", [
795e8d8bef9SDimitry Andric                                    FeatureAggressiveFMA,
796e8d8bef9SDimitry Andric                                    FeatureAlternateSExtLoadCVTF32Pattern,
797e8d8bef9SDimitry Andric                                    FeatureArithmeticBccFusion,
798e8d8bef9SDimitry Andric                                    FeatureArithmeticCbzFusion,
799e8d8bef9SDimitry Andric                                    FeatureDisableLatencySchedHeuristic,
800e8d8bef9SDimitry Andric                                    FeatureFuseAddress,
801e8d8bef9SDimitry Andric                                    FeatureFuseAES,
802e8d8bef9SDimitry Andric                                    FeatureFuseArithmeticLogic,
803e8d8bef9SDimitry Andric                                    FeatureFuseCCSelect,
804e8d8bef9SDimitry Andric                                    FeatureFuseCryptoEOR,
805e8d8bef9SDimitry Andric                                    FeatureFuseLiterals,
806e8d8bef9SDimitry Andric                                    FeatureZCRegMove,
807349cc55cSDimitry Andric                                    FeatureZCZeroing]>;
808e8d8bef9SDimitry Andric
809349cc55cSDimitry Andricdef TuneExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
8100b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
811349cc55cSDimitry Andric                                    [FeatureExynosCheapAsMoveHandling,
8120b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
8130b57cec5SDimitry Andric                                     FeatureFuseAddress,
8140b57cec5SDimitry Andric                                     FeatureFuseAES,
8150b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
8160b57cec5SDimitry Andric                                     FeatureFuseLiterals,
8170b57cec5SDimitry Andric                                     FeatureLSLFast,
8180b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
819fe6060f1SDimitry Andric                                     FeaturePredictableSelectIsExpensive]>;
8200b57cec5SDimitry Andric
821349cc55cSDimitry Andricdef TuneExynosM4 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
822349cc55cSDimitry Andric                                    "Samsung Exynos-M3 processors",
823349cc55cSDimitry Andric                                    [FeatureArithmeticBccFusion,
8240b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
8250b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
8260b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
8270b57cec5SDimitry Andric                                     FeatureFuseAddress,
8280b57cec5SDimitry Andric                                     FeatureFuseAES,
8290b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
8300b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
8310b57cec5SDimitry Andric                                     FeatureFuseLiterals,
8320b57cec5SDimitry Andric                                     FeatureLSLFast,
8330b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
8340b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
8350b57cec5SDimitry Andric
836349cc55cSDimitry Andricdef TuneKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
8370b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
8380b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
8390b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
8400b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
8410b57cec5SDimitry Andric                                   FeatureZCZeroing,
842349cc55cSDimitry Andric                                   FeatureLSLFast]
843349cc55cSDimitry Andric                                   >;
8440b57cec5SDimitry Andric
845349cc55cSDimitry Andricdef TuneFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
8460b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
8470b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
8480b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
8490b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
8500b57cec5SDimitry Andric                                   FeatureZCZeroing,
8510b57cec5SDimitry Andric                                   FeatureLSLFast,
8520b57cec5SDimitry Andric                                   FeatureSlowSTRQro
8530b57cec5SDimitry Andric                                   ]>;
8540b57cec5SDimitry Andric
855349cc55cSDimitry Andricdef TuneNeoverseE1 : SubtargetFeature<"neoversee1", "ARMProcFamily", "NeoverseE1",
8568bcb0991SDimitry Andric                                      "Neoverse E1 ARM processors", [
857fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
858349cc55cSDimitry Andric                                      FeatureFuseAES
8598bcb0991SDimitry Andric                                      ]>;
8608bcb0991SDimitry Andric
861349cc55cSDimitry Andricdef TuneNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily", "NeoverseN1",
8628bcb0991SDimitry Andric                                      "Neoverse N1 ARM processors", [
863fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
864349cc55cSDimitry Andric                                      FeatureFuseAES
8658bcb0991SDimitry Andric                                      ]>;
8668bcb0991SDimitry Andric
867349cc55cSDimitry Andricdef TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2",
868e8d8bef9SDimitry Andric                                      "Neoverse N2 ARM processors", [
869fe6060f1SDimitry Andric                                      FeaturePostRAScheduler,
870349cc55cSDimitry Andric                                      FeatureFuseAES
871349cc55cSDimitry Andric                                      ]>;
872349cc55cSDimitry Andricdef TuneNeoverse512TVB : SubtargetFeature<"neoverse512tvb", "ARMProcFamily", "Neoverse512TVB",
873349cc55cSDimitry Andric                                      "Neoverse 512-TVB ARM processors", [
874349cc55cSDimitry Andric                                      FeaturePostRAScheduler,
875349cc55cSDimitry Andric                                      FeatureFuseAES
876fe6060f1SDimitry Andric                                      ]>;
877e8d8bef9SDimitry Andric
878349cc55cSDimitry Andricdef TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1",
879e8d8bef9SDimitry Andric                                      "Neoverse V1 ARM processors", [
880e8d8bef9SDimitry Andric                                      FeatureFuseAES,
881349cc55cSDimitry Andric                                      FeaturePostRAScheduler]>;
882e8d8bef9SDimitry Andric
883349cc55cSDimitry Andricdef TuneSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
8840b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
8850b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
8860b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
8870b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
8880b57cec5SDimitry Andric                                   FeatureZCZeroing,
889349cc55cSDimitry Andric                                   FeatureLSLFast]>;
8900b57cec5SDimitry Andric
891349cc55cSDimitry Andricdef TuneThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily", "ThunderX2T99",
8920b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
8930b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
8940b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
8950b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
896349cc55cSDimitry Andric                                          FeaturePredictableSelectIsExpensive]>;
8970b57cec5SDimitry Andric
898349cc55cSDimitry Andricdef TuneThunderX3T110  : SubtargetFeature<"thunderx3t110", "ARMProcFamily",
899e837bb5cSDimitry Andric                                          "ThunderX3T110",
900e837bb5cSDimitry Andric                                          "Marvell ThunderX3 processors", [
901e837bb5cSDimitry Andric                                           FeatureAggressiveFMA,
902e837bb5cSDimitry Andric                                           FeatureArithmeticBccFusion,
903e837bb5cSDimitry Andric                                           FeaturePostRAScheduler,
904e837bb5cSDimitry Andric                                           FeaturePredictableSelectIsExpensive,
905e837bb5cSDimitry Andric                                           FeatureBalanceFPOps,
906349cc55cSDimitry Andric                                           FeatureStrictAlign]>;
907e837bb5cSDimitry Andric
908349cc55cSDimitry Andricdef TuneThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
9090b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
9100b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
911349cc55cSDimitry Andric                                    FeaturePredictableSelectIsExpensive]>;
9120b57cec5SDimitry Andric
913349cc55cSDimitry Andricdef TuneThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
9140b57cec5SDimitry Andric                                       "ThunderXT88",
9150b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
9160b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
917349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
9180b57cec5SDimitry Andric
919349cc55cSDimitry Andricdef TuneThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
9200b57cec5SDimitry Andric                                       "ThunderXT81",
9210b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
9220b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
923349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
9240b57cec5SDimitry Andric
925349cc55cSDimitry Andricdef TuneThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
9260b57cec5SDimitry Andric                                       "ThunderXT83",
9270b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
9280b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
929349cc55cSDimitry Andric                                       FeaturePredictableSelectIsExpensive]>;
9300b57cec5SDimitry Andric
931349cc55cSDimitry Andricdef TuneTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
9320b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
9330b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
9340b57cec5SDimitry Andric                                  FeatureFuseAES,
935349cc55cSDimitry Andric                                  FeaturePostRAScheduler]>;
9360b57cec5SDimitry Andric
937349cc55cSDimitry Andric
938349cc55cSDimitry Andricdef ProcessorFeatures {
939349cc55cSDimitry Andric  list<SubtargetFeature> A53  = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
940349cc55cSDimitry Andric                                 FeatureFPARMv8, FeatureNEON, FeaturePerfMon];
941349cc55cSDimitry Andric  list<SubtargetFeature> A55  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
942349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
943349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon];
944349cc55cSDimitry Andric  list<SubtargetFeature> A510 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
945349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
946349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
947349cc55cSDimitry Andric                                 FeatureFP16FML];
948349cc55cSDimitry Andric  list<SubtargetFeature> A65  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
949349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
950349cc55cSDimitry Andric                                 FeatureRCPC, FeatureSSBS, FeatureRAS];
951349cc55cSDimitry Andric  list<SubtargetFeature> A76  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
952349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
953349cc55cSDimitry Andric                                 FeatureRCPC, FeatureSSBS];
954349cc55cSDimitry Andric  list<SubtargetFeature> A77  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
955349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
956349cc55cSDimitry Andric                                 FeatureRCPC];
957349cc55cSDimitry Andric  list<SubtargetFeature> A78  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
958349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
959349cc55cSDimitry Andric                                 FeatureRCPC, FeaturePerfMon, FeatureSPE,
960349cc55cSDimitry Andric                                 FeatureSSBS];
961349cc55cSDimitry Andric  list<SubtargetFeature> A78C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
962349cc55cSDimitry Andric                                 FeatureNEON, FeatureFullFP16, FeatureDotProd,
963349cc55cSDimitry Andric                                 FeatureFlagM, FeatureFP16FML, FeaturePAuth,
964349cc55cSDimitry Andric                                 FeaturePerfMon, FeatureRCPC, FeatureSPE,
965349cc55cSDimitry Andric                                 FeatureSSBS];
966349cc55cSDimitry Andric  list<SubtargetFeature> A710 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
967349cc55cSDimitry Andric                                 FeatureETE, FeatureMTE, FeatureFP16FML,
968349cc55cSDimitry Andric                                 FeatureSVE2BitPerm, FeatureBF16, FeatureMatMulInt8];
96904eeddc0SDimitry Andric  list<SubtargetFeature> R82  = [HasV8_0rOps, FeaturePerfMon, FeatureFullFP16,
97004eeddc0SDimitry Andric                                 FeatureFP16FML, FeatureSSBS, FeaturePredRes,
97104eeddc0SDimitry Andric                                 FeatureSB, FeatureSpecRestrict];
972349cc55cSDimitry Andric  list<SubtargetFeature> X1   = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
973349cc55cSDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
974349cc55cSDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd];
975*1fd87a68SDimitry Andric  list<SubtargetFeature> X1C  = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
976*1fd87a68SDimitry Andric                                 FeatureNEON, FeatureRCPC, FeaturePerfMon,
977*1fd87a68SDimitry Andric                                 FeatureSPE, FeatureFullFP16, FeatureDotProd,
978*1fd87a68SDimitry Andric                                 FeaturePAuth];
979349cc55cSDimitry Andric  list<SubtargetFeature> X2   = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
980349cc55cSDimitry Andric                                 FeatureMatMulInt8, FeatureBF16, FeatureAM,
981349cc55cSDimitry Andric                                 FeatureMTE, FeatureETE, FeatureSVE2BitPerm,
982349cc55cSDimitry Andric                                 FeatureFP16FML];
983349cc55cSDimitry Andric  list<SubtargetFeature> A64FX    = [HasV8_2aOps, FeatureFPARMv8, FeatureNEON,
984349cc55cSDimitry Andric                                     FeatureSHA2, FeaturePerfMon, FeatureFullFP16,
985349cc55cSDimitry Andric                                     FeatureSVE, FeatureComplxNum];
986349cc55cSDimitry Andric  list<SubtargetFeature> Carmel   = [HasV8_2aOps, FeatureNEON, FeatureCrypto,
987349cc55cSDimitry Andric                                     FeatureFullFP16];
988349cc55cSDimitry Andric  list<SubtargetFeature> AppleA7  = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
989349cc55cSDimitry Andric                                     FeatureNEON,FeaturePerfMon, FeatureAppleA7SysReg];
990349cc55cSDimitry Andric  list<SubtargetFeature> AppleA10 = [HasV8_0aOps, FeatureCrypto, FeatureFPARMv8,
991349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureCRC,
992349cc55cSDimitry Andric                                     FeatureRDM, FeaturePAN, FeatureLOR, FeatureVH];
993349cc55cSDimitry Andric  list<SubtargetFeature> AppleA11 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
994349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
995349cc55cSDimitry Andric  list<SubtargetFeature> AppleA12 = [HasV8_3aOps, FeatureCrypto, FeatureFPARMv8,
996349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16];
997349cc55cSDimitry Andric  list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
998349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFullFP16,
999349cc55cSDimitry Andric                                     FeatureFP16FML, FeatureSHA3];
1000349cc55cSDimitry Andric  list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1001349cc55cSDimitry Andric                                     FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
1002349cc55cSDimitry Andric                                     FeatureSpecRestrict, FeatureSSBS, FeatureSB,
1003349cc55cSDimitry Andric                                     FeaturePredRes, FeatureCacheDeepPersist,
1004349cc55cSDimitry Andric                                     FeatureFullFP16, FeatureFP16FML, FeatureSHA3,
1005349cc55cSDimitry Andric                                     FeatureAltFPCmp];
1006349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM3 = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1007349cc55cSDimitry Andric                                     FeaturePerfMon];
1008349cc55cSDimitry Andric  list<SubtargetFeature> ExynosM4 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1009349cc55cSDimitry Andric                                     FeatureFullFP16, FeaturePerfMon];
1010349cc55cSDimitry Andric  list<SubtargetFeature> Falkor   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1011349cc55cSDimitry Andric                                     FeatureFPARMv8, FeatureNEON, FeaturePerfMon,
1012349cc55cSDimitry Andric                                     FeatureRDM];
1013349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseE1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1014349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
1015349cc55cSDimitry Andric                                       FeatureRCPC, FeatureSSBS];
1016349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN1 = [HasV8_2aOps, FeatureCrypto, FeatureDotProd,
1017349cc55cSDimitry Andric                                       FeatureFPARMv8, FeatureFullFP16, FeatureNEON,
1018349cc55cSDimitry Andric                                       FeatureRCPC, FeatureSPE, FeatureSSBS];
1019349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseN2 = [HasV8_5aOps, FeatureBF16, FeatureETE,
1020349cc55cSDimitry Andric                                       FeatureMatMulInt8, FeatureMTE, FeatureSVE2,
1021349cc55cSDimitry Andric                                       FeatureSVE2BitPerm, FeatureTRBE, FeatureCrypto];
1022349cc55cSDimitry Andric  list<SubtargetFeature> Neoverse512TVB = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1023349cc55cSDimitry Andric                                           FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1024349cc55cSDimitry Andric                                           FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1025349cc55cSDimitry Andric                                           FeaturePerfMon, FeatureRandGen, FeatureSPE,
1026349cc55cSDimitry Andric                                           FeatureSSBS, FeatureSVE];
1027349cc55cSDimitry Andric  list<SubtargetFeature> NeoverseV1 = [HasV8_4aOps, FeatureBF16, FeatureCacheDeepPersist,
1028349cc55cSDimitry Andric                                       FeatureCrypto, FeatureFPARMv8, FeatureFP16FML,
1029349cc55cSDimitry Andric                                       FeatureFullFP16, FeatureMatMulInt8, FeatureNEON,
1030349cc55cSDimitry Andric                                       FeaturePerfMon, FeatureRandGen, FeatureSPE,
1031349cc55cSDimitry Andric                                       FeatureSSBS, FeatureSVE];
1032349cc55cSDimitry Andric  list<SubtargetFeature> Saphira    = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
1033349cc55cSDimitry Andric                                       FeatureNEON, FeatureSPE, FeaturePerfMon];
1034349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX   = [HasV8_0aOps, FeatureCRC, FeatureCrypto,
1035349cc55cSDimitry Andric                                       FeatureFPARMv8, FeaturePerfMon, FeatureNEON];
1036349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX2T99  = [HasV8_1aOps, FeatureCRC, FeatureCrypto,
1037349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE];
1038349cc55cSDimitry Andric  list<SubtargetFeature> ThunderX3T110 = [HasV8_3aOps, FeatureCRC, FeatureCrypto,
1039349cc55cSDimitry Andric                                          FeatureFPARMv8, FeatureNEON, FeatureLSE,
1040349cc55cSDimitry Andric                                          FeaturePAuth, FeaturePerfMon];
1041349cc55cSDimitry Andric  list<SubtargetFeature> TSV110 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
1042349cc55cSDimitry Andric                                   FeatureNEON, FeaturePerfMon, FeatureSPE,
1043349cc55cSDimitry Andric                                   FeatureFullFP16, FeatureFP16FML, FeatureDotProd];
1044349cc55cSDimitry Andric
10455ffd83dbSDimitry Andric  // ETE and TRBE are future architecture extensions. We temporarily enable them
1046349cc55cSDimitry Andric  // by default for users targeting generic AArch64. The extensions do not
10478bcb0991SDimitry Andric  // affect code generated by the compiler and can be used only by explicitly
10488bcb0991SDimitry Andric  // mentioning the new system register names in assembly.
1049349cc55cSDimitry Andric  list<SubtargetFeature> Generic = [FeatureFPARMv8, FeatureNEON, FeaturePerfMon, FeatureETE];
1050349cc55cSDimitry Andric}
10510b57cec5SDimitry Andric
1052349cc55cSDimitry Andric
1053349cc55cSDimitry Andricdef : ProcessorModel<"generic", CortexA55Model, ProcessorFeatures.Generic,
1054349cc55cSDimitry Andric                     [FeatureFuseAES, FeaturePostRAScheduler]>;
1055349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, ProcessorFeatures.A53,
1056349cc55cSDimitry Andric                     [TuneA35]>;
1057349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a34", CortexA53Model, ProcessorFeatures.A53,
1058349cc55cSDimitry Andric                     [TuneA35]>;
1059349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, ProcessorFeatures.A53,
1060349cc55cSDimitry Andric                     [TuneA53]>;
1061349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA55Model, ProcessorFeatures.A55,
1062349cc55cSDimitry Andric                     [TuneA55]>;
1063349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a510", CortexA55Model, ProcessorFeatures.A510,
1064349cc55cSDimitry Andric                     [TuneA510]>;
1065349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, ProcessorFeatures.A53,
1066349cc55cSDimitry Andric                     [TuneA57]>;
1067349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65", CortexA53Model, ProcessorFeatures.A65,
1068349cc55cSDimitry Andric                     [TuneA65]>;
1069349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a65ae", CortexA53Model, ProcessorFeatures.A65,
1070349cc55cSDimitry Andric                     [TuneA65]>;
1071349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, ProcessorFeatures.A53,
1072349cc55cSDimitry Andric                     [TuneA72]>;
1073349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, ProcessorFeatures.A53,
1074349cc55cSDimitry Andric                     [TuneA73]>;
1075349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, ProcessorFeatures.A55,
1076349cc55cSDimitry Andric                     [TuneA75]>;
1077349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, ProcessorFeatures.A76,
1078349cc55cSDimitry Andric                     [TuneA76]>;
1079349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, ProcessorFeatures.A76,
1080349cc55cSDimitry Andric                     [TuneA76]>;
1081349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a77", CortexA57Model, ProcessorFeatures.A77,
1082349cc55cSDimitry Andric                     [TuneA77]>;
1083349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78", CortexA57Model, ProcessorFeatures.A78,
1084349cc55cSDimitry Andric                     [TuneA78]>;
1085349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a78c", CortexA57Model, ProcessorFeatures.A78C,
1086349cc55cSDimitry Andric                     [TuneA78C]>;
1087349cc55cSDimitry Andricdef : ProcessorModel<"cortex-a710", CortexA57Model, ProcessorFeatures.A710,
1088349cc55cSDimitry Andric                     [TuneA710]>;
1089349cc55cSDimitry Andricdef : ProcessorModel<"cortex-r82", CortexA55Model, ProcessorFeatures.R82,
1090349cc55cSDimitry Andric                     [TuneR82]>;
1091349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x1", CortexA57Model, ProcessorFeatures.X1,
1092349cc55cSDimitry Andric                     [TuneX1]>;
1093*1fd87a68SDimitry Andricdef : ProcessorModel<"cortex-x1c", CortexA57Model, ProcessorFeatures.X1C,
1094*1fd87a68SDimitry Andric                     [TuneX1]>;
1095349cc55cSDimitry Andricdef : ProcessorModel<"cortex-x2", CortexA57Model, ProcessorFeatures.X2,
1096349cc55cSDimitry Andric                     [TuneX2]>;
1097349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-e1", CortexA53Model,
1098349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseE1, [TuneNeoverseE1]>;
1099349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-n1", CortexA57Model,
1100349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN1, [TuneNeoverseN1]>;
1101349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-n2", CortexA57Model,
1102349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseN2, [TuneNeoverseN2]>;
1103349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-512tvb", CortexA57Model,
1104349cc55cSDimitry Andric                     ProcessorFeatures.Neoverse512TVB, [TuneNeoverse512TVB]>;
1105349cc55cSDimitry Andricdef : ProcessorModel<"neoverse-v1", CortexA57Model,
1106349cc55cSDimitry Andric                     ProcessorFeatures.NeoverseV1, [TuneNeoverseV1]>;
1107349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, ProcessorFeatures.ExynosM3,
1108349cc55cSDimitry Andric                     [TuneExynosM3]>;
1109349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, ProcessorFeatures.ExynosM4,
1110349cc55cSDimitry Andric                     [TuneExynosM4]>;
1111349cc55cSDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM5Model, ProcessorFeatures.ExynosM4,
1112349cc55cSDimitry Andric                     [TuneExynosM4]>;
1113349cc55cSDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, ProcessorFeatures.Falkor,
1114349cc55cSDimitry Andric                     [TuneFalkor]>;
1115349cc55cSDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, ProcessorFeatures.Saphira,
1116349cc55cSDimitry Andric                     [TuneSaphira]>;
1117349cc55cSDimitry Andricdef : ProcessorModel<"kryo", KryoModel, ProcessorFeatures.A53, [TuneKryo]>;
1118349cc55cSDimitry Andric
11190b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
1120349cc55cSDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  ProcessorFeatures.ThunderX,
1121349cc55cSDimitry Andric                     [TuneThunderX]>;
1122349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,
1123349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT88]>;
1124349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,
1125349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT81]>;
1126349cc55cSDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,
1127349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX, [TuneThunderXT83]>;
11280b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
1129349cc55cSDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model,
1130349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX2T99, [TuneThunderX2T99]>;
1131e837bb5cSDimitry Andric// Marvell ThunderX3T110 Processors.
1132349cc55cSDimitry Andricdef : ProcessorModel<"thunderx3t110", ThunderX3T110Model,
1133349cc55cSDimitry Andric                     ProcessorFeatures.ThunderX3T110, [TuneThunderX3T110]>;
1134349cc55cSDimitry Andricdef : ProcessorModel<"tsv110", TSV110Model, ProcessorFeatures.TSV110,
1135349cc55cSDimitry Andric                     [TuneTSV110]>;
11360b57cec5SDimitry Andric
1137480093f4SDimitry Andric// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
1138349cc55cSDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
1139349cc55cSDimitry Andric                     [TuneAppleA7]>;
1140480093f4SDimitry Andric
1141480093f4SDimitry Andric// iPhone and iPad CPUs
1142349cc55cSDimitry Andricdef : ProcessorModel<"apple-a7", CycloneModel, ProcessorFeatures.AppleA7,
1143349cc55cSDimitry Andric                     [TuneAppleA7]>;
1144349cc55cSDimitry Andricdef : ProcessorModel<"apple-a8", CycloneModel, ProcessorFeatures.AppleA7,
1145349cc55cSDimitry Andric                     [TuneAppleA7]>;
1146349cc55cSDimitry Andricdef : ProcessorModel<"apple-a9", CycloneModel, ProcessorFeatures.AppleA7,
1147349cc55cSDimitry Andric                     [TuneAppleA7]>;
1148349cc55cSDimitry Andricdef : ProcessorModel<"apple-a10", CycloneModel, ProcessorFeatures.AppleA10,
1149349cc55cSDimitry Andric                     [TuneAppleA10]>;
1150349cc55cSDimitry Andricdef : ProcessorModel<"apple-a11", CycloneModel, ProcessorFeatures.AppleA11,
1151349cc55cSDimitry Andric                     [TuneAppleA11]>;
1152349cc55cSDimitry Andricdef : ProcessorModel<"apple-a12", CycloneModel, ProcessorFeatures.AppleA12,
1153349cc55cSDimitry Andric                     [TuneAppleA12]>;
1154349cc55cSDimitry Andricdef : ProcessorModel<"apple-a13", CycloneModel, ProcessorFeatures.AppleA13,
1155349cc55cSDimitry Andric                     [TuneAppleA13]>;
1156349cc55cSDimitry Andricdef : ProcessorModel<"apple-a14", CycloneModel, ProcessorFeatures.AppleA14,
1157349cc55cSDimitry Andric                     [TuneAppleA14]>;
1158480093f4SDimitry Andric
1159fe6060f1SDimitry Andric// Mac CPUs
1160349cc55cSDimitry Andricdef : ProcessorModel<"apple-m1", CycloneModel, ProcessorFeatures.AppleA14,
1161349cc55cSDimitry Andric                     [TuneAppleA14]>;
1162fe6060f1SDimitry Andric
1163480093f4SDimitry Andric// watch CPUs.
1164349cc55cSDimitry Andricdef : ProcessorModel<"apple-s4", CycloneModel, ProcessorFeatures.AppleA12,
1165349cc55cSDimitry Andric                     [TuneAppleA12]>;
1166349cc55cSDimitry Andricdef : ProcessorModel<"apple-s5", CycloneModel, ProcessorFeatures.AppleA12,
1167349cc55cSDimitry Andric                     [TuneAppleA12]>;
1168480093f4SDimitry Andric
11690b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
1170349cc55cSDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, ProcessorFeatures.AppleA14,
1171349cc55cSDimitry Andric                     [TuneAppleA14]>;
11720b57cec5SDimitry Andric
11735ffd83dbSDimitry Andric// Fujitsu A64FX
1174349cc55cSDimitry Andricdef : ProcessorModel<"a64fx", A64FXModel, ProcessorFeatures.A64FX,
1175349cc55cSDimitry Andric                     [TuneA64FX]>;
11765ffd83dbSDimitry Andric
11775ffd83dbSDimitry Andric// Nvidia Carmel
1178349cc55cSDimitry Andricdef : ProcessorModel<"carmel", NoSchedModel, ProcessorFeatures.Carmel,
1179349cc55cSDimitry Andric                     [TuneCarmel]>;
11805ffd83dbSDimitry Andric
11810b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
11820b57cec5SDimitry Andric// Assembly parser
11830b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
11840b57cec5SDimitry Andric
11850b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
11860b57cec5SDimitry Andric  int Variant = 0;
11870b57cec5SDimitry Andric  string Name = "generic";
11880b57cec5SDimitry Andric  string BreakCharacters = ".";
11890b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
11900b57cec5SDimitry Andric}
11910b57cec5SDimitry Andric
11920b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
11930b57cec5SDimitry Andric  int Variant = 1;
11940b57cec5SDimitry Andric  string Name = "apple-neon";
11950b57cec5SDimitry Andric  string BreakCharacters = ".";
11960b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
11970b57cec5SDimitry Andric}
11980b57cec5SDimitry Andric
11990b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12000b57cec5SDimitry Andric// Assembly printer
12010b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12020b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
12030b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
12040b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
12050b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
12060b57cec5SDimitry Andric  int PassSubtarget = 1;
12070b57cec5SDimitry Andric  int Variant = 0;
12080b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
12090b57cec5SDimitry Andric}
12100b57cec5SDimitry Andric
12110b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
12120b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
12130b57cec5SDimitry Andric  int PassSubtarget = 1;
12140b57cec5SDimitry Andric  int Variant = 1;
12150b57cec5SDimitry Andric  int isMCAsmWriter = 1;
12160b57cec5SDimitry Andric}
12170b57cec5SDimitry Andric
12180b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12190b57cec5SDimitry Andric// Target Declaration
12200b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12210b57cec5SDimitry Andric
12220b57cec5SDimitry Andricdef AArch64 : Target {
12230b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
12240b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
12250b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
12260b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
12270b57cec5SDimitry Andric}
12280b57cec5SDimitry Andric
12290b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12300b57cec5SDimitry Andric// Pfm Counters
12310b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12320b57cec5SDimitry Andric
12330b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
1234