PPCScheduleA2.td 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //===- PPCScheduleA2.td - PPC A2 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. // Primary reference:
  9. // A2 Processor User's Manual.
  10. // IBM (as updated in) 2010.
  11. //===----------------------------------------------------------------------===//
  12. // Functional units on the PowerPC A2 chip sets
  13. //
  14. def A2_XU : FuncUnit; // A2_XU pipeline
  15. def A2_FU : FuncUnit; // FI pipeline
  16. //
  17. // This file defines the itinerary class data for the PPC A2 processor.
  18. //
  19. //===----------------------------------------------------------------------===//
  20. def PPCA2Itineraries : ProcessorItineraries<
  21. [A2_XU, A2_FU], [], [
  22. InstrItinData<IIC_IntSimple, [InstrStage<1, [A2_XU]>],
  23. [1, 0, 0]>,
  24. InstrItinData<IIC_IntGeneral, [InstrStage<1, [A2_XU]>],
  25. [2, 0, 0]>,
  26. InstrItinData<IIC_IntISEL, [InstrStage<1, [A2_XU]>],
  27. [2, 0, 0, 0]>,
  28. InstrItinData<IIC_IntCompare, [InstrStage<1, [A2_XU]>],
  29. [2, 0, 0]>,
  30. InstrItinData<IIC_IntDivW, [InstrStage<1, [A2_XU]>],
  31. [39, 0, 0]>,
  32. InstrItinData<IIC_IntDivD, [InstrStage<1, [A2_XU]>],
  33. [71, 0, 0]>,
  34. InstrItinData<IIC_IntMulHW, [InstrStage<1, [A2_XU]>],
  35. [5, 0, 0]>,
  36. InstrItinData<IIC_IntMulHWU, [InstrStage<1, [A2_XU]>],
  37. [5, 0, 0]>,
  38. InstrItinData<IIC_IntMulLI, [InstrStage<1, [A2_XU]>],
  39. [6, 0, 0]>,
  40. InstrItinData<IIC_IntRotate, [InstrStage<1, [A2_XU]>],
  41. [2, 0, 0]>,
  42. InstrItinData<IIC_IntRotateD, [InstrStage<1, [A2_XU]>],
  43. [2, 0, 0]>,
  44. InstrItinData<IIC_IntRotateDI, [InstrStage<1, [A2_XU]>],
  45. [2, 0, 0]>,
  46. InstrItinData<IIC_IntShift, [InstrStage<1, [A2_XU]>],
  47. [2, 0, 0]>,
  48. InstrItinData<IIC_IntTrapW, [InstrStage<1, [A2_XU]>],
  49. [2, 0]>,
  50. InstrItinData<IIC_IntTrapD, [InstrStage<1, [A2_XU]>],
  51. [2, 0]>,
  52. InstrItinData<IIC_BrB, [InstrStage<1, [A2_XU]>],
  53. [6, 0, 0]>,
  54. InstrItinData<IIC_BrCR, [InstrStage<1, [A2_XU]>],
  55. [1, 0, 0]>,
  56. InstrItinData<IIC_BrMCR, [InstrStage<1, [A2_XU]>],
  57. [5, 0, 0]>,
  58. InstrItinData<IIC_BrMCRX, [InstrStage<1, [A2_XU]>],
  59. [1, 0, 0]>,
  60. InstrItinData<IIC_LdStDCBA, [InstrStage<1, [A2_XU]>],
  61. [1, 0, 0]>,
  62. InstrItinData<IIC_LdStDCBF, [InstrStage<1, [A2_XU]>],
  63. [1, 0, 0]>,
  64. InstrItinData<IIC_LdStDCBI, [InstrStage<1, [A2_XU]>],
  65. [1, 0, 0]>,
  66. InstrItinData<IIC_LdStLoad, [InstrStage<1, [A2_XU]>],
  67. [6, 0, 0]>,
  68. InstrItinData<IIC_LdStLoadUpd, [InstrStage<1, [A2_XU]>],
  69. [6, 8, 0, 0]>,
  70. InstrItinData<IIC_LdStLoadUpdX,[InstrStage<1, [A2_XU]>],
  71. [6, 8, 0, 0]>,
  72. InstrItinData<IIC_LdStLDU, [InstrStage<1, [A2_XU]>],
  73. [6, 0, 0]>,
  74. InstrItinData<IIC_LdStLDUX, [InstrStage<1, [A2_XU]>],
  75. [6, 0, 0]>,
  76. InstrItinData<IIC_LdStStore, [InstrStage<1, [A2_XU]>],
  77. [0, 0, 0]>,
  78. InstrItinData<IIC_LdStICBI, [InstrStage<1, [A2_XU]>],
  79. [16, 0, 0]>,
  80. InstrItinData<IIC_LdStSTFD, [InstrStage<1, [A2_XU]>],
  81. [0, 0, 0]>,
  82. InstrItinData<IIC_LdStSTFDU, [InstrStage<1, [A2_XU]>],
  83. [2, 0, 0, 0]>,
  84. InstrItinData<IIC_LdStLFD, [InstrStage<1, [A2_XU]>],
  85. [7, 0, 0]>,
  86. InstrItinData<IIC_LdStLFDU, [InstrStage<1, [A2_XU]>],
  87. [7, 9, 0, 0]>,
  88. InstrItinData<IIC_LdStLFDUX, [InstrStage<1, [A2_XU]>],
  89. [7, 9, 0, 0]>,
  90. InstrItinData<IIC_LdStLHA, [InstrStage<1, [A2_XU]>],
  91. [6, 0, 0]>,
  92. InstrItinData<IIC_LdStLHAU, [InstrStage<1, [A2_XU]>],
  93. [6, 8, 0, 0]>,
  94. InstrItinData<IIC_LdStLHAUX, [InstrStage<1, [A2_XU]>],
  95. [6, 8, 0, 0]>,
  96. InstrItinData<IIC_LdStLWARX, [InstrStage<1, [A2_XU]>],
  97. [82, 0, 0]>, // L2 latency
  98. InstrItinData<IIC_LdStSTD, [InstrStage<1, [A2_XU]>],
  99. [0, 0, 0]>,
  100. InstrItinData<IIC_LdStSTU, [InstrStage<1, [A2_XU]>],
  101. [2, 0, 0, 0]>,
  102. InstrItinData<IIC_LdStSTUX, [InstrStage<1, [A2_XU]>],
  103. [2, 0, 0, 0]>,
  104. InstrItinData<IIC_LdStSTDCX, [InstrStage<1, [A2_XU]>],
  105. [82, 0, 0]>, // L2 latency
  106. InstrItinData<IIC_LdStSTWCX, [InstrStage<1, [A2_XU]>],
  107. [82, 0, 0]>, // L2 latency
  108. InstrItinData<IIC_LdStSync, [InstrStage<1, [A2_XU]>],
  109. [6]>,
  110. InstrItinData<IIC_SprISYNC, [InstrStage<1, [A2_XU]>],
  111. [16]>,
  112. InstrItinData<IIC_SprMTMSR, [InstrStage<1, [A2_XU]>],
  113. [16, 0]>,
  114. InstrItinData<IIC_SprMFCR, [InstrStage<1, [A2_XU]>],
  115. [6, 0]>,
  116. InstrItinData<IIC_SprMFCRF, [InstrStage<1, [A2_XU]>],
  117. [1, 0]>,
  118. InstrItinData<IIC_SprMFMSR, [InstrStage<1, [A2_XU]>],
  119. [4, 0]>,
  120. InstrItinData<IIC_SprMFSPR, [InstrStage<1, [A2_XU]>],
  121. [6, 0]>,
  122. InstrItinData<IIC_SprMFTB, [InstrStage<1, [A2_XU]>],
  123. [4, 0]>,
  124. InstrItinData<IIC_SprMTSPR, [InstrStage<1, [A2_XU]>],
  125. [6, 0]>,
  126. InstrItinData<IIC_SprRFI, [InstrStage<1, [A2_XU]>],
  127. [16]>,
  128. InstrItinData<IIC_SprSC, [InstrStage<1, [A2_XU]>],
  129. [16]>,
  130. InstrItinData<IIC_FPGeneral, [InstrStage<1, [A2_FU]>],
  131. [6, 0, 0]>,
  132. InstrItinData<IIC_FPAddSub, [InstrStage<1, [A2_FU]>],
  133. [6, 0, 0]>,
  134. InstrItinData<IIC_FPCompare, [InstrStage<1, [A2_FU]>],
  135. [5, 0, 0]>,
  136. InstrItinData<IIC_FPDivD, [InstrStage<1, [A2_FU]>],
  137. [72, 0, 0]>,
  138. InstrItinData<IIC_FPDivS, [InstrStage<1, [A2_FU]>],
  139. [59, 0, 0]>,
  140. InstrItinData<IIC_FPSqrtD, [InstrStage<1, [A2_FU]>],
  141. [69, 0, 0]>,
  142. InstrItinData<IIC_FPSqrtS, [InstrStage<1, [A2_FU]>],
  143. [65, 0, 0]>,
  144. InstrItinData<IIC_FPFused, [InstrStage<1, [A2_FU]>],
  145. [6, 0, 0, 0]>,
  146. InstrItinData<IIC_FPRes, [InstrStage<1, [A2_FU]>],
  147. [6, 0]>
  148. ]>;
  149. // ===---------------------------------------------------------------------===//
  150. // A2 machine model for scheduling and other instruction cost heuristics.
  151. def PPCA2Model : SchedMachineModel {
  152. let IssueWidth = 1; // 1 instruction is dispatched per cycle.
  153. let LoadLatency = 6; // Optimistic load latency assuming bypass.
  154. // This is overriden by OperandCycles if the
  155. // Itineraries are queried instead.
  156. let MispredictPenalty = 13;
  157. let CompleteModel = 0;
  158. let Itineraries = PPCA2Itineraries;
  159. }