Add infrastructure for support of multiple memory constraints.
[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 SM20 : SubtargetFeature<"sm_20", "SmVersion", "20",
30                             "Target SM 2.0">;
31 def SM21 : SubtargetFeature<"sm_21", "SmVersion", "21",
32                             "Target SM 2.1">;
33 def SM30 : SubtargetFeature<"sm_30", "SmVersion", "30",
34                             "Target SM 3.0">;
35 def SM35 : SubtargetFeature<"sm_35", "SmVersion", "35",
36                             "Target SM 3.5">;
37 def SM50 : SubtargetFeature<"sm_50", "SmVersion", "50",
38                             "Target SM 5.0">;
39
40 // PTX Versions
41 def PTX30 : SubtargetFeature<"ptx30", "PTXVersion", "30",
42                              "Use PTX version 3.0">;
43 def PTX31 : SubtargetFeature<"ptx31", "PTXVersion", "31",
44                              "Use PTX version 3.1">;
45 def PTX32 : SubtargetFeature<"ptx32", "PTXVersion", "32",
46                              "Use PTX version 3.2">;
47 def PTX40 : SubtargetFeature<"ptx40", "PTXVersion", "40",
48                              "Use PTX version 4.0">;
49
50 //===----------------------------------------------------------------------===//
51 // NVPTX supported processors.
52 //===----------------------------------------------------------------------===//
53
54 class Proc<string Name, list<SubtargetFeature> Features>
55  : Processor<Name, NoItineraries, Features>;
56
57 def : Proc<"sm_20", [SM20]>;
58 def : Proc<"sm_21", [SM21]>;
59 def : Proc<"sm_30", [SM30]>;
60 def : Proc<"sm_35", [SM35]>;
61 def : Proc<"sm_50", [SM50]>;
62
63
64 def NVPTXInstrInfo : InstrInfo {
65 }
66
67 def NVPTX : Target {
68   let InstructionSet = NVPTXInstrInfo;
69 }