ARM.td 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412
  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. def ModeThumb : SubtargetFeature<"thumb-mode", "InThumbMode",
  19. "true", "Thumb mode">;
  20. def ModeSoftFloat : SubtargetFeature<"soft-float","UseSoftFloat",
  21. "true", "Use software floating "
  22. "point features.">;
  23. //===----------------------------------------------------------------------===//
  24. // ARM Subtarget features.
  25. //
  26. // Floating Point, HW Division and Neon Support
  27. // FP loads/stores/moves, shared between VFP and MVE (even in the integer-only
  28. // version).
  29. def FeatureFPRegs : SubtargetFeature<"fpregs", "HasFPRegs", "true",
  30. "Enable FP registers">;
  31. // 16-bit FP loads/stores/moves, shared between VFP (with the v8.2A FP16
  32. // extension) and MVE (even in the integer-only version).
  33. def FeatureFPRegs16 : SubtargetFeature<"fpregs16", "HasFPRegs16", "true",
  34. "Enable 16-bit FP registers",
  35. [FeatureFPRegs]>;
  36. def FeatureFPRegs64 : SubtargetFeature<"fpregs64", "HasFPRegs64", "true",
  37. "Enable 64-bit FP registers",
  38. [FeatureFPRegs]>;
  39. def FeatureFP64 : SubtargetFeature<"fp64", "HasFP64", "true",
  40. "Floating point unit supports "
  41. "double precision",
  42. [FeatureFPRegs64]>;
  43. def FeatureD32 : SubtargetFeature<"d32", "HasD32", "true",
  44. "Extend FP to 32 double registers">;
  45. multiclass VFPver<string name, string query, string description,
  46. list<SubtargetFeature> prev,
  47. list<SubtargetFeature> otherimplies,
  48. list<SubtargetFeature> vfp2prev = []> {
  49. def _D16_SP: SubtargetFeature<
  50. name#"d16sp", query#"D16SP", "true",
  51. description#" with only 16 d-registers and no double precision",
  52. !foreach(v, prev, !cast<SubtargetFeature>(v # "_D16_SP")) #
  53. !foreach(v, vfp2prev, !cast<SubtargetFeature>(v # "_SP")) #
  54. otherimplies>;
  55. def _SP: SubtargetFeature<
  56. name#"sp", query#"SP", "true",
  57. description#" with no double precision",
  58. !foreach(v, prev, !cast<SubtargetFeature>(v # "_SP")) #
  59. otherimplies # [FeatureD32, !cast<SubtargetFeature>(NAME # "_D16_SP")]>;
  60. def _D16: SubtargetFeature<
  61. name#"d16", query#"D16", "true",
  62. description#" with only 16 d-registers",
  63. !foreach(v, prev, !cast<SubtargetFeature>(v # "_D16")) #
  64. vfp2prev #
  65. otherimplies # [FeatureFP64, !cast<SubtargetFeature>(NAME # "_D16_SP")]>;
  66. def "": SubtargetFeature<
  67. name, query, "true", description,
  68. prev # otherimplies # [
  69. !cast<SubtargetFeature>(NAME # "_D16"),
  70. !cast<SubtargetFeature>(NAME # "_SP")]>;
  71. }
  72. def FeatureVFP2_SP : SubtargetFeature<"vfp2sp", "HasVFPv2SP", "true",
  73. "Enable VFP2 instructions with "
  74. "no double precision",
  75. [FeatureFPRegs]>;
  76. def FeatureVFP2 : SubtargetFeature<"vfp2", "HasVFPv2", "true",
  77. "Enable VFP2 instructions",
  78. [FeatureFP64, FeatureVFP2_SP]>;
  79. defm FeatureVFP3: VFPver<"vfp3", "HasVFPv3", "Enable VFP3 instructions",
  80. [], [], [FeatureVFP2]>;
  81. def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
  82. "Enable NEON instructions",
  83. [FeatureVFP3]>;
  84. def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
  85. "Enable half-precision "
  86. "floating point">;
  87. defm FeatureVFP4: VFPver<"vfp4", "HasVFPv4", "Enable VFP4 instructions",
  88. [FeatureVFP3], [FeatureFP16]>;
  89. defm FeatureFPARMv8: VFPver<"fp-armv8", "HasFPARMv8", "Enable ARMv8 FP",
  90. [FeatureVFP4], []>;
  91. def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
  92. "Enable full half-precision "
  93. "floating point",
  94. [FeatureFPARMv8_D16_SP, FeatureFPRegs16]>;
  95. def FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true",
  96. "Enable full half-precision "
  97. "floating point fml instructions",
  98. [FeatureFullFP16]>;
  99. def FeatureHWDivThumb : SubtargetFeature<"hwdiv",
  100. "HasHardwareDivideInThumb", "true",
  101. "Enable divide instructions in Thumb">;
  102. def FeatureHWDivARM : SubtargetFeature<"hwdiv-arm",
  103. "HasHardwareDivideInARM", "true",
  104. "Enable divide instructions in ARM mode">;
  105. // Atomic Support
  106. def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true",
  107. "Has data barrier (dmb/dsb) instructions">;
  108. def FeatureV7Clrex : SubtargetFeature<"v7clrex", "HasV7Clrex", "true",
  109. "Has v7 clrex instruction">;
  110. def FeatureDFB : SubtargetFeature<"dfb", "HasFullDataBarrier", "true",
  111. "Has full data barrier (dfb) instruction">;
  112. def FeatureAcquireRelease : SubtargetFeature<"acquire-release",
  113. "HasAcquireRelease", "true",
  114. "Has v8 acquire/release (lda/ldaex "
  115. " etc) instructions">;
  116. def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
  117. "FP compare + branch is slow">;
  118. def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true",
  119. "Enable support for Performance "
  120. "Monitor extensions">;
  121. // TrustZone Security Extensions
  122. def FeatureTrustZone : SubtargetFeature<"trustzone", "HasTrustZone", "true",
  123. "Enable support for TrustZone "
  124. "security extensions">;
  125. def Feature8MSecExt : SubtargetFeature<"8msecext", "Has8MSecExt", "true",
  126. "Enable support for ARMv8-M "
  127. "Security Extensions">;
  128. def FeatureSHA2 : SubtargetFeature<"sha2", "HasSHA2", "true",
  129. "Enable SHA1 and SHA256 support", [FeatureNEON]>;
  130. def FeatureAES : SubtargetFeature<"aes", "HasAES", "true",
  131. "Enable AES support", [FeatureNEON]>;
  132. def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
  133. "Enable support for "
  134. "Cryptography extensions",
  135. [FeatureNEON, FeatureSHA2, FeatureAES]>;
  136. def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
  137. "Enable support for CRC instructions">;
  138. def FeatureDotProd : SubtargetFeature<"dotprod", "HasDotProd", "true",
  139. "Enable support for dot product instructions",
  140. [FeatureNEON]>;
  141. // Not to be confused with FeatureHasRetAddrStack (return address stack)
  142. def FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true",
  143. "Enable Reliability, Availability "
  144. "and Serviceability extensions">;
  145. // Fast computation of non-negative address offsets
  146. def FeatureFPAO : SubtargetFeature<"fpao", "HasFPAO", "true",
  147. "Enable fast computation of "
  148. "positive address offsets">;
  149. // Fast execution of AES crypto operations
  150. def FeatureFuseAES : SubtargetFeature<"fuse-aes", "HasFuseAES", "true",
  151. "CPU fuses AES crypto operations">;
  152. // Fast execution of bottom and top halves of literal generation
  153. def FeatureFuseLiterals : SubtargetFeature<"fuse-literals", "HasFuseLiterals", "true",
  154. "CPU fuses literal generation operations">;
  155. // The way of reading thread pointer
  156. def FeatureReadTp : SubtargetFeature<"read-tp-hard", "ReadTPHard", "true",
  157. "Reading thread pointer from register">;
  158. // Cyclone can zero VFP registers in 0 cycles.
  159. def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
  160. "Has zero-cycle zeroing instructions">;
  161. // Whether it is profitable to unpredicate certain instructions during if-conversion
  162. def FeatureProfUnpredicate : SubtargetFeature<"prof-unpr",
  163. "IsProfitableToUnpredicate", "true",
  164. "Is profitable to unpredicate">;
  165. // Some targets (e.g. Swift) have microcoded VGETLNi32.
  166. def FeatureSlowVGETLNi32 : SubtargetFeature<"slow-vgetlni32",
  167. "HasSlowVGETLNi32", "true",
  168. "Has slow VGETLNi32 - prefer VMOV">;
  169. // Some targets (e.g. Swift) have microcoded VDUP32.
  170. def FeatureSlowVDUP32 : SubtargetFeature<"slow-vdup32", "HasSlowVDUP32",
  171. "true",
  172. "Has slow VDUP32 - prefer VMOV">;
  173. // Some targets (e.g. Cortex-A9) prefer VMOVSR to VMOVDRR even when using NEON
  174. // for scalar FP, as this allows more effective execution domain optimization.
  175. def FeaturePreferVMOVSR : SubtargetFeature<"prefer-vmovsr", "PreferVMOVSR",
  176. "true", "Prefer VMOVSR">;
  177. // Swift has ISHST barriers compatible with Atomic Release semantics but weaker
  178. // than ISH
  179. def FeaturePrefISHSTBarrier : SubtargetFeature<"prefer-ishst", "PreferISHST",
  180. "true", "Prefer ISHST barriers">;
  181. // Some targets (e.g. Cortex-A9) have muxed AGU and NEON/FPU.
  182. def FeatureMuxedUnits : SubtargetFeature<"muxed-units", "HasMuxedUnits",
  183. "true",
  184. "Has muxed AGU and NEON/FPU">;
  185. // Whether VLDM/VSTM starting with odd register number need more microops
  186. // than single VLDRS
  187. def FeatureSlowOddRegister : SubtargetFeature<"slow-odd-reg", "SlowOddRegister",
  188. "true", "VLDM/VSTM starting "
  189. "with an odd register is slow">;
  190. // Some targets have a renaming dependency when loading into D subregisters.
  191. def FeatureSlowLoadDSubreg : SubtargetFeature<"slow-load-D-subreg",
  192. "SlowLoadDSubregister", "true",
  193. "Loading into D subregs is slow">;
  194. def FeatureUseWideStrideVFP : SubtargetFeature<"wide-stride-vfp",
  195. "UseWideStrideVFP", "true",
  196. "Use a wide stride when allocating VFP registers">;
  197. // Some targets (e.g. Cortex-A15) never want VMOVS to be widened to VMOVD.
  198. def FeatureDontWidenVMOVS : SubtargetFeature<"dont-widen-vmovs",
  199. "DontWidenVMOVS", "true",
  200. "Don't widen VMOVS to VMOVD">;
  201. // Some targets (e.g. Cortex-A15) prefer to avoid mixing operations on different
  202. // VFP register widths.
  203. def FeatureSplatVFPToNeon : SubtargetFeature<"splat-vfp-neon",
  204. "SplatVFPToNeon", "true",
  205. "Splat register from VFP to NEON",
  206. [FeatureDontWidenVMOVS]>;
  207. // Whether or not it is profitable to expand VFP/NEON MLA/MLS instructions.
  208. def FeatureExpandMLx : SubtargetFeature<"expand-fp-mlx",
  209. "ExpandMLx", "true",
  210. "Expand VFP/NEON MLA/MLS instructions">;
  211. // Some targets have special RAW hazards for VFP/NEON VMLA/VMLS.
  212. def FeatureHasVMLxHazards : SubtargetFeature<"vmlx-hazards", "HasVMLxHazards",
  213. "true", "Has VMLx hazards">;
  214. // Some targets (e.g. Cortex-A9) want to convert VMOVRS, VMOVSR and VMOVS from
  215. // VFP to NEON, as an execution domain optimization.
  216. def FeatureNEONForFPMovs : SubtargetFeature<"neon-fpmovs",
  217. "UseNEONForFPMovs", "true",
  218. "Convert VMOVSR, VMOVRS, "
  219. "VMOVS to NEON">;
  220. // Some processors benefit from using NEON instructions for scalar
  221. // single-precision FP operations. This affects instruction selection and should
  222. // only be enabled if the handling of denormals is not important.
  223. def FeatureNEONForFP : SubtargetFeature<"neonfp",
  224. "UseNEONForSinglePrecisionFP",
  225. "true",
  226. "Use NEON for single precision FP">;
  227. // On some processors, VLDn instructions that access unaligned data take one
  228. // extra cycle. Take that into account when computing operand latencies.
  229. def FeatureCheckVLDnAlign : SubtargetFeature<"vldn-align", "CheckVLDnAlign",
  230. "true",
  231. "Check for VLDn unaligned access">;
  232. // Some processors have a nonpipelined VFP coprocessor.
  233. def FeatureNonpipelinedVFP : SubtargetFeature<"nonpipelined-vfp",
  234. "NonpipelinedVFP", "true",
  235. "VFP instructions are not pipelined">;
  236. // Some processors have FP multiply-accumulate instructions that don't
  237. // play nicely with other VFP / NEON instructions, and it's generally better
  238. // to just not use them.
  239. def FeatureHasSlowFPVMLx : SubtargetFeature<"slowfpvmlx", "SlowFPVMLx", "true",
  240. "Disable VFP / NEON MAC instructions">;
  241. // VFPv4 added VFMA instructions that can similar be fast or slow.
  242. def FeatureHasSlowFPVFMx : SubtargetFeature<"slowfpvfmx", "SlowFPVFMx", "true",
  243. "Disable VFP / NEON FMA instructions">;
  244. // Cortex-A8 / A9 Advanced SIMD has multiplier accumulator forwarding.
  245. def FeatureVMLxForwarding : SubtargetFeature<"vmlx-forwarding",
  246. "HasVMLxForwarding", "true",
  247. "Has multiplier accumulator forwarding">;
  248. // Disable 32-bit to 16-bit narrowing for experimentation.
  249. def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
  250. "Prefer 32-bit Thumb instrs">;
  251. def FeaturePrefLoopAlign32 : SubtargetFeature<"loop-align", "PrefLoopLogAlignment","2",
  252. "Prefer 32-bit alignment for loops">;
  253. def FeatureMVEVectorCostFactor1 : SubtargetFeature<"mve1beat", "MVEVectorCostFactor", "1",
  254. "Model MVE instructions as a 1 beat per tick architecture">;
  255. def FeatureMVEVectorCostFactor2 : SubtargetFeature<"mve2beat", "MVEVectorCostFactor", "2",
  256. "Model MVE instructions as a 2 beats per tick architecture">;
  257. def FeatureMVEVectorCostFactor4 : SubtargetFeature<"mve4beat", "MVEVectorCostFactor", "4",
  258. "Model MVE instructions as a 4 beats per tick architecture">;
  259. /// Some instructions update CPSR partially, which can add false dependency for
  260. /// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is
  261. /// mapped to a separate physical register. Avoid partial CPSR update for these
  262. /// processors.
  263. def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr",
  264. "AvoidCPSRPartialUpdate", "true",
  265. "Avoid CPSR partial update for OOO execution">;
  266. /// Disable +1 predication cost for instructions updating CPSR.
  267. /// Enabled for Cortex-A57.
  268. def FeatureCheapPredicableCPSR : SubtargetFeature<"cheap-predicable-cpsr",
  269. "CheapPredicableCPSRDef",
  270. "true",
  271. "Disable +1 predication cost for instructions updating CPSR">;
  272. def FeatureAvoidMOVsShOp : SubtargetFeature<"avoid-movs-shop",
  273. "AvoidMOVsShifterOperand", "true",
  274. "Avoid movs instructions with "
  275. "shifter operand">;
  276. // Some processors perform return stack prediction. CodeGen should avoid issue
  277. // "normal" call instructions to callees which do not return.
  278. def FeatureHasRetAddrStack : SubtargetFeature<"ret-addr-stack",
  279. "HasRetAddrStack", "true",
  280. "Has return address stack">;
  281. // Some processors have no branch predictor, which changes the expected cost of
  282. // taking a branch which affects the choice of whether to use predicated
  283. // instructions.
  284. def FeatureHasNoBranchPredictor : SubtargetFeature<"no-branch-predictor",
  285. "HasBranchPredictor", "false",
  286. "Has no branch predictor">;
  287. /// DSP extension.
  288. def FeatureDSP : SubtargetFeature<"dsp", "HasDSP", "true",
  289. "Supports DSP instructions in "
  290. "ARM and/or Thumb2">;
  291. // Multiprocessing extension.
  292. def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true",
  293. "Supports Multiprocessing extension">;
  294. // Virtualization extension - requires HW divide (ARMv7-AR ARMARM - 4.4.8).
  295. def FeatureVirtualization : SubtargetFeature<"virtualization",
  296. "HasVirtualization", "true",
  297. "Supports Virtualization extension",
  298. [FeatureHWDivThumb, FeatureHWDivARM]>;
  299. // Special TRAP encoding for NaCl, which looks like a TRAP in Thumb too.
  300. // See ARMInstrInfo.td for details.
  301. def FeatureNaClTrap : SubtargetFeature<"nacl-trap", "UseNaClTrap", "true",
  302. "NaCl trap">;
  303. def FeatureStrictAlign : SubtargetFeature<"strict-align",
  304. "StrictAlign", "true",
  305. "Disallow all unaligned memory "
  306. "access">;
  307. def FeatureLongCalls : SubtargetFeature<"long-calls", "GenLongCalls", "true",
  308. "Generate calls via indirect call "
  309. "instructions">;
  310. def FeatureExecuteOnly : SubtargetFeature<"execute-only",
  311. "GenExecuteOnly", "true",
  312. "Enable the generation of "
  313. "execute only code.">;
  314. def FeatureReserveR9 : SubtargetFeature<"reserve-r9", "ReserveR9", "true",
  315. "Reserve R9, making it unavailable"
  316. " as GPR">;
  317. def FeatureNoMovt : SubtargetFeature<"no-movt", "NoMovt", "true",
  318. "Don't use movt/movw pairs for "
  319. "32-bit imms">;
  320. def FeatureNoNegativeImmediates
  321. : SubtargetFeature<"no-neg-immediates",
  322. "NegativeImmediates", "false",
  323. "Convert immediates and instructions "
  324. "to their negated or complemented "
  325. "equivalent when the immediate does "
  326. "not fit in the encoding.">;
  327. // Use the MachineScheduler for instruction scheduling for the subtarget.
  328. def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true",
  329. "Use the MachineScheduler">;
  330. def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler",
  331. "DisablePostRAScheduler", "true",
  332. "Don't schedule again after register allocation">;
  333. // Armv8.5-A extensions
  334. def FeatureSB : SubtargetFeature<"sb", "HasSB", "true",
  335. "Enable v8.5a Speculation Barrier" >;
  336. // Armv8.6-A extensions
  337. def FeatureBF16 : SubtargetFeature<"bf16", "HasBF16", "true",
  338. "Enable support for BFloat16 instructions", [FeatureNEON]>;
  339. def FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8",
  340. "true", "Enable Matrix Multiply Int8 Extension", [FeatureNEON]>;
  341. // Armv8.1-M extensions
  342. def FeatureLOB : SubtargetFeature<"lob", "HasLOB", "true",
  343. "Enable Low Overhead Branch "
  344. "extensions">;
  345. //===----------------------------------------------------------------------===//
  346. // ARM architecture class
  347. //
  348. // A-series ISA
  349. def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass",
  350. "Is application profile ('A' series)">;
  351. // R-series ISA
  352. def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass",
  353. "Is realtime profile ('R' series)">;
  354. // M-series ISA
  355. def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass",
  356. "Is microcontroller profile ('M' series)">;
  357. def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true",
  358. "Enable Thumb2 instructions">;
  359. def FeatureNoARM : SubtargetFeature<"noarm", "NoARM", "true",
  360. "Does not support ARM mode execution">;
  361. //===----------------------------------------------------------------------===//
  362. // ARM ISAa.
  363. //
  364. def HasV4TOps : SubtargetFeature<"v4t", "HasV4TOps", "true",
  365. "Support ARM v4T instructions">;
  366. def HasV5TOps : SubtargetFeature<"v5t", "HasV5TOps", "true",
  367. "Support ARM v5T instructions",
  368. [HasV4TOps]>;
  369. def HasV5TEOps : SubtargetFeature<"v5te", "HasV5TEOps", "true",
  370. "Support ARM v5TE, v5TEj, and "
  371. "v5TExp instructions",
  372. [HasV5TOps]>;
  373. def HasV6Ops : SubtargetFeature<"v6", "HasV6Ops", "true",
  374. "Support ARM v6 instructions",
  375. [HasV5TEOps]>;
  376. def HasV6MOps : SubtargetFeature<"v6m", "HasV6MOps", "true",
  377. "Support ARM v6M instructions",
  378. [HasV6Ops]>;
  379. def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true",
  380. "Support ARM v8M Baseline instructions",
  381. [HasV6MOps]>;
  382. def HasV6KOps : SubtargetFeature<"v6k", "HasV6KOps", "true",
  383. "Support ARM v6k instructions",
  384. [HasV6Ops]>;
  385. def HasV6T2Ops : SubtargetFeature<"v6t2", "HasV6T2Ops", "true",
  386. "Support ARM v6t2 instructions",
  387. [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>;
  388. def HasV7Ops : SubtargetFeature<"v7", "HasV7Ops", "true",
  389. "Support ARM v7 instructions",
  390. [HasV6T2Ops, FeaturePerfMon,
  391. FeatureV7Clrex]>;
  392. def HasV8MMainlineOps :
  393. SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true",
  394. "Support ARM v8M Mainline instructions",
  395. [HasV7Ops]>;
  396. def HasV8Ops : SubtargetFeature<"v8", "HasV8Ops", "true",
  397. "Support ARM v8 instructions",
  398. [HasV7Ops, FeatureAcquireRelease]>;
  399. def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true",
  400. "Support ARM v8.1a instructions",
  401. [HasV8Ops]>;
  402. def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true",
  403. "Support ARM v8.2a instructions",
  404. [HasV8_1aOps]>;
  405. def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true",
  406. "Support ARM v8.3a instructions",
  407. [HasV8_2aOps]>;
  408. def HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true",
  409. "Support ARM v8.4a instructions",
  410. [HasV8_3aOps, FeatureDotProd]>;
  411. def HasV8_5aOps : SubtargetFeature<"v8.5a", "HasV8_5aOps", "true",
  412. "Support ARM v8.5a instructions",
  413. [HasV8_4aOps, FeatureSB]>;
  414. def HasV8_6aOps : SubtargetFeature<"v8.6a", "HasV8_6aOps", "true",
  415. "Support ARM v8.6a instructions",
  416. [HasV8_5aOps, FeatureBF16,
  417. FeatureMatMulInt8]>;
  418. def HasV8_7aOps : SubtargetFeature<"v8.7a", "HasV8_7aOps", "true",
  419. "Support ARM v8.7a instructions",
  420. [HasV8_6aOps]>;
  421. def HasV8_1MMainlineOps : SubtargetFeature<
  422. "v8.1m.main", "HasV8_1MMainlineOps", "true",
  423. "Support ARM v8-1M Mainline instructions",
  424. [HasV8MMainlineOps]>;
  425. def HasMVEIntegerOps : SubtargetFeature<
  426. "mve", "HasMVEIntegerOps", "true",
  427. "Support M-Class Vector Extension with integer ops",
  428. [HasV8_1MMainlineOps, FeatureDSP, FeatureFPRegs16, FeatureFPRegs64]>;
  429. def HasMVEFloatOps : SubtargetFeature<
  430. "mve.fp", "HasMVEFloatOps", "true",
  431. "Support M-Class Vector Extension with integer and floating ops",
  432. [HasMVEIntegerOps, FeatureFPARMv8_D16_SP, FeatureFullFP16]>;
  433. def HasCDEOps : SubtargetFeature<"cde", "HasCDEOps", "true",
  434. "Support CDE instructions",
  435. [HasV8MMainlineOps]>;
  436. foreach i = {0-7} in
  437. def FeatureCoprocCDE#i : SubtargetFeature<"cdecp"#i,
  438. "CoprocCDE["#i#"]", "true",
  439. "Coprocessor "#i#" ISA is CDEv1",
  440. [HasCDEOps]>;
  441. //===----------------------------------------------------------------------===//
  442. // Control codegen mitigation against Straight Line Speculation vulnerability.
  443. //===----------------------------------------------------------------------===//
  444. def FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr",
  445. "HardenSlsRetBr", "true",
  446. "Harden against straight line speculation across RETurn and BranchRegister "
  447. "instructions">;
  448. def FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr",
  449. "HardenSlsBlr", "true",
  450. "Harden against straight line speculation across indirect calls">;
  451. //===----------------------------------------------------------------------===//
  452. // ARM Processor subtarget features.
  453. //
  454. def ProcA5 : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5",
  455. "Cortex-A5 ARM processors", []>;
  456. def ProcA7 : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7",
  457. "Cortex-A7 ARM processors", []>;
  458. def ProcA8 : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
  459. "Cortex-A8 ARM processors", []>;
  460. def ProcA9 : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
  461. "Cortex-A9 ARM processors", []>;
  462. def ProcA12 : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12",
  463. "Cortex-A12 ARM processors", []>;
  464. def ProcA15 : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15",
  465. "Cortex-A15 ARM processors", []>;
  466. def ProcA17 : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17",
  467. "Cortex-A17 ARM processors", []>;
  468. def ProcA32 : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32",
  469. "Cortex-A32 ARM processors", []>;
  470. def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35",
  471. "Cortex-A35 ARM processors", []>;
  472. def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
  473. "Cortex-A53 ARM processors", []>;
  474. def ProcA55 : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55",
  475. "Cortex-A55 ARM processors", []>;
  476. def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
  477. "Cortex-A57 ARM processors", []>;
  478. def ProcA72 : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72",
  479. "Cortex-A72 ARM processors", []>;
  480. def ProcA73 : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73",
  481. "Cortex-A73 ARM processors", []>;
  482. def ProcA75 : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75",
  483. "Cortex-A75 ARM processors", []>;
  484. def ProcA76 : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76",
  485. "Cortex-A76 ARM processors", []>;
  486. def ProcA77 : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77",
  487. "Cortex-A77 ARM processors", []>;
  488. def ProcA78 : SubtargetFeature<"cortex-a78", "ARMProcFamily", "CortexA78",
  489. "Cortex-A78 ARM processors", []>;
  490. def ProcA78C : SubtargetFeature<"a78c", "ARMProcFamily", "CortexA78C",
  491. "Cortex-A78C ARM processors", []>;
  492. def ProcX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1",
  493. "Cortex-X1 ARM processors", []>;
  494. def ProcV1 : SubtargetFeature<"neoverse-v1", "ARMProcFamily",
  495. "NeoverseV1", "Neoverse-V1 ARM processors", []>;
  496. def ProcKrait : SubtargetFeature<"krait", "ARMProcFamily", "Krait",
  497. "Qualcomm Krait processors", []>;
  498. def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo",
  499. "Qualcomm Kryo processors", []>;
  500. def ProcSwift : SubtargetFeature<"swift", "ARMProcFamily", "Swift",
  501. "Swift ARM processors", []>;
  502. def ProcExynos : SubtargetFeature<"exynos", "ARMProcFamily", "Exynos",
  503. "Samsung Exynos processors",
  504. [FeatureZCZeroing,
  505. FeatureUseWideStrideVFP,
  506. FeatureSplatVFPToNeon,
  507. FeatureSlowVGETLNi32,
  508. FeatureSlowVDUP32,
  509. FeatureSlowFPBrcc,
  510. FeatureProfUnpredicate,
  511. FeatureHWDivThumb,
  512. FeatureHWDivARM,
  513. FeatureHasSlowFPVMLx,
  514. FeatureHasSlowFPVFMx,
  515. FeatureHasRetAddrStack,
  516. FeatureFuseLiterals,
  517. FeatureFuseAES,
  518. FeatureExpandMLx,
  519. FeatureCrypto,
  520. FeatureCRC]>;
  521. def ProcR4 : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4",
  522. "Cortex-R4 ARM processors", []>;
  523. def ProcR5 : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5",
  524. "Cortex-R5 ARM processors", []>;
  525. def ProcR7 : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7",
  526. "Cortex-R7 ARM processors", []>;
  527. def ProcR52 : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52",
  528. "Cortex-R52 ARM processors", []>;
  529. def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3",
  530. "Cortex-M3 ARM processors", []>;
  531. def ProcM7 : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7",
  532. "Cortex-M7 ARM processors", []>;
  533. //===----------------------------------------------------------------------===//
  534. // ARM Helper classes.
  535. //
  536. class Architecture<string fname, string aname, list<SubtargetFeature> features>
  537. : SubtargetFeature<fname, "ARMArch", aname,
  538. !strconcat(aname, " architecture"), features>;
  539. class ProcNoItin<string Name, list<SubtargetFeature> Features>
  540. : Processor<Name, NoItineraries, Features>;
  541. //===----------------------------------------------------------------------===//
  542. // ARM architectures
  543. //
  544. def ARMv2 : Architecture<"armv2", "ARMv2", []>;
  545. def ARMv2a : Architecture<"armv2a", "ARMv2a", []>;
  546. def ARMv3 : Architecture<"armv3", "ARMv3", []>;
  547. def ARMv3m : Architecture<"armv3m", "ARMv3m", []>;
  548. def ARMv4 : Architecture<"armv4", "ARMv4", []>;
  549. def ARMv4t : Architecture<"armv4t", "ARMv4t", [HasV4TOps]>;
  550. def ARMv5t : Architecture<"armv5t", "ARMv5t", [HasV5TOps]>;
  551. def ARMv5te : Architecture<"armv5te", "ARMv5te", [HasV5TEOps]>;
  552. def ARMv5tej : Architecture<"armv5tej", "ARMv5tej", [HasV5TEOps]>;
  553. def ARMv6 : Architecture<"armv6", "ARMv6", [HasV6Ops,
  554. FeatureDSP]>;
  555. def ARMv6t2 : Architecture<"armv6t2", "ARMv6t2", [HasV6T2Ops,
  556. FeatureDSP]>;
  557. def ARMv6k : Architecture<"armv6k", "ARMv6k", [HasV6KOps]>;
  558. def ARMv6kz : Architecture<"armv6kz", "ARMv6kz", [HasV6KOps,
  559. FeatureTrustZone]>;
  560. def ARMv6m : Architecture<"armv6-m", "ARMv6m", [HasV6MOps,
  561. FeatureNoARM,
  562. ModeThumb,
  563. FeatureDB,
  564. FeatureMClass,
  565. FeatureStrictAlign]>;
  566. def ARMv6sm : Architecture<"armv6s-m", "ARMv6sm", [HasV6MOps,
  567. FeatureNoARM,
  568. ModeThumb,
  569. FeatureDB,
  570. FeatureMClass,
  571. FeatureStrictAlign]>;
  572. def ARMv7a : Architecture<"armv7-a", "ARMv7a", [HasV7Ops,
  573. FeatureNEON,
  574. FeatureDB,
  575. FeatureDSP,
  576. FeatureAClass]>;
  577. def ARMv7ve : Architecture<"armv7ve", "ARMv7ve", [HasV7Ops,
  578. FeatureNEON,
  579. FeatureDB,
  580. FeatureDSP,
  581. FeatureTrustZone,
  582. FeatureMP,
  583. FeatureVirtualization,
  584. FeatureAClass]>;
  585. def ARMv7r : Architecture<"armv7-r", "ARMv7r", [HasV7Ops,
  586. FeatureDB,
  587. FeatureDSP,
  588. FeatureHWDivThumb,
  589. FeatureRClass]>;
  590. def ARMv7m : Architecture<"armv7-m", "ARMv7m", [HasV7Ops,
  591. FeatureThumb2,
  592. FeatureNoARM,
  593. ModeThumb,
  594. FeatureDB,
  595. FeatureHWDivThumb,
  596. FeatureMClass]>;
  597. def ARMv7em : Architecture<"armv7e-m", "ARMv7em", [HasV7Ops,
  598. FeatureThumb2,
  599. FeatureNoARM,
  600. ModeThumb,
  601. FeatureDB,
  602. FeatureHWDivThumb,
  603. FeatureMClass,
  604. FeatureDSP]>;
  605. def ARMv8a : Architecture<"armv8-a", "ARMv8a", [HasV8Ops,
  606. FeatureAClass,
  607. FeatureDB,
  608. FeatureFPARMv8,
  609. FeatureNEON,
  610. FeatureDSP,
  611. FeatureTrustZone,
  612. FeatureMP,
  613. FeatureVirtualization,
  614. FeatureCrypto,
  615. FeatureCRC]>;
  616. def ARMv81a : Architecture<"armv8.1-a", "ARMv81a", [HasV8_1aOps,
  617. FeatureAClass,
  618. FeatureDB,
  619. FeatureFPARMv8,
  620. FeatureNEON,
  621. FeatureDSP,
  622. FeatureTrustZone,
  623. FeatureMP,
  624. FeatureVirtualization,
  625. FeatureCrypto,
  626. FeatureCRC]>;
  627. def ARMv82a : Architecture<"armv8.2-a", "ARMv82a", [HasV8_2aOps,
  628. FeatureAClass,
  629. FeatureDB,
  630. FeatureFPARMv8,
  631. FeatureNEON,
  632. FeatureDSP,
  633. FeatureTrustZone,
  634. FeatureMP,
  635. FeatureVirtualization,
  636. FeatureCrypto,
  637. FeatureCRC,
  638. FeatureRAS]>;
  639. def ARMv83a : Architecture<"armv8.3-a", "ARMv83a", [HasV8_3aOps,
  640. FeatureAClass,
  641. FeatureDB,
  642. FeatureFPARMv8,
  643. FeatureNEON,
  644. FeatureDSP,
  645. FeatureTrustZone,
  646. FeatureMP,
  647. FeatureVirtualization,
  648. FeatureCrypto,
  649. FeatureCRC,
  650. FeatureRAS]>;
  651. def ARMv84a : Architecture<"armv8.4-a", "ARMv84a", [HasV8_4aOps,
  652. FeatureAClass,
  653. FeatureDB,
  654. FeatureFPARMv8,
  655. FeatureNEON,
  656. FeatureDSP,
  657. FeatureTrustZone,
  658. FeatureMP,
  659. FeatureVirtualization,
  660. FeatureCrypto,
  661. FeatureCRC,
  662. FeatureRAS,
  663. FeatureDotProd]>;
  664. def ARMv85a : Architecture<"armv8.5-a", "ARMv85a", [HasV8_5aOps,
  665. FeatureAClass,
  666. FeatureDB,
  667. FeatureFPARMv8,
  668. FeatureNEON,
  669. FeatureDSP,
  670. FeatureTrustZone,
  671. FeatureMP,
  672. FeatureVirtualization,
  673. FeatureCrypto,
  674. FeatureCRC,
  675. FeatureRAS,
  676. FeatureDotProd]>;
  677. def ARMv86a : Architecture<"armv8.6-a", "ARMv86a", [HasV8_6aOps,
  678. FeatureAClass,
  679. FeatureDB,
  680. FeatureFPARMv8,
  681. FeatureNEON,
  682. FeatureDSP,
  683. FeatureTrustZone,
  684. FeatureMP,
  685. FeatureVirtualization,
  686. FeatureCrypto,
  687. FeatureCRC,
  688. FeatureRAS,
  689. FeatureDotProd]>;
  690. def ARMv87a : Architecture<"armv8.7-a", "ARMv86a", [HasV8_7aOps,
  691. FeatureAClass,
  692. FeatureDB,
  693. FeatureFPARMv8,
  694. FeatureNEON,
  695. FeatureDSP,
  696. FeatureTrustZone,
  697. FeatureMP,
  698. FeatureVirtualization,
  699. FeatureCrypto,
  700. FeatureCRC,
  701. FeatureRAS,
  702. FeatureDotProd]>;
  703. def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops,
  704. FeatureRClass,
  705. FeatureDB,
  706. FeatureDFB,
  707. FeatureDSP,
  708. FeatureCRC,
  709. FeatureMP,
  710. FeatureVirtualization,
  711. FeatureFPARMv8,
  712. FeatureNEON]>;
  713. def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline",
  714. [HasV8MBaselineOps,
  715. FeatureNoARM,
  716. ModeThumb,
  717. FeatureDB,
  718. FeatureHWDivThumb,
  719. FeatureV7Clrex,
  720. Feature8MSecExt,
  721. FeatureAcquireRelease,
  722. FeatureMClass,
  723. FeatureStrictAlign]>;
  724. def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline",
  725. [HasV8MMainlineOps,
  726. FeatureNoARM,
  727. ModeThumb,
  728. FeatureDB,
  729. FeatureHWDivThumb,
  730. Feature8MSecExt,
  731. FeatureAcquireRelease,
  732. FeatureMClass]>;
  733. def ARMv81mMainline : Architecture<"armv8.1-m.main", "ARMv81mMainline",
  734. [HasV8_1MMainlineOps,
  735. FeatureNoARM,
  736. ModeThumb,
  737. FeatureDB,
  738. FeatureHWDivThumb,
  739. Feature8MSecExt,
  740. FeatureAcquireRelease,
  741. FeatureMClass,
  742. FeatureRAS,
  743. FeatureLOB]>;
  744. // Aliases
  745. def IWMMXT : Architecture<"iwmmxt", "ARMv5te", [ARMv5te]>;
  746. def IWMMXT2 : Architecture<"iwmmxt2", "ARMv5te", [ARMv5te]>;
  747. def XScale : Architecture<"xscale", "ARMv5te", [ARMv5te]>;
  748. def ARMv6j : Architecture<"armv6j", "ARMv7a", [ARMv6]>;
  749. def ARMv7k : Architecture<"armv7k", "ARMv7a", [ARMv7a]>;
  750. def ARMv7s : Architecture<"armv7s", "ARMv7a", [ARMv7a]>;
  751. //===----------------------------------------------------------------------===//
  752. // Register File Description
  753. //===----------------------------------------------------------------------===//
  754. include "ARMRegisterInfo.td"
  755. include "ARMRegisterBanks.td"
  756. include "ARMCallingConv.td"
  757. //===----------------------------------------------------------------------===//
  758. // ARM schedules.
  759. //===----------------------------------------------------------------------===//
  760. //
  761. include "ARMPredicates.td"
  762. include "ARMSchedule.td"
  763. //===----------------------------------------------------------------------===//
  764. // Instruction Descriptions
  765. //===----------------------------------------------------------------------===//
  766. include "ARMInstrInfo.td"
  767. def ARMInstrInfo : InstrInfo;
  768. //===----------------------------------------------------------------------===//
  769. // ARM schedules
  770. //
  771. include "ARMScheduleV6.td"
  772. include "ARMScheduleA8.td"
  773. include "ARMScheduleA9.td"
  774. include "ARMScheduleSwift.td"
  775. include "ARMScheduleR52.td"
  776. include "ARMScheduleA57.td"
  777. include "ARMScheduleM4.td"
  778. include "ARMScheduleM7.td"
  779. //===----------------------------------------------------------------------===//
  780. // ARM processors
  781. //
  782. // Dummy CPU, used to target architectures
  783. def : ProcessorModel<"generic", CortexA8Model, []>;
  784. // FIXME: Several processors below are not using their own scheduler
  785. // model, but one of similar/previous processor. These should be fixed.
  786. def : ProcNoItin<"arm8", [ARMv4]>;
  787. def : ProcNoItin<"arm810", [ARMv4]>;
  788. def : ProcNoItin<"strongarm", [ARMv4]>;
  789. def : ProcNoItin<"strongarm110", [ARMv4]>;
  790. def : ProcNoItin<"strongarm1100", [ARMv4]>;
  791. def : ProcNoItin<"strongarm1110", [ARMv4]>;
  792. def : ProcNoItin<"arm7tdmi", [ARMv4t]>;
  793. def : ProcNoItin<"arm7tdmi-s", [ARMv4t]>;
  794. def : ProcNoItin<"arm710t", [ARMv4t]>;
  795. def : ProcNoItin<"arm720t", [ARMv4t]>;
  796. def : ProcNoItin<"arm9", [ARMv4t]>;
  797. def : ProcNoItin<"arm9tdmi", [ARMv4t]>;
  798. def : ProcNoItin<"arm920", [ARMv4t]>;
  799. def : ProcNoItin<"arm920t", [ARMv4t]>;
  800. def : ProcNoItin<"arm922t", [ARMv4t]>;
  801. def : ProcNoItin<"arm940t", [ARMv4t]>;
  802. def : ProcNoItin<"ep9312", [ARMv4t]>;
  803. def : ProcNoItin<"arm10tdmi", [ARMv5t]>;
  804. def : ProcNoItin<"arm1020t", [ARMv5t]>;
  805. def : ProcNoItin<"arm9e", [ARMv5te]>;
  806. def : ProcNoItin<"arm926ej-s", [ARMv5te]>;
  807. def : ProcNoItin<"arm946e-s", [ARMv5te]>;
  808. def : ProcNoItin<"arm966e-s", [ARMv5te]>;
  809. def : ProcNoItin<"arm968e-s", [ARMv5te]>;
  810. def : ProcNoItin<"arm10e", [ARMv5te]>;
  811. def : ProcNoItin<"arm1020e", [ARMv5te]>;
  812. def : ProcNoItin<"arm1022e", [ARMv5te]>;
  813. def : ProcNoItin<"xscale", [ARMv5te]>;
  814. def : ProcNoItin<"iwmmxt", [ARMv5te]>;
  815. def : Processor<"arm1136j-s", ARMV6Itineraries, [ARMv6]>;
  816. def : Processor<"arm1136jf-s", ARMV6Itineraries, [ARMv6,
  817. FeatureVFP2,
  818. FeatureHasSlowFPVMLx]>;
  819. def : Processor<"cortex-m0", ARMV6Itineraries, [ARMv6m]>;
  820. def : Processor<"cortex-m0plus", ARMV6Itineraries, [ARMv6m]>;
  821. def : Processor<"cortex-m1", ARMV6Itineraries, [ARMv6m]>;
  822. def : Processor<"sc000", ARMV6Itineraries, [ARMv6m]>;
  823. def : Processor<"arm1176j-s", ARMV6Itineraries, [ARMv6kz]>;
  824. def : Processor<"arm1176jz-s", ARMV6Itineraries, [ARMv6kz]>;
  825. def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ARMv6kz,
  826. FeatureVFP2,
  827. FeatureHasSlowFPVMLx]>;
  828. def : Processor<"mpcorenovfp", ARMV6Itineraries, [ARMv6k]>;
  829. def : Processor<"mpcore", ARMV6Itineraries, [ARMv6k,
  830. FeatureVFP2,
  831. FeatureHasSlowFPVMLx]>;
  832. def : Processor<"arm1156t2-s", ARMV6Itineraries, [ARMv6t2]>;
  833. def : Processor<"arm1156t2f-s", ARMV6Itineraries, [ARMv6t2,
  834. FeatureVFP2,
  835. FeatureHasSlowFPVMLx]>;
  836. def : ProcessorModel<"cortex-a5", CortexA8Model, [ARMv7a, ProcA5,
  837. FeatureHasRetAddrStack,
  838. FeatureTrustZone,
  839. FeatureSlowFPBrcc,
  840. FeatureHasSlowFPVMLx,
  841. FeatureHasSlowFPVFMx,
  842. FeatureVMLxForwarding,
  843. FeatureMP,
  844. FeatureVFP4]>;
  845. def : ProcessorModel<"cortex-a7", CortexA8Model, [ARMv7a, ProcA7,
  846. FeatureHasRetAddrStack,
  847. FeatureTrustZone,
  848. FeatureSlowFPBrcc,
  849. FeatureHasVMLxHazards,
  850. FeatureHasSlowFPVMLx,
  851. FeatureHasSlowFPVFMx,
  852. FeatureVMLxForwarding,
  853. FeatureMP,
  854. FeatureVFP4,
  855. FeatureVirtualization]>;
  856. def : ProcessorModel<"cortex-a8", CortexA8Model, [ARMv7a, ProcA8,
  857. FeatureHasRetAddrStack,
  858. FeatureNonpipelinedVFP,
  859. FeatureTrustZone,
  860. FeatureSlowFPBrcc,
  861. FeatureHasVMLxHazards,
  862. FeatureHasSlowFPVMLx,
  863. FeatureHasSlowFPVFMx,
  864. FeatureVMLxForwarding]>;
  865. def : ProcessorModel<"cortex-a9", CortexA9Model, [ARMv7a, ProcA9,
  866. FeatureHasRetAddrStack,
  867. FeatureTrustZone,
  868. FeatureHasVMLxHazards,
  869. FeatureVMLxForwarding,
  870. FeatureFP16,
  871. FeatureAvoidPartialCPSR,
  872. FeatureExpandMLx,
  873. FeaturePreferVMOVSR,
  874. FeatureMuxedUnits,
  875. FeatureNEONForFPMovs,
  876. FeatureCheckVLDnAlign,
  877. FeatureMP]>;
  878. def : ProcessorModel<"cortex-a12", CortexA9Model, [ARMv7a, ProcA12,
  879. FeatureHasRetAddrStack,
  880. FeatureTrustZone,
  881. FeatureVMLxForwarding,
  882. FeatureVFP4,
  883. FeatureAvoidPartialCPSR,
  884. FeatureVirtualization,
  885. FeatureMP]>;
  886. def : ProcessorModel<"cortex-a15", CortexA9Model, [ARMv7a, ProcA15,
  887. FeatureDontWidenVMOVS,
  888. FeatureSplatVFPToNeon,
  889. FeatureHasRetAddrStack,
  890. FeatureMuxedUnits,
  891. FeatureTrustZone,
  892. FeatureVFP4,
  893. FeatureMP,
  894. FeatureCheckVLDnAlign,
  895. FeatureAvoidPartialCPSR,
  896. FeatureVirtualization]>;
  897. def : ProcessorModel<"cortex-a17", CortexA9Model, [ARMv7a, ProcA17,
  898. FeatureHasRetAddrStack,
  899. FeatureTrustZone,
  900. FeatureMP,
  901. FeatureVMLxForwarding,
  902. FeatureVFP4,
  903. FeatureAvoidPartialCPSR,
  904. FeatureVirtualization]>;
  905. // FIXME: krait has currently the same features as A9 plus VFP4 and HWDiv
  906. def : ProcessorModel<"krait", CortexA9Model, [ARMv7a, ProcKrait,
  907. FeatureHasRetAddrStack,
  908. FeatureMuxedUnits,
  909. FeatureCheckVLDnAlign,
  910. FeatureVMLxForwarding,
  911. FeatureFP16,
  912. FeatureAvoidPartialCPSR,
  913. FeatureVFP4,
  914. FeatureHWDivThumb,
  915. FeatureHWDivARM]>;
  916. def : ProcessorModel<"swift", SwiftModel, [ARMv7a, ProcSwift,
  917. FeatureHasRetAddrStack,
  918. FeatureNEONForFP,
  919. FeatureVFP4,
  920. FeatureUseWideStrideVFP,
  921. FeatureMP,
  922. FeatureHWDivThumb,
  923. FeatureHWDivARM,
  924. FeatureAvoidPartialCPSR,
  925. FeatureAvoidMOVsShOp,
  926. FeatureHasSlowFPVMLx,
  927. FeatureHasSlowFPVFMx,
  928. FeatureHasVMLxHazards,
  929. FeatureProfUnpredicate,
  930. FeaturePrefISHSTBarrier,
  931. FeatureSlowOddRegister,
  932. FeatureSlowLoadDSubreg,
  933. FeatureSlowVGETLNi32,
  934. FeatureSlowVDUP32,
  935. FeatureUseMISched,
  936. FeatureNoPostRASched]>;
  937. def : ProcessorModel<"cortex-r4", CortexA8Model, [ARMv7r, ProcR4,
  938. FeatureHasRetAddrStack,
  939. FeatureAvoidPartialCPSR]>;
  940. def : ProcessorModel<"cortex-r4f", CortexA8Model, [ARMv7r, ProcR4,
  941. FeatureHasRetAddrStack,
  942. FeatureSlowFPBrcc,
  943. FeatureHasSlowFPVMLx,
  944. FeatureHasSlowFPVFMx,
  945. FeatureVFP3_D16,
  946. FeatureAvoidPartialCPSR]>;
  947. def : ProcessorModel<"cortex-r5", CortexA8Model, [ARMv7r, ProcR5,
  948. FeatureHasRetAddrStack,
  949. FeatureVFP3_D16,
  950. FeatureSlowFPBrcc,
  951. FeatureHWDivARM,
  952. FeatureHasSlowFPVMLx,
  953. FeatureHasSlowFPVFMx,
  954. FeatureAvoidPartialCPSR]>;
  955. def : ProcessorModel<"cortex-r7", CortexA8Model, [ARMv7r, ProcR7,
  956. FeatureHasRetAddrStack,
  957. FeatureVFP3_D16,
  958. FeatureFP16,
  959. FeatureMP,
  960. FeatureSlowFPBrcc,
  961. FeatureHWDivARM,
  962. FeatureHasSlowFPVMLx,
  963. FeatureHasSlowFPVFMx,
  964. FeatureAvoidPartialCPSR]>;
  965. def : ProcessorModel<"cortex-r8", CortexA8Model, [ARMv7r,
  966. FeatureHasRetAddrStack,
  967. FeatureVFP3_D16,
  968. FeatureFP16,
  969. FeatureMP,
  970. FeatureSlowFPBrcc,
  971. FeatureHWDivARM,
  972. FeatureHasSlowFPVMLx,
  973. FeatureHasSlowFPVFMx,
  974. FeatureAvoidPartialCPSR]>;
  975. def : ProcessorModel<"cortex-m3", CortexM4Model, [ARMv7m,
  976. ProcM3,
  977. FeaturePrefLoopAlign32,
  978. FeatureUseMISched,
  979. FeatureHasNoBranchPredictor]>;
  980. def : ProcessorModel<"sc300", CortexM4Model, [ARMv7m,
  981. ProcM3,
  982. FeatureUseMISched,
  983. FeatureHasNoBranchPredictor]>;
  984. def : ProcessorModel<"cortex-m4", CortexM4Model, [ARMv7em,
  985. FeatureVFP4_D16_SP,
  986. FeaturePrefLoopAlign32,
  987. FeatureHasSlowFPVMLx,
  988. FeatureHasSlowFPVFMx,
  989. FeatureUseMISched,
  990. FeatureHasNoBranchPredictor]>;
  991. def : ProcessorModel<"cortex-m7", CortexM7Model, [ARMv7em,
  992. ProcM7,
  993. FeatureFPARMv8_D16,
  994. FeatureUseMISched]>;
  995. def : ProcNoItin<"cortex-m23", [ARMv8mBaseline,
  996. FeatureNoMovt]>;
  997. def : ProcessorModel<"cortex-m33", CortexM4Model, [ARMv8mMainline,
  998. FeatureDSP,
  999. FeatureFPARMv8_D16_SP,
  1000. FeaturePrefLoopAlign32,
  1001. FeatureHasSlowFPVMLx,
  1002. FeatureHasSlowFPVFMx,
  1003. FeatureUseMISched,
  1004. FeatureHasNoBranchPredictor]>;
  1005. def : ProcessorModel<"cortex-m35p", CortexM4Model, [ARMv8mMainline,
  1006. FeatureDSP,
  1007. FeatureFPARMv8_D16_SP,
  1008. FeaturePrefLoopAlign32,
  1009. FeatureHasSlowFPVMLx,
  1010. FeatureHasSlowFPVFMx,
  1011. FeatureUseMISched,
  1012. FeatureHasNoBranchPredictor]>;
  1013. def : ProcessorModel<"cortex-m55", CortexM4Model, [ARMv81mMainline,
  1014. FeatureDSP,
  1015. FeatureFPARMv8_D16,
  1016. FeatureUseMISched,
  1017. FeatureHasNoBranchPredictor,
  1018. FeaturePrefLoopAlign32,
  1019. FeatureHasSlowFPVMLx,
  1020. HasMVEFloatOps]>;
  1021. def : ProcNoItin<"cortex-a32", [ARMv8a,
  1022. FeatureHWDivThumb,
  1023. FeatureHWDivARM,
  1024. FeatureCrypto,
  1025. FeatureCRC]>;
  1026. def : ProcNoItin<"cortex-a35", [ARMv8a, ProcA35,
  1027. FeatureHWDivThumb,
  1028. FeatureHWDivARM,
  1029. FeatureCrypto,
  1030. FeatureCRC]>;
  1031. def : ProcNoItin<"cortex-a53", [ARMv8a, ProcA53,
  1032. FeatureHWDivThumb,
  1033. FeatureHWDivARM,
  1034. FeatureCrypto,
  1035. FeatureCRC,
  1036. FeatureFPAO]>;
  1037. def : ProcNoItin<"cortex-a55", [ARMv82a, ProcA55,
  1038. FeatureHWDivThumb,
  1039. FeatureHWDivARM,
  1040. FeatureDotProd]>;
  1041. def : ProcessorModel<"cortex-a57", CortexA57Model, [ARMv8a, ProcA57,
  1042. FeatureHWDivThumb,
  1043. FeatureHWDivARM,
  1044. FeatureCrypto,
  1045. FeatureCRC,
  1046. FeatureFPAO,
  1047. FeatureAvoidPartialCPSR,
  1048. FeatureCheapPredicableCPSR]>;
  1049. def : ProcessorModel<"cortex-a72", CortexA57Model, [ARMv8a, ProcA72,
  1050. FeatureHWDivThumb,
  1051. FeatureHWDivARM,
  1052. FeatureCrypto,
  1053. FeatureCRC]>;
  1054. def : ProcNoItin<"cortex-a73", [ARMv8a, ProcA73,
  1055. FeatureHWDivThumb,
  1056. FeatureHWDivARM,
  1057. FeatureCrypto,
  1058. FeatureCRC]>;
  1059. def : ProcNoItin<"cortex-a75", [ARMv82a, ProcA75,
  1060. FeatureHWDivThumb,
  1061. FeatureHWDivARM,
  1062. FeatureDotProd]>;
  1063. def : ProcNoItin<"cortex-a76", [ARMv82a, ProcA76,
  1064. FeatureHWDivThumb,
  1065. FeatureHWDivARM,
  1066. FeatureCrypto,
  1067. FeatureCRC,
  1068. FeatureFullFP16,
  1069. FeatureDotProd]>;
  1070. def : ProcNoItin<"cortex-a76ae", [ARMv82a, ProcA76,
  1071. FeatureHWDivThumb,
  1072. FeatureHWDivARM,
  1073. FeatureCrypto,
  1074. FeatureCRC,
  1075. FeatureFullFP16,
  1076. FeatureDotProd]>;
  1077. def : ProcNoItin<"cortex-a77", [ARMv82a, ProcA77,
  1078. FeatureHWDivThumb,
  1079. FeatureHWDivARM,
  1080. FeatureCrypto,
  1081. FeatureCRC,
  1082. FeatureFullFP16,
  1083. FeatureDotProd]>;
  1084. def : ProcNoItin<"cortex-a78", [ARMv82a, ProcA78,
  1085. FeatureHWDivThumb,
  1086. FeatureHWDivARM,
  1087. FeatureCrypto,
  1088. FeatureCRC,
  1089. FeatureFullFP16,
  1090. FeatureDotProd]>;
  1091. def : ProcNoItin<"cortex-a78c", [ARMv82a, ProcA78C,
  1092. FeatureHWDivThumb,
  1093. FeatureHWDivARM,
  1094. FeatureCrypto,
  1095. FeatureCRC,
  1096. FeatureDotProd,
  1097. FeatureFullFP16]>;
  1098. def : ProcNoItin<"cortex-x1", [ARMv82a, ProcX1,
  1099. FeatureHWDivThumb,
  1100. FeatureHWDivARM,
  1101. FeatureCrypto,
  1102. FeatureCRC,
  1103. FeatureFullFP16,
  1104. FeatureDotProd]>;
  1105. def : ProcNoItin<"neoverse-v1", [ARMv84a,
  1106. FeatureHWDivThumb,
  1107. FeatureHWDivARM,
  1108. FeatureCrypto,
  1109. FeatureCRC,
  1110. FeatureFullFP16,
  1111. FeatureBF16,
  1112. FeatureMatMulInt8]>;
  1113. def : ProcNoItin<"neoverse-n1", [ARMv82a,
  1114. FeatureHWDivThumb,
  1115. FeatureHWDivARM,
  1116. FeatureCrypto,
  1117. FeatureCRC,
  1118. FeatureDotProd]>;
  1119. def : ProcNoItin<"neoverse-n2", [ARMv85a,
  1120. FeatureBF16,
  1121. FeatureMatMulInt8,
  1122. FeaturePerfMon]>;
  1123. def : ProcessorModel<"cyclone", SwiftModel, [ARMv8a, ProcSwift,
  1124. FeatureHasRetAddrStack,
  1125. FeatureNEONForFP,
  1126. FeatureVFP4,
  1127. FeatureMP,
  1128. FeatureHWDivThumb,
  1129. FeatureHWDivARM,
  1130. FeatureAvoidPartialCPSR,
  1131. FeatureAvoidMOVsShOp,
  1132. FeatureHasSlowFPVMLx,
  1133. FeatureHasSlowFPVFMx,
  1134. FeatureCrypto,
  1135. FeatureUseMISched,
  1136. FeatureZCZeroing,
  1137. FeatureNoPostRASched]>;
  1138. def : ProcNoItin<"exynos-m3", [ARMv8a, ProcExynos]>;
  1139. def : ProcNoItin<"exynos-m4", [ARMv82a, ProcExynos,
  1140. FeatureFullFP16,
  1141. FeatureDotProd]>;
  1142. def : ProcNoItin<"exynos-m5", [ARMv82a, ProcExynos,
  1143. FeatureFullFP16,
  1144. FeatureDotProd]>;
  1145. def : ProcNoItin<"kryo", [ARMv8a, ProcKryo,
  1146. FeatureHWDivThumb,
  1147. FeatureHWDivARM,
  1148. FeatureCrypto,
  1149. FeatureCRC]>;
  1150. def : ProcessorModel<"cortex-r52", CortexR52Model, [ARMv8r, ProcR52,
  1151. FeatureUseMISched,
  1152. FeatureFPAO]>;
  1153. //===----------------------------------------------------------------------===//
  1154. // Declare the target which we are implementing
  1155. //===----------------------------------------------------------------------===//
  1156. def ARMAsmWriter : AsmWriter {
  1157. string AsmWriterClassName = "InstPrinter";
  1158. int PassSubtarget = 1;
  1159. int Variant = 0;
  1160. bit isMCAsmWriter = 1;
  1161. }
  1162. def ARMAsmParser : AsmParser {
  1163. bit ReportMultipleNearMisses = 1;
  1164. }
  1165. def ARMAsmParserVariant : AsmParserVariant {
  1166. int Variant = 0;
  1167. string Name = "ARM";
  1168. string BreakCharacters = ".";
  1169. }
  1170. def ARM : Target {
  1171. // Pull in Instruction Info.
  1172. let InstructionSet = ARMInstrInfo;
  1173. let AssemblyWriters = [ARMAsmWriter];
  1174. let AssemblyParsers = [ARMAsmParser];
  1175. let AssemblyParserVariants = [ARMAsmParserVariant];
  1176. let AllowRegisterRenaming = 1;
  1177. }