ARMScheduleR52.td 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. //==- ARMScheduleR52.td - Cortex-R52 Scheduling Definitions -*- 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. // This file defines the SchedRead/Write data for the ARM Cortex-R52 processor.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // ===---------------------------------------------------------------------===//
  13. // The Cortex-R52 is an in-order pipelined superscalar microprocessor with
  14. // a 8 stage pipeline. It can issue maximum two instructions in each cycle.
  15. // There are two ALUs, one LDST, one MUL and a non-pipelined integer DIV.
  16. // A number of forwarding paths enable results of computations to be input
  17. // to subsequent operations before they are written to registers.
  18. // This scheduler is a MachineScheduler. See TargetSchedule.td for details.
  19. def CortexR52Model : SchedMachineModel {
  20. let MicroOpBufferSize = 0; // R52 is in-order processor
  21. let IssueWidth = 2; // 2 micro-ops dispatched per cycle
  22. let LoadLatency = 1; // Optimistic, assuming no misses
  23. let MispredictPenalty = 8; // A branch direction mispredict, including PFU
  24. let CompleteModel = 0; // Covers instructions applicable to cortex-r52.
  25. }
  26. //===----------------------------------------------------------------------===//
  27. // Define each kind of processor resource and number available.
  28. // Modeling each pipeline as a ProcResource using the BufferSize = 0 since
  29. // Cortex-R52 is an in-order processor.
  30. def R52UnitALU : ProcResource<2> { let BufferSize = 0; } // Int ALU
  31. def R52UnitMAC : ProcResource<1> { let BufferSize = 0; } // Int MAC
  32. def R52UnitDiv : ProcResource<1> { let BufferSize = 0; } // Int Division
  33. def R52UnitLd : ProcResource<1> { let BufferSize = 0; } // Load/Store
  34. def R52UnitB : ProcResource<1> { let BufferSize = 0; } // Branch
  35. def R52UnitFPALU : ProcResource<2> { let BufferSize = 0; } // FP ALU
  36. def R52UnitFPMUL : ProcResource<2> { let BufferSize = 0; } // FP MUL
  37. def R52UnitFPDIV : ProcResource<1> { let BufferSize = 0; } // FP DIV
  38. // Cortex-R52 specific SchedReads
  39. def R52Read_ISS : SchedRead;
  40. def R52Read_EX1 : SchedRead;
  41. def R52Read_EX2 : SchedRead;
  42. def R52Read_WRI : SchedRead;
  43. def R52Read_F0 : SchedRead; // F0 maps to ISS stage of integer pipe
  44. def R52Read_F1 : SchedRead;
  45. def R52Read_F2 : SchedRead;
  46. //===----------------------------------------------------------------------===//
  47. // Subtarget-specific SchedWrite types which map ProcResources and set latency.
  48. let SchedModel = CortexR52Model in {
  49. // ALU - Write occurs in Late EX2 (independent of whether shift was required)
  50. def : WriteRes<WriteALU, [R52UnitALU]> { let Latency = 3; }
  51. def : WriteRes<WriteALUsi, [R52UnitALU]> { let Latency = 3; }
  52. def : WriteRes<WriteALUsr, [R52UnitALU]> { let Latency = 3; }
  53. def : WriteRes<WriteALUSsr, [R52UnitALU]> { let Latency = 3; }
  54. // Compares
  55. def : WriteRes<WriteCMP, [R52UnitALU]> { let Latency = 0; }
  56. def : WriteRes<WriteCMPsi, [R52UnitALU]> { let Latency = 0; }
  57. def : WriteRes<WriteCMPsr, [R52UnitALU]> { let Latency = 0; }
  58. // Multiply - aliased to sub-target specific later
  59. // Div - may stall 0-9 cycles depending on input (i.e. WRI+(0-9)/2)
  60. def : WriteRes<WriteDIV, [R52UnitDiv]> {
  61. let Latency = 8; let ResourceCycles = [8]; // non-pipelined
  62. }
  63. // Branches - LR written in Late EX2
  64. def : WriteRes<WriteBr, [R52UnitB]> { let Latency = 0; }
  65. def : WriteRes<WriteBrL, [R52UnitB]> { let Latency = 0; }
  66. def : WriteRes<WriteBrTbl, [R52UnitALU]> { let Latency = 0; }
  67. // Misc
  68. def : WriteRes<WriteNoop, []> { let Latency = 0; let NumMicroOps = 0; }
  69. // Integer pipeline by-passes
  70. def : ReadAdvance<ReadALU, 1>; // Operand needed in EX1 stage
  71. def : ReadAdvance<ReadALUsr, 0>; // Shift operands needed in ISS
  72. def : ReadAdvance<ReadMUL, 0>;
  73. def : ReadAdvance<ReadMAC, 0>;
  74. // Floating-point. Map target-defined SchedReadWrites to subtarget
  75. def : WriteRes<WriteFPMUL32, [R52UnitFPMUL]> { let Latency = 6; }
  76. def : WriteRes<WriteFPMUL64, [R52UnitFPMUL, R52UnitFPMUL]> {
  77. let Latency = 6;
  78. }
  79. def : WriteRes<WriteFPMAC32, [R52UnitFPMUL, R52UnitFPALU]> {
  80. let Latency = 11; // as it is internally two insns (MUL then ADD)
  81. }
  82. def : WriteRes<WriteFPMAC64, [R52UnitFPMUL, R52UnitFPMUL,
  83. R52UnitFPALU, R52UnitFPALU]> {
  84. let Latency = 11;
  85. }
  86. def : WriteRes<WriteFPDIV32, [R52UnitDiv]> {
  87. let Latency = 7; // FP div takes fixed #cycles
  88. let ResourceCycles = [7]; // is not pipelined
  89. }
  90. def : WriteRes<WriteFPDIV64, [R52UnitDiv]> {
  91. let Latency = 17;
  92. let ResourceCycles = [17];
  93. }
  94. def : WriteRes<WriteFPSQRT32, [R52UnitDiv]> { let Latency = 7; }
  95. def : WriteRes<WriteFPSQRT64, [R52UnitDiv]> { let Latency = 17; }
  96. // Overriden via InstRW for this processor.
  97. def : WriteRes<WriteVST1, []>;
  98. def : WriteRes<WriteVST2, []>;
  99. def : WriteRes<WriteVST3, []>;
  100. def : WriteRes<WriteVST4, []>;
  101. def : ReadAdvance<ReadFPMUL, 1>; // mul operand read in F1
  102. def : ReadAdvance<ReadFPMAC, 1>; // fp-mac operand read in F1
  103. //===----------------------------------------------------------------------===//
  104. // Subtarget-specific SchedReadWrites.
  105. // Forwarding information - based on when an operand is read
  106. def : ReadAdvance<R52Read_ISS, 0>;
  107. def : ReadAdvance<R52Read_EX1, 1>;
  108. def : ReadAdvance<R52Read_EX2, 2>;
  109. def : ReadAdvance<R52Read_F0, 0>;
  110. def : ReadAdvance<R52Read_F1, 1>;
  111. def : ReadAdvance<R52Read_F2, 2>;
  112. // Cortex-R52 specific SchedWrites for use with InstRW
  113. def R52WriteMAC : SchedWriteRes<[R52UnitMAC]> { let Latency = 4; }
  114. def R52WriteMACHi : SchedWriteRes<[R52UnitMAC]> {
  115. let Latency = 4; let NumMicroOps = 0;
  116. }
  117. def R52WriteDIV : SchedWriteRes<[R52UnitDiv]> {
  118. let Latency = 8; let ResourceCycles = [8]; // not pipelined
  119. }
  120. def R52WriteLd : SchedWriteRes<[R52UnitLd]> { let Latency = 4; }
  121. def R52WriteST : SchedWriteRes<[R52UnitLd]> { let Latency = 4; }
  122. def R52WriteAdr : SchedWriteRes<[]> { let Latency = 0; }
  123. def R52WriteCC : SchedWriteRes<[]> { let Latency = 0; }
  124. def R52WriteALU_EX1 : SchedWriteRes<[R52UnitALU]> { let Latency = 2; }
  125. def R52WriteALU_EX2 : SchedWriteRes<[R52UnitALU]> { let Latency = 3; }
  126. def R52WriteALU_WRI : SchedWriteRes<[R52UnitALU]> { let Latency = 4; }
  127. def R52WriteNoRSRC_EX2 : SchedWriteRes<[]> { let Latency = 3; }
  128. def R52WriteNoRSRC_WRI : SchedWriteRes<[]> { let Latency = 4; }
  129. // Alias generics to sub-target specific
  130. def : SchedAlias<WriteMUL16, R52WriteMAC>;
  131. def : SchedAlias<WriteMUL32, R52WriteMAC>;
  132. def : SchedAlias<WriteMUL64Lo, R52WriteMAC>;
  133. def : SchedAlias<WriteMUL64Hi, R52WriteMACHi>;
  134. def : SchedAlias<WriteMAC16, R52WriteMAC>;
  135. def : SchedAlias<WriteMAC32, R52WriteMAC>;
  136. def : SchedAlias<WriteMAC64Lo, R52WriteMAC>;
  137. def : SchedAlias<WriteMAC64Hi, R52WriteMACHi>;
  138. def : SchedAlias<WritePreLd, R52WriteLd>;
  139. def : SchedAlias<WriteLd, R52WriteLd>;
  140. def : SchedAlias<WriteST, R52WriteST>;
  141. def R52WriteFPALU_F3 : SchedWriteRes<[R52UnitFPALU]> { let Latency = 4; }
  142. def R52Write2FPALU_F3 : SchedWriteRes<[R52UnitFPALU, R52UnitFPALU]> {
  143. let Latency = 4;
  144. }
  145. def R52WriteFPALU_F4 : SchedWriteRes<[R52UnitFPALU]> { let Latency = 5; }
  146. def R52Write2FPALU_F4 : SchedWriteRes<[R52UnitFPALU, R52UnitFPALU]> {
  147. let Latency = 5;
  148. }
  149. def R52WriteFPALU_F5 : SchedWriteRes<[R52UnitFPALU]> { let Latency = 6; }
  150. def R52Write2FPALU_F5 : SchedWriteRes<[R52UnitFPALU, R52UnitFPALU]> {
  151. let Latency = 6;
  152. }
  153. def R52WriteFPMUL_F5 : SchedWriteRes<[R52UnitFPMUL]> { let Latency = 6; }
  154. def R52Write2FPMUL_F5 : SchedWriteRes<[R52UnitFPMUL, R52UnitFPMUL]> {
  155. let Latency = 6;
  156. }
  157. def R52WriteFPMAC_F5 : SchedWriteRes<[R52UnitFPMUL, R52UnitFPALU]> {
  158. let Latency = 11; // as it is internally two insns (MUL then ADD)
  159. }
  160. def R52Write2FPMAC_F5 : SchedWriteRes<[R52UnitFPMUL, R52UnitFPMUL,
  161. R52UnitFPALU, R52UnitFPALU]> {
  162. let Latency = 11;
  163. }
  164. def R52WriteFPLd_F4 : SchedWriteRes<[R52UnitLd]> { let Latency = 5; }
  165. def R52WriteFPST_F4 : SchedWriteRes<[R52UnitLd]> { let Latency = 5; }
  166. //===----------------------------------------------------------------------===//
  167. // Floating-point. Map target defined SchedReadWrites to processor specific ones
  168. //
  169. def : SchedAlias<WriteFPCVT, R52WriteFPALU_F5>;
  170. def : SchedAlias<WriteFPMOV, R52WriteFPALU_F3>;
  171. def : SchedAlias<WriteFPALU32, R52WriteFPALU_F5>;
  172. def : SchedAlias<WriteFPALU64, R52WriteFPALU_F5>;
  173. //===----------------------------------------------------------------------===//
  174. // Subtarget-specific overrides. Map opcodes to list of SchedReadWrites types.
  175. //
  176. def : InstRW<[WriteALU], (instrs COPY)>;
  177. def : InstRW<[R52WriteALU_EX2, R52Read_EX1, R52Read_ISS],
  178. (instregex "SXTB", "SXTH", "SXTB16", "UXTB", "UXTH", "UXTB16",
  179. "t2SXTB", "t2SXTH", "t2SXTB16", "t2UXTB", "t2UXTH", "t2UXTB16")>;
  180. def : InstRW<[R52WriteALU_EX1, R52Read_ISS],
  181. (instregex "MOVCCi32imm", "MOVi32imm", "t2MOVCCi", "t2MOVi")>;
  182. def : InstRW<[R52WriteALU_EX2, R52Read_EX1],
  183. (instregex "MOV_ga_pcrel$")>;
  184. def : InstRW<[R52WriteLd,R52Read_ISS],
  185. (instregex "MOV_ga_pcrel_ldr")>;
  186. def : InstRW<[R52WriteALU_EX2, R52Read_EX1, R52Read_EX1], (instregex "SEL", "t2SEL")>;
  187. def : InstRW< [R52WriteALU_EX2, R52Read_ISS, R52Read_ISS],
  188. (instregex "BFC", "BFI", "UBFX", "SBFX", "(t|t2)BFC", "(t|t2)BFI",
  189. "(t|t2)UBFX", "(t|t2)SBFX")>;
  190. // Saturating arithmetic
  191. def : InstRW< [R52WriteALU_WRI, R52Read_EX1, R52Read_EX1],
  192. (instregex "QADD", "QSUB", "QDADD", "QDSUB", "SSAT", "SSAT16", "USAT",
  193. "QADD8", "QADD16", "QSUB8", "QSUB16", "QASX", "QSAX",
  194. "UQADD8", "UQADD16","UQSUB8","UQSUB16","UQASX","UQSAX", "t2QADD",
  195. "t2QSUB", "t2QDADD", "t2QDSUB", "t2SSAT", "t2SSAT16", "t2USAT",
  196. "t2QADD8", "t2QADD16", "t2QSUB8", "t2QSUB16", "t2QASX", "t2QSAX",
  197. "t2UQADD8", "t2UQADD16","t2UQSUB8","t2UQSUB16","t2UQASX","t2UQSAX","t2ABS")>;
  198. // Parallel arithmetic
  199. def : InstRW< [R52WriteALU_EX2, R52Read_EX1, R52Read_EX1],
  200. (instregex "SADD8", "SADD16", "SSUB8", "SSUB16", "SASX", "SSAX",
  201. "UADD8", "UADD16", "USUB8", "USUB16", "UASX", "USAX", "t2SADD8",
  202. "t2SADD16", "t2SSUB8", "t2SSUB16", "t2SASX", "t2SSAX", "t2UADD8",
  203. "t2UADD16", "t2USUB8", "t2USUB16", "t2UASX", "t2USAX")>;
  204. // Flag setting.
  205. def : InstRW< [R52WriteALU_EX2, R52Read_EX1, R52Read_EX1],
  206. (instregex "SHADD8", "SHADD16", "SHSUB8", "SHSUB16", "SHASX", "SHSAX",
  207. "SXTAB", "SXTAB16", "SXTAH", "UHADD8", "UHADD16", "UHSUB8", "UHSUB16",
  208. "UHASX", "UHSAX", "UXTAB", "UXTAB16", "UXTAH", "t2SHADD8", "t2SHADD16",
  209. "t2SHSUB8", "t2SHSUB16", "t2SHASX", "t2SHSAX", "t2SXTAB", "t2SXTAB16",
  210. "t2SXTAH", "t2UHADD8", "t2UHADD16", "t2UHSUB8", "t2UHSUB16", "t2UHASX",
  211. "t2UHSAX", "t2UXTAB", "t2UXTAB16", "t2UXTAH")>;
  212. // Sum of Absolute Difference
  213. def : InstRW< [R52WriteALU_WRI, R52Read_ISS, R52Read_ISS, R52Read_ISS],
  214. (instregex "USAD8", "t2USAD8", "USADA8", "t2USADA8") >;
  215. // Integer Multiply
  216. def : InstRW<[R52WriteMAC, R52Read_ISS, R52Read_ISS],
  217. (instregex "MUL", "SMMUL", "SMMULR", "SMULBB", "SMULBT",
  218. "SMULTB", "SMULTT", "SMULWB", "SMULWT", "SMUSD", "SMUSDX", "t2MUL",
  219. "t2SMMUL", "t2SMMULR", "t2SMULBB", "t2SMULBT", "t2SMULTB", "t2SMULTT",
  220. "t2SMULWB", "t2SMULWT", "t2SMUSD")>;
  221. // Multiply Accumulate
  222. // Even for 64-bit accumulation (or Long), the single MAC is used (not ALUs).
  223. // The store pipeline is used partly for 64-bit operations.
  224. def : InstRW<[R52WriteMAC, R52Read_ISS, R52Read_ISS, R52Read_ISS],
  225. (instregex "MLA", "MLS", "SMMLA", "SMMLAR", "SMMLS", "SMMLSR",
  226. "t2MLA", "t2MLS", "t2SMMLA", "t2SMMLAR", "t2SMMLS", "t2SMMLSR",
  227. "SMUAD", "SMUADX", "t2SMUAD", "t2SMUADX",
  228. "SMLABB", "SMLABT", "SMLATB", "SMLATT", "SMLSD", "SMLSDX",
  229. "SMLAWB", "SMLAWT", "t2SMLABB", "t2SMLABT", "t2SMLATB", "t2SMLATT",
  230. "t2SMLSD", "t2SMLSDX", "t2SMLAWB", "t2SMLAWT",
  231. "SMLAD", "SMLADX", "t2SMLAD", "t2SMLADX",
  232. "SMULL$", "UMULL$", "t2SMULL$", "t2UMULL$",
  233. "SMLAL", "UMLAL", "SMLALBT",
  234. "SMLALTB", "SMLALTT", "SMLALD", "SMLALDX", "SMLSLD", "SMLSLDX",
  235. "UMAAL", "t2SMLAL", "t2UMLAL",
  236. "t2SMLALBT", "t2SMLALTB", "t2SMLALTT", "t2SMLALD", "t2SMLALDX",
  237. "t2SMLSLD", "t2SMLSLDX", "t2UMAAL")>;
  238. def : InstRW <[R52WriteDIV, R52Read_ISS, R52Read_ISS],
  239. (instregex "t2SDIV", "t2UDIV")>;
  240. // Loads (except POST) with SHL > 2, or ror, require 2 extra cycles.
  241. // However, that's non-trivial to specify, so we keep it uniform
  242. def : InstRW<[R52WriteLd, R52Read_ISS, R52Read_ISS],
  243. (instregex "LDR(i12|rs)$", "LDRB(i12|rs)$", "t2LDR(i8|i12|s|pci)",
  244. "t2LDR(H|B)(i8|i12|s|pci)", "LDREX", "t2LDREX",
  245. "tLDR[BH](r|i|spi|pci|pciASM)", "tLDR(r|i|spi|pci|pciASM)",
  246. "LDRH$", "PICLDR$", "PICLDR(H|B)$", "LDRcp$",
  247. "PICLDRS(H|B)$", "t2LDRS(H|B)(i|r|p|s)", "LDRS(H|B)$",
  248. "t2LDRpci_pic", "tLDRS(B|H)", "t2LDRDi8", "LDRD$", "LDA", "t2LDA")>;
  249. def : InstRW<[R52WriteLd, R52WriteAdr, R52Read_ISS, R52Read_ISS],
  250. (instregex "LD(RB|R)(_|T_)(POST|PRE)_(IMM|REG)", "LDRH(_PRE|_POST)",
  251. "LDRBT_POST$", "LDR(T|BT)_POST_(REG|IMM)", "LDRHT(i|r)",
  252. "t2LD(R|RB|RH)_(PRE|POST)", "t2LD(R|RB|RH)T",
  253. "LDR(SH|SB)(_POST|_PRE)", "t2LDR(SH|SB)(_POST|_PRE)",
  254. "LDRS(B|H)T(i|r)", "t2LDRS(B|H)T(i|r)?",
  255. "LDRD_(POST|PRE)", "t2LDRD_(POST|PRE)")>;
  256. def : InstRW<[R52WriteALU_EX2, R52Read_EX1], (instregex "MOVS?sr", "t2MOVS?sr")>;
  257. def : InstRW<[R52WriteALU_WRI, R52Read_EX2], (instregex "MOVT", "t2MOVT")>;
  258. def : InstRW<[R52WriteALU_EX2, R52Read_EX1], (instregex "AD(C|D)S?ri", "ANDS?ri",
  259. "BICS?ri", "CLZ", "EORri", "MVNS?r", "ORRri", "RSBS?ri", "RSCri", "SBCri",
  260. "t2AD(C|D)S?ri", "t2ANDS?ri", "t2BICS?ri","t2CLZ", "t2EORri", "t2MVN",
  261. "t2ORRri", "t2RSBS?ri", "t2SBCri")>;
  262. def : InstRW<[R52WriteALU_EX2, R52Read_EX1, R52Read_EX1], (instregex "AD(C|D)S?rr",
  263. "ANDS?rr", "BICS?rr", "CRC", "EORrr", "ORRrr", "RSBrr", "RSCrr", "SBCrr",
  264. "t2AD(C|D)S?rr", "t2ANDS?rr", "t2BICS?rr", "t2CRC", "t2EORrr", "t2SBCrr")>;
  265. def : InstRW<[R52WriteALU_EX2, R52Read_EX1, R52Read_ISS], (instregex "AD(C|D)S?rsi",
  266. "ANDS?rsi", "BICS?rsi", "EORrsi", "ORRrsi", "RSBrsi", "RSCrsi", "SBCrsi",
  267. "t2AD(C|D)S?rs", "t2ANDS?rs", "t2BICS?rs", "t2EORrs", "t2ORRrs", "t2RSBrs", "t2SBCrs")>;
  268. def : InstRW<[R52WriteALU_EX2, R52Read_EX1, R52Read_ISS, R52Read_ISS],
  269. (instregex "AD(C|D)S?rsr", "ANDS?rsr", "BICS?rsr", "EORrsr", "MVNS?sr",
  270. "ORRrsr", "RSBrsr", "RSCrsr", "SBCrsr")>;
  271. def : InstRW<[R52WriteALU_EX1],
  272. (instregex "ADR", "MOVsi", "MVNS?s?i", "t2MOVS?si")>;
  273. def : InstRW<[R52WriteALU_EX1, R52Read_ISS], (instregex "ASRi", "RORS?i")>;
  274. def : InstRW<[R52WriteALU_EX1, R52Read_ISS, R52Read_ISS],
  275. (instregex "ASRr", "RORS?r", "LSR", "LSL")>;
  276. def : InstRW<[R52WriteCC, R52Read_EX1], (instregex "CMPri", "CMNri")>;
  277. def : InstRW<[R52WriteCC, R52Read_EX1, R52Read_EX1], (instregex "CMPrr", "CMNzrr")>;
  278. def : InstRW<[R52WriteCC, R52Read_EX1, R52Read_ISS], (instregex "CMPrsi", "CMNzrsi")>;
  279. def : InstRW<[R52WriteCC, R52Read_EX1, R52Read_ISS, R52Read_ISS], (instregex "CMPrsr", "CMNzrsr")>;
  280. def : InstRW<[R52WriteALU_EX2, R52Read_ISS],
  281. (instregex "t2LDC", "RBIT", "REV", "REV16", "REVSH", "RRX")>;
  282. def : InstRW<[R52WriteCC, R52Read_ISS], (instregex "TST")>;
  283. def : InstRW<[R52WriteLd], (instregex "MRS", "MRSbanked")>;
  284. def : InstRW<[R52WriteLd, R52Read_EX1], (instregex "MSR", "MSRbanked")>;
  285. // Integer Load, Multiple.
  286. foreach Lat = 3-25 in {
  287. def R52WriteILDM#Lat#Cy : SchedWriteRes<[R52UnitLd]> {
  288. let Latency = Lat;
  289. }
  290. def R52WriteILDM#Lat#CyNo : SchedWriteRes<[]> {
  291. let Latency = Lat;
  292. let NumMicroOps = 0;
  293. }
  294. }
  295. foreach NAddr = 1-16 in {
  296. def R52ILDMAddr#NAddr#Pred : SchedPredicate<"TII->getNumLDMAddresses(*MI) == "#NAddr>;
  297. }
  298. def R52WriteILDMAddrNoWB : SchedWriteRes<[R52UnitLd]> { let Latency = 0; }
  299. def R52WriteILDMAddrWB : SchedWriteRes<[R52UnitLd]>;
  300. def R52WriteILDM : SchedWriteVariant<[
  301. SchedVar<R52ILDMAddr2Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy]>,
  302. SchedVar<R52ILDMAddr3Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  303. R52WriteILDM6Cy]>,
  304. SchedVar<R52ILDMAddr4Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  305. R52WriteILDM6Cy, R52WriteILDM7Cy]>,
  306. SchedVar<R52ILDMAddr5Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  307. R52WriteILDM6Cy, R52WriteILDM7Cy,
  308. R52WriteILDM8Cy]>,
  309. SchedVar<R52ILDMAddr6Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  310. R52WriteILDM6Cy, R52WriteILDM7Cy,
  311. R52WriteILDM8Cy, R52WriteILDM9Cy]>,
  312. SchedVar<R52ILDMAddr7Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  313. R52WriteILDM6Cy, R52WriteILDM7Cy,
  314. R52WriteILDM8Cy, R52WriteILDM9Cy,
  315. R52WriteILDM10Cy]>,
  316. SchedVar<R52ILDMAddr8Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  317. R52WriteILDM6Cy, R52WriteILDM7Cy,
  318. R52WriteILDM8Cy, R52WriteILDM9Cy,
  319. R52WriteILDM10Cy, R52WriteILDM11Cy]>,
  320. SchedVar<R52ILDMAddr9Pred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  321. R52WriteILDM6Cy, R52WriteILDM7Cy,
  322. R52WriteILDM8Cy, R52WriteILDM9Cy,
  323. R52WriteILDM10Cy, R52WriteILDM11Cy,
  324. R52WriteILDM12Cy]>,
  325. SchedVar<R52ILDMAddr10Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  326. R52WriteILDM6Cy, R52WriteILDM7Cy,
  327. R52WriteILDM8Cy, R52WriteILDM9Cy,
  328. R52WriteILDM10Cy, R52WriteILDM11Cy,
  329. R52WriteILDM12Cy, R52WriteILDM13Cy]>,
  330. SchedVar<R52ILDMAddr11Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  331. R52WriteILDM6Cy, R52WriteILDM7Cy,
  332. R52WriteILDM8Cy, R52WriteILDM9Cy,
  333. R52WriteILDM10Cy, R52WriteILDM11Cy,
  334. R52WriteILDM12Cy, R52WriteILDM13Cy,
  335. R52WriteILDM14Cy]>,
  336. SchedVar<R52ILDMAddr12Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  337. R52WriteILDM6Cy, R52WriteILDM7Cy,
  338. R52WriteILDM8Cy, R52WriteILDM9Cy,
  339. R52WriteILDM10Cy, R52WriteILDM11Cy,
  340. R52WriteILDM12Cy, R52WriteILDM13Cy,
  341. R52WriteILDM14Cy, R52WriteILDM15Cy]>,
  342. SchedVar<R52ILDMAddr13Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  343. R52WriteILDM6Cy, R52WriteILDM7Cy,
  344. R52WriteILDM8Cy, R52WriteILDM9Cy,
  345. R52WriteILDM10Cy, R52WriteILDM11Cy,
  346. R52WriteILDM12Cy, R52WriteILDM13Cy,
  347. R52WriteILDM14Cy, R52WriteILDM15Cy,
  348. R52WriteILDM16Cy]>,
  349. SchedVar<R52ILDMAddr14Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  350. R52WriteILDM6Cy, R52WriteILDM7Cy,
  351. R52WriteILDM8Cy, R52WriteILDM9Cy,
  352. R52WriteILDM10Cy, R52WriteILDM11Cy,
  353. R52WriteILDM12Cy, R52WriteILDM13Cy,
  354. R52WriteILDM14Cy, R52WriteILDM15Cy,
  355. R52WriteILDM16Cy, R52WriteILDM17Cy]>,
  356. SchedVar<R52ILDMAddr15Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  357. R52WriteILDM6Cy, R52WriteILDM7Cy,
  358. R52WriteILDM8Cy, R52WriteILDM9Cy,
  359. R52WriteILDM10Cy, R52WriteILDM11Cy,
  360. R52WriteILDM12Cy, R52WriteILDM13Cy,
  361. R52WriteILDM14Cy, R52WriteILDM15Cy,
  362. R52WriteILDM16Cy, R52WriteILDM17Cy,
  363. R52WriteILDM18Cy]>,
  364. SchedVar<R52ILDMAddr15Pred,[R52WriteILDM4Cy, R52WriteILDM5Cy,
  365. R52WriteILDM6Cy, R52WriteILDM7Cy,
  366. R52WriteILDM8Cy, R52WriteILDM9Cy,
  367. R52WriteILDM10Cy, R52WriteILDM11Cy,
  368. R52WriteILDM12Cy, R52WriteILDM13Cy,
  369. R52WriteILDM14Cy, R52WriteILDM15Cy,
  370. R52WriteILDM16Cy, R52WriteILDM17Cy,
  371. R52WriteILDM18Cy, R52WriteILDM19Cy]>,
  372. // Unknown number of registers, just use resources for two registers.
  373. SchedVar<NoSchedPred, [R52WriteILDM4Cy, R52WriteILDM5Cy,
  374. R52WriteILDM6CyNo, R52WriteILDM7CyNo,
  375. R52WriteILDM8CyNo, R52WriteILDM9CyNo,
  376. R52WriteILDM10CyNo, R52WriteILDM11CyNo,
  377. R52WriteILDM12CyNo, R52WriteILDM13CyNo,
  378. R52WriteILDM14CyNo, R52WriteILDM15CyNo,
  379. R52WriteILDM16CyNo, R52WriteILDM17CyNo,
  380. R52WriteILDM18Cy, R52WriteILDM19Cy]>
  381. ]> { let Variadic=1; }
  382. // Integer Store, Multiple
  383. def R52WriteIStIncAddr : SchedWriteRes<[R52UnitLd]> {
  384. let Latency = 4;
  385. let NumMicroOps = 2;
  386. }
  387. foreach NumAddr = 1-16 in {
  388. def R52WriteISTM#NumAddr : WriteSequence<[R52WriteIStIncAddr], NumAddr>;
  389. }
  390. def R52WriteISTM : SchedWriteVariant<[
  391. SchedVar<R52ILDMAddr2Pred, [R52WriteISTM2]>,
  392. SchedVar<R52ILDMAddr3Pred, [R52WriteISTM3]>,
  393. SchedVar<R52ILDMAddr4Pred, [R52WriteISTM4]>,
  394. SchedVar<R52ILDMAddr5Pred, [R52WriteISTM5]>,
  395. SchedVar<R52ILDMAddr6Pred, [R52WriteISTM6]>,
  396. SchedVar<R52ILDMAddr7Pred, [R52WriteISTM7]>,
  397. SchedVar<R52ILDMAddr8Pred, [R52WriteISTM8]>,
  398. SchedVar<R52ILDMAddr9Pred, [R52WriteISTM9]>,
  399. SchedVar<R52ILDMAddr10Pred,[R52WriteISTM10]>,
  400. SchedVar<R52ILDMAddr11Pred,[R52WriteISTM11]>,
  401. SchedVar<R52ILDMAddr12Pred,[R52WriteISTM12]>,
  402. SchedVar<R52ILDMAddr13Pred,[R52WriteISTM13]>,
  403. SchedVar<R52ILDMAddr14Pred,[R52WriteISTM14]>,
  404. SchedVar<R52ILDMAddr15Pred,[R52WriteISTM15]>,
  405. SchedVar<R52ILDMAddr16Pred,[R52WriteISTM16]>,
  406. // Unknow number of registers, just use resources for two registers.
  407. SchedVar<NoSchedPred, [R52WriteISTM2]>
  408. ]>;
  409. def : InstRW<[R52WriteILDM, R52Read_ISS],
  410. (instregex "LDM(IA|DA|DB|IB)$", "t2LDM(IA|DA|DB|IB)$",
  411. "(t|sys)LDM(IA|DA|DB|IB)$")>;
  412. def : InstRW<[R52WriteILDM, R52WriteAdr, R52Read_ISS],
  413. (instregex "LDM(IA|DA|DB|IB)_UPD", "(t2|sys|t)LDM(IA|DA|DB|IB)_UPD")>;
  414. def : InstRW<[R52WriteILDM, R52WriteAdr, R52Read_ISS],
  415. (instregex "LDMIA_RET", "(t|t2)LDMIA_RET", "tPOP")>;
  416. // Integer Store, Single Element
  417. def : InstRW<[R52WriteLd, R52Read_ISS, R52Read_EX2],
  418. (instregex "PICSTR", "STR(i12|rs)", "STRB(i12|rs)", "STRH$", "STREX", "SRS", "t2SRS",
  419. "t2SRSDB", "t2STREX", "t2STREXB", "t2STREXD", "t2STREXH", "t2STR(i12|i8|s)$",
  420. "RFE", "t2RFE", "t2STR[BH](i12|i8|s)$", "tSTR[BH](i|r)", "tSTR(i|r)", "tSTRspi")>;
  421. def : InstRW<[R52WriteLd, R52WriteAdr, R52Read_ISS, R52Read_EX2],
  422. (instregex "STR(B_|_|BT_|T_)(PRE_IMM|PRE_REG|POST_REG|POST_IMM)",
  423. "STR(i|r)_preidx", "STRB(i|r)_preidx", "STRH_preidx", "STR(H_|HT_)(PRE|POST)",
  424. "STR(BT|HT|T)", "t2STR_(PRE|POST)", "t2STR[BH]_(PRE|POST)",
  425. "t2STR_preidx", "t2STR[BH]_preidx", "t2ST(RB|RH|R)T")>;
  426. // Integer Store, Dual
  427. def : InstRW<[R52WriteLd, R52Read_ISS, R52Read_EX2],
  428. (instregex "STRD$", "t2STRDi8", "STL", "t2STL")>;
  429. def : InstRW<[R52WriteLd, R52WriteAdr, R52Read_ISS, R52Read_EX2],
  430. (instregex "(t2|t)STRD_(POST|PRE)", "STRD_(POST|PRE)")>;
  431. def : InstRW<[R52WriteISTM, R52Read_ISS, R52Read_EX2],
  432. (instregex "STM(IB|IA|DB|DA)$", "(t2|sys|t)STM(IB|IA|DB|DA)$")>;
  433. def : InstRW<[R52WriteISTM, R52WriteAdr, R52Read_ISS, R52Read_EX2],
  434. (instregex "STM(IB|IA|DB|DA)_UPD", "(t2|sys|t)STM(IB|IA|DB|DA)_UPD",
  435. "tPUSH")>;
  436. // LDRLIT pseudo instructions, they expand to LDR + PICADD
  437. def : InstRW<[R52WriteLd],
  438. (instregex "t?LDRLIT_ga_abs", "t?LDRLIT_ga_pcrel$")>;
  439. // LDRLIT_ga_pcrel_ldr expands to LDR + PICLDR
  440. def : InstRW<[R52WriteLd], (instregex "LDRLIT_ga_pcrel_ldr")>;
  441. //===----------------------------------------------------------------------===//
  442. // VFP, Floating Point Support
  443. def : InstRW<[R52WriteFPALU_F5, R52Read_F1, R52Read_F1], (instregex "VABD(fd|hd)")>;
  444. def : InstRW<[R52Write2FPALU_F5, R52Read_F1, R52Read_F1], (instregex "VABD(fq|hq)")>;
  445. def : InstRW<[R52WriteFPALU_F5, R52Read_F1], (instregex "VABS(D|S|H)")>;
  446. def : InstRW<[R52WriteFPALU_F5, R52Read_F1], (instregex "VABS(fd|hd)")>;
  447. def : InstRW<[R52Write2FPALU_F5, R52Read_F1], (instregex "VABS(fq|hq)")>;
  448. def : InstRW<[R52WriteFPALU_F3, R52Read_F1, R52Read_F1], (instregex "(VACGE|VACGT)(fd|hd)")>;
  449. def : InstRW<[R52Write2FPALU_F3, R52Read_F1, R52Read_F1], (instregex "(VACGE|VACGT)(fq|hq)")>;
  450. def : InstRW<[R52WriteFPALU_F5, R52Read_F1, R52Read_F1], (instregex "(VADD|VSUB)(D|S|H|fd|hd)$")>;
  451. def : InstRW<[R52Write2FPALU_F5, R52Read_F1, R52Read_F1], (instregex "(VADD|VSUB)(fq|hq)")>;
  452. def : InstRW<[R52WriteFPLd_F4, R52Read_ISS, R52Read_F1], (instregex "VLDR")>;
  453. def : InstRW<[R52WriteFPST_F4, R52Read_ISS, R52Read_F1], (instregex "VSTR")>;
  454. //===----------------------------------------------------------------------===//
  455. // Neon Support
  456. // vector multiple load stores
  457. foreach NumAddr = 1-16 in {
  458. def R52LMAddrPred#NumAddr :
  459. SchedPredicate<"MI->getNumOperands() == "#NumAddr>;
  460. }
  461. foreach Lat = 1-32 in {
  462. def R52WriteLM#Lat#Cy : SchedWriteRes<[]> {
  463. let Latency = Lat;
  464. }
  465. }
  466. foreach Num = 1-32 in { // reserve LdSt resource, no dual-issue
  467. def R52ReserveLd#Num#Cy : SchedWriteRes<[R52UnitLd]> {
  468. let Latency = 0;
  469. let NumMicroOps = Num;
  470. let ResourceCycles = [Num];
  471. }
  472. }
  473. def R52WriteVLDM : SchedWriteVariant<[
  474. // 1 D reg
  475. SchedVar<R52LMAddrPred1, [R52WriteLM5Cy,
  476. R52ReserveLd5Cy]>,
  477. SchedVar<R52LMAddrPred2, [R52WriteLM5Cy,
  478. R52ReserveLd5Cy]>,
  479. // 2 D reg
  480. SchedVar<R52LMAddrPred3, [R52WriteLM5Cy, R52WriteLM6Cy,
  481. R52ReserveLd6Cy]>,
  482. SchedVar<R52LMAddrPred4, [R52WriteLM5Cy, R52WriteLM6Cy,
  483. R52ReserveLd6Cy]>,
  484. // 3 D reg
  485. SchedVar<R52LMAddrPred5, [R52WriteLM5Cy, R52WriteLM6Cy,
  486. R52WriteLM7Cy,
  487. R52ReserveLd4Cy]>,
  488. SchedVar<R52LMAddrPred6, [R52WriteLM5Cy, R52WriteLM6Cy,
  489. R52WriteLM7Cy,
  490. R52ReserveLd7Cy]>,
  491. // 4 D reg
  492. SchedVar<R52LMAddrPred7, [R52WriteLM5Cy, R52WriteLM6Cy,
  493. R52WriteLM7Cy, R52WriteLM8Cy,
  494. R52ReserveLd8Cy]>,
  495. SchedVar<R52LMAddrPred8, [R52WriteLM5Cy, R52WriteLM6Cy,
  496. R52WriteLM7Cy, R52WriteLM8Cy,
  497. R52ReserveLd8Cy]>,
  498. // 5 D reg
  499. SchedVar<R52LMAddrPred9, [R52WriteLM5Cy, R52WriteLM6Cy,
  500. R52WriteLM7Cy, R52WriteLM8Cy,
  501. R52WriteLM9Cy,
  502. R52ReserveLd9Cy]>,
  503. SchedVar<R52LMAddrPred10, [R52WriteLM5Cy, R52WriteLM6Cy,
  504. R52WriteLM7Cy, R52WriteLM8Cy,
  505. R52WriteLM9Cy,
  506. R52ReserveLd9Cy]>,
  507. // 6 D reg
  508. SchedVar<R52LMAddrPred11, [R52WriteLM5Cy, R52WriteLM6Cy,
  509. R52WriteLM7Cy, R52WriteLM8Cy,
  510. R52WriteLM9Cy, R52WriteLM10Cy,
  511. R52ReserveLd10Cy]>,
  512. SchedVar<R52LMAddrPred12, [R52WriteLM5Cy, R52WriteLM6Cy,
  513. R52WriteLM7Cy, R52WriteLM8Cy,
  514. R52WriteLM9Cy, R52WriteLM10Cy,
  515. R52ReserveLd10Cy]>,
  516. // 7 D reg
  517. SchedVar<R52LMAddrPred13, [R52WriteLM5Cy, R52WriteLM6Cy,
  518. R52WriteLM7Cy, R52WriteLM8Cy,
  519. R52WriteLM9Cy, R52WriteLM10Cy,
  520. R52WriteLM11Cy,
  521. R52ReserveLd11Cy]>,
  522. SchedVar<R52LMAddrPred14, [R52WriteLM5Cy, R52WriteLM6Cy,
  523. R52WriteLM7Cy, R52WriteLM8Cy,
  524. R52WriteLM9Cy, R52WriteLM10Cy,
  525. R52WriteLM11Cy,
  526. R52ReserveLd11Cy]>,
  527. // 8 D reg
  528. SchedVar<R52LMAddrPred14, [R52WriteLM5Cy, R52WriteLM6Cy,
  529. R52WriteLM7Cy, R52WriteLM8Cy,
  530. R52WriteLM9Cy, R52WriteLM10Cy,
  531. R52WriteLM11Cy, R52WriteLM12Cy,
  532. R52ReserveLd12Cy]>,
  533. SchedVar<R52LMAddrPred15, [R52WriteLM5Cy, R52WriteLM6Cy,
  534. R52WriteLM7Cy, R52WriteLM8Cy,
  535. R52WriteLM9Cy, R52WriteLM10Cy,
  536. R52WriteLM11Cy, R52WriteLM12Cy,
  537. R52ReserveLd12Cy]>,
  538. // unknown number of reg.
  539. SchedVar<NoSchedPred, [R52WriteLM5Cy, R52WriteLM6Cy,
  540. R52WriteLM7Cy, R52WriteLM8Cy,
  541. R52WriteLM9Cy, R52WriteLM10Cy,
  542. R52WriteLM11Cy, R52WriteLM12Cy,
  543. R52ReserveLd5Cy]>
  544. ]> { let Variadic=1;}
  545. // variable stores. Cannot dual-issue
  546. def R52WriteSTM5 : SchedWriteRes<[R52UnitLd]> {
  547. let Latency = 5;
  548. let NumMicroOps = 2;
  549. let ResourceCycles = [1];
  550. }
  551. def R52WriteSTM6 : SchedWriteRes<[R52UnitLd]> {
  552. let Latency = 6;
  553. let NumMicroOps = 4;
  554. let ResourceCycles = [2];
  555. }
  556. def R52WriteSTM7 : SchedWriteRes<[R52UnitLd]> {
  557. let Latency = 7;
  558. let NumMicroOps = 6;
  559. let ResourceCycles = [3];
  560. }
  561. def R52WriteSTM8 : SchedWriteRes<[R52UnitLd]> {
  562. let Latency = 8;
  563. let NumMicroOps = 8;
  564. let ResourceCycles = [4];
  565. }
  566. def R52WriteSTM9 : SchedWriteRes<[R52UnitLd]> {
  567. let Latency = 9;
  568. let NumMicroOps = 10;
  569. let ResourceCycles = [5];
  570. }
  571. def R52WriteSTM10 : SchedWriteRes<[R52UnitLd]> {
  572. let Latency = 10;
  573. let NumMicroOps = 12;
  574. let ResourceCycles = [6];
  575. }
  576. def R52WriteSTM11 : SchedWriteRes<[R52UnitLd]> {
  577. let Latency = 11;
  578. let NumMicroOps = 14;
  579. let ResourceCycles = [7];
  580. }
  581. def R52WriteSTM12 : SchedWriteRes<[R52UnitLd]> {
  582. let Latency = 12;
  583. let NumMicroOps = 16;
  584. let ResourceCycles = [8];
  585. }
  586. def R52WriteSTM13 : SchedWriteRes<[R52UnitLd]> {
  587. let Latency = 13;
  588. let NumMicroOps = 18;
  589. let ResourceCycles = [9];
  590. }
  591. def R52WriteSTM14 : SchedWriteRes<[R52UnitLd]> {
  592. let Latency = 14;
  593. let NumMicroOps = 20;
  594. let ResourceCycles = [10];
  595. }
  596. def R52WriteSTM15 : SchedWriteRes<[R52UnitLd]> {
  597. let Latency = 15;
  598. let NumMicroOps = 22;
  599. let ResourceCycles = [11];
  600. }
  601. def R52WriteSTM : SchedWriteVariant<[
  602. SchedVar<R52LMAddrPred1, [R52WriteSTM5]>,
  603. SchedVar<R52LMAddrPred2, [R52WriteSTM5]>,
  604. SchedVar<R52LMAddrPred3, [R52WriteSTM6]>,
  605. SchedVar<R52LMAddrPred4, [R52WriteSTM6]>,
  606. SchedVar<R52LMAddrPred5, [R52WriteSTM7]>,
  607. SchedVar<R52LMAddrPred6, [R52WriteSTM7]>,
  608. SchedVar<R52LMAddrPred7, [R52WriteSTM8]>,
  609. SchedVar<R52LMAddrPred8, [R52WriteSTM8]>,
  610. SchedVar<R52LMAddrPred9, [R52WriteSTM9]>,
  611. SchedVar<R52LMAddrPred10, [R52WriteSTM9]>,
  612. SchedVar<R52LMAddrPred11, [R52WriteSTM10]>,
  613. SchedVar<R52LMAddrPred12, [R52WriteSTM10]>,
  614. SchedVar<R52LMAddrPred13, [R52WriteSTM11]>,
  615. SchedVar<R52LMAddrPred14, [R52WriteSTM11]>,
  616. SchedVar<R52LMAddrPred15, [R52WriteSTM12]>,
  617. SchedVar<R52LMAddrPred16, [R52WriteSTM12]>,
  618. // unknown number of registers, just use resources for two
  619. SchedVar<NoSchedPred, [R52WriteSTM6]>
  620. ]>;
  621. // Vector Load/Stores. Can issue only in slot-0. Can dual-issue with
  622. // another instruction in slot-1, but only in the last issue.
  623. def : WriteRes<WriteVLD1, [R52UnitLd]> { let Latency = 5;}
  624. def : WriteRes<WriteVLD2, [R52UnitLd]> {
  625. let Latency = 6;
  626. let NumMicroOps = 3;
  627. let ResourceCycles = [2];
  628. let SingleIssue = 1;
  629. }
  630. def : WriteRes<WriteVLD3, [R52UnitLd]> {
  631. let Latency = 7;
  632. let NumMicroOps = 5;
  633. let ResourceCycles = [3];
  634. let SingleIssue = 1;
  635. }
  636. def : WriteRes<WriteVLD4, [R52UnitLd]> {
  637. let Latency = 8;
  638. let NumMicroOps = 7;
  639. let ResourceCycles = [4];
  640. let SingleIssue = 1;
  641. }
  642. def R52WriteVST1Mem : SchedWriteRes<[R52UnitLd]> {
  643. let Latency = 5;
  644. let NumMicroOps = 1;
  645. let ResourceCycles = [1];
  646. }
  647. def R52WriteVST2Mem : SchedWriteRes<[R52UnitLd]> {
  648. let Latency = 6;
  649. let NumMicroOps = 3;
  650. let ResourceCycles = [2];
  651. }
  652. def R52WriteVST3Mem : SchedWriteRes<[R52UnitLd]> {
  653. let Latency = 7;
  654. let NumMicroOps = 5;
  655. let ResourceCycles = [3];
  656. }
  657. def R52WriteVST4Mem : SchedWriteRes<[R52UnitLd]> {
  658. let Latency = 8;
  659. let NumMicroOps = 7;
  660. let ResourceCycles = [4];
  661. }
  662. def R52WriteVST5Mem : SchedWriteRes<[R52UnitLd]> {
  663. let Latency = 9;
  664. let NumMicroOps = 9;
  665. let ResourceCycles = [5];
  666. }
  667. def : InstRW<[R52WriteFPALU_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "VABA(u|s)(v8i8|v4i16|v2i32)")>;
  668. def : InstRW<[R52Write2FPALU_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "VABA(u|s)(v16i8|v8i16|v4i32)")>;
  669. def : InstRW<[R52Write2FPALU_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "VABAL(u|s)(v8i16|v4i32|v2i64)")>;
  670. def : InstRW<[R52WriteFPALU_F4, R52Read_F1, R52Read_F1], (instregex "VABD(u|s)(v8i8|v4i16|v2i32)")>;
  671. def : InstRW<[R52Write2FPALU_F4, R52Read_F1, R52Read_F1], (instregex "VABD(u|s)(v16i8|v8i16|v4i32)")>;
  672. def : InstRW<[R52Write2FPALU_F4, R52Read_F1, R52Read_F1], (instregex "VABDL(u|s)(v16i8|v8i16|v4i32)")>;
  673. def : InstRW<[R52Write2FPALU_F4, R52Read_F1], (instregex "VABS(v16i8|v8i16|v4i32)")>;
  674. def : InstRW<[R52WriteFPALU_F4, R52Read_F2, R52Read_F2],
  675. (instregex "(VADD|VSUB)(v8i8|v4i16|v2i32|v1i64)")>;
  676. def : InstRW<[R52Write2FPALU_F4, R52Read_F2, R52Read_F2],
  677. (instregex "(VADD|VSUB)(v16i8|v8i16|v4i32|v2i64)")>;
  678. def : InstRW<[R52Write2FPALU_F5, R52Read_F2, R52Read_F2],
  679. (instregex "(VADDHN|VRADDHN|VSUBHN|VRSUBHN)(v8i8|v4i16|v2i32)")>;
  680. def : InstRW<[R52Write2FPALU_F4, R52Read_F1, R52Read_F1],
  681. (instregex "VADDL", "VADDW", "VSUBL", "VSUBW")>;
  682. def : InstRW<[R52WriteFPALU_F3, R52Read_F2, R52Read_F2], (instregex "(VAND|VBIC|VEOR)d")>;
  683. def : InstRW<[R52Write2FPALU_F3, R52Read_F2, R52Read_F2], (instregex "(VAND|VBIC|VEOR)q")>;
  684. def : InstRW<[R52WriteFPALU_F3, R52Read_F2], (instregex "VBICi(v4i16|v2i32)")>;
  685. def : InstRW<[R52Write2FPALU_F3, R52Read_F2], (instregex "VBICi(v8i16|v4i32)")>;
  686. def : InstRW<[R52WriteFPALU_F3, R52Read_F1, R52Read_F2, R52Read_F2], (instregex "(VBIF|VBIT|VBSL|VBSP)d")>;
  687. def : InstRW<[R52Write2FPALU_F3, R52Read_F1, R52Read_F2, R52Read_F2], (instregex "(VBIF|VBIT|VBSL|VBSP)q")>;
  688. def : InstRW<[R52WriteFPALU_F3, R52Read_F1, R52Read_F1],
  689. (instregex "(VCEQ|VCGE|VCGT|VCLE|VCLT|VCLZ|VCMP|VCMPE|VCNT)")>;
  690. def : InstRW<[R52WriteFPALU_F5, R52Read_F1, R52Read_F1],
  691. (instregex "VCVT", "VSITO", "VUITO", "VTO")>;
  692. def : InstRW<[R52WriteFPALU_F3, R52Read_ISS], (instregex "VDUP(8|16|32)d")>;
  693. def : InstRW<[R52Write2FPALU_F3, R52Read_ISS], (instregex "VDUP(8|16|32)q")>;
  694. def : InstRW<[R52WriteFPALU_F3, R52Read_F1], (instregex "VDUPLN(8|16|32)d")>;
  695. def : InstRW<[R52Write2FPALU_F3, R52Read_F1], (instregex "VDUPLN(8|16|32)q")>;
  696. def : InstRW<[R52WriteFPALU_F3, R52Read_F1, R52Read_F1], (instregex "VEXTd(8|16|32)", "VSEL")>;
  697. def : InstRW<[R52Write2FPALU_F3, R52Read_F1, R52Read_F1], (instregex "VEXTq(8|16|32|64)")>;
  698. def : InstRW<[R52WriteFPMAC_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "(VFMA|VFMS)(f|h)d")>;
  699. def : InstRW<[R52Write2FPMAC_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "(VFMA|VFMS)(f|h)q")>;
  700. def : InstRW<[R52WriteFPALU_F4, R52Read_F2, R52Read_F2], (instregex "(VHADD|VHSUB)(u|s)(v8i8|v4i16|v2i32)")>;
  701. def : InstRW<[R52Write2FPALU_F4, R52Read_F2, R52Read_F2], (instregex "(VHADD|VHSUB)(u|s)(v16i8|v8i16|v4i32)")>;
  702. def : InstRW<[R52WriteVLDM], (instregex "VLDM[SD](IA|DB)$")>;
  703. def : InstRW<[R52WriteFPALU_F4, R52Read_F1, R52Read_F1], (instregex "VMAX", "VMIN", "VPMAX", "VPMIN")>;
  704. def : InstRW<[R52WriteFPALU_F3, R52Read_F1, R52Read_F1], (instregex "VORR", "VORN", "VREV")>;
  705. def : InstRW<[R52WriteNoRSRC_WRI], (instregex "VMRS")>;
  706. def : InstRW<[R52WriteFPALU_F5, R52Read_F1], (instregex "VNEG")>;
  707. def : InstRW<[R52WriteFPALU_F4, R52Read_F1, R52Read_F1], (instregex "VPADDi")>;
  708. def : InstRW<[R52Write2FPALU_F4, R52Read_F1, R52Read_F1], (instregex "VPADAL", "VPADDL")>;
  709. def : InstRW<[R52WriteFPALU_F5, R52Read_F1], (instregex "VQABS(v8i8|v4i16|v2i32|v1i64)")>;
  710. def : InstRW<[R52Write2FPALU_F5, R52Read_F1], (instregex "VQABS(v16i8|v8i16|v4i32|v2i64)")>;
  711. def : InstRW<[R52WriteFPALU_F5, R52Read_F2, R52Read_F2],
  712. (instregex "(VQADD|VQSUB)(u|s)(v8i8|v4i16|v2i32|v1i64)")>;
  713. def : InstRW<[R52Write2FPALU_F5, R52Read_F2, R52Read_F2],
  714. (instregex "(VQADD|VQSUB)(u|s)(v16i8|v8i16|v4i32|v2i64)")>;
  715. def : InstRW<[R52Write2FPMAC_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "VQDMLAL", "VQDMLSL")>;
  716. def : InstRW<[R52WriteFPMUL_F5, R52Read_F1, R52Read_F1, R52Read_F1], (instregex "VQDMUL","VQRDMUL")>;
  717. def : InstRW<[R52WriteFPALU_F5, R52Read_F1, R52Read_F1],
  718. (instregex "VQMOVN", "VQNEG", "VQSHL", "VQSHRN")>;
  719. def : InstRW<[R52WriteFPALU_F4, R52Read_F1, R52Read_F1], (instregex "VRSHL", "VRSHR", "VRSHRN", "VTB")>;
  720. def : InstRW<[R52WriteFPALU_F3, R52Read_F1, R52Read_F1], (instregex "VSWP", "VTRN", "VUZP", "VZIP")>;
  721. //---
  722. // VSTx. Vector Stores
  723. //---
  724. // 1-element structure store
  725. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST1d(8|16|32|64)$")>;
  726. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST1q(8|16|32|64)$")>;
  727. def : InstRW<[R52WriteVST3Mem, R52Read_ISS, R52Read_F2], (instregex "VST1d(8|16|32|64)T$")>;
  728. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST1d(8|16|32|64)Q$")>;
  729. def : InstRW<[R52WriteVST3Mem, R52Read_ISS, R52Read_F2], (instregex "VST1d64TPseudo$")>;
  730. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST1d64QPseudo$")>;
  731. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST1LNd(8|16|32)$")>;
  732. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST1LNdAsm_(8|16|32)$")>;
  733. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST1LNq(8|16|32)Pseudo$")>;
  734. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1d(8|16|32|64)wb")>;
  735. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1q(8|16|32|64)wb")>;
  736. def : InstRW<[R52WriteVST3Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1d(8|16|32|64)Twb")>;
  737. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1d(8|16|32|64)Qwb")>;
  738. def : InstRW<[R52WriteVST3Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1d64TPseudoWB")>;
  739. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1d64QPseudoWB")>;
  740. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1LNd(8|16|32)_UPD")>;
  741. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1LNdWB_(fixed|register)_Asm_(8|16|32)")>;
  742. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST1LNq(8|16|32)Pseudo_UPD")>;
  743. // 2-element structure store
  744. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST2(d|b)(8|16|32)$")>;
  745. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST2q(8|16|32)$")>;
  746. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST2q(8|16|32)Pseudo$")>;
  747. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST2LNd(8|16|32)$")>;
  748. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST2LNdAsm_(8|16|32)$")>;
  749. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST2LNd(8|16|32)Pseudo$")>;
  750. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST2LNq(16|32)$")>;
  751. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST2LNqAsm_(16|32)$")>;
  752. def : InstRW<[R52WriteVST1Mem, R52Read_ISS, R52Read_F2], (instregex "VST2LNq(16|32)Pseudo$")>;
  753. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2(d|b)(8|16|32)wb")>;
  754. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2q(8|16|32)wb")>;
  755. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2q(8|16|32)PseudoWB")>;
  756. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2LNd(8|16|32)_UPD")>;
  757. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2LNdWB_(fixed|register)_Asm_(8|16|32)")>;
  758. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2LNd(8|16|32)Pseudo_UPD")>;
  759. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2LNq(16|32)_UPD")>;
  760. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2LNqWB_(fixed|register)_Asm_(16|32)")>;
  761. def : InstRW<[R52WriteVST1Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST2LNq(16|32)Pseudo_UPD")>;
  762. // 3-element structure store
  763. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST3(d|q)(8|16|32)$")>;
  764. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST3(d|q)Asm_(8|16|32)$")>;
  765. def : InstRW<[R52WriteVST4Mem, R52Read_ISS, R52Read_F2], (instregex "VST3d(8|16|32)(oddP|P)seudo$")>;
  766. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST3LNd(8|16|32)$")>;
  767. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST3LNdAsm_(8|16|32)$")>;
  768. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST3LNd(8|16|32)Pseudo$")>;
  769. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST3LNq(16|32)$")>;
  770. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST3LNqAsm_(16|32)$")>;
  771. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST3LNq(16|32)Pseudo$")>;
  772. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3(d|q)(8|16|32)_UPD$")>;
  773. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3(d|q)WB_(fixed|register)_Asm_(8|16|32)$")>;
  774. def : InstRW<[R52WriteVST4Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3(d|q)(8|16|32)(oddP|P)seudo_UPD$")>;
  775. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3LNd(8|16|32)_UPD$")>;
  776. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3LNdWB_(fixed|register)_Asm_(8|16|32)")>;
  777. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3LNd(8|16|32)Pseudo_UPD$")>;
  778. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3LNq(16|32)_UPD$")>;
  779. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3LNqWB_(fixed|register)_Asm_(16|32)$")>;
  780. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST3LNq(16|32)Pseudo_UPD$")>;
  781. // 4-element structure store
  782. def : InstRW<[R52WriteVST5Mem, R52Read_ISS, R52Read_F2], (instregex "VST4(d|q)(8|16|32)$")>;
  783. def : InstRW<[R52WriteVST5Mem, R52Read_ISS, R52Read_F2], (instregex "VST4(d|q)Asm_(8|16|32)$")>;
  784. def : InstRW<[R52WriteVST5Mem, R52Read_ISS, R52Read_F2], (instregex "VST4d(8|16|32)Pseudo$")>;
  785. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST4LNd(8|16|32)$")>;
  786. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST4LNdAsm_(8|16|32)$")>;
  787. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST4LNd(8|16|32)Pseudo$")>;
  788. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST4LNq(16|32)$")>;
  789. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST4LNqAsm_(16|32)$")>;
  790. def : InstRW<[R52WriteVST2Mem, R52Read_ISS, R52Read_F2], (instregex "VST4LNq(16|32)Pseudo$")>;
  791. def : InstRW<[R52WriteVST5Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4(d|q)(8|16|32)_UPD")>;
  792. def : InstRW<[R52WriteVST5Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4(d|q)WB_(fixed|register)_Asm_(8|16|32)")>;
  793. def : InstRW<[R52WriteVST5Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4(d|q)(8|16|32)(oddP|P)seudo_UPD")>;
  794. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4LNd(8|16|32)_UPD")>;
  795. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4LNdWB_(fixed|register)_Asm_(8|16|32)")>;
  796. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4LNd(8|16|32)Pseudo_UPD")>;
  797. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4LNq(16|32)_UPD")>;
  798. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4LNqWB_(fixed|register)_Asm_(16|32)")>;
  799. def : InstRW<[R52WriteVST2Mem, R52WriteAdr, R52Read_ISS, R52Read_F2], (instregex "VST4LNq(16|32)Pseudo_UPD")>;
  800. } // R52 SchedModel