ARMScheduleV6.td 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. //===-- ARMScheduleV6.td - ARM v6 Scheduling Definitions ---*- tablegen -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines the itinerary class data for the ARM v6 processors.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. // Model based on ARM1176
  13. //
  14. // Functional Units
  15. def V6_Pipe : FuncUnit; // pipeline
  16. // Scheduling information derived from "ARM1176JZF-S Technical Reference Manual"
  17. //
  18. def ARMV6Itineraries : ProcessorItineraries<
  19. [V6_Pipe], [], [
  20. //
  21. // No operand cycles
  22. InstrItinData<IIC_iALUx , [InstrStage<1, [V6_Pipe]>]>,
  23. //
  24. // Binary Instructions that produce a result
  25. InstrItinData<IIC_iALUi , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  26. InstrItinData<IIC_iALUr , [InstrStage<1, [V6_Pipe]>], [2, 2, 2]>,
  27. InstrItinData<IIC_iALUsi , [InstrStage<1, [V6_Pipe]>], [2, 2, 1]>,
  28. InstrItinData<IIC_iALUsr , [InstrStage<2, [V6_Pipe]>], [3, 3, 2, 1]>,
  29. //
  30. // Bitwise Instructions that produce a result
  31. InstrItinData<IIC_iBITi , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  32. InstrItinData<IIC_iBITr , [InstrStage<1, [V6_Pipe]>], [2, 2, 2]>,
  33. InstrItinData<IIC_iBITsi , [InstrStage<1, [V6_Pipe]>], [2, 2, 1]>,
  34. InstrItinData<IIC_iBITsr , [InstrStage<2, [V6_Pipe]>], [3, 3, 2, 1]>,
  35. //
  36. // Unary Instructions that produce a result
  37. InstrItinData<IIC_iUNAr , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  38. InstrItinData<IIC_iUNAsi , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  39. //
  40. // Zero and sign extension instructions
  41. InstrItinData<IIC_iEXTr , [InstrStage<1, [V6_Pipe]>], [1, 1]>,
  42. InstrItinData<IIC_iEXTAr , [InstrStage<1, [V6_Pipe]>], [2, 2, 1]>,
  43. InstrItinData<IIC_iEXTAsr , [InstrStage<2, [V6_Pipe]>], [3, 3, 2, 1]>,
  44. //
  45. // Compare instructions
  46. InstrItinData<IIC_iCMPi , [InstrStage<1, [V6_Pipe]>], [2]>,
  47. InstrItinData<IIC_iCMPr , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  48. InstrItinData<IIC_iCMPsi , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  49. InstrItinData<IIC_iCMPsr , [InstrStage<2, [V6_Pipe]>], [3, 2, 1]>,
  50. //
  51. // Test instructions
  52. InstrItinData<IIC_iTSTi , [InstrStage<1, [V6_Pipe]>], [2]>,
  53. InstrItinData<IIC_iTSTr , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  54. InstrItinData<IIC_iTSTsi , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  55. InstrItinData<IIC_iTSTsr , [InstrStage<2, [V6_Pipe]>], [3, 2, 1]>,
  56. //
  57. // Move instructions, unconditional
  58. InstrItinData<IIC_iMOVi , [InstrStage<1, [V6_Pipe]>], [2]>,
  59. InstrItinData<IIC_iMOVr , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  60. InstrItinData<IIC_iMOVsi , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  61. InstrItinData<IIC_iMOVsr , [InstrStage<2, [V6_Pipe]>], [3, 2, 1]>,
  62. InstrItinData<IIC_iMOVix2 , [InstrStage<1, [V6_Pipe]>,
  63. InstrStage<1, [V6_Pipe]>], [2]>,
  64. InstrItinData<IIC_iMOVix2addpc,[InstrStage<1, [V6_Pipe]>,
  65. InstrStage<1, [V6_Pipe]>,
  66. InstrStage<1, [V6_Pipe]>], [3]>,
  67. InstrItinData<IIC_iMOVix2ld , [InstrStage<1, [V6_Pipe]>,
  68. InstrStage<1, [V6_Pipe]>,
  69. InstrStage<1, [V6_Pipe]>], [5]>,
  70. //
  71. // Move instructions, conditional
  72. InstrItinData<IIC_iCMOVi , [InstrStage<1, [V6_Pipe]>], [3]>,
  73. InstrItinData<IIC_iCMOVr , [InstrStage<1, [V6_Pipe]>], [3, 2]>,
  74. InstrItinData<IIC_iCMOVsi , [InstrStage<1, [V6_Pipe]>], [3, 1]>,
  75. InstrItinData<IIC_iCMOVsr , [InstrStage<1, [V6_Pipe]>], [4, 2, 1]>,
  76. InstrItinData<IIC_iCMOVix2 , [InstrStage<1, [V6_Pipe]>,
  77. InstrStage<1, [V6_Pipe]>], [4]>,
  78. //
  79. // MVN instructions
  80. InstrItinData<IIC_iMVNi , [InstrStage<1, [V6_Pipe]>], [2]>,
  81. InstrItinData<IIC_iMVNr , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  82. InstrItinData<IIC_iMVNsi , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  83. InstrItinData<IIC_iMVNsr , [InstrStage<2, [V6_Pipe]>], [3, 2, 1]>,
  84. // Integer multiply pipeline
  85. //
  86. InstrItinData<IIC_iMUL16 , [InstrStage<1, [V6_Pipe]>], [4, 1, 1]>,
  87. InstrItinData<IIC_iMAC16 , [InstrStage<1, [V6_Pipe]>], [4, 1, 1, 2]>,
  88. InstrItinData<IIC_iMUL32 , [InstrStage<2, [V6_Pipe]>], [5, 1, 1]>,
  89. InstrItinData<IIC_iMAC32 , [InstrStage<2, [V6_Pipe]>], [5, 1, 1, 2]>,
  90. InstrItinData<IIC_iMUL64 , [InstrStage<3, [V6_Pipe]>], [6, 1, 1]>,
  91. InstrItinData<IIC_iMAC64 , [InstrStage<3, [V6_Pipe]>], [6, 1, 1, 2]>,
  92. // Integer load pipeline
  93. //
  94. // Immediate offset
  95. InstrItinData<IIC_iLoad_i , [InstrStage<1, [V6_Pipe]>], [4, 1]>,
  96. InstrItinData<IIC_iLoad_bh_i, [InstrStage<1, [V6_Pipe]>], [4, 1]>,
  97. InstrItinData<IIC_iLoad_d_i , [InstrStage<1, [V6_Pipe]>], [4, 1]>,
  98. //
  99. // Register offset
  100. InstrItinData<IIC_iLoad_r , [InstrStage<1, [V6_Pipe]>], [4, 1, 1]>,
  101. InstrItinData<IIC_iLoad_bh_r, [InstrStage<1, [V6_Pipe]>], [4, 1, 1]>,
  102. InstrItinData<IIC_iLoad_d_r , [InstrStage<1, [V6_Pipe]>], [4, 1, 1]>,
  103. //
  104. // Scaled register offset, issues over 2 cycles
  105. InstrItinData<IIC_iLoad_si , [InstrStage<2, [V6_Pipe]>], [5, 2, 1]>,
  106. InstrItinData<IIC_iLoad_bh_si, [InstrStage<2, [V6_Pipe]>], [5, 2, 1]>,
  107. //
  108. // Immediate offset with update
  109. InstrItinData<IIC_iLoad_iu , [InstrStage<1, [V6_Pipe]>], [4, 2, 1]>,
  110. InstrItinData<IIC_iLoad_bh_iu, [InstrStage<1, [V6_Pipe]>], [4, 2, 1]>,
  111. //
  112. // Register offset with update
  113. InstrItinData<IIC_iLoad_ru , [InstrStage<1, [V6_Pipe]>], [4, 2, 1, 1]>,
  114. InstrItinData<IIC_iLoad_bh_ru, [InstrStage<1, [V6_Pipe]>], [4, 2, 1, 1]>,
  115. InstrItinData<IIC_iLoad_d_ru , [InstrStage<1, [V6_Pipe]>], [4, 2, 1, 1]>,
  116. //
  117. // Scaled register offset with update, issues over 2 cycles
  118. InstrItinData<IIC_iLoad_siu, [InstrStage<2, [V6_Pipe]>], [5, 2, 2, 1]>,
  119. InstrItinData<IIC_iLoad_bh_siu,[InstrStage<2, [V6_Pipe]>], [5, 2, 2, 1]>,
  120. //
  121. // Load multiple, def is the 5th operand.
  122. InstrItinData<IIC_iLoad_m , [InstrStage<3, [V6_Pipe]>], [1, 1, 1, 1, 4]>,
  123. //
  124. // Load multiple + update, defs are the 1st and 5th operands.
  125. InstrItinData<IIC_iLoad_mu , [InstrStage<3, [V6_Pipe]>], [2, 1, 1, 1, 4]>,
  126. //
  127. // Load multiple plus branch
  128. InstrItinData<IIC_iLoad_mBr, [InstrStage<3, [V6_Pipe]>,
  129. InstrStage<1, [V6_Pipe]>], [1, 2, 1, 1, 4]>,
  130. //
  131. // iLoadi + iALUr for t2LDRpci_pic.
  132. InstrItinData<IIC_iLoadiALU, [InstrStage<1, [V6_Pipe]>,
  133. InstrStage<1, [V6_Pipe]>], [3, 1]>,
  134. //
  135. // Pop, def is the 3rd operand.
  136. InstrItinData<IIC_iPop , [InstrStage<3, [V6_Pipe]>], [1, 1, 4]>,
  137. //
  138. // Pop + branch, def is the 3rd operand.
  139. InstrItinData<IIC_iPop_Br, [InstrStage<3, [V6_Pipe]>,
  140. InstrStage<1, [V6_Pipe]>], [1, 2, 4]>,
  141. // Integer store pipeline
  142. //
  143. // Immediate offset
  144. InstrItinData<IIC_iStore_i , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  145. InstrItinData<IIC_iStore_bh_i, [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  146. InstrItinData<IIC_iStore_d_i , [InstrStage<1, [V6_Pipe]>], [2, 1]>,
  147. //
  148. // Register offset
  149. InstrItinData<IIC_iStore_r , [InstrStage<1, [V6_Pipe]>], [2, 1, 1]>,
  150. InstrItinData<IIC_iStore_bh_r, [InstrStage<1, [V6_Pipe]>], [2, 1, 1]>,
  151. InstrItinData<IIC_iStore_d_r , [InstrStage<1, [V6_Pipe]>], [2, 1, 1]>,
  152. //
  153. // Scaled register offset, issues over 2 cycles
  154. InstrItinData<IIC_iStore_si , [InstrStage<2, [V6_Pipe]>], [2, 2, 1]>,
  155. InstrItinData<IIC_iStore_bh_si, [InstrStage<2, [V6_Pipe]>], [2, 2, 1]>,
  156. //
  157. // Immediate offset with update
  158. InstrItinData<IIC_iStore_iu , [InstrStage<1, [V6_Pipe]>], [2, 2, 1]>,
  159. InstrItinData<IIC_iStore_bh_iu, [InstrStage<1, [V6_Pipe]>], [2, 2, 1]>,
  160. //
  161. // Register offset with update
  162. InstrItinData<IIC_iStore_ru, [InstrStage<1, [V6_Pipe]>], [2, 2, 1, 1]>,
  163. InstrItinData<IIC_iStore_bh_ru,[InstrStage<1, [V6_Pipe]>], [2, 2, 1, 1]>,
  164. InstrItinData<IIC_iStore_d_ru, [InstrStage<1, [V6_Pipe]>], [2, 2, 1, 1]>,
  165. //
  166. // Scaled register offset with update, issues over 2 cycles
  167. InstrItinData<IIC_iStore_siu, [InstrStage<2, [V6_Pipe]>], [2, 2, 2, 1]>,
  168. InstrItinData<IIC_iStore_bh_siu,[InstrStage<2, [V6_Pipe]>], [2, 2, 2, 1]>,
  169. //
  170. // Store multiple
  171. InstrItinData<IIC_iStore_m , [InstrStage<3, [V6_Pipe]>]>,
  172. //
  173. // Store multiple + update
  174. InstrItinData<IIC_iStore_mu , [InstrStage<3, [V6_Pipe]>], [2]>,
  175. // Branch
  176. //
  177. // no delay slots, so the latency of a branch is unimportant
  178. InstrItinData<IIC_Br , [InstrStage<1, [V6_Pipe]>]>,
  179. // VFP
  180. // Issue through integer pipeline, and execute in NEON unit. We assume
  181. // RunFast mode so that NFP pipeline is used for single-precision when
  182. // possible.
  183. //
  184. // FP Special Register to Integer Register File Move
  185. InstrItinData<IIC_fpSTAT , [InstrStage<1, [V6_Pipe]>], [3]>,
  186. //
  187. // Single-precision FP Unary
  188. InstrItinData<IIC_fpUNA32 , [InstrStage<1, [V6_Pipe]>], [5, 2]>,
  189. //
  190. // Double-precision FP Unary
  191. InstrItinData<IIC_fpUNA64 , [InstrStage<1, [V6_Pipe]>], [5, 2]>,
  192. //
  193. // Single-precision FP Compare
  194. InstrItinData<IIC_fpCMP32 , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  195. //
  196. // Double-precision FP Compare
  197. InstrItinData<IIC_fpCMP64 , [InstrStage<1, [V6_Pipe]>], [2, 2]>,
  198. //
  199. // Single to Double FP Convert
  200. InstrItinData<IIC_fpCVTSD , [InstrStage<1, [V6_Pipe]>], [5, 2]>,
  201. //
  202. // Double to Single FP Convert
  203. InstrItinData<IIC_fpCVTDS , [InstrStage<1, [V6_Pipe]>], [5, 2]>,
  204. //
  205. // Single-Precision FP to Integer Convert
  206. InstrItinData<IIC_fpCVTSI , [InstrStage<1, [V6_Pipe]>], [9, 2]>,
  207. //
  208. // Double-Precision FP to Integer Convert
  209. InstrItinData<IIC_fpCVTDI , [InstrStage<1, [V6_Pipe]>], [9, 2]>,
  210. //
  211. // Integer to Single-Precision FP Convert
  212. InstrItinData<IIC_fpCVTIS , [InstrStage<1, [V6_Pipe]>], [9, 2]>,
  213. //
  214. // Integer to Double-Precision FP Convert
  215. InstrItinData<IIC_fpCVTID , [InstrStage<1, [V6_Pipe]>], [9, 2]>,
  216. //
  217. // Single-precision FP ALU
  218. InstrItinData<IIC_fpALU32 , [InstrStage<1, [V6_Pipe]>], [9, 2, 2]>,
  219. //
  220. // Double-precision FP ALU
  221. InstrItinData<IIC_fpALU64 , [InstrStage<1, [V6_Pipe]>], [9, 2, 2]>,
  222. //
  223. // Single-precision FP Multiply
  224. InstrItinData<IIC_fpMUL32 , [InstrStage<1, [V6_Pipe]>], [9, 2, 2]>,
  225. //
  226. // Double-precision FP Multiply
  227. InstrItinData<IIC_fpMUL64 , [InstrStage<2, [V6_Pipe]>], [9, 2, 2]>,
  228. //
  229. // Single-precision FP MAC
  230. InstrItinData<IIC_fpMAC32 , [InstrStage<1, [V6_Pipe]>], [9, 2, 2, 2]>,
  231. //
  232. // Double-precision FP MAC
  233. InstrItinData<IIC_fpMAC64 , [InstrStage<2, [V6_Pipe]>], [9, 2, 2, 2]>,
  234. //
  235. // Single-precision Fused FP MAC
  236. InstrItinData<IIC_fpFMAC32, [InstrStage<1, [V6_Pipe]>], [9, 2, 2, 2]>,
  237. //
  238. // Double-precision Fused FP MAC
  239. InstrItinData<IIC_fpFMAC64, [InstrStage<2, [V6_Pipe]>], [9, 2, 2, 2]>,
  240. //
  241. // Single-precision FP DIV
  242. InstrItinData<IIC_fpDIV32 , [InstrStage<15, [V6_Pipe]>], [20, 2, 2]>,
  243. //
  244. // Double-precision FP DIV
  245. InstrItinData<IIC_fpDIV64 , [InstrStage<29, [V6_Pipe]>], [34, 2, 2]>,
  246. //
  247. // Single-precision FP SQRT
  248. InstrItinData<IIC_fpSQRT32 , [InstrStage<15, [V6_Pipe]>], [20, 2, 2]>,
  249. //
  250. // Double-precision FP SQRT
  251. InstrItinData<IIC_fpSQRT64 , [InstrStage<29, [V6_Pipe]>], [34, 2, 2]>,
  252. //
  253. // Integer to Single-precision Move
  254. InstrItinData<IIC_fpMOVIS, [InstrStage<1, [V6_Pipe]>], [10, 1]>,
  255. //
  256. // Integer to Double-precision Move
  257. InstrItinData<IIC_fpMOVID, [InstrStage<1, [V6_Pipe]>], [10, 1, 1]>,
  258. //
  259. // Single-precision to Integer Move
  260. InstrItinData<IIC_fpMOVSI, [InstrStage<1, [V6_Pipe]>], [10, 1]>,
  261. //
  262. // Double-precision to Integer Move
  263. InstrItinData<IIC_fpMOVDI, [InstrStage<1, [V6_Pipe]>], [10, 10, 1]>,
  264. //
  265. // Single-precision FP Load
  266. InstrItinData<IIC_fpLoad32 , [InstrStage<1, [V6_Pipe]>], [5, 2, 2]>,
  267. //
  268. // Double-precision FP Load
  269. InstrItinData<IIC_fpLoad64 , [InstrStage<1, [V6_Pipe]>], [5, 2, 2]>,
  270. //
  271. // FP Load Multiple
  272. InstrItinData<IIC_fpLoad_m , [InstrStage<3, [V6_Pipe]>], [2, 1, 1, 5]>,
  273. //
  274. // FP Load Multiple + update
  275. InstrItinData<IIC_fpLoad_mu, [InstrStage<3, [V6_Pipe]>], [3, 2, 1, 1, 5]>,
  276. //
  277. // Single-precision FP Store
  278. InstrItinData<IIC_fpStore32 , [InstrStage<1, [V6_Pipe]>], [2, 2, 2]>,
  279. //
  280. // Double-precision FP Store
  281. // use FU_Issue to enforce the 1 load/store per cycle limit
  282. InstrItinData<IIC_fpStore64 , [InstrStage<1, [V6_Pipe]>], [2, 2, 2]>,
  283. //
  284. // FP Store Multiple
  285. InstrItinData<IIC_fpStore_m, [InstrStage<3, [V6_Pipe]>], [2, 2, 2, 2]>,
  286. //
  287. // FP Store Multiple + update
  288. InstrItinData<IIC_fpStore_mu,[InstrStage<3, [V6_Pipe]>], [3, 2, 2, 2, 2]>
  289. ]>;