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