NVPTX: Stop leaking memory by using a managed constant instead of a new Argument.
[oota-llvm.git] / lib / Target / NVPTX / NVPTX.td
1 //===- NVPTX.td - Describe the NVPTX Target Machine -----------*- tblgen -*-==//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // This is the top level entry point for the NVPTX target.
10 //===----------------------------------------------------------------------===//
11
12 //===----------------------------------------------------------------------===//
13 // Target-independent interfaces
14 //===----------------------------------------------------------------------===//
15
16 include "llvm/Target/Target.td"
17
18 include "NVPTXRegisterInfo.td"
19 include "NVPTXInstrInfo.td"
20
21 //===----------------------------------------------------------------------===//
22 // Subtarget Features.
23 // - We use the SM version number instead of explicit feature table.
24 // - Need at least one feature to avoid generating zero sized array by
25 //   TableGen in NVPTXGenSubtarget.inc.
26 //===----------------------------------------------------------------------===//
27
28 // SM Versions
29 def SM10 : SubtargetFeature<"sm_10", "SmVersion", "10",
30                             "Target SM 1.0">;
31 def SM11 : SubtargetFeature<"sm_11", "SmVersion", "11",
32                             "Target SM 1.1">;
33 def SM12 : SubtargetFeature<"sm_12", "SmVersion", "12",
34                             "Target SM 1.2">;
35 def SM13 : SubtargetFeature<"sm_13", "SmVersion", "13",
36                             "Target SM 1.3">;
37 def SM20 : SubtargetFeature<"sm_20", "SmVersion", "20",
38                             "Target SM 2.0">;
39 def SM21 : SubtargetFeature<"sm_21", "SmVersion", "21",
40                             "Target SM 2.1">;
41 def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30",
42                             "Target SM 3.0">;
43 def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35",
44                             "Target SM 3.5">;
45
46 // PTX Versions
47 def PTX30 : SubtargetFeature<"ptx30", "PTXVersion", "30",
48                              "Use PTX version 3.0">;
49 def PTX31 : SubtargetFeature<"ptx31", "PTXVersion", "31",
50                              "Use PTX version 3.1">;
51
52 //===----------------------------------------------------------------------===//
53 // NVPTX supported processors.
54 //===----------------------------------------------------------------------===//
55
56 class Proc<string Name, list<SubtargetFeature> Features>
57  : Processor<Name, NoItineraries, Features>;
58
59 def : Proc<"sm_10", [SM10]>;
60 def : Proc<"sm_11", [SM11]>;
61 def : Proc<"sm_12", [SM12]>;
62 def : Proc<"sm_13", [SM13]>;
63 def : Proc<"sm_20", [SM20]>;
64 def : Proc<"sm_21", [SM21]>;
65 def : Proc<"sm_30", [SM30]>;
66 def : Proc<"sm_35", [SM35]>;
67
68
69 def NVPTXInstrInfo : InstrInfo {
70 }
71
72 def NVPTX : Target {
73   let InstructionSet = NVPTXInstrInfo;
74 }