AArch64SchedThunderX3T110.td 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005
  1. //=- AArch64SchedThunderX3T110.td - Marvell ThunderX3 T110 ---*- 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 scheduling model for Marvell ThunderX3T110
  10. // family of processors.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //===----------------------------------------------------------------------===//
  14. // Pipeline Description.
  15. def ThunderX3T110Model : SchedMachineModel {
  16. let IssueWidth = 4; // 4 micro-ops dispatched at a time.
  17. let MicroOpBufferSize = 70; // 70 entries in micro-op re-order buffer.
  18. let LoadLatency = 4; // Optimistic load latency.
  19. let MispredictPenalty = 12; // Extra cycles for mispredicted branch.
  20. // Determined via a mix of micro-arch details and experimentation.
  21. let LoopMicroOpBufferSize = 128; // FIXME: might be much bigger in TX3.
  22. let PostRAScheduler = 1; // Using PostRA sched.
  23. let CompleteModel = 1;
  24. list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
  25. PAUnsupported.F,
  26. SMEUnsupported.F,
  27. [HasMTE]);
  28. // FIXME: Remove when all errors have been fixed.
  29. let FullInstRWOverlapCheck = 0;
  30. }
  31. let SchedModel = ThunderX3T110Model in {
  32. // Issue ports.
  33. // Port 0: ALU.
  34. def THX3T110P0 : ProcResource<1>;
  35. // Port 1: ALU.
  36. def THX3T110P1 : ProcResource<1>;
  37. // Port 2: ALU/Branch.
  38. def THX3T110P2 : ProcResource<1>;
  39. // Port 3: ALU/Branch.
  40. def THX3T110P3 : ProcResource<1>;
  41. // Port 4: Load/Store.
  42. def THX3T110P4 : ProcResource<1>;
  43. // Port 5: Load/store.
  44. def THX3T110P5 : ProcResource<1>;
  45. // Port 6: FP/Neon/SIMD/Crypto.
  46. def THX3T110P6FP0 : ProcResource<1>;
  47. // Port 7: FP/Neon/SIMD/Crypto.
  48. def THX3T110P7FP1 : ProcResource<1>;
  49. // Port 8: FP/Neon/SIMD/Crypto.
  50. def THX3T110P8FP2 : ProcResource<1>;
  51. // Port 9: FP/Neon/SIMD/Crypto.
  52. def THX3T110P9FP3 : ProcResource<1>;
  53. // Port 10: Store Data Unit.
  54. def THX3T110SD0 : ProcResource<1>;
  55. // Define groups for the functional units on each issue port. Each group
  56. // created will be used by a WriteRes.
  57. // Integer divide/mulhi micro-ops only on port I1.
  58. def THX3T110I1 : ProcResGroup<[THX3T110P1]>;
  59. // Branch micro-ops on ports I2/I3.
  60. def THX3T110I23 : ProcResGroup<[THX3T110P2, THX3T110P3]>;
  61. // Branch micro-ops on ports I1/I2/I3.
  62. def THX3T110I123 : ProcResGroup<[THX3T110P1, THX3T110P2, THX3T110P3]>;
  63. // Integer micro-ops on ports I0/I1/I2.
  64. def THX3T110I012 : ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2]>;
  65. // Integer micro-ops on ports I0/I1/I2/I3.
  66. def THX3T110I0123 : ProcResGroup<[THX3T110P0, THX3T110P1,
  67. THX3T110P2, THX3T110P3]>;
  68. // FP micro-ops on ports FP0/FP1/FP2/FP3.
  69. def THX3T110FP0123 : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1,
  70. THX3T110P8FP2, THX3T110P9FP3]>;
  71. // FP micro-ops on ports FP2/FP3.
  72. def THX3T110FP23 : ProcResGroup<[THX3T110P8FP2, THX3T110P9FP3]>;
  73. // ASIMD micro-ops on ports FP0/FP1/FP2/FP3.
  74. def THX3T110SIMD : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1,
  75. THX3T110P8FP2, THX3T110P9FP3]>;
  76. // Store data micro-ops only on port 10.
  77. def THX3T110SD : ProcResGroup<[THX3T110SD0]>;
  78. // Load/store micro-ops on ports P4/P5.
  79. def THX3T110LS : ProcResGroup<[THX3T110P4, THX3T110P5]>;
  80. // 70 entry unified scheduler.
  81. def THX3T110ANY: ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2,
  82. THX3T110P3, THX3T110P4, THX3T110P5,
  83. THX3T110P6FP0, THX3T110P7FP1,
  84. THX3T110P8FP2, THX3T110P9FP3]> {
  85. let BufferSize = 70;
  86. }
  87. // Define commonly used write types for InstRW specializations.
  88. // All definitions follow the format: THX3T110Write_<NumCycles>Cyc_<Resources>.
  89. // 3 cycles on I1.
  90. def THX3T110Write_3Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
  91. let Latency = 3;
  92. let NumMicroOps = 2;
  93. }
  94. // 4 cycles on I1.
  95. def THX3T110Write_4Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
  96. let Latency = 4;
  97. let NumMicroOps = 2;
  98. }
  99. // 5 cycles on I1.
  100. def THX3T110Write_5Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
  101. let Latency = 5;
  102. let NumMicroOps = 2;
  103. }
  104. // 7 cycles on I1.
  105. def THX3T110Write_7Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
  106. let Latency = 7;
  107. let NumMicroOps = 3;
  108. }
  109. // 23 cycles on I1.
  110. def THX3T110Write_23Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
  111. let Latency = 23;
  112. let ResourceCycles = [13, 23];
  113. let NumMicroOps = 4;
  114. }
  115. // 39 cycles on I1.
  116. def THX3T110Write_39Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
  117. let Latency = 39;
  118. let ResourceCycles = [13, 39];
  119. let NumMicroOps = 4;
  120. }
  121. // 1 cycle on I2/I3
  122. def THX3T110Write_1Cyc_I23 : SchedWriteRes<[THX3T110I23]> {
  123. let Latency = 1;
  124. let NumMicroOps = 2;
  125. }
  126. // 8 cycles on I2/I3
  127. def THX3T110Write_8Cyc_I23 : SchedWriteRes<[THX3T110I23]> {
  128. let Latency = 8;
  129. let NumMicroOps = 3;
  130. }
  131. // 1 cycle on I1/I2/I3
  132. def THX3T110Write_1Cyc_I123 : SchedWriteRes<[THX3T110I123]> {
  133. let Latency = 1;
  134. let NumMicroOps = 2;
  135. }
  136. // 8 cycles on I1/I2/I3
  137. def THX3T110Write_8Cyc_I123 : SchedWriteRes<[THX3T110I123]> {
  138. let Latency = 8;
  139. let NumMicroOps = 3;
  140. }
  141. // 1 cycle on I0/I1/I2/I3.
  142. def THX3T110Write_1Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  143. let Latency = 1;
  144. let NumMicroOps = 2;
  145. }
  146. // 2 cycles on I0/I1/I2/I3.
  147. def THX3T110Write_2Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  148. let Latency = 2;
  149. let NumMicroOps = 2;
  150. }
  151. // 3 cycles on I0/I1/I2/I3.
  152. def THX3T110Write_3Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  153. let Latency = 3;
  154. let NumMicroOps = 2;
  155. }
  156. // 4 cycles on I0/I1/I2/I3.
  157. def THX3T110Write_4Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  158. let Latency = 4;
  159. let NumMicroOps = 3;
  160. }
  161. // 5 cycles on I0/I1/I2/I3.
  162. def THX3T110Write_5Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  163. let Latency = 5;
  164. let NumMicroOps = 3;
  165. }
  166. // 6 cycles on I0/I1/I2/I3.
  167. def THX3T110Write_6Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  168. let Latency = 6;
  169. let NumMicroOps = 3;
  170. }
  171. // 8 cycles on I0/I1/I2/I3.
  172. def THX3T110Write_8Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  173. let Latency = 8;
  174. let NumMicroOps = 4;
  175. }
  176. // 13 cycles on I0/I1/I2/I3.
  177. def THX3T110Write_13Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  178. let Latency = 13;
  179. let NumMicroOps = 3;
  180. }
  181. // 23 cycles on I0/I1/I2/I3.
  182. def THX3T110Write_23Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  183. let Latency = 23;
  184. let NumMicroOps = 3;
  185. }
  186. // 39 cycles on I0/I1/I2/I3.
  187. def THX3T110Write_39Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
  188. let Latency = 39;
  189. let NumMicroOps = 3;
  190. }
  191. // 4 cycles on F2/F3.
  192. def THX3T110Write_4Cyc_F23 : SchedWriteRes<[THX3T110FP23]> {
  193. let Latency = 4;
  194. let NumMicroOps = 2;
  195. }
  196. // 5 cycles on F0/F1/F2/F3.
  197. def THX3T110Write_5Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  198. let Latency = 5;
  199. let NumMicroOps = 2;
  200. }
  201. // 6 cycles on F0/F1/F2/F3.
  202. def THX3T110Write_6Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  203. let Latency = 6;
  204. let NumMicroOps = 3;
  205. }
  206. // 7 cycles on F0/F1/F2/F3.
  207. def THX3T110Write_7Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  208. let Latency = 7;
  209. let NumMicroOps = 3;
  210. }
  211. // 8 cycles on F0/F1/F2/F3.
  212. def THX3T110Write_8Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  213. let Latency = 8;
  214. let NumMicroOps = 3;
  215. }
  216. // 10 cycles on F0/F1/F2/F3.
  217. def THX3T110Write_10Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  218. let Latency = 10;
  219. let NumMicroOps = 3;
  220. }
  221. // 16 cycles on F0/F1/F2/F3.
  222. def THX3T110Write_16Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  223. let Latency = 16;
  224. let NumMicroOps = 3;
  225. let ResourceCycles = [8];
  226. }
  227. // 23 cycles on F0/F1/F2/F3.
  228. def THX3T110Write_23Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
  229. let Latency = 23;
  230. let NumMicroOps = 3;
  231. let ResourceCycles = [11];
  232. }
  233. // 1 cycle on LS0/LS1.
  234. def THX3T110Write_1Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  235. let Latency = 1;
  236. let NumMicroOps = 1;
  237. }
  238. // 2 cycles on LS0/LS1.
  239. def THX3T110Write_2Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  240. let Latency = 2;
  241. let NumMicroOps = 2;
  242. }
  243. // 4 cycles on LS0/LS1.
  244. def THX3T110Write_4Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  245. let Latency = 4;
  246. let NumMicroOps = 2;
  247. let ResourceCycles = [2];
  248. }
  249. // 5 cycles on LS0/LS1.
  250. def THX3T110Write_5Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  251. let Latency = 5;
  252. let NumMicroOps = 3;
  253. }
  254. // 6 cycles on LS0/LS1.
  255. def THX3T110Write_6Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  256. let Latency = 6;
  257. let NumMicroOps = 3;
  258. }
  259. // 4 + 5 cycles on LS0/LS1.
  260. // First resource is available after 4 cycles.
  261. // Second resource is available after 5 cycles.
  262. // Load vector pair, immed offset, Q-form [LDP/LDNP].
  263. def THX3T110Write_4_5Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  264. let Latency = 4;
  265. let NumMicroOps = 2;
  266. let ResourceCycles = [4, 5];
  267. }
  268. // 4 + 8 cycles on LS0/LS1.
  269. // First resource is available after 4 cycles.
  270. // Second resource is available after 8 cycles.
  271. // Load vector pair, immed offset, S/D-form [LDP/LDNP].
  272. def THX3T110Write_4_8Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
  273. let Latency = 4;
  274. let NumMicroOps = 2;
  275. let ResourceCycles = [4, 8];
  276. }
  277. // 11 cycles on LS0/LS1 and I1.
  278. def THX3T110Write_11Cyc_LS01_I1 :
  279. SchedWriteRes<[THX3T110LS, THX3T110I1]> {
  280. let Latency = 11;
  281. let NumMicroOps = 4;
  282. }
  283. // 1 cycles on LS0/LS1 and I0/I1/I2/I3.
  284. def THX3T110Write_1Cyc_LS01_I0123 :
  285. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  286. let Latency = 1;
  287. let NumMicroOps = 2;
  288. }
  289. // 1 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
  290. def THX3T110Write_1Cyc_LS01_I0123_I0123 :
  291. SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
  292. let Latency = 1;
  293. let NumMicroOps = 3;
  294. }
  295. // 4 cycles on LS0/LS1 and I0/I1/I2/I3.
  296. def THX3T110Write_4Cyc_LS01_I0123 :
  297. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  298. let Latency = 4;
  299. let NumMicroOps = 3;
  300. }
  301. // 4 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
  302. def THX3T110Write_4Cyc_LS01_I0123_I0123 :
  303. SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
  304. let Latency = 4;
  305. let NumMicroOps = 3;
  306. }
  307. // 5 cycles on LS0/LS1 and I0/I1/I2/I3.
  308. def THX3T110Write_5Cyc_LS01_I0123 :
  309. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  310. let Latency = 5;
  311. let NumMicroOps = 3;
  312. }
  313. // 5 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
  314. def THX3T110Write_5Cyc_LS01_I0123_I0123 :
  315. SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
  316. let Latency = 5;
  317. let NumMicroOps = 3;
  318. }
  319. // 6 cycles on LS0/LS1 and I0/I1/I2/I3.
  320. def THX3T110Write_6Cyc_LS01_I012 :
  321. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  322. let Latency = 6;
  323. let NumMicroOps = 4;
  324. }
  325. // 6 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
  326. def THX3T110Write_6Cyc_LS01_I0123_I0123 :
  327. SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
  328. let Latency = 6;
  329. let NumMicroOps = 3;
  330. }
  331. // 1 cycle on LS0/LS1 and SD.
  332. def THX3T110Write_1Cyc_LS01_SD :
  333. SchedWriteRes<[THX3T110LS, THX3T110SD]> {
  334. let Latency = 1;
  335. let NumMicroOps = 2;
  336. }
  337. // 2 cycles on LS0/LS1 and SD.
  338. def THX3T110Write_2Cyc_LS01_SD :
  339. SchedWriteRes<[THX3T110LS, THX3T110SD]> {
  340. let Latency = 2;
  341. let NumMicroOps = 2;
  342. }
  343. // 4 cycles on LS0/LS1 and SD.
  344. def THX3T110Write_4Cyc_LS01_SD :
  345. SchedWriteRes<[THX3T110LS, THX3T110SD]> {
  346. let Latency = 4;
  347. let NumMicroOps = 3;
  348. }
  349. // 5 cycles on LS0/LS1 and SD.
  350. def THX3T110Write_5Cyc_LS01_SD :
  351. SchedWriteRes<[THX3T110LS, THX3T110SD]> {
  352. let Latency = 5;
  353. let NumMicroOps = 4;
  354. }
  355. // 6 cycles on LS0/LS1 and SD.
  356. def THX3T110Write_6Cyc_LS01_SD :
  357. SchedWriteRes<[THX3T110LS, THX3T110SD]> {
  358. let Latency = 6;
  359. let NumMicroOps = 5;
  360. }
  361. // 1 cycle on LS0/LS1, SD and I0/I1/I2/I3.
  362. def THX3T110Write_1Cyc_LS01_SD_I0123 :
  363. SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
  364. let Latency = 1;
  365. let NumMicroOps = 2;
  366. }
  367. // 2 cycles on LS0/LS1, SD and I0/I1/I2/I3.
  368. def THX3T110Write_2Cyc_LS01_SD_I0123 :
  369. SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
  370. let Latency = 2;
  371. let NumMicroOps = 2;
  372. }
  373. // 4 cycles on LS0/LS1, SD and I0/I1/I2/I3.
  374. def THX3T110Write_4Cyc_LS01_SD_I0123 :
  375. SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
  376. let Latency = 4;
  377. let NumMicroOps = 3;
  378. }
  379. // 5 cycles on LS0/LS1, SD and I0/I1/I2/I3.
  380. def THX3T110Write_5Cyc_LS01_SD_I0123 :
  381. SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
  382. let Latency = 5;
  383. let NumMicroOps = 4;
  384. }
  385. // 6 cycles on LS0/LS1, SD and I0/I1/I2/I3.
  386. def THX3T110Write_6Cyc_LS01_SD_I0123 :
  387. SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
  388. let Latency = 6;
  389. let NumMicroOps = 5;
  390. }
  391. // 1 cycles on LS0/LS1 and F0/F1/F2/F3.
  392. def THX3T110Write_1Cyc_LS01_F0123 :
  393. SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
  394. let Latency = 1;
  395. let NumMicroOps = 2;
  396. }
  397. // 5 cycles on LS0/LS1 and F0/F1/F2/F3.
  398. def THX3T110Write_5Cyc_LS01_F0123 :
  399. SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
  400. let Latency = 5;
  401. let NumMicroOps = 3;
  402. }
  403. // 6 cycles on LS0/LS1 and F0/F1/F2/F3.
  404. def THX3T110Write_6Cyc_LS01_F0123 :
  405. SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
  406. let Latency = 6;
  407. let NumMicroOps = 3;
  408. }
  409. // 7 cycles on LS0/LS1 and F0/F1/F2/F3.
  410. def THX3T110Write_7Cyc_LS01_F0123 :
  411. SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
  412. let Latency = 7;
  413. let NumMicroOps = 3;
  414. }
  415. // 8 cycles on LS0/LS1 and F0/F1/F2/F3.
  416. def THX3T110Write_8Cyc_LS01_F0123 :
  417. SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
  418. let Latency = 8;
  419. let NumMicroOps = 3;
  420. }
  421. // 8 cycles on LS0/LS1 and I0/I1/I2/I3.
  422. def THX3T110Write_8Cyc_LS01_I0123 :
  423. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  424. let Latency = 8;
  425. let NumMicroOps = 3;
  426. }
  427. // 12 cycles on LS0/LS1 and I0/I1/I2/I3.
  428. def THX3T110Write_12Cyc_LS01_I0123 :
  429. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  430. let Latency = 12;
  431. let NumMicroOps = 4;
  432. }
  433. // 16 cycles on LS0/LS1 and I0/I1/I2/I3.
  434. def THX3T110Write_16Cyc_LS01_I0123 :
  435. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  436. let Latency = 16;
  437. let NumMicroOps = 5;
  438. }
  439. // 24 cycles on LS0/LS1 and I0/I1/I2/I3.
  440. def THX3T110Write_24Cyc_LS01_I0123 :
  441. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  442. let Latency = 24;
  443. let NumMicroOps = 10;
  444. }
  445. // 32 cycles on LS0/LS1 and I0/I1/I2/I3.
  446. def THX3T110Write_32Cyc_LS01_I0123 :
  447. SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
  448. let Latency = 32;
  449. let NumMicroOps = 14;
  450. }
  451. // 3 cycles on F0/F1/F2/F3.
  452. def THX3T110Write_3Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  453. let Latency = 3;
  454. let NumMicroOps = 2;
  455. }
  456. // 4 cycles on F0/F1/F2/F3.
  457. def THX3T110Write_4Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  458. let Latency = 4;
  459. let NumMicroOps = 2;
  460. }
  461. // 5 cycles on F0/F1/F2/F3.
  462. def THX3T110Write_5Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  463. let Latency = 5;
  464. let NumMicroOps = 2;
  465. }
  466. // 10 cycles on F0/F1/F2/F3.
  467. def THX3T110Write_10Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  468. let Latency = 10;
  469. let NumMicroOps = 4;
  470. }
  471. // 15 cycles on F0/F1/F2/F3.
  472. def THX3T110Write_15Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  473. let Latency = 15;
  474. let NumMicroOps = 7;
  475. }
  476. // 16 cycles on F0/F1/F2/F3.
  477. def THX3T110Write_16Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  478. let Latency = 16;
  479. let NumMicroOps = 3;
  480. }
  481. // 18 cycles on F0/F1/F2/F3.
  482. def THX3T110Write_18Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  483. let Latency = 18;
  484. let NumMicroOps = 3;
  485. }
  486. // 19 cycles on F0/F1/F2/F3.
  487. def THX3T110Write_19Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  488. let Latency = 19;
  489. let NumMicroOps = 4;
  490. }
  491. // 20 cycles on F0/F1/F2/F3.
  492. def THX3T110Write_20Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  493. let Latency = 20;
  494. let NumMicroOps = 4;
  495. }
  496. // 23 cycles on F0/F1/F2/F3.
  497. def THX3T110Write_23Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
  498. let Latency = 23;
  499. let NumMicroOps = 4;
  500. }
  501. // 3 cycles on F2/F3 and 4 cycles on F0/F1/F2/F3.
  502. def THX3T110Write_3_4Cyc_F23_F0123 :
  503. SchedWriteRes<[THX3T110FP23, THX3T110FP0123]> {
  504. let Latency = 3;
  505. let NumMicroOps = 2;
  506. let ResourceCycles = [3, 4];
  507. }
  508. // Define commonly used read types.
  509. // No forwarding is provided for these types.
  510. def : ReadAdvance<ReadI, 0>;
  511. def : ReadAdvance<ReadISReg, 0>;
  512. def : ReadAdvance<ReadIEReg, 0>;
  513. def : ReadAdvance<ReadIM, 0>;
  514. def : ReadAdvance<ReadIMA, 0>;
  515. def : ReadAdvance<ReadID, 0>;
  516. def : ReadAdvance<ReadExtrHi, 0>;
  517. def : ReadAdvance<ReadAdrBase, 0>;
  518. def : ReadAdvance<ReadVLD, 0>;
  519. def : ReadAdvance<ReadST, 0>;
  520. //===----------------------------------------------------------------------===//
  521. // 3. Instruction Tables.
  522. //---
  523. // 3.1 Branch Instructions
  524. //---
  525. // Branch, immed
  526. // Branch and link, immed
  527. // Compare and branch
  528. def : WriteRes<WriteBr, [THX3T110I23]> {
  529. let Latency = 1;
  530. let NumMicroOps = 2;
  531. }
  532. // Branch, register
  533. // Branch and link, register != LR
  534. // Branch and link, register = LR
  535. def : WriteRes<WriteBrReg, [THX3T110I23]> {
  536. let Latency = 1;
  537. let NumMicroOps = 2;
  538. }
  539. def : WriteRes<WriteSys, []> { let Latency = 1; }
  540. def : WriteRes<WriteBarrier, []> { let Latency = 1; }
  541. def : WriteRes<WriteHint, []> { let Latency = 1; }
  542. def : WriteRes<WriteAtomic, []> {
  543. let Latency = 4;
  544. let NumMicroOps = 2;
  545. }
  546. //---
  547. // Branch
  548. //---
  549. def : InstRW<[THX3T110Write_1Cyc_I23], (instrs B, BL, BR, BLR)>;
  550. def : InstRW<[THX3T110Write_1Cyc_I23], (instrs Bcc)>;
  551. def : InstRW<[THX3T110Write_1Cyc_I23], (instrs RET)>;
  552. def : InstRW<[THX3T110Write_1Cyc_I23],
  553. (instrs CBZW, CBZX, CBNZW, CBNZX, TBZW, TBZX, TBNZW, TBNZX)>;
  554. //---
  555. // 3.2 Arithmetic and Logical Instructions
  556. // 3.3 Move and Shift Instructions
  557. //---
  558. // ALU, basic
  559. // Conditional compare
  560. // Conditional select
  561. // Address generation
  562. def : WriteRes<WriteI, [THX3T110I0123]> {
  563. let Latency = 1;
  564. let ResourceCycles = [1];
  565. let NumMicroOps = 2;
  566. }
  567. def : InstRW<[WriteI],
  568. (instregex "ADD?(W|X)r(i|r|s|x)", "ADDS?(W|X)r(i|r|s|x)(64)?",
  569. "AND?(W|X)r(i|r|s|x)", "ANDS?(W|X)r(i|r|s|x)",
  570. "ADC(W|X)r",
  571. "BIC?(W|X)r(i|r|s|x)", "BICS?(W|X)r(i|r|s|x)",
  572. "EON?(W|X)r(i|r|s|x)", "ORN?(W|X)r(i|r|s|x)",
  573. "ORR?(W|X)r(i|r|s|x)", "SUB?(W|X)r(i|r|s|x)",
  574. "SUBS?(W|X)r(i|r|s|x)", "SBC(W|X)r",
  575. "SBCS(W|X)r", "CCMN(W|X)(i|r)",
  576. "CCMP(W|X)(i|r)", "CSEL(W|X)r",
  577. "CSINC(W|X)r", "CSINV(W|X)r",
  578. "CSNEG(W|X)r")>;
  579. def : InstRW<[WriteI], (instrs COPY)>;
  580. // ALU, extend and/or shift
  581. def : WriteRes<WriteISReg, [THX3T110I0123]> {
  582. let Latency = 2;
  583. let ResourceCycles = [2];
  584. let NumMicroOps = 2;
  585. }
  586. def : InstRW<[WriteISReg],
  587. (instregex "ADD?(W|X)r(i|r|s|x)", "ADDS?(W|X)r(i|r|s|x)(64)?",
  588. "AND?(W|X)r(i|r|s|x)", "ANDS?(W|X)r(i|r|s|x)",
  589. "ADC(W|X)r",
  590. "BIC?(W|X)r(i|r|s|x)", "BICS?(W|X)r(i|r|s|x)",
  591. "EON?(W|X)r(i|r|s|x)", "ORN?(W|X)r(i|r|s|x)",
  592. "ORR?(W|X)r(i|r|s|x)", "SUB?(W|X)r(i|r|s|x)",
  593. "SUBS?(W|X)r(i|r|s|x)", "SBC(W|X)r",
  594. "SBCS(W|X)r", "CCMN(W|X)(i|r)",
  595. "CCMP(W|X)(i|r)", "CSEL(W|X)r",
  596. "CSINC(W|X)r", "CSINV(W|X)r",
  597. "CSNEG(W|X)r")>;
  598. def : WriteRes<WriteIEReg, [THX3T110I0123]> {
  599. let Latency = 1;
  600. let ResourceCycles = [1];
  601. let NumMicroOps = 2;
  602. }
  603. def : InstRW<[WriteIEReg],
  604. (instregex "ADD?(W|X)r(i|r|s|x)", "ADDS?(W|X)r(i|r|s|x)(64)?",
  605. "AND?(W|X)r(i|r|s|x)", "ANDS?(W|X)r(i|r|s|x)",
  606. "ADC(W|X)r",
  607. "BIC?(W|X)r(i|r|s|x)", "BICS?(W|X)r(i|r|s|x)",
  608. "EON?(W|X)r(i|r|s|x)", "ORN?(W|X)r(i|r|s|x)",
  609. "ORR?(W|X)r(i|r|s|x)", "SUB?(W|X)r(i|r|s|x)",
  610. "SUBS?(W|X)r(i|r|s|x)", "SBC(W|X)r",
  611. "SBCS(W|X)r", "CCMN(W|X)(i|r)",
  612. "CCMP(W|X)(i|r)", "CSEL(W|X)r",
  613. "CSINC(W|X)r", "CSINV(W|X)r",
  614. "CSNEG(W|X)r")>;
  615. // Move immed
  616. def : WriteRes<WriteImm, [THX3T110I0123]> {
  617. let Latency = 1;
  618. let NumMicroOps = 2;
  619. }
  620. def : InstRW<[THX3T110Write_1Cyc_I0123],
  621. (instrs MOVKWi, MOVKXi, MOVNWi, MOVNXi, MOVZWi, MOVZXi)>;
  622. def : InstRW<[THX3T110Write_1Cyc_I0123],
  623. (instrs ASRVWr, ASRVXr, LSLVWr, LSLVXr, RORVWr, RORVXr)>;
  624. // Variable shift
  625. def : WriteRes<WriteIS, [THX3T110I0123]> {
  626. let Latency = 1;
  627. let NumMicroOps = 2;
  628. }
  629. //---
  630. // 3.4 Divide and Multiply Instructions
  631. //---
  632. // Divide, W-form
  633. // Latency range of 13-23/13-39.
  634. def : WriteRes<WriteID32, [THX3T110I1]> {
  635. let Latency = 39;
  636. let ResourceCycles = [39];
  637. let NumMicroOps = 4;
  638. }
  639. // Divide, X-form
  640. def : WriteRes<WriteID64, [THX3T110I1]> {
  641. let Latency = 23;
  642. let ResourceCycles = [23];
  643. let NumMicroOps = 4;
  644. }
  645. // Multiply accumulate, W-form
  646. def : WriteRes<WriteIM32, [THX3T110I0123]> {
  647. let Latency = 5;
  648. let NumMicroOps = 3;
  649. }
  650. // Multiply accumulate, X-form
  651. def : WriteRes<WriteIM64, [THX3T110I0123]> {
  652. let Latency = 5;
  653. let NumMicroOps = 3;
  654. }
  655. //def : InstRW<[WriteIM32, ReadIM, ReadIM, ReadIMA, THX3T110Write_5Cyc_I012],
  656. // (instrs MADDWrrr, MSUBWrrr)>;
  657. def : InstRW<[WriteIM32], (instrs MADDWrrr, MSUBWrrr)>;
  658. def : InstRW<[WriteIM32], (instrs MADDXrrr, MSUBXrrr)>;
  659. def : InstRW<[THX3T110Write_5Cyc_I0123],
  660. (instregex "(S|U)(MADDL|MSUBL)rrr")>;
  661. def : InstRW<[WriteID32], (instrs SDIVWr, UDIVWr)>;
  662. def : InstRW<[WriteID64], (instrs SDIVXr, UDIVXr)>;
  663. // Bitfield extract, two reg
  664. def : WriteRes<WriteExtr, [THX3T110I0123]> {
  665. let Latency = 1;
  666. let NumMicroOps = 2;
  667. }
  668. // Multiply high
  669. def : InstRW<[THX3T110Write_4Cyc_I1], (instrs SMULHrr, UMULHrr)>;
  670. // Miscellaneous Data-Processing Instructions
  671. // Bitfield extract
  672. def : InstRW<[THX3T110Write_1Cyc_I0123], (instrs EXTRWrri, EXTRXrri)>;
  673. // Bitifield move - basic
  674. def : InstRW<[THX3T110Write_1Cyc_I0123],
  675. (instrs SBFMWri, SBFMXri, UBFMWri, UBFMXri)>;
  676. // Bitfield move, insert
  677. def : InstRW<[THX3T110Write_1Cyc_I0123], (instregex "^BFM")>;
  678. def : InstRW<[THX3T110Write_1Cyc_I0123], (instregex "(S|U)?BFM.*")>;
  679. // Count leading
  680. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
  681. (instregex "^CLS(W|X)r$", "^CLZ(W|X)r$")>;
  682. // Reverse bits
  683. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instrs RBITWr, RBITXr)>;
  684. // Cryptography Extensions
  685. def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^AES[DE]")>;
  686. def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^AESI?MC")>;
  687. def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^PMULL")>;
  688. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1SU0")>;
  689. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1(H|SU1)")>;
  690. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1[CMP]")>;
  691. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA256SU0")>;
  692. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA256(H|H2|SU1)")>;
  693. // CRC Instructions
  694. // def : InstRW<[THX3T110Write_4Cyc_I1], (instregex "^CRC32", "^CRC32C")>;
  695. def : InstRW<[THX3T110Write_4Cyc_I1],
  696. (instrs CRC32Brr, CRC32Hrr, CRC32Wrr, CRC32Xrr)>;
  697. def : InstRW<[THX3T110Write_4Cyc_I1],
  698. (instrs CRC32CBrr, CRC32CHrr, CRC32CWrr, CRC32CXrr)>;
  699. // Reverse bits/bytes
  700. // NOTE: Handled by WriteI.
  701. //---
  702. // 3.6 Load Instructions
  703. // 3.10 FP Load Instructions
  704. //---
  705. // Load register, literal
  706. // Load register, unscaled immed
  707. // Load register, immed unprivileged
  708. // Load register, unsigned immed
  709. def : WriteRes<WriteLD, [THX3T110LS]> {
  710. let Latency = 4;
  711. let NumMicroOps = 4;
  712. }
  713. // Load register, immed post-index
  714. // NOTE: Handled by WriteLD, WriteI.
  715. // Load register, immed pre-index
  716. // NOTE: Handled by WriteLD, WriteAdr.
  717. def : WriteRes<WriteAdr, [THX3T110I0123]> {
  718. let Latency = 1;
  719. let NumMicroOps = 2;
  720. }
  721. // Load pair, immed offset, normal
  722. // Load pair, immed offset, signed words, base != SP
  723. // Load pair, immed offset signed words, base = SP
  724. // LDP only breaks into *one* LS micro-op. Thus
  725. // the resources are handled by WriteLD.
  726. def : WriteRes<WriteLDHi, []> {
  727. let Latency = 4;
  728. let NumMicroOps = 4;
  729. }
  730. // Load register offset, basic
  731. // Load register, register offset, scale by 4/8
  732. // Load register, register offset, scale by 2
  733. // Load register offset, extend
  734. // Load register, register offset, extend, scale by 4/8
  735. // Load register, register offset, extend, scale by 2
  736. def THX3T110WriteLDIdx : SchedWriteVariant<[
  737. SchedVar<ScaledIdxPred, [THX3T110Write_4Cyc_LS01_I0123_I0123]>,
  738. SchedVar<NoSchedPred, [THX3T110Write_4Cyc_LS01_I0123]>]>;
  739. def : SchedAlias<WriteLDIdx, THX3T110WriteLDIdx>;
  740. def THX3T110ReadAdrBase : SchedReadVariant<[
  741. SchedVar<ScaledIdxPred, [ReadDefault]>,
  742. SchedVar<NoSchedPred, [ReadDefault]>]>;
  743. def : SchedAlias<ReadAdrBase, THX3T110ReadAdrBase>;
  744. // Load pair, immed pre-index, normal
  745. // Load pair, immed pre-index, signed words
  746. // Load pair, immed post-index, normal
  747. // Load pair, immed post-index, signed words
  748. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPDi)>;
  749. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPQi)>;
  750. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPSi)>;
  751. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPWi)>;
  752. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPXi)>;
  753. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPDi)>;
  754. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPQi)>;
  755. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPSi)>;
  756. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPSWi)>;
  757. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPWi)>;
  758. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPXi)>;
  759. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRBui)>;
  760. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRDui)>;
  761. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRHui)>;
  762. def : InstRW<[THX3T110Write_5Cyc_LS01], (instrs LDRQui)>;
  763. def : InstRW<[THX3T110Write_5Cyc_LS01], (instrs LDRSui)>;
  764. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRDl)>;
  765. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRQl)>;
  766. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRWl)>;
  767. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRXl)>;
  768. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRBi)>;
  769. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRHi)>;
  770. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRWi)>;
  771. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRXi)>;
  772. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSBWi)>;
  773. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSBXi)>;
  774. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSHWi)>;
  775. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSHXi)>;
  776. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSWi)>;
  777. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
  778. (instrs LDPDpre)>;
  779. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
  780. (instrs LDPQpre)>;
  781. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
  782. (instrs LDPSpre)>;
  783. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
  784. (instrs LDPWpre)>;
  785. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
  786. (instrs LDPWpre)>;
  787. def : InstRW<[THX3T110Write_4Cyc_LS01, WriteAdr],
  788. (instrs LDRBpre, LDRDpre, LDRHpre, LDRQpre,
  789. LDRSpre, LDRWpre, LDRXpre,
  790. LDRSBWpre, LDRSBXpre, LDRSBWpost, LDRSBXpost,
  791. LDRSHWpre, LDRSHXpre, LDRSHWpost, LDRSHXpost,
  792. LDRBBpre, LDRBBpost, LDRHHpre, LDRHHpost)>;
  793. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
  794. (instrs LDPDpost, LDPQpost, LDPSpost, LDPWpost, LDPXpost)>;
  795. def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteI],
  796. (instrs LDRBpost, LDRDpost, LDRHpost,
  797. LDRQpost, LDRSpost, LDRWpost, LDRXpost)>;
  798. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteLDHi, WriteAdr],
  799. (instrs LDPDpre, LDPQpre, LDPSpre, LDPWpre, LDPXpre)>;
  800. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteAdr],
  801. (instrs LDRBpre, LDRDpre, LDRHpre, LDRQpre,
  802. LDRSpre, LDRWpre, LDRXpre)>;
  803. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteLDHi, WriteAdr],
  804. (instrs LDPDpost, LDPQpost, LDPSpost, LDPWpost, LDPXpost)>;
  805. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteI],
  806. (instrs LDRBpost, LDRDpost, LDRHpost, LDRQpost,
  807. LDRSpost, LDRWpost, LDRXpost)>;
  808. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRBroW)>;
  809. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRDroW)>;
  810. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHroW)>;
  811. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHHroW)>;
  812. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRQroW)>;
  813. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSroW)>;
  814. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHWroW)>;
  815. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHXroW)>;
  816. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRWroW)>;
  817. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRXroW)>;
  818. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRBroX)>;
  819. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRDroX)>;
  820. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHHroX)>;
  821. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHroX)>;
  822. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRQroX)>;
  823. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSroX)>;
  824. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHWroX)>;
  825. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHXroX)>;
  826. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRWroX)>;
  827. def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRXroX)>;
  828. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURBi)>;
  829. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURBBi)>;
  830. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURDi)>;
  831. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURHi)>;
  832. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURHHi)>;
  833. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURQi)>;
  834. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSi)>;
  835. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURXi)>;
  836. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSBWi)>;
  837. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSBXi)>;
  838. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSHWi)>;
  839. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSHXi)>;
  840. def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSWi)>;
  841. // Load exclusive
  842. def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAR(B|H|W|X)$")>;
  843. def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAXR(B|H|W|X)$")>;
  844. def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDXR(B|H|W|X)$")>;
  845. def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAXP(W|X)$")>;
  846. def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDXP(W|X)$")>;
  847. //---
  848. // Prefetch
  849. //---
  850. def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMl)>;
  851. def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFUMi)>;
  852. def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMui)>;
  853. def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMroW)>;
  854. def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMroX)>;
  855. //--
  856. // 3.7 Store Instructions
  857. // 3.11 FP Store Instructions
  858. //--
  859. // Store register, unscaled immed
  860. // Store register, immed unprivileged
  861. // Store register, unsigned immed
  862. def : WriteRes<WriteST, [THX3T110LS, THX3T110SD]> {
  863. let Latency = 1;
  864. let NumMicroOps = 2;
  865. }
  866. // Store register, immed post-index
  867. // NOTE: Handled by WriteAdr, WriteST, ReadAdrBase
  868. // Store register, immed pre-index
  869. // NOTE: Handled by WriteAdr, WriteST
  870. // Store register, register offset, basic
  871. // Store register, register offset, scaled by 4/8
  872. // Store register, register offset, scaled by 2
  873. // Store register, register offset, extend
  874. // Store register, register offset, extend, scale by 4/8
  875. // Store register, register offset, extend, scale by 1
  876. def : WriteRes<WriteSTIdx, [THX3T110LS, THX3T110SD, THX3T110I0123]> {
  877. let Latency = 1;
  878. let NumMicroOps = 2;
  879. }
  880. // Store pair, immed offset, W-form
  881. // Store pair, immed offset, X-form
  882. def : WriteRes<WriteSTP, [THX3T110LS, THX3T110SD]> {
  883. let Latency = 1;
  884. let NumMicroOps = 2;
  885. }
  886. // Store pair, immed post-index, W-form
  887. // Store pair, immed post-index, X-form
  888. // Store pair, immed pre-index, W-form
  889. // Store pair, immed pre-index, X-form
  890. // NOTE: Handled by WriteAdr, WriteSTP.
  891. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURBi)>;
  892. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURBBi)>;
  893. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURDi)>;
  894. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURHi)>;
  895. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURHHi)>;
  896. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURQi)>;
  897. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURSi)>;
  898. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURWi)>;
  899. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURXi)>;
  900. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRBi)>;
  901. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRHi)>;
  902. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRWi)>;
  903. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRXi)>;
  904. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPDi)>;
  905. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPQi)>;
  906. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPXi)>;
  907. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPWi)>;
  908. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPDi)>;
  909. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPQi)>;
  910. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPXi)>;
  911. def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPWi)>;
  912. def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRBui)>;
  913. def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRDui)>;
  914. def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRHui)>;
  915. def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRQui)>;
  916. def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRXui)>;
  917. def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRWui)>;
  918. def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRBui)>;
  919. def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRDui)>;
  920. def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRHui)>;
  921. def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRQui)>;
  922. def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRXui)>;
  923. def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRWui)>;
  924. def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRBui)>;
  925. def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRDui)>;
  926. def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRHui)>;
  927. def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRQui)>;
  928. def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRXui)>;
  929. def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRWui)>;
  930. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  931. (instrs STPDpre, STPDpost)>;
  932. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  933. (instrs STPDpre, STPDpost)>;
  934. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  935. (instrs STPQpre, STPQpost)>;
  936. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  937. (instrs STPQpre, STPQpost)>;
  938. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  939. (instrs STPSpre, STPSpost)>;
  940. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  941. (instrs STPSpre, STPSpost)>;
  942. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  943. (instrs STPWpre, STPWpost)>;
  944. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  945. (instrs STPWpre, STPWpost)>;
  946. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  947. (instrs STPXpre, STPXpost)>;
  948. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  949. (instrs STPXpre, STPXpost)>;
  950. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  951. (instrs STRBpre, STRBpost)>;
  952. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  953. (instrs STRBpre, STRBpost)>;
  954. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  955. (instrs STRBBpre, STRBBpost)>;
  956. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  957. (instrs STRBBpre, STRBBpost)>;
  958. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  959. (instrs STRDpre, STRDpost)>;
  960. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  961. (instrs STRDpre, STRDpost)>;
  962. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  963. (instrs STRHpre, STRHpost)>;
  964. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  965. (instrs STRHpre, STRHpost)>;
  966. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  967. (instrs STRHHpre, STRHHpost)>;
  968. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  969. (instrs STRHHpre, STRHHpost)>;
  970. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  971. (instrs STRQpre, STRQpost)>;
  972. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  973. (instrs STRQpre, STRQpost)>;
  974. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  975. (instrs STRSpre, STRSpost)>;
  976. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  977. (instrs STRSpre, STRSpost)>;
  978. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  979. (instrs STRWpre, STRWpost)>;
  980. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  981. (instrs STRWpre, STRWpost)>;
  982. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
  983. (instrs STRXpre, STRXpost)>;
  984. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  985. (instrs STRXpre, STRXpost)>;
  986. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  987. (instrs STRBroW, STRBroX)>;
  988. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  989. (instrs STRBBroW, STRBBroX)>;
  990. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  991. (instrs STRDroW, STRDroX)>;
  992. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  993. (instrs STRHroW, STRHroX)>;
  994. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  995. (instrs STRHHroW, STRHHroX)>;
  996. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  997. (instrs STRQroW, STRQroX)>;
  998. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  999. (instrs STRSroW, STRSroX)>;
  1000. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  1001. (instrs STRWroW, STRWroX)>;
  1002. def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
  1003. (instrs STRXroW, STRXroX)>;
  1004. // Store exclusive
  1005. def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instrs STNPWi, STNPXi)>;
  1006. def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLR(B|H|W|X)$")>;
  1007. def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STXP(W|X)$")>;
  1008. def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STXR(B|H|W|X)$")>;
  1009. def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLXP(W|X)$")>;
  1010. def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLXR(B|H|W|X)$")>;
  1011. //---
  1012. // 3.8 FP Data Processing Instructions
  1013. //---
  1014. // FP absolute value
  1015. // FP min/max
  1016. // FP negate
  1017. def : WriteRes<WriteF, [THX3T110FP0123]> {
  1018. let Latency = 5;
  1019. let NumMicroOps = 2;
  1020. }
  1021. // FP arithmetic
  1022. def : InstRW<[THX3T110Write_6Cyc_F01], (instregex "^FADD", "^FSUB")>;
  1023. // FP compare
  1024. def : WriteRes<WriteFCmp, [THX3T110FP0123]> {
  1025. let Latency = 5;
  1026. let NumMicroOps = 2;
  1027. }
  1028. // FP Mul, Div, Sqrt
  1029. def : WriteRes<WriteFDiv, [THX3T110FP0123]> {
  1030. let Latency = 22;
  1031. let ResourceCycles = [19];
  1032. }
  1033. def THX3T110XWriteFDiv : SchedWriteRes<[THX3T110FP0123]> {
  1034. let Latency = 16;
  1035. let ResourceCycles = [8];
  1036. let NumMicroOps = 4;
  1037. }
  1038. def THX3T110XWriteFDivSP : SchedWriteRes<[THX3T110FP0123]> {
  1039. let Latency = 16;
  1040. let ResourceCycles = [8];
  1041. let NumMicroOps = 4;
  1042. }
  1043. def THX3T110XWriteFDivDP : SchedWriteRes<[THX3T110FP0123]> {
  1044. let Latency = 23;
  1045. let ResourceCycles = [12];
  1046. let NumMicroOps = 4;
  1047. }
  1048. def THX3T110XWriteFSqrtSP : SchedWriteRes<[THX3T110FP0123]> {
  1049. let Latency = 16;
  1050. let ResourceCycles = [8];
  1051. let NumMicroOps = 4;
  1052. }
  1053. def THX3T110XWriteFSqrtDP : SchedWriteRes<[THX3T110FP0123]> {
  1054. let Latency = 23;
  1055. let ResourceCycles = [12];
  1056. let NumMicroOps = 4;
  1057. }
  1058. // FP divide, S-form
  1059. // FP square root, S-form
  1060. def : InstRW<[THX3T110XWriteFDivSP], (instrs FDIVSrr)>;
  1061. def : InstRW<[THX3T110XWriteFSqrtSP], (instrs FSQRTSr)>;
  1062. def : InstRW<[THX3T110XWriteFDivSP], (instregex "^FDIVv.*32$")>;
  1063. def : InstRW<[THX3T110XWriteFSqrtSP], (instregex "^.*SQRT.*32$")>;
  1064. def : InstRW<[THX3T110Write_16Cyc_F01], (instregex "^FDIVSrr", "^FSQRTSr")>;
  1065. // FP divide, D-form
  1066. // FP square root, D-form
  1067. def : InstRW<[THX3T110XWriteFDivDP], (instrs FDIVDrr)>;
  1068. def : InstRW<[THX3T110XWriteFSqrtDP], (instrs FSQRTDr)>;
  1069. def : InstRW<[THX3T110XWriteFDivDP], (instregex "^FDIVv.*64$")>;
  1070. def : InstRW<[THX3T110XWriteFSqrtDP], (instregex "^.*SQRT.*64$")>;
  1071. def : InstRW<[THX3T110Write_23Cyc_F01], (instregex "^FDIVDrr", "^FSQRTDr")>;
  1072. // FP multiply
  1073. // FP multiply accumulate
  1074. def : WriteRes<WriteFMul, [THX3T110FP0123]> {
  1075. let Latency = 6;
  1076. let ResourceCycles = [2];
  1077. let NumMicroOps = 3;
  1078. }
  1079. def THX3T110XWriteFMul : SchedWriteRes<[THX3T110FP0123]> {
  1080. let Latency = 6;
  1081. let ResourceCycles = [2];
  1082. let NumMicroOps = 3;
  1083. }
  1084. def THX3T110XWriteFMulAcc : SchedWriteRes<[THX3T110FP0123]> {
  1085. let Latency = 6;
  1086. let ResourceCycles = [2];
  1087. let NumMicroOps = 3;
  1088. }
  1089. def : InstRW<[THX3T110XWriteFMul], (instregex "^FMUL", "^FNMUL")>;
  1090. def : InstRW<[THX3T110XWriteFMulAcc],
  1091. (instregex "^FMADD", "^FMSUB", "^FNMADD", "^FNMSUB")>;
  1092. // FP round to integral
  1093. def : InstRW<[THX3T110Write_7Cyc_F01],
  1094. (instregex "^FRINT(A|I|M|N|P|X|Z)(Sr|Dr)")>;
  1095. // FP select
  1096. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FCSEL")>;
  1097. //---
  1098. // 3.9 FP Miscellaneous Instructions
  1099. //---
  1100. // FP convert, from vec to vec reg
  1101. // FP convert, from gen to vec reg
  1102. // FP convert, from vec to gen reg
  1103. def : WriteRes<WriteFCvt, [THX3T110FP0123]> {
  1104. let Latency = 7;
  1105. let NumMicroOps = 3;
  1106. }
  1107. // FP move, immed
  1108. // FP move, register
  1109. def : WriteRes<WriteFImm, [THX3T110FP0123]> {
  1110. let Latency = 4;
  1111. let NumMicroOps = 2;
  1112. }
  1113. // FP transfer, from gen to vec reg
  1114. // FP transfer, from vec to gen reg
  1115. def : WriteRes<WriteFCopy, [THX3T110FP0123]> {
  1116. let Latency = 4;
  1117. let NumMicroOps = 2;
  1118. }
  1119. def : InstRW<[THX3T110Write_5Cyc_F01], (instrs FMOVXDHighr, FMOVDXHighr)>;
  1120. //---
  1121. // 3.12 ASIMD Integer Instructions
  1122. //---
  1123. // ASIMD absolute diff, D-form
  1124. // ASIMD absolute diff, Q-form
  1125. // ASIMD absolute diff accum, D-form
  1126. // ASIMD absolute diff accum, Q-form
  1127. // ASIMD absolute diff accum long
  1128. // ASIMD absolute diff long
  1129. // ASIMD arith, basic
  1130. // ASIMD arith, complex
  1131. // ASIMD compare
  1132. // ASIMD logical (AND, BIC, EOR)
  1133. // ASIMD max/min, basic
  1134. // ASIMD max/min, reduce, 4H/4S
  1135. // ASIMD max/min, reduce, 8B/8H
  1136. // ASIMD max/min, reduce, 16B
  1137. // ASIMD multiply, D-form
  1138. // ASIMD multiply, Q-form
  1139. // ASIMD multiply accumulate long
  1140. // ASIMD multiply accumulate saturating long
  1141. // ASIMD multiply long
  1142. // ASIMD pairwise add and accumulate
  1143. // ASIMD shift accumulate
  1144. // ASIMD shift by immed, basic
  1145. // ASIMD shift by immed and insert, basic, D-form
  1146. // ASIMD shift by immed and insert, basic, Q-form
  1147. // ASIMD shift by immed, complex
  1148. // ASIMD shift by register, basic, D-form
  1149. // ASIMD shift by register, basic, Q-form
  1150. // ASIMD shift by register, complex, D-form
  1151. // ASIMD shift by register, complex, Q-form
  1152. def : WriteRes<WriteVd, [THX3T110FP0123]> {
  1153. let Latency = 5;
  1154. let NumMicroOps = 4;
  1155. let ResourceCycles = [4];
  1156. }
  1157. def : WriteRes<WriteVq, [THX3T110FP0123]> {
  1158. let Latency = 5;
  1159. let NumMicroOps = 4;
  1160. let ResourceCycles = [4];
  1161. }
  1162. // ASIMD arith, reduce, 4H/4S
  1163. // ASIMD arith, reduce, 8B/8H
  1164. // ASIMD arith, reduce, 16B
  1165. // ASIMD logical (MVN (alias for NOT), ORN, ORR)
  1166. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1167. (instregex "^ANDv", "^BICv", "^EORv", "^ORRv", "^ORNv", "^NOTv")>;
  1168. // ASIMD arith, reduce
  1169. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1170. (instregex "^ADDVv", "^SADDLVv", "^UADDLVv")>;
  1171. // ASIMD polynomial (8x8) multiply long
  1172. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^(S|U|SQD)MULL")>;
  1173. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1174. (instregex "(S|U|SQD)(MLAL|MLSL|MULL)v.*")>;
  1175. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^PMULL(v8i8|v16i8)")>;
  1176. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^PMULL(v1i64|v2i64)")>;
  1177. // ASIMD absolute diff accum, D-form
  1178. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1179. (instregex "^[SU]ABA(v8i8|v4i16|v2i32)$")>;
  1180. // ASIMD absolute diff accum, Q-form
  1181. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1182. (instregex "^[SU]ABA(v16i8|v8i16|v4i32)$")>;
  1183. // ASIMD absolute diff accum long
  1184. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1185. (instregex "^[SU]ABAL")>;
  1186. // ASIMD arith, reduce, 4H/4S
  1187. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1188. (instregex "^[SU]?ADDL?V(v8i8|v4i16|v2i32)v$")>;
  1189. // ASIMD arith, reduce, 8B
  1190. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1191. (instregex "^[SU]?ADDL?V(v8i16|v4i32)v$")>;
  1192. // ASIMD arith, reduce, 16B/16H
  1193. def : InstRW<[THX3T110Write_10Cyc_F0123],
  1194. (instregex "^[SU]?ADDL?Vv16i8v$")>;
  1195. // ASIMD max/min, reduce, 4H/4S
  1196. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1197. (instregex "^[SU](MIN|MAX)V(v4i16|v4i32)v$")>;
  1198. // ASIMD max/min, reduce, 8B/8H
  1199. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1200. (instregex "^[SU](MIN|MAX)V(v8i8|v8i16)v$")>;
  1201. // ASIMD max/min, reduce, 16B/16H
  1202. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1203. (instregex "^[SU](MIN|MAX)Vv16i8v$")>;
  1204. // ASIMD multiply, D-form
  1205. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1206. (instregex "^(P?MUL|SQR?DMULH)" #
  1207. "(v8i8|v4i16|v2i32|v1i8|v1i16|v1i32|v1i64)" #
  1208. "(_indexed)?$")>;
  1209. // ASIMD multiply, Q-form
  1210. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1211. (instregex "^(P?MUL|SQR?DMULH)(v16i8|v8i16|v4i32)(_indexed)?$")>;
  1212. // ASIMD multiply accumulate, D-form
  1213. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1214. (instregex "^ML[AS](v8i8|v4i16|v2i32)(_indexed)?$")>;
  1215. // ASIMD multiply accumulate, Q-form
  1216. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1217. (instregex "^ML[AS](v16i8|v8i16|v4i32)(_indexed)?$")>;
  1218. // ASIMD shift accumulate
  1219. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1220. (instregex "SRSRAv","SSRAv","URSRAv","USRAv")>;
  1221. // ASIMD shift by immed, basic
  1222. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1223. (instregex "RSHRNv","SHRNv", "SQRSHRNv","SQRSHRUNv",
  1224. "SQSHRNv","SQSHRUNv", "UQRSHRNv",
  1225. "UQSHRNv","SQXTNv","SQXTUNv","UQXTNv")>;
  1226. // ASIMD shift by immed, complex
  1227. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]?(Q|R){1,2}SHR")>;
  1228. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SQSHLU")>;
  1229. // ASIMD shift by register, basic, Q-form
  1230. def : InstRW<[THX3T110Write_5Cyc_F01],
  1231. (instregex "^[SU]SHL(v16i8|v8i16|v4i32|v2i64)")>;
  1232. // ASIMD shift by register, complex, D-form
  1233. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1234. (instregex "^[SU][QR]{1,2}SHL" #
  1235. "(v1i8|v1i16|v1i32|v1i64|v8i8|v4i16|v2i32|b|d|h|s)")>;
  1236. // ASIMD shift by register, complex, Q-form
  1237. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1238. (instregex "^[SU][QR]{1,2}SHL(v16i8|v8i16|v4i32|v2i64)")>;
  1239. // ASIMD Arithmetic
  1240. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1241. (instregex "(ADD|SUB)(v8i8|v4i16|v2i32|v1i64)")>;
  1242. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1243. (instregex "(ADD|SUB)(v16i8|v8i16|v4i32|v2i64)")>;
  1244. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(ADD|SUB)HNv.*")>;
  1245. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(RADD|RSUB)HNv.*")>;
  1246. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1247. (instregex "^SQADD", "^SQNEG", "^SQSUB", "^SRHADD",
  1248. "^SUQADD", "^UQADD", "^UQSUB", "^URHADD", "^USQADD")>;
  1249. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1250. (instregex "ADDP(v16i8|v8i16|v4i32|v2i64)")>;
  1251. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1252. (instregex "((AND|ORN|EOR|EON)S?(Xr[rsi]|v16i8|v8i16|v4i32)|" #
  1253. "(ORR|BIC)S?(Xr[rs]|v16i8|v8i16|v4i32))")>;
  1254. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1255. (instregex "(CLS|CLZ|CNT)(v4i32|v8i16|v16i8)")>;
  1256. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADALP","^UADALP")>;
  1257. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADDLPv","^UADDLPv")>;
  1258. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADDLV","^UADDLV")>;
  1259. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1260. (instregex "^ADDVv","^SMAXVv","^UMAXVv","^SMINVv","^UMINVv")>;
  1261. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1262. (instregex "^SABAv","^UABAv","^SABALv","^UABALv")>;
  1263. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1264. (instregex "^SQADDv","^SQSUBv","^UQADDv","^UQSUBv")>;
  1265. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SUQADDv","^USQADDv")>;
  1266. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1267. (instregex "^ADDHNv","^RADDHNv", "^RSUBHNv",
  1268. "^SQABS", "^SQADD", "^SQNEG", "^SQSUB",
  1269. "^SRHADD", "^SUBHNv", "^SUQADD",
  1270. "^UQADD", "^UQSUB", "^URHADD", "^USQADD")>;
  1271. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1272. (instregex "^CMEQv","^CMGEv","^CMGTv",
  1273. "^CMLEv","^CMLTv", "^CMHIv","^CMHSv")>;
  1274. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1275. (instregex "^SMAXv","^SMINv","^UMAXv","^UMINv",
  1276. "^SMAXPv","^SMINPv","^UMAXPv","^UMINPv")>;
  1277. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1278. (instregex "^SABDv","^UABDv", "^SABDLv","^UABDLv")>;
  1279. //---
  1280. // 3.13 ASIMD Floating-point Instructions
  1281. //---
  1282. // ASIMD FP absolute value
  1283. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FABSv")>;
  1284. // ASIMD FP arith, normal, D-form
  1285. // ASIMD FP arith, normal, Q-form
  1286. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
  1287. (instregex "^FABDv", "^FADDv", "^FSUBv")>;
  1288. // ASIMD FP arith,pairwise, D-form
  1289. // ASIMD FP arith, pairwise, Q-form
  1290. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FADDPv")>;
  1291. // ASIMD FP compare, D-form
  1292. // ASIMD FP compare, Q-form
  1293. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FACGEv", "^FACGTv")>;
  1294. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FCMEQv", "^FCMGEv",
  1295. "^FCMGTv", "^FCMLEv",
  1296. "^FCMLTv")>;
  1297. // ASIMD FP round, D-form
  1298. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1299. (instregex "^FRINT[AIMNPXZ](v2f32)")>;
  1300. // ASIMD FP round, Q-form
  1301. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1302. (instregex "^FRINT[AIMNPXZ](v4f32|v2f64)")>;
  1303. // ASIMD FP convert, long
  1304. // ASIMD FP convert, narrow
  1305. // ASIMD FP convert, other, D-form
  1306. // ASIMD FP convert, other, Q-form
  1307. // NOTE: Handled by WriteV.
  1308. // ASIMD FP convert, long and narrow
  1309. def : InstRW<[THX3T110Write_5Cyc_F01], (instregex "^FCVT(L|N|XN)v")>;
  1310. // ASIMD FP convert, other, D-form
  1311. def : InstRW<[THX3T110Write_5Cyc_F01],
  1312. (instregex "^[FVSU]CVT([AMNPZ][SU])?(_Int)?(v2f32|v1i32|v2i32|v1i64)")>;
  1313. // ASIMD FP convert, other, Q-form
  1314. def : InstRW<[THX3T110Write_5Cyc_F01],
  1315. (instregex "^[FVSU]CVT([AMNPZ][SU])?(_Int)?(v4f32|v2f64|v4i32|v2i64)")>;
  1316. // ASIMD FP divide, D-form, F32
  1317. def : InstRW<[THX3T110Write_16Cyc_F0123], (instrs FDIVv2f32)>;
  1318. def : InstRW<[THX3T110Write_16Cyc_F0123], (instregex "FDIVv2f32")>;
  1319. // ASIMD FP divide, Q-form, F32
  1320. def : InstRW<[THX3T110Write_16Cyc_F0123], (instrs FDIVv4f32)>;
  1321. def : InstRW<[THX3T110Write_16Cyc_F0123], (instregex "FDIVv4f32")>;
  1322. // ASIMD FP divide, Q-form, F64
  1323. def : InstRW<[THX3T110Write_23Cyc_F0123], (instrs FDIVv2f64)>;
  1324. def : InstRW<[THX3T110Write_23Cyc_F0123], (instregex "FDIVv2f64")>;
  1325. // ASIMD FP max/min, normal, D-form
  1326. // ASIMD FP max/min, normal, Q-form
  1327. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXv", "^FMAXNMv",
  1328. "^FMINv", "^FMINNMv")>;
  1329. // ASIMD FP max/min, pairwise, D-form
  1330. // ASIMD FP max/min, pairwise, Q-form
  1331. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXPv", "^FMAXNMPv",
  1332. "^FMINPv", "^FMINNMPv")>;
  1333. // ASIMD FP max/min, reduce
  1334. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXVv", "^FMAXNMVv",
  1335. "^FMINVv", "^FMINNMVv")>;
  1336. // ASIMD FP multiply, D-form, FZ
  1337. // ASIMD FP multiply, D-form, no FZ
  1338. // ASIMD FP multiply, Q-form, FZ
  1339. // ASIMD FP multiply, Q-form, no FZ
  1340. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1341. (instregex "^FMULv", "^FMULXv")>;
  1342. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1343. (instregex "^FMULX?(v2f32|v1i32|v2i32|v1i64|32|64)")>;
  1344. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1345. (instregex "^FMULX?(v4f32|v2f64|v4i32|v2i64)")>;
  1346. // ASIMD FP multiply accumulate, Dform, FZ
  1347. // ASIMD FP multiply accumulate, Dform, no FZ
  1348. // ASIMD FP multiply accumulate, Qform, FZ
  1349. // ASIMD FP multiply accumulate, Qform, no FZ
  1350. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1351. (instregex "^FMLAv", "^FMLSv")>;
  1352. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1353. (instregex "^FML[AS](v2f32|v1i32|v2i32|v1i64)")>;
  1354. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1355. (instregex "^FML[AS](v4f32|v2f64|v4i32|v2i64)")>;
  1356. // ASIMD FP negate
  1357. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FNEGv")>;
  1358. //--
  1359. // 3.14 ASIMD Miscellaneous Instructions
  1360. //--
  1361. // ASIMD bit reverse
  1362. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^RBITv")>;
  1363. // ASIMD bitwise insert, D-form
  1364. // ASIMD bitwise insert, Q-form
  1365. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
  1366. (instregex "^BIFv", "^BITv", "^BSLv")>;
  1367. // ASIMD count, D-form
  1368. // ASIMD count, Q-form
  1369. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
  1370. (instregex "^CLSv", "^CLZv", "^CNTv")>;
  1371. // ASIMD duplicate, gen reg
  1372. // ASIMD duplicate, element
  1373. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUPv")>;
  1374. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUP(i8|i16|i32|i64)$")>;
  1375. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUPv.+gpr")>;
  1376. // ASIMD extract
  1377. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^EXTv")>;
  1378. // ASIMD extract narrow
  1379. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^XTNv")>;
  1380. // ASIMD extract narrow, saturating
  1381. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1382. (instregex "^SQXTNv", "^SQXTUNv", "^UQXTNv")>;
  1383. // ASIMD insert, element to element
  1384. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^INSv")>;
  1385. // ASIMD transfer, element to gen reg
  1386. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]MOVv")>;
  1387. // ASIMD move, integer immed
  1388. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^MOVIv")>;
  1389. // ASIMD move, FP immed
  1390. def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FMOVv")>;
  1391. // ASIMD transpose
  1392. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^TRN1", "^TRN2")>;
  1393. // ASIMD unzip/zip
  1394. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1395. (instregex "^UZP1", "^UZP2", "^ZIP1", "^ZIP2")>;
  1396. // ASIMD reciprocal estimate, D-form
  1397. // ASIMD reciprocal estimate, Q-form
  1398. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1399. (instregex "^FRECPEv", "^FRECPXv", "^URECPEv",
  1400. "^FRSQRTEv", "^URSQRTEv")>;
  1401. // ASIMD reciprocal step, D-form, FZ
  1402. // ASIMD reciprocal step, D-form, no FZ
  1403. // ASIMD reciprocal step, Q-form, FZ
  1404. // ASIMD reciprocal step, Q-form, no FZ
  1405. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1406. (instregex "^FRECPSv", "^FRSQRTSv")>;
  1407. // ASIMD reverse
  1408. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1409. (instregex "^REV16v", "^REV32v", "^REV64v")>;
  1410. // ASIMD table lookup, D-form
  1411. // ASIMD table lookup, Q-form
  1412. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1413. (instrs TBLv8i8One, TBLv16i8One, TBXv8i8One, TBXv16i8One)>;
  1414. def : InstRW<[THX3T110Write_10Cyc_F0123],
  1415. (instrs TBLv8i8Two, TBLv16i8Two, TBXv8i8Two, TBXv16i8Two)>;
  1416. def : InstRW<[THX3T110Write_15Cyc_F0123],
  1417. (instrs TBLv8i8Three, TBLv16i8Three, TBXv8i8Three, TBXv16i8Three)>;
  1418. def : InstRW<[THX3T110Write_20Cyc_F0123],
  1419. (instrs TBLv8i8Four, TBLv16i8Four, TBXv8i8Four, TBXv16i8Four)>;
  1420. // ASIMD transfer, element to word or word
  1421. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]MOVv")>;
  1422. // ASIMD transfer, element to gen reg
  1423. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(S|U)MOVv.*")>;
  1424. // ASIMD transfer gen reg to element
  1425. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^INSv")>;
  1426. // ASIMD transpose
  1427. def : InstRW<[THX3T110Write_5Cyc_F0123],
  1428. (instregex "^TRN1v", "^TRN2v", "^UZP1v", "^UZP2v")>;
  1429. // ASIMD unzip/zip
  1430. def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^ZIP1v", "^ZIP2v")>;
  1431. //--
  1432. // 3.15 ASIMD Load Instructions
  1433. //--
  1434. // ASIMD load, 1 element, multiple, 1 reg, D-form
  1435. // ASIMD load, 1 element, multiple, 1 reg, Q-form
  1436. def : InstRW<[THX3T110Write_4Cyc_LS01],
  1437. (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1438. def : InstRW<[THX3T110Write_4Cyc_LS01, WriteAdr],
  1439. (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1440. // ASIMD load, 1 element, multiple, 2 reg, D-form
  1441. // ASIMD load, 1 element, multiple, 2 reg, Q-form
  1442. def : InstRW<[THX3T110Write_4Cyc_LS01],
  1443. (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1444. def : InstRW<[THX3T110Write_4Cyc_LS01, WriteAdr],
  1445. (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1446. // ASIMD load, 1 element, multiple, 3 reg, D-form
  1447. // ASIMD load, 1 element, multiple, 3 reg, Q-form
  1448. def : InstRW<[THX3T110Write_5Cyc_LS01],
  1449. (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1450. def : InstRW<[THX3T110Write_5Cyc_LS01, WriteAdr],
  1451. (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1452. // ASIMD load, 1 element, multiple, 4 reg, D-form
  1453. // ASIMD load, 1 element, multiple, 4 reg, Q-form
  1454. def : InstRW<[THX3T110Write_6Cyc_LS01],
  1455. (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1456. def : InstRW<[THX3T110Write_6Cyc_LS01, WriteAdr],
  1457. (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1458. // ASIMD load, 1 element, one lane, B/H/S
  1459. // ASIMD load, 1 element, one lane, D
  1460. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
  1461. (instregex "^LD1i(8|16|32|64)$")>;
  1462. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
  1463. (instregex "^LD1i(8|16|32|64)_POST$")>;
  1464. // ASIMD load, 1 element, all lanes, D-form, B/H/S
  1465. // ASIMD load, 1 element, all lanes, D-form, D
  1466. // ASIMD load, 1 element, all lanes, Q-form
  1467. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
  1468. (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1469. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
  1470. (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1471. // ASIMD load, 2 element, multiple, D-form, B/H/S
  1472. // ASIMD load, 2 element, multiple, Q-form, D
  1473. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
  1474. (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
  1475. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
  1476. (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
  1477. // ASIMD load, 2 element, one lane, B/H
  1478. // ASIMD load, 2 element, one lane, S
  1479. // ASIMD load, 2 element, one lane, D
  1480. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
  1481. (instregex "^LD2i(8|16|32|64)$")>;
  1482. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
  1483. (instregex "^LD2i(8|16|32|64)_POST$")>;
  1484. // ASIMD load, 2 element, all lanes, D-form, B/H/S
  1485. // ASIMD load, 2 element, all lanes, D-form, D
  1486. // ASIMD load, 2 element, all lanes, Q-form
  1487. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
  1488. (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1489. def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
  1490. (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1491. // ASIMD load, 3 element, multiple, D-form, B/H/S
  1492. // ASIMD load, 3 element, multiple, Q-form, B/H/S
  1493. // ASIMD load, 3 element, multiple, Q-form, D
  1494. def : InstRW<[THX3T110Write_8Cyc_LS01_F0123],
  1495. (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
  1496. def : InstRW<[THX3T110Write_8Cyc_LS01_F0123, WriteAdr],
  1497. (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
  1498. // ASIMD load, 3 element, one lone, B/H
  1499. // ASIMD load, 3 element, one lane, S
  1500. // ASIMD load, 3 element, one lane, D
  1501. def : InstRW<[THX3T110Write_7Cyc_LS01_F0123],
  1502. (instregex "^LD3i(8|16|32|64)$")>;
  1503. def : InstRW<[THX3T110Write_7Cyc_LS01_F0123, WriteAdr],
  1504. (instregex "^LD3i(8|16|32|64)_POST$")>;
  1505. // ASIMD load, 3 element, all lanes, D-form, B/H/S
  1506. // ASIMD load, 3 element, all lanes, D-form, D
  1507. // ASIMD load, 3 element, all lanes, Q-form, B/H/S
  1508. // ASIMD load, 3 element, all lanes, Q-form, D
  1509. def : InstRW<[THX3T110Write_7Cyc_LS01_F0123],
  1510. (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1511. def : InstRW<[THX3T110Write_7Cyc_LS01_F0123, WriteAdr],
  1512. (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1513. // ASIMD load, 4 element, multiple, D-form, B/H/S
  1514. // ASIMD load, 4 element, multiple, Q-form, B/H/S
  1515. // ASIMD load, 4 element, multiple, Q-form, D
  1516. def : InstRW<[THX3T110Write_8Cyc_LS01_F0123],
  1517. (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
  1518. def : InstRW<[THX3T110Write_8Cyc_LS01_F0123, WriteAdr],
  1519. (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
  1520. // ASIMD load, 4 element, one lane, B/H
  1521. // ASIMD load, 4 element, one lane, S
  1522. // ASIMD load, 4 element, one lane, D
  1523. def : InstRW<[THX3T110Write_6Cyc_LS01_F0123],
  1524. (instregex "^LD4i(8|16|32|64)$")>;
  1525. def : InstRW<[THX3T110Write_6Cyc_LS01_F0123, WriteAdr],
  1526. (instregex "^LD4i(8|16|32|64)_POST$")>;
  1527. // ASIMD load, 4 element, all lanes, D-form, B/H/S
  1528. // ASIMD load, 4 element, all lanes, D-form, D
  1529. // ASIMD load, 4 element, all lanes, Q-form, B/H/S
  1530. // ASIMD load, 4 element, all lanes, Q-form, D
  1531. def : InstRW<[THX3T110Write_6Cyc_LS01_F0123],
  1532. (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1533. def : InstRW<[THX3T110Write_6Cyc_LS01_F0123, WriteAdr],
  1534. (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1535. //--
  1536. // 3.16 ASIMD Store Instructions
  1537. //--
  1538. // ASIMD store, 1 element, multiple, 1 reg, D-form
  1539. // ASIMD store, 1 element, multiple, 1 reg, Q-form
  1540. def : InstRW<[THX3T110Write_1Cyc_LS01],
  1541. (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1542. def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
  1543. (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1544. // ASIMD store, 1 element, multiple, 2 reg, D-form
  1545. // ASIMD store, 1 element, multiple, 2 reg, Q-form
  1546. def : InstRW<[THX3T110Write_1Cyc_LS01],
  1547. (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1548. def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
  1549. (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1550. // ASIMD store, 1 element, multiple, 3 reg, D-form
  1551. // ASIMD store, 1 element, multiple, 3 reg, Q-form
  1552. def : InstRW<[THX3T110Write_1Cyc_LS01],
  1553. (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1554. def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
  1555. (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1556. // ASIMD store, 1 element, multiple, 4 reg, D-form
  1557. // ASIMD store, 1 element, multiple, 4 reg, Q-form
  1558. def : InstRW<[THX3T110Write_1Cyc_LS01],
  1559. (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
  1560. def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
  1561. (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
  1562. // ASIMD store, 1 element, one lane, B/H/S
  1563. // ASIMD store, 1 element, one lane, D
  1564. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1565. (instregex "^ST1i(8|16|32|64)$")>;
  1566. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1567. (instregex "^ST1i(8|16|32|64)_POST$")>;
  1568. // ASIMD store, 2 element, multiple, D-form, B/H/S
  1569. // ASIMD store, 2 element, multiple, Q-form, B/H/S
  1570. // ASIMD store, 2 element, multiple, Q-form, D
  1571. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1572. (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
  1573. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1574. (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
  1575. // ASIMD store, 2 element, one lane, B/H/S
  1576. // ASIMD store, 2 element, one lane, D
  1577. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1578. (instregex "^ST2i(8|16|32|64)$")>;
  1579. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1580. (instregex "^ST2i(8|16|32|64)_POST$")>;
  1581. // ASIMD store, 3 element, multiple, D-form, B/H/S
  1582. // ASIMD store, 3 element, multiple, Q-form, B/H/S
  1583. // ASIMD store, 3 element, multiple, Q-form, D
  1584. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1585. (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
  1586. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1587. (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
  1588. // ASIMD store, 3 element, one lane, B/H
  1589. // ASIMD store, 3 element, one lane, S
  1590. // ASIMD store, 3 element, one lane, D
  1591. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1592. (instregex "^ST3i(8|16|32|64)$")>;
  1593. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1594. (instregex "^ST3i(8|16|32|64)_POST$")>;
  1595. // ASIMD store, 4 element, multiple, D-form, B/H/S
  1596. // ASIMD store, 4 element, multiple, Q-form, B/H/S
  1597. // ASIMD store, 4 element, multiple, Q-form, D
  1598. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1599. (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
  1600. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1601. (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
  1602. // ASIMD store, 4 element, one lane, B/H
  1603. // ASIMD store, 4 element, one lane, S
  1604. // ASIMD store, 4 element, one lane, D
  1605. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
  1606. (instregex "^ST4i(8|16|32|64)$")>;
  1607. def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
  1608. (instregex "^ST4i(8|16|32|64)_POST$")>;
  1609. // V8.1a Atomics (LSE)
  1610. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1611. (instrs CASB, CASH, CASW, CASX)>;
  1612. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1613. (instrs CASAB, CASAH, CASAW, CASAX)>;
  1614. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1615. (instrs CASLB, CASLH, CASLW, CASLX)>;
  1616. def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
  1617. (instrs CASALB, CASALH, CASALW, CASALX)>;
  1618. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1619. (instrs LDLARB, LDLARH, LDLARW, LDLARX)>;
  1620. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1621. (instrs LDADDB, LDADDH, LDADDW, LDADDX)>;
  1622. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1623. (instrs LDADDAB, LDADDAH, LDADDAW, LDADDAX)>;
  1624. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1625. (instrs LDADDLB, LDADDLH, LDADDLW, LDADDLX)>;
  1626. def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
  1627. (instrs LDADDALB, LDADDALH, LDADDALW, LDADDALX)>;
  1628. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1629. (instrs LDCLRB, LDCLRH, LDCLRW, LDCLRX)>;
  1630. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1631. (instrs LDCLRAB, LDCLRAH, LDCLRAW, LDCLRAX)>;
  1632. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1633. (instrs LDCLRLB, LDCLRLH, LDCLRLW, LDCLRLX)>;
  1634. def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
  1635. (instrs LDCLRALB, LDCLRALH, LDCLRALW, LDCLRALX)>;
  1636. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1637. (instrs LDEORB, LDEORH, LDEORW, LDEORX)>;
  1638. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1639. (instrs LDEORAB, LDEORAH, LDEORAW, LDEORAX)>;
  1640. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1641. (instrs LDEORLB, LDEORLH, LDEORLW, LDEORLX)>;
  1642. def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
  1643. (instrs LDEORALB, LDEORALH, LDEORALW, LDEORALX)>;
  1644. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1645. (instrs LDSETB, LDSETH, LDSETW, LDSETX)>;
  1646. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1647. (instrs LDSETAB, LDSETAH, LDSETAW, LDSETAX)>;
  1648. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1649. (instrs LDSETLB, LDSETLH, LDSETLW, LDSETLX)>;
  1650. def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
  1651. (instrs LDSETALB, LDSETALH, LDSETALW, LDSETALX)>;
  1652. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1653. (instrs LDSMAXB, LDSMAXH, LDSMAXW, LDSMAXX,
  1654. LDSMAXAB, LDSMAXAH, LDSMAXAW, LDSMAXAX,
  1655. LDSMAXLB, LDSMAXLH, LDSMAXLW, LDSMAXLX,
  1656. LDSMAXALB, LDSMAXALH, LDSMAXALW, LDSMAXALX)>;
  1657. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1658. (instrs LDSMINB, LDSMINH, LDSMINW, LDSMINX,
  1659. LDSMINAB, LDSMINAH, LDSMINAW, LDSMINAX,
  1660. LDSMINLB, LDSMINLH, LDSMINLW, LDSMINLX,
  1661. LDSMINALB, LDSMINALH, LDSMINALW, LDSMINALX)>;
  1662. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1663. (instrs LDUMAXB, LDUMAXH, LDUMAXW, LDUMAXX,
  1664. LDUMAXAB, LDUMAXAH, LDUMAXAW, LDUMAXAX,
  1665. LDUMAXLB, LDUMAXLH, LDUMAXLW, LDUMAXLX,
  1666. LDUMAXALB, LDUMAXALH, LDUMAXALW, LDUMAXALX)>;
  1667. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1668. (instrs LDUMINB, LDUMINH, LDUMINW, LDUMINX,
  1669. LDUMINAB, LDUMINAH, LDUMINAW, LDUMINAX,
  1670. LDUMINLB, LDUMINLH, LDUMINLW, LDUMINLX,
  1671. LDUMINALB, LDUMINALH, LDUMINALW, LDUMINALX)>;
  1672. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1673. (instrs SWPB, SWPH, SWPW, SWPX)>;
  1674. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1675. (instrs SWPAB, SWPAH, SWPAW, SWPAX)>;
  1676. def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
  1677. (instrs SWPLB, SWPLH, SWPLW, SWPLX)>;
  1678. def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
  1679. (instrs SWPALB, SWPALH, SWPALW, SWPALX)>;
  1680. def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
  1681. (instrs STLLRB, STLLRH, STLLRW, STLLRX)>;
  1682. // V8.3a PAC
  1683. def : InstRW<[THX3T110Write_11Cyc_LS01_I1], (instregex "^LDRAA", "^LDRAB")>;
  1684. def : InstRW<[THX3T110Write_8Cyc_I123],
  1685. (instrs BLRAA, BLRAAZ, BLRAB, BLRABZ,
  1686. BRAA, BRAAZ, BRAB, BRABZ)>;
  1687. def : InstRW<[THX3T110Write_8Cyc_I123], (instrs RETAA, RETAB)>;
  1688. } // SchedModel = ThunderX3T110Model