AArch64SchedExynosM3.td 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. //=- AArch64SchedExynosM3.td - Samsung Exynos M3 Sched Defs --*- 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 machine model for the Samsung Exynos M3 to support
  10. // instruction scheduling and other instruction cost heuristics.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //===----------------------------------------------------------------------===//
  14. // The Exynos-M3 is an advanced superscalar microprocessor with a 6-wide
  15. // in-order stage for decode and dispatch and a wider issue stage.
  16. // The execution units and loads and stores are out-of-order.
  17. def ExynosM3Model : SchedMachineModel {
  18. let IssueWidth = 6; // Up to 6 uops per cycle.
  19. let MicroOpBufferSize = 228; // ROB size.
  20. let LoopMicroOpBufferSize = 40; // Based on the instruction queue size.
  21. let LoadLatency = 4; // Optimistic load cases.
  22. let MispredictPenalty = 16; // Minimum branch misprediction penalty.
  23. let CompleteModel = 1; // Use the default model otherwise.
  24. list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
  25. PAUnsupported.F,
  26. SMEUnsupported.F);
  27. }
  28. //===----------------------------------------------------------------------===//
  29. // Define each kind of processor resource and number available on the Exynos-M3,
  30. // which has 12 pipelines, each with its own queue with out-of-order dispatch.
  31. let SchedModel = ExynosM3Model in {
  32. def M3UnitA : ProcResource<2>; // Simple integer
  33. def M3UnitC : ProcResource<2>; // Simple and complex integer
  34. def M3UnitD : ProcResource<1>; // Integer division (inside C0, serialized)
  35. def M3UnitB : ProcResource<2>; // Branch
  36. def M3UnitL : ProcResource<2>; // Load
  37. def M3UnitS : ProcResource<1>; // Store
  38. def M3PipeF0 : ProcResource<1>; // FP #0
  39. let Super = M3PipeF0 in {
  40. def M3UnitFMAC0 : ProcResource<1>; // FP multiplication
  41. def M3UnitFADD0 : ProcResource<1>; // Simple FP
  42. def M3UnitFCVT0 : ProcResource<1>; // FP conversion
  43. def M3UnitFSQR : ProcResource<2>; // FP square root (serialized)
  44. def M3UnitNALU0 : ProcResource<1>; // Simple vector
  45. def M3UnitNMSC : ProcResource<1>; // FP and vector miscellanea
  46. def M3UnitNSHT0 : ProcResource<1>; // Vector shifting
  47. def M3UnitNSHF0 : ProcResource<1>; // Vector shuffling
  48. }
  49. def M3PipeF1 : ProcResource<1>; // FP #1
  50. let Super = M3PipeF1 in {
  51. def M3UnitFMAC1 : ProcResource<1>; // FP multiplication
  52. def M3UnitFADD1 : ProcResource<1>; // Simple FP
  53. def M3UnitFDIV0 : ProcResource<2>; // FP division (serialized)
  54. def M3UnitFCVT1 : ProcResource<1>; // FP conversion
  55. def M3UnitFST0 : ProcResource<1>; // FP store
  56. def M3UnitNALU1 : ProcResource<1>; // Simple vector
  57. def M3UnitNCRY0 : ProcResource<1>; // Cryptographic
  58. def M3UnitNMUL : ProcResource<1>; // Vector multiplication
  59. def M3UnitNSHT1 : ProcResource<1>; // Vector shifting
  60. def M3UnitNSHF1 : ProcResource<1>; // Vector shuffling
  61. }
  62. def M3PipeF2 : ProcResource<1>; // FP #2
  63. let Super = M3PipeF2 in {
  64. def M3UnitFMAC2 : ProcResource<1>; // FP multiplication
  65. def M3UnitFADD2 : ProcResource<1>; // Simple FP
  66. def M3UnitFDIV1 : ProcResource<2>; // FP division (serialized)
  67. def M3UnitFST1 : ProcResource<1>; // FP store
  68. def M3UnitNALU2 : ProcResource<1>; // Simple vector
  69. def M3UnitNCRY1 : ProcResource<1>; // Cryptographic
  70. def M3UnitNSHT2 : ProcResource<1>; // Vector shifting
  71. def M3UnitNSHF2 : ProcResource<1>; // Vector shuffling
  72. }
  73. def M3UnitALU : ProcResGroup<[M3UnitA,
  74. M3UnitC]>;
  75. def M3UnitFMAC : ProcResGroup<[M3UnitFMAC0,
  76. M3UnitFMAC1,
  77. M3UnitFMAC2]>;
  78. def M3UnitFADD : ProcResGroup<[M3UnitFADD0,
  79. M3UnitFADD1,
  80. M3UnitFADD2]>;
  81. def M3UnitFDIV : ProcResGroup<[M3UnitFDIV0,
  82. M3UnitFDIV1]>;
  83. def M3UnitFCVT : ProcResGroup<[M3UnitFCVT0,
  84. M3UnitFCVT1]>;
  85. def M3UnitFST : ProcResGroup<[M3UnitFST0,
  86. M3UnitFST1]>;
  87. def M3UnitNALU : ProcResGroup<[M3UnitNALU0,
  88. M3UnitNALU1,
  89. M3UnitNALU2]>;
  90. def M3UnitNCRY : ProcResGroup<[M3UnitNCRY0,
  91. M3UnitNCRY1]>;
  92. def M3UnitNSHT : ProcResGroup<[M3UnitNSHT0,
  93. M3UnitNSHT1,
  94. M3UnitNSHT2]>;
  95. def M3UnitNSHF : ProcResGroup<[M3UnitNSHF0,
  96. M3UnitNSHF1,
  97. M3UnitNSHF2]>;
  98. //===----------------------------------------------------------------------===//
  99. // Coarse scheduling model.
  100. def M3WriteZ0 : SchedWriteRes<[]> { let Latency = 0;
  101. let NumMicroOps = 1; }
  102. def M3WriteZ1 : SchedWriteRes<[]> { let Latency = 1;
  103. let NumMicroOps = 0; }
  104. def M3WriteA1 : SchedWriteRes<[M3UnitALU]> { let Latency = 1; }
  105. def M3WriteAA : SchedWriteRes<[M3UnitALU]> { let Latency = 2;
  106. let ResourceCycles = [2]; }
  107. def M3WriteAB : SchedWriteRes<[M3UnitALU,
  108. M3UnitC]> { let Latency = 1;
  109. let NumMicroOps = 2; }
  110. def M3WriteAC : SchedWriteRes<[M3UnitALU,
  111. M3UnitALU,
  112. M3UnitC]> { let Latency = 2;
  113. let NumMicroOps = 3; }
  114. def M3WriteAD : SchedWriteRes<[M3UnitALU,
  115. M3UnitC]> { let Latency = 2;
  116. let NumMicroOps = 2; }
  117. def M3WriteC1 : SchedWriteRes<[M3UnitC]> { let Latency = 1; }
  118. def M3WriteC2 : SchedWriteRes<[M3UnitC]> { let Latency = 2; }
  119. def M3WriteAU : SchedWriteVariant<[SchedVar<IsCopyIdiomPred, [M3WriteZ0]>,
  120. SchedVar<ExynosArithPred, [M3WriteA1]>,
  121. SchedVar<ExynosLogicPred, [M3WriteA1]>,
  122. SchedVar<NoSchedPred, [M3WriteAA]>]>;
  123. def M3WriteAV : SchedWriteVariant<[SchedVar<IsCopyIdiomPred, [M3WriteZ0]>,
  124. SchedVar<ExynosArithPred, [M3WriteA1]>,
  125. SchedVar<NoSchedPred, [M3WriteAA]>]>;
  126. def M3WriteAW : SchedWriteVariant<[SchedVar<IsZeroIdiomPred, [M3WriteZ0]>,
  127. SchedVar<ExynosLogicPred, [M3WriteA1]>,
  128. SchedVar<NoSchedPred, [M3WriteAA]>]>;
  129. def M3WriteAX : SchedWriteVariant<[SchedVar<ExynosArithPred, [M3WriteA1]>,
  130. SchedVar<ExynosLogicPred, [M3WriteA1]>,
  131. SchedVar<NoSchedPred, [M3WriteAA]>]>;
  132. def M3WriteAY : SchedWriteVariant<[SchedVar<ExynosRotateRightImmPred, [M3WriteA1]>,
  133. SchedVar<NoSchedPred, [M3WriteAA]>]>;
  134. def M3WriteB1 : SchedWriteRes<[M3UnitB]> { let Latency = 1; }
  135. def M3WriteBX : SchedWriteVariant<[SchedVar<ExynosBranchLinkLRPred, [M3WriteAC]>,
  136. SchedVar<NoSchedPred, [M3WriteAB]>]>;
  137. def M3WriteL4 : SchedWriteRes<[M3UnitL]> { let Latency = 4; }
  138. def M3WriteL5 : SchedWriteRes<[M3UnitL]> { let Latency = 5; }
  139. def M3WriteLA : SchedWriteRes<[M3UnitL,
  140. M3UnitL]> { let Latency = 5;
  141. let NumMicroOps = 1; }
  142. def M3WriteLB : SchedWriteRes<[M3UnitA,
  143. M3UnitL]> { let Latency = 5;
  144. let NumMicroOps = 2; }
  145. def M3WriteLC : SchedWriteRes<[M3UnitA,
  146. M3UnitL,
  147. M3UnitL]> { let Latency = 5;
  148. let NumMicroOps = 2; }
  149. def M3WriteLD : SchedWriteRes<[M3UnitA,
  150. M3UnitL]> { let Latency = 4;
  151. let NumMicroOps = 2; }
  152. def M3WriteLE : SchedWriteRes<[M3UnitA,
  153. M3UnitL]> { let Latency = 6;
  154. let NumMicroOps = 2; }
  155. def M3WriteLH : SchedWriteRes<[]> { let Latency = 5;
  156. let NumMicroOps = 0; }
  157. def M3WriteLX : SchedWriteVariant<[SchedVar<ExynosScaledIdxPred, [M3WriteL5]>,
  158. SchedVar<NoSchedPred, [M3WriteL4]>]>;
  159. def M3WriteLY : SchedWriteVariant<[SchedVar<ExynosScaledIdxPred, [M3WriteLE]>,
  160. SchedVar<NoSchedPred, [M3WriteL5]>]>;
  161. def M3WriteS1 : SchedWriteRes<[M3UnitS]> { let Latency = 1; }
  162. def M3WriteSA : SchedWriteRes<[M3UnitA,
  163. M3UnitS,
  164. M3UnitFST]> { let Latency = 3;
  165. let NumMicroOps = 2; }
  166. def M3WriteSB : SchedWriteRes<[M3UnitA,
  167. M3UnitS]> { let Latency = 2;
  168. let NumMicroOps = 2; }
  169. def M3WriteSC : SchedWriteRes<[M3UnitA,
  170. M3UnitS,
  171. M3UnitFST]> { let Latency = 1;
  172. let NumMicroOps = 2; }
  173. def M3WriteSY : SchedWriteVariant<[SchedVar<ExynosScaledIdxPred, [M3WriteSA]>,
  174. SchedVar<NoSchedPred, [WriteVST]>]>;
  175. def M3ReadAdrBase : SchedReadVariant<[SchedVar<ExynosScaledIdxPred, [ReadDefault]>,
  176. SchedVar<NoSchedPred, [ReadDefault]>]>;
  177. // Branch instructions.
  178. def : SchedAlias<WriteBr, M3WriteZ0>;
  179. def : SchedAlias<WriteBrReg, M3WriteC1>;
  180. // Arithmetic and logical integer instructions.
  181. def : SchedAlias<WriteI, M3WriteA1>;
  182. def : SchedAlias<WriteISReg, M3WriteA1>;
  183. def : SchedAlias<WriteIEReg, M3WriteA1>;
  184. def : SchedAlias<WriteIS, M3WriteA1>;
  185. // Move instructions.
  186. def : SchedAlias<WriteImm, M3WriteA1>;
  187. // Divide and multiply instructions.
  188. def : WriteRes<WriteID32, [M3UnitC,
  189. M3UnitD]> { let Latency = 12;
  190. let ResourceCycles = [1, 12]; }
  191. def : WriteRes<WriteID64, [M3UnitC,
  192. M3UnitD]> { let Latency = 21;
  193. let ResourceCycles = [1, 21]; }
  194. def : WriteRes<WriteIM32, [M3UnitC]> { let Latency = 3; }
  195. def : WriteRes<WriteIM64, [M3UnitC]> { let Latency = 4;
  196. let ResourceCycles = [2]; }
  197. // Miscellaneous instructions.
  198. def : SchedAlias<WriteExtr, M3WriteAY>;
  199. // Addressing modes.
  200. def : SchedAlias<WriteAdr, M3WriteZ1>;
  201. def : SchedAlias<ReadAdrBase, M3ReadAdrBase>;
  202. // Load instructions.
  203. def : SchedAlias<WriteLD, M3WriteL4>;
  204. def : WriteRes<WriteLDHi, []> { let Latency = 4;
  205. let NumMicroOps = 0; }
  206. def : SchedAlias<WriteLDIdx, M3WriteLB>;
  207. // Store instructions.
  208. def : SchedAlias<WriteST, M3WriteS1>;
  209. def : SchedAlias<WriteSTP, M3WriteS1>;
  210. def : SchedAlias<WriteSTX, M3WriteS1>;
  211. def : SchedAlias<WriteSTIdx, M3WriteSB>;
  212. // FP data instructions.
  213. def : WriteRes<WriteF, [M3UnitFADD]> { let Latency = 2; }
  214. def : WriteRes<WriteFCmp, [M3UnitNMSC]> { let Latency = 2; }
  215. def : WriteRes<WriteFDiv, [M3UnitFDIV]> { let Latency = 12;
  216. let ResourceCycles = [12]; }
  217. def : WriteRes<WriteFMul, [M3UnitFMAC]> { let Latency = 4; }
  218. // FP miscellaneous instructions.
  219. def : WriteRes<WriteFCvt, [M3UnitFCVT]> { let Latency = 3; }
  220. def : WriteRes<WriteFImm, [M3UnitNALU]> { let Latency = 1; }
  221. def : WriteRes<WriteFCopy, [M3UnitNALU]> { let Latency = 1; }
  222. // FP load instructions.
  223. def : SchedAlias<WriteVLD, M3WriteL5>;
  224. // FP store instructions.
  225. def : WriteRes<WriteVST, [M3UnitS,
  226. M3UnitFST]> { let Latency = 1;
  227. let NumMicroOps = 1; }
  228. // ASIMD FP instructions.
  229. def : WriteRes<WriteVd, [M3UnitNALU]> { let Latency = 3; }
  230. def : WriteRes<WriteVq, [M3UnitNALU]> { let Latency = 3; }
  231. // Other miscellaneous instructions.
  232. def : WriteRes<WriteAtomic, []> { let Unsupported = 1; }
  233. def : WriteRes<WriteBarrier, []> { let Latency = 1; }
  234. def : WriteRes<WriteHint, []> { let Latency = 1; }
  235. def : WriteRes<WriteSys, []> { let Latency = 1; }
  236. //===----------------------------------------------------------------------===//
  237. // Generic fast forwarding.
  238. // TODO: Add FP register forwarding rules.
  239. def : ReadAdvance<ReadI, 0>;
  240. def : ReadAdvance<ReadISReg, 0>;
  241. def : ReadAdvance<ReadIEReg, 0>;
  242. def : ReadAdvance<ReadIM, 0>;
  243. // TODO: The forwarding for 32 bits actually saves 2 cycles.
  244. def : ReadAdvance<ReadIMA, 3, [WriteIM32, WriteIM64]>;
  245. def : ReadAdvance<ReadID, 0>;
  246. def : ReadAdvance<ReadExtrHi, 0>;
  247. def : ReadAdvance<ReadAdrBase, 0>;
  248. def : ReadAdvance<ReadVLD, 0>;
  249. def : ReadAdvance<ReadST, 0>;
  250. //===----------------------------------------------------------------------===//
  251. // Finer scheduling model.
  252. def M3WriteNEONA : SchedWriteRes<[M3UnitNSHF,
  253. M3UnitFADD]> { let Latency = 3;
  254. let NumMicroOps = 2; }
  255. def M3WriteNEONB : SchedWriteRes<[M3UnitNALU,
  256. M3UnitFST]> { let Latency = 10;
  257. let NumMicroOps = 2; }
  258. def M3WriteNEOND : SchedWriteRes<[M3UnitNSHF,
  259. M3UnitFST]> { let Latency = 6;
  260. let NumMicroOps = 2; }
  261. def M3WriteNEONH : SchedWriteRes<[M3UnitNALU,
  262. M3UnitS]> { let Latency = 5;
  263. let NumMicroOps = 2; }
  264. def M3WriteNEONI : SchedWriteRes<[M3UnitNSHF,
  265. M3UnitS]> { let Latency = 5;
  266. let NumMicroOps = 2; }
  267. def M3WriteNEONV : SchedWriteRes<[M3UnitFDIV0,
  268. M3UnitFDIV1]> { let Latency = 7;
  269. let NumMicroOps = 2;
  270. let ResourceCycles = [8, 8]; }
  271. def M3WriteNEONW : SchedWriteRes<[M3UnitFDIV0,
  272. M3UnitFDIV1]> { let Latency = 12;
  273. let NumMicroOps = 2;
  274. let ResourceCycles = [13, 13]; }
  275. def M3WriteNEONX : SchedWriteRes<[M3UnitFSQR,
  276. M3UnitFSQR]> { let Latency = 18;
  277. let NumMicroOps = 2;
  278. let ResourceCycles = [19, 19]; }
  279. def M3WriteNEONY : SchedWriteRes<[M3UnitFSQR,
  280. M3UnitFSQR]> { let Latency = 25;
  281. let NumMicroOps = 2;
  282. let ResourceCycles = [26, 26]; }
  283. def M3WriteNEONZ : SchedWriteRes<[M3UnitNMSC,
  284. M3UnitNMSC]> { let Latency = 5;
  285. let NumMicroOps = 2; }
  286. def M3WriteFADD2 : SchedWriteRes<[M3UnitFADD]> { let Latency = 2; }
  287. def M3WriteFCVT2 : SchedWriteRes<[M3UnitFCVT]> { let Latency = 2; }
  288. def M3WriteFCVT3 : SchedWriteRes<[M3UnitFCVT]> { let Latency = 3; }
  289. def M3WriteFCVT3A : SchedWriteRes<[M3UnitFCVT0]> { let Latency = 3; }
  290. def M3WriteFCVT4A : SchedWriteRes<[M3UnitFCVT0]> { let Latency = 4; }
  291. def M3WriteFCVT4 : SchedWriteRes<[M3UnitFCVT]> { let Latency = 4; }
  292. def M3WriteFDIV10 : SchedWriteRes<[M3UnitFDIV]> { let Latency = 7;
  293. let ResourceCycles = [8]; }
  294. def M3WriteFDIV12 : SchedWriteRes<[M3UnitFDIV]> { let Latency = 12;
  295. let ResourceCycles = [13]; }
  296. def M3WriteFMAC3 : SchedWriteRes<[M3UnitFMAC]> { let Latency = 3; }
  297. def M3WriteFMAC4 : SchedWriteRes<[M3UnitFMAC]> { let Latency = 4; }
  298. def M3WriteFMAC5 : SchedWriteRes<[M3UnitFMAC]> { let Latency = 5; }
  299. def M3WriteFSQR17 : SchedWriteRes<[M3UnitFSQR]> { let Latency = 18;
  300. let ResourceCycles = [19]; }
  301. def M3WriteFSQR25 : SchedWriteRes<[M3UnitFSQR]> { let Latency = 25;
  302. let ResourceCycles = [26]; }
  303. def M3WriteNALU1 : SchedWriteRes<[M3UnitNALU]> { let Latency = 1; }
  304. def M3WriteNCRY1A : SchedWriteRes<[M3UnitNCRY0]> { let Latency = 1; }
  305. def M3WriteNCRY3A : SchedWriteRes<[M3UnitNCRY0]> { let Latency = 3; }
  306. def M3WriteNCRY5A : SchedWriteRes<[M3UnitNCRY]> { let Latency = 5; }
  307. def M3WriteNMSC1 : SchedWriteRes<[M3UnitNMSC]> { let Latency = 1; }
  308. def M3WriteNMSC2 : SchedWriteRes<[M3UnitNMSC]> { let Latency = 2; }
  309. def M3WriteNMSC3 : SchedWriteRes<[M3UnitNMSC]> { let Latency = 3; }
  310. def M3WriteNMUL3 : SchedWriteRes<[M3UnitNMUL]> { let Latency = 3; }
  311. def M3WriteNSHF1 : SchedWriteRes<[M3UnitNSHF]> { let Latency = 1; }
  312. def M3WriteNSHF3 : SchedWriteRes<[M3UnitNSHF]> { let Latency = 3; }
  313. def M3WriteNSHT1 : SchedWriteRes<[M3UnitNSHT]> { let Latency = 1; }
  314. def M3WriteNSHT2 : SchedWriteRes<[M3UnitNSHT]> { let Latency = 2; }
  315. def M3WriteNSHT3 : SchedWriteRes<[M3UnitNSHT]> { let Latency = 3; }
  316. def M3WriteVLDA : SchedWriteRes<[M3UnitL,
  317. M3UnitL]> { let Latency = 5;
  318. let NumMicroOps = 2; }
  319. def M3WriteVLDB : SchedWriteRes<[M3UnitL,
  320. M3UnitL,
  321. M3UnitL]> { let Latency = 6;
  322. let NumMicroOps = 3; }
  323. def M3WriteVLDC : SchedWriteRes<[M3UnitL,
  324. M3UnitL,
  325. M3UnitL,
  326. M3UnitL]> { let Latency = 6;
  327. let NumMicroOps = 4; }
  328. def M3WriteVLDD : SchedWriteRes<[M3UnitL,
  329. M3UnitNALU]> { let Latency = 7;
  330. let NumMicroOps = 2;
  331. let ResourceCycles = [2, 1]; }
  332. def M3WriteVLDE : SchedWriteRes<[M3UnitL,
  333. M3UnitNALU]> { let Latency = 6;
  334. let NumMicroOps = 2;
  335. let ResourceCycles = [2, 1]; }
  336. def M3WriteVLDF : SchedWriteRes<[M3UnitL,
  337. M3UnitL]> { let Latency = 10;
  338. let NumMicroOps = 2;
  339. let ResourceCycles = [5, 5]; }
  340. def M3WriteVLDG : SchedWriteRes<[M3UnitL,
  341. M3UnitNALU,
  342. M3UnitNALU]> { let Latency = 7;
  343. let NumMicroOps = 3;
  344. let ResourceCycles = [2, 1, 1]; }
  345. def M3WriteVLDH : SchedWriteRes<[M3UnitL,
  346. M3UnitNALU,
  347. M3UnitNALU]> { let Latency = 6;
  348. let NumMicroOps = 3;
  349. let ResourceCycles = [2, 1, 1]; }
  350. def M3WriteVLDI : SchedWriteRes<[M3UnitL,
  351. M3UnitL,
  352. M3UnitL]> { let Latency = 12;
  353. let NumMicroOps = 3;
  354. let ResourceCycles = [6, 6, 6]; }
  355. def M3WriteVLDJ : SchedWriteRes<[M3UnitL,
  356. M3UnitNALU,
  357. M3UnitNALU,
  358. M3UnitNALU]> { let Latency = 7;
  359. let NumMicroOps = 4;
  360. let ResourceCycles = [2, 1, 1, 1]; }
  361. def M3WriteVLDK : SchedWriteRes<[M3UnitL,
  362. M3UnitNALU,
  363. M3UnitNALU,
  364. M3UnitNALU,
  365. M3UnitNALU]> { let Latency = 9;
  366. let NumMicroOps = 5;
  367. let ResourceCycles = [4, 1, 1, 1, 1]; }
  368. def M3WriteVLDL : SchedWriteRes<[M3UnitL,
  369. M3UnitNALU,
  370. M3UnitNALU,
  371. M3UnitL,
  372. M3UnitNALU]> { let Latency = 6;
  373. let NumMicroOps = 5;
  374. let ResourceCycles = [6, 1, 1, 6, 1]; }
  375. def M3WriteVLDM : SchedWriteRes<[M3UnitL,
  376. M3UnitNALU,
  377. M3UnitNALU,
  378. M3UnitL,
  379. M3UnitNALU,
  380. M3UnitNALU]> { let Latency = 7;
  381. let NumMicroOps = 6;
  382. let ResourceCycles = [6, 1, 1, 6, 1, 1]; }
  383. def M3WriteVLDN : SchedWriteRes<[M3UnitL,
  384. M3UnitL,
  385. M3UnitL,
  386. M3UnitL]> { let Latency = 14;
  387. let NumMicroOps = 4;
  388. let ResourceCycles = [6, 6, 6, 6]; }
  389. def M3WriteVSTA : WriteSequence<[WriteVST], 2>;
  390. def M3WriteVSTB : WriteSequence<[WriteVST], 3>;
  391. def M3WriteVSTC : WriteSequence<[WriteVST], 4>;
  392. def M3WriteVSTD : SchedWriteRes<[M3UnitS,
  393. M3UnitFST,
  394. M3UnitS,
  395. M3UnitFST]> { let Latency = 7;
  396. let NumMicroOps = 4;
  397. let ResourceCycles = [1, 3, 1, 3]; }
  398. def M3WriteVSTE : SchedWriteRes<[M3UnitS,
  399. M3UnitFST,
  400. M3UnitS,
  401. M3UnitFST,
  402. M3UnitS,
  403. M3UnitFST]> { let Latency = 8;
  404. let NumMicroOps = 6;
  405. let ResourceCycles = [1, 3, 1, 3, 1, 3]; }
  406. def M3WriteVSTF : SchedWriteRes<[M3UnitNALU,
  407. M3UnitFST,
  408. M3UnitFST,
  409. M3UnitS,
  410. M3UnitFST,
  411. M3UnitS,
  412. M3UnitFST]> { let Latency = 15;
  413. let NumMicroOps = 7;
  414. let ResourceCycles = [1, 3, 3, 1, 3, 1, 3]; }
  415. def M3WriteVSTG : SchedWriteRes<[M3UnitNALU,
  416. M3UnitFST,
  417. M3UnitFST,
  418. M3UnitS,
  419. M3UnitFST,
  420. M3UnitS,
  421. M3UnitFST,
  422. M3UnitS,
  423. M3UnitFST]> { let Latency = 16;
  424. let NumMicroOps = 9;
  425. let ResourceCycles = [1, 3, 3, 1, 3, 1, 3, 1, 3]; }
  426. def M3WriteVSTH : SchedWriteRes<[M3UnitNALU,
  427. M3UnitFST,
  428. M3UnitFST,
  429. M3UnitS,
  430. M3UnitFST]> { let Latency = 14;
  431. let NumMicroOps = 5;
  432. let ResourceCycles = [1, 3, 3, 1, 3]; }
  433. def M3WriteVSTI : SchedWriteRes<[M3UnitNALU,
  434. M3UnitFST,
  435. M3UnitFST,
  436. M3UnitS,
  437. M3UnitFST,
  438. M3UnitS,
  439. M3UnitFST,
  440. M3UnitS,
  441. M3UnitFST]> { let Latency = 17;
  442. let NumMicroOps = 9;
  443. let ResourceCycles = [1, 3, 3, 1, 3, 1, 3, 1, 3]; }
  444. // Special cases.
  445. def M3WriteAES : SchedWriteRes<[M3UnitNCRY]> { let Latency = 1; }
  446. def M3WriteCOPY : SchedWriteVariant<[SchedVar<ExynosFPPred, [M3WriteNALU1]>,
  447. SchedVar<NoSchedPred, [M3WriteZ0]>]>;
  448. def M3WriteMOVI : SchedWriteVariant<[SchedVar<IsZeroFPIdiomPred, [M3WriteZ0]>,
  449. SchedVar<NoSchedPred, [M3WriteNALU1]>]>;
  450. // Fast forwarding.
  451. def M3ReadAES : SchedReadAdvance<1, [M3WriteAES]>;
  452. def M3ReadFMAC : SchedReadAdvance<1, [M3WriteFMAC4,
  453. M3WriteFMAC5]>;
  454. def M3ReadNMUL : SchedReadAdvance<1, [M3WriteNMUL3]>;
  455. // Branch instructions
  456. def : InstRW<[M3WriteB1], (instrs Bcc)>;
  457. def : InstRW<[M3WriteA1], (instrs BL)>;
  458. def : InstRW<[M3WriteBX], (instrs BLR)>;
  459. def : InstRW<[M3WriteC1], (instregex "^CBN?Z[WX]")>;
  460. def : InstRW<[M3WriteAD], (instregex "^TBN?Z[WX]")>;
  461. // Arithmetic and logical integer instructions.
  462. def : InstRW<[M3WriteAX], (instregex "^(ADD|AND|BIC|EON|EOR|ORN|SUB)[WX]rs$")>;
  463. def : InstRW<[M3WriteAU], (instrs ORRWrs, ORRXrs)>;
  464. def : InstRW<[M3WriteAX], (instregex "^(ADD|SUB)S?[WX]rx(64)?$")>;
  465. def : InstRW<[M3WriteAX], (instregex "^(ADD|AND|BIC|SUB)S[WX]rs$")>;
  466. def : InstRW<[M3WriteAV], (instrs ADDWri, ADDXri)>;
  467. def : InstRW<[M3WriteAW], (instrs ORRWri, ORRXri)>;
  468. // Move instructions.
  469. def : InstRW<[M3WriteCOPY], (instrs COPY)>;
  470. def : InstRW<[M3WriteZ0], (instrs ADR, ADRP)>;
  471. def : InstRW<[M3WriteZ0], (instregex "^MOV[NZ][WX]i")>;
  472. // Divide and multiply instructions.
  473. // Miscellaneous instructions.
  474. // Load instructions.
  475. def : InstRW<[M3WriteLD,
  476. WriteLDHi,
  477. WriteAdr], (instregex "^LDP(SW|W|X)(post|pre)")>;
  478. def : InstRW<[M3WriteLB,
  479. ReadAdrBase], (instregex "^LDR(BB|SBW|SBX|HH|SHW|SHX|SW|W|X)roW")>;
  480. def : InstRW<[M3WriteLX,
  481. ReadAdrBase], (instregex "^LDR(BB|SBW|SBX|HH|SHW|SHX|SW|W|X)roX")>;
  482. def : InstRW<[M3WriteLB,
  483. ReadAdrBase], (instrs PRFMroW)>;
  484. def : InstRW<[M3WriteLX,
  485. ReadAdrBase], (instrs PRFMroX)>;
  486. // Store instructions.
  487. def : InstRW<[M3WriteSB,
  488. ReadAdrBase], (instregex "^STR(BB|HH|W|X)roW")>;
  489. def : InstRW<[WriteST,
  490. ReadAdrBase], (instregex "^STR(BB|HH|W|X)roX")>;
  491. // FP data instructions.
  492. def : InstRW<[M3WriteNSHF1], (instregex "^FABS[DS]r")>;
  493. def : InstRW<[M3WriteFADD2], (instregex "^F(ADD|SUB)[DS]rr")>;
  494. def : InstRW<[M3WriteFDIV10], (instrs FDIVSrr)>;
  495. def : InstRW<[M3WriteFDIV12], (instrs FDIVDrr)>;
  496. def : InstRW<[M3WriteNMSC1], (instregex "^F(MAX|MIN).+rr")>;
  497. def : InstRW<[M3WriteFMAC3], (instregex "^FN?MUL[DS]rr")>;
  498. def : InstRW<[M3WriteFMAC4,
  499. M3ReadFMAC], (instregex "^FN?M(ADD|SUB)[DS]rrr")>;
  500. def : InstRW<[M3WriteNALU1], (instregex "^FNEG[DS]r")>;
  501. def : InstRW<[M3WriteFCVT3A], (instregex "^FRINT.+r")>;
  502. def : InstRW<[M3WriteNEONH], (instregex "^FCSEL[DS]rrr")>;
  503. def : InstRW<[M3WriteFSQR17], (instrs FSQRTSr)>;
  504. def : InstRW<[M3WriteFSQR25], (instrs FSQRTDr)>;
  505. // FP miscellaneous instructions.
  506. def : InstRW<[M3WriteFCVT3], (instregex "^FCVT[DHS][DHS]r")>;
  507. def : InstRW<[M3WriteFCVT4A], (instregex "^[SU]CVTF[SU][XW][DHS]ri")>;
  508. def : InstRW<[M3WriteFCVT3A], (instregex "^FCVT[AMNPZ][SU]U[XW][DHS]r")>;
  509. def : InstRW<[M3WriteFCVT3A], (instregex "^FCVTZ[SU][dhs]")>;
  510. def : InstRW<[M3WriteNALU1], (instregex "^FMOV[DS][ir]")>;
  511. def : InstRW<[M3WriteFCVT4], (instregex "^[FU](RECP|RSQRT)Ev1")>;
  512. def : InstRW<[M3WriteNMSC1], (instregex "^FRECPXv1")>;
  513. def : InstRW<[M3WriteFMAC4,
  514. M3ReadFMAC], (instregex "^F(RECP|RSQRT)S(16|32|64)")>;
  515. def : InstRW<[M3WriteNALU1], (instregex "^FMOV[WX][DS]r")>;
  516. def : InstRW<[M3WriteNALU1], (instregex "^FMOV[DS][WX]r")>;
  517. def : InstRW<[M3WriteNEONI], (instregex "^FMOV(DX|XD)Highr")>;
  518. // FP load instructions.
  519. def : InstRW<[WriteVLD], (instregex "^LDR[DSQ]l")>;
  520. def : InstRW<[WriteVLD], (instregex "^LDUR[BDHSQ]i")>;
  521. def : InstRW<[WriteVLD,
  522. WriteAdr], (instregex "^LDR[BDHSQ](post|pre)")>;
  523. def : InstRW<[WriteVLD], (instregex "^LDR[BDHSQ]ui")>;
  524. def : InstRW<[M3WriteLE,
  525. ReadAdrBase], (instregex "^LDR[BDHS]roW")>;
  526. def : InstRW<[WriteVLD,
  527. ReadAdrBase], (instregex "^LDR[BDHS]roX")>;
  528. def : InstRW<[M3WriteLY,
  529. ReadAdrBase], (instregex "^LDRQro[WX]")>;
  530. def : InstRW<[WriteVLD,
  531. M3WriteLH], (instregex "^LDN?P[DS]i")>;
  532. def : InstRW<[M3WriteLA,
  533. M3WriteLH], (instregex "^LDN?PQi")>;
  534. def : InstRW<[M3WriteLB,
  535. M3WriteLH,
  536. WriteAdr], (instregex "^LDP[DS](post|pre)")>;
  537. def : InstRW<[M3WriteLC,
  538. M3WriteLH,
  539. WriteAdr], (instregex "^LDPQ(post|pre)")>;
  540. // FP store instructions.
  541. def : InstRW<[WriteVST], (instregex "^STUR[BDHSQ]i")>;
  542. def : InstRW<[WriteVST,
  543. WriteAdr], (instregex "^STR[BDHSQ](post|pre)")>;
  544. def : InstRW<[WriteVST], (instregex "^STR[BDHSQ]ui")>;
  545. def : InstRW<[M3WriteSA,
  546. ReadAdrBase], (instregex "^STR[BDHS]roW")>;
  547. def : InstRW<[M3WriteSA,
  548. ReadAdrBase], (instregex "^STRQroW")>;
  549. def : InstRW<[WriteVST,
  550. ReadAdrBase], (instregex "^STR[BDHS]roX")>;
  551. def : InstRW<[M3WriteSY,
  552. ReadAdrBase], (instregex "^STRQroX")>;
  553. def : InstRW<[WriteVST], (instregex "^STN?P[DSQ]i")>;
  554. def : InstRW<[WriteVST,
  555. WriteAdr], (instregex "^STP[DS](post|pre)")>;
  556. def : InstRW<[M3WriteSC,
  557. WriteAdr], (instregex "^STPQ(post|pre)")>;
  558. // ASIMD instructions.
  559. def : InstRW<[M3WriteNMSC3], (instregex "^[SU]ABAL?v")>;
  560. def : InstRW<[M3WriteNMSC1], (instregex "^[SU]ABDL?v")>;
  561. def : InstRW<[M3WriteNMSC1], (instregex "^((SQ)?ABS|SQNEG)v")>;
  562. def : InstRW<[M3WriteNALU1], (instregex "^(ADD|NEG|SUB)v")>;
  563. def : InstRW<[M3WriteNMSC3], (instregex "^[SU]?ADDL?Pv")>;
  564. def : InstRW<[M3WriteNMSC3], (instregex "^[SU]H(ADD|SUB)v")>;
  565. def : InstRW<[M3WriteNMSC3], (instregex "^[SU](ADD|SUB)[LW]V?v")>;
  566. def : InstRW<[M3WriteNMSC3], (instregex "^R?(ADD|SUB)HN2?v")>;
  567. def : InstRW<[M3WriteNMSC3], (instregex "^[SU]Q(ADD|SUB)v")>;
  568. def : InstRW<[M3WriteNMSC3], (instregex "^(SU|US)QADDv")>;
  569. def : InstRW<[M3WriteNMSC3], (instregex "^[SU]RHADDv")>;
  570. def : InstRW<[M3WriteNMSC1], (instregex "^CM(EQ|GE|GT|HI|HS|LE|LT)v")>;
  571. def : InstRW<[M3WriteNALU1], (instregex "^CMTSTv")>;
  572. def : InstRW<[M3WriteNALU1], (instregex "^(AND|BIC|EOR|MVNI|NOT|ORN|ORR)v")>;
  573. def : InstRW<[M3WriteNMSC1], (instregex "^[SU](MIN|MAX)v")>;
  574. def : InstRW<[M3WriteNMSC2], (instregex "^[SU](MIN|MAX)Pv")>;
  575. def : InstRW<[M3WriteNMSC3], (instregex "^[SU](MIN|MAX)Vv")>;
  576. def : InstRW<[M3WriteNMUL3], (instregex "^(MUL|SQR?DMULH)v")>;
  577. def : InstRW<[M3WriteNMUL3,
  578. M3ReadNMUL], (instregex "^ML[AS]v")>;
  579. def : InstRW<[M3WriteNMUL3], (instregex "^[SU]ML[AS]Lv")>;
  580. def : InstRW<[M3WriteNMUL3], (instregex "^SQDML[AS]L")>;
  581. def : InstRW<[M3WriteNMUL3], (instregex "^(S|U|SQD)MULLv")>;
  582. def : InstRW<[M3WriteNMSC3], (instregex "^[SU]ADALPv")>;
  583. def : InstRW<[M3WriteNSHT3], (instregex "^[SU]R?SRAv")>;
  584. def : InstRW<[M3WriteNSHT1], (instregex "^SHL[dv]")>;
  585. def : InstRW<[M3WriteNSHT1], (instregex "^[SU]SH[LR][dv]")>;
  586. def : InstRW<[M3WriteNSHT1], (instregex "^S[RS]I[dv]")>;
  587. def : InstRW<[M3WriteNSHT2], (instregex "^[SU]?SHLLv")>;
  588. def : InstRW<[M3WriteNSHT3], (instregex "^(([SU]Q)?R)?SHRU?N[bhsv]")>;
  589. def : InstRW<[M3WriteNSHT3], (instregex "^[SU]RSH[LR][dv]")>;
  590. def : InstRW<[M3WriteNSHT3], (instregex "^[SU]QR?SHLU?[bdhsv]")>;
  591. // ASIMD FP instructions.
  592. def : InstRW<[M3WriteNSHF1], (instregex "^FABSv")>;
  593. def : InstRW<[M3WriteFADD2], (instregex "^F(ABD|ADD|SUB)v")>;
  594. def : InstRW<[M3WriteNEONA], (instregex "^FADDP")>;
  595. def : InstRW<[M3WriteNMSC1], (instregex "^F(AC|CM)(EQ|GE|GT|LE|LT)v[^1]")>;
  596. def : InstRW<[M3WriteFCVT3], (instregex "^FCVT(L|N|XN)v")>;
  597. def : InstRW<[M3WriteFCVT2], (instregex "^FCVT[AMNPZ][SU]v")>;
  598. def : InstRW<[M3WriteFCVT2], (instregex "^[SU]CVTFv")>;
  599. def : InstRW<[M3WriteFDIV10], (instrs FDIVv2f32)>;
  600. def : InstRW<[M3WriteNEONV], (instrs FDIVv4f32)>;
  601. def : InstRW<[M3WriteNEONW], (instrs FDIVv2f64)>;
  602. def : InstRW<[M3WriteNMSC1], (instregex "^F(MAX|MIN)(NM)?v")>;
  603. def : InstRW<[M3WriteNMSC2], (instregex "^F(MAX|MIN)(NM)?Pv")>;
  604. def : InstRW<[M3WriteNEONZ], (instregex "^F(MAX|MIN)(NM)?Vv")>;
  605. def : InstRW<[M3WriteFMAC3], (instregex "^FMULX?v.[fi]")>;
  606. def : InstRW<[M3WriteFMAC4,
  607. M3ReadFMAC], (instregex "^FML[AS]v.f")>;
  608. def : InstRW<[M3WriteFMAC5,
  609. M3ReadFMAC], (instregex "^FML[AS]v.i")>;
  610. def : InstRW<[M3WriteNALU1], (instregex "^FNEGv")>;
  611. def : InstRW<[M3WriteFCVT3A], (instregex "^FRINT[AIMNPXZ]v")>;
  612. def : InstRW<[M3WriteFSQR17], (instrs FSQRTv2f32)>;
  613. def : InstRW<[M3WriteNEONX], (instrs FSQRTv4f32)>;
  614. def : InstRW<[M3WriteNEONY], (instrs FSQRTv2f64)>;
  615. // ASIMD miscellaneous instructions.
  616. def : InstRW<[M3WriteNALU1], (instregex "^RBITv")>;
  617. def : InstRW<[M3WriteNALU1], (instregex "^(BIF|BIT|BSL|BSP)v")>;
  618. def : InstRW<[M3WriteNEONB], (instregex "^DUPv.+gpr")>;
  619. def : InstRW<[M3WriteNSHF1], (instregex "^DUPv.+lane")>;
  620. def : InstRW<[M3WriteNSHF1], (instregex "^EXTv")>;
  621. def : InstRW<[M3WriteNSHF1], (instregex "^[SU]?Q?XTU?Nv")>;
  622. def : InstRW<[M3WriteNSHF1], (instregex "^DUP(i8|i16|i32|i64)$")>;
  623. def : InstRW<[M3WriteNSHF1], (instregex "^INSv.+lane")>;
  624. def : InstRW<[M3WriteMOVI], (instregex "^MOVI")>;
  625. def : InstRW<[M3WriteNALU1], (instregex "^FMOVv")>;
  626. def : InstRW<[M3WriteFCVT4], (instregex "^[FU](RECP|RSQRT)Ev[248]")>;
  627. def : InstRW<[M3WriteFMAC4,
  628. M3ReadFMAC], (instregex "^F(RECP|RSQRT)Sv")>;
  629. def : InstRW<[M3WriteNSHF1], (instregex "^REV(16|32|64)v")>;
  630. def : InstRW<[M3WriteNSHF1], (instregex "^TB[LX]v")>;
  631. def : InstRW<[M3WriteNEOND], (instregex "^[SU]MOVv")>;
  632. def : InstRW<[M3WriteNSHF3], (instregex "^INSv.+gpr")>;
  633. def : InstRW<[M3WriteNSHF1], (instregex "^(TRN|UZP|ZIP)[12]v")>;
  634. // ASIMD load instructions.
  635. def : InstRW<[M3WriteL5], (instregex "LD1Onev(8b|4h|2s|1d)$")>;
  636. def : InstRW<[M3WriteL5,
  637. M3WriteA1], (instregex "LD1Onev(8b|4h|2s|1d)_POST")>;
  638. def : InstRW<[M3WriteL5], (instregex "LD1Onev(16b|8h|4s|2d)$")>;
  639. def : InstRW<[M3WriteL5,
  640. M3WriteA1], (instregex "LD1Onev(16b|8h|4s|2d)_POST")>;
  641. def : InstRW<[M3WriteVLDA], (instregex "LD1Twov(8b|4h|2s|1d)$")>;
  642. def : InstRW<[M3WriteVLDA,
  643. M3WriteA1], (instregex "LD1Twov(8b|4h|2s|1d)_POST")>;
  644. def : InstRW<[M3WriteVLDA], (instregex "LD1Twov(16b|8h|4s|2d)$")>;
  645. def : InstRW<[M3WriteVLDA,
  646. M3WriteA1], (instregex "LD1Twov(16b|8h|4s|2d)_POST")>;
  647. def : InstRW<[M3WriteVLDB], (instregex "LD1Threev(8b|4h|2s|1d)$")>;
  648. def : InstRW<[M3WriteVLDB,
  649. M3WriteA1], (instregex "LD1Threev(8b|4h|2s|1d)_POST")>;
  650. def : InstRW<[M3WriteVLDB], (instregex "LD1Threev(16b|8h|4s|2d)$")>;
  651. def : InstRW<[M3WriteVLDB,
  652. M3WriteA1], (instregex "LD1Threev(16b|8h|4s|2d)_POST")>;
  653. def : InstRW<[M3WriteVLDC], (instregex "LD1Fourv(8b|4h|2s|1d)$")>;
  654. def : InstRW<[M3WriteVLDC,
  655. M3WriteA1], (instregex "LD1Fourv(8b|4h|2s|1d)_POST")>;
  656. def : InstRW<[M3WriteVLDC], (instregex "LD1Fourv(16b|8h|4s|2d)$")>;
  657. def : InstRW<[M3WriteVLDC,
  658. M3WriteA1], (instregex "LD1Fourv(16b|8h|4s|2d)_POST")>;
  659. def : InstRW<[M3WriteVLDD], (instregex "LD1i(8|16|32)$")>;
  660. def : InstRW<[M3WriteVLDD,
  661. M3WriteA1], (instregex "LD1i(8|16|32)_POST")>;
  662. def : InstRW<[M3WriteVLDE], (instregex "LD1i(64)$")>;
  663. def : InstRW<[M3WriteVLDE,
  664. M3WriteA1], (instregex "LD1i(64)_POST")>;
  665. def : InstRW<[M3WriteL5], (instregex "LD1Rv(8b|4h|2s|1d)$")>;
  666. def : InstRW<[M3WriteL5,
  667. M3WriteA1], (instregex "LD1Rv(8b|4h|2s|1d)_POST")>;
  668. def : InstRW<[M3WriteL5], (instregex "LD1Rv(16b|8h|4s|2d)$")>;
  669. def : InstRW<[M3WriteL5,
  670. M3WriteA1], (instregex "LD1Rv(16b|8h|4s|2d)_POST")>;
  671. def : InstRW<[M3WriteVLDF], (instregex "LD2Twov(8b|4h|2s)$")>;
  672. def : InstRW<[M3WriteVLDF,
  673. M3WriteA1], (instregex "LD2Twov(8b|4h|2s)_POST")>;
  674. def : InstRW<[M3WriteVLDF], (instregex "LD2Twov(16b|8h|4s|2d)$")>;
  675. def : InstRW<[M3WriteVLDF,
  676. M3WriteA1], (instregex "LD2Twov(16b|8h|4s|2d)_POST")>;
  677. def : InstRW<[M3WriteVLDG], (instregex "LD2i(8|16|32)$")>;
  678. def : InstRW<[M3WriteVLDG,
  679. M3WriteA1], (instregex "LD2i(8|16|32)_POST")>;
  680. def : InstRW<[M3WriteVLDH], (instregex "LD2i(64)$")>;
  681. def : InstRW<[M3WriteVLDH,
  682. M3WriteA1], (instregex "LD2i(64)_POST")>;
  683. def : InstRW<[M3WriteVLDA], (instregex "LD2Rv(8b|4h|2s|1d)$")>;
  684. def : InstRW<[M3WriteVLDA,
  685. M3WriteA1], (instregex "LD2Rv(8b|4h|2s|1d)_POST")>;
  686. def : InstRW<[M3WriteVLDA], (instregex "LD2Rv(16b|8h|4s|2d)$")>;
  687. def : InstRW<[M3WriteVLDA,
  688. M3WriteA1], (instregex "LD2Rv(16b|8h|4s|2d)_POST")>;
  689. def : InstRW<[M3WriteVLDI], (instregex "LD3Threev(8b|4h|2s)$")>;
  690. def : InstRW<[M3WriteVLDI,
  691. M3WriteA1], (instregex "LD3Threev(8b|4h|2s)_POST")>;
  692. def : InstRW<[M3WriteVLDI], (instregex "LD3Threev(16b|8h|4s|2d)$")>;
  693. def : InstRW<[M3WriteVLDI,
  694. M3WriteA1], (instregex "LD3Threev(16b|8h|4s|2d)_POST")>;
  695. def : InstRW<[M3WriteVLDJ], (instregex "LD3i(8|16|32)$")>;
  696. def : InstRW<[M3WriteVLDJ,
  697. M3WriteA1], (instregex "LD3i(8|16|32)_POST")>;
  698. def : InstRW<[M3WriteVLDL], (instregex "LD3i(64)$")>;
  699. def : InstRW<[M3WriteVLDL,
  700. M3WriteA1], (instregex "LD3i(64)_POST")>;
  701. def : InstRW<[M3WriteVLDB], (instregex "LD3Rv(8b|4h|2s|1d)$")>;
  702. def : InstRW<[M3WriteVLDB,
  703. M3WriteA1], (instregex "LD3Rv(8b|4h|2s|1d)_POST")>;
  704. def : InstRW<[M3WriteVLDB], (instregex "LD3Rv(16b|8h|4s|2d)$")>;
  705. def : InstRW<[M3WriteVLDB,
  706. M3WriteA1], (instregex "LD3Rv(16b|8h|4s|2d)_POST")>;
  707. def : InstRW<[M3WriteVLDN], (instregex "LD4Fourv(8b|4h|2s)$")>;
  708. def : InstRW<[M3WriteVLDN,
  709. M3WriteA1], (instregex "LD4Fourv(8b|4h|2s)_POST")>;
  710. def : InstRW<[M3WriteVLDN], (instregex "LD4Fourv(16b|8h|4s|2d)$")>;
  711. def : InstRW<[M3WriteVLDN,
  712. M3WriteA1], (instregex "LD4Fourv(16b|8h|4s|2d)_POST")>;
  713. def : InstRW<[M3WriteVLDK], (instregex "LD4i(8|16|32)$")>;
  714. def : InstRW<[M3WriteVLDK,
  715. M3WriteA1], (instregex "LD4i(8|16|32)_POST")>;
  716. def : InstRW<[M3WriteVLDM], (instregex "LD4i(64)$")>;
  717. def : InstRW<[M3WriteVLDM,
  718. M3WriteA1], (instregex "LD4i(64)_POST")>;
  719. def : InstRW<[M3WriteVLDC], (instregex "LD4Rv(8b|4h|2s|1d)$")>;
  720. def : InstRW<[M3WriteVLDC,
  721. M3WriteA1], (instregex "LD4Rv(8b|4h|2s|1d)_POST")>;
  722. def : InstRW<[M3WriteVLDC], (instregex "LD4Rv(16b|8h|4s|2d)$")>;
  723. def : InstRW<[M3WriteVLDC,
  724. M3WriteA1], (instregex "LD4Rv(16b|8h|4s|2d)_POST")>;
  725. // ASIMD store instructions.
  726. def : InstRW<[WriteVST], (instregex "ST1Onev(8b|4h|2s|1d)$")>;
  727. def : InstRW<[WriteVST,
  728. WriteAdr], (instregex "ST1Onev(8b|4h|2s|1d)_POST")>;
  729. def : InstRW<[WriteVST], (instregex "ST1Onev(16b|8h|4s|2d)$")>;
  730. def : InstRW<[WriteVST,
  731. WriteAdr], (instregex "ST1Onev(16b|8h|4s|2d)_POST")>;
  732. def : InstRW<[M3WriteVSTA], (instregex "ST1Twov(8b|4h|2s|1d)$")>;
  733. def : InstRW<[M3WriteVSTA,
  734. WriteAdr], (instregex "ST1Twov(8b|4h|2s|1d)_POST")>;
  735. def : InstRW<[M3WriteVSTA], (instregex "ST1Twov(16b|8h|4s|2d)$")>;
  736. def : InstRW<[M3WriteVSTA,
  737. WriteAdr], (instregex "ST1Twov(16b|8h|4s|2d)_POST")>;
  738. def : InstRW<[M3WriteVSTB], (instregex "ST1Threev(8b|4h|2s|1d)$")>;
  739. def : InstRW<[M3WriteVSTB,
  740. WriteAdr], (instregex "ST1Threev(8b|4h|2s|1d)_POST")>;
  741. def : InstRW<[M3WriteVSTB], (instregex "ST1Threev(16b|8h|4s|2d)$")>;
  742. def : InstRW<[M3WriteVSTB,
  743. WriteAdr], (instregex "ST1Threev(16b|8h|4s|2d)_POST")>;
  744. def : InstRW<[M3WriteVSTC], (instregex "ST1Fourv(8b|4h|2s|1d)$")>;
  745. def : InstRW<[M3WriteVSTC,
  746. WriteAdr], (instregex "ST1Fourv(8b|4h|2s|1d)_POST")>;
  747. def : InstRW<[M3WriteVSTC], (instregex "ST1Fourv(16b|8h|4s|2d)$")>;
  748. def : InstRW<[M3WriteVSTC,
  749. WriteAdr], (instregex "ST1Fourv(16b|8h|4s|2d)_POST")>;
  750. def : InstRW<[M3WriteVSTD], (instregex "ST1i(8|16|32|64)$")>;
  751. def : InstRW<[M3WriteVSTD,
  752. WriteAdr], (instregex "ST1i(8|16|32|64)_POST")>;
  753. def : InstRW<[M3WriteVSTD], (instregex "ST2Twov(8b|4h|2s)$")>;
  754. def : InstRW<[M3WriteVSTD,
  755. WriteAdr], (instregex "ST2Twov(8b|4h|2s)_POST")>;
  756. def : InstRW<[M3WriteVSTE], (instregex "ST2Twov(16b|8h|4s|2d)$")>;
  757. def : InstRW<[M3WriteVSTE,
  758. WriteAdr], (instregex "ST2Twov(16b|8h|4s|2d)_POST")>;
  759. def : InstRW<[M3WriteVSTD], (instregex "ST2i(8|16|32)$")>;
  760. def : InstRW<[M3WriteVSTD,
  761. WriteAdr], (instregex "ST2i(8|16|32)_POST")>;
  762. def : InstRW<[M3WriteVSTD], (instregex "ST2i(64)$")>;
  763. def : InstRW<[M3WriteVSTD,
  764. WriteAdr], (instregex "ST2i(64)_POST")>;
  765. def : InstRW<[M3WriteVSTF], (instregex "ST3Threev(8b|4h|2s)$")>;
  766. def : InstRW<[M3WriteVSTF,
  767. WriteAdr], (instregex "ST3Threev(8b|4h|2s)_POST")>;
  768. def : InstRW<[M3WriteVSTG], (instregex "ST3Threev(16b|8h|4s|2d)$")>;
  769. def : InstRW<[M3WriteVSTG,
  770. WriteAdr], (instregex "ST3Threev(16b|8h|4s|2d)_POST")>;
  771. def : InstRW<[M3WriteVSTH], (instregex "ST3i(8|16|32)$")>;
  772. def : InstRW<[M3WriteVSTH,
  773. WriteAdr], (instregex "ST3i(8|16|32)_POST")>;
  774. def : InstRW<[M3WriteVSTF], (instregex "ST3i(64)$")>;
  775. def : InstRW<[M3WriteVSTF,
  776. WriteAdr], (instregex "ST3i(64)_POST")>;
  777. def : InstRW<[M3WriteVSTF], (instregex "ST4Fourv(8b|4h|2s)$")>;
  778. def : InstRW<[M3WriteVSTF,
  779. WriteAdr], (instregex "ST4Fourv(8b|4h|2s)_POST")>;
  780. def : InstRW<[M3WriteVSTI], (instregex "ST4Fourv(16b|8h|4s|2d)$")>;
  781. def : InstRW<[M3WriteVSTI,
  782. WriteAdr], (instregex "ST4Fourv(16b|8h|4s|2d)_POST")>;
  783. def : InstRW<[M3WriteVSTF], (instregex "ST4i(8|16|32|64)$")>;
  784. def : InstRW<[M3WriteVSTF,
  785. WriteAdr], (instregex "ST4i(8|16|32|64)_POST")>;
  786. // Cryptography instructions.
  787. def : InstRW<[M3WriteAES], (instregex "^AES[DE]")>;
  788. def : InstRW<[M3WriteAES,
  789. M3ReadAES], (instregex "^AESI?MC")>;
  790. def : InstRW<[M3WriteNCRY3A], (instregex "^PMULL?v")>;
  791. def : InstRW<[M3WriteNCRY1A], (instregex "^SHA1([CHMP]|SU[01])")>;
  792. def : InstRW<[M3WriteNCRY1A], (instregex "^SHA256SU0")>;
  793. def : InstRW<[M3WriteNCRY5A], (instregex "^SHA256(H2?|SU1)")>;
  794. // CRC instructions.
  795. def : InstRW<[M3WriteC2], (instregex "^CRC32")>;
  796. } // SchedModel = ExynosM3Model