[obj2yaml] - Fix BB after r373315.
[llvm-complete.git] / lib / Target / NVPTX / NVPTX.td
blob1d947ef1ce6231c46c5622d42f8651378dbf1d38
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 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
12 // Target-independent interfaces
13 //===----------------------------------------------------------------------===//
15 include "llvm/Target/Target.td"
17 include "NVPTXRegisterInfo.td"
18 include "NVPTXInstrInfo.td"
20 //===----------------------------------------------------------------------===//
21 // Subtarget Features.
22 // - We use the SM version number instead of explicit feature table.
23 // - Need at least one feature to avoid generating zero sized array by
24 //   TableGen in NVPTXGenSubtarget.inc.
25 //===----------------------------------------------------------------------===//
27 // SM Versions
28 def SM20 : SubtargetFeature<"sm_20", "SmVersion", "20",
29                             "Target SM 2.0">;
30 def SM21 : SubtargetFeature<"sm_21", "SmVersion", "21",
31                             "Target SM 2.1">;
32 def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30",
33                             "Target SM 3.0">;
34 def SM32 : SubtargetFeature<"sm_32", "SmVersion", "32",
35                             "Target SM 3.2">;
36 def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35",
37                             "Target SM 3.5">;
38 def SM37 : SubtargetFeature<"sm_37", "SmVersion", "37",
39                             "Target SM 3.7">;
40 def SM50 : SubtargetFeature<"sm_50", "SmVersion", "50",
41                             "Target SM 5.0">;
42 def SM52 : SubtargetFeature<"sm_52", "SmVersion", "52",
43                             "Target SM 5.2">;
44 def SM53 : SubtargetFeature<"sm_53", "SmVersion", "53",
45                             "Target SM 5.3">;
46 def SM60 : SubtargetFeature<"sm_60", "SmVersion", "60",
47                              "Target SM 6.0">;
48 def SM61 : SubtargetFeature<"sm_61", "SmVersion", "61",
49                              "Target SM 6.1">;
50 def SM62 : SubtargetFeature<"sm_62", "SmVersion", "62",
51                              "Target SM 6.2">;
52 def SM70 : SubtargetFeature<"sm_70", "SmVersion", "70",
53                              "Target SM 7.0">;
54 def SM72 : SubtargetFeature<"sm_72", "SmVersion", "72",
55                              "Target SM 7.2">;
56 def SM75 : SubtargetFeature<"sm_75", "SmVersion", "75",
57                              "Target SM 7.5">;
59 // PTX Versions
60 def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
61                              "Use PTX version 3.2">;
62 def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
63                              "Use PTX version 4.0">;
64 def PTX41 : SubtargetFeature<"ptx41", "PTXVersion", "41",
65                              "Use PTX version 4.1">;
66 def PTX42 : SubtargetFeature<"ptx42", "PTXVersion", "42",
67                              "Use PTX version 4.2">;
68 def PTX43 : SubtargetFeature<"ptx43", "PTXVersion", "43",
69                              "Use PTX version 4.3">;
70 def PTX50 : SubtargetFeature<"ptx50", "PTXVersion", "50",
71                              "Use PTX version 5.0">;
72 def PTX60 : SubtargetFeature<"ptx60", "PTXVersion", "60",
73                              "Use PTX version 6.0">;
74 def PTX61 : SubtargetFeature<"ptx61", "PTXVersion", "61",
75                              "Use PTX version 6.1">;
76 def PTX63 : SubtargetFeature<"ptx63", "PTXVersion", "63",
77                              "Use PTX version 6.3">;
78 def PTX64 : SubtargetFeature<"ptx64", "PTXVersion", "64",
79                              "Use PTX version 6.4">;
81 //===----------------------------------------------------------------------===//
82 // NVPTX supported processors.
83 //===----------------------------------------------------------------------===//
85 class Proc<string Name, list<SubtargetFeature> Features>
86  : Processor<Name, NoItineraries, Features>;
88 def : Proc<"sm_20", [SM20]>;
89 def : Proc<"sm_21", [SM21]>;
90 def : Proc<"sm_30", [SM30]>;
91 def : Proc<"sm_32", [SM32, PTX40]>;
92 def : Proc<"sm_35", [SM35]>;
93 def : Proc<"sm_37", [SM37, PTX41]>;
94 def : Proc<"sm_50", [SM50, PTX40]>;
95 def : Proc<"sm_52", [SM52, PTX41]>;
96 def : Proc<"sm_53", [SM53, PTX42]>;
97 def : Proc<"sm_60", [SM60, PTX50]>;
98 def : Proc<"sm_61", [SM61, PTX50]>;
99 def : Proc<"sm_62", [SM62, PTX50]>;
100 def : Proc<"sm_70", [SM70, PTX60]>;
101 def : Proc<"sm_72", [SM72, PTX61]>;
102 def : Proc<"sm_75", [SM75, PTX63]>;
104 def NVPTXInstrInfo : InstrInfo {
107 def NVPTX : Target {
108   let InstructionSet = NVPTXInstrInfo;