RISCVProcessors.td 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. //===-- RISCVProcessors.td - RISCV Processors --------------*- 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. // RISC-V processors supported.
  10. //===----------------------------------------------------------------------===//
  11. class RISCVProcessorModel<string n,
  12. SchedMachineModel m,
  13. list<SubtargetFeature> f,
  14. list<SubtargetFeature> tunef = [],
  15. string default_march = "">
  16. : ProcessorModel<n, m, f, tunef> {
  17. string DefaultMarch = default_march;
  18. }
  19. class RISCVTuneProcessorModel<string n,
  20. SchedMachineModel m,
  21. list<SubtargetFeature> tunef = [],
  22. list<SubtargetFeature> f = []>
  23. : ProcessorModel<n, m, f,tunef>;
  24. def GENERIC_RV32 : RISCVProcessorModel<"generic-rv32",
  25. NoSchedModel,
  26. [Feature32Bit]>;
  27. def GENERIC_RV64 : RISCVProcessorModel<"generic-rv64",
  28. NoSchedModel,
  29. [Feature64Bit]>;
  30. // Support generic for compatibility with other targets. The triple will be used
  31. // to change to the appropriate rv32/rv64 version.
  32. def : ProcessorModel<"generic", NoSchedModel, []>;
  33. def ROCKET_RV32 : RISCVProcessorModel<"rocket-rv32",
  34. RocketModel,
  35. [Feature32Bit]>;
  36. def ROCKET_RV64 : RISCVProcessorModel<"rocket-rv64",
  37. RocketModel,
  38. [Feature64Bit]>;
  39. def ROCKET : RISCVTuneProcessorModel<"rocket",
  40. RocketModel>;
  41. def SIFIVE_7 : RISCVTuneProcessorModel<"sifive-7-series",
  42. SiFive7Model,
  43. [TuneSiFive7]>;
  44. def SIFIVE_E20 : RISCVProcessorModel<"sifive-e20",
  45. RocketModel,
  46. [Feature32Bit,
  47. FeatureStdExtM,
  48. FeatureStdExtC]>;
  49. def SIFIVE_E21 : RISCVProcessorModel<"sifive-e21",
  50. RocketModel,
  51. [Feature32Bit,
  52. FeatureStdExtM,
  53. FeatureStdExtA,
  54. FeatureStdExtC]>;
  55. def SIFIVE_E24 : RISCVProcessorModel<"sifive-e24",
  56. RocketModel,
  57. [Feature32Bit,
  58. FeatureStdExtM,
  59. FeatureStdExtA,
  60. FeatureStdExtF,
  61. FeatureStdExtC]>;
  62. def SIFIVE_E31 : RISCVProcessorModel<"sifive-e31",
  63. RocketModel,
  64. [Feature32Bit,
  65. FeatureStdExtM,
  66. FeatureStdExtA,
  67. FeatureStdExtC]>;
  68. def SIFIVE_E34 : RISCVProcessorModel<"sifive-e34",
  69. RocketModel,
  70. [Feature32Bit,
  71. FeatureStdExtM,
  72. FeatureStdExtA,
  73. FeatureStdExtF,
  74. FeatureStdExtC]>;
  75. def SIFIVE_E76 : RISCVProcessorModel<"sifive-e76",
  76. SiFive7Model,
  77. [Feature32Bit,
  78. FeatureStdExtM,
  79. FeatureStdExtA,
  80. FeatureStdExtF,
  81. FeatureStdExtC],
  82. [TuneSiFive7]>;
  83. def SIFIVE_S21 : RISCVProcessorModel<"sifive-s21",
  84. RocketModel,
  85. [Feature64Bit,
  86. FeatureStdExtM,
  87. FeatureStdExtA,
  88. FeatureStdExtC]>;
  89. def SIFIVE_S51 : RISCVProcessorModel<"sifive-s51",
  90. RocketModel,
  91. [Feature64Bit,
  92. FeatureStdExtM,
  93. FeatureStdExtA,
  94. FeatureStdExtC]>;
  95. def SIFIVE_S54 : RISCVProcessorModel<"sifive-s54",
  96. RocketModel,
  97. [Feature64Bit,
  98. FeatureStdExtM,
  99. FeatureStdExtA,
  100. FeatureStdExtF,
  101. FeatureStdExtD,
  102. FeatureStdExtC]>;
  103. def SIFIVE_S76 : RISCVProcessorModel<"sifive-s76",
  104. SiFive7Model,
  105. [Feature64Bit,
  106. FeatureStdExtM,
  107. FeatureStdExtA,
  108. FeatureStdExtF,
  109. FeatureStdExtD,
  110. FeatureStdExtC],
  111. [TuneSiFive7]>;
  112. def SIFIVE_U54 : RISCVProcessorModel<"sifive-u54",
  113. RocketModel,
  114. [Feature64Bit,
  115. FeatureStdExtM,
  116. FeatureStdExtA,
  117. FeatureStdExtF,
  118. FeatureStdExtD,
  119. FeatureStdExtC]>;
  120. def SIFIVE_U74 : RISCVProcessorModel<"sifive-u74",
  121. SiFive7Model,
  122. [Feature64Bit,
  123. FeatureStdExtM,
  124. FeatureStdExtA,
  125. FeatureStdExtF,
  126. FeatureStdExtD,
  127. FeatureStdExtC],
  128. [TuneSiFive7]>;
  129. def SYNTACORE_SCR1_BASE : RISCVProcessorModel<"syntacore-scr1-base",
  130. SyntacoreSCR1Model,
  131. [Feature32Bit,
  132. FeatureStdExtC],
  133. [TuneNoDefaultUnroll]>;
  134. def SYNTACORE_SCR1_MAX : RISCVProcessorModel<"syntacore-scr1-max",
  135. SyntacoreSCR1Model,
  136. [Feature32Bit,
  137. FeatureStdExtM,
  138. FeatureStdExtC],
  139. [TuneNoDefaultUnroll]>;