xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64.td (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric//=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
2*0b57cec5SDimitry Andric//
3*0b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric//
7*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric//
9*0b57cec5SDimitry Andric//
10*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
11*0b57cec5SDimitry Andric
12*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
13*0b57cec5SDimitry Andric// Target-independent interfaces which we are implementing.
14*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
15*0b57cec5SDimitry Andric
16*0b57cec5SDimitry Andricinclude "llvm/Target/Target.td"
17*0b57cec5SDimitry Andric
18*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
19*0b57cec5SDimitry Andric// AArch64 Subtarget features.
20*0b57cec5SDimitry Andric//
21*0b57cec5SDimitry Andric
22*0b57cec5SDimitry Andricdef FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
23*0b57cec5SDimitry Andric                                       "Enable ARMv8 FP">;
24*0b57cec5SDimitry Andric
25*0b57cec5SDimitry Andricdef FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
26*0b57cec5SDimitry Andric  "Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
27*0b57cec5SDimitry Andric
28*0b57cec5SDimitry Andricdef FeatureSM4 : SubtargetFeature<
29*0b57cec5SDimitry Andric    "sm4", "HasSM4", "true",
30*0b57cec5SDimitry Andric    "Enable SM3 and SM4 support", [FeatureNEON]>;
31*0b57cec5SDimitry Andric
32*0b57cec5SDimitry Andricdef FeatureSHA2 : SubtargetFeature<
33*0b57cec5SDimitry Andric    "sha2", "HasSHA2", "true",
34*0b57cec5SDimitry Andric    "Enable SHA1 and SHA256 support", [FeatureNEON]>;
35*0b57cec5SDimitry Andric
36*0b57cec5SDimitry Andricdef FeatureSHA3 : SubtargetFeature<
37*0b57cec5SDimitry Andric    "sha3", "HasSHA3", "true",
38*0b57cec5SDimitry Andric    "Enable SHA512 and SHA3 support", [FeatureNEON, FeatureSHA2]>;
39*0b57cec5SDimitry Andric
40*0b57cec5SDimitry Andricdef FeatureAES : SubtargetFeature<
41*0b57cec5SDimitry Andric    "aes", "HasAES", "true",
42*0b57cec5SDimitry Andric    "Enable AES support", [FeatureNEON]>;
43*0b57cec5SDimitry Andric
44*0b57cec5SDimitry Andric// Crypto has been split up and any combination is now valid (see the
45*0b57cec5SDimitry Andric// crypto defintions above). Also, crypto is now context sensitive:
46*0b57cec5SDimitry Andric// it has a different meaning for e.g. Armv8.4 than it has for Armv8.2.
47*0b57cec5SDimitry Andric// Therefore, we rely on Clang, the user interacing tool, to pass on the
48*0b57cec5SDimitry Andric// appropriate crypto options. But here in the backend, crypto has very little
49*0b57cec5SDimitry Andric// meaning anymore. We kept the Crypto defintion here for backward
50*0b57cec5SDimitry Andric// compatibility, and now imply features SHA2 and AES, which was the
51*0b57cec5SDimitry Andric// "traditional" meaning of Crypto.
52*0b57cec5SDimitry Andricdef FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
53*0b57cec5SDimitry Andric  "Enable cryptographic instructions", [FeatureNEON, FeatureSHA2, FeatureAES]>;
54*0b57cec5SDimitry Andric
55*0b57cec5SDimitry Andricdef FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
56*0b57cec5SDimitry Andric  "Enable ARMv8 CRC-32 checksum instructions">;
57*0b57cec5SDimitry Andric
58*0b57cec5SDimitry Andricdef FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
59*0b57cec5SDimitry Andric  "Enable ARMv8 Reliability, Availability and Serviceability Extensions">;
60*0b57cec5SDimitry Andric
61*0b57cec5SDimitry Andricdef FeatureLSE : SubtargetFeature<"lse", "HasLSE", "true",
62*0b57cec5SDimitry Andric  "Enable ARMv8.1 Large System Extension (LSE) atomic instructions">;
63*0b57cec5SDimitry Andric
64*0b57cec5SDimitry Andricdef FeatureRDM : SubtargetFeature<"rdm", "HasRDM", "true",
65*0b57cec5SDimitry Andric  "Enable ARMv8.1 Rounding Double Multiply Add/Subtract instructions">;
66*0b57cec5SDimitry Andric
67*0b57cec5SDimitry Andricdef FeaturePAN : SubtargetFeature<
68*0b57cec5SDimitry Andric    "pan", "HasPAN", "true",
69*0b57cec5SDimitry Andric    "Enables ARM v8.1 Privileged Access-Never extension">;
70*0b57cec5SDimitry Andric
71*0b57cec5SDimitry Andricdef FeatureLOR : SubtargetFeature<
72*0b57cec5SDimitry Andric    "lor", "HasLOR", "true",
73*0b57cec5SDimitry Andric    "Enables ARM v8.1 Limited Ordering Regions extension">;
74*0b57cec5SDimitry Andric
75*0b57cec5SDimitry Andricdef FeatureVH : SubtargetFeature<
76*0b57cec5SDimitry Andric    "vh", "HasVH", "true",
77*0b57cec5SDimitry Andric    "Enables ARM v8.1 Virtual Host extension">;
78*0b57cec5SDimitry Andric
79*0b57cec5SDimitry Andricdef FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
80*0b57cec5SDimitry Andric  "Enable ARMv8 PMUv3 Performance Monitors extension">;
81*0b57cec5SDimitry Andric
82*0b57cec5SDimitry Andricdef FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
83*0b57cec5SDimitry Andric  "Full FP16", [FeatureFPARMv8]>;
84*0b57cec5SDimitry Andric
85*0b57cec5SDimitry Andricdef FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
86*0b57cec5SDimitry Andric  "Enable FP16 FML instructions", [FeatureFullFP16]>;
87*0b57cec5SDimitry Andric
88*0b57cec5SDimitry Andricdef FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
89*0b57cec5SDimitry Andric  "Enable Statistical Profiling extension">;
90*0b57cec5SDimitry Andric
91*0b57cec5SDimitry Andricdef FeaturePAN_RWV : SubtargetFeature<
92*0b57cec5SDimitry Andric    "pan-rwv", "HasPAN_RWV", "true",
93*0b57cec5SDimitry Andric    "Enable v8.2 PAN s1e1R and s1e1W Variants",
94*0b57cec5SDimitry Andric    [FeaturePAN]>;
95*0b57cec5SDimitry Andric
96*0b57cec5SDimitry Andric// UAO PState
97*0b57cec5SDimitry Andricdef FeaturePsUAO : SubtargetFeature< "uaops", "HasPsUAO", "true",
98*0b57cec5SDimitry Andric    "Enable v8.2 UAO PState">;
99*0b57cec5SDimitry Andric
100*0b57cec5SDimitry Andricdef FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
101*0b57cec5SDimitry Andric    "true", "Enable v8.2 data Cache Clean to Point of Persistence" >;
102*0b57cec5SDimitry Andric
103*0b57cec5SDimitry Andricdef FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
104*0b57cec5SDimitry Andric  "Enable Scalable Vector Extension (SVE) instructions">;
105*0b57cec5SDimitry Andric
106*0b57cec5SDimitry Andricdef FeatureSVE2 : SubtargetFeature<"sve2", "HasSVE2", "true",
107*0b57cec5SDimitry Andric  "Enable Scalable Vector Extension 2 (SVE2) instructions", [FeatureSVE]>;
108*0b57cec5SDimitry Andric
109*0b57cec5SDimitry Andricdef FeatureSVE2AES : SubtargetFeature<"sve2-aes", "HasSVE2AES", "true",
110*0b57cec5SDimitry Andric  "Enable AES SVE2 instructions", [FeatureSVE2, FeatureAES]>;
111*0b57cec5SDimitry Andric
112*0b57cec5SDimitry Andricdef FeatureSVE2SM4 : SubtargetFeature<"sve2-sm4", "HasSVE2SM4", "true",
113*0b57cec5SDimitry Andric  "Enable SM4 SVE2 instructions", [FeatureSVE2, FeatureSM4]>;
114*0b57cec5SDimitry Andric
115*0b57cec5SDimitry Andricdef FeatureSVE2SHA3 : SubtargetFeature<"sve2-sha3", "HasSVE2SHA3", "true",
116*0b57cec5SDimitry Andric  "Enable SHA3 SVE2 instructions", [FeatureSVE2, FeatureSHA3]>;
117*0b57cec5SDimitry Andric
118*0b57cec5SDimitry Andricdef FeatureSVE2BitPerm : SubtargetFeature<"sve2-bitperm", "HasSVE2BitPerm", "true",
119*0b57cec5SDimitry Andric  "Enable bit permutation SVE2 instructions", [FeatureSVE2]>;
120*0b57cec5SDimitry Andric
121*0b57cec5SDimitry Andricdef FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
122*0b57cec5SDimitry Andric                                        "Has zero-cycle register moves">;
123*0b57cec5SDimitry Andricdef FeatureZCZeroingGP : SubtargetFeature<"zcz-gp", "HasZeroCycleZeroingGP", "true",
124*0b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for generic registers">;
125*0b57cec5SDimitry Andric
126*0b57cec5SDimitry Andricdef FeatureZCZeroingFP : SubtargetFeature<"zcz-fp", "HasZeroCycleZeroingFP", "true",
127*0b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions for FP registers">;
128*0b57cec5SDimitry Andric
129*0b57cec5SDimitry Andricdef FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
130*0b57cec5SDimitry Andric                                        "Has zero-cycle zeroing instructions",
131*0b57cec5SDimitry Andric                                        [FeatureZCZeroingGP, FeatureZCZeroingFP]>;
132*0b57cec5SDimitry Andric
133*0b57cec5SDimitry Andric/// ... but the floating-point version doesn't quite work in rare cases on older
134*0b57cec5SDimitry Andric/// CPUs.
135*0b57cec5SDimitry Andricdef FeatureZCZeroingFPWorkaround : SubtargetFeature<"zcz-fp-workaround",
136*0b57cec5SDimitry Andric    "HasZeroCycleZeroingFPWorkaround", "true",
137*0b57cec5SDimitry Andric    "The zero-cycle floating-point zeroing instruction has a bug">;
138*0b57cec5SDimitry Andric
139*0b57cec5SDimitry Andricdef FeatureStrictAlign : SubtargetFeature<"strict-align",
140*0b57cec5SDimitry Andric                                          "StrictAlign", "true",
141*0b57cec5SDimitry Andric                                          "Disallow all unaligned memory "
142*0b57cec5SDimitry Andric                                          "access">;
143*0b57cec5SDimitry Andric
144*0b57cec5SDimitry Andricforeach i = {1-7,9-15,18,20-28} in
145*0b57cec5SDimitry Andric    def FeatureReserveX#i : SubtargetFeature<"reserve-x"#i, "ReserveXRegister["#i#"]", "true",
146*0b57cec5SDimitry Andric                                             "Reserve X"#i#", making it unavailable "
147*0b57cec5SDimitry Andric                                             "as a GPR">;
148*0b57cec5SDimitry Andric
149*0b57cec5SDimitry Andricforeach i = {8-15,18} in
150*0b57cec5SDimitry Andric    def FeatureCallSavedX#i : SubtargetFeature<"call-saved-x"#i,
151*0b57cec5SDimitry Andric         "CustomCallSavedXRegs["#i#"]", "true", "Make X"#i#" callee saved.">;
152*0b57cec5SDimitry Andric
153*0b57cec5SDimitry Andricdef FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
154*0b57cec5SDimitry Andric                                    "Use alias analysis during codegen">;
155*0b57cec5SDimitry Andric
156*0b57cec5SDimitry Andricdef FeatureBalanceFPOps : SubtargetFeature<"balance-fp-ops", "BalanceFPOps",
157*0b57cec5SDimitry Andric    "true",
158*0b57cec5SDimitry Andric    "balance mix of odd and even D-registers for fp multiply(-accumulate) ops">;
159*0b57cec5SDimitry Andric
160*0b57cec5SDimitry Andricdef FeaturePredictableSelectIsExpensive : SubtargetFeature<
161*0b57cec5SDimitry Andric    "predictable-select-expensive", "PredictableSelectIsExpensive", "true",
162*0b57cec5SDimitry Andric    "Prefer likely predicted branches over selects">;
163*0b57cec5SDimitry Andric
164*0b57cec5SDimitry Andricdef FeatureCustomCheapAsMoveHandling : SubtargetFeature<"custom-cheap-as-move",
165*0b57cec5SDimitry Andric    "CustomAsCheapAsMove", "true",
166*0b57cec5SDimitry Andric    "Use custom handling of cheap instructions">;
167*0b57cec5SDimitry Andric
168*0b57cec5SDimitry Andricdef FeatureExynosCheapAsMoveHandling : SubtargetFeature<"exynos-cheap-as-move",
169*0b57cec5SDimitry Andric    "ExynosAsCheapAsMove", "true",
170*0b57cec5SDimitry Andric    "Use Exynos specific handling of cheap instructions",
171*0b57cec5SDimitry Andric    [FeatureCustomCheapAsMoveHandling]>;
172*0b57cec5SDimitry Andric
173*0b57cec5SDimitry Andricdef FeaturePostRAScheduler : SubtargetFeature<"use-postra-scheduler",
174*0b57cec5SDimitry Andric    "UsePostRAScheduler", "true", "Schedule again after register allocation">;
175*0b57cec5SDimitry Andric
176*0b57cec5SDimitry Andricdef FeatureSlowMisaligned128Store : SubtargetFeature<"slow-misaligned-128store",
177*0b57cec5SDimitry Andric    "Misaligned128StoreIsSlow", "true", "Misaligned 128 bit stores are slow">;
178*0b57cec5SDimitry Andric
179*0b57cec5SDimitry Andricdef FeatureSlowPaired128 : SubtargetFeature<"slow-paired-128",
180*0b57cec5SDimitry Andric    "Paired128IsSlow", "true", "Paired 128 bit loads and stores are slow">;
181*0b57cec5SDimitry Andric
182*0b57cec5SDimitry Andricdef FeatureSlowSTRQro : SubtargetFeature<"slow-strqro-store", "STRQroIsSlow",
183*0b57cec5SDimitry Andric    "true", "STR of Q register with register offset is slow">;
184*0b57cec5SDimitry Andric
185*0b57cec5SDimitry Andricdef FeatureAlternateSExtLoadCVTF32Pattern : SubtargetFeature<
186*0b57cec5SDimitry Andric    "alternate-sextload-cvt-f32-pattern", "UseAlternateSExtLoadCVTF32Pattern",
187*0b57cec5SDimitry Andric    "true", "Use alternative pattern for sextload convert to f32">;
188*0b57cec5SDimitry Andric
189*0b57cec5SDimitry Andricdef FeatureArithmeticBccFusion : SubtargetFeature<
190*0b57cec5SDimitry Andric    "arith-bcc-fusion", "HasArithmeticBccFusion", "true",
191*0b57cec5SDimitry Andric    "CPU fuses arithmetic+bcc operations">;
192*0b57cec5SDimitry Andric
193*0b57cec5SDimitry Andricdef FeatureArithmeticCbzFusion : SubtargetFeature<
194*0b57cec5SDimitry Andric    "arith-cbz-fusion", "HasArithmeticCbzFusion", "true",
195*0b57cec5SDimitry Andric    "CPU fuses arithmetic + cbz/cbnz operations">;
196*0b57cec5SDimitry Andric
197*0b57cec5SDimitry Andricdef FeatureFuseAddress : SubtargetFeature<
198*0b57cec5SDimitry Andric    "fuse-address", "HasFuseAddress", "true",
199*0b57cec5SDimitry Andric    "CPU fuses address generation and memory operations">;
200*0b57cec5SDimitry Andric
201*0b57cec5SDimitry Andricdef FeatureFuseAES : SubtargetFeature<
202*0b57cec5SDimitry Andric    "fuse-aes", "HasFuseAES", "true",
203*0b57cec5SDimitry Andric    "CPU fuses AES crypto operations">;
204*0b57cec5SDimitry Andric
205*0b57cec5SDimitry Andricdef FeatureFuseArithmeticLogic : SubtargetFeature<
206*0b57cec5SDimitry Andric    "fuse-arith-logic", "HasFuseArithmeticLogic", "true",
207*0b57cec5SDimitry Andric    "CPU fuses arithmetic and logic operations">;
208*0b57cec5SDimitry Andric
209*0b57cec5SDimitry Andricdef FeatureFuseCCSelect : SubtargetFeature<
210*0b57cec5SDimitry Andric    "fuse-csel", "HasFuseCCSelect", "true",
211*0b57cec5SDimitry Andric    "CPU fuses conditional select operations">;
212*0b57cec5SDimitry Andric
213*0b57cec5SDimitry Andricdef FeatureFuseCryptoEOR : SubtargetFeature<
214*0b57cec5SDimitry Andric    "fuse-crypto-eor", "HasFuseCryptoEOR", "true",
215*0b57cec5SDimitry Andric    "CPU fuses AES/PMULL and EOR operations">;
216*0b57cec5SDimitry Andric
217*0b57cec5SDimitry Andricdef FeatureFuseLiterals : SubtargetFeature<
218*0b57cec5SDimitry Andric    "fuse-literals", "HasFuseLiterals", "true",
219*0b57cec5SDimitry Andric    "CPU fuses literal generation operations">;
220*0b57cec5SDimitry Andric
221*0b57cec5SDimitry Andricdef FeatureDisableLatencySchedHeuristic : SubtargetFeature<
222*0b57cec5SDimitry Andric    "disable-latency-sched-heuristic", "DisableLatencySchedHeuristic", "true",
223*0b57cec5SDimitry Andric    "Disable latency scheduling heuristic">;
224*0b57cec5SDimitry Andric
225*0b57cec5SDimitry Andricdef FeatureForce32BitJumpTables
226*0b57cec5SDimitry Andric   : SubtargetFeature<"force-32bit-jump-tables", "Force32BitJumpTables", "true",
227*0b57cec5SDimitry Andric                      "Force jump table entries to be 32-bits wide except at MinSize">;
228*0b57cec5SDimitry Andric
229*0b57cec5SDimitry Andricdef FeatureRCPC : SubtargetFeature<"rcpc", "HasRCPC", "true",
230*0b57cec5SDimitry Andric                                   "Enable support for RCPC extension">;
231*0b57cec5SDimitry Andric
232*0b57cec5SDimitry Andricdef FeatureUseRSqrt : SubtargetFeature<
233*0b57cec5SDimitry Andric    "use-reciprocal-square-root", "UseRSqrt", "true",
234*0b57cec5SDimitry Andric    "Use the reciprocal square root approximation">;
235*0b57cec5SDimitry Andric
236*0b57cec5SDimitry Andricdef FeatureDotProd : SubtargetFeature<
237*0b57cec5SDimitry Andric    "dotprod", "HasDotProd", "true",
238*0b57cec5SDimitry Andric    "Enable dot product support">;
239*0b57cec5SDimitry Andric
240*0b57cec5SDimitry Andricdef FeaturePA : SubtargetFeature<
241*0b57cec5SDimitry Andric    "pa", "HasPA", "true",
242*0b57cec5SDimitry Andric    "Enable v8.3-A Pointer Authentication enchancement">;
243*0b57cec5SDimitry Andric
244*0b57cec5SDimitry Andricdef FeatureJS : SubtargetFeature<
245*0b57cec5SDimitry Andric    "jsconv", "HasJS", "true",
246*0b57cec5SDimitry Andric    "Enable v8.3-A JavaScript FP conversion enchancement",
247*0b57cec5SDimitry Andric    [FeatureFPARMv8]>;
248*0b57cec5SDimitry Andric
249*0b57cec5SDimitry Andricdef FeatureCCIDX : SubtargetFeature<
250*0b57cec5SDimitry Andric    "ccidx", "HasCCIDX", "true",
251*0b57cec5SDimitry Andric    "Enable v8.3-A Extend of the CCSIDR number of sets">;
252*0b57cec5SDimitry Andric
253*0b57cec5SDimitry Andricdef FeatureComplxNum : SubtargetFeature<
254*0b57cec5SDimitry Andric    "complxnum", "HasComplxNum", "true",
255*0b57cec5SDimitry Andric    "Enable v8.3-A Floating-point complex number support",
256*0b57cec5SDimitry Andric    [FeatureNEON]>;
257*0b57cec5SDimitry Andric
258*0b57cec5SDimitry Andricdef FeatureNV : SubtargetFeature<
259*0b57cec5SDimitry Andric    "nv", "HasNV", "true",
260*0b57cec5SDimitry Andric    "Enable v8.4-A Nested Virtualization Enchancement">;
261*0b57cec5SDimitry Andric
262*0b57cec5SDimitry Andricdef FeatureRASv8_4 : SubtargetFeature<
263*0b57cec5SDimitry Andric    "rasv8_4", "HasRASv8_4", "true",
264*0b57cec5SDimitry Andric    "Enable v8.4-A Reliability, Availability and Serviceability extension",
265*0b57cec5SDimitry Andric    [FeatureRAS]>;
266*0b57cec5SDimitry Andric
267*0b57cec5SDimitry Andricdef FeatureMPAM : SubtargetFeature<
268*0b57cec5SDimitry Andric    "mpam", "HasMPAM", "true",
269*0b57cec5SDimitry Andric    "Enable v8.4-A Memory system Partitioning and Monitoring extension">;
270*0b57cec5SDimitry Andric
271*0b57cec5SDimitry Andricdef FeatureDIT : SubtargetFeature<
272*0b57cec5SDimitry Andric    "dit", "HasDIT", "true",
273*0b57cec5SDimitry Andric    "Enable v8.4-A Data Independent Timing instructions">;
274*0b57cec5SDimitry Andric
275*0b57cec5SDimitry Andricdef FeatureTRACEV8_4 : SubtargetFeature<
276*0b57cec5SDimitry Andric    "tracev8.4", "HasTRACEV8_4", "true",
277*0b57cec5SDimitry Andric    "Enable v8.4-A Trace extension">;
278*0b57cec5SDimitry Andric
279*0b57cec5SDimitry Andricdef FeatureAM : SubtargetFeature<
280*0b57cec5SDimitry Andric    "am", "HasAM", "true",
281*0b57cec5SDimitry Andric    "Enable v8.4-A Activity Monitors extension">;
282*0b57cec5SDimitry Andric
283*0b57cec5SDimitry Andricdef FeatureSEL2 : SubtargetFeature<
284*0b57cec5SDimitry Andric    "sel2", "HasSEL2", "true",
285*0b57cec5SDimitry Andric    "Enable v8.4-A Secure Exception Level 2 extension">;
286*0b57cec5SDimitry Andric
287*0b57cec5SDimitry Andricdef FeatureTLB_RMI : SubtargetFeature<
288*0b57cec5SDimitry Andric    "tlb-rmi", "HasTLB_RMI", "true",
289*0b57cec5SDimitry Andric    "Enable v8.4-A TLB Range and Maintenance Instructions">;
290*0b57cec5SDimitry Andric
291*0b57cec5SDimitry Andricdef FeatureFMI : SubtargetFeature<
292*0b57cec5SDimitry Andric    "fmi", "HasFMI", "true",
293*0b57cec5SDimitry Andric    "Enable v8.4-A Flag Manipulation Instructions">;
294*0b57cec5SDimitry Andric
295*0b57cec5SDimitry Andric// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
296*0b57cec5SDimitry Andricdef FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
297*0b57cec5SDimitry Andric    "Enable v8.4-A RCPC instructions with Immediate Offsets",
298*0b57cec5SDimitry Andric    [FeatureRCPC]>;
299*0b57cec5SDimitry Andric
300*0b57cec5SDimitry Andricdef FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
301*0b57cec5SDimitry Andric                                        "NegativeImmediates", "false",
302*0b57cec5SDimitry Andric                                        "Convert immediates and instructions "
303*0b57cec5SDimitry Andric                                        "to their negated or complemented "
304*0b57cec5SDimitry Andric                                        "equivalent when the immediate does "
305*0b57cec5SDimitry Andric                                        "not fit in the encoding.">;
306*0b57cec5SDimitry Andric
307*0b57cec5SDimitry Andricdef FeatureLSLFast : SubtargetFeature<
308*0b57cec5SDimitry Andric    "lsl-fast", "HasLSLFast", "true",
309*0b57cec5SDimitry Andric    "CPU has a fastpath logical shift of up to 3 places">;
310*0b57cec5SDimitry Andric
311*0b57cec5SDimitry Andricdef FeatureAggressiveFMA :
312*0b57cec5SDimitry Andric  SubtargetFeature<"aggressive-fma",
313*0b57cec5SDimitry Andric                   "HasAggressiveFMA",
314*0b57cec5SDimitry Andric                   "true",
315*0b57cec5SDimitry Andric                   "Enable Aggressive FMA for floating-point.">;
316*0b57cec5SDimitry Andric
317*0b57cec5SDimitry Andricdef FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
318*0b57cec5SDimitry Andric  "Enable alternative NZCV format for floating point comparisons">;
319*0b57cec5SDimitry Andric
320*0b57cec5SDimitry Andricdef FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
321*0b57cec5SDimitry Andric  "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
322*0b57cec5SDimitry Andric  "an integer (in FP format) forcing it to fit into a 32- or 64-bit int" >;
323*0b57cec5SDimitry Andric
324*0b57cec5SDimitry Andricdef FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
325*0b57cec5SDimitry Andric  "true", "Enable architectural speculation restriction" >;
326*0b57cec5SDimitry Andric
327*0b57cec5SDimitry Andricdef FeatureSB : SubtargetFeature<"sb", "HasSB",
328*0b57cec5SDimitry Andric  "true", "Enable v8.5 Speculation Barrier" >;
329*0b57cec5SDimitry Andric
330*0b57cec5SDimitry Andricdef FeatureSSBS : SubtargetFeature<"ssbs", "HasSSBS",
331*0b57cec5SDimitry Andric  "true", "Enable Speculative Store Bypass Safe bit" >;
332*0b57cec5SDimitry Andric
333*0b57cec5SDimitry Andricdef FeaturePredRes : SubtargetFeature<"predres", "HasPredRes", "true",
334*0b57cec5SDimitry Andric  "Enable v8.5a execution and data prediction invalidation instructions" >;
335*0b57cec5SDimitry Andric
336*0b57cec5SDimitry Andricdef FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "HasCCDP",
337*0b57cec5SDimitry Andric    "true", "Enable v8.5 Cache Clean to Point of Deep Persistence" >;
338*0b57cec5SDimitry Andric
339*0b57cec5SDimitry Andricdef FeatureBranchTargetId : SubtargetFeature<"bti", "HasBTI",
340*0b57cec5SDimitry Andric    "true", "Enable Branch Target Identification" >;
341*0b57cec5SDimitry Andric
342*0b57cec5SDimitry Andricdef FeatureRandGen : SubtargetFeature<"rand", "HasRandGen",
343*0b57cec5SDimitry Andric    "true", "Enable Random Number generation instructions" >;
344*0b57cec5SDimitry Andric
345*0b57cec5SDimitry Andricdef FeatureMTE : SubtargetFeature<"mte", "HasMTE",
346*0b57cec5SDimitry Andric    "true", "Enable Memory Tagging Extension" >;
347*0b57cec5SDimitry Andric
348*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
349*0b57cec5SDimitry Andric// Architectures.
350*0b57cec5SDimitry Andric//
351*0b57cec5SDimitry Andric
352*0b57cec5SDimitry Andricdef HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
353*0b57cec5SDimitry Andric  "Support ARM v8.1a instructions", [FeatureCRC, FeatureLSE, FeatureRDM,
354*0b57cec5SDimitry Andric  FeaturePAN, FeatureLOR, FeatureVH]>;
355*0b57cec5SDimitry Andric
356*0b57cec5SDimitry Andricdef HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
357*0b57cec5SDimitry Andric  "Support ARM v8.2a instructions", [HasV8_1aOps, FeaturePsUAO,
358*0b57cec5SDimitry Andric  FeaturePAN_RWV, FeatureRAS, FeatureCCPP]>;
359*0b57cec5SDimitry Andric
360*0b57cec5SDimitry Andricdef HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
361*0b57cec5SDimitry Andric  "Support ARM v8.3a instructions", [HasV8_2aOps, FeatureRCPC, FeaturePA,
362*0b57cec5SDimitry Andric  FeatureJS, FeatureCCIDX, FeatureComplxNum]>;
363*0b57cec5SDimitry Andric
364*0b57cec5SDimitry Andricdef HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
365*0b57cec5SDimitry Andric  "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd,
366*0b57cec5SDimitry Andric  FeatureNV, FeatureRASv8_4, FeatureMPAM, FeatureDIT,
367*0b57cec5SDimitry Andric  FeatureTRACEV8_4, FeatureAM, FeatureSEL2, FeatureTLB_RMI,
368*0b57cec5SDimitry Andric  FeatureFMI, FeatureRCPC_IMMO]>;
369*0b57cec5SDimitry Andric
370*0b57cec5SDimitry Andricdef HasV8_5aOps : SubtargetFeature<
371*0b57cec5SDimitry Andric  "v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions",
372*0b57cec5SDimitry Andric  [HasV8_4aOps, FeatureAltFPCmp, FeatureFRInt3264, FeatureSpecRestrict,
373*0b57cec5SDimitry Andric   FeatureSSBS, FeatureSB, FeaturePredRes, FeatureCacheDeepPersist,
374*0b57cec5SDimitry Andric   FeatureBranchTargetId]
375*0b57cec5SDimitry Andric>;
376*0b57cec5SDimitry Andric
377*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
378*0b57cec5SDimitry Andric// Register File Description
379*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
380*0b57cec5SDimitry Andric
381*0b57cec5SDimitry Andricinclude "AArch64RegisterInfo.td"
382*0b57cec5SDimitry Andricinclude "AArch64RegisterBanks.td"
383*0b57cec5SDimitry Andricinclude "AArch64CallingConvention.td"
384*0b57cec5SDimitry Andric
385*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
386*0b57cec5SDimitry Andric// Instruction Descriptions
387*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
388*0b57cec5SDimitry Andric
389*0b57cec5SDimitry Andricinclude "AArch64Schedule.td"
390*0b57cec5SDimitry Andricinclude "AArch64InstrInfo.td"
391*0b57cec5SDimitry Andricinclude "AArch64SchedPredicates.td"
392*0b57cec5SDimitry Andricinclude "AArch64SchedPredExynos.td"
393*0b57cec5SDimitry Andric
394*0b57cec5SDimitry Andricdef AArch64InstrInfo : InstrInfo;
395*0b57cec5SDimitry Andric
396*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
397*0b57cec5SDimitry Andric// Named operands for MRS/MSR/TLBI/...
398*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
399*0b57cec5SDimitry Andric
400*0b57cec5SDimitry Andricinclude "AArch64SystemOperands.td"
401*0b57cec5SDimitry Andric
402*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
403*0b57cec5SDimitry Andric// Access to privileged registers
404*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
405*0b57cec5SDimitry Andric
406*0b57cec5SDimitry Andricforeach i = 1-3 in
407*0b57cec5SDimitry Andricdef FeatureUseEL#i#ForTP : SubtargetFeature<"tpidr-el"#i, "UseEL"#i#"ForTP",
408*0b57cec5SDimitry Andric  "true", "Permit use of TPIDR_EL"#i#" for the TLS base">;
409*0b57cec5SDimitry Andric
410*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
411*0b57cec5SDimitry Andric// AArch64 Processors supported.
412*0b57cec5SDimitry Andric//
413*0b57cec5SDimitry Andric
414*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
415*0b57cec5SDimitry Andric// Unsupported features to disable for scheduling models
416*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
417*0b57cec5SDimitry Andric
418*0b57cec5SDimitry Andricclass AArch64Unsupported { list<Predicate> F; }
419*0b57cec5SDimitry Andric
420*0b57cec5SDimitry Andricdef SVEUnsupported : AArch64Unsupported {
421*0b57cec5SDimitry Andric  let F = [HasSVE, HasSVE2, HasSVE2AES, HasSVE2SM4, HasSVE2SHA3,
422*0b57cec5SDimitry Andric           HasSVE2BitPerm];
423*0b57cec5SDimitry Andric}
424*0b57cec5SDimitry Andric
425*0b57cec5SDimitry Andricinclude "AArch64SchedA53.td"
426*0b57cec5SDimitry Andricinclude "AArch64SchedA57.td"
427*0b57cec5SDimitry Andricinclude "AArch64SchedCyclone.td"
428*0b57cec5SDimitry Andricinclude "AArch64SchedFalkor.td"
429*0b57cec5SDimitry Andricinclude "AArch64SchedKryo.td"
430*0b57cec5SDimitry Andricinclude "AArch64SchedExynosM1.td"
431*0b57cec5SDimitry Andricinclude "AArch64SchedExynosM3.td"
432*0b57cec5SDimitry Andricinclude "AArch64SchedExynosM4.td"
433*0b57cec5SDimitry Andricinclude "AArch64SchedThunderX.td"
434*0b57cec5SDimitry Andricinclude "AArch64SchedThunderX2T99.td"
435*0b57cec5SDimitry Andric
436*0b57cec5SDimitry Andricdef ProcA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
437*0b57cec5SDimitry Andric                                   "Cortex-A35 ARM processors", [
438*0b57cec5SDimitry Andric                                   FeatureCRC,
439*0b57cec5SDimitry Andric                                   FeatureCrypto,
440*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
441*0b57cec5SDimitry Andric                                   FeatureNEON,
442*0b57cec5SDimitry Andric                                   FeaturePerfMon
443*0b57cec5SDimitry Andric                                   ]>;
444*0b57cec5SDimitry Andric
445*0b57cec5SDimitry Andricdef ProcA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
446*0b57cec5SDimitry Andric                                   "Cortex-A53 ARM processors", [
447*0b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
448*0b57cec5SDimitry Andric                                   FeatureCRC,
449*0b57cec5SDimitry Andric                                   FeatureCrypto,
450*0b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
451*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
452*0b57cec5SDimitry Andric                                   FeatureFuseAES,
453*0b57cec5SDimitry Andric                                   FeatureNEON,
454*0b57cec5SDimitry Andric                                   FeaturePerfMon,
455*0b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
456*0b57cec5SDimitry Andric                                   FeatureUseAA
457*0b57cec5SDimitry Andric                                   ]>;
458*0b57cec5SDimitry Andric
459*0b57cec5SDimitry Andricdef ProcA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
460*0b57cec5SDimitry Andric                                   "Cortex-A55 ARM processors", [
461*0b57cec5SDimitry Andric                                   HasV8_2aOps,
462*0b57cec5SDimitry Andric                                   FeatureCrypto,
463*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
464*0b57cec5SDimitry Andric                                   FeatureFuseAES,
465*0b57cec5SDimitry Andric                                   FeatureNEON,
466*0b57cec5SDimitry Andric                                   FeatureFullFP16,
467*0b57cec5SDimitry Andric                                   FeatureDotProd,
468*0b57cec5SDimitry Andric                                   FeatureRCPC,
469*0b57cec5SDimitry Andric                                   FeaturePerfMon
470*0b57cec5SDimitry Andric                                   ]>;
471*0b57cec5SDimitry Andric
472*0b57cec5SDimitry Andricdef ProcA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
473*0b57cec5SDimitry Andric                                   "Cortex-A57 ARM processors", [
474*0b57cec5SDimitry Andric                                   FeatureBalanceFPOps,
475*0b57cec5SDimitry Andric                                   FeatureCRC,
476*0b57cec5SDimitry Andric                                   FeatureCrypto,
477*0b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
478*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
479*0b57cec5SDimitry Andric                                   FeatureFuseAES,
480*0b57cec5SDimitry Andric                                   FeatureFuseLiterals,
481*0b57cec5SDimitry Andric                                   FeatureNEON,
482*0b57cec5SDimitry Andric                                   FeaturePerfMon,
483*0b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
484*0b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive
485*0b57cec5SDimitry Andric                                   ]>;
486*0b57cec5SDimitry Andric
487*0b57cec5SDimitry Andricdef ProcA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
488*0b57cec5SDimitry Andric                                   "Cortex-A72 ARM processors", [
489*0b57cec5SDimitry Andric                                   FeatureCRC,
490*0b57cec5SDimitry Andric                                   FeatureCrypto,
491*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
492*0b57cec5SDimitry Andric                                   FeatureFuseAES,
493*0b57cec5SDimitry Andric                                   FeatureNEON,
494*0b57cec5SDimitry Andric                                   FeaturePerfMon
495*0b57cec5SDimitry Andric                                   ]>;
496*0b57cec5SDimitry Andric
497*0b57cec5SDimitry Andricdef ProcA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
498*0b57cec5SDimitry Andric                                   "Cortex-A73 ARM processors", [
499*0b57cec5SDimitry Andric                                   FeatureCRC,
500*0b57cec5SDimitry Andric                                   FeatureCrypto,
501*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
502*0b57cec5SDimitry Andric                                   FeatureFuseAES,
503*0b57cec5SDimitry Andric                                   FeatureNEON,
504*0b57cec5SDimitry Andric                                   FeaturePerfMon
505*0b57cec5SDimitry Andric                                   ]>;
506*0b57cec5SDimitry Andric
507*0b57cec5SDimitry Andricdef ProcA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
508*0b57cec5SDimitry Andric                                   "Cortex-A75 ARM processors", [
509*0b57cec5SDimitry Andric                                   HasV8_2aOps,
510*0b57cec5SDimitry Andric                                   FeatureCrypto,
511*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
512*0b57cec5SDimitry Andric                                   FeatureFuseAES,
513*0b57cec5SDimitry Andric                                   FeatureNEON,
514*0b57cec5SDimitry Andric                                   FeatureFullFP16,
515*0b57cec5SDimitry Andric                                   FeatureDotProd,
516*0b57cec5SDimitry Andric                                   FeatureRCPC,
517*0b57cec5SDimitry Andric                                   FeaturePerfMon
518*0b57cec5SDimitry Andric                                   ]>;
519*0b57cec5SDimitry Andric
520*0b57cec5SDimitry Andricdef ProcA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
521*0b57cec5SDimitry Andric                                   "Cortex-A76 ARM processors", [
522*0b57cec5SDimitry Andric                                    HasV8_2aOps,
523*0b57cec5SDimitry Andric                                    FeatureFPARMv8,
524*0b57cec5SDimitry Andric                                    FeatureNEON,
525*0b57cec5SDimitry Andric                                    FeatureRCPC,
526*0b57cec5SDimitry Andric                                    FeatureCrypto,
527*0b57cec5SDimitry Andric                                    FeatureFullFP16,
528*0b57cec5SDimitry Andric                                    FeatureDotProd,
529*0b57cec5SDimitry Andric                                    FeatureSSBS
530*0b57cec5SDimitry Andric                                    ]>;
531*0b57cec5SDimitry Andric
532*0b57cec5SDimitry Andric// Note that cyclone does not fuse AES instructions, but newer apple chips do
533*0b57cec5SDimitry Andric// perform the fusion and cyclone is used by default when targetting apple OSes.
534*0b57cec5SDimitry Andricdef ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
535*0b57cec5SDimitry Andric                                   "Cyclone", [
536*0b57cec5SDimitry Andric                                   FeatureAlternateSExtLoadCVTF32Pattern,
537*0b57cec5SDimitry Andric                                   FeatureArithmeticBccFusion,
538*0b57cec5SDimitry Andric                                   FeatureArithmeticCbzFusion,
539*0b57cec5SDimitry Andric                                   FeatureCrypto,
540*0b57cec5SDimitry Andric                                   FeatureDisableLatencySchedHeuristic,
541*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
542*0b57cec5SDimitry Andric                                   FeatureFuseAES,
543*0b57cec5SDimitry Andric                                   FeatureFuseCryptoEOR,
544*0b57cec5SDimitry Andric                                   FeatureNEON,
545*0b57cec5SDimitry Andric                                   FeaturePerfMon,
546*0b57cec5SDimitry Andric                                   FeatureZCRegMove,
547*0b57cec5SDimitry Andric                                   FeatureZCZeroing,
548*0b57cec5SDimitry Andric                                   FeatureZCZeroingFPWorkaround
549*0b57cec5SDimitry Andric                                   ]>;
550*0b57cec5SDimitry Andric
551*0b57cec5SDimitry Andricdef ProcExynosM1 : SubtargetFeature<"exynosm1", "ARMProcFamily", "ExynosM1",
552*0b57cec5SDimitry Andric                                    "Samsung Exynos-M1 processors",
553*0b57cec5SDimitry Andric                                    [FeatureSlowPaired128,
554*0b57cec5SDimitry Andric                                     FeatureCRC,
555*0b57cec5SDimitry Andric                                     FeatureCrypto,
556*0b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
557*0b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
558*0b57cec5SDimitry Andric                                     FeatureFuseAES,
559*0b57cec5SDimitry Andric                                     FeaturePerfMon,
560*0b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
561*0b57cec5SDimitry Andric                                     FeatureSlowMisaligned128Store,
562*0b57cec5SDimitry Andric                                     FeatureUseRSqrt,
563*0b57cec5SDimitry Andric                                     FeatureZCZeroingFP]>;
564*0b57cec5SDimitry Andric
565*0b57cec5SDimitry Andricdef ProcExynosM2 : SubtargetFeature<"exynosm2", "ARMProcFamily", "ExynosM1",
566*0b57cec5SDimitry Andric                                    "Samsung Exynos-M2 processors",
567*0b57cec5SDimitry Andric                                    [FeatureSlowPaired128,
568*0b57cec5SDimitry Andric                                     FeatureCRC,
569*0b57cec5SDimitry Andric                                     FeatureCrypto,
570*0b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
571*0b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
572*0b57cec5SDimitry Andric                                     FeatureFuseAES,
573*0b57cec5SDimitry Andric                                     FeaturePerfMon,
574*0b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
575*0b57cec5SDimitry Andric                                     FeatureSlowMisaligned128Store,
576*0b57cec5SDimitry Andric                                     FeatureZCZeroingFP]>;
577*0b57cec5SDimitry Andric
578*0b57cec5SDimitry Andricdef ProcExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3",
579*0b57cec5SDimitry Andric                                    "Samsung Exynos-M3 processors",
580*0b57cec5SDimitry Andric                                    [FeatureCRC,
581*0b57cec5SDimitry Andric                                     FeatureCrypto,
582*0b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
583*0b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
584*0b57cec5SDimitry Andric                                     FeatureFuseAddress,
585*0b57cec5SDimitry Andric                                     FeatureFuseAES,
586*0b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
587*0b57cec5SDimitry Andric                                     FeatureFuseLiterals,
588*0b57cec5SDimitry Andric                                     FeatureLSLFast,
589*0b57cec5SDimitry Andric                                     FeaturePerfMon,
590*0b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
591*0b57cec5SDimitry Andric                                     FeaturePredictableSelectIsExpensive,
592*0b57cec5SDimitry Andric                                     FeatureZCZeroingFP]>;
593*0b57cec5SDimitry Andric
594*0b57cec5SDimitry Andricdef ProcExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3",
595*0b57cec5SDimitry Andric                                    "Samsung Exynos-M4 processors",
596*0b57cec5SDimitry Andric                                    [HasV8_2aOps,
597*0b57cec5SDimitry Andric                                     FeatureArithmeticBccFusion,
598*0b57cec5SDimitry Andric                                     FeatureArithmeticCbzFusion,
599*0b57cec5SDimitry Andric                                     FeatureCrypto,
600*0b57cec5SDimitry Andric                                     FeatureDotProd,
601*0b57cec5SDimitry Andric                                     FeatureExynosCheapAsMoveHandling,
602*0b57cec5SDimitry Andric                                     FeatureForce32BitJumpTables,
603*0b57cec5SDimitry Andric                                     FeatureFullFP16,
604*0b57cec5SDimitry Andric                                     FeatureFuseAddress,
605*0b57cec5SDimitry Andric                                     FeatureFuseAES,
606*0b57cec5SDimitry Andric                                     FeatureFuseArithmeticLogic,
607*0b57cec5SDimitry Andric                                     FeatureFuseCCSelect,
608*0b57cec5SDimitry Andric                                     FeatureFuseLiterals,
609*0b57cec5SDimitry Andric                                     FeatureLSLFast,
610*0b57cec5SDimitry Andric                                     FeaturePerfMon,
611*0b57cec5SDimitry Andric                                     FeaturePostRAScheduler,
612*0b57cec5SDimitry Andric                                     FeatureZCZeroing]>;
613*0b57cec5SDimitry Andric
614*0b57cec5SDimitry Andricdef ProcKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
615*0b57cec5SDimitry Andric                                   "Qualcomm Kryo processors", [
616*0b57cec5SDimitry Andric                                   FeatureCRC,
617*0b57cec5SDimitry Andric                                   FeatureCrypto,
618*0b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
619*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
620*0b57cec5SDimitry Andric                                   FeatureNEON,
621*0b57cec5SDimitry Andric                                   FeaturePerfMon,
622*0b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
623*0b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
624*0b57cec5SDimitry Andric                                   FeatureZCZeroing,
625*0b57cec5SDimitry Andric                                   FeatureLSLFast
626*0b57cec5SDimitry Andric                                   ]>;
627*0b57cec5SDimitry Andric
628*0b57cec5SDimitry Andricdef ProcFalkor  : SubtargetFeature<"falkor", "ARMProcFamily", "Falkor",
629*0b57cec5SDimitry Andric                                   "Qualcomm Falkor processors", [
630*0b57cec5SDimitry Andric                                   FeatureCRC,
631*0b57cec5SDimitry Andric                                   FeatureCrypto,
632*0b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
633*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
634*0b57cec5SDimitry Andric                                   FeatureNEON,
635*0b57cec5SDimitry Andric                                   FeaturePerfMon,
636*0b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
637*0b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
638*0b57cec5SDimitry Andric                                   FeatureRDM,
639*0b57cec5SDimitry Andric                                   FeatureZCZeroing,
640*0b57cec5SDimitry Andric                                   FeatureLSLFast,
641*0b57cec5SDimitry Andric                                   FeatureSlowSTRQro
642*0b57cec5SDimitry Andric                                   ]>;
643*0b57cec5SDimitry Andric
644*0b57cec5SDimitry Andricdef ProcSaphira  : SubtargetFeature<"saphira", "ARMProcFamily", "Saphira",
645*0b57cec5SDimitry Andric                                   "Qualcomm Saphira processors", [
646*0b57cec5SDimitry Andric                                   FeatureCrypto,
647*0b57cec5SDimitry Andric                                   FeatureCustomCheapAsMoveHandling,
648*0b57cec5SDimitry Andric                                   FeatureFPARMv8,
649*0b57cec5SDimitry Andric                                   FeatureNEON,
650*0b57cec5SDimitry Andric                                   FeatureSPE,
651*0b57cec5SDimitry Andric                                   FeaturePerfMon,
652*0b57cec5SDimitry Andric                                   FeaturePostRAScheduler,
653*0b57cec5SDimitry Andric                                   FeaturePredictableSelectIsExpensive,
654*0b57cec5SDimitry Andric                                   FeatureZCZeroing,
655*0b57cec5SDimitry Andric                                   FeatureLSLFast,
656*0b57cec5SDimitry Andric                                   HasV8_4aOps]>;
657*0b57cec5SDimitry Andric
658*0b57cec5SDimitry Andricdef ProcThunderX2T99  : SubtargetFeature<"thunderx2t99", "ARMProcFamily",
659*0b57cec5SDimitry Andric                                         "ThunderX2T99",
660*0b57cec5SDimitry Andric                                         "Cavium ThunderX2 processors", [
661*0b57cec5SDimitry Andric                                          FeatureAggressiveFMA,
662*0b57cec5SDimitry Andric                                          FeatureCRC,
663*0b57cec5SDimitry Andric                                          FeatureCrypto,
664*0b57cec5SDimitry Andric                                          FeatureFPARMv8,
665*0b57cec5SDimitry Andric                                          FeatureArithmeticBccFusion,
666*0b57cec5SDimitry Andric                                          FeatureNEON,
667*0b57cec5SDimitry Andric                                          FeaturePostRAScheduler,
668*0b57cec5SDimitry Andric                                          FeaturePredictableSelectIsExpensive,
669*0b57cec5SDimitry Andric                                          FeatureLSE,
670*0b57cec5SDimitry Andric                                          HasV8_1aOps]>;
671*0b57cec5SDimitry Andric
672*0b57cec5SDimitry Andricdef ProcThunderX : SubtargetFeature<"thunderx", "ARMProcFamily", "ThunderX",
673*0b57cec5SDimitry Andric                                    "Cavium ThunderX processors", [
674*0b57cec5SDimitry Andric                                    FeatureCRC,
675*0b57cec5SDimitry Andric                                    FeatureCrypto,
676*0b57cec5SDimitry Andric                                    FeatureFPARMv8,
677*0b57cec5SDimitry Andric                                    FeaturePerfMon,
678*0b57cec5SDimitry Andric                                    FeaturePostRAScheduler,
679*0b57cec5SDimitry Andric                                    FeaturePredictableSelectIsExpensive,
680*0b57cec5SDimitry Andric                                    FeatureNEON]>;
681*0b57cec5SDimitry Andric
682*0b57cec5SDimitry Andricdef ProcThunderXT88 : SubtargetFeature<"thunderxt88", "ARMProcFamily",
683*0b57cec5SDimitry Andric                                       "ThunderXT88",
684*0b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
685*0b57cec5SDimitry Andric                                       FeatureCRC,
686*0b57cec5SDimitry Andric                                       FeatureCrypto,
687*0b57cec5SDimitry Andric                                       FeatureFPARMv8,
688*0b57cec5SDimitry Andric                                       FeaturePerfMon,
689*0b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
690*0b57cec5SDimitry Andric                                       FeaturePredictableSelectIsExpensive,
691*0b57cec5SDimitry Andric                                       FeatureNEON]>;
692*0b57cec5SDimitry Andric
693*0b57cec5SDimitry Andricdef ProcThunderXT81 : SubtargetFeature<"thunderxt81", "ARMProcFamily",
694*0b57cec5SDimitry Andric                                       "ThunderXT81",
695*0b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
696*0b57cec5SDimitry Andric                                       FeatureCRC,
697*0b57cec5SDimitry Andric                                       FeatureCrypto,
698*0b57cec5SDimitry Andric                                       FeatureFPARMv8,
699*0b57cec5SDimitry Andric                                       FeaturePerfMon,
700*0b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
701*0b57cec5SDimitry Andric                                       FeaturePredictableSelectIsExpensive,
702*0b57cec5SDimitry Andric                                       FeatureNEON]>;
703*0b57cec5SDimitry Andric
704*0b57cec5SDimitry Andricdef ProcThunderXT83 : SubtargetFeature<"thunderxt83", "ARMProcFamily",
705*0b57cec5SDimitry Andric                                       "ThunderXT83",
706*0b57cec5SDimitry Andric                                       "Cavium ThunderX processors", [
707*0b57cec5SDimitry Andric                                       FeatureCRC,
708*0b57cec5SDimitry Andric                                       FeatureCrypto,
709*0b57cec5SDimitry Andric                                       FeatureFPARMv8,
710*0b57cec5SDimitry Andric                                       FeaturePerfMon,
711*0b57cec5SDimitry Andric                                       FeaturePostRAScheduler,
712*0b57cec5SDimitry Andric                                       FeaturePredictableSelectIsExpensive,
713*0b57cec5SDimitry Andric                                       FeatureNEON]>;
714*0b57cec5SDimitry Andric
715*0b57cec5SDimitry Andricdef ProcTSV110 : SubtargetFeature<"tsv110", "ARMProcFamily", "TSV110",
716*0b57cec5SDimitry Andric                                  "HiSilicon TS-V110 processors", [
717*0b57cec5SDimitry Andric                                  HasV8_2aOps,
718*0b57cec5SDimitry Andric                                  FeatureCrypto,
719*0b57cec5SDimitry Andric                                  FeatureCustomCheapAsMoveHandling,
720*0b57cec5SDimitry Andric                                  FeatureFPARMv8,
721*0b57cec5SDimitry Andric                                  FeatureFuseAES,
722*0b57cec5SDimitry Andric                                  FeatureNEON,
723*0b57cec5SDimitry Andric                                  FeaturePerfMon,
724*0b57cec5SDimitry Andric                                  FeaturePostRAScheduler,
725*0b57cec5SDimitry Andric                                  FeatureSPE,
726*0b57cec5SDimitry Andric                                  FeatureFullFP16,
727*0b57cec5SDimitry Andric                                  FeatureFP16FML,
728*0b57cec5SDimitry Andric                                  FeatureDotProd]>;
729*0b57cec5SDimitry Andric
730*0b57cec5SDimitry Andricdef : ProcessorModel<"generic", NoSchedModel, [
731*0b57cec5SDimitry Andric                     FeatureFPARMv8,
732*0b57cec5SDimitry Andric                     FeatureFuseAES,
733*0b57cec5SDimitry Andric                     FeatureNEON,
734*0b57cec5SDimitry Andric                     FeaturePerfMon,
735*0b57cec5SDimitry Andric                     FeaturePostRAScheduler
736*0b57cec5SDimitry Andric                     ]>;
737*0b57cec5SDimitry Andric
738*0b57cec5SDimitry Andric// FIXME: Cortex-A35 and Cortex-A55 are currently modeled as a Cortex-A53.
739*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a35", CortexA53Model, [ProcA35]>;
740*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
741*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a55", CortexA53Model, [ProcA55]>;
742*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
743*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA72]>;
744*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a73", CortexA57Model, [ProcA73]>;
745*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a75", CortexA57Model, [ProcA75]>;
746*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a76", CortexA57Model, [ProcA76]>;
747*0b57cec5SDimitry Andricdef : ProcessorModel<"cortex-a76ae", CortexA57Model, [ProcA76]>;
748*0b57cec5SDimitry Andricdef : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
749*0b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>;
750*0b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m2", ExynosM1Model, [ProcExynosM2]>;
751*0b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m3", ExynosM3Model, [ProcExynosM3]>;
752*0b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m4", ExynosM4Model, [ProcExynosM4]>;
753*0b57cec5SDimitry Andricdef : ProcessorModel<"exynos-m5", ExynosM4Model, [ProcExynosM4]>;
754*0b57cec5SDimitry Andricdef : ProcessorModel<"falkor", FalkorModel, [ProcFalkor]>;
755*0b57cec5SDimitry Andricdef : ProcessorModel<"saphira", FalkorModel, [ProcSaphira]>;
756*0b57cec5SDimitry Andricdef : ProcessorModel<"kryo", KryoModel, [ProcKryo]>;
757*0b57cec5SDimitry Andric// Cavium ThunderX/ThunderX T8X  Processors
758*0b57cec5SDimitry Andricdef : ProcessorModel<"thunderx", ThunderXT8XModel,  [ProcThunderX]>;
759*0b57cec5SDimitry Andricdef : ProcessorModel<"thunderxt88", ThunderXT8XModel,  [ProcThunderXT88]>;
760*0b57cec5SDimitry Andricdef : ProcessorModel<"thunderxt81", ThunderXT8XModel,  [ProcThunderXT81]>;
761*0b57cec5SDimitry Andricdef : ProcessorModel<"thunderxt83", ThunderXT8XModel,  [ProcThunderXT83]>;
762*0b57cec5SDimitry Andric// Cavium ThunderX2T9X  Processors. Formerly Broadcom Vulcan.
763*0b57cec5SDimitry Andricdef : ProcessorModel<"thunderx2t99", ThunderX2T99Model, [ProcThunderX2T99]>;
764*0b57cec5SDimitry Andric// FIXME: HiSilicon TSV110 is currently modeled as a Cortex-A57.
765*0b57cec5SDimitry Andricdef : ProcessorModel<"tsv110", CortexA57Model, [ProcTSV110]>;
766*0b57cec5SDimitry Andric
767*0b57cec5SDimitry Andric// Alias for the latest Apple processor model supported by LLVM.
768*0b57cec5SDimitry Andricdef : ProcessorModel<"apple-latest", CycloneModel, [ProcCyclone]>;
769*0b57cec5SDimitry Andric
770*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
771*0b57cec5SDimitry Andric// Assembly parser
772*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
773*0b57cec5SDimitry Andric
774*0b57cec5SDimitry Andricdef GenericAsmParserVariant : AsmParserVariant {
775*0b57cec5SDimitry Andric  int Variant = 0;
776*0b57cec5SDimitry Andric  string Name = "generic";
777*0b57cec5SDimitry Andric  string BreakCharacters = ".";
778*0b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
779*0b57cec5SDimitry Andric}
780*0b57cec5SDimitry Andric
781*0b57cec5SDimitry Andricdef AppleAsmParserVariant : AsmParserVariant {
782*0b57cec5SDimitry Andric  int Variant = 1;
783*0b57cec5SDimitry Andric  string Name = "apple-neon";
784*0b57cec5SDimitry Andric  string BreakCharacters = ".";
785*0b57cec5SDimitry Andric  string TokenizingCharacters = "[]*!/";
786*0b57cec5SDimitry Andric}
787*0b57cec5SDimitry Andric
788*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
789*0b57cec5SDimitry Andric// Assembly printer
790*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
791*0b57cec5SDimitry Andric// AArch64 Uses the MC printer for asm output, so make sure the TableGen
792*0b57cec5SDimitry Andric// AsmWriter bits get associated with the correct class.
793*0b57cec5SDimitry Andricdef GenericAsmWriter : AsmWriter {
794*0b57cec5SDimitry Andric  string AsmWriterClassName  = "InstPrinter";
795*0b57cec5SDimitry Andric  int PassSubtarget = 1;
796*0b57cec5SDimitry Andric  int Variant = 0;
797*0b57cec5SDimitry Andric  bit isMCAsmWriter = 1;
798*0b57cec5SDimitry Andric}
799*0b57cec5SDimitry Andric
800*0b57cec5SDimitry Andricdef AppleAsmWriter : AsmWriter {
801*0b57cec5SDimitry Andric  let AsmWriterClassName = "AppleInstPrinter";
802*0b57cec5SDimitry Andric  int PassSubtarget = 1;
803*0b57cec5SDimitry Andric  int Variant = 1;
804*0b57cec5SDimitry Andric  int isMCAsmWriter = 1;
805*0b57cec5SDimitry Andric}
806*0b57cec5SDimitry Andric
807*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
808*0b57cec5SDimitry Andric// Target Declaration
809*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
810*0b57cec5SDimitry Andric
811*0b57cec5SDimitry Andricdef AArch64 : Target {
812*0b57cec5SDimitry Andric  let InstructionSet = AArch64InstrInfo;
813*0b57cec5SDimitry Andric  let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
814*0b57cec5SDimitry Andric  let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
815*0b57cec5SDimitry Andric  let AllowRegisterRenaming = 1;
816*0b57cec5SDimitry Andric}
817*0b57cec5SDimitry Andric
818*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
819*0b57cec5SDimitry Andric// Pfm Counters
820*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
821*0b57cec5SDimitry Andric
822*0b57cec5SDimitry Andricinclude "AArch64PfmCounters.td"
823