xref: /freebsd/contrib/llvm-project/llvm/lib/Target/NVPTX/NVPTX.td (revision 9f23cbd6cae82fd77edfad7173432fa8dccd0a95)
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//===----------------------------------------------------------------------===//
12// Target-independent interfaces
13//===----------------------------------------------------------------------===//
14
15include "llvm/Target/Target.td"
16
17include "NVPTXRegisterInfo.td"
18include "NVPTXInstrInfo.td"
19
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//===----------------------------------------------------------------------===//
26
27// SM Versions
28def SM20 : SubtargetFeature<"sm_20", "SmVersion", "20",
29                            "Target SM 2.0">;
30def SM21 : SubtargetFeature<"sm_21", "SmVersion", "21",
31                            "Target SM 2.1">;
32def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30",
33                            "Target SM 3.0">;
34def SM32 : SubtargetFeature<"sm_32", "SmVersion", "32",
35                            "Target SM 3.2">;
36def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35",
37                            "Target SM 3.5">;
38def SM37 : SubtargetFeature<"sm_37", "SmVersion", "37",
39                            "Target SM 3.7">;
40def SM50 : SubtargetFeature<"sm_50", "SmVersion", "50",
41                            "Target SM 5.0">;
42def SM52 : SubtargetFeature<"sm_52", "SmVersion", "52",
43                            "Target SM 5.2">;
44def SM53 : SubtargetFeature<"sm_53", "SmVersion", "53",
45                            "Target SM 5.3">;
46def SM60 : SubtargetFeature<"sm_60", "SmVersion", "60",
47                             "Target SM 6.0">;
48def SM61 : SubtargetFeature<"sm_61", "SmVersion", "61",
49                             "Target SM 6.1">;
50def SM62 : SubtargetFeature<"sm_62", "SmVersion", "62",
51                             "Target SM 6.2">;
52def SM70 : SubtargetFeature<"sm_70", "SmVersion", "70",
53                             "Target SM 7.0">;
54def SM72 : SubtargetFeature<"sm_72", "SmVersion", "72",
55                             "Target SM 7.2">;
56def SM75 : SubtargetFeature<"sm_75", "SmVersion", "75",
57                             "Target SM 7.5">;
58def SM80 : SubtargetFeature<"sm_80", "SmVersion", "80",
59                             "Target SM 8.0">;
60def SM86 : SubtargetFeature<"sm_86", "SmVersion", "86",
61                             "Target SM 8.6">;
62def SM87 : SubtargetFeature<"sm_87", "SmVersion", "87",
63                             "Target SM 8.7">;
64def SM89 : SubtargetFeature<"sm_89", "SmVersion", "89",
65                             "Target SM 8.9">;
66def SM90 : SubtargetFeature<"sm_90", "SmVersion", "90",
67                             "Target SM 9.0">;
68
69// PTX Versions
70def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
71                             "Use PTX version 3.2">;
72def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
73                             "Use PTX version 4.0">;
74def PTX41 : SubtargetFeature<"ptx41", "PTXVersion", "41",
75                             "Use PTX version 4.1">;
76def PTX42 : SubtargetFeature<"ptx42", "PTXVersion", "42",
77                             "Use PTX version 4.2">;
78def PTX43 : SubtargetFeature<"ptx43", "PTXVersion", "43",
79                             "Use PTX version 4.3">;
80def PTX50 : SubtargetFeature<"ptx50", "PTXVersion", "50",
81                             "Use PTX version 5.0">;
82def PTX60 : SubtargetFeature<"ptx60", "PTXVersion", "60",
83                             "Use PTX version 6.0">;
84def PTX61 : SubtargetFeature<"ptx61", "PTXVersion", "61",
85                             "Use PTX version 6.1">;
86def PTX63 : SubtargetFeature<"ptx63", "PTXVersion", "63",
87                             "Use PTX version 6.3">;
88def PTX64 : SubtargetFeature<"ptx64", "PTXVersion", "64",
89                             "Use PTX version 6.4">;
90def PTX65 : SubtargetFeature<"ptx65", "PTXVersion", "65",
91                             "Use PTX version 6.5">;
92def PTX70 : SubtargetFeature<"ptx70", "PTXVersion", "70",
93                             "Use PTX version 7.0">;
94def PTX71 : SubtargetFeature<"ptx71", "PTXVersion", "71",
95                             "Use PTX version 7.1">;
96def PTX72 : SubtargetFeature<"ptx72", "PTXVersion", "72",
97                             "Use PTX version 7.2">;
98def PTX73 : SubtargetFeature<"ptx73", "PTXVersion", "73",
99                             "Use PTX version 7.3">;
100def PTX74 : SubtargetFeature<"ptx74", "PTXVersion", "74",
101                             "Use PTX version 7.4">;
102def PTX75 : SubtargetFeature<"ptx75", "PTXVersion", "75",
103                             "Use PTX version 7.5">;
104def PTX76 : SubtargetFeature<"ptx76", "PTXVersion", "76",
105                             "Use PTX version 7.6">;
106def PTX77 : SubtargetFeature<"ptx77", "PTXVersion", "77",
107                             "Use PTX version 7.7">;
108def PTX78 : SubtargetFeature<"ptx78", "PTXVersion", "78",
109                             "Use PTX version 7.8">;
110
111//===----------------------------------------------------------------------===//
112// NVPTX supported processors.
113//===----------------------------------------------------------------------===//
114
115class Proc<string Name, list<SubtargetFeature> Features>
116 : Processor<Name, NoItineraries, Features>;
117
118def : Proc<"sm_20", [SM20, PTX32]>;
119def : Proc<"sm_21", [SM21, PTX32]>;
120def : Proc<"sm_30", [SM30]>;
121def : Proc<"sm_32", [SM32, PTX40]>;
122def : Proc<"sm_35", [SM35, PTX32]>;
123def : Proc<"sm_37", [SM37, PTX41]>;
124def : Proc<"sm_50", [SM50, PTX40]>;
125def : Proc<"sm_52", [SM52, PTX41]>;
126def : Proc<"sm_53", [SM53, PTX42]>;
127def : Proc<"sm_60", [SM60, PTX50]>;
128def : Proc<"sm_61", [SM61, PTX50]>;
129def : Proc<"sm_62", [SM62, PTX50]>;
130def : Proc<"sm_70", [SM70, PTX60]>;
131def : Proc<"sm_72", [SM72, PTX61]>;
132def : Proc<"sm_75", [SM75, PTX63]>;
133def : Proc<"sm_80", [SM80, PTX70]>;
134def : Proc<"sm_86", [SM86, PTX71]>;
135def : Proc<"sm_87", [SM87, PTX74]>;
136def : Proc<"sm_89", [SM89, PTX78]>;
137def : Proc<"sm_90", [SM90, PTX78]>;
138
139def NVPTXInstrInfo : InstrInfo {
140}
141
142def NVPTX : Target {
143  let InstructionSet = NVPTXInstrInfo;
144}
145