AArch64SchedThunderX3T110.td 69 KB

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