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 /// Some instructions update CPSR partially, which can add false dependency for
309 /// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is
310 /// mapped to a separate physical register. Avoid partial CPSR update for these
312 def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr",
313 "AvoidCPSRPartialUpdate", "true",
314 "Avoid CPSR partial update for OOO execution">;
316 /// Disable +1 predication cost for instructions updating CPSR.
317 /// Enabled for Cortex-A57.
318 def FeatureCheapPredicableCPSR : SubtargetFeature<"cheap-predicable-cpsr",
319 "CheapPredicableCPSRDef",
321 "Disable +1 predication cost for instructions updating CPSR">;
323 def FeatureAvoidMOVsShOp : SubtargetFeature<"avoid-movs-shop",
324 "AvoidMOVsShifterOperand", "true",
325 "Avoid movs instructions with "
328 // Some processors perform return stack prediction. CodeGen should avoid issue
329 // "normal" call instructions to callees which do not return.
330 def FeatureHasRetAddrStack : SubtargetFeature<"ret-addr-stack",
331 "HasRetAddrStack", "true",
332 "Has return address stack">;
334 // Some processors have no branch predictor, which changes the expected cost of
335 // taking a branch which affects the choice of whether to use predicated
337 def FeatureHasNoBranchPredictor : SubtargetFeature<"no-branch-predictor",
338 "HasBranchPredictor", "false",
339 "Has no branch predictor">;
342 def FeatureDSP : SubtargetFeature<"dsp", "HasDSP", "true",
343 "Supports DSP instructions in "
344 "ARM and/or Thumb2">;
346 // Multiprocessing extension.
347 def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true",
348 "Supports Multiprocessing extension">;
350 // Virtualization extension - requires HW divide (ARMv7-AR ARMARM - 4.4.8).
351 def FeatureVirtualization : SubtargetFeature<"virtualization",
352 "HasVirtualization", "true",
353 "Supports Virtualization extension",
354 [FeatureHWDivThumb, FeatureHWDivARM]>;
356 // Special TRAP encoding for NaCl, which looks like a TRAP in Thumb too.
357 // See ARMInstrInfo.td for details.
358 def FeatureNaClTrap : SubtargetFeature<"nacl-trap", "UseNaClTrap", "true",
361 def FeatureStrictAlign : SubtargetFeature<"strict-align",
362 "StrictAlign", "true",
363 "Disallow all unaligned memory "
366 def FeatureLongCalls : SubtargetFeature<"long-calls", "GenLongCalls", "true",
367 "Generate calls via indirect call "
370 def FeatureExecuteOnly : SubtargetFeature<"execute-only",
371 "GenExecuteOnly", "true",
372 "Enable the generation of "
373 "execute only code.">;
375 def FeatureReserveR9 : SubtargetFeature<"reserve-r9", "ReserveR9", "true",
376 "Reserve R9, making it unavailable"
379 def FeatureNoMovt : SubtargetFeature<"no-movt", "NoMovt", "true",
380 "Don't use movt/movw pairs for "
383 def FeatureNoNegativeImmediates
384 : SubtargetFeature<"no-neg-immediates",
385 "NegativeImmediates", "false",
386 "Convert immediates and instructions "
387 "to their negated or complemented "
388 "equivalent when the immediate does "
389 "not fit in the encoding.">;
391 // Use the MachineScheduler for instruction scheduling for the subtarget.
392 def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true",
393 "Use the MachineScheduler">;
395 def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler",
396 "DisablePostRAScheduler", "true",
397 "Don't schedule again after register allocation">;
399 // Enable use of alias analysis during code generation
400 def FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
401 "Use alias analysis during codegen">;
403 // Armv8.5-A extensions
405 def FeatureSB : SubtargetFeature<"sb", "HasSB", "true",
406 "Enable v8.5a Speculation Barrier" >;
408 // Armv8.1-M extensions
410 def FeatureLOB : SubtargetFeature<"lob", "HasLOB", "true",
411 "Enable Low Overhead Branch "
414 //===----------------------------------------------------------------------===//
415 // ARM architecture class
419 def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass",
420 "Is application profile ('A' series)">;
423 def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass",
424 "Is realtime profile ('R' series)">;
427 def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass",
428 "Is microcontroller profile ('M' series)">;
431 def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true",
432 "Enable Thumb2 instructions">;
434 def FeatureNoARM : SubtargetFeature<"noarm", "NoARM", "true",
435 "Does not support ARM mode execution">;
437 //===----------------------------------------------------------------------===//
441 def HasV4TOps : SubtargetFeature<"v4t", "HasV4TOps", "true",
442 "Support ARM v4T instructions">;
444 def HasV5TOps : SubtargetFeature<"v5t", "HasV5TOps", "true",
445 "Support ARM v5T instructions",
448 def HasV5TEOps : SubtargetFeature<"v5te", "HasV5TEOps", "true",
449 "Support ARM v5TE, v5TEj, and "
450 "v5TExp instructions",
453 def HasV6Ops : SubtargetFeature<"v6", "HasV6Ops", "true",
454 "Support ARM v6 instructions",
457 def HasV6MOps : SubtargetFeature<"v6m", "HasV6MOps", "true",
458 "Support ARM v6M instructions",
461 def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true",
462 "Support ARM v8M Baseline instructions",
465 def HasV6KOps : SubtargetFeature<"v6k", "HasV6KOps", "true",
466 "Support ARM v6k instructions",
469 def HasV6T2Ops : SubtargetFeature<"v6t2", "HasV6T2Ops", "true",
470 "Support ARM v6t2 instructions",
471 [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>;
473 def HasV7Ops : SubtargetFeature<"v7", "HasV7Ops", "true",
474 "Support ARM v7 instructions",
475 [HasV6T2Ops, FeaturePerfMon,
478 def HasV8MMainlineOps :
479 SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true",
480 "Support ARM v8M Mainline instructions",
483 def HasV8Ops : SubtargetFeature<"v8", "HasV8Ops", "true",
484 "Support ARM v8 instructions",
485 [HasV7Ops, FeatureAcquireRelease]>;
487 def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
488 "Support ARM v8.1a instructions",
491 def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
492 "Support ARM v8.2a instructions",
495 def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
496 "Support ARM v8.3a instructions",
499 def HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
500 "Support ARM v8.4a instructions",
501 [HasV8_3aOps, FeatureDotProd]>;
503 def HasV8_5aOps : SubtargetFeature<"v8.5a", "HasV8_5aOps", "true",
504 "Support ARM v8.5a instructions",
505 [HasV8_4aOps, FeatureSB]>;
507 def HasV8_1MMainlineOps : SubtargetFeature<
508 "v8.1m.main", "HasV8_1MMainlineOps", "true",
509 "Support ARM v8-1M Mainline instructions",
510 [HasV8MMainlineOps]>;
511 def HasMVEIntegerOps : SubtargetFeature<
512 "mve", "HasMVEIntegerOps", "true",
513 "Support M-Class Vector Extension with integer ops",
514 [HasV8_1MMainlineOps, FeatureDSP, FeatureFPRegs16, FeatureFPRegs64]>;
515 def HasMVEFloatOps : SubtargetFeature<
516 "mve.fp", "HasMVEFloatOps", "true",
517 "Support M-Class Vector Extension with integer and floating ops",
518 [HasMVEIntegerOps, FeatureFPARMv8_D16_SP, FeatureFullFP16]>;
520 //===----------------------------------------------------------------------===//
521 // ARM Processor subtarget features.
524 def ProcA5 : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5",
525 "Cortex-A5 ARM processors", []>;
526 def ProcA7 : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7",
527 "Cortex-A7 ARM processors", []>;
528 def ProcA8 : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
529 "Cortex-A8 ARM processors", []>;
530 def ProcA9 : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
531 "Cortex-A9 ARM processors", []>;
532 def ProcA12 : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12",
533 "Cortex-A12 ARM processors", []>;
534 def ProcA15 : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15",
535 "Cortex-A15 ARM processors", []>;
536 def ProcA17 : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17",
537 "Cortex-A17 ARM processors", []>;
538 def ProcA32 : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32",
539 "Cortex-A32 ARM processors", []>;
540 def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
541 "Cortex-A35 ARM processors", []>;
542 def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
543 "Cortex-A53 ARM processors", []>;
544 def ProcA55 : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
545 "Cortex-A55 ARM processors", []>;
546 def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
547 "Cortex-A57 ARM processors", []>;
548 def ProcA72 : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
549 "Cortex-A72 ARM processors", []>;
550 def ProcA73 : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
551 "Cortex-A73 ARM processors", []>;
552 def ProcA75 : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
553 "Cortex-A75 ARM processors", []>;
554 def ProcA76 : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
555 "Cortex-A76 ARM processors", []>;
557 def ProcKrait : SubtargetFeature<"krait", "ARMProcFamily", "Krait",
558 "Qualcomm Krait processors", []>;
559 def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
560 "Qualcomm Kryo processors", []>;
561 def ProcSwift : SubtargetFeature<"swift", "ARMProcFamily", "Swift",
562 "Swift ARM processors", []>;
564 def ProcExynos : SubtargetFeature<"exynos", "ARMProcFamily", "Exynos",
565 "Samsung Exynos processors",
567 FeatureUseWideStrideVFP,
569 FeatureSplatVFPToNeon,
570 FeatureSlowVGETLNi32,
573 FeatureProfUnpredicate,
576 FeatureHasSlowFPVMLx,
577 FeatureHasRetAddrStack,
584 def ProcR4 : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4",
585 "Cortex-R4 ARM processors", []>;
586 def ProcR5 : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5",
587 "Cortex-R5 ARM processors", []>;
588 def ProcR7 : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7",
589 "Cortex-R7 ARM processors", []>;
590 def ProcR52 : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52",
591 "Cortex-R52 ARM processors", []>;
593 def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3",
594 "Cortex-M3 ARM processors", []>;
597 //===----------------------------------------------------------------------===//
598 // ARM Helper classes.
601 class Architecture<string fname, string aname, list<SubtargetFeature> features>
602 : SubtargetFeature<fname, "ARMArch", aname,
603 !strconcat(aname, " architecture"), features>;
605 class ProcNoItin<string Name, list<SubtargetFeature> Features>
606 : Processor<Name, NoItineraries, Features>;
609 //===----------------------------------------------------------------------===//
613 def ARMv2 : Architecture<"armv2", "ARMv2", []>;
615 def ARMv2a : Architecture<"armv2a", "ARMv2a", []>;
617 def ARMv3 : Architecture<"armv3", "ARMv3", []>;
619 def ARMv3m : Architecture<"armv3m", "ARMv3m", []>;
621 def ARMv4 : Architecture<"armv4", "ARMv4", []>;
623 def ARMv4t : Architecture<"armv4t", "ARMv4t", [HasV4TOps]>;
625 def ARMv5t : Architecture<"armv5t", "ARMv5t", [HasV5TOps]>;
627 def ARMv5te : Architecture<"armv5te", "ARMv5te", [HasV5TEOps]>;
629 def ARMv5tej : Architecture<"armv5tej", "ARMv5tej", [HasV5TEOps]>;
631 def ARMv6 : Architecture<"armv6", "ARMv6", [HasV6Ops,
634 def ARMv6t2 : Architecture<"armv6t2", "ARMv6t2", [HasV6T2Ops,
637 def ARMv6k : Architecture<"armv6k", "ARMv6k", [HasV6KOps]>;
639 def ARMv6kz : Architecture<"armv6kz", "ARMv6kz", [HasV6KOps,
642 def ARMv6m : Architecture<"armv6-m", "ARMv6m", [HasV6MOps,
647 FeatureStrictAlign]>;
649 def ARMv6sm : Architecture<"armv6s-m", "ARMv6sm", [HasV6MOps,
654 FeatureStrictAlign]>;
656 def ARMv7a : Architecture<"armv7-a", "ARMv7a", [HasV7Ops,
662 def ARMv7ve : Architecture<"armv7ve", "ARMv7ve", [HasV7Ops,
668 FeatureVirtualization,
671 def ARMv7r : Architecture<"armv7-r", "ARMv7r", [HasV7Ops,
677 def ARMv7m : Architecture<"armv7-m", "ARMv7m", [HasV7Ops,
685 def ARMv7em : Architecture<"armv7e-m", "ARMv7em", [HasV7Ops,
694 def ARMv8a : Architecture<"armv8-a", "ARMv8a", [HasV8Ops,
702 FeatureVirtualization,
706 def ARMv81a : Architecture<"armv8.1-a", "ARMv81a", [HasV8_1aOps,
714 FeatureVirtualization,
718 def ARMv82a : Architecture<"armv8.2-a", "ARMv82a", [HasV8_2aOps,
726 FeatureVirtualization,
731 def ARMv83a : Architecture<"armv8.3-a", "ARMv83a", [HasV8_3aOps,
739 FeatureVirtualization,
744 def ARMv84a : Architecture<"armv8.4-a", "ARMv84a", [HasV8_4aOps,
752 FeatureVirtualization,
758 def ARMv85a : Architecture<"armv8.5-a", "ARMv85a", [HasV8_5aOps,
766 FeatureVirtualization,
772 def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops,
779 FeatureVirtualization,
783 def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline",
791 FeatureAcquireRelease,
793 FeatureStrictAlign]>;
795 def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline",
802 FeatureAcquireRelease,
805 def ARMv81mMainline : Architecture<"armv8.1-m.main", "ARMv81mMainline",
806 [HasV8_1MMainlineOps,
812 FeatureAcquireRelease,
818 def IWMMXT : Architecture<"iwmmxt", "ARMv5te", [ARMv5te]>;
819 def IWMMXT2 : Architecture<"iwmmxt2", "ARMv5te", [ARMv5te]>;
820 def XScale : Architecture<"xscale", "ARMv5te", [ARMv5te]>;
821 def ARMv6j : Architecture<"armv6j", "ARMv7a", [ARMv6]>;
822 def ARMv7k : Architecture<"armv7k", "ARMv7a", [ARMv7a]>;
823 def ARMv7s : Architecture<"armv7s", "ARMv7a", [ARMv7a]>;
826 //===----------------------------------------------------------------------===//
828 //===----------------------------------------------------------------------===//
830 include "ARMPredicates.td"
831 include "ARMSchedule.td"
833 //===----------------------------------------------------------------------===//
837 // Dummy CPU, used to target architectures
838 def : ProcessorModel<"generic", CortexA8Model, []>;
840 // FIXME: Several processors below are not using their own scheduler
841 // model, but one of similar/previous processor. These should be fixed.
843 def : ProcNoItin<"arm8", [ARMv4]>;
844 def : ProcNoItin<"arm810", [ARMv4]>;
845 def : ProcNoItin<"strongarm", [ARMv4]>;
846 def : ProcNoItin<"strongarm110", [ARMv4]>;
847 def : ProcNoItin<"strongarm1100", [ARMv4]>;
848 def : ProcNoItin<"strongarm1110", [ARMv4]>;
850 def : ProcNoItin<"arm7tdmi", [ARMv4t]>;
851 def : ProcNoItin<"arm7tdmi-s", [ARMv4t]>;
852 def : ProcNoItin<"arm710t", [ARMv4t]>;
853 def : ProcNoItin<"arm720t", [ARMv4t]>;
854 def : ProcNoItin<"arm9", [ARMv4t]>;
855 def : ProcNoItin<"arm9tdmi", [ARMv4t]>;
856 def : ProcNoItin<"arm920", [ARMv4t]>;
857 def : ProcNoItin<"arm920t", [ARMv4t]>;
858 def : ProcNoItin<"arm922t", [ARMv4t]>;
859 def : ProcNoItin<"arm940t", [ARMv4t]>;
860 def : ProcNoItin<"ep9312", [ARMv4t]>;
862 def : ProcNoItin<"arm10tdmi", [ARMv5t]>;
863 def : ProcNoItin<"arm1020t", [ARMv5t]>;
865 def : ProcNoItin<"arm9e", [ARMv5te]>;
866 def : ProcNoItin<"arm926ej-s", [ARMv5te]>;
867 def : ProcNoItin<"arm946e-s", [ARMv5te]>;
868 def : ProcNoItin<"arm966e-s", [ARMv5te]>;
869 def : ProcNoItin<"arm968e-s", [ARMv5te]>;
870 def : ProcNoItin<"arm10e", [ARMv5te]>;
871 def : ProcNoItin<"arm1020e", [ARMv5te]>;
872 def : ProcNoItin<"arm1022e", [ARMv5te]>;
873 def : ProcNoItin<"xscale", [ARMv5te]>;
874 def : ProcNoItin<"iwmmxt", [ARMv5te]>;
876 def : Processor<"arm1136j-s", ARMV6Itineraries, [ARMv6]>;
877 def : Processor<"arm1136jf-s", ARMV6Itineraries, [ARMv6,
879 FeatureHasSlowFPVMLx]>;
881 def : Processor<"cortex-m0", ARMV6Itineraries, [ARMv6m]>;
882 def : Processor<"cortex-m0plus", ARMV6Itineraries, [ARMv6m]>;
883 def : Processor<"cortex-m1", ARMV6Itineraries, [ARMv6m]>;
884 def : Processor<"sc000", ARMV6Itineraries, [ARMv6m]>;
886 def : Processor<"arm1176j-s", ARMV6Itineraries, [ARMv6kz]>;
887 def : Processor<"arm1176jz-s", ARMV6Itineraries, [ARMv6kz]>;
888 def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ARMv6kz,
890 FeatureHasSlowFPVMLx]>;
892 def : Processor<"mpcorenovfp", ARMV6Itineraries, [ARMv6k]>;
893 def : Processor<"mpcore", ARMV6Itineraries, [ARMv6k,
895 FeatureHasSlowFPVMLx]>;
897 def : Processor<"arm1156t2-s", ARMV6Itineraries, [ARMv6t2]>;
898 def : Processor<"arm1156t2f-s", ARMV6Itineraries, [ARMv6t2,
900 FeatureHasSlowFPVMLx]>;
902 def : ProcessorModel<"cortex-a5", CortexA8Model, [ARMv7a, ProcA5,
903 FeatureHasRetAddrStack,
906 FeatureHasSlowFPVMLx,
907 FeatureVMLxForwarding,
911 def : ProcessorModel<"cortex-a7", CortexA8Model, [ARMv7a, ProcA7,
912 FeatureHasRetAddrStack,
915 FeatureHasVMLxHazards,
916 FeatureHasSlowFPVMLx,
917 FeatureVMLxForwarding,
920 FeatureVirtualization]>;
922 def : ProcessorModel<"cortex-a8", CortexA8Model, [ARMv7a, ProcA8,
923 FeatureHasRetAddrStack,
924 FeatureNonpipelinedVFP,
927 FeatureHasVMLxHazards,
928 FeatureHasSlowFPVMLx,
929 FeatureVMLxForwarding]>;
931 def : ProcessorModel<"cortex-a9", CortexA9Model, [ARMv7a, ProcA9,
932 FeatureHasRetAddrStack,
934 FeatureHasVMLxHazards,
935 FeatureVMLxForwarding,
937 FeatureAvoidPartialCPSR,
941 FeatureNEONForFPMovs,
942 FeatureCheckVLDnAlign,
945 def : ProcessorModel<"cortex-a12", CortexA9Model, [ARMv7a, ProcA12,
946 FeatureHasRetAddrStack,
948 FeatureVMLxForwarding,
950 FeatureAvoidPartialCPSR,
951 FeatureVirtualization,
954 def : ProcessorModel<"cortex-a15", CortexA9Model, [ARMv7a, ProcA15,
955 FeatureDontWidenVMOVS,
956 FeatureSplatVFPToNeon,
957 FeatureHasRetAddrStack,
962 FeatureCheckVLDnAlign,
963 FeatureAvoidPartialCPSR,
964 FeatureVirtualization]>;
966 def : ProcessorModel<"cortex-a17", CortexA9Model, [ARMv7a, ProcA17,
967 FeatureHasRetAddrStack,
970 FeatureVMLxForwarding,
972 FeatureAvoidPartialCPSR,
973 FeatureVirtualization]>;
975 // FIXME: krait has currently the same features as A9 plus VFP4 and HWDiv
976 def : ProcessorModel<"krait", CortexA9Model, [ARMv7a, ProcKrait,
977 FeatureHasRetAddrStack,
979 FeatureCheckVLDnAlign,
980 FeatureVMLxForwarding,
982 FeatureAvoidPartialCPSR,
987 def : ProcessorModel<"swift", SwiftModel, [ARMv7a, ProcSwift,
988 FeatureHasRetAddrStack,
991 FeatureUseWideStrideVFP,
995 FeatureAvoidPartialCPSR,
996 FeatureAvoidMOVsShOp,
997 FeatureHasSlowFPVMLx,
998 FeatureHasVMLxHazards,
999 FeatureProfUnpredicate,
1000 FeaturePrefISHSTBarrier,
1001 FeatureSlowOddRegister,
1002 FeatureSlowLoadDSubreg,
1003 FeatureSlowVGETLNi32,
1006 FeatureNoPostRASched]>;
1008 def : ProcessorModel<"cortex-r4", CortexA8Model, [ARMv7r, ProcR4,
1009 FeatureHasRetAddrStack,
1010 FeatureAvoidPartialCPSR]>;
1012 def : ProcessorModel<"cortex-r4f", CortexA8Model, [ARMv7r, ProcR4,
1013 FeatureHasRetAddrStack,
1015 FeatureHasSlowFPVMLx,
1017 FeatureAvoidPartialCPSR]>;
1019 def : ProcessorModel<"cortex-r5", CortexA8Model, [ARMv7r, ProcR5,
1020 FeatureHasRetAddrStack,
1024 FeatureHasSlowFPVMLx,
1025 FeatureAvoidPartialCPSR]>;
1027 def : ProcessorModel<"cortex-r7", CortexA8Model, [ARMv7r, ProcR7,
1028 FeatureHasRetAddrStack,
1034 FeatureHasSlowFPVMLx,
1035 FeatureAvoidPartialCPSR]>;
1037 def : ProcessorModel<"cortex-r8", CortexA8Model, [ARMv7r,
1038 FeatureHasRetAddrStack,
1044 FeatureHasSlowFPVMLx,
1045 FeatureAvoidPartialCPSR]>;
1047 def : ProcessorModel<"cortex-m3", CortexM4Model, [ARMv7m,
1049 FeaturePrefLoopAlign32,
1052 FeatureHasNoBranchPredictor]>;
1054 def : ProcessorModel<"sc300", CortexM4Model, [ARMv7m,
1058 FeatureHasNoBranchPredictor]>;
1060 def : ProcessorModel<"cortex-m4", CortexM4Model, [ARMv7em,
1062 FeaturePrefLoopAlign32,
1063 FeatureHasSlowFPVMLx,
1066 FeatureHasNoBranchPredictor]>;
1068 def : ProcNoItin<"cortex-m7", [ARMv7em,
1069 FeatureFPARMv8_D16]>;
1071 def : ProcNoItin<"cortex-m23", [ARMv8mBaseline,
1074 def : ProcessorModel<"cortex-m33", CortexM4Model, [ARMv8mMainline,
1076 FeatureFPARMv8_D16_SP,
1077 FeaturePrefLoopAlign32,
1078 FeatureHasSlowFPVMLx,
1081 FeatureHasNoBranchPredictor]>;
1083 def : ProcessorModel<"cortex-m35p", CortexM4Model, [ARMv8mMainline,
1085 FeatureFPARMv8_D16_SP,
1086 FeaturePrefLoopAlign32,
1087 FeatureHasSlowFPVMLx,
1090 FeatureHasNoBranchPredictor]>;
1093 def : ProcNoItin<"cortex-a32", [ARMv8a,
1099 def : ProcNoItin<"cortex-a35", [ARMv8a, ProcA35,
1105 def : ProcNoItin<"cortex-a53", [ARMv8a, ProcA53,
1112 def : ProcNoItin<"cortex-a55", [ARMv82a, ProcA55,
1117 def : ProcessorModel<"cortex-a57", CortexA57Model, [ARMv8a, ProcA57,
1123 FeatureAvoidPartialCPSR,
1124 FeatureCheapPredicableCPSR]>;
1126 def : ProcessorModel<"cortex-a72", CortexA57Model, [ARMv8a, ProcA72,
1132 def : ProcNoItin<"cortex-a73", [ARMv8a, ProcA73,
1138 def : ProcNoItin<"cortex-a75", [ARMv82a, ProcA75,
1143 def : ProcNoItin<"cortex-a76", [ARMv82a, ProcA76,
1151 def : ProcNoItin<"cortex-a76ae", [ARMv82a, ProcA76,
1159 def : ProcNoItin<"neoverse-n1", [ARMv82a,
1166 def : ProcessorModel<"cyclone", SwiftModel, [ARMv8a, ProcSwift,
1167 FeatureHasRetAddrStack,
1173 FeatureAvoidPartialCPSR,
1174 FeatureAvoidMOVsShOp,
1175 FeatureHasSlowFPVMLx,
1179 FeatureNoPostRASched]>;
1181 def : ProcNoItin<"exynos-m1", [ARMv8a, ProcExynos]>;
1182 def : ProcNoItin<"exynos-m2", [ARMv8a, ProcExynos]>;
1183 def : ProcNoItin<"exynos-m3", [ARMv8a, ProcExynos]>;
1184 def : ProcNoItin<"exynos-m4", [ARMv82a, ProcExynos,
1187 def : ProcNoItin<"exynos-m5", [ARMv82a, ProcExynos,
1191 def : ProcNoItin<"kryo", [ARMv8a, ProcKryo,
1197 def : ProcessorModel<"cortex-r52", CortexR52Model, [ARMv8r, ProcR52,
1202 //===----------------------------------------------------------------------===//
1203 // Register File Description
1204 //===----------------------------------------------------------------------===//
1206 include "ARMRegisterInfo.td"
1207 include "ARMRegisterBanks.td"
1208 include "ARMCallingConv.td"
1210 //===----------------------------------------------------------------------===//
1211 // Instruction Descriptions
1212 //===----------------------------------------------------------------------===//
1214 include "ARMInstrInfo.td"
1215 def ARMInstrInfo : InstrInfo;
1217 //===----------------------------------------------------------------------===//
1218 // Declare the target which we are implementing
1219 //===----------------------------------------------------------------------===//
1221 def ARMAsmWriter : AsmWriter {
1222 string AsmWriterClassName = "InstPrinter";
1223 int PassSubtarget = 1;
1225 bit isMCAsmWriter = 1;
1228 def ARMAsmParser : AsmParser {
1229 bit ReportMultipleNearMisses = 1;
1232 def ARMAsmParserVariant : AsmParserVariant {
1234 string Name = "ARM";
1235 string BreakCharacters = ".";
1239 // Pull in Instruction Info.
1240 let InstructionSet = ARMInstrInfo;
1241 let AssemblyWriters = [ARMAsmWriter];
1242 let AssemblyParsers = [ARMAsmParser];
1243 let AssemblyParserVariants = [ARMAsmParserVariant];
1244 let AllowRegisterRenaming = 1;