xref: /freebsd/contrib/llvm-project/llvm/lib/Target/ARM/ARM.td (revision d9a42747950146bf03cda7f6e25d219253f8a57a)
1//===-- ARM.td - Describe the ARM Target Machine -----------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//
10//===----------------------------------------------------------------------===//
11
12//===----------------------------------------------------------------------===//
13// Target-independent interfaces which we are implementing
14//===----------------------------------------------------------------------===//
15
16include "llvm/Target/Target.td"
17
18//===----------------------------------------------------------------------===//
19// ARM Subtarget state.
20//
21
22// True if compiling for Thumb, false for ARM.
23def ModeThumb             : SubtargetFeature<"thumb-mode", "IsThumb",
24                                             "true", "Thumb mode">;
25
26// True if we're using software floating point features.
27def ModeSoftFloat         : SubtargetFeature<"soft-float","UseSoftFloat",
28                                             "true", "Use software floating "
29                                             "point features.">;
30
31
32//===----------------------------------------------------------------------===//
33// ARM Subtarget features.
34//
35
36// Floating Point, HW Division and Neon Support
37
38// FP loads/stores/moves, shared between VFP and MVE (even in the integer-only
39// version).
40def FeatureFPRegs         : SubtargetFeature<"fpregs", "HasFPRegs", "true",
41                                             "Enable FP registers">;
42
43// 16-bit FP loads/stores/moves, shared between VFP (with the v8.2A FP16
44// extension) and MVE (even in the integer-only version).
45def FeatureFPRegs16       : SubtargetFeature<"fpregs16", "HasFPRegs16", "true",
46                                             "Enable 16-bit FP registers",
47                                             [FeatureFPRegs]>;
48
49def FeatureFPRegs64       : SubtargetFeature<"fpregs64", "HasFPRegs64", "true",
50                                             "Enable 64-bit FP registers",
51                                             [FeatureFPRegs]>;
52
53// True if the floating point unit supports double precision.
54def FeatureFP64           : SubtargetFeature<"fp64", "HasFP64", "true",
55                                             "Floating point unit supports "
56                                             "double precision",
57                                             [FeatureFPRegs64]>;
58
59// True if subtarget has the full 32 double precision FP registers for VFPv3.
60def FeatureD32            : SubtargetFeature<"d32", "HasD32", "true",
61                                             "Extend FP to 32 double registers">;
62
63/// Versions of the VFP flags restricted to single precision, or to
64/// 16 d-registers, or both.
65multiclass VFPver<string name, string query, string description,
66                  list<SubtargetFeature> prev,
67                  list<SubtargetFeature> otherimplies,
68                  list<SubtargetFeature> vfp2prev = []> {
69  def _D16_SP: SubtargetFeature<
70    name#"d16sp", query#"D16SP", "true",
71    description#" with only 16 d-registers and no double precision",
72    !foreach(v, prev, !cast<SubtargetFeature>(v # "_D16_SP")) #
73      !foreach(v, vfp2prev, !cast<SubtargetFeature>(v # "_SP")) #
74      otherimplies>;
75  def _SP: SubtargetFeature<
76    name#"sp", query#"SP", "true",
77    description#" with no double precision",
78    !foreach(v, prev, !cast<SubtargetFeature>(v # "_SP")) #
79      otherimplies # [FeatureD32, !cast<SubtargetFeature>(NAME # "_D16_SP")]>;
80  def _D16: SubtargetFeature<
81    name#"d16", query#"D16", "true",
82    description#" with only 16 d-registers",
83    !foreach(v, prev, !cast<SubtargetFeature>(v # "_D16")) #
84      vfp2prev #
85      otherimplies # [FeatureFP64, !cast<SubtargetFeature>(NAME # "_D16_SP")]>;
86  def "": SubtargetFeature<
87    name, query, "true", description,
88    prev # otherimplies # [
89        !cast<SubtargetFeature>(NAME # "_D16"),
90        !cast<SubtargetFeature>(NAME # "_SP")]>;
91}
92
93def FeatureVFP2_SP        : SubtargetFeature<"vfp2sp", "HasVFPv2SP", "true",
94                                             "Enable VFP2 instructions with "
95                                             "no double precision",
96                                             [FeatureFPRegs]>;
97
98def FeatureVFP2           : SubtargetFeature<"vfp2", "HasVFPv2", "true",
99                                             "Enable VFP2 instructions",
100                                             [FeatureFP64, FeatureVFP2_SP]>;
101
102defm FeatureVFP3: VFPver<"vfp3", "HasVFPv3", "Enable VFP3 instructions",
103                         [], [], [FeatureVFP2]>;
104
105def FeatureNEON           : SubtargetFeature<"neon", "HasNEON", "true",
106                                             "Enable NEON instructions",
107                                             [FeatureVFP3]>;
108
109// True if subtarget supports half-precision FP conversions.
110def FeatureFP16           : SubtargetFeature<"fp16", "HasFP16", "true",
111                                             "Enable half-precision "
112                                             "floating point">;
113
114defm FeatureVFP4: VFPver<"vfp4", "HasVFPv4", "Enable VFP4 instructions",
115                         [FeatureVFP3], [FeatureFP16]>;
116
117defm FeatureFPARMv8: VFPver<"fp-armv8", "HasFPARMv8", "Enable ARMv8 FP",
118                         [FeatureVFP4], []>;
119
120// True if subtarget supports half-precision FP operations.
121def FeatureFullFP16       : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
122                                             "Enable full half-precision "
123                                             "floating point",
124                                             [FeatureFPARMv8_D16_SP, FeatureFPRegs16]>;
125
126// True if subtarget supports half-precision FP fml operations.
127def FeatureFP16FML        : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
128                                             "Enable full half-precision "
129                                             "floating point fml instructions",
130                                             [FeatureFullFP16]>;
131
132// True if subtarget supports [su]div in Thumb mode.
133def FeatureHWDivThumb     : SubtargetFeature<"hwdiv",
134                                             "HasDivideInThumbMode", "true",
135                                             "Enable divide instructions in Thumb">;
136
137// True if subtarget supports [su]div in ARM mode.
138def FeatureHWDivARM       : SubtargetFeature<"hwdiv-arm",
139                                             "HasDivideInARMMode", "true",
140                                             "Enable divide instructions in ARM mode">;
141
142// Atomic Support
143
144// True if the subtarget supports DMB / DSB data barrier instructions.
145def FeatureDB             : SubtargetFeature<"db", "HasDataBarrier", "true",
146                                             "Has data barrier (dmb/dsb) instructions">;
147
148// True if the subtarget supports CLREX instructions.
149def FeatureV7Clrex        : SubtargetFeature<"v7clrex", "HasV7Clrex", "true",
150                                             "Has v7 clrex instruction">;
151
152// True if the subtarget supports DFB data barrier instruction.
153def FeatureDFB  : SubtargetFeature<"dfb", "HasFullDataBarrier", "true",
154                                   "Has full data barrier (dfb) instruction">;
155
156// True if the subtarget supports v8 atomics (LDA/LDAEX etc) instructions.
157def FeatureAcquireRelease : SubtargetFeature<"acquire-release",
158                                             "HasAcquireRelease", "true",
159                                             "Has v8 acquire/release (lda/ldaex "
160                                             " etc) instructions">;
161
162
163// True if floating point compare + branch is slow.
164def FeatureSlowFPBrcc     : SubtargetFeature<"slow-fp-brcc", "IsFPBrccSlow", "true",
165                                             "FP compare + branch is slow">;
166
167// True if the processor supports the Performance Monitor Extensions. These
168// include a generic cycle-counter as well as more fine-grained (often
169// implementation-specific) events.
170def FeaturePerfMon        : SubtargetFeature<"perfmon", "HasPerfMon", "true",
171                                             "Enable support for Performance "
172                                             "Monitor extensions">;
173
174
175// TrustZone Security Extensions
176
177// True if processor supports TrustZone security extensions.
178def FeatureTrustZone      : SubtargetFeature<"trustzone", "HasTrustZone", "true",
179                                             "Enable support for TrustZone "
180                                             "security extensions">;
181
182// True if processor supports ARMv8-M Security Extensions.
183def Feature8MSecExt       : SubtargetFeature<"8msecext", "Has8MSecExt", "true",
184                                             "Enable support for ARMv8-M "
185                                             "Security Extensions">;
186
187// True if processor supports SHA1 and SHA256.
188def FeatureSHA2           : SubtargetFeature<"sha2", "HasSHA2", "true",
189                                             "Enable SHA1 and SHA256 support", [FeatureNEON]>;
190
191def FeatureAES            : SubtargetFeature<"aes", "HasAES", "true",
192                                             "Enable AES support", [FeatureNEON]>;
193
194// True if processor supports Cryptography extensions.
195def FeatureCrypto         : SubtargetFeature<"crypto", "HasCrypto", "true",
196                                             "Enable support for "
197                                             "Cryptography extensions",
198                                             [FeatureNEON, FeatureSHA2, FeatureAES]>;
199
200// True if processor supports CRC instructions.
201def FeatureCRC            : SubtargetFeature<"crc", "HasCRC", "true",
202                                             "Enable support for CRC instructions">;
203
204// True if the ARMv8.2A dot product instructions are supported.
205def FeatureDotProd        : SubtargetFeature<"dotprod", "HasDotProd", "true",
206                                             "Enable support for dot product instructions",
207                                             [FeatureNEON]>;
208
209// True if the processor supports RAS extensions.
210// Not to be confused with FeatureHasRetAddrStack (return address stack).
211def FeatureRAS            : SubtargetFeature<"ras", "HasRAS", "true",
212                                             "Enable Reliability, Availability "
213                                             "and Serviceability extensions">;
214
215// Fast computation of non-negative address offsets.
216// True if processor does positive address offset computation faster.
217def FeatureFPAO           : SubtargetFeature<"fpao", "HasFPAO", "true",
218                                             "Enable fast computation of "
219                                             "positive address offsets">;
220
221// Fast execution of AES crypto operations.
222// True if processor executes back to back AES instruction pairs faster.
223def FeatureFuseAES        : SubtargetFeature<"fuse-aes", "HasFuseAES", "true",
224                                             "CPU fuses AES crypto operations">;
225
226// Fast execution of bottom and top halves of literal generation.
227// True if processor executes back to back bottom and top halves of literal generation faster.
228def FeatureFuseLiterals   : SubtargetFeature<"fuse-literals", "HasFuseLiterals", "true",
229                                             "CPU fuses literal generation operations">;
230
231// The way of reading thread pointer.
232// True if read thread pointer from coprocessor register.
233def FeatureReadTp :  SubtargetFeature<"read-tp-hard", "IsReadTPHard", "true",
234                                      "Reading thread pointer from register">;
235
236// Cyclone can zero VFP registers in 0 cycles.
237// True if the instructions "vmov.i32 d0, #0" and "vmov.i32 q0, #0" are
238// particularly effective at zeroing a VFP register.
239def FeatureZCZeroing      : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
240                                             "Has zero-cycle zeroing instructions">;
241
242// Whether it is profitable to unpredicate certain instructions during if-conversion.
243// True if if conversion may decide to leave some instructions unpredicated.
244def FeatureProfUnpredicate : SubtargetFeature<"prof-unpr",
245                                              "IsProfitableToUnpredicate", "true",
246                                              "Is profitable to unpredicate">;
247
248// Some targets (e.g. Swift) have microcoded VGETLNi32.
249// True if VMOV will be favored over VGETLNi32.
250def FeatureSlowVGETLNi32  : SubtargetFeature<"slow-vgetlni32",
251                                             "HasSlowVGETLNi32", "true",
252                                             "Has slow VGETLNi32 - prefer VMOV">;
253
254// Some targets (e.g. Swift) have microcoded VDUP32.
255// True if VMOV will be favored over VDUP.
256def FeatureSlowVDUP32     : SubtargetFeature<"slow-vdup32", "HasSlowVDUP32",
257                                             "true",
258                                             "Has slow VDUP32 - prefer VMOV">;
259
260// Some targets (e.g. Cortex-A9) prefer VMOVSR to VMOVDRR even when using NEON
261// for scalar FP, as this allows more effective execution domain optimization.
262// True if VMOVSR will be favored over VMOVDRR.
263def FeaturePreferVMOVSR   : SubtargetFeature<"prefer-vmovsr", "PreferVMOVSR",
264                                             "true", "Prefer VMOVSR">;
265
266// Swift has ISHST barriers compatible with Atomic Release semantics but weaker
267// than ISH.
268// True if ISHST barriers will be used for Release semantics.
269def FeaturePrefISHSTBarrier : SubtargetFeature<"prefer-ishst", "PreferISHSTBarriers",
270                                               "true", "Prefer ISHST barriers">;
271
272// Some targets (e.g. Cortex-A9) have muxed AGU and NEON/FPU.
273// True if the AGU and NEON/FPU units are multiplexed.
274def FeatureMuxedUnits     : SubtargetFeature<"muxed-units", "HasMuxedUnits",
275                                             "true",
276                                             "Has muxed AGU and NEON/FPU">;
277
278// Whether VLDM/VSTM starting with odd register number need more microops
279// than single VLDRS.
280// True if a VLDM/VSTM starting with an odd register number is considered to
281// take more microops than single VLDRS/VSTRS.
282def FeatureSlowOddRegister : SubtargetFeature<"slow-odd-reg", "HasSlowOddRegister",
283                                              "true", "VLDM/VSTM starting "
284                                              "with an odd register is slow">;
285
286// Some targets have a renaming dependency when loading into D subregisters.
287// True if loading into a D subregister will be penalized.
288def FeatureSlowLoadDSubreg : SubtargetFeature<"slow-load-D-subreg",
289                                              "HasSlowLoadDSubregister", "true",
290                                              "Loading into D subregs is slow">;
291
292// True if use a wider stride when allocating VFP registers.
293def FeatureUseWideStrideVFP : SubtargetFeature<"wide-stride-vfp",
294                                               "UseWideStrideVFP", "true",
295                                               "Use a wide stride when allocating VFP registers">;
296
297// Some targets (e.g. Cortex-A15) never want VMOVS to be widened to VMOVD.
298// True if VMOVS will never be widened to VMOVD.
299def FeatureDontWidenVMOVS : SubtargetFeature<"dont-widen-vmovs",
300                                             "DontWidenVMOVS", "true",
301                                             "Don't widen VMOVS to VMOVD">;
302
303// Some targets (e.g. Cortex-A15) prefer to avoid mixing operations on different
304// VFP register widths.
305// True if splat a register between VFP and NEON instructions.
306def FeatureSplatVFPToNeon : SubtargetFeature<"splat-vfp-neon",
307                                             "UseSplatVFPToNeon", "true",
308                                             "Splat register from VFP to NEON",
309                                             [FeatureDontWidenVMOVS]>;
310
311// Whether or not it is profitable to expand VFP/NEON MLA/MLS instructions.
312// True if run the MLx expansion pass.
313def FeatureExpandMLx      : SubtargetFeature<"expand-fp-mlx",
314                                             "ExpandMLx", "true",
315                                             "Expand VFP/NEON MLA/MLS instructions">;
316
317// Some targets have special RAW hazards for VFP/NEON VMLA/VMLS.
318// True if VFP/NEON VMLA/VMLS have special RAW hazards.
319def FeatureHasVMLxHazards : SubtargetFeature<"vmlx-hazards", "HasVMLxHazards",
320                                             "true", "Has VMLx hazards">;
321
322// Some targets (e.g. Cortex-A9) want to convert VMOVRS, VMOVSR and VMOVS from
323// VFP to NEON, as an execution domain optimization.
324// True if VMOVRS, VMOVSR and VMOVS will be converted from VFP to NEON.
325def FeatureNEONForFPMovs  : SubtargetFeature<"neon-fpmovs",
326                                             "UseNEONForFPMovs", "true",
327                                             "Convert VMOVSR, VMOVRS, "
328                                             "VMOVS to NEON">;
329
330// Some processors benefit from using NEON instructions for scalar
331// single-precision FP operations. This affects instruction selection and should
332// only be enabled if the handling of denormals is not important.
333// Use the method useNEONForSinglePrecisionFP() to determine if NEON should actually be used.
334def FeatureNEONForFP      : SubtargetFeature<"neonfp",
335                                             "HasNEONForFP",
336                                             "true",
337                                             "Use NEON for single precision FP">;
338
339// On some processors, VLDn instructions that access unaligned data take one
340// extra cycle. Take that into account when computing operand latencies.
341// True if VLDn instructions take an extra cycle for unaligned accesses.
342def FeatureCheckVLDnAlign : SubtargetFeature<"vldn-align", "CheckVLDnAccessAlignment",
343                                             "true",
344                                             "Check for VLDn unaligned access">;
345
346// Some processors have a nonpipelined VFP coprocessor.
347// True if VFP instructions are not pipelined.
348def FeatureNonpipelinedVFP : SubtargetFeature<"nonpipelined-vfp",
349                                              "NonpipelinedVFP", "true",
350                                              "VFP instructions are not pipelined">;
351
352// Some processors have FP multiply-accumulate instructions that don't
353// play nicely with other VFP / NEON instructions, and it's generally better
354// to just not use them.
355// If the VFP2 / NEON instructions are available, indicates
356// whether the FP VML[AS] instructions are slow (if so, don't use them).
357def FeatureHasSlowFPVMLx  : SubtargetFeature<"slowfpvmlx", "SlowFPVMLx", "true",
358                                             "Disable VFP / NEON MAC instructions">;
359
360// VFPv4 added VFMA instructions that can similarly be fast or slow.
361// If the VFP4 / NEON instructions are available, indicates
362// whether the FP VFM[AS] instructions are slow (if so, don't use them).
363def FeatureHasSlowFPVFMx  : SubtargetFeature<"slowfpvfmx", "SlowFPVFMx", "true",
364                                             "Disable VFP / NEON FMA instructions">;
365
366// Cortex-A8 / A9 Advanced SIMD has multiplier accumulator forwarding.
367/// True if NEON has special multiplier accumulator
368/// forwarding to allow mul + mla being issued back to back.
369def FeatureVMLxForwarding : SubtargetFeature<"vmlx-forwarding",
370                                             "HasVMLxForwarding", "true",
371                                             "Has multiplier accumulator forwarding">;
372
373// Disable 32-bit to 16-bit narrowing for experimentation.
374// True if codegen would prefer 32-bit Thumb instructions over 16-bit ones.
375def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Prefers32BitThumb", "true",
376                                             "Prefer 32-bit Thumb instrs">;
377
378def FeaturePrefLoopAlign32 : SubtargetFeature<"loop-align", "PrefLoopLogAlignment","2",
379                                              "Prefer 32-bit alignment for loops">;
380
381def FeatureMVEVectorCostFactor1 : SubtargetFeature<"mve1beat", "MVEVectorCostFactor", "4",
382                        "Model MVE instructions as a 1 beat per tick architecture">;
383
384def FeatureMVEVectorCostFactor2 : SubtargetFeature<"mve2beat", "MVEVectorCostFactor", "2",
385                        "Model MVE instructions as a 2 beats per tick architecture">;
386
387def FeatureMVEVectorCostFactor4 : SubtargetFeature<"mve4beat", "MVEVectorCostFactor", "1",
388                        "Model MVE instructions as a 4 beats per tick architecture">;
389
390/// Some instructions update CPSR partially, which can add false dependency for
391/// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is
392/// mapped to a separate physical register. Avoid partial CPSR update for these
393/// processors.
394/// True if codegen would avoid using instructions
395/// that partially update CPSR and add false dependency on the previous
396/// CPSR setting instruction.
397def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr",
398                                               "AvoidCPSRPartialUpdate", "true",
399                                 "Avoid CPSR partial update for OOO execution">;
400
401/// Disable +1 predication cost for instructions updating CPSR.
402/// Enabled for Cortex-A57.
403/// True if disable +1 predication cost for instructions updating CPSR. Enabled for Cortex-A57.
404def FeatureCheapPredicableCPSR : SubtargetFeature<"cheap-predicable-cpsr",
405                                                  "CheapPredicableCPSRDef",
406                                                  "true",
407                  "Disable +1 predication cost for instructions updating CPSR">;
408
409// True if codegen should avoid using flag setting movs with shifter operand (i.e. asr, lsl, lsr).
410def FeatureAvoidMOVsShOp  : SubtargetFeature<"avoid-movs-shop",
411                                             "AvoidMOVsShifterOperand", "true",
412                                             "Avoid movs instructions with "
413                                             "shifter operand">;
414
415// Some processors perform return stack prediction. CodeGen should avoid issue
416// "normal" call instructions to callees which do not return.
417def FeatureHasRetAddrStack : SubtargetFeature<"ret-addr-stack",
418                                              "HasRetAddrStack", "true",
419                                              "Has return address stack">;
420
421// Some processors have no branch predictor, which changes the expected cost of
422// taking a branch which affects the choice of whether to use predicated
423// instructions.
424// True if the subtarget has a branch predictor. Having
425// a branch predictor or not changes the expected cost of taking a branch
426// which affects the choice of whether to use predicated instructions.
427def FeatureHasNoBranchPredictor : SubtargetFeature<"no-branch-predictor",
428                                                   "HasBranchPredictor", "false",
429                                                   "Has no branch predictor">;
430
431/// DSP extension.
432/// True if the subtarget supports the DSP (saturating arith and such) instructions.
433def FeatureDSP            : SubtargetFeature<"dsp", "HasDSP", "true",
434                                             "Supports DSP instructions in "
435                                             "ARM and/or Thumb2">;
436
437// True if the subtarget supports Multiprocessing extension (ARMv7 only).
438def FeatureMP             : SubtargetFeature<"mp", "HasMPExtension", "true",
439                                        "Supports Multiprocessing extension">;
440
441// Virtualization extension - requires HW divide (ARMv7-AR ARMARM - 4.4.8).
442def FeatureVirtualization : SubtargetFeature<"virtualization",
443                                             "HasVirtualization", "true",
444                                             "Supports Virtualization extension",
445                                             [FeatureHWDivThumb, FeatureHWDivARM]>;
446
447// Special TRAP encoding for NaCl, which looks like a TRAP in Thumb too.
448// See ARMInstrInfo.td for details.
449// True if NaCl TRAP instruction is generated instead of the regular TRAP.
450def FeatureNaClTrap       : SubtargetFeature<"nacl-trap", "UseNaClTrap", "true",
451                                             "NaCl trap">;
452
453// True if the subtarget disallows unaligned memory
454// accesses for some types.  For details, see
455// ARMTargetLowering::allowsMisalignedMemoryAccesses().
456def FeatureStrictAlign    : SubtargetFeature<"strict-align",
457                                             "StrictAlign", "true",
458                                             "Disallow all unaligned memory "
459                                             "access">;
460
461// Generate calls via indirect call instructions.
462def FeatureLongCalls      : SubtargetFeature<"long-calls", "GenLongCalls", "true",
463                                             "Generate calls via indirect call "
464                                             "instructions">;
465
466// Generate code that does not contain data access to code sections.
467def FeatureExecuteOnly    : SubtargetFeature<"execute-only",
468                                             "GenExecuteOnly", "true",
469                                             "Enable the generation of "
470                                             "execute only code.">;
471
472// True if R9 is not available as a general purpose register.
473def FeatureReserveR9      : SubtargetFeature<"reserve-r9", "ReserveR9", "true",
474                                             "Reserve R9, making it unavailable"
475                                             " as GPR">;
476
477// True if MOVT / MOVW pairs are not used for materialization of
478// 32-bit imms (including global addresses).
479def FeatureNoMovt         : SubtargetFeature<"no-movt", "NoMovt", "true",
480                                             "Don't use movt/movw pairs for "
481                                             "32-bit imms">;
482
483/// Implicitly convert an instruction to a different one if its immediates
484/// cannot be encoded. For example, ADD r0, r1, #FFFFFFFF -> SUB r0, r1, #1.
485def FeatureNoNegativeImmediates
486                          : SubtargetFeature<"no-neg-immediates",
487                                             "NegativeImmediates", "false",
488                                             "Convert immediates and instructions "
489                                             "to their negated or complemented "
490                                             "equivalent when the immediate does "
491                                             "not fit in the encoding.">;
492
493// Use the MachineScheduler for instruction scheduling for the subtarget.
494def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true",
495                                        "Use the MachineScheduler">;
496
497// Use the MachinePipeliner for instruction scheduling for the subtarget.
498def FeatureUseMIPipeliner: SubtargetFeature<"use-mipipeliner", "UseMIPipeliner", "true",
499                                            "Use the MachinePipeliner">;
500
501// False if scheduling should happen again after register allocation.
502def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler",
503    "DisablePostRAScheduler", "true",
504    "Don't schedule again after register allocation">;
505
506// Armv8.5-A extensions
507
508// Has speculation barrier.
509def FeatureSB       : SubtargetFeature<"sb", "HasSB", "true",
510  "Enable v8.5a Speculation Barrier" >;
511
512// Armv8.6-A extensions
513
514// True if subtarget supports BFloat16 floating point operations.
515def FeatureBF16     : SubtargetFeature<"bf16", "HasBF16", "true",
516  "Enable support for BFloat16 instructions",  [FeatureNEON]>;
517
518// True if subtarget supports 8-bit integer matrix multiply.
519def FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
520    "true", "Enable Matrix Multiply Int8 Extension", [FeatureNEON]>;
521
522// Armv8.1-M extensions
523
524// True if the processor supports the Low Overhead Branch extension.
525def FeatureLOB            : SubtargetFeature<"lob", "HasLOB", "true",
526                                             "Enable Low Overhead Branch "
527                                             "extensions">;
528
529// Mitigate against the cve-2021-35465 security vulnurability.
530def FeatureFixCMSE_CVE_2021_35465 : SubtargetFeature<"fix-cmse-cve-2021-35465",
531                                        "FixCMSE_CVE_2021_35465", "true",
532                                        "Mitigate against the cve-2021-35465 "
533                                        "security vulnurability">;
534
535def FeaturePACBTI         : SubtargetFeature<"pacbti", "HasPACBTI", "true",
536                                             "Enable Pointer Authentication and Branch "
537                                             "Target Identification">;
538
539/// Don't place a BTI instruction after return-twice constructs (setjmp).
540def FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice",
541                                                 "NoBTIAtReturnTwice", "true",
542                                                 "Don't place a BTI instruction "
543                                                 "after a return-twice">;
544
545def FeatureFixCortexA57AES1742098 : SubtargetFeature<"fix-cortex-a57-aes-1742098",
546  "FixCortexA57AES1742098", "true",
547  "Work around Cortex-A57 Erratum 1742098 / Cortex-A72 Erratum 1655431 (AES)">;
548
549def FeatureAAPCSFrameChain : SubtargetFeature<"aapcs-frame-chain",
550                                              "CreateAAPCSFrameChain", "true",
551                                              "Create an AAPCS compliant frame chain">;
552
553def FeatureAAPCSFrameChainLeaf : SubtargetFeature<"aapcs-frame-chain-leaf",
554                                                  "CreateAAPCSFrameChainLeaf", "true",
555                                                  "Create an AAPCS compliant frame chain "
556                                                  "for leaf functions",
557                                                  [FeatureAAPCSFrameChain]>;
558
559// Assume that lock-free 32-bit atomics are available, even if the target
560// and operating system combination would not usually provide them. The user
561// is responsible for providing any necessary __sync implementations. Code
562// built with this feature is not ABI-compatible with code built without this
563// feature, if atomic variables are exposed across the ABI boundary.
564def FeatureAtomics32 : SubtargetFeature<
565    "atomics-32", "HasForced32BitAtomics", "true",
566    "Assume that lock-free 32-bit atomics are available">;
567
568//===----------------------------------------------------------------------===//
569// ARM architecture class
570//
571
572// A-series ISA
573def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass",
574                                     "Is application profile ('A' series)">;
575
576// R-series ISA
577def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass",
578                                     "Is realtime profile ('R' series)">;
579
580// M-series ISA
581def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass",
582                                     "Is microcontroller profile ('M' series)">;
583
584// True if Thumb2 instructions are supported.
585def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true",
586                                     "Enable Thumb2 instructions">;
587
588// True if subtarget does not support ARM mode execution.
589def FeatureNoARM  : SubtargetFeature<"noarm", "NoARM", "true",
590                                     "Does not support ARM mode execution">;
591
592//===----------------------------------------------------------------------===//
593// ARM ISAa.
594//
595// Specify whether target support specific ARM ISA variants.
596
597def HasV4TOps   : SubtargetFeature<"v4t", "HasV4TOps", "true",
598                                   "Support ARM v4T instructions">;
599
600def HasV5TOps   : SubtargetFeature<"v5t", "HasV5TOps", "true",
601                                   "Support ARM v5T instructions",
602                                   [HasV4TOps]>;
603
604def HasV5TEOps  : SubtargetFeature<"v5te", "HasV5TEOps", "true",
605                                   "Support ARM v5TE, v5TEj, and "
606                                   "v5TExp instructions",
607                                   [HasV5TOps]>;
608
609def HasV6Ops    : SubtargetFeature<"v6", "HasV6Ops", "true",
610                                   "Support ARM v6 instructions",
611                                   [HasV5TEOps]>;
612
613def HasV6MOps   : SubtargetFeature<"v6m", "HasV6MOps", "true",
614                                   "Support ARM v6M instructions",
615                                   [HasV6Ops]>;
616
617def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true",
618                                         "Support ARM v8M Baseline instructions",
619                                         [HasV6MOps]>;
620
621def HasV6KOps   : SubtargetFeature<"v6k", "HasV6KOps", "true",
622                                   "Support ARM v6k instructions",
623                                   [HasV6Ops]>;
624
625def HasV6T2Ops  : SubtargetFeature<"v6t2", "HasV6T2Ops", "true",
626                                   "Support ARM v6t2 instructions",
627                                   [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>;
628
629def HasV7Ops    : SubtargetFeature<"v7", "HasV7Ops", "true",
630                                   "Support ARM v7 instructions",
631                                   [HasV6T2Ops, FeatureV7Clrex]>;
632
633def HasV8MMainlineOps :
634                  SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true",
635                                   "Support ARM v8M Mainline instructions",
636                                   [HasV7Ops]>;
637
638def HasV8Ops    : SubtargetFeature<"v8", "HasV8Ops", "true",
639                                   "Support ARM v8 instructions",
640                                   [HasV7Ops, FeaturePerfMon, FeatureAcquireRelease]>;
641
642def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
643                                   "Support ARM v8.1a instructions",
644                                   [HasV8Ops]>;
645
646def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
647                                   "Support ARM v8.2a instructions",
648                                   [HasV8_1aOps]>;
649
650def HasV8_3aOps   : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
651                                   "Support ARM v8.3a instructions",
652                                   [HasV8_2aOps]>;
653
654def HasV8_4aOps   : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
655                                   "Support ARM v8.4a instructions",
656                                   [HasV8_3aOps, FeatureDotProd]>;
657
658def HasV8_5aOps   : SubtargetFeature<"v8.5a", "HasV8_5aOps", "true",
659                                   "Support ARM v8.5a instructions",
660                                   [HasV8_4aOps, FeatureSB]>;
661
662def HasV8_6aOps   : SubtargetFeature<"v8.6a", "HasV8_6aOps", "true",
663                                   "Support ARM v8.6a instructions",
664                                   [HasV8_5aOps, FeatureBF16,
665                                    FeatureMatMulInt8]>;
666
667def HasV8_7aOps   : SubtargetFeature<"v8.7a", "HasV8_7aOps", "true",
668                                   "Support ARM v8.7a instructions",
669                                   [HasV8_6aOps]>;
670
671def HasV8_8aOps   : SubtargetFeature<"v8.8a", "HasV8_8aOps", "true",
672                                   "Support ARM v8.8a instructions",
673                                   [HasV8_7aOps]>;
674
675def HasV9_0aOps   : SubtargetFeature<"v9a", "HasV9_0aOps", "true",
676                                   "Support ARM v9a instructions",
677                                   [HasV8_5aOps]>;
678
679def HasV9_1aOps   : SubtargetFeature<"v9.1a", "HasV9_1aOps", "true",
680                                   "Support ARM v9.1a instructions",
681                                   [HasV8_6aOps, HasV9_0aOps]>;
682
683def HasV9_2aOps   : SubtargetFeature<"v9.2a", "HasV9_2aOps", "true",
684                                   "Support ARM v9.2a instructions",
685                                   [HasV8_7aOps, HasV9_1aOps]>;
686
687def HasV9_3aOps   : SubtargetFeature<"v9.3a", "HasV9_3aOps", "true",
688                                   "Support ARM v9.3a instructions",
689                                   [HasV8_8aOps, HasV9_2aOps]>;
690
691def HasV8_1MMainlineOps : SubtargetFeature<
692               "v8.1m.main", "HasV8_1MMainlineOps", "true",
693               "Support ARM v8-1M Mainline instructions",
694               [HasV8MMainlineOps]>;
695def HasMVEIntegerOps : SubtargetFeature<
696               "mve", "HasMVEIntegerOps", "true",
697               "Support M-Class Vector Extension with integer ops",
698               [HasV8_1MMainlineOps, FeatureDSP, FeatureFPRegs16, FeatureFPRegs64]>;
699def HasMVEFloatOps : SubtargetFeature<
700               "mve.fp", "HasMVEFloatOps", "true",
701               "Support M-Class Vector Extension with integer and floating ops",
702               [HasMVEIntegerOps, FeatureFPARMv8_D16_SP, FeatureFullFP16]>;
703
704def HasCDEOps : SubtargetFeature<"cde", "HasCDEOps", "true",
705                                 "Support CDE instructions",
706                                 [HasV8MMainlineOps]>;
707
708foreach i = {0-7} in
709    def FeatureCoprocCDE#i : SubtargetFeature<"cdecp"#i,
710                                              "CoprocCDE["#i#"]", "true",
711                                              "Coprocessor "#i#" ISA is CDEv1",
712                                              [HasCDEOps]>;
713
714//===----------------------------------------------------------------------===//
715// Control codegen mitigation against Straight Line Speculation vulnerability.
716//===----------------------------------------------------------------------===//
717
718/// Harden against Straight Line Speculation for Returns and Indirect Branches.
719def FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
720  "HardenSlsRetBr", "true",
721  "Harden against straight line speculation across RETurn and BranchRegister "
722  "instructions">;
723/// Harden against Straight Line Speculation for indirect calls.
724def FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
725  "HardenSlsBlr", "true",
726  "Harden against straight line speculation across indirect calls">;
727/// Generate thunk code for SLS mitigation in the normal text section.
728def FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
729  "HardenSlsNoComdat", "true",
730  "Generate thunk code for SLS mitigation in the normal text section">;
731
732//===----------------------------------------------------------------------===//
733// ARM Processor subtarget features.
734//
735
736def ProcA5      : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5",
737                                   "Cortex-A5 ARM processors", []>;
738def ProcA7      : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7",
739                                   "Cortex-A7 ARM processors", []>;
740def ProcA8      : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
741                                   "Cortex-A8 ARM processors", []>;
742def ProcA9      : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
743                                   "Cortex-A9 ARM processors", []>;
744def ProcA12     : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12",
745                                   "Cortex-A12 ARM processors", []>;
746def ProcA15     : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15",
747                                   "Cortex-A15 ARM processors", []>;
748def ProcA17     : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17",
749                                   "Cortex-A17 ARM processors", []>;
750def ProcA32     : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32",
751                                   "Cortex-A32 ARM processors", []>;
752def ProcA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
753                                   "Cortex-A35 ARM processors", []>;
754def ProcA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
755                                   "Cortex-A53 ARM processors", []>;
756def ProcA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
757                                   "Cortex-A55 ARM processors", []>;
758def ProcA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
759                                   "Cortex-A57 ARM processors", []>;
760def ProcA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
761                                   "Cortex-A72 ARM processors", []>;
762def ProcA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
763                                   "Cortex-A73 ARM processors", []>;
764def ProcA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
765                                   "Cortex-A75 ARM processors", []>;
766def ProcA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
767                                   "Cortex-A76 ARM processors", []>;
768def ProcA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
769                                   "Cortex-A77 ARM processors", []>;
770def ProcA78     : SubtargetFeature<"cortex-a78", "ARMProcFamily", "CortexA78",
771                                   "Cortex-A78 ARM processors", []>;
772def ProcA78C    : SubtargetFeature<"a78c", "ARMProcFamily", "CortexA78C",
773                                   "Cortex-A78C ARM processors", []>;
774def ProcA710    : SubtargetFeature<"cortex-a710", "ARMProcFamily",
775                                   "CortexA710", "Cortex-A710 ARM processors", []>;
776def ProcX1      : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
777                                   "Cortex-X1 ARM processors", []>;
778def ProcX1C     : SubtargetFeature<"cortex-x1c", "ARMProcFamily", "CortexX1C",
779                                   "Cortex-X1C ARM processors", []>;
780
781def ProcV1      : SubtargetFeature<"neoverse-v1", "ARMProcFamily",
782                                   "NeoverseV1", "Neoverse-V1 ARM processors", []>;
783
784def ProcKrait   : SubtargetFeature<"krait", "ARMProcFamily", "Krait",
785                                   "Qualcomm Krait processors", []>;
786def ProcKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
787                                   "Qualcomm Kryo processors", []>;
788def ProcSwift   : SubtargetFeature<"swift", "ARMProcFamily", "Swift",
789                                   "Swift ARM processors", []>;
790
791def ProcExynos  : SubtargetFeature<"exynos", "ARMProcFamily", "Exynos",
792                                   "Samsung Exynos processors",
793                                   [FeatureZCZeroing,
794                                    FeatureUseWideStrideVFP,
795                                    FeatureSplatVFPToNeon,
796                                    FeatureSlowVGETLNi32,
797                                    FeatureSlowVDUP32,
798                                    FeatureSlowFPBrcc,
799                                    FeatureProfUnpredicate,
800                                    FeatureHWDivThumb,
801                                    FeatureHWDivARM,
802                                    FeatureHasSlowFPVMLx,
803                                    FeatureHasSlowFPVFMx,
804                                    FeatureHasRetAddrStack,
805                                    FeatureFuseLiterals,
806                                    FeatureFuseAES,
807                                    FeatureExpandMLx,
808                                    FeatureCrypto,
809                                    FeatureCRC]>;
810
811def ProcR4      : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4",
812                                   "Cortex-R4 ARM processors", []>;
813def ProcR5      : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5",
814                                   "Cortex-R5 ARM processors", []>;
815def ProcR7      : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7",
816                                   "Cortex-R7 ARM processors", []>;
817def ProcR52     : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52",
818                                   "Cortex-R52 ARM processors", []>;
819
820def ProcM3      : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3",
821                                   "Cortex-M3 ARM processors", []>;
822def ProcM7      : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7",
823                                   "Cortex-M7 ARM processors", []>;
824
825//===----------------------------------------------------------------------===//
826// ARM Helper classes.
827//
828
829class Architecture<string fname, string aname, list<SubtargetFeature> features>
830  : SubtargetFeature<fname, "ARMArch", aname,
831                     !strconcat(aname, " architecture"), features>;
832
833class ProcNoItin<string Name, list<SubtargetFeature> Features>
834  : Processor<Name, NoItineraries, Features>;
835
836
837//===----------------------------------------------------------------------===//
838// ARM architectures
839//
840
841def ARMv2     : Architecture<"armv2",     "ARMv2",    []>;
842
843def ARMv2a    : Architecture<"armv2a",    "ARMv2a",   []>;
844
845def ARMv3     : Architecture<"armv3",     "ARMv3",    []>;
846
847def ARMv3m    : Architecture<"armv3m",    "ARMv3m",   []>;
848
849def ARMv4     : Architecture<"armv4",     "ARMv4",    []>;
850
851def ARMv4t    : Architecture<"armv4t",    "ARMv4t",   [HasV4TOps]>;
852
853def ARMv5t    : Architecture<"armv5t",    "ARMv5t",   [HasV5TOps]>;
854
855def ARMv5te   : Architecture<"armv5te",   "ARMv5te",  [HasV5TEOps]>;
856
857def ARMv5tej  : Architecture<"armv5tej",  "ARMv5tej", [HasV5TEOps]>;
858
859def ARMv6     : Architecture<"armv6",     "ARMv6",    [HasV6Ops,
860                                                       FeatureDSP]>;
861
862def ARMv6t2   : Architecture<"armv6t2",   "ARMv6t2",  [HasV6T2Ops,
863                                                       FeatureDSP]>;
864
865def ARMv6k    : Architecture<"armv6k",    "ARMv6k",   [HasV6KOps]>;
866
867def ARMv6kz   : Architecture<"armv6kz",   "ARMv6kz",  [HasV6KOps,
868                                                       FeatureTrustZone]>;
869
870def ARMv6m    : Architecture<"armv6-m",   "ARMv6m",   [HasV6MOps,
871                                                       FeatureNoARM,
872                                                       ModeThumb,
873                                                       FeatureDB,
874                                                       FeatureMClass,
875                                                       FeatureStrictAlign]>;
876
877def ARMv6sm   : Architecture<"armv6s-m",  "ARMv6sm",  [HasV6MOps,
878                                                       FeatureNoARM,
879                                                       ModeThumb,
880                                                       FeatureDB,
881                                                       FeatureMClass,
882                                                       FeatureStrictAlign]>;
883
884def ARMv7a    : Architecture<"armv7-a",   "ARMv7a",   [HasV7Ops,
885                                                       FeatureNEON,
886                                                       FeatureDB,
887                                                       FeatureDSP,
888                                                       FeatureAClass,
889                                                       FeaturePerfMon]>;
890
891def ARMv7ve   : Architecture<"armv7ve",   "ARMv7ve",  [HasV7Ops,
892                                                       FeatureNEON,
893                                                       FeatureDB,
894                                                       FeatureDSP,
895                                                       FeatureTrustZone,
896                                                       FeatureMP,
897                                                       FeatureVirtualization,
898                                                       FeatureAClass,
899                                                       FeaturePerfMon]>;
900
901def ARMv7r    : Architecture<"armv7-r",   "ARMv7r",   [HasV7Ops,
902                                                       FeatureDB,
903                                                       FeatureDSP,
904                                                       FeatureHWDivThumb,
905                                                       FeatureRClass,
906                                                       FeaturePerfMon]>;
907
908def ARMv7m    : Architecture<"armv7-m",   "ARMv7m",   [HasV7Ops,
909                                                       FeatureThumb2,
910                                                       FeatureNoARM,
911                                                       ModeThumb,
912                                                       FeatureDB,
913                                                       FeatureHWDivThumb,
914                                                       FeatureMClass]>;
915
916def ARMv7em   : Architecture<"armv7e-m",  "ARMv7em",  [HasV7Ops,
917                                                       FeatureThumb2,
918                                                       FeatureNoARM,
919                                                       ModeThumb,
920                                                       FeatureDB,
921                                                       FeatureHWDivThumb,
922                                                       FeatureMClass,
923                                                       FeatureDSP]>;
924
925def ARMv8a    : Architecture<"armv8-a",   "ARMv8a",   [HasV8Ops,
926                                                       FeatureAClass,
927                                                       FeatureDB,
928                                                       FeatureFPARMv8,
929                                                       FeatureNEON,
930                                                       FeatureDSP,
931                                                       FeatureTrustZone,
932                                                       FeatureMP,
933                                                       FeatureVirtualization,
934                                                       FeatureCrypto,
935                                                       FeatureCRC]>;
936
937def ARMv81a   : Architecture<"armv8.1-a", "ARMv81a",  [HasV8_1aOps,
938                                                       FeatureAClass,
939                                                       FeatureDB,
940                                                       FeatureFPARMv8,
941                                                       FeatureNEON,
942                                                       FeatureDSP,
943                                                       FeatureTrustZone,
944                                                       FeatureMP,
945                                                       FeatureVirtualization,
946                                                       FeatureCrypto,
947                                                       FeatureCRC]>;
948
949def ARMv82a   : Architecture<"armv8.2-a", "ARMv82a",  [HasV8_2aOps,
950                                                       FeatureAClass,
951                                                       FeatureDB,
952                                                       FeatureFPARMv8,
953                                                       FeatureNEON,
954                                                       FeatureDSP,
955                                                       FeatureTrustZone,
956                                                       FeatureMP,
957                                                       FeatureVirtualization,
958                                                       FeatureCrypto,
959                                                       FeatureCRC,
960                                                       FeatureRAS]>;
961
962def ARMv83a   : Architecture<"armv8.3-a", "ARMv83a",  [HasV8_3aOps,
963                                                       FeatureAClass,
964                                                       FeatureDB,
965                                                       FeatureFPARMv8,
966                                                       FeatureNEON,
967                                                       FeatureDSP,
968                                                       FeatureTrustZone,
969                                                       FeatureMP,
970                                                       FeatureVirtualization,
971                                                       FeatureCrypto,
972                                                       FeatureCRC,
973                                                       FeatureRAS]>;
974
975def ARMv84a   : Architecture<"armv8.4-a", "ARMv84a",  [HasV8_4aOps,
976                                                       FeatureAClass,
977                                                       FeatureDB,
978                                                       FeatureFPARMv8,
979                                                       FeatureNEON,
980                                                       FeatureDSP,
981                                                       FeatureTrustZone,
982                                                       FeatureMP,
983                                                       FeatureVirtualization,
984                                                       FeatureCrypto,
985                                                       FeatureCRC,
986                                                       FeatureRAS,
987                                                       FeatureDotProd]>;
988
989def ARMv85a   : Architecture<"armv8.5-a", "ARMv85a",  [HasV8_5aOps,
990                                                       FeatureAClass,
991                                                       FeatureDB,
992                                                       FeatureFPARMv8,
993                                                       FeatureNEON,
994                                                       FeatureDSP,
995                                                       FeatureTrustZone,
996                                                       FeatureMP,
997                                                       FeatureVirtualization,
998                                                       FeatureCrypto,
999                                                       FeatureCRC,
1000                                                       FeatureRAS,
1001                                                       FeatureDotProd]>;
1002def ARMv86a   : Architecture<"armv8.6-a", "ARMv86a",  [HasV8_6aOps,
1003                                                       FeatureAClass,
1004                                                       FeatureDB,
1005                                                       FeatureFPARMv8,
1006                                                       FeatureNEON,
1007                                                       FeatureDSP,
1008                                                       FeatureTrustZone,
1009                                                       FeatureMP,
1010                                                       FeatureVirtualization,
1011                                                       FeatureCrypto,
1012                                                       FeatureCRC,
1013                                                       FeatureRAS,
1014                                                       FeatureDotProd]>;
1015def ARMv87a   : Architecture<"armv8.7-a", "ARMv87a",  [HasV8_7aOps,
1016                                                       FeatureAClass,
1017                                                       FeatureDB,
1018                                                       FeatureFPARMv8,
1019                                                       FeatureNEON,
1020                                                       FeatureDSP,
1021                                                       FeatureTrustZone,
1022                                                       FeatureMP,
1023                                                       FeatureVirtualization,
1024                                                       FeatureCrypto,
1025                                                       FeatureCRC,
1026                                                       FeatureRAS,
1027                                                       FeatureDotProd]>;
1028def ARMv88a   : Architecture<"armv8.8-a", "ARMv88a",  [HasV8_8aOps,
1029                                                       FeatureAClass,
1030                                                       FeatureDB,
1031                                                       FeatureFPARMv8,
1032                                                       FeatureNEON,
1033                                                       FeatureDSP,
1034                                                       FeatureTrustZone,
1035                                                       FeatureMP,
1036                                                       FeatureVirtualization,
1037                                                       FeatureCrypto,
1038                                                       FeatureCRC,
1039                                                       FeatureRAS,
1040                                                       FeatureDotProd]>;
1041
1042def ARMv9a   : Architecture<"armv9-a", "ARMv9a",       [HasV9_0aOps,
1043                                                       FeatureAClass,
1044                                                       FeatureDB,
1045                                                       FeatureFPARMv8,
1046                                                       FeatureNEON,
1047                                                       FeatureDSP,
1048                                                       FeatureTrustZone,
1049                                                       FeatureMP,
1050                                                       FeatureVirtualization,
1051                                                       FeatureCRC,
1052                                                       FeatureRAS,
1053                                                       FeatureDotProd]>;
1054def ARMv91a   : Architecture<"armv9.1-a", "ARMv91a",   [HasV9_1aOps,
1055                                                       FeatureAClass,
1056                                                       FeatureDB,
1057                                                       FeatureFPARMv8,
1058                                                       FeatureNEON,
1059                                                       FeatureDSP,
1060                                                       FeatureTrustZone,
1061                                                       FeatureMP,
1062                                                       FeatureVirtualization,
1063                                                       FeatureCRC,
1064                                                       FeatureRAS,
1065                                                       FeatureDotProd]>;
1066def ARMv92a   : Architecture<"armv9.2-a", "ARMv92a",  [HasV9_2aOps,
1067                                                       FeatureAClass,
1068                                                       FeatureDB,
1069                                                       FeatureFPARMv8,
1070                                                       FeatureNEON,
1071                                                       FeatureDSP,
1072                                                       FeatureTrustZone,
1073                                                       FeatureMP,
1074                                                       FeatureVirtualization,
1075                                                       FeatureCRC,
1076                                                       FeatureRAS,
1077                                                       FeatureDotProd]>;
1078def ARMv93a   : Architecture<"armv9.3-a", "ARMv93a",  [HasV9_3aOps,
1079                                                       FeatureAClass,
1080                                                       FeatureDB,
1081                                                       FeatureFPARMv8,
1082                                                       FeatureNEON,
1083                                                       FeatureDSP,
1084                                                       FeatureTrustZone,
1085                                                       FeatureMP,
1086                                                       FeatureVirtualization,
1087                                                       FeatureCrypto,
1088                                                       FeatureCRC,
1089                                                       FeatureRAS,
1090                                                       FeatureDotProd]>;
1091
1092def ARMv8r    : Architecture<"armv8-r",   "ARMv8r",   [HasV8Ops,
1093                                                       FeatureRClass,
1094                                                       FeatureDB,
1095                                                       FeatureDFB,
1096                                                       FeatureDSP,
1097                                                       FeatureCRC,
1098                                                       FeatureMP,
1099                                                       FeatureVirtualization,
1100                                                       FeatureFPARMv8,
1101                                                       FeatureNEON]>;
1102
1103def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline",
1104                                                      [HasV8MBaselineOps,
1105                                                       FeatureNoARM,
1106                                                       ModeThumb,
1107                                                       FeatureDB,
1108                                                       FeatureHWDivThumb,
1109                                                       FeatureV7Clrex,
1110                                                       Feature8MSecExt,
1111                                                       FeatureAcquireRelease,
1112                                                       FeatureMClass,
1113                                                       FeatureStrictAlign]>;
1114
1115def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline",
1116                                                      [HasV8MMainlineOps,
1117                                                       FeatureNoARM,
1118                                                       ModeThumb,
1119                                                       FeatureDB,
1120                                                       FeatureHWDivThumb,
1121                                                       Feature8MSecExt,
1122                                                       FeatureAcquireRelease,
1123                                                       FeatureMClass]>;
1124
1125def ARMv81mMainline : Architecture<"armv8.1-m.main", "ARMv81mMainline",
1126                                                      [HasV8_1MMainlineOps,
1127                                                       FeatureNoARM,
1128                                                       ModeThumb,
1129                                                       FeatureDB,
1130                                                       FeatureHWDivThumb,
1131                                                       Feature8MSecExt,
1132                                                       FeatureAcquireRelease,
1133                                                       FeatureMClass,
1134                                                       FeatureRAS,
1135                                                       FeatureLOB]>;
1136
1137// Aliases
1138def IWMMXT   : Architecture<"iwmmxt",      "ARMv5te",  [ARMv5te]>;
1139def IWMMXT2  : Architecture<"iwmmxt2",     "ARMv5te",  [ARMv5te]>;
1140def XScale   : Architecture<"xscale",      "ARMv5te",  [ARMv5te]>;
1141def ARMv6j   : Architecture<"armv6j",      "ARMv7a",   [ARMv6]>;
1142def ARMv7k   : Architecture<"armv7k",      "ARMv7a",   [ARMv7a]>;
1143def ARMv7s   : Architecture<"armv7s",      "ARMv7a",   [ARMv7a]>;
1144
1145//===----------------------------------------------------------------------===//
1146// Register File Description
1147//===----------------------------------------------------------------------===//
1148
1149include "ARMRegisterInfo.td"
1150include "ARMRegisterBanks.td"
1151include "ARMCallingConv.td"
1152
1153//===----------------------------------------------------------------------===//
1154// ARM schedules.
1155//===----------------------------------------------------------------------===//
1156//
1157include "ARMPredicates.td"
1158include "ARMSchedule.td"
1159
1160//===----------------------------------------------------------------------===//
1161// Instruction Descriptions
1162//===----------------------------------------------------------------------===//
1163
1164include "ARMInstrInfo.td"
1165def ARMInstrInfo : InstrInfo;
1166
1167//===----------------------------------------------------------------------===//
1168// ARM schedules
1169//
1170include "ARMScheduleV6.td"
1171include "ARMScheduleA8.td"
1172include "ARMScheduleA9.td"
1173include "ARMScheduleSwift.td"
1174include "ARMScheduleR52.td"
1175include "ARMScheduleA57.td"
1176include "ARMScheduleM4.td"
1177include "ARMScheduleM7.td"
1178
1179//===----------------------------------------------------------------------===//
1180// ARM processors
1181//
1182// Dummy CPU, used to target architectures
1183def : ProcessorModel<"generic",     CortexA8Model,      []>;
1184
1185// FIXME: Several processors below are not using their own scheduler
1186// model, but one of similar/previous processor. These should be fixed.
1187
1188def : ProcNoItin<"arm8",                                [ARMv4]>;
1189def : ProcNoItin<"arm810",                              [ARMv4]>;
1190def : ProcNoItin<"strongarm",                           [ARMv4]>;
1191def : ProcNoItin<"strongarm110",                        [ARMv4]>;
1192def : ProcNoItin<"strongarm1100",                       [ARMv4]>;
1193def : ProcNoItin<"strongarm1110",                       [ARMv4]>;
1194
1195def : ProcNoItin<"arm7tdmi",                            [ARMv4t]>;
1196def : ProcNoItin<"arm7tdmi-s",                          [ARMv4t]>;
1197def : ProcNoItin<"arm710t",                             [ARMv4t]>;
1198def : ProcNoItin<"arm720t",                             [ARMv4t]>;
1199def : ProcNoItin<"arm9",                                [ARMv4t]>;
1200def : ProcNoItin<"arm9tdmi",                            [ARMv4t]>;
1201def : ProcNoItin<"arm920",                              [ARMv4t]>;
1202def : ProcNoItin<"arm920t",                             [ARMv4t]>;
1203def : ProcNoItin<"arm922t",                             [ARMv4t]>;
1204def : ProcNoItin<"arm940t",                             [ARMv4t]>;
1205def : ProcNoItin<"ep9312",                              [ARMv4t]>;
1206
1207def : ProcNoItin<"arm10tdmi",                           [ARMv5t]>;
1208def : ProcNoItin<"arm1020t",                            [ARMv5t]>;
1209
1210def : ProcNoItin<"arm9e",                               [ARMv5te]>;
1211def : ProcNoItin<"arm926ej-s",                          [ARMv5te]>;
1212def : ProcNoItin<"arm946e-s",                           [ARMv5te]>;
1213def : ProcNoItin<"arm966e-s",                           [ARMv5te]>;
1214def : ProcNoItin<"arm968e-s",                           [ARMv5te]>;
1215def : ProcNoItin<"arm10e",                              [ARMv5te]>;
1216def : ProcNoItin<"arm1020e",                            [ARMv5te]>;
1217def : ProcNoItin<"arm1022e",                            [ARMv5te]>;
1218def : ProcNoItin<"xscale",                              [ARMv5te]>;
1219def : ProcNoItin<"iwmmxt",                              [ARMv5te]>;
1220
1221def : Processor<"arm1136j-s",       ARMV6Itineraries,   [ARMv6]>;
1222def : Processor<"arm1136jf-s",      ARMV6Itineraries,   [ARMv6,
1223                                                         FeatureVFP2,
1224                                                         FeatureHasSlowFPVMLx]>;
1225
1226def : Processor<"cortex-m0",        ARMV6Itineraries,   [ARMv6m,
1227                                                         FeatureHasNoBranchPredictor]>;
1228def : Processor<"cortex-m0plus",    ARMV6Itineraries,   [ARMv6m,
1229                                                         FeatureHasNoBranchPredictor]>;
1230def : Processor<"cortex-m1",        ARMV6Itineraries,   [ARMv6m,
1231                                                         FeatureHasNoBranchPredictor]>;
1232def : Processor<"sc000",            ARMV6Itineraries,   [ARMv6m,
1233                                                         FeatureHasNoBranchPredictor]>;
1234
1235def : Processor<"arm1176jz-s",      ARMV6Itineraries,   [ARMv6kz]>;
1236def : Processor<"arm1176jzf-s",     ARMV6Itineraries,   [ARMv6kz,
1237                                                         FeatureVFP2,
1238                                                         FeatureHasSlowFPVMLx]>;
1239
1240def : Processor<"mpcorenovfp",      ARMV6Itineraries,   [ARMv6k]>;
1241def : Processor<"mpcore",           ARMV6Itineraries,   [ARMv6k,
1242                                                         FeatureVFP2,
1243                                                         FeatureHasSlowFPVMLx]>;
1244
1245def : Processor<"arm1156t2-s",      ARMV6Itineraries,   [ARMv6t2]>;
1246def : Processor<"arm1156t2f-s",     ARMV6Itineraries,   [ARMv6t2,
1247                                                         FeatureVFP2,
1248                                                         FeatureHasSlowFPVMLx]>;
1249
1250def : ProcessorModel<"cortex-a5",   CortexA8Model,      [ARMv7a, ProcA5,
1251                                                         FeatureHasRetAddrStack,
1252                                                         FeatureTrustZone,
1253                                                         FeatureSlowFPBrcc,
1254                                                         FeatureHasSlowFPVMLx,
1255                                                         FeatureHasSlowFPVFMx,
1256                                                         FeatureVMLxForwarding,
1257                                                         FeatureMP,
1258                                                         FeatureVFP4]>;
1259
1260def : ProcessorModel<"cortex-a7",   CortexA8Model,      [ARMv7a, ProcA7,
1261                                                         FeatureHasRetAddrStack,
1262                                                         FeatureTrustZone,
1263                                                         FeatureSlowFPBrcc,
1264                                                         FeatureHasVMLxHazards,
1265                                                         FeatureHasSlowFPVMLx,
1266                                                         FeatureHasSlowFPVFMx,
1267                                                         FeatureVMLxForwarding,
1268                                                         FeatureMP,
1269                                                         FeatureVFP4,
1270                                                         FeatureVirtualization]>;
1271
1272def : ProcessorModel<"cortex-a8",   CortexA8Model,      [ARMv7a, ProcA8,
1273                                                         FeatureHasRetAddrStack,
1274                                                         FeatureNonpipelinedVFP,
1275                                                         FeatureTrustZone,
1276                                                         FeatureSlowFPBrcc,
1277                                                         FeatureHasVMLxHazards,
1278                                                         FeatureHasSlowFPVMLx,
1279                                                         FeatureHasSlowFPVFMx,
1280                                                         FeatureVMLxForwarding]>;
1281
1282def : ProcessorModel<"cortex-a9",   CortexA9Model,      [ARMv7a, ProcA9,
1283                                                         FeatureHasRetAddrStack,
1284                                                         FeatureTrustZone,
1285                                                         FeatureHasVMLxHazards,
1286                                                         FeatureVMLxForwarding,
1287                                                         FeatureFP16,
1288                                                         FeatureAvoidPartialCPSR,
1289                                                         FeatureExpandMLx,
1290                                                         FeaturePreferVMOVSR,
1291                                                         FeatureMuxedUnits,
1292                                                         FeatureNEONForFPMovs,
1293                                                         FeatureCheckVLDnAlign,
1294                                                         FeatureMP]>;
1295
1296def : ProcessorModel<"cortex-a12",  CortexA9Model,      [ARMv7a, ProcA12,
1297                                                         FeatureHasRetAddrStack,
1298                                                         FeatureTrustZone,
1299                                                         FeatureVMLxForwarding,
1300                                                         FeatureVFP4,
1301                                                         FeatureAvoidPartialCPSR,
1302                                                         FeatureVirtualization,
1303                                                         FeatureMP]>;
1304
1305def : ProcessorModel<"cortex-a15",  CortexA9Model,      [ARMv7a, ProcA15,
1306                                                         FeatureDontWidenVMOVS,
1307                                                         FeatureSplatVFPToNeon,
1308                                                         FeatureHasRetAddrStack,
1309                                                         FeatureMuxedUnits,
1310                                                         FeatureTrustZone,
1311                                                         FeatureVFP4,
1312                                                         FeatureMP,
1313                                                         FeatureCheckVLDnAlign,
1314                                                         FeatureAvoidPartialCPSR,
1315                                                         FeatureVirtualization]>;
1316
1317def : ProcessorModel<"cortex-a17",  CortexA9Model,      [ARMv7a, ProcA17,
1318                                                         FeatureHasRetAddrStack,
1319                                                         FeatureTrustZone,
1320                                                         FeatureMP,
1321                                                         FeatureVMLxForwarding,
1322                                                         FeatureVFP4,
1323                                                         FeatureAvoidPartialCPSR,
1324                                                         FeatureVirtualization]>;
1325
1326// FIXME: krait has currently the same features as A9 plus VFP4 and  HWDiv
1327def : ProcessorModel<"krait",       CortexA9Model,      [ARMv7a, ProcKrait,
1328                                                         FeatureHasRetAddrStack,
1329                                                         FeatureMuxedUnits,
1330                                                         FeatureCheckVLDnAlign,
1331                                                         FeatureVMLxForwarding,
1332                                                         FeatureFP16,
1333                                                         FeatureAvoidPartialCPSR,
1334                                                         FeatureVFP4,
1335                                                         FeatureHWDivThumb,
1336                                                         FeatureHWDivARM]>;
1337
1338def : ProcessorModel<"swift",       SwiftModel,         [ARMv7a, ProcSwift,
1339                                                         FeatureHasRetAddrStack,
1340                                                         FeatureNEONForFP,
1341                                                         FeatureVFP4,
1342                                                         FeatureUseWideStrideVFP,
1343                                                         FeatureMP,
1344                                                         FeatureHWDivThumb,
1345                                                         FeatureHWDivARM,
1346                                                         FeatureAvoidPartialCPSR,
1347                                                         FeatureAvoidMOVsShOp,
1348                                                         FeatureHasSlowFPVMLx,
1349                                                         FeatureHasSlowFPVFMx,
1350                                                         FeatureHasVMLxHazards,
1351                                                         FeatureProfUnpredicate,
1352                                                         FeaturePrefISHSTBarrier,
1353                                                         FeatureSlowOddRegister,
1354                                                         FeatureSlowLoadDSubreg,
1355                                                         FeatureSlowVGETLNi32,
1356                                                         FeatureSlowVDUP32,
1357                                                         FeatureUseMISched,
1358                                                         FeatureNoPostRASched]>;
1359
1360def : ProcessorModel<"cortex-r4",   CortexA8Model,      [ARMv7r, ProcR4,
1361                                                         FeatureHasRetAddrStack,
1362                                                         FeatureAvoidPartialCPSR]>;
1363
1364def : ProcessorModel<"cortex-r4f",  CortexA8Model,      [ARMv7r, ProcR4,
1365                                                         FeatureHasRetAddrStack,
1366                                                         FeatureSlowFPBrcc,
1367                                                         FeatureHasSlowFPVMLx,
1368                                                         FeatureHasSlowFPVFMx,
1369                                                         FeatureVFP3_D16,
1370                                                         FeatureAvoidPartialCPSR]>;
1371
1372def : ProcessorModel<"cortex-r5",   CortexA8Model,      [ARMv7r, ProcR5,
1373                                                         FeatureHasRetAddrStack,
1374                                                         FeatureVFP3_D16,
1375                                                         FeatureSlowFPBrcc,
1376                                                         FeatureHWDivARM,
1377                                                         FeatureHasSlowFPVMLx,
1378                                                         FeatureHasSlowFPVFMx,
1379                                                         FeatureAvoidPartialCPSR]>;
1380
1381def : ProcessorModel<"cortex-r7",   CortexA8Model,      [ARMv7r, ProcR7,
1382                                                         FeatureHasRetAddrStack,
1383                                                         FeatureVFP3_D16,
1384                                                         FeatureFP16,
1385                                                         FeatureMP,
1386                                                         FeatureSlowFPBrcc,
1387                                                         FeatureHWDivARM,
1388                                                         FeatureHasSlowFPVMLx,
1389                                                         FeatureHasSlowFPVFMx,
1390                                                         FeatureAvoidPartialCPSR]>;
1391
1392def : ProcessorModel<"cortex-r8",   CortexA8Model,      [ARMv7r,
1393                                                         FeatureHasRetAddrStack,
1394                                                         FeatureVFP3_D16,
1395                                                         FeatureFP16,
1396                                                         FeatureMP,
1397                                                         FeatureSlowFPBrcc,
1398                                                         FeatureHWDivARM,
1399                                                         FeatureHasSlowFPVMLx,
1400                                                         FeatureHasSlowFPVFMx,
1401                                                         FeatureAvoidPartialCPSR]>;
1402
1403def : ProcessorModel<"cortex-m3",   CortexM4Model,      [ARMv7m,
1404                                                         ProcM3,
1405                                                         FeaturePrefLoopAlign32,
1406                                                         FeatureUseMISched,
1407                                                         FeatureHasNoBranchPredictor]>;
1408
1409def : ProcessorModel<"sc300",       CortexM4Model,      [ARMv7m,
1410                                                         ProcM3,
1411                                                         FeatureUseMISched,
1412                                                         FeatureHasNoBranchPredictor]>;
1413
1414def : ProcessorModel<"cortex-m4", CortexM4Model,        [ARMv7em,
1415                                                         FeatureVFP4_D16_SP,
1416                                                         FeaturePrefLoopAlign32,
1417                                                         FeatureHasSlowFPVMLx,
1418                                                         FeatureHasSlowFPVFMx,
1419                                                         FeatureUseMISched,
1420                                                         FeatureHasNoBranchPredictor]>;
1421
1422def : ProcessorModel<"cortex-m7", CortexM7Model,        [ARMv7em,
1423                                                         ProcM7,
1424                                                         FeatureFPARMv8_D16,
1425                                                         FeatureUseMIPipeliner,
1426                                                         FeatureUseMISched]>;
1427
1428def : ProcNoItin<"cortex-m23",                          [ARMv8mBaseline,
1429                                                         FeatureNoMovt,
1430                                                         FeatureHasNoBranchPredictor]>;
1431
1432def : ProcessorModel<"cortex-m33", CortexM4Model,       [ARMv8mMainline,
1433                                                         FeatureDSP,
1434                                                         FeatureFPARMv8_D16_SP,
1435                                                         FeaturePrefLoopAlign32,
1436                                                         FeatureHasSlowFPVMLx,
1437                                                         FeatureHasSlowFPVFMx,
1438                                                         FeatureUseMISched,
1439                                                         FeatureHasNoBranchPredictor,
1440                                                         FeatureFixCMSE_CVE_2021_35465]>;
1441
1442def : ProcessorModel<"cortex-m35p", CortexM4Model,      [ARMv8mMainline,
1443                                                         FeatureDSP,
1444                                                         FeatureFPARMv8_D16_SP,
1445                                                         FeaturePrefLoopAlign32,
1446                                                         FeatureHasSlowFPVMLx,
1447                                                         FeatureHasSlowFPVFMx,
1448                                                         FeatureUseMISched,
1449                                                         FeatureHasNoBranchPredictor,
1450                                                         FeatureFixCMSE_CVE_2021_35465]>;
1451
1452def : ProcessorModel<"cortex-m55", CortexM4Model,      [ARMv81mMainline,
1453                                                         FeatureDSP,
1454                                                         FeatureFPARMv8_D16,
1455                                                         FeatureUseMISched,
1456                                                         FeatureHasNoBranchPredictor,
1457                                                         FeaturePrefLoopAlign32,
1458                                                         FeatureHasSlowFPVMLx,
1459                                                         HasMVEFloatOps,
1460                                                         FeatureFixCMSE_CVE_2021_35465]>;
1461
1462def : ProcessorModel<"cortex-m85", CortexM7Model,       [ARMv81mMainline,
1463                                                         FeatureDSP,
1464                                                         FeatureFPARMv8_D16,
1465                                                         FeaturePACBTI,
1466                                                         FeatureUseMISched,
1467                                                         HasMVEFloatOps]>;
1468
1469def : ProcNoItin<"cortex-a32",                           [ARMv8a,
1470                                                         FeatureHWDivThumb,
1471                                                         FeatureHWDivARM,
1472                                                         FeatureCrypto,
1473                                                         FeatureCRC]>;
1474
1475def : ProcNoItin<"cortex-a35",                          [ARMv8a, ProcA35,
1476                                                         FeatureHWDivThumb,
1477                                                         FeatureHWDivARM,
1478                                                         FeatureCrypto,
1479                                                         FeatureCRC]>;
1480
1481def : ProcNoItin<"cortex-a53",                          [ARMv8a, ProcA53,
1482                                                         FeatureHWDivThumb,
1483                                                         FeatureHWDivARM,
1484                                                         FeatureCrypto,
1485                                                         FeatureCRC,
1486                                                         FeatureFPAO]>;
1487
1488def : ProcNoItin<"cortex-a55",                          [ARMv82a, ProcA55,
1489                                                         FeatureHWDivThumb,
1490                                                         FeatureHWDivARM,
1491                                                         FeatureDotProd]>;
1492
1493def : ProcessorModel<"cortex-a57",  CortexA57Model,     [ARMv8a, ProcA57,
1494                                                         FeatureHWDivThumb,
1495                                                         FeatureHWDivARM,
1496                                                         FeatureCrypto,
1497                                                         FeatureCRC,
1498                                                         FeatureFPAO,
1499                                                         FeatureAvoidPartialCPSR,
1500                                                         FeatureCheapPredicableCPSR,
1501                                                         FeatureFixCortexA57AES1742098]>;
1502
1503def : ProcessorModel<"cortex-a72",  CortexA57Model,     [ARMv8a, ProcA72,
1504                                                         FeatureHWDivThumb,
1505                                                         FeatureHWDivARM,
1506                                                         FeatureCrypto,
1507                                                         FeatureCRC,
1508                                                         FeatureFixCortexA57AES1742098]>;
1509
1510def : ProcNoItin<"cortex-a73",                          [ARMv8a, ProcA73,
1511                                                         FeatureHWDivThumb,
1512                                                         FeatureHWDivARM,
1513                                                         FeatureCrypto,
1514                                                         FeatureCRC]>;
1515
1516def : ProcNoItin<"cortex-a75",                          [ARMv82a, ProcA75,
1517                                                         FeatureHWDivThumb,
1518                                                         FeatureHWDivARM,
1519                                                         FeatureDotProd]>;
1520
1521def : ProcNoItin<"cortex-a76",                          [ARMv82a, ProcA76,
1522                                                         FeatureHWDivThumb,
1523                                                         FeatureHWDivARM,
1524                                                         FeatureCrypto,
1525                                                         FeatureCRC,
1526                                                         FeatureFullFP16,
1527                                                         FeatureDotProd]>;
1528
1529def : ProcNoItin<"cortex-a76ae",                        [ARMv82a, ProcA76,
1530                                                         FeatureHWDivThumb,
1531                                                         FeatureHWDivARM,
1532                                                         FeatureCrypto,
1533                                                         FeatureCRC,
1534                                                         FeatureFullFP16,
1535                                                         FeatureDotProd]>;
1536
1537def : ProcNoItin<"cortex-a77",                          [ARMv82a, ProcA77,
1538                                                         FeatureHWDivThumb,
1539                                                         FeatureHWDivARM,
1540                                                         FeatureCrypto,
1541                                                         FeatureCRC,
1542                                                         FeatureFullFP16,
1543                                                         FeatureDotProd]>;
1544
1545def : ProcNoItin<"cortex-a78",                          [ARMv82a, ProcA78,
1546                                                         FeatureHWDivThumb,
1547                                                         FeatureHWDivARM,
1548                                                         FeatureCrypto,
1549                                                         FeatureCRC,
1550                                                         FeatureFullFP16,
1551                                                         FeatureDotProd]>;
1552
1553def : ProcNoItin<"cortex-a78c",                         [ARMv82a, ProcA78C,
1554                                                         FeatureHWDivThumb,
1555                                                         FeatureHWDivARM,
1556                                                         FeatureCrypto,
1557                                                         FeatureCRC,
1558                                                         FeatureDotProd,
1559                                                         FeatureFullFP16]>;
1560
1561def : ProcNoItin<"cortex-a710",                         [ARMv9a, ProcA710,
1562                                                         FeatureHWDivThumb,
1563                                                         FeatureHWDivARM,
1564                                                         FeatureFP16FML,
1565                                                         FeatureBF16,
1566                                                         FeatureMatMulInt8,
1567                                                         FeatureSB]>;
1568
1569def : ProcNoItin<"cortex-x1",                           [ARMv82a, ProcX1,
1570                                                         FeatureHWDivThumb,
1571                                                         FeatureHWDivARM,
1572                                                         FeatureCrypto,
1573                                                         FeatureCRC,
1574                                                         FeatureFullFP16,
1575                                                         FeatureDotProd]>;
1576
1577def : ProcNoItin<"cortex-x1c",                          [ARMv82a, ProcX1C,
1578                                                         FeatureHWDivThumb,
1579                                                         FeatureHWDivARM,
1580                                                         FeatureCrypto,
1581                                                         FeatureCRC,
1582                                                         FeatureFullFP16,
1583                                                         FeatureDotProd]>;
1584
1585def : ProcNoItin<"neoverse-v1",                         [ARMv84a,
1586                                                         FeatureHWDivThumb,
1587                                                         FeatureHWDivARM,
1588                                                         FeatureCrypto,
1589                                                         FeatureCRC,
1590                                                         FeatureFullFP16,
1591                                                         FeatureBF16,
1592                                                         FeatureMatMulInt8]>;
1593
1594def : ProcNoItin<"neoverse-n1",                         [ARMv82a,
1595                                                         FeatureHWDivThumb,
1596                                                         FeatureHWDivARM,
1597                                                         FeatureCrypto,
1598                                                         FeatureCRC,
1599                                                         FeatureDotProd]>;
1600
1601def : ProcNoItin<"neoverse-n2",                         [ARMv85a,
1602                                                         FeatureBF16,
1603                                                         FeatureMatMulInt8]>;
1604
1605def : ProcessorModel<"cyclone",     SwiftModel,         [ARMv8a, ProcSwift,
1606                                                         FeatureHasRetAddrStack,
1607                                                         FeatureNEONForFP,
1608                                                         FeatureVFP4,
1609                                                         FeatureMP,
1610                                                         FeatureHWDivThumb,
1611                                                         FeatureHWDivARM,
1612                                                         FeatureAvoidPartialCPSR,
1613                                                         FeatureAvoidMOVsShOp,
1614                                                         FeatureHasSlowFPVMLx,
1615                                                         FeatureHasSlowFPVFMx,
1616                                                         FeatureCrypto,
1617                                                         FeatureUseMISched,
1618                                                         FeatureZCZeroing,
1619                                                         FeatureNoPostRASched]>;
1620
1621def : ProcNoItin<"exynos-m3",                           [ARMv8a, ProcExynos]>;
1622def : ProcNoItin<"exynos-m4",                           [ARMv82a, ProcExynos,
1623                                                         FeatureFullFP16,
1624                                                         FeatureDotProd]>;
1625def : ProcNoItin<"exynos-m5",                           [ARMv82a, ProcExynos,
1626                                                         FeatureFullFP16,
1627                                                         FeatureDotProd]>;
1628
1629def : ProcNoItin<"kryo",                                [ARMv8a, ProcKryo,
1630                                                         FeatureHWDivThumb,
1631                                                         FeatureHWDivARM,
1632                                                         FeatureCrypto,
1633                                                         FeatureCRC]>;
1634
1635def : ProcessorModel<"cortex-r52", CortexR52Model,      [ARMv8r, ProcR52,
1636                                                         FeatureUseMISched,
1637                                                         FeatureFPAO]>;
1638
1639//===----------------------------------------------------------------------===//
1640// Declare the target which we are implementing
1641//===----------------------------------------------------------------------===//
1642
1643def ARMAsmWriter : AsmWriter {
1644  string AsmWriterClassName  = "InstPrinter";
1645  int PassSubtarget = 1;
1646  int Variant = 0;
1647  bit isMCAsmWriter = 1;
1648}
1649
1650def ARMAsmParser : AsmParser {
1651  bit ReportMultipleNearMisses = 1;
1652}
1653
1654def ARMAsmParserVariant : AsmParserVariant {
1655  int Variant = 0;
1656  string Name = "ARM";
1657  string BreakCharacters = ".";
1658}
1659
1660def ARM : Target {
1661  // Pull in Instruction Info.
1662  let InstructionSet = ARMInstrInfo;
1663  let AssemblyWriters = [ARMAsmWriter];
1664  let AssemblyParsers = [ARMAsmParser];
1665  let AssemblyParserVariants = [ARMAsmParserVariant];
1666  let AllowRegisterRenaming = 1;
1667}
1668