xref: /llvm-project-15.0.7/llvm/lib/Target/ARM/ARM.td (revision aba0d3cd)
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//===----------------------------------------------------------------------===//
560// ARM architecture class
561//
562
563// A-series ISA
564def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass",
565                                     "Is application profile ('A' series)">;
566
567// R-series ISA
568def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass",
569                                     "Is realtime profile ('R' series)">;
570
571// M-series ISA
572def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass",
573                                     "Is microcontroller profile ('M' series)">;
574
575// True if Thumb2 instructions are supported.
576def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true",
577                                     "Enable Thumb2 instructions">;
578
579// True if subtarget does not support ARM mode execution.
580def FeatureNoARM  : SubtargetFeature<"noarm", "NoARM", "true",
581                                     "Does not support ARM mode execution">;
582
583//===----------------------------------------------------------------------===//
584// ARM ISAa.
585//
586// Specify whether target support specific ARM ISA variants.
587
588def HasV4TOps   : SubtargetFeature<"v4t", "HasV4TOps", "true",
589                                   "Support ARM v4T instructions">;
590
591def HasV5TOps   : SubtargetFeature<"v5t", "HasV5TOps", "true",
592                                   "Support ARM v5T instructions",
593                                   [HasV4TOps]>;
594
595def HasV5TEOps  : SubtargetFeature<"v5te", "HasV5TEOps", "true",
596                                   "Support ARM v5TE, v5TEj, and "
597                                   "v5TExp instructions",
598                                   [HasV5TOps]>;
599
600def HasV6Ops    : SubtargetFeature<"v6", "HasV6Ops", "true",
601                                   "Support ARM v6 instructions",
602                                   [HasV5TEOps]>;
603
604def HasV6MOps   : SubtargetFeature<"v6m", "HasV6MOps", "true",
605                                   "Support ARM v6M instructions",
606                                   [HasV6Ops]>;
607
608def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true",
609                                         "Support ARM v8M Baseline instructions",
610                                         [HasV6MOps]>;
611
612def HasV6KOps   : SubtargetFeature<"v6k", "HasV6KOps", "true",
613                                   "Support ARM v6k instructions",
614                                   [HasV6Ops]>;
615
616def HasV6T2Ops  : SubtargetFeature<"v6t2", "HasV6T2Ops", "true",
617                                   "Support ARM v6t2 instructions",
618                                   [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>;
619
620def HasV7Ops    : SubtargetFeature<"v7", "HasV7Ops", "true",
621                                   "Support ARM v7 instructions",
622                                   [HasV6T2Ops, FeatureV7Clrex]>;
623
624def HasV8MMainlineOps :
625                  SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true",
626                                   "Support ARM v8M Mainline instructions",
627                                   [HasV7Ops]>;
628
629def HasV8Ops    : SubtargetFeature<"v8", "HasV8Ops", "true",
630                                   "Support ARM v8 instructions",
631                                   [HasV7Ops, FeaturePerfMon, FeatureAcquireRelease]>;
632
633def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
634                                   "Support ARM v8.1a instructions",
635                                   [HasV8Ops]>;
636
637def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
638                                   "Support ARM v8.2a instructions",
639                                   [HasV8_1aOps]>;
640
641def HasV8_3aOps   : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
642                                   "Support ARM v8.3a instructions",
643                                   [HasV8_2aOps]>;
644
645def HasV8_4aOps   : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
646                                   "Support ARM v8.4a instructions",
647                                   [HasV8_3aOps, FeatureDotProd]>;
648
649def HasV8_5aOps   : SubtargetFeature<"v8.5a", "HasV8_5aOps", "true",
650                                   "Support ARM v8.5a instructions",
651                                   [HasV8_4aOps, FeatureSB]>;
652
653def HasV8_6aOps   : SubtargetFeature<"v8.6a", "HasV8_6aOps", "true",
654                                   "Support ARM v8.6a instructions",
655                                   [HasV8_5aOps, FeatureBF16,
656                                    FeatureMatMulInt8]>;
657
658def HasV8_7aOps   : SubtargetFeature<"v8.7a", "HasV8_7aOps", "true",
659                                   "Support ARM v8.7a instructions",
660                                   [HasV8_6aOps]>;
661
662def HasV8_8aOps   : SubtargetFeature<"v8.8a", "HasV8_8aOps", "true",
663                                   "Support ARM v8.8a instructions",
664                                   [HasV8_7aOps]>;
665
666def HasV9_0aOps   : SubtargetFeature<"v9a", "HasV9_0aOps", "true",
667                                   "Support ARM v9a instructions",
668                                   [HasV8_5aOps]>;
669
670def HasV9_1aOps   : SubtargetFeature<"v9.1a", "HasV9_1aOps", "true",
671                                   "Support ARM v9.1a instructions",
672                                   [HasV8_6aOps, HasV9_0aOps]>;
673
674def HasV9_2aOps   : SubtargetFeature<"v9.2a", "HasV9_2aOps", "true",
675                                   "Support ARM v9.2a instructions",
676                                   [HasV8_7aOps, HasV9_1aOps]>;
677
678def HasV9_3aOps   : SubtargetFeature<"v9.3a", "HasV9_3aOps", "true",
679                                   "Support ARM v9.3a instructions",
680                                   [HasV8_8aOps, HasV9_2aOps]>;
681
682def HasV8_1MMainlineOps : SubtargetFeature<
683               "v8.1m.main", "HasV8_1MMainlineOps", "true",
684               "Support ARM v8-1M Mainline instructions",
685               [HasV8MMainlineOps]>;
686def HasMVEIntegerOps : SubtargetFeature<
687               "mve", "HasMVEIntegerOps", "true",
688               "Support M-Class Vector Extension with integer ops",
689               [HasV8_1MMainlineOps, FeatureDSP, FeatureFPRegs16, FeatureFPRegs64]>;
690def HasMVEFloatOps : SubtargetFeature<
691               "mve.fp", "HasMVEFloatOps", "true",
692               "Support M-Class Vector Extension with integer and floating ops",
693               [HasMVEIntegerOps, FeatureFPARMv8_D16_SP, FeatureFullFP16]>;
694
695def HasCDEOps : SubtargetFeature<"cde", "HasCDEOps", "true",
696                                 "Support CDE instructions",
697                                 [HasV8MMainlineOps]>;
698
699foreach i = {0-7} in
700    def FeatureCoprocCDE#i : SubtargetFeature<"cdecp"#i,
701                                              "CoprocCDE["#i#"]", "true",
702                                              "Coprocessor "#i#" ISA is CDEv1",
703                                              [HasCDEOps]>;
704
705//===----------------------------------------------------------------------===//
706// Control codegen mitigation against Straight Line Speculation vulnerability.
707//===----------------------------------------------------------------------===//
708
709/// Harden against Straight Line Speculation for Returns and Indirect Branches.
710def FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
711  "HardenSlsRetBr", "true",
712  "Harden against straight line speculation across RETurn and BranchRegister "
713  "instructions">;
714/// Harden against Straight Line Speculation for indirect calls.
715def FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
716  "HardenSlsBlr", "true",
717  "Harden against straight line speculation across indirect calls">;
718/// Generate thunk code for SLS mitigation in the normal text section.
719def FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat",
720  "HardenSlsNoComdat", "true",
721  "Generate thunk code for SLS mitigation in the normal text section">;
722
723//===----------------------------------------------------------------------===//
724// ARM Processor subtarget features.
725//
726
727def ProcA5      : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5",
728                                   "Cortex-A5 ARM processors", []>;
729def ProcA7      : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7",
730                                   "Cortex-A7 ARM processors", []>;
731def ProcA8      : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
732                                   "Cortex-A8 ARM processors", []>;
733def ProcA9      : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
734                                   "Cortex-A9 ARM processors", []>;
735def ProcA12     : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12",
736                                   "Cortex-A12 ARM processors", []>;
737def ProcA15     : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15",
738                                   "Cortex-A15 ARM processors", []>;
739def ProcA17     : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17",
740                                   "Cortex-A17 ARM processors", []>;
741def ProcA32     : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32",
742                                   "Cortex-A32 ARM processors", []>;
743def ProcA35     : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
744                                   "Cortex-A35 ARM processors", []>;
745def ProcA53     : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
746                                   "Cortex-A53 ARM processors", []>;
747def ProcA55     : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
748                                   "Cortex-A55 ARM processors", []>;
749def ProcA57     : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
750                                   "Cortex-A57 ARM processors", []>;
751def ProcA72     : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
752                                   "Cortex-A72 ARM processors", []>;
753def ProcA73     : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
754                                   "Cortex-A73 ARM processors", []>;
755def ProcA75     : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
756                                   "Cortex-A75 ARM processors", []>;
757def ProcA76     : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
758                                   "Cortex-A76 ARM processors", []>;
759def ProcA77     : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
760                                   "Cortex-A77 ARM processors", []>;
761def ProcA78     : SubtargetFeature<"cortex-a78", "ARMProcFamily", "CortexA78",
762                                   "Cortex-A78 ARM processors", []>;
763def ProcA78C    : SubtargetFeature<"a78c", "ARMProcFamily", "CortexA78C",
764                                   "Cortex-A78C ARM processors", []>;
765def ProcA710    : SubtargetFeature<"cortex-a710", "ARMProcFamily",
766                                   "CortexA710", "Cortex-A710 ARM processors", []>;
767def ProcX1      : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
768                                   "Cortex-X1 ARM processors", []>;
769def ProcX1C     : SubtargetFeature<"cortex-x1c", "ARMProcFamily", "CortexX1C",
770                                   "Cortex-X1C ARM processors", []>;
771
772def ProcV1      : SubtargetFeature<"neoverse-v1", "ARMProcFamily",
773                                   "NeoverseV1", "Neoverse-V1 ARM processors", []>;
774
775def ProcKrait   : SubtargetFeature<"krait", "ARMProcFamily", "Krait",
776                                   "Qualcomm Krait processors", []>;
777def ProcKryo    : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
778                                   "Qualcomm Kryo processors", []>;
779def ProcSwift   : SubtargetFeature<"swift", "ARMProcFamily", "Swift",
780                                   "Swift ARM processors", []>;
781
782def ProcExynos  : SubtargetFeature<"exynos", "ARMProcFamily", "Exynos",
783                                   "Samsung Exynos processors",
784                                   [FeatureZCZeroing,
785                                    FeatureUseWideStrideVFP,
786                                    FeatureSplatVFPToNeon,
787                                    FeatureSlowVGETLNi32,
788                                    FeatureSlowVDUP32,
789                                    FeatureSlowFPBrcc,
790                                    FeatureProfUnpredicate,
791                                    FeatureHWDivThumb,
792                                    FeatureHWDivARM,
793                                    FeatureHasSlowFPVMLx,
794                                    FeatureHasSlowFPVFMx,
795                                    FeatureHasRetAddrStack,
796                                    FeatureFuseLiterals,
797                                    FeatureFuseAES,
798                                    FeatureExpandMLx,
799                                    FeatureCrypto,
800                                    FeatureCRC]>;
801
802def ProcR4      : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4",
803                                   "Cortex-R4 ARM processors", []>;
804def ProcR5      : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5",
805                                   "Cortex-R5 ARM processors", []>;
806def ProcR7      : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7",
807                                   "Cortex-R7 ARM processors", []>;
808def ProcR52     : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52",
809                                   "Cortex-R52 ARM processors", []>;
810
811def ProcM3      : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3",
812                                   "Cortex-M3 ARM processors", []>;
813def ProcM7      : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7",
814                                   "Cortex-M7 ARM processors", []>;
815
816//===----------------------------------------------------------------------===//
817// ARM Helper classes.
818//
819
820class Architecture<string fname, string aname, list<SubtargetFeature> features>
821  : SubtargetFeature<fname, "ARMArch", aname,
822                     !strconcat(aname, " architecture"), features>;
823
824class ProcNoItin<string Name, list<SubtargetFeature> Features>
825  : Processor<Name, NoItineraries, Features>;
826
827
828//===----------------------------------------------------------------------===//
829// ARM architectures
830//
831
832def ARMv2     : Architecture<"armv2",     "ARMv2",    []>;
833
834def ARMv2a    : Architecture<"armv2a",    "ARMv2a",   []>;
835
836def ARMv3     : Architecture<"armv3",     "ARMv3",    []>;
837
838def ARMv3m    : Architecture<"armv3m",    "ARMv3m",   []>;
839
840def ARMv4     : Architecture<"armv4",     "ARMv4",    []>;
841
842def ARMv4t    : Architecture<"armv4t",    "ARMv4t",   [HasV4TOps]>;
843
844def ARMv5t    : Architecture<"armv5t",    "ARMv5t",   [HasV5TOps]>;
845
846def ARMv5te   : Architecture<"armv5te",   "ARMv5te",  [HasV5TEOps]>;
847
848def ARMv5tej  : Architecture<"armv5tej",  "ARMv5tej", [HasV5TEOps]>;
849
850def ARMv6     : Architecture<"armv6",     "ARMv6",    [HasV6Ops,
851                                                       FeatureDSP]>;
852
853def ARMv6t2   : Architecture<"armv6t2",   "ARMv6t2",  [HasV6T2Ops,
854                                                       FeatureDSP]>;
855
856def ARMv6k    : Architecture<"armv6k",    "ARMv6k",   [HasV6KOps]>;
857
858def ARMv6kz   : Architecture<"armv6kz",   "ARMv6kz",  [HasV6KOps,
859                                                       FeatureTrustZone]>;
860
861def ARMv6m    : Architecture<"armv6-m",   "ARMv6m",   [HasV6MOps,
862                                                       FeatureNoARM,
863                                                       ModeThumb,
864                                                       FeatureDB,
865                                                       FeatureMClass,
866                                                       FeatureStrictAlign]>;
867
868def ARMv6sm   : Architecture<"armv6s-m",  "ARMv6sm",  [HasV6MOps,
869                                                       FeatureNoARM,
870                                                       ModeThumb,
871                                                       FeatureDB,
872                                                       FeatureMClass,
873                                                       FeatureStrictAlign]>;
874
875def ARMv7a    : Architecture<"armv7-a",   "ARMv7a",   [HasV7Ops,
876                                                       FeatureNEON,
877                                                       FeatureDB,
878                                                       FeatureDSP,
879                                                       FeatureAClass,
880                                                       FeaturePerfMon]>;
881
882def ARMv7ve   : Architecture<"armv7ve",   "ARMv7ve",  [HasV7Ops,
883                                                       FeatureNEON,
884                                                       FeatureDB,
885                                                       FeatureDSP,
886                                                       FeatureTrustZone,
887                                                       FeatureMP,
888                                                       FeatureVirtualization,
889                                                       FeatureAClass,
890                                                       FeaturePerfMon]>;
891
892def ARMv7r    : Architecture<"armv7-r",   "ARMv7r",   [HasV7Ops,
893                                                       FeatureDB,
894                                                       FeatureDSP,
895                                                       FeatureHWDivThumb,
896                                                       FeatureRClass,
897                                                       FeaturePerfMon]>;
898
899def ARMv7m    : Architecture<"armv7-m",   "ARMv7m",   [HasV7Ops,
900                                                       FeatureThumb2,
901                                                       FeatureNoARM,
902                                                       ModeThumb,
903                                                       FeatureDB,
904                                                       FeatureHWDivThumb,
905                                                       FeatureMClass]>;
906
907def ARMv7em   : Architecture<"armv7e-m",  "ARMv7em",  [HasV7Ops,
908                                                       FeatureThumb2,
909                                                       FeatureNoARM,
910                                                       ModeThumb,
911                                                       FeatureDB,
912                                                       FeatureHWDivThumb,
913                                                       FeatureMClass,
914                                                       FeatureDSP]>;
915
916def ARMv8a    : Architecture<"armv8-a",   "ARMv8a",   [HasV8Ops,
917                                                       FeatureAClass,
918                                                       FeatureDB,
919                                                       FeatureFPARMv8,
920                                                       FeatureNEON,
921                                                       FeatureDSP,
922                                                       FeatureTrustZone,
923                                                       FeatureMP,
924                                                       FeatureVirtualization,
925                                                       FeatureCrypto,
926                                                       FeatureCRC]>;
927
928def ARMv81a   : Architecture<"armv8.1-a", "ARMv81a",  [HasV8_1aOps,
929                                                       FeatureAClass,
930                                                       FeatureDB,
931                                                       FeatureFPARMv8,
932                                                       FeatureNEON,
933                                                       FeatureDSP,
934                                                       FeatureTrustZone,
935                                                       FeatureMP,
936                                                       FeatureVirtualization,
937                                                       FeatureCrypto,
938                                                       FeatureCRC]>;
939
940def ARMv82a   : Architecture<"armv8.2-a", "ARMv82a",  [HasV8_2aOps,
941                                                       FeatureAClass,
942                                                       FeatureDB,
943                                                       FeatureFPARMv8,
944                                                       FeatureNEON,
945                                                       FeatureDSP,
946                                                       FeatureTrustZone,
947                                                       FeatureMP,
948                                                       FeatureVirtualization,
949                                                       FeatureCrypto,
950                                                       FeatureCRC,
951                                                       FeatureRAS]>;
952
953def ARMv83a   : Architecture<"armv8.3-a", "ARMv83a",  [HasV8_3aOps,
954                                                       FeatureAClass,
955                                                       FeatureDB,
956                                                       FeatureFPARMv8,
957                                                       FeatureNEON,
958                                                       FeatureDSP,
959                                                       FeatureTrustZone,
960                                                       FeatureMP,
961                                                       FeatureVirtualization,
962                                                       FeatureCrypto,
963                                                       FeatureCRC,
964                                                       FeatureRAS]>;
965
966def ARMv84a   : Architecture<"armv8.4-a", "ARMv84a",  [HasV8_4aOps,
967                                                       FeatureAClass,
968                                                       FeatureDB,
969                                                       FeatureFPARMv8,
970                                                       FeatureNEON,
971                                                       FeatureDSP,
972                                                       FeatureTrustZone,
973                                                       FeatureMP,
974                                                       FeatureVirtualization,
975                                                       FeatureCrypto,
976                                                       FeatureCRC,
977                                                       FeatureRAS,
978                                                       FeatureDotProd]>;
979
980def ARMv85a   : Architecture<"armv8.5-a", "ARMv85a",  [HasV8_5aOps,
981                                                       FeatureAClass,
982                                                       FeatureDB,
983                                                       FeatureFPARMv8,
984                                                       FeatureNEON,
985                                                       FeatureDSP,
986                                                       FeatureTrustZone,
987                                                       FeatureMP,
988                                                       FeatureVirtualization,
989                                                       FeatureCrypto,
990                                                       FeatureCRC,
991                                                       FeatureRAS,
992                                                       FeatureDotProd]>;
993def ARMv86a   : Architecture<"armv8.6-a", "ARMv86a",  [HasV8_6aOps,
994                                                       FeatureAClass,
995                                                       FeatureDB,
996                                                       FeatureFPARMv8,
997                                                       FeatureNEON,
998                                                       FeatureDSP,
999                                                       FeatureTrustZone,
1000                                                       FeatureMP,
1001                                                       FeatureVirtualization,
1002                                                       FeatureCrypto,
1003                                                       FeatureCRC,
1004                                                       FeatureRAS,
1005                                                       FeatureDotProd]>;
1006def ARMv87a   : Architecture<"armv8.7-a", "ARMv87a",  [HasV8_7aOps,
1007                                                       FeatureAClass,
1008                                                       FeatureDB,
1009                                                       FeatureFPARMv8,
1010                                                       FeatureNEON,
1011                                                       FeatureDSP,
1012                                                       FeatureTrustZone,
1013                                                       FeatureMP,
1014                                                       FeatureVirtualization,
1015                                                       FeatureCrypto,
1016                                                       FeatureCRC,
1017                                                       FeatureRAS,
1018                                                       FeatureDotProd]>;
1019def ARMv88a   : Architecture<"armv8.8-a", "ARMv88a",  [HasV8_8aOps,
1020                                                       FeatureAClass,
1021                                                       FeatureDB,
1022                                                       FeatureFPARMv8,
1023                                                       FeatureNEON,
1024                                                       FeatureDSP,
1025                                                       FeatureTrustZone,
1026                                                       FeatureMP,
1027                                                       FeatureVirtualization,
1028                                                       FeatureCrypto,
1029                                                       FeatureCRC,
1030                                                       FeatureRAS,
1031                                                       FeatureDotProd]>;
1032
1033def ARMv9a   : Architecture<"armv9-a", "ARMv9a",       [HasV9_0aOps,
1034                                                       FeatureAClass,
1035                                                       FeatureDB,
1036                                                       FeatureFPARMv8,
1037                                                       FeatureNEON,
1038                                                       FeatureDSP,
1039                                                       FeatureTrustZone,
1040                                                       FeatureMP,
1041                                                       FeatureVirtualization,
1042                                                       FeatureCRC,
1043                                                       FeatureRAS,
1044                                                       FeatureDotProd]>;
1045def ARMv91a   : Architecture<"armv9.1-a", "ARMv91a",   [HasV9_1aOps,
1046                                                       FeatureAClass,
1047                                                       FeatureDB,
1048                                                       FeatureFPARMv8,
1049                                                       FeatureNEON,
1050                                                       FeatureDSP,
1051                                                       FeatureTrustZone,
1052                                                       FeatureMP,
1053                                                       FeatureVirtualization,
1054                                                       FeatureCRC,
1055                                                       FeatureRAS,
1056                                                       FeatureDotProd]>;
1057def ARMv92a   : Architecture<"armv9.2-a", "ARMv92a",  [HasV9_2aOps,
1058                                                       FeatureAClass,
1059                                                       FeatureDB,
1060                                                       FeatureFPARMv8,
1061                                                       FeatureNEON,
1062                                                       FeatureDSP,
1063                                                       FeatureTrustZone,
1064                                                       FeatureMP,
1065                                                       FeatureVirtualization,
1066                                                       FeatureCRC,
1067                                                       FeatureRAS,
1068                                                       FeatureDotProd]>;
1069def ARMv93a   : Architecture<"armv9.3-a", "ARMv93a",  [HasV9_3aOps,
1070                                                       FeatureAClass,
1071                                                       FeatureDB,
1072                                                       FeatureFPARMv8,
1073                                                       FeatureNEON,
1074                                                       FeatureDSP,
1075                                                       FeatureTrustZone,
1076                                                       FeatureMP,
1077                                                       FeatureVirtualization,
1078                                                       FeatureCrypto,
1079                                                       FeatureCRC,
1080                                                       FeatureRAS,
1081                                                       FeatureDotProd]>;
1082
1083def ARMv8r    : Architecture<"armv8-r",   "ARMv8r",   [HasV8Ops,
1084                                                       FeatureRClass,
1085                                                       FeatureDB,
1086                                                       FeatureDFB,
1087                                                       FeatureDSP,
1088                                                       FeatureCRC,
1089                                                       FeatureMP,
1090                                                       FeatureVirtualization,
1091                                                       FeatureFPARMv8,
1092                                                       FeatureNEON]>;
1093
1094def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline",
1095                                                      [HasV8MBaselineOps,
1096                                                       FeatureNoARM,
1097                                                       ModeThumb,
1098                                                       FeatureDB,
1099                                                       FeatureHWDivThumb,
1100                                                       FeatureV7Clrex,
1101                                                       Feature8MSecExt,
1102                                                       FeatureAcquireRelease,
1103                                                       FeatureMClass,
1104                                                       FeatureStrictAlign]>;
1105
1106def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline",
1107                                                      [HasV8MMainlineOps,
1108                                                       FeatureNoARM,
1109                                                       ModeThumb,
1110                                                       FeatureDB,
1111                                                       FeatureHWDivThumb,
1112                                                       Feature8MSecExt,
1113                                                       FeatureAcquireRelease,
1114                                                       FeatureMClass]>;
1115
1116def ARMv81mMainline : Architecture<"armv8.1-m.main", "ARMv81mMainline",
1117                                                      [HasV8_1MMainlineOps,
1118                                                       FeatureNoARM,
1119                                                       ModeThumb,
1120                                                       FeatureDB,
1121                                                       FeatureHWDivThumb,
1122                                                       Feature8MSecExt,
1123                                                       FeatureAcquireRelease,
1124                                                       FeatureMClass,
1125                                                       FeatureRAS,
1126                                                       FeatureLOB]>;
1127
1128// Aliases
1129def IWMMXT   : Architecture<"iwmmxt",      "ARMv5te",  [ARMv5te]>;
1130def IWMMXT2  : Architecture<"iwmmxt2",     "ARMv5te",  [ARMv5te]>;
1131def XScale   : Architecture<"xscale",      "ARMv5te",  [ARMv5te]>;
1132def ARMv6j   : Architecture<"armv6j",      "ARMv7a",   [ARMv6]>;
1133def ARMv7k   : Architecture<"armv7k",      "ARMv7a",   [ARMv7a]>;
1134def ARMv7s   : Architecture<"armv7s",      "ARMv7a",   [ARMv7a]>;
1135
1136//===----------------------------------------------------------------------===//
1137// Register File Description
1138//===----------------------------------------------------------------------===//
1139
1140include "ARMRegisterInfo.td"
1141include "ARMRegisterBanks.td"
1142include "ARMCallingConv.td"
1143
1144//===----------------------------------------------------------------------===//
1145// ARM schedules.
1146//===----------------------------------------------------------------------===//
1147//
1148include "ARMPredicates.td"
1149include "ARMSchedule.td"
1150
1151//===----------------------------------------------------------------------===//
1152// Instruction Descriptions
1153//===----------------------------------------------------------------------===//
1154
1155include "ARMInstrInfo.td"
1156def ARMInstrInfo : InstrInfo;
1157
1158//===----------------------------------------------------------------------===//
1159// ARM schedules
1160//
1161include "ARMScheduleV6.td"
1162include "ARMScheduleA8.td"
1163include "ARMScheduleA9.td"
1164include "ARMScheduleSwift.td"
1165include "ARMScheduleR52.td"
1166include "ARMScheduleA57.td"
1167include "ARMScheduleM4.td"
1168include "ARMScheduleM7.td"
1169
1170//===----------------------------------------------------------------------===//
1171// ARM processors
1172//
1173// Dummy CPU, used to target architectures
1174def : ProcessorModel<"generic",     CortexA8Model,      []>;
1175
1176// FIXME: Several processors below are not using their own scheduler
1177// model, but one of similar/previous processor. These should be fixed.
1178
1179def : ProcNoItin<"arm8",                                [ARMv4]>;
1180def : ProcNoItin<"arm810",                              [ARMv4]>;
1181def : ProcNoItin<"strongarm",                           [ARMv4]>;
1182def : ProcNoItin<"strongarm110",                        [ARMv4]>;
1183def : ProcNoItin<"strongarm1100",                       [ARMv4]>;
1184def : ProcNoItin<"strongarm1110",                       [ARMv4]>;
1185
1186def : ProcNoItin<"arm7tdmi",                            [ARMv4t]>;
1187def : ProcNoItin<"arm7tdmi-s",                          [ARMv4t]>;
1188def : ProcNoItin<"arm710t",                             [ARMv4t]>;
1189def : ProcNoItin<"arm720t",                             [ARMv4t]>;
1190def : ProcNoItin<"arm9",                                [ARMv4t]>;
1191def : ProcNoItin<"arm9tdmi",                            [ARMv4t]>;
1192def : ProcNoItin<"arm920",                              [ARMv4t]>;
1193def : ProcNoItin<"arm920t",                             [ARMv4t]>;
1194def : ProcNoItin<"arm922t",                             [ARMv4t]>;
1195def : ProcNoItin<"arm940t",                             [ARMv4t]>;
1196def : ProcNoItin<"ep9312",                              [ARMv4t]>;
1197
1198def : ProcNoItin<"arm10tdmi",                           [ARMv5t]>;
1199def : ProcNoItin<"arm1020t",                            [ARMv5t]>;
1200
1201def : ProcNoItin<"arm9e",                               [ARMv5te]>;
1202def : ProcNoItin<"arm926ej-s",                          [ARMv5te]>;
1203def : ProcNoItin<"arm946e-s",                           [ARMv5te]>;
1204def : ProcNoItin<"arm966e-s",                           [ARMv5te]>;
1205def : ProcNoItin<"arm968e-s",                           [ARMv5te]>;
1206def : ProcNoItin<"arm10e",                              [ARMv5te]>;
1207def : ProcNoItin<"arm1020e",                            [ARMv5te]>;
1208def : ProcNoItin<"arm1022e",                            [ARMv5te]>;
1209def : ProcNoItin<"xscale",                              [ARMv5te]>;
1210def : ProcNoItin<"iwmmxt",                              [ARMv5te]>;
1211
1212def : Processor<"arm1136j-s",       ARMV6Itineraries,   [ARMv6]>;
1213def : Processor<"arm1136jf-s",      ARMV6Itineraries,   [ARMv6,
1214                                                         FeatureVFP2,
1215                                                         FeatureHasSlowFPVMLx]>;
1216
1217def : Processor<"cortex-m0",        ARMV6Itineraries,   [ARMv6m,
1218                                                         FeatureHasNoBranchPredictor]>;
1219def : Processor<"cortex-m0plus",    ARMV6Itineraries,   [ARMv6m,
1220                                                         FeatureHasNoBranchPredictor]>;
1221def : Processor<"cortex-m1",        ARMV6Itineraries,   [ARMv6m,
1222                                                         FeatureHasNoBranchPredictor]>;
1223def : Processor<"sc000",            ARMV6Itineraries,   [ARMv6m,
1224                                                         FeatureHasNoBranchPredictor]>;
1225
1226def : Processor<"arm1176jz-s",      ARMV6Itineraries,   [ARMv6kz]>;
1227def : Processor<"arm1176jzf-s",     ARMV6Itineraries,   [ARMv6kz,
1228                                                         FeatureVFP2,
1229                                                         FeatureHasSlowFPVMLx]>;
1230
1231def : Processor<"mpcorenovfp",      ARMV6Itineraries,   [ARMv6k]>;
1232def : Processor<"mpcore",           ARMV6Itineraries,   [ARMv6k,
1233                                                         FeatureVFP2,
1234                                                         FeatureHasSlowFPVMLx]>;
1235
1236def : Processor<"arm1156t2-s",      ARMV6Itineraries,   [ARMv6t2]>;
1237def : Processor<"arm1156t2f-s",     ARMV6Itineraries,   [ARMv6t2,
1238                                                         FeatureVFP2,
1239                                                         FeatureHasSlowFPVMLx]>;
1240
1241def : ProcessorModel<"cortex-a5",   CortexA8Model,      [ARMv7a, ProcA5,
1242                                                         FeatureHasRetAddrStack,
1243                                                         FeatureTrustZone,
1244                                                         FeatureSlowFPBrcc,
1245                                                         FeatureHasSlowFPVMLx,
1246                                                         FeatureHasSlowFPVFMx,
1247                                                         FeatureVMLxForwarding,
1248                                                         FeatureMP,
1249                                                         FeatureVFP4]>;
1250
1251def : ProcessorModel<"cortex-a7",   CortexA8Model,      [ARMv7a, ProcA7,
1252                                                         FeatureHasRetAddrStack,
1253                                                         FeatureTrustZone,
1254                                                         FeatureSlowFPBrcc,
1255                                                         FeatureHasVMLxHazards,
1256                                                         FeatureHasSlowFPVMLx,
1257                                                         FeatureHasSlowFPVFMx,
1258                                                         FeatureVMLxForwarding,
1259                                                         FeatureMP,
1260                                                         FeatureVFP4,
1261                                                         FeatureVirtualization]>;
1262
1263def : ProcessorModel<"cortex-a8",   CortexA8Model,      [ARMv7a, ProcA8,
1264                                                         FeatureHasRetAddrStack,
1265                                                         FeatureNonpipelinedVFP,
1266                                                         FeatureTrustZone,
1267                                                         FeatureSlowFPBrcc,
1268                                                         FeatureHasVMLxHazards,
1269                                                         FeatureHasSlowFPVMLx,
1270                                                         FeatureHasSlowFPVFMx,
1271                                                         FeatureVMLxForwarding]>;
1272
1273def : ProcessorModel<"cortex-a9",   CortexA9Model,      [ARMv7a, ProcA9,
1274                                                         FeatureHasRetAddrStack,
1275                                                         FeatureTrustZone,
1276                                                         FeatureHasVMLxHazards,
1277                                                         FeatureVMLxForwarding,
1278                                                         FeatureFP16,
1279                                                         FeatureAvoidPartialCPSR,
1280                                                         FeatureExpandMLx,
1281                                                         FeaturePreferVMOVSR,
1282                                                         FeatureMuxedUnits,
1283                                                         FeatureNEONForFPMovs,
1284                                                         FeatureCheckVLDnAlign,
1285                                                         FeatureMP]>;
1286
1287def : ProcessorModel<"cortex-a12",  CortexA9Model,      [ARMv7a, ProcA12,
1288                                                         FeatureHasRetAddrStack,
1289                                                         FeatureTrustZone,
1290                                                         FeatureVMLxForwarding,
1291                                                         FeatureVFP4,
1292                                                         FeatureAvoidPartialCPSR,
1293                                                         FeatureVirtualization,
1294                                                         FeatureMP]>;
1295
1296def : ProcessorModel<"cortex-a15",  CortexA9Model,      [ARMv7a, ProcA15,
1297                                                         FeatureDontWidenVMOVS,
1298                                                         FeatureSplatVFPToNeon,
1299                                                         FeatureHasRetAddrStack,
1300                                                         FeatureMuxedUnits,
1301                                                         FeatureTrustZone,
1302                                                         FeatureVFP4,
1303                                                         FeatureMP,
1304                                                         FeatureCheckVLDnAlign,
1305                                                         FeatureAvoidPartialCPSR,
1306                                                         FeatureVirtualization]>;
1307
1308def : ProcessorModel<"cortex-a17",  CortexA9Model,      [ARMv7a, ProcA17,
1309                                                         FeatureHasRetAddrStack,
1310                                                         FeatureTrustZone,
1311                                                         FeatureMP,
1312                                                         FeatureVMLxForwarding,
1313                                                         FeatureVFP4,
1314                                                         FeatureAvoidPartialCPSR,
1315                                                         FeatureVirtualization]>;
1316
1317// FIXME: krait has currently the same features as A9 plus VFP4 and  HWDiv
1318def : ProcessorModel<"krait",       CortexA9Model,      [ARMv7a, ProcKrait,
1319                                                         FeatureHasRetAddrStack,
1320                                                         FeatureMuxedUnits,
1321                                                         FeatureCheckVLDnAlign,
1322                                                         FeatureVMLxForwarding,
1323                                                         FeatureFP16,
1324                                                         FeatureAvoidPartialCPSR,
1325                                                         FeatureVFP4,
1326                                                         FeatureHWDivThumb,
1327                                                         FeatureHWDivARM]>;
1328
1329def : ProcessorModel<"swift",       SwiftModel,         [ARMv7a, ProcSwift,
1330                                                         FeatureHasRetAddrStack,
1331                                                         FeatureNEONForFP,
1332                                                         FeatureVFP4,
1333                                                         FeatureUseWideStrideVFP,
1334                                                         FeatureMP,
1335                                                         FeatureHWDivThumb,
1336                                                         FeatureHWDivARM,
1337                                                         FeatureAvoidPartialCPSR,
1338                                                         FeatureAvoidMOVsShOp,
1339                                                         FeatureHasSlowFPVMLx,
1340                                                         FeatureHasSlowFPVFMx,
1341                                                         FeatureHasVMLxHazards,
1342                                                         FeatureProfUnpredicate,
1343                                                         FeaturePrefISHSTBarrier,
1344                                                         FeatureSlowOddRegister,
1345                                                         FeatureSlowLoadDSubreg,
1346                                                         FeatureSlowVGETLNi32,
1347                                                         FeatureSlowVDUP32,
1348                                                         FeatureUseMISched,
1349                                                         FeatureNoPostRASched]>;
1350
1351def : ProcessorModel<"cortex-r4",   CortexA8Model,      [ARMv7r, ProcR4,
1352                                                         FeatureHasRetAddrStack,
1353                                                         FeatureAvoidPartialCPSR]>;
1354
1355def : ProcessorModel<"cortex-r4f",  CortexA8Model,      [ARMv7r, ProcR4,
1356                                                         FeatureHasRetAddrStack,
1357                                                         FeatureSlowFPBrcc,
1358                                                         FeatureHasSlowFPVMLx,
1359                                                         FeatureHasSlowFPVFMx,
1360                                                         FeatureVFP3_D16,
1361                                                         FeatureAvoidPartialCPSR]>;
1362
1363def : ProcessorModel<"cortex-r5",   CortexA8Model,      [ARMv7r, ProcR5,
1364                                                         FeatureHasRetAddrStack,
1365                                                         FeatureVFP3_D16,
1366                                                         FeatureSlowFPBrcc,
1367                                                         FeatureHWDivARM,
1368                                                         FeatureHasSlowFPVMLx,
1369                                                         FeatureHasSlowFPVFMx,
1370                                                         FeatureAvoidPartialCPSR]>;
1371
1372def : ProcessorModel<"cortex-r7",   CortexA8Model,      [ARMv7r, ProcR7,
1373                                                         FeatureHasRetAddrStack,
1374                                                         FeatureVFP3_D16,
1375                                                         FeatureFP16,
1376                                                         FeatureMP,
1377                                                         FeatureSlowFPBrcc,
1378                                                         FeatureHWDivARM,
1379                                                         FeatureHasSlowFPVMLx,
1380                                                         FeatureHasSlowFPVFMx,
1381                                                         FeatureAvoidPartialCPSR]>;
1382
1383def : ProcessorModel<"cortex-r8",   CortexA8Model,      [ARMv7r,
1384                                                         FeatureHasRetAddrStack,
1385                                                         FeatureVFP3_D16,
1386                                                         FeatureFP16,
1387                                                         FeatureMP,
1388                                                         FeatureSlowFPBrcc,
1389                                                         FeatureHWDivARM,
1390                                                         FeatureHasSlowFPVMLx,
1391                                                         FeatureHasSlowFPVFMx,
1392                                                         FeatureAvoidPartialCPSR]>;
1393
1394def : ProcessorModel<"cortex-m3",   CortexM4Model,      [ARMv7m,
1395                                                         ProcM3,
1396                                                         FeaturePrefLoopAlign32,
1397                                                         FeatureUseMISched,
1398                                                         FeatureHasNoBranchPredictor]>;
1399
1400def : ProcessorModel<"sc300",       CortexM4Model,      [ARMv7m,
1401                                                         ProcM3,
1402                                                         FeatureUseMISched,
1403                                                         FeatureHasNoBranchPredictor]>;
1404
1405def : ProcessorModel<"cortex-m4", CortexM4Model,        [ARMv7em,
1406                                                         FeatureVFP4_D16_SP,
1407                                                         FeaturePrefLoopAlign32,
1408                                                         FeatureHasSlowFPVMLx,
1409                                                         FeatureHasSlowFPVFMx,
1410                                                         FeatureUseMISched,
1411                                                         FeatureHasNoBranchPredictor]>;
1412
1413def : ProcessorModel<"cortex-m7", CortexM7Model,        [ARMv7em,
1414                                                         ProcM7,
1415                                                         FeatureFPARMv8_D16,
1416                                                         FeatureUseMIPipeliner,
1417                                                         FeatureUseMISched]>;
1418
1419def : ProcNoItin<"cortex-m23",                          [ARMv8mBaseline,
1420                                                         FeatureNoMovt,
1421                                                         FeatureHasNoBranchPredictor]>;
1422
1423def : ProcessorModel<"cortex-m33", CortexM4Model,       [ARMv8mMainline,
1424                                                         FeatureDSP,
1425                                                         FeatureFPARMv8_D16_SP,
1426                                                         FeaturePrefLoopAlign32,
1427                                                         FeatureHasSlowFPVMLx,
1428                                                         FeatureHasSlowFPVFMx,
1429                                                         FeatureUseMISched,
1430                                                         FeatureHasNoBranchPredictor,
1431                                                         FeatureFixCMSE_CVE_2021_35465]>;
1432
1433def : ProcessorModel<"cortex-m35p", CortexM4Model,      [ARMv8mMainline,
1434                                                         FeatureDSP,
1435                                                         FeatureFPARMv8_D16_SP,
1436                                                         FeaturePrefLoopAlign32,
1437                                                         FeatureHasSlowFPVMLx,
1438                                                         FeatureHasSlowFPVFMx,
1439                                                         FeatureUseMISched,
1440                                                         FeatureHasNoBranchPredictor,
1441                                                         FeatureFixCMSE_CVE_2021_35465]>;
1442
1443def : ProcessorModel<"cortex-m55", CortexM4Model,      [ARMv81mMainline,
1444                                                         FeatureDSP,
1445                                                         FeatureFPARMv8_D16,
1446                                                         FeatureUseMISched,
1447                                                         FeatureHasNoBranchPredictor,
1448                                                         FeaturePrefLoopAlign32,
1449                                                         FeatureHasSlowFPVMLx,
1450                                                         HasMVEFloatOps,
1451                                                         FeatureFixCMSE_CVE_2021_35465]>;
1452
1453def : ProcessorModel<"cortex-m85", CortexM7Model,       [ARMv81mMainline,
1454                                                         FeatureDSP,
1455                                                         FeatureFPARMv8_D16,
1456                                                         FeaturePACBTI,
1457                                                         FeatureUseMISched,
1458                                                         HasMVEFloatOps]>;
1459
1460def : ProcNoItin<"cortex-a32",                           [ARMv8a,
1461                                                         FeatureHWDivThumb,
1462                                                         FeatureHWDivARM,
1463                                                         FeatureCrypto,
1464                                                         FeatureCRC]>;
1465
1466def : ProcNoItin<"cortex-a35",                          [ARMv8a, ProcA35,
1467                                                         FeatureHWDivThumb,
1468                                                         FeatureHWDivARM,
1469                                                         FeatureCrypto,
1470                                                         FeatureCRC]>;
1471
1472def : ProcNoItin<"cortex-a53",                          [ARMv8a, ProcA53,
1473                                                         FeatureHWDivThumb,
1474                                                         FeatureHWDivARM,
1475                                                         FeatureCrypto,
1476                                                         FeatureCRC,
1477                                                         FeatureFPAO]>;
1478
1479def : ProcNoItin<"cortex-a55",                          [ARMv82a, ProcA55,
1480                                                         FeatureHWDivThumb,
1481                                                         FeatureHWDivARM,
1482                                                         FeatureDotProd]>;
1483
1484def : ProcessorModel<"cortex-a57",  CortexA57Model,     [ARMv8a, ProcA57,
1485                                                         FeatureHWDivThumb,
1486                                                         FeatureHWDivARM,
1487                                                         FeatureCrypto,
1488                                                         FeatureCRC,
1489                                                         FeatureFPAO,
1490                                                         FeatureAvoidPartialCPSR,
1491                                                         FeatureCheapPredicableCPSR,
1492                                                         FeatureFixCortexA57AES1742098]>;
1493
1494def : ProcessorModel<"cortex-a72",  CortexA57Model,     [ARMv8a, ProcA72,
1495                                                         FeatureHWDivThumb,
1496                                                         FeatureHWDivARM,
1497                                                         FeatureCrypto,
1498                                                         FeatureCRC,
1499                                                         FeatureFixCortexA57AES1742098]>;
1500
1501def : ProcNoItin<"cortex-a73",                          [ARMv8a, ProcA73,
1502                                                         FeatureHWDivThumb,
1503                                                         FeatureHWDivARM,
1504                                                         FeatureCrypto,
1505                                                         FeatureCRC]>;
1506
1507def : ProcNoItin<"cortex-a75",                          [ARMv82a, ProcA75,
1508                                                         FeatureHWDivThumb,
1509                                                         FeatureHWDivARM,
1510                                                         FeatureDotProd]>;
1511
1512def : ProcNoItin<"cortex-a76",                          [ARMv82a, ProcA76,
1513                                                         FeatureHWDivThumb,
1514                                                         FeatureHWDivARM,
1515                                                         FeatureCrypto,
1516                                                         FeatureCRC,
1517                                                         FeatureFullFP16,
1518                                                         FeatureDotProd]>;
1519
1520def : ProcNoItin<"cortex-a76ae",                        [ARMv82a, ProcA76,
1521                                                         FeatureHWDivThumb,
1522                                                         FeatureHWDivARM,
1523                                                         FeatureCrypto,
1524                                                         FeatureCRC,
1525                                                         FeatureFullFP16,
1526                                                         FeatureDotProd]>;
1527
1528def : ProcNoItin<"cortex-a77",                          [ARMv82a, ProcA77,
1529                                                         FeatureHWDivThumb,
1530                                                         FeatureHWDivARM,
1531                                                         FeatureCrypto,
1532                                                         FeatureCRC,
1533                                                         FeatureFullFP16,
1534                                                         FeatureDotProd]>;
1535
1536def : ProcNoItin<"cortex-a78",                          [ARMv82a, ProcA78,
1537                                                         FeatureHWDivThumb,
1538                                                         FeatureHWDivARM,
1539                                                         FeatureCrypto,
1540                                                         FeatureCRC,
1541                                                         FeatureFullFP16,
1542                                                         FeatureDotProd]>;
1543
1544def : ProcNoItin<"cortex-a78c",                         [ARMv82a, ProcA78C,
1545                                                         FeatureHWDivThumb,
1546                                                         FeatureHWDivARM,
1547                                                         FeatureCrypto,
1548                                                         FeatureCRC,
1549                                                         FeatureDotProd,
1550                                                         FeatureFullFP16]>;
1551
1552def : ProcNoItin<"cortex-a710",                         [ARMv9a, ProcA710,
1553                                                         FeatureHWDivThumb,
1554                                                         FeatureHWDivARM,
1555                                                         FeatureFP16FML,
1556                                                         FeatureBF16,
1557                                                         FeatureMatMulInt8,
1558                                                         FeatureSB]>;
1559
1560def : ProcNoItin<"cortex-x1",                           [ARMv82a, ProcX1,
1561                                                         FeatureHWDivThumb,
1562                                                         FeatureHWDivARM,
1563                                                         FeatureCrypto,
1564                                                         FeatureCRC,
1565                                                         FeatureFullFP16,
1566                                                         FeatureDotProd]>;
1567
1568def : ProcNoItin<"cortex-x1c",                          [ARMv82a, ProcX1C,
1569                                                         FeatureHWDivThumb,
1570                                                         FeatureHWDivARM,
1571                                                         FeatureCrypto,
1572                                                         FeatureCRC,
1573                                                         FeatureFullFP16,
1574                                                         FeatureDotProd]>;
1575
1576def : ProcNoItin<"neoverse-v1",                         [ARMv84a,
1577                                                         FeatureHWDivThumb,
1578                                                         FeatureHWDivARM,
1579                                                         FeatureCrypto,
1580                                                         FeatureCRC,
1581                                                         FeatureFullFP16,
1582                                                         FeatureBF16,
1583                                                         FeatureMatMulInt8]>;
1584
1585def : ProcNoItin<"neoverse-n1",                         [ARMv82a,
1586                                                         FeatureHWDivThumb,
1587                                                         FeatureHWDivARM,
1588                                                         FeatureCrypto,
1589                                                         FeatureCRC,
1590                                                         FeatureDotProd]>;
1591
1592def : ProcNoItin<"neoverse-n2",                         [ARMv85a,
1593                                                         FeatureBF16,
1594                                                         FeatureMatMulInt8]>;
1595
1596def : ProcessorModel<"cyclone",     SwiftModel,         [ARMv8a, ProcSwift,
1597                                                         FeatureHasRetAddrStack,
1598                                                         FeatureNEONForFP,
1599                                                         FeatureVFP4,
1600                                                         FeatureMP,
1601                                                         FeatureHWDivThumb,
1602                                                         FeatureHWDivARM,
1603                                                         FeatureAvoidPartialCPSR,
1604                                                         FeatureAvoidMOVsShOp,
1605                                                         FeatureHasSlowFPVMLx,
1606                                                         FeatureHasSlowFPVFMx,
1607                                                         FeatureCrypto,
1608                                                         FeatureUseMISched,
1609                                                         FeatureZCZeroing,
1610                                                         FeatureNoPostRASched]>;
1611
1612def : ProcNoItin<"exynos-m3",                           [ARMv8a, ProcExynos]>;
1613def : ProcNoItin<"exynos-m4",                           [ARMv82a, ProcExynos,
1614                                                         FeatureFullFP16,
1615                                                         FeatureDotProd]>;
1616def : ProcNoItin<"exynos-m5",                           [ARMv82a, ProcExynos,
1617                                                         FeatureFullFP16,
1618                                                         FeatureDotProd]>;
1619
1620def : ProcNoItin<"kryo",                                [ARMv8a, ProcKryo,
1621                                                         FeatureHWDivThumb,
1622                                                         FeatureHWDivARM,
1623                                                         FeatureCrypto,
1624                                                         FeatureCRC]>;
1625
1626def : ProcessorModel<"cortex-r52", CortexR52Model,      [ARMv8r, ProcR52,
1627                                                         FeatureUseMISched,
1628                                                         FeatureFPAO]>;
1629
1630//===----------------------------------------------------------------------===//
1631// Declare the target which we are implementing
1632//===----------------------------------------------------------------------===//
1633
1634def ARMAsmWriter : AsmWriter {
1635  string AsmWriterClassName  = "InstPrinter";
1636  int PassSubtarget = 1;
1637  int Variant = 0;
1638  bit isMCAsmWriter = 1;
1639}
1640
1641def ARMAsmParser : AsmParser {
1642  bit ReportMultipleNearMisses = 1;
1643}
1644
1645def ARMAsmParserVariant : AsmParserVariant {
1646  int Variant = 0;
1647  string Name = "ARM";
1648  string BreakCharacters = ".";
1649}
1650
1651def ARM : Target {
1652  // Pull in Instruction Info.
1653  let InstructionSet = ARMInstrInfo;
1654  let AssemblyWriters = [ARMAsmWriter];
1655  let AssemblyParsers = [ARMAsmParser];
1656  let AssemblyParserVariants = [ARMAsmParserVariant];
1657  let AllowRegisterRenaming = 1;
1658}
1659