AArch64SchedExynosM3.td 43 KB

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