1 //===-- ARM.td - Describe the ARM Target Machine -----------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
14 // Target-independent interfaces which we are implementing
15 //===----------------------------------------------------------------------===//
17 include "llvm/Target/Target.td"
19 //===----------------------------------------------------------------------===//
20 // ARM Subtarget state.
23 def ModeThumb : SubtargetFeature<"thumb-mode", "InThumbMode",
24 "true", "Thumb mode">;
26 def ModeSoftFloat : SubtargetFeature<"soft-float","UseSoftFloat",
27 "true", "Use software floating "
31 //===----------------------------------------------------------------------===//
32 // ARM Subtarget features.
35 // Floating Point, HW Division and Neon Support
36 def FeatureVFP2 : SubtargetFeature<"vfp2", "HasVFPv2", "true",
37 "Enable VFP2 instructions">;
39 def FeatureVFP3 : SubtargetFeature<"vfp3", "HasVFPv3", "true",
40 "Enable VFP3 instructions",
43 def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
44 "Enable NEON instructions",
47 def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
48 "Enable half-precision "
51 def FeatureVFP4 : SubtargetFeature<"vfp4", "HasVFPv4", "true",
52 "Enable VFP4 instructions",
53 [FeatureVFP3, FeatureFP16]>;
55 def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8",
56 "true", "Enable ARMv8 FP",
59 def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
60 "Enable full half-precision "
64 def FeatureVFPOnlySP : SubtargetFeature<"fp-only-sp", "FPOnlySP", "true",
65 "Floating point unit supports "
66 "single precision only">;
68 def FeatureD16 : SubtargetFeature<"d16", "HasD16", "true",
69 "Restrict FP to 16 double registers">;
71 def FeatureHWDivThumb : SubtargetFeature<"hwdiv",
72 "HasHardwareDivideInThumb", "true",
73 "Enable divide instructions in Thumb">;
75 def FeatureHWDivARM : SubtargetFeature<"hwdiv-arm",
76 "HasHardwareDivideInARM", "true",
77 "Enable divide instructions in ARM mode">;
80 def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true",
81 "Has data barrier (dmb/dsb) instructions">;
83 def FeatureV7Clrex : SubtargetFeature<"v7clrex", "HasV7Clrex", "true",
84 "Has v7 clrex instruction">;
86 def FeatureDFB : SubtargetFeature<"dfb", "HasFullDataBarrier", "true",
87 "Has full data barrier (dfb) instruction">;
89 def FeatureAcquireRelease : SubtargetFeature<"acquire-release",
90 "HasAcquireRelease", "true",
91 "Has v8 acquire/release (lda/ldaex "
92 " etc) instructions">;
95 def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
96 "FP compare + branch is slow">;
98 def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
99 "Enable support for Performance "
100 "Monitor extensions">;
103 // TrustZone Security Extensions
104 def FeatureTrustZone : SubtargetFeature<"trustzone", "HasTrustZone", "true",
105 "Enable support for TrustZone "
106 "security extensions">;
108 def Feature8MSecExt : SubtargetFeature<"8msecext", "Has8MSecExt", "true",
109 "Enable support for ARMv8-M "
110 "Security Extensions">;
112 def FeatureSHA2 : SubtargetFeature<"sha2", "HasSHA2", "true",
113 "Enable SHA1 and SHA256 support", [FeatureNEON]>;
115 def FeatureAES : SubtargetFeature<"aes", "HasAES", "true",
116 "Enable AES support", [FeatureNEON]>;
118 def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
119 "Enable support for "
120 "Cryptography extensions",
121 [FeatureNEON, FeatureSHA2, FeatureAES]>;
123 def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
124 "Enable support for CRC instructions">;
126 def FeatureDotProd : SubtargetFeature<"dotprod", "HasDotProd", "true",
127 "Enable support for dot product instructions",
130 // Not to be confused with FeatureHasRetAddrStack (return address stack)
131 def FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
132 "Enable Reliability, Availability "
133 "and Serviceability extensions">;
135 // Fast computation of non-negative address offsets
136 def FeatureFPAO : SubtargetFeature<"fpao", "HasFPAO", "true",
137 "Enable fast computation of "
138 "positive address offsets">;
140 // Fast execution of AES crypto operations
141 def FeatureFuseAES : SubtargetFeature<"fuse-aes", "HasFuseAES", "true",
142 "CPU fuses AES crypto operations">;
144 // The way of reading thread pointer
145 def FeatureReadTp : SubtargetFeature<"read-tp-hard", "ReadTPHard", "true",
146 "Reading thread pointer from register">;
148 // Cyclone can zero VFP registers in 0 cycles.
149 def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
150 "Has zero-cycle zeroing instructions">;
152 // Whether it is profitable to unpredicate certain instructions during if-conversion
153 def FeatureProfUnpredicate : SubtargetFeature<"prof-unpr",
154 "IsProfitableToUnpredicate", "true",
155 "Is profitable to unpredicate">;
157 // Some targets (e.g. Swift) have microcoded VGETLNi32.
158 def FeatureSlowVGETLNi32 : SubtargetFeature<"slow-vgetlni32",
159 "HasSlowVGETLNi32", "true",
160 "Has slow VGETLNi32 - prefer VMOV">;
162 // Some targets (e.g. Swift) have microcoded VDUP32.
163 def FeatureSlowVDUP32 : SubtargetFeature<"slow-vdup32", "HasSlowVDUP32",
165 "Has slow VDUP32 - prefer VMOV">;
167 // Some targets (e.g. Cortex-A9) prefer VMOVSR to VMOVDRR even when using NEON
168 // for scalar FP, as this allows more effective execution domain optimization.
169 def FeaturePreferVMOVSR : SubtargetFeature<"prefer-vmovsr", "PreferVMOVSR",
170 "true", "Prefer VMOVSR">;
172 // Swift has ISHST barriers compatible with Atomic Release semantics but weaker
174 def FeaturePrefISHSTBarrier : SubtargetFeature<"prefer-ishst", "PreferISHST",
175 "true", "Prefer ISHST barriers">;
177 // Some targets (e.g. Cortex-A9) have muxed AGU and NEON/FPU.
178 def FeatureMuxedUnits : SubtargetFeature<"muxed-units", "HasMuxedUnits",
180 "Has muxed AGU and NEON/FPU">;
182 // Whether VLDM/VSTM starting with odd register number need more microops
184 def FeatureSlowOddRegister : SubtargetFeature<"slow-odd-reg", "SlowOddRegister",
185 "true", "VLDM/VSTM starting "
186 "with an odd register is slow">;
188 // Some targets have a renaming dependency when loading into D subregisters.
189 def FeatureSlowLoadDSubreg : SubtargetFeature<"slow-load-D-subreg",
190 "SlowLoadDSubregister", "true",
191 "Loading into D subregs is slow">;
193 // Some targets (e.g. Cortex-A15) never want VMOVS to be widened to VMOVD.
194 def FeatureDontWidenVMOVS : SubtargetFeature<"dont-widen-vmovs",
195 "DontWidenVMOVS", "true",
196 "Don't widen VMOVS to VMOVD">;
198 // Whether or not it is profitable to expand VFP/NEON MLA/MLS instructions.
199 def FeatureExpandMLx : SubtargetFeature<"expand-fp-mlx",
201 "Expand VFP/NEON MLA/MLS instructions">;
203 // Some targets have special RAW hazards for VFP/NEON VMLA/VMLS.
204 def FeatureHasVMLxHazards : SubtargetFeature<"vmlx-hazards", "HasVMLxHazards",
205 "true", "Has VMLx hazards">;
207 // Some targets (e.g. Cortex-A9) want to convert VMOVRS, VMOVSR and VMOVS from
208 // VFP to NEON, as an execution domain optimization.
209 def FeatureNEONForFPMovs : SubtargetFeature<"neon-fpmovs",
210 "UseNEONForFPMovs", "true",
211 "Convert VMOVSR, VMOVRS, "
214 // Some processors benefit from using NEON instructions for scalar
215 // single-precision FP operations. This affects instruction selection and should
216 // only be enabled if the handling of denormals is not important.
217 def FeatureNEONForFP : SubtargetFeature<"neonfp",
218 "UseNEONForSinglePrecisionFP",
220 "Use NEON for single precision FP">;
222 // On some processors, VLDn instructions that access unaligned data take one
223 // extra cycle. Take that into account when computing operand latencies.
224 def FeatureCheckVLDnAlign : SubtargetFeature<"vldn-align", "CheckVLDnAlign",
226 "Check for VLDn unaligned access">;
228 // Some processors have a nonpipelined VFP coprocessor.
229 def FeatureNonpipelinedVFP : SubtargetFeature<"nonpipelined-vfp",
230 "NonpipelinedVFP", "true",
231 "VFP instructions are not pipelined">;
233 // Some processors have FP multiply-accumulate instructions that don't
234 // play nicely with other VFP / NEON instructions, and it's generally better
235 // to just not use them.
236 def FeatureHasSlowFPVMLx : SubtargetFeature<"slowfpvmlx", "SlowFPVMLx", "true",
237 "Disable VFP / NEON MAC instructions">;
239 // Cortex-A8 / A9 Advanced SIMD has multiplier accumulator forwarding.
240 def FeatureVMLxForwarding : SubtargetFeature<"vmlx-forwarding",
241 "HasVMLxForwarding", "true",
242 "Has multiplier accumulator forwarding">;
244 // Disable 32-bit to 16-bit narrowing for experimentation.
245 def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
246 "Prefer 32-bit Thumb instrs">;
248 /// Some instructions update CPSR partially, which can add false dependency for
249 /// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is
250 /// mapped to a separate physical register. Avoid partial CPSR update for these
252 def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr",
253 "AvoidCPSRPartialUpdate", "true",
254 "Avoid CPSR partial update for OOO execution">;
256 /// Disable +1 predication cost for instructions updating CPSR.
257 /// Enabled for Cortex-A57.
258 def FeatureCheapPredicableCPSR : SubtargetFeature<"cheap-predicable-cpsr",
259 "CheapPredicableCPSRDef",
261 "Disable +1 predication cost for instructions updating CPSR">;
263 def FeatureAvoidMOVsShOp : SubtargetFeature<"avoid-movs-shop",
264 "AvoidMOVsShifterOperand", "true",
265 "Avoid movs instructions with "
268 // Some processors perform return stack prediction. CodeGen should avoid issue
269 // "normal" call instructions to callees which do not return.
270 def FeatureHasRetAddrStack : SubtargetFeature<"ret-addr-stack",
271 "HasRetAddrStack", "true",
272 "Has return address stack">;
274 // Some processors have no branch predictor, which changes the expected cost of
275 // taking a branch which affects the choice of whether to use predicated
277 def FeatureHasNoBranchPredictor : SubtargetFeature<"no-branch-predictor",
278 "HasBranchPredictor", "false",
279 "Has no branch predictor">;
282 def FeatureDSP : SubtargetFeature<"dsp", "HasDSP", "true",
283 "Supports DSP instructions in "
284 "ARM and/or Thumb2">;
286 // Multiprocessing extension.
287 def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true",
288 "Supports Multiprocessing extension">;
290 // Virtualization extension - requires HW divide (ARMv7-AR ARMARM - 4.4.8).
291 def FeatureVirtualization : SubtargetFeature<"virtualization",
292 "HasVirtualization", "true",
293 "Supports Virtualization extension",
294 [FeatureHWDivThumb, FeatureHWDivARM]>;
296 // Special TRAP encoding for NaCl, which looks like a TRAP in Thumb too.
297 // See ARMInstrInfo.td for details.
298 def FeatureNaClTrap : SubtargetFeature<"nacl-trap", "UseNaClTrap", "true",
301 def FeatureStrictAlign : SubtargetFeature<"strict-align",
302 "StrictAlign", "true",
303 "Disallow all unaligned memory "
306 def FeatureLongCalls : SubtargetFeature<"long-calls", "GenLongCalls", "true",
307 "Generate calls via indirect call "
310 def FeatureExecuteOnly : SubtargetFeature<"execute-only",
311 "GenExecuteOnly", "true",
312 "Enable the generation of "
313 "execute only code.">;
315 def FeatureReserveR9 : SubtargetFeature<"reserve-r9", "ReserveR9", "true",
316 "Reserve R9, making it unavailable"
319 def FeatureNoMovt : SubtargetFeature<"no-movt", "NoMovt", "true",
320 "Don't use movt/movw pairs for "
323 def FeatureNoNegativeImmediates
324 : SubtargetFeature<"no-neg-immediates",
325 "NegativeImmediates", "false",
326 "Convert immediates and instructions "
327 "to their negated or complemented "
328 "equivalent when the immediate does "
329 "not fit in the encoding.">;
331 // Use the MachineScheduler for instruction scheduling for the subtarget.
332 def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true",
333 "Use the MachineScheduler">;
335 def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler",
336 "DisablePostRAScheduler", "true",
337 "Don't schedule again after register allocation">;
339 // Enable use of alias analysis during code generation
340 def FeatureUseAA : SubtargetFeature<"use-aa", "UseAA", "true",
341 "Use alias analysis during codegen">;
343 //===----------------------------------------------------------------------===//
344 // ARM architecture class
348 def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass",
349 "Is application profile ('A' series)">;
352 def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass",
353 "Is realtime profile ('R' series)">;
356 def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass",
357 "Is microcontroller profile ('M' series)">;
360 def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true",
361 "Enable Thumb2 instructions">;
363 def FeatureNoARM : SubtargetFeature<"noarm", "NoARM", "true",
364 "Does not support ARM mode execution">;
366 //===----------------------------------------------------------------------===//
370 def HasV4TOps : SubtargetFeature<"v4t", "HasV4TOps", "true",
371 "Support ARM v4T instructions">;
373 def HasV5TOps : SubtargetFeature<"v5t", "HasV5TOps", "true",
374 "Support ARM v5T instructions",
377 def HasV5TEOps : SubtargetFeature<"v5te", "HasV5TEOps", "true",
378 "Support ARM v5TE, v5TEj, and "
379 "v5TExp instructions",
382 def HasV6Ops : SubtargetFeature<"v6", "HasV6Ops", "true",
383 "Support ARM v6 instructions",
386 def HasV6MOps : SubtargetFeature<"v6m", "HasV6MOps", "true",
387 "Support ARM v6M instructions",
390 def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true",
391 "Support ARM v8M Baseline instructions",
394 def HasV6KOps : SubtargetFeature<"v6k", "HasV6KOps", "true",
395 "Support ARM v6k instructions",
398 def HasV6T2Ops : SubtargetFeature<"v6t2", "HasV6T2Ops", "true",
399 "Support ARM v6t2 instructions",
400 [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>;
402 def HasV7Ops : SubtargetFeature<"v7", "HasV7Ops", "true",
403 "Support ARM v7 instructions",
404 [HasV6T2Ops, FeaturePerfMon,
407 def HasV8MMainlineOps :
408 SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true",
409 "Support ARM v8M Mainline instructions",
412 def HasV8Ops : SubtargetFeature<"v8", "HasV8Ops", "true",
413 "Support ARM v8 instructions",
414 [HasV7Ops, FeatureAcquireRelease]>;
416 def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
417 "Support ARM v8.1a instructions",
420 def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
421 "Support ARM v8.2a instructions",
424 def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
425 "Support ARM v8.3a instructions",
428 def HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
429 "Support ARM v8.4a instructions",
430 [HasV8_3aOps, FeatureDotProd]>;
432 //===----------------------------------------------------------------------===//
433 // ARM Processor subtarget features.
436 def ProcA5 : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5",
437 "Cortex-A5 ARM processors", []>;
438 def ProcA7 : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7",
439 "Cortex-A7 ARM processors", []>;
440 def ProcA8 : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
441 "Cortex-A8 ARM processors", []>;
442 def ProcA9 : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
443 "Cortex-A9 ARM processors", []>;
444 def ProcA12 : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12",
445 "Cortex-A12 ARM processors", []>;
446 def ProcA15 : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15",
447 "Cortex-A15 ARM processors", []>;
448 def ProcA17 : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17",
449 "Cortex-A17 ARM processors", []>;
450 def ProcA32 : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32",
451 "Cortex-A32 ARM processors", []>;
452 def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
453 "Cortex-A35 ARM processors", []>;
454 def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
455 "Cortex-A53 ARM processors", []>;
456 def ProcA55 : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
457 "Cortex-A55 ARM processors", []>;
458 def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
459 "Cortex-A57 ARM processors", []>;
460 def ProcA72 : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
461 "Cortex-A72 ARM processors", []>;
462 def ProcA73 : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
463 "Cortex-A73 ARM processors", []>;
464 def ProcA75 : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
465 "Cortex-A75 ARM processors", []>;
467 def ProcKrait : SubtargetFeature<"krait", "ARMProcFamily", "Krait",
468 "Qualcomm Krait processors", []>;
469 def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
470 "Qualcomm Kryo processors", []>;
471 def ProcSwift : SubtargetFeature<"swift", "ARMProcFamily", "Swift",
472 "Swift ARM processors", []>;
474 def ProcExynosM1 : SubtargetFeature<"exynosm1", "ARMProcFamily", "ExynosM1",
475 "Samsung Exynos-Mx processors", []>;
477 def ProcR4 : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4",
478 "Cortex-R4 ARM processors", []>;
479 def ProcR5 : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5",
480 "Cortex-R5 ARM processors", []>;
481 def ProcR7 : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7",
482 "Cortex-R7 ARM processors", []>;
483 def ProcR52 : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52",
484 "Cortex-R52 ARM processors", []>;
486 def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3",
487 "Cortex-M3 ARM processors", []>;
490 //===----------------------------------------------------------------------===//
491 // ARM Helper classes.
494 class Architecture<string fname, string aname, list<SubtargetFeature> features>
495 : SubtargetFeature<fname, "ARMArch", aname,
496 !strconcat(aname, " architecture"), features>;
498 class ProcNoItin<string Name, list<SubtargetFeature> Features>
499 : Processor<Name, NoItineraries, Features>;
502 //===----------------------------------------------------------------------===//
506 def ARMv2 : Architecture<"armv2", "ARMv2", []>;
508 def ARMv2a : Architecture<"armv2a", "ARMv2a", []>;
510 def ARMv3 : Architecture<"armv3", "ARMv3", []>;
512 def ARMv3m : Architecture<"armv3m", "ARMv3m", []>;
514 def ARMv4 : Architecture<"armv4", "ARMv4", []>;
516 def ARMv4t : Architecture<"armv4t", "ARMv4t", [HasV4TOps]>;
518 def ARMv5t : Architecture<"armv5t", "ARMv5t", [HasV5TOps]>;
520 def ARMv5te : Architecture<"armv5te", "ARMv5te", [HasV5TEOps]>;
522 def ARMv5tej : Architecture<"armv5tej", "ARMv5tej", [HasV5TEOps]>;
524 def ARMv6 : Architecture<"armv6", "ARMv6", [HasV6Ops,
527 def ARMv6t2 : Architecture<"armv6t2", "ARMv6t2", [HasV6T2Ops,
530 def ARMv6k : Architecture<"armv6k", "ARMv6k", [HasV6KOps]>;
532 def ARMv6kz : Architecture<"armv6kz", "ARMv6kz", [HasV6KOps,
535 def ARMv6m : Architecture<"armv6-m", "ARMv6m", [HasV6MOps,
540 FeatureStrictAlign]>;
542 def ARMv6sm : Architecture<"armv6s-m", "ARMv6sm", [HasV6MOps,
547 FeatureStrictAlign]>;
549 def ARMv7a : Architecture<"armv7-a", "ARMv7a", [HasV7Ops,
555 def ARMv7ve : Architecture<"armv7ve", "ARMv7ve", [HasV7Ops,
561 FeatureVirtualization,
564 def ARMv7r : Architecture<"armv7-r", "ARMv7r", [HasV7Ops,
570 def ARMv7m : Architecture<"armv7-m", "ARMv7m", [HasV7Ops,
578 def ARMv7em : Architecture<"armv7e-m", "ARMv7em", [HasV7Ops,
587 def ARMv8a : Architecture<"armv8-a", "ARMv8a", [HasV8Ops,
595 FeatureVirtualization,
599 def ARMv81a : Architecture<"armv8.1-a", "ARMv81a", [HasV8_1aOps,
607 FeatureVirtualization,
611 def ARMv82a : Architecture<"armv8.2-a", "ARMv82a", [HasV8_2aOps,
619 FeatureVirtualization,
624 def ARMv83a : Architecture<"armv8.3-a", "ARMv83a", [HasV8_3aOps,
632 FeatureVirtualization,
637 def ARMv84a : Architecture<"armv8.4-a", "ARMv84a", [HasV8_4aOps,
645 FeatureVirtualization,
651 def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops,
658 FeatureVirtualization,
662 def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline",
670 FeatureAcquireRelease,
672 FeatureStrictAlign]>;
674 def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline",
681 FeatureAcquireRelease,
685 def IWMMXT : Architecture<"iwmmxt", "ARMv5te", [ARMv5te]>;
686 def IWMMXT2 : Architecture<"iwmmxt2", "ARMv5te", [ARMv5te]>;
687 def XScale : Architecture<"xscale", "ARMv5te", [ARMv5te]>;
688 def ARMv6j : Architecture<"armv6j", "ARMv7a", [ARMv6]>;
689 def ARMv7k : Architecture<"armv7k", "ARMv7a", [ARMv7a]>;
690 def ARMv7s : Architecture<"armv7s", "ARMv7a", [ARMv7a]>;
693 //===----------------------------------------------------------------------===//
695 //===----------------------------------------------------------------------===//
697 include "ARMSchedule.td"
699 //===----------------------------------------------------------------------===//
703 // Dummy CPU, used to target architectures
704 def : ProcessorModel<"generic", CortexA8Model, []>;
706 // FIXME: Several processors below are not using their own scheduler
707 // model, but one of similar/previous processor. These should be fixed.
709 def : ProcNoItin<"arm8", [ARMv4]>;
710 def : ProcNoItin<"arm810", [ARMv4]>;
711 def : ProcNoItin<"strongarm", [ARMv4]>;
712 def : ProcNoItin<"strongarm110", [ARMv4]>;
713 def : ProcNoItin<"strongarm1100", [ARMv4]>;
714 def : ProcNoItin<"strongarm1110", [ARMv4]>;
716 def : ProcNoItin<"arm7tdmi", [ARMv4t]>;
717 def : ProcNoItin<"arm7tdmi-s", [ARMv4t]>;
718 def : ProcNoItin<"arm710t", [ARMv4t]>;
719 def : ProcNoItin<"arm720t", [ARMv4t]>;
720 def : ProcNoItin<"arm9", [ARMv4t]>;
721 def : ProcNoItin<"arm9tdmi", [ARMv4t]>;
722 def : ProcNoItin<"arm920", [ARMv4t]>;
723 def : ProcNoItin<"arm920t", [ARMv4t]>;
724 def : ProcNoItin<"arm922t", [ARMv4t]>;
725 def : ProcNoItin<"arm940t", [ARMv4t]>;
726 def : ProcNoItin<"ep9312", [ARMv4t]>;
728 def : ProcNoItin<"arm10tdmi", [ARMv5t]>;
729 def : ProcNoItin<"arm1020t", [ARMv5t]>;
731 def : ProcNoItin<"arm9e", [ARMv5te]>;
732 def : ProcNoItin<"arm926ej-s", [ARMv5te]>;
733 def : ProcNoItin<"arm946e-s", [ARMv5te]>;
734 def : ProcNoItin<"arm966e-s", [ARMv5te]>;
735 def : ProcNoItin<"arm968e-s", [ARMv5te]>;
736 def : ProcNoItin<"arm10e", [ARMv5te]>;
737 def : ProcNoItin<"arm1020e", [ARMv5te]>;
738 def : ProcNoItin<"arm1022e", [ARMv5te]>;
739 def : ProcNoItin<"xscale", [ARMv5te]>;
740 def : ProcNoItin<"iwmmxt", [ARMv5te]>;
742 def : Processor<"arm1136j-s", ARMV6Itineraries, [ARMv6]>;
743 def : Processor<"arm1136jf-s", ARMV6Itineraries, [ARMv6,
745 FeatureHasSlowFPVMLx]>;
747 def : Processor<"cortex-m0", ARMV6Itineraries, [ARMv6m]>;
748 def : Processor<"cortex-m0plus", ARMV6Itineraries, [ARMv6m]>;
749 def : Processor<"cortex-m1", ARMV6Itineraries, [ARMv6m]>;
750 def : Processor<"sc000", ARMV6Itineraries, [ARMv6m]>;
752 def : Processor<"arm1176j-s", ARMV6Itineraries, [ARMv6kz]>;
753 def : Processor<"arm1176jz-s", ARMV6Itineraries, [ARMv6kz]>;
754 def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ARMv6kz,
756 FeatureHasSlowFPVMLx]>;
758 def : Processor<"mpcorenovfp", ARMV6Itineraries, [ARMv6k]>;
759 def : Processor<"mpcore", ARMV6Itineraries, [ARMv6k,
761 FeatureHasSlowFPVMLx]>;
763 def : Processor<"arm1156t2-s", ARMV6Itineraries, [ARMv6t2]>;
764 def : Processor<"arm1156t2f-s", ARMV6Itineraries, [ARMv6t2,
766 FeatureHasSlowFPVMLx]>;
768 def : ProcessorModel<"cortex-a5", CortexA8Model, [ARMv7a, ProcA5,
769 FeatureHasRetAddrStack,
772 FeatureHasSlowFPVMLx,
773 FeatureVMLxForwarding,
777 def : ProcessorModel<"cortex-a7", CortexA8Model, [ARMv7a, ProcA7,
778 FeatureHasRetAddrStack,
781 FeatureHasVMLxHazards,
782 FeatureHasSlowFPVMLx,
783 FeatureVMLxForwarding,
786 FeatureVirtualization]>;
788 def : ProcessorModel<"cortex-a8", CortexA8Model, [ARMv7a, ProcA8,
789 FeatureHasRetAddrStack,
790 FeatureNonpipelinedVFP,
793 FeatureHasVMLxHazards,
794 FeatureHasSlowFPVMLx,
795 FeatureVMLxForwarding]>;
797 def : ProcessorModel<"cortex-a9", CortexA9Model, [ARMv7a, ProcA9,
798 FeatureHasRetAddrStack,
800 FeatureHasVMLxHazards,
801 FeatureVMLxForwarding,
803 FeatureAvoidPartialCPSR,
807 FeatureNEONForFPMovs,
808 FeatureCheckVLDnAlign,
811 def : ProcessorModel<"cortex-a12", CortexA9Model, [ARMv7a, ProcA12,
812 FeatureHasRetAddrStack,
814 FeatureVMLxForwarding,
816 FeatureAvoidPartialCPSR,
817 FeatureVirtualization,
820 def : ProcessorModel<"cortex-a15", CortexA9Model, [ARMv7a, ProcA15,
821 FeatureDontWidenVMOVS,
822 FeatureHasRetAddrStack,
827 FeatureCheckVLDnAlign,
828 FeatureAvoidPartialCPSR,
829 FeatureVirtualization]>;
831 def : ProcessorModel<"cortex-a17", CortexA9Model, [ARMv7a, ProcA17,
832 FeatureHasRetAddrStack,
835 FeatureVMLxForwarding,
837 FeatureAvoidPartialCPSR,
838 FeatureVirtualization]>;
840 // FIXME: krait has currently the same features as A9 plus VFP4 and HWDiv
841 def : ProcessorModel<"krait", CortexA9Model, [ARMv7a, ProcKrait,
842 FeatureHasRetAddrStack,
844 FeatureCheckVLDnAlign,
845 FeatureVMLxForwarding,
847 FeatureAvoidPartialCPSR,
852 def : ProcessorModel<"swift", SwiftModel, [ARMv7a, ProcSwift,
853 FeatureHasRetAddrStack,
859 FeatureAvoidPartialCPSR,
860 FeatureAvoidMOVsShOp,
861 FeatureHasSlowFPVMLx,
862 FeatureHasVMLxHazards,
863 FeatureProfUnpredicate,
864 FeaturePrefISHSTBarrier,
865 FeatureSlowOddRegister,
866 FeatureSlowLoadDSubreg,
867 FeatureSlowVGETLNi32,
870 FeatureNoPostRASched]>;
872 def : ProcessorModel<"cortex-r4", CortexA8Model, [ARMv7r, ProcR4,
873 FeatureHasRetAddrStack,
874 FeatureAvoidPartialCPSR]>;
876 def : ProcessorModel<"cortex-r4f", CortexA8Model, [ARMv7r, ProcR4,
877 FeatureHasRetAddrStack,
879 FeatureHasSlowFPVMLx,
882 FeatureAvoidPartialCPSR]>;
884 def : ProcessorModel<"cortex-r5", CortexA8Model, [ARMv7r, ProcR5,
885 FeatureHasRetAddrStack,
890 FeatureHasSlowFPVMLx,
891 FeatureAvoidPartialCPSR]>;
893 def : ProcessorModel<"cortex-r7", CortexA8Model, [ARMv7r, ProcR7,
894 FeatureHasRetAddrStack,
901 FeatureHasSlowFPVMLx,
902 FeatureAvoidPartialCPSR]>;
904 def : ProcessorModel<"cortex-r8", CortexA8Model, [ARMv7r,
905 FeatureHasRetAddrStack,
912 FeatureHasSlowFPVMLx,
913 FeatureAvoidPartialCPSR]>;
915 def : ProcessorModel<"cortex-m3", CortexM3Model, [ARMv7m,
917 FeatureHasNoBranchPredictor]>;
919 def : ProcessorModel<"sc300", CortexM3Model, [ARMv7m,
921 FeatureHasNoBranchPredictor]>;
923 def : ProcessorModel<"cortex-m4", CortexM3Model, [ARMv7em,
927 FeatureHasNoBranchPredictor]>;
929 def : ProcNoItin<"cortex-m7", [ARMv7em,
933 def : ProcNoItin<"cortex-m23", [ARMv8mBaseline,
936 def : ProcessorModel<"cortex-m33", CortexM3Model, [ARMv8mMainline,
941 FeatureHasNoBranchPredictor]>;
943 def : ProcNoItin<"cortex-a32", [ARMv8a,
949 def : ProcNoItin<"cortex-a35", [ARMv8a, ProcA35,
955 def : ProcNoItin<"cortex-a53", [ARMv8a, ProcA53,
962 def : ProcNoItin<"cortex-a55", [ARMv82a, ProcA55,
967 def : ProcessorModel<"cortex-a57", CortexA57Model, [ARMv8a, ProcA57,
973 FeatureAvoidPartialCPSR,
974 FeatureCheapPredicableCPSR]>;
976 def : ProcNoItin<"cortex-a72", [ARMv8a, ProcA72,
982 def : ProcNoItin<"cortex-a73", [ARMv8a, ProcA73,
988 def : ProcNoItin<"cortex-a75", [ARMv82a, ProcA75,
993 def : ProcessorModel<"cyclone", SwiftModel, [ARMv8a, ProcSwift,
994 FeatureHasRetAddrStack,
1000 FeatureAvoidPartialCPSR,
1001 FeatureAvoidMOVsShOp,
1002 FeatureHasSlowFPVMLx,
1006 FeatureNoPostRASched]>;
1008 def : ProcNoItin<"exynos-m1", [ARMv8a, ProcExynosM1,
1014 def : ProcNoItin<"exynos-m2", [ARMv8a, ProcExynosM1,
1020 def : ProcNoItin<"exynos-m3", [ARMv8a, ProcExynosM1,
1026 def : ProcNoItin<"exynos-m4", [ARMv8a, ProcExynosM1,
1032 def : ProcNoItin<"kryo", [ARMv8a, ProcKryo,
1038 def : ProcessorModel<"cortex-r52", CortexR52Model, [ARMv8r, ProcR52,
1043 //===----------------------------------------------------------------------===//
1044 // Register File Description
1045 //===----------------------------------------------------------------------===//
1047 include "ARMRegisterInfo.td"
1048 include "ARMRegisterBanks.td"
1049 include "ARMCallingConv.td"
1051 //===----------------------------------------------------------------------===//
1052 // Instruction Descriptions
1053 //===----------------------------------------------------------------------===//
1055 include "ARMInstrInfo.td"
1056 def ARMInstrInfo : InstrInfo;
1058 //===----------------------------------------------------------------------===//
1059 // Declare the target which we are implementing
1060 //===----------------------------------------------------------------------===//
1062 def ARMAsmWriter : AsmWriter {
1063 string AsmWriterClassName = "InstPrinter";
1064 int PassSubtarget = 1;
1066 bit isMCAsmWriter = 1;
1069 def ARMAsmParser : AsmParser {
1070 bit ReportMultipleNearMisses = 1;
1073 def ARMAsmParserVariant : AsmParserVariant {
1075 string Name = "ARM";
1076 string BreakCharacters = ".";
1080 // Pull in Instruction Info.
1081 let InstructionSet = ARMInstrInfo;
1082 let AssemblyWriters = [ARMAsmWriter];
1083 let AssemblyParsers = [ARMAsmParser];
1084 let AssemblyParserVariants = [ARMAsmParserVariant];
1085 let AllowRegisterRenaming = 1;