xref: /freebsd/contrib/llvm-project/llvm/lib/Target/NVPTX/NVPTX.td (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
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">;
62
63// PTX Versions
64def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
65                             "Use PTX version 3.2">;
66def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
67                             "Use PTX version 4.0">;
68def PTX41 : SubtargetFeature<"ptx41", "PTXVersion", "41",
69                             "Use PTX version 4.1">;
70def PTX42 : SubtargetFeature<"ptx42", "PTXVersion", "42",
71                             "Use PTX version 4.2">;
72def PTX43 : SubtargetFeature<"ptx43", "PTXVersion", "43",
73                             "Use PTX version 4.3">;
74def PTX50 : SubtargetFeature<"ptx50", "PTXVersion", "50",
75                             "Use PTX version 5.0">;
76def PTX60 : SubtargetFeature<"ptx60", "PTXVersion", "60",
77                             "Use PTX version 6.0">;
78def PTX61 : SubtargetFeature<"ptx61", "PTXVersion", "61",
79                             "Use PTX version 6.1">;
80def PTX63 : SubtargetFeature<"ptx63", "PTXVersion", "63",
81                             "Use PTX version 6.3">;
82def PTX64 : SubtargetFeature<"ptx64", "PTXVersion", "64",
83                             "Use PTX version 6.4">;
84def PTX65 : SubtargetFeature<"ptx65", "PTXVersion", "65",
85                             "Use PTX version 6.5">;
86def PTX70 : SubtargetFeature<"ptx70", "PTXVersion", "70",
87                             "Use PTX version 7.0">;
88def PTX71 : SubtargetFeature<"ptx71", "PTXVersion", "71",
89                             "Use PTX version 7.1">;
90def PTX72 : SubtargetFeature<"ptx72", "PTXVersion", "72",
91                             "Use PTX version 7.2">;
92def PTX73 : SubtargetFeature<"ptx73", "PTXVersion", "73",
93                             "Use PTX version 7.3">;
94def PTX74 : SubtargetFeature<"ptx74", "PTXVersion", "74",
95                             "Use PTX version 7.4">;
96def PTX75 : SubtargetFeature<"ptx75", "PTXVersion", "75",
97                             "Use PTX version 7.5">;
98
99//===----------------------------------------------------------------------===//
100// NVPTX supported processors.
101//===----------------------------------------------------------------------===//
102
103class Proc<string Name, list<SubtargetFeature> Features>
104 : Processor<Name, NoItineraries, Features>;
105
106def : Proc<"sm_20", [SM20]>;
107def : Proc<"sm_21", [SM21]>;
108def : Proc<"sm_30", [SM30]>;
109def : Proc<"sm_32", [SM32, PTX40]>;
110def : Proc<"sm_35", [SM35]>;
111def : Proc<"sm_37", [SM37, PTX41]>;
112def : Proc<"sm_50", [SM50, PTX40]>;
113def : Proc<"sm_52", [SM52, PTX41]>;
114def : Proc<"sm_53", [SM53, PTX42]>;
115def : Proc<"sm_60", [SM60, PTX50]>;
116def : Proc<"sm_61", [SM61, PTX50]>;
117def : Proc<"sm_62", [SM62, PTX50]>;
118def : Proc<"sm_70", [SM70, PTX60]>;
119def : Proc<"sm_72", [SM72, PTX61]>;
120def : Proc<"sm_75", [SM75, PTX63]>;
121def : Proc<"sm_80", [SM80, PTX70]>;
122def : Proc<"sm_86", [SM86, PTX71]>;
123
124def NVPTXInstrInfo : InstrInfo {
125}
126
127def NVPTX : Target {
128  let InstructionSet = NVPTXInstrInfo;
129}
130