NVPTX.td 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //===- NVPTX.td - Describe the NVPTX Target Machine -----------*- tblgen -*-==//
  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. // This is the top level entry point for the NVPTX target.
  9. //===----------------------------------------------------------------------===//
  10. //===----------------------------------------------------------------------===//
  11. // Target-independent interfaces
  12. //===----------------------------------------------------------------------===//
  13. include "llvm/Target/Target.td"
  14. include "NVPTXRegisterInfo.td"
  15. include "NVPTXInstrInfo.td"
  16. //===----------------------------------------------------------------------===//
  17. // Subtarget Features.
  18. // - We use the SM version number instead of explicit feature table.
  19. // - Need at least one feature to avoid generating zero sized array by
  20. // TableGen in NVPTXGenSubtarget.inc.
  21. //===----------------------------------------------------------------------===//
  22. // SM Versions
  23. def SM20 : SubtargetFeature<"sm_20", "SmVersion", "20",
  24. "Target SM 2.0">;
  25. def SM21 : SubtargetFeature<"sm_21", "SmVersion", "21",
  26. "Target SM 2.1">;
  27. def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30",
  28. "Target SM 3.0">;
  29. def SM32 : SubtargetFeature<"sm_32", "SmVersion", "32",
  30. "Target SM 3.2">;
  31. def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35",
  32. "Target SM 3.5">;
  33. def SM37 : SubtargetFeature<"sm_37", "SmVersion", "37",
  34. "Target SM 3.7">;
  35. def SM50 : SubtargetFeature<"sm_50", "SmVersion", "50",
  36. "Target SM 5.0">;
  37. def SM52 : SubtargetFeature<"sm_52", "SmVersion", "52",
  38. "Target SM 5.2">;
  39. def SM53 : SubtargetFeature<"sm_53", "SmVersion", "53",
  40. "Target SM 5.3">;
  41. def SM60 : SubtargetFeature<"sm_60", "SmVersion", "60",
  42. "Target SM 6.0">;
  43. def SM61 : SubtargetFeature<"sm_61", "SmVersion", "61",
  44. "Target SM 6.1">;
  45. def SM62 : SubtargetFeature<"sm_62", "SmVersion", "62",
  46. "Target SM 6.2">;
  47. def SM70 : SubtargetFeature<"sm_70", "SmVersion", "70",
  48. "Target SM 7.0">;
  49. def SM72 : SubtargetFeature<"sm_72", "SmVersion", "72",
  50. "Target SM 7.2">;
  51. def SM75 : SubtargetFeature<"sm_75", "SmVersion", "75",
  52. "Target SM 7.5">;
  53. def SM80 : SubtargetFeature<"sm_80", "SmVersion", "80",
  54. "Target SM 8.0">;
  55. def SM86 : SubtargetFeature<"sm_86", "SmVersion", "86",
  56. "Target SM 8.6">;
  57. // PTX Versions
  58. def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
  59. "Use PTX version 3.2">;
  60. def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
  61. "Use PTX version 4.0">;
  62. def PTX41 : SubtargetFeature<"ptx41", "PTXVersion", "41",
  63. "Use PTX version 4.1">;
  64. def PTX42 : SubtargetFeature<"ptx42", "PTXVersion", "42",
  65. "Use PTX version 4.2">;
  66. def PTX43 : SubtargetFeature<"ptx43", "PTXVersion", "43",
  67. "Use PTX version 4.3">;
  68. def PTX50 : SubtargetFeature<"ptx50", "PTXVersion", "50",
  69. "Use PTX version 5.0">;
  70. def PTX60 : SubtargetFeature<"ptx60", "PTXVersion", "60",
  71. "Use PTX version 6.0">;
  72. def PTX61 : SubtargetFeature<"ptx61", "PTXVersion", "61",
  73. "Use PTX version 6.1">;
  74. def PTX63 : SubtargetFeature<"ptx63", "PTXVersion", "63",
  75. "Use PTX version 6.3">;
  76. def PTX64 : SubtargetFeature<"ptx64", "PTXVersion", "64",
  77. "Use PTX version 6.4">;
  78. def PTX65 : SubtargetFeature<"ptx65", "PTXVersion", "65",
  79. "Use PTX version 6.5">;
  80. def PTX70 : SubtargetFeature<"ptx70", "PTXVersion", "70",
  81. "Use PTX version 7.0">;
  82. def PTX71 : SubtargetFeature<"ptx71", "PTXVersion", "71",
  83. "Use PTX version 7.1">;
  84. def PTX72 : SubtargetFeature<"ptx72", "PTXVersion", "72",
  85. "Use PTX version 7.2">;
  86. def PTX73 : SubtargetFeature<"ptx73", "PTXVersion", "73",
  87. "Use PTX version 7.3">;
  88. def PTX74 : SubtargetFeature<"ptx74", "PTXVersion", "74",
  89. "Use PTX version 7.4">;
  90. def PTX75 : SubtargetFeature<"ptx75", "PTXVersion", "75",
  91. "Use PTX version 7.5">;
  92. //===----------------------------------------------------------------------===//
  93. // NVPTX supported processors.
  94. //===----------------------------------------------------------------------===//
  95. class Proc<string Name, list<SubtargetFeature> Features>
  96. : Processor<Name, NoItineraries, Features>;
  97. def : Proc<"sm_20", [SM20]>;
  98. def : Proc<"sm_21", [SM21]>;
  99. def : Proc<"sm_30", [SM30]>;
  100. def : Proc<"sm_32", [SM32, PTX40]>;
  101. def : Proc<"sm_35", [SM35]>;
  102. def : Proc<"sm_37", [SM37, PTX41]>;
  103. def : Proc<"sm_50", [SM50, PTX40]>;
  104. def : Proc<"sm_52", [SM52, PTX41]>;
  105. def : Proc<"sm_53", [SM53, PTX42]>;
  106. def : Proc<"sm_60", [SM60, PTX50]>;
  107. def : Proc<"sm_61", [SM61, PTX50]>;
  108. def : Proc<"sm_62", [SM62, PTX50]>;
  109. def : Proc<"sm_70", [SM70, PTX60]>;
  110. def : Proc<"sm_72", [SM72, PTX61]>;
  111. def : Proc<"sm_75", [SM75, PTX63]>;
  112. def : Proc<"sm_80", [SM80, PTX70]>;
  113. def : Proc<"sm_86", [SM86, PTX71]>;
  114. def NVPTXInstrInfo : InstrInfo {
  115. }
  116. def NVPTX : Target {
  117. let InstructionSet = NVPTXInstrInfo;
  118. }