1 //===-- ARM.td - Describe the ARM Target Machine -----------*- tablegen -*-===//
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
7 //===----------------------------------------------------------------------===//
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
13 // Target-independent interfaces which we are implementing
14 //===----------------------------------------------------------------------===//
16 include "llvm/Target/Target.td"
18 //===----------------------------------------------------------------------===//
19 // ARM Subtarget state.
22 def ModeThumb : SubtargetFeature<"thumb-mode", "InThumbMode",
23 "true", "Thumb mode">;
25 def ModeSoftFloat : SubtargetFeature<"soft-float","UseSoftFloat",
26 "true", "Use software floating "
30 //===----------------------------------------------------------------------===//
31 // ARM Subtarget features.
34 // Floating Point, HW Division and Neon Support
36 // FP loads/stores/moves, shared between VFP and MVE (even in the integer-only
38 def FeatureFPRegs : SubtargetFeature<"fpregs", "HasFPRegs", "true",
39 "Enable FP registers">;
41 // 16-bit FP loads/stores/moves, shared between VFP (with the v8.2A FP16
42 // extension) and MVE (even in the integer-only version).
43 def FeatureFPRegs16 : SubtargetFeature<"fpregs16", "HasFPRegs16", "true",
44 "Enable 16-bit FP registers",
47 def FeatureFPRegs64 : SubtargetFeature<"fpregs64", "HasFPRegs64", "true",
48 "Enable 64-bit FP registers",
51 def FeatureFP64 : SubtargetFeature<"fp64", "HasFP64", "true",
52 "Floating point unit supports "
56 def FeatureD32 : SubtargetFeature<"d32", "HasD32", "true",
57 "Extend FP to 32 double registers">;
59 multiclass VFPver<string name, string query, string description,
60 list<SubtargetFeature> prev = [],
61 list<SubtargetFeature> otherimplies = []> {
62 def _D16_SP: SubtargetFeature<
63 name#"d16sp", query#"D16SP", "true",
64 description#" with only 16 d-registers and no double precision",
65 !foreach(v, prev, !cast<SubtargetFeature>(v # "_D16_SP")) # otherimplies>;
66 def _SP: SubtargetFeature<
67 name#"sp", query#"SP", "true",
68 description#" with no double precision",
69 !foreach(v, prev, !cast<SubtargetFeature>(v # "_SP")) #
70 otherimplies # [FeatureD32, !cast<SubtargetFeature>(NAME # "_D16_SP")]>;
71 def _D16: SubtargetFeature<
72 name#"d16", query#"D16", "true",
73 description#" with only 16 d-registers",
74 !foreach(v, prev, !cast<SubtargetFeature>(v # "_D16")) #
75 otherimplies # [FeatureFP64, !cast<SubtargetFeature>(NAME # "_D16_SP")]>;
76 def "": SubtargetFeature<
77 name, query, "true", description,
78 prev # otherimplies # [
79 !cast<SubtargetFeature>(NAME # "_D16"),
80 !cast<SubtargetFeature>(NAME # "_SP")]>;
83 defm FeatureVFP2: VFPver<"vfp2", "HasVFPv2", "Enable VFP2 instructions",
86 defm FeatureVFP3: VFPver<"vfp3", "HasVFPv3", "Enable VFP3 instructions",
89 def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
90 "Enable NEON instructions",
93 def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
94 "Enable half-precision "
97 defm FeatureVFP4: VFPver<"vfp4", "HasVFPv4", "Enable VFP4 instructions",
98 [FeatureVFP3], [FeatureFP16]>;
100 defm FeatureFPARMv8: VFPver<"fp-armv8", "HasFPARMv8", "Enable ARMv8 FP",
103 def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
104 "Enable full half-precision "
106 [FeatureFPARMv8_D16_SP, FeatureFPRegs16]>;
108 def FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
109 "Enable full half-precision "
110 "floating point fml instructions",
113 def FeatureHWDivThumb : SubtargetFeature<"hwdiv",
114 "HasHardwareDivideInThumb", "true",
115 "Enable divide instructions in Thumb">;
117 def FeatureHWDivARM : SubtargetFeature<"hwdiv-arm",
118 "HasHardwareDivideInARM", "true",
119 "Enable divide instructions in ARM mode">;
122 def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true",
123 "Has data barrier (dmb/dsb) instructions">;
125 def FeatureV7Clrex : SubtargetFeature<"v7clrex", "HasV7Clrex", "true",
126 "Has v7 clrex instruction">;
128 def FeatureDFB : SubtargetFeature<"dfb", "HasFullDataBarrier", "true",
129 "Has full data barrier (dfb) instruction">;
131 def FeatureAcquireRelease : SubtargetFeature<"acquire-release",
132 "HasAcquireRelease", "true",
133 "Has v8 acquire/release (lda/ldaex "
134 " etc) instructions">;
137 def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
138 "FP compare + branch is slow">;
140 def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
141 "Enable support for Performance "
142 "Monitor extensions">;
145 // TrustZone Security Extensions
146 def FeatureTrustZone : SubtargetFeature<"trustzone", "HasTrustZone", "true",
147 "Enable support for TrustZone "
148 "security extensions">;
150 def Feature8MSecExt : SubtargetFeature<"8msecext", "Has8MSecExt", "true",
151 "Enable support for ARMv8-M "
152 "Security Extensions">;
154 def FeatureSHA2 : SubtargetFeature<"sha2", "HasSHA2", "true",
155 "Enable SHA1 and SHA256 support", [FeatureNEON]>;
157 def FeatureAES : SubtargetFeature<"aes", "HasAES", "true",
158 "Enable AES support", [FeatureNEON]>;
160 def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
161 "Enable support for "
162 "Cryptography extensions",
163 [FeatureNEON, FeatureSHA2, FeatureAES]>;
165 def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
166 "Enable support for CRC instructions">;
168 def FeatureDotProd : SubtargetFeature<"dotprod", "HasDotProd", "true",
169 "Enable support for dot product instructions",
172 // Not to be confused with FeatureHasRetAddrStack (return address stack)
173 def FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
174 "Enable Reliability, Availability "
175 "and Serviceability extensions">;
177 // Fast computation of non-negative address offsets
178 def FeatureFPAO : SubtargetFeature<"fpao", "HasFPAO", "true",
179 "Enable fast computation of "
180 "positive address offsets">;
182 // Fast execution of AES crypto operations
183 def FeatureFuseAES : SubtargetFeature<"fuse-aes", "HasFuseAES", "true",
184 "CPU fuses AES crypto operations">;
186 // Fast execution of bottom and top halves of literal generation
187 def FeatureFuseLiterals : SubtargetFeature<"fuse-literals", "HasFuseLiterals", "true",
188 "CPU fuses literal generation operations">;
190 // The way of reading thread pointer
191 def FeatureReadTp : SubtargetFeature<"read-tp-hard", "ReadTPHard", "true",
192 "Reading thread pointer from register">;
194 // Cyclone can zero VFP registers in 0 cycles.
195 def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
196 "Has zero-cycle zeroing instructions">;
198 // Whether it is profitable to unpredicate certain instructions during if-conversion
199 def FeatureProfUnpredicate : SubtargetFeature<"prof-unpr",
200 "IsProfitableToUnpredicate", "true",
201 "Is profitable to unpredicate">;
203 // Some targets (e.g. Swift) have microcoded VGETLNi32.
204 def FeatureSlowVGETLNi32 : SubtargetFeature<"slow-vgetlni32",
205 "HasSlowVGETLNi32", "true",
206 "Has slow VGETLNi32 - prefer VMOV">;
208 // Some targets (e.g. Swift) have microcoded VDUP32.
209 def FeatureSlowVDUP32 : SubtargetFeature<"slow-vdup32", "HasSlowVDUP32",
211 "Has slow VDUP32 - prefer VMOV">;
213 // Some targets (e.g. Cortex-A9) prefer VMOVSR to VMOVDRR even when using NEON
214 // for scalar FP, as this allows more effective execution domain optimization.
215 def FeaturePreferVMOVSR : SubtargetFeature<"prefer-vmovsr", "PreferVMOVSR",
216 "true", "Prefer VMOVSR">;
218 // Swift has ISHST barriers compatible with Atomic Release semantics but weaker
220 def FeaturePrefISHSTBarrier : SubtargetFeature<"prefer-ishst", "PreferISHST",
221 "true", "Prefer ISHST barriers">;
223 // Some targets (e.g. Cortex-A9) have muxed AGU and NEON/FPU.
224 def FeatureMuxedUnits : SubtargetFeature<"muxed-units", "HasMuxedUnits",
226 "Has muxed AGU and NEON/FPU">;
228 // Whether VLDM/VSTM starting with odd register number need more microops
230 def FeatureSlowOddRegister : SubtargetFeature<"slow-odd-reg", "SlowOddRegister",
231 "true", "VLDM/VSTM starting "
232 "with an odd register is slow">;
234 // Some targets have a renaming dependency when loading into D subregisters.
235 def FeatureSlowLoadDSubreg : SubtargetFeature<"slow-load-D-subreg",
236 "SlowLoadDSubregister", "true",
237 "Loading into D subregs is slow">;
239 def FeatureUseWideStrideVFP : SubtargetFeature<"wide-stride-vfp",
240 "UseWideStrideVFP", "true",
241 "Use a wide stride when allocating VFP registers">;
243 // Some targets (e.g. Cortex-A15) never want VMOVS to be widened to VMOVD.
244 def FeatureDontWidenVMOVS : SubtargetFeature<"dont-widen-vmovs",
245 "DontWidenVMOVS", "true",
246 "Don't widen VMOVS to VMOVD">;
248 // Some targets (e.g. Cortex-A15) prefer to avoid mixing operations on different
249 // VFP register widths.
250 def FeatureSplatVFPToNeon : SubtargetFeature<"splat-vfp-neon",
251 "SplatVFPToNeon", "true",
252 "Splat register from VFP to NEON",
253 [FeatureDontWidenVMOVS]>;
255 // Whether or not it is profitable to expand VFP/NEON MLA/MLS instructions.
256 def FeatureExpandMLx : SubtargetFeature<"expand-fp-mlx",
258 "Expand VFP/NEON MLA/MLS instructions">;
260 // Some targets have special RAW hazards for VFP/NEON VMLA/VMLS.
261 def FeatureHasVMLxHazards : SubtargetFeature<"vmlx-hazards", "HasVMLxHazards",
262 "true", "Has VMLx hazards">;
264 // Some targets (e.g. Cortex-A9) want to convert VMOVRS, VMOVSR and VMOVS from
265 // VFP to NEON, as an execution domain optimization.
266 def FeatureNEONForFPMovs : SubtargetFeature<"neon-fpmovs",
267 "UseNEONForFPMovs", "true",
268 "Convert VMOVSR, VMOVRS, "
271 // Some processors benefit from using NEON instructions for scalar
272 // single-precision FP operations. This affects instruction selection and should
273 // only be enabled if the handling of denormals is not important.
274 def FeatureNEONForFP : SubtargetFeature<"neonfp",
275 "UseNEONForSinglePrecisionFP",
277 "Use NEON for single precision FP">;
279 // On some processors, VLDn instructions that access unaligned data take one
280 // extra cycle. Take that into account when computing operand latencies.
281 def FeatureCheckVLDnAlign : SubtargetFeature<"vldn-align", "CheckVLDnAlign",
283 "Check for VLDn unaligned access">;
285 // Some processors have a nonpipelined VFP coprocessor.
286 def FeatureNonpipelinedVFP : SubtargetFeature<"nonpipelined-vfp",
287 "NonpipelinedVFP", "true",
288 "VFP instructions are not pipelined">;
290 // Some processors have FP multiply-accumulate instructions that don't
291 // play nicely with other VFP / NEON instructions, and it's generally better
292 // to just not use them.
293 def FeatureHasSlowFPVMLx : SubtargetFeature<"slowfpvmlx", "SlowFPVMLx", "true",
294 "Disable VFP / NEON MAC instructions">;
296 // Cortex-A8 / A9 Advanced SIMD has multiplier accumulator forwarding.
297 def FeatureVMLxForwarding : SubtargetFeature<"vmlx-forwarding",
298 "HasVMLxForwarding", "true",
299 "Has multiplier accumulator forwarding">;
301 // Disable 32-bit to 16-bit narrowing for experimentation.
302 def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
303 "Prefer 32-bit Thumb instrs">;
305 def FeaturePrefLoopAlign32 : SubtargetFeature<"loop-align", "PrefLoopAlignment","2",
306 "Prefer 32-bit alignment for loops">;
308 def FeatureMVEVectorCostFactor1 : SubtargetFeature<"mve1beat", "MVEVectorCostFactor", "1",
309 "Model MVE instructions as a 1 beat per tick architecture">;
311 def FeatureMVEVectorCostFactor2 : SubtargetFeature<"mve2beat", "MVEVectorCostFactor", "2",
312 "Model MVE instructions as a 2 beats per tick architecture">;
314 def FeatureMVEVectorCostFactor4 : SubtargetFeature<"mve4beat", "MVEVectorCostFactor", "4",
315 "Model MVE instructions as a 4 beats per tick architecture">;
317 /// Some instructions update CPSR partially, which can add false dependency for
318 /// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is
319 /// mapped to a separate physical register. Avoid partial CPSR update for these
321 def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr",
322 "AvoidCPSRPartialUpdate", "true",
323 "Avoid CPSR partial update for OOO execution">;
325 /// Disable +1 predication cost for instructions updating CPSR.
326 /// Enabled for Cortex-A57.
327 def FeatureCheapPredicableCPSR : SubtargetFeature<"cheap-predicable-cpsr",
328 "CheapPredicableCPSRDef",
330 "Disable +1 predication cost for instructions updating CPSR">;
332 def FeatureAvoidMOVsShOp : SubtargetFeature<"avoid-movs-shop",
333 "AvoidMOVsShifterOperand", "true",
334 "Avoid movs instructions with "
337 // Some processors perform return stack prediction. CodeGen should avoid issue
338 // "normal" call instructions to callees which do not return.
339 def FeatureHasRetAddrStack : SubtargetFeature<"ret-addr-stack",
340 "HasRetAddrStack", "true",
341 "Has return address stack">;
343 // Some processors have no branch predictor, which changes the expected cost of
344 // taking a branch which affects the choice of whether to use predicated
346 def FeatureHasNoBranchPredictor : SubtargetFeature<"no-branch-predictor",
347 "HasBranchPredictor", "false",
348 "Has no branch predictor">;
351 def FeatureDSP : SubtargetFeature<"dsp", "HasDSP", "true",
352 "Supports DSP instructions in "
353 "ARM and/or Thumb2">;
355 // Multiprocessing extension.
356 def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true",
357 "Supports Multiprocessing extension">;
359 // Virtualization extension - requires HW divide (ARMv7-AR ARMARM - 4.4.8).
360 def FeatureVirtualization : SubtargetFeature<"virtualization",
361 "HasVirtualization", "true",
362 "Supports Virtualization extension",
363 [FeatureHWDivThumb, FeatureHWDivARM]>;
365 // Special TRAP encoding for NaCl, which looks like a TRAP in Thumb too.
366 // See ARMInstrInfo.td for details.
367 def FeatureNaClTrap : SubtargetFeature<"nacl-trap", "UseNaClTrap", "true",
370 def FeatureStrictAlign : SubtargetFeature<"strict-align",
371 "StrictAlign", "true",
372 "Disallow all unaligned memory "
375 def FeatureLongCalls : SubtargetFeature<"long-calls", "GenLongCalls", "true",
376 "Generate calls via indirect call "
379 def FeatureExecuteOnly : SubtargetFeature<"execute-only",
380 "GenExecuteOnly", "true",
381 "Enable the generation of "
382 "execute only code.">;
384 def FeatureReserveR9 : SubtargetFeature<"reserve-r9", "ReserveR9", "true",
385 "Reserve R9, making it unavailable"
388 def FeatureNoMovt : SubtargetFeature<"no-movt", "NoMovt", "true",
389 "Don't use movt/movw pairs for "
392 def FeatureNoNegativeImmediates
393 : SubtargetFeature<"no-neg-immediates",
394 "NegativeImmediates", "false",
395 "Convert immediates and instructions "
396 "to their negated or complemented "
397 "equivalent when the immediate does "
398 "not fit in the encoding.">;
400 // Use the MachineScheduler for instruction scheduling for the subtarget.
401 def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true",
402 "Use the MachineScheduler">;
404 def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler",
405 "DisablePostRAScheduler", "true",
406 "Don't schedule again after register allocation">;
408 // Enable use of alias analysis during code generation
409 def FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
410 "Use alias analysis during codegen">;
412 // Armv8.5-A extensions
414 def FeatureSB : SubtargetFeature<"sb", "HasSB", "true",
415 "Enable v8.5a Speculation Barrier" >;
417 // Armv8.1-M extensions
419 def FeatureLOB : SubtargetFeature<"lob", "HasLOB", "true",
420 "Enable Low Overhead Branch "
423 //===----------------------------------------------------------------------===//
424 // ARM architecture class
428 def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass",
429 "Is application profile ('A' series)">;
432 def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass",
433 "Is realtime profile ('R' series)">;
436 def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass",
437 "Is microcontroller profile ('M' series)">;
440 def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true",
441 "Enable Thumb2 instructions">;
443 def FeatureNoARM : SubtargetFeature<"noarm", "NoARM", "true",
444 "Does not support ARM mode execution">;
446 //===----------------------------------------------------------------------===//
450 def HasV4TOps : SubtargetFeature<"v4t", "HasV4TOps", "true",
451 "Support ARM v4T instructions">;
453 def HasV5TOps : SubtargetFeature<"v5t", "HasV5TOps", "true",
454 "Support ARM v5T instructions",
457 def HasV5TEOps : SubtargetFeature<"v5te", "HasV5TEOps", "true",
458 "Support ARM v5TE, v5TEj, and "
459 "v5TExp instructions",
462 def HasV6Ops : SubtargetFeature<"v6", "HasV6Ops", "true",
463 "Support ARM v6 instructions",
466 def HasV6MOps : SubtargetFeature<"v6m", "HasV6MOps", "true",
467 "Support ARM v6M instructions",
470 def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true",
471 "Support ARM v8M Baseline instructions",
474 def HasV6KOps : SubtargetFeature<"v6k", "HasV6KOps", "true",
475 "Support ARM v6k instructions",
478 def HasV6T2Ops : SubtargetFeature<"v6t2", "HasV6T2Ops", "true",
479 "Support ARM v6t2 instructions",
480 [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>;
482 def HasV7Ops : SubtargetFeature<"v7", "HasV7Ops", "true",
483 "Support ARM v7 instructions",
484 [HasV6T2Ops, FeaturePerfMon,
487 def HasV8MMainlineOps :
488 SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true",
489 "Support ARM v8M Mainline instructions",
492 def HasV8Ops : SubtargetFeature<"v8", "HasV8Ops", "true",
493 "Support ARM v8 instructions",
494 [HasV7Ops, FeatureAcquireRelease]>;
496 def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
497 "Support ARM v8.1a instructions",
500 def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
501 "Support ARM v8.2a instructions",
504 def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
505 "Support ARM v8.3a instructions",
508 def HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
509 "Support ARM v8.4a instructions",
510 [HasV8_3aOps, FeatureDotProd]>;
512 def HasV8_5aOps : SubtargetFeature<"v8.5a", "HasV8_5aOps", "true",
513 "Support ARM v8.5a instructions",
514 [HasV8_4aOps, FeatureSB]>;
516 def HasV8_1MMainlineOps : SubtargetFeature<
517 "v8.1m.main", "HasV8_1MMainlineOps", "true",
518 "Support ARM v8-1M Mainline instructions",
519 [HasV8MMainlineOps]>;
520 def HasMVEIntegerOps : SubtargetFeature<
521 "mve", "HasMVEIntegerOps", "true",
522 "Support M-Class Vector Extension with integer ops",
523 [HasV8_1MMainlineOps, FeatureDSP, FeatureFPRegs16, FeatureFPRegs64]>;
524 def HasMVEFloatOps : SubtargetFeature<
525 "mve.fp", "HasMVEFloatOps", "true",
526 "Support M-Class Vector Extension with integer and floating ops",
527 [HasMVEIntegerOps, FeatureFPARMv8_D16_SP, FeatureFullFP16]>;
529 //===----------------------------------------------------------------------===//
530 // ARM Processor subtarget features.
533 def ProcA5 : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5",
534 "Cortex-A5 ARM processors", []>;
535 def ProcA7 : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7",
536 "Cortex-A7 ARM processors", []>;
537 def ProcA8 : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
538 "Cortex-A8 ARM processors", []>;
539 def ProcA9 : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
540 "Cortex-A9 ARM processors", []>;
541 def ProcA12 : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12",
542 "Cortex-A12 ARM processors", []>;
543 def ProcA15 : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15",
544 "Cortex-A15 ARM processors", []>;
545 def ProcA17 : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17",
546 "Cortex-A17 ARM processors", []>;
547 def ProcA32 : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32",
548 "Cortex-A32 ARM processors", []>;
549 def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
550 "Cortex-A35 ARM processors", []>;
551 def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
552 "Cortex-A53 ARM processors", []>;
553 def ProcA55 : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
554 "Cortex-A55 ARM processors", []>;
555 def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
556 "Cortex-A57 ARM processors", []>;
557 def ProcA72 : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
558 "Cortex-A72 ARM processors", []>;
559 def ProcA73 : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
560 "Cortex-A73 ARM processors", []>;
561 def ProcA75 : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
562 "Cortex-A75 ARM processors", []>;
563 def ProcA76 : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
564 "Cortex-A76 ARM processors", []>;
566 def ProcKrait : SubtargetFeature<"krait", "ARMProcFamily", "Krait",
567 "Qualcomm Krait processors", []>;
568 def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
569 "Qualcomm Kryo processors", []>;
570 def ProcSwift : SubtargetFeature<"swift", "ARMProcFamily", "Swift",
571 "Swift ARM processors", []>;
573 def ProcExynos : SubtargetFeature<"exynos", "ARMProcFamily", "Exynos",
574 "Samsung Exynos processors",
576 FeatureUseWideStrideVFP,
578 FeatureSplatVFPToNeon,
579 FeatureSlowVGETLNi32,
582 FeatureProfUnpredicate,
585 FeatureHasSlowFPVMLx,
586 FeatureHasRetAddrStack,
593 def ProcR4 : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4",
594 "Cortex-R4 ARM processors", []>;
595 def ProcR5 : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5",
596 "Cortex-R5 ARM processors", []>;
597 def ProcR7 : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7",
598 "Cortex-R7 ARM processors", []>;
599 def ProcR52 : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52",
600 "Cortex-R52 ARM processors", []>;
602 def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3",
603 "Cortex-M3 ARM processors", []>;
606 //===----------------------------------------------------------------------===//
607 // ARM Helper classes.
610 class Architecture<string fname, string aname, list<SubtargetFeature> features>
611 : SubtargetFeature<fname, "ARMArch", aname,
612 !strconcat(aname, " architecture"), features>;
614 class ProcNoItin<string Name, list<SubtargetFeature> Features>
615 : Processor<Name, NoItineraries, Features>;
618 //===----------------------------------------------------------------------===//
622 def ARMv2 : Architecture<"armv2", "ARMv2", []>;
624 def ARMv2a : Architecture<"armv2a", "ARMv2a", []>;
626 def ARMv3 : Architecture<"armv3", "ARMv3", []>;
628 def ARMv3m : Architecture<"armv3m", "ARMv3m", []>;
630 def ARMv4 : Architecture<"armv4", "ARMv4", []>;
632 def ARMv4t : Architecture<"armv4t", "ARMv4t", [HasV4TOps]>;
634 def ARMv5t : Architecture<"armv5t", "ARMv5t", [HasV5TOps]>;
636 def ARMv5te : Architecture<"armv5te", "ARMv5te", [HasV5TEOps]>;
638 def ARMv5tej : Architecture<"armv5tej", "ARMv5tej", [HasV5TEOps]>;
640 def ARMv6 : Architecture<"armv6", "ARMv6", [HasV6Ops,
643 def ARMv6t2 : Architecture<"armv6t2", "ARMv6t2", [HasV6T2Ops,
646 def ARMv6k : Architecture<"armv6k", "ARMv6k", [HasV6KOps]>;
648 def ARMv6kz : Architecture<"armv6kz", "ARMv6kz", [HasV6KOps,
651 def ARMv6m : Architecture<"armv6-m", "ARMv6m", [HasV6MOps,
656 FeatureStrictAlign]>;
658 def ARMv6sm : Architecture<"armv6s-m", "ARMv6sm", [HasV6MOps,
663 FeatureStrictAlign]>;
665 def ARMv7a : Architecture<"armv7-a", "ARMv7a", [HasV7Ops,
671 def ARMv7ve : Architecture<"armv7ve", "ARMv7ve", [HasV7Ops,
677 FeatureVirtualization,
680 def ARMv7r : Architecture<"armv7-r", "ARMv7r", [HasV7Ops,
686 def ARMv7m : Architecture<"armv7-m", "ARMv7m", [HasV7Ops,
694 def ARMv7em : Architecture<"armv7e-m", "ARMv7em", [HasV7Ops,
703 def ARMv8a : Architecture<"armv8-a", "ARMv8a", [HasV8Ops,
711 FeatureVirtualization,
715 def ARMv81a : Architecture<"armv8.1-a", "ARMv81a", [HasV8_1aOps,
723 FeatureVirtualization,
727 def ARMv82a : Architecture<"armv8.2-a", "ARMv82a", [HasV8_2aOps,
735 FeatureVirtualization,
740 def ARMv83a : Architecture<"armv8.3-a", "ARMv83a", [HasV8_3aOps,
748 FeatureVirtualization,
753 def ARMv84a : Architecture<"armv8.4-a", "ARMv84a", [HasV8_4aOps,
761 FeatureVirtualization,
767 def ARMv85a : Architecture<"armv8.5-a", "ARMv85a", [HasV8_5aOps,
775 FeatureVirtualization,
781 def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops,
788 FeatureVirtualization,
792 def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline",
800 FeatureAcquireRelease,
802 FeatureStrictAlign]>;
804 def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline",
811 FeatureAcquireRelease,
814 def ARMv81mMainline : Architecture<"armv8.1-m.main", "ARMv81mMainline",
815 [HasV8_1MMainlineOps,
821 FeatureAcquireRelease,
827 def IWMMXT : Architecture<"iwmmxt", "ARMv5te", [ARMv5te]>;
828 def IWMMXT2 : Architecture<"iwmmxt2", "ARMv5te", [ARMv5te]>;
829 def XScale : Architecture<"xscale", "ARMv5te", [ARMv5te]>;
830 def ARMv6j : Architecture<"armv6j", "ARMv7a", [ARMv6]>;
831 def ARMv7k : Architecture<"armv7k", "ARMv7a", [ARMv7a]>;
832 def ARMv7s : Architecture<"armv7s", "ARMv7a", [ARMv7a]>;
835 //===----------------------------------------------------------------------===//
837 //===----------------------------------------------------------------------===//
839 include "ARMPredicates.td"
840 include "ARMSchedule.td"
842 //===----------------------------------------------------------------------===//
846 // Dummy CPU, used to target architectures
847 def : ProcessorModel<"generic", CortexA8Model, []>;
849 // FIXME: Several processors below are not using their own scheduler
850 // model, but one of similar/previous processor. These should be fixed.
852 def : ProcNoItin<"arm8", [ARMv4]>;
853 def : ProcNoItin<"arm810", [ARMv4]>;
854 def : ProcNoItin<"strongarm", [ARMv4]>;
855 def : ProcNoItin<"strongarm110", [ARMv4]>;
856 def : ProcNoItin<"strongarm1100", [ARMv4]>;
857 def : ProcNoItin<"strongarm1110", [ARMv4]>;
859 def : ProcNoItin<"arm7tdmi", [ARMv4t]>;
860 def : ProcNoItin<"arm7tdmi-s", [ARMv4t]>;
861 def : ProcNoItin<"arm710t", [ARMv4t]>;
862 def : ProcNoItin<"arm720t", [ARMv4t]>;
863 def : ProcNoItin<"arm9", [ARMv4t]>;
864 def : ProcNoItin<"arm9tdmi", [ARMv4t]>;
865 def : ProcNoItin<"arm920", [ARMv4t]>;
866 def : ProcNoItin<"arm920t", [ARMv4t]>;
867 def : ProcNoItin<"arm922t", [ARMv4t]>;
868 def : ProcNoItin<"arm940t", [ARMv4t]>;
869 def : ProcNoItin<"ep9312", [ARMv4t]>;
871 def : ProcNoItin<"arm10tdmi", [ARMv5t]>;
872 def : ProcNoItin<"arm1020t", [ARMv5t]>;
874 def : ProcNoItin<"arm9e", [ARMv5te]>;
875 def : ProcNoItin<"arm926ej-s", [ARMv5te]>;
876 def : ProcNoItin<"arm946e-s", [ARMv5te]>;
877 def : ProcNoItin<"arm966e-s", [ARMv5te]>;
878 def : ProcNoItin<"arm968e-s", [ARMv5te]>;
879 def : ProcNoItin<"arm10e", [ARMv5te]>;
880 def : ProcNoItin<"arm1020e", [ARMv5te]>;
881 def : ProcNoItin<"arm1022e", [ARMv5te]>;
882 def : ProcNoItin<"xscale", [ARMv5te]>;
883 def : ProcNoItin<"iwmmxt", [ARMv5te]>;
885 def : Processor<"arm1136j-s", ARMV6Itineraries, [ARMv6]>;
886 def : Processor<"arm1136jf-s", ARMV6Itineraries, [ARMv6,
888 FeatureHasSlowFPVMLx]>;
890 def : Processor<"cortex-m0", ARMV6Itineraries, [ARMv6m]>;
891 def : Processor<"cortex-m0plus", ARMV6Itineraries, [ARMv6m]>;
892 def : Processor<"cortex-m1", ARMV6Itineraries, [ARMv6m]>;
893 def : Processor<"sc000", ARMV6Itineraries, [ARMv6m]>;
895 def : Processor<"arm1176j-s", ARMV6Itineraries, [ARMv6kz]>;
896 def : Processor<"arm1176jz-s", ARMV6Itineraries, [ARMv6kz]>;
897 def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ARMv6kz,
899 FeatureHasSlowFPVMLx]>;
901 def : Processor<"mpcorenovfp", ARMV6Itineraries, [ARMv6k]>;
902 def : Processor<"mpcore", ARMV6Itineraries, [ARMv6k,
904 FeatureHasSlowFPVMLx]>;
906 def : Processor<"arm1156t2-s", ARMV6Itineraries, [ARMv6t2]>;
907 def : Processor<"arm1156t2f-s", ARMV6Itineraries, [ARMv6t2,
909 FeatureHasSlowFPVMLx]>;
911 def : ProcessorModel<"cortex-a5", CortexA8Model, [ARMv7a, ProcA5,
912 FeatureHasRetAddrStack,
915 FeatureHasSlowFPVMLx,
916 FeatureVMLxForwarding,
920 def : ProcessorModel<"cortex-a7", CortexA8Model, [ARMv7a, ProcA7,
921 FeatureHasRetAddrStack,
924 FeatureHasVMLxHazards,
925 FeatureHasSlowFPVMLx,
926 FeatureVMLxForwarding,
929 FeatureVirtualization]>;
931 def : ProcessorModel<"cortex-a8", CortexA8Model, [ARMv7a, ProcA8,
932 FeatureHasRetAddrStack,
933 FeatureNonpipelinedVFP,
936 FeatureHasVMLxHazards,
937 FeatureHasSlowFPVMLx,
938 FeatureVMLxForwarding]>;
940 def : ProcessorModel<"cortex-a9", CortexA9Model, [ARMv7a, ProcA9,
941 FeatureHasRetAddrStack,
943 FeatureHasVMLxHazards,
944 FeatureVMLxForwarding,
946 FeatureAvoidPartialCPSR,
950 FeatureNEONForFPMovs,
951 FeatureCheckVLDnAlign,
954 def : ProcessorModel<"cortex-a12", CortexA9Model, [ARMv7a, ProcA12,
955 FeatureHasRetAddrStack,
957 FeatureVMLxForwarding,
959 FeatureAvoidPartialCPSR,
960 FeatureVirtualization,
963 def : ProcessorModel<"cortex-a15", CortexA9Model, [ARMv7a, ProcA15,
964 FeatureDontWidenVMOVS,
965 FeatureSplatVFPToNeon,
966 FeatureHasRetAddrStack,
971 FeatureCheckVLDnAlign,
972 FeatureAvoidPartialCPSR,
973 FeatureVirtualization]>;
975 def : ProcessorModel<"cortex-a17", CortexA9Model, [ARMv7a, ProcA17,
976 FeatureHasRetAddrStack,
979 FeatureVMLxForwarding,
981 FeatureAvoidPartialCPSR,
982 FeatureVirtualization]>;
984 // FIXME: krait has currently the same features as A9 plus VFP4 and HWDiv
985 def : ProcessorModel<"krait", CortexA9Model, [ARMv7a, ProcKrait,
986 FeatureHasRetAddrStack,
988 FeatureCheckVLDnAlign,
989 FeatureVMLxForwarding,
991 FeatureAvoidPartialCPSR,
996 def : ProcessorModel<"swift", SwiftModel, [ARMv7a, ProcSwift,
997 FeatureHasRetAddrStack,
1000 FeatureUseWideStrideVFP,
1004 FeatureAvoidPartialCPSR,
1005 FeatureAvoidMOVsShOp,
1006 FeatureHasSlowFPVMLx,
1007 FeatureHasVMLxHazards,
1008 FeatureProfUnpredicate,
1009 FeaturePrefISHSTBarrier,
1010 FeatureSlowOddRegister,
1011 FeatureSlowLoadDSubreg,
1012 FeatureSlowVGETLNi32,
1015 FeatureNoPostRASched]>;
1017 def : ProcessorModel<"cortex-r4", CortexA8Model, [ARMv7r, ProcR4,
1018 FeatureHasRetAddrStack,
1019 FeatureAvoidPartialCPSR]>;
1021 def : ProcessorModel<"cortex-r4f", CortexA8Model, [ARMv7r, ProcR4,
1022 FeatureHasRetAddrStack,
1024 FeatureHasSlowFPVMLx,
1026 FeatureAvoidPartialCPSR]>;
1028 def : ProcessorModel<"cortex-r5", CortexA8Model, [ARMv7r, ProcR5,
1029 FeatureHasRetAddrStack,
1033 FeatureHasSlowFPVMLx,
1034 FeatureAvoidPartialCPSR]>;
1036 def : ProcessorModel<"cortex-r7", CortexA8Model, [ARMv7r, ProcR7,
1037 FeatureHasRetAddrStack,
1043 FeatureHasSlowFPVMLx,
1044 FeatureAvoidPartialCPSR]>;
1046 def : ProcessorModel<"cortex-r8", CortexA8Model, [ARMv7r,
1047 FeatureHasRetAddrStack,
1053 FeatureHasSlowFPVMLx,
1054 FeatureAvoidPartialCPSR]>;
1056 def : ProcessorModel<"cortex-m3", CortexM4Model, [ARMv7m,
1058 FeaturePrefLoopAlign32,
1061 FeatureHasNoBranchPredictor]>;
1063 def : ProcessorModel<"sc300", CortexM4Model, [ARMv7m,
1067 FeatureHasNoBranchPredictor]>;
1069 def : ProcessorModel<"cortex-m4", CortexM4Model, [ARMv7em,
1071 FeaturePrefLoopAlign32,
1072 FeatureHasSlowFPVMLx,
1075 FeatureHasNoBranchPredictor]>;
1077 def : ProcNoItin<"cortex-m7", [ARMv7em,
1078 FeatureFPARMv8_D16]>;
1080 def : ProcNoItin<"cortex-m23", [ARMv8mBaseline,
1083 def : ProcessorModel<"cortex-m33", CortexM4Model, [ARMv8mMainline,
1085 FeatureFPARMv8_D16_SP,
1086 FeaturePrefLoopAlign32,
1087 FeatureHasSlowFPVMLx,
1090 FeatureHasNoBranchPredictor]>;
1092 def : ProcessorModel<"cortex-m35p", CortexM4Model, [ARMv8mMainline,
1094 FeatureFPARMv8_D16_SP,
1095 FeaturePrefLoopAlign32,
1096 FeatureHasSlowFPVMLx,
1099 FeatureHasNoBranchPredictor]>;
1102 def : ProcNoItin<"cortex-a32", [ARMv8a,
1108 def : ProcNoItin<"cortex-a35", [ARMv8a, ProcA35,
1114 def : ProcNoItin<"cortex-a53", [ARMv8a, ProcA53,
1121 def : ProcNoItin<"cortex-a55", [ARMv82a, ProcA55,
1126 def : ProcessorModel<"cortex-a57", CortexA57Model, [ARMv8a, ProcA57,
1132 FeatureAvoidPartialCPSR,
1133 FeatureCheapPredicableCPSR]>;
1135 def : ProcessorModel<"cortex-a72", CortexA57Model, [ARMv8a, ProcA72,
1141 def : ProcNoItin<"cortex-a73", [ARMv8a, ProcA73,
1147 def : ProcNoItin<"cortex-a75", [ARMv82a, ProcA75,
1152 def : ProcNoItin<"cortex-a76", [ARMv82a, ProcA76,
1160 def : ProcNoItin<"cortex-a76ae", [ARMv82a, ProcA76,
1168 def : ProcNoItin<"neoverse-n1", [ARMv82a,
1175 def : ProcessorModel<"cyclone", SwiftModel, [ARMv8a, ProcSwift,
1176 FeatureHasRetAddrStack,
1182 FeatureAvoidPartialCPSR,
1183 FeatureAvoidMOVsShOp,
1184 FeatureHasSlowFPVMLx,
1188 FeatureNoPostRASched]>;
1190 def : ProcNoItin<"exynos-m1", [ARMv8a, ProcExynos]>;
1191 def : ProcNoItin<"exynos-m2", [ARMv8a, ProcExynos]>;
1192 def : ProcNoItin<"exynos-m3", [ARMv8a, ProcExynos]>;
1193 def : ProcNoItin<"exynos-m4", [ARMv82a, ProcExynos,
1196 def : ProcNoItin<"exynos-m5", [ARMv82a, ProcExynos,
1200 def : ProcNoItin<"kryo", [ARMv8a, ProcKryo,
1206 def : ProcessorModel<"cortex-r52", CortexR52Model, [ARMv8r, ProcR52,
1211 //===----------------------------------------------------------------------===//
1212 // Register File Description
1213 //===----------------------------------------------------------------------===//
1215 include "ARMRegisterInfo.td"
1216 include "ARMRegisterBanks.td"
1217 include "ARMCallingConv.td"
1219 //===----------------------------------------------------------------------===//
1220 // Instruction Descriptions
1221 //===----------------------------------------------------------------------===//
1223 include "ARMInstrInfo.td"
1224 def ARMInstrInfo : InstrInfo;
1226 //===----------------------------------------------------------------------===//
1227 // Declare the target which we are implementing
1228 //===----------------------------------------------------------------------===//
1230 def ARMAsmWriter : AsmWriter {
1231 string AsmWriterClassName = "InstPrinter";
1232 int PassSubtarget = 1;
1234 bit isMCAsmWriter = 1;
1237 def ARMAsmParser : AsmParser {
1238 bit ReportMultipleNearMisses = 1;
1241 def ARMAsmParserVariant : AsmParserVariant {
1243 string Name = "ARM";
1244 string BreakCharacters = ".";
1248 // Pull in Instruction Info.
1249 let InstructionSet = ARMInstrInfo;
1250 let AssemblyWriters = [ARMAsmWriter];
1251 let AssemblyParsers = [ARMAsmParser];
1252 let AssemblyParserVariants = [ARMAsmParserVariant];
1253 let AllowRegisterRenaming = 1;