ARM.td 96 KB

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