1 //===- PTX.td - Describe the PTX Target Machine ---------------*- tblgen -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 // This is the top level entry point for the PTX target.
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
13 // Target-independent interfaces
14 //===----------------------------------------------------------------------===//
16 include "llvm/Target/Target.td"
18 //===----------------------------------------------------------------------===//
20 //===----------------------------------------------------------------------===//
22 //===- Architectural Features ---------------------------------------------===//
24 def FeatureDouble : SubtargetFeature<"double", "SupportsDouble", "true",
25 "Do not demote .f64 to .f32">;
27 def FeatureNoFMA : SubtargetFeature<"no-fma","SupportsFMA", "false",
28 "Disable Fused-Multiply Add">;
30 //===- PTX Version --------------------------------------------------------===//
32 def FeaturePTX20 : SubtargetFeature<"ptx20", "PTXVersion", "PTX_VERSION_2_0",
33 "Use PTX Language Version 2.0">;
35 def FeaturePTX21 : SubtargetFeature<"ptx21", "PTXVersion", "PTX_VERSION_2_1",
36 "Use PTX Language Version 2.1">;
38 def FeaturePTX22 : SubtargetFeature<"ptx22", "PTXVersion", "PTX_VERSION_2_2",
39 "Use PTX Language Version 2.2">;
41 def FeaturePTX23 : SubtargetFeature<"ptx23", "PTXVersion", "PTX_VERSION_2_3",
42 "Use PTX Language Version 2.3">;
44 //===- PTX Target ---------------------------------------------------------===//
46 def FeatureSM10 : SubtargetFeature<"sm10", "PTXTarget", "PTX_SM_1_0",
47 "Use Shader Model 1.0">;
48 def FeatureSM11 : SubtargetFeature<"sm11", "PTXTarget", "PTX_SM_1_1",
49 "Use Shader Model 1.1">;
50 def FeatureSM12 : SubtargetFeature<"sm12", "PTXTarget", "PTX_SM_1_2",
51 "Use Shader Model 1.2">;
52 def FeatureSM13 : SubtargetFeature<"sm13", "PTXTarget", "PTX_SM_1_3",
53 "Use Shader Model 1.3">;
54 def FeatureSM20 : SubtargetFeature<"sm20", "PTXTarget", "PTX_SM_2_0",
55 "Use Shader Model 2.0">;
56 def FeatureSM21 : SubtargetFeature<"sm21", "PTXTarget", "PTX_SM_2_1",
57 "Use Shader Model 2.1">;
58 def FeatureSM22 : SubtargetFeature<"sm22", "PTXTarget", "PTX_SM_2_2",
59 "Use Shader Model 2.2">;
60 def FeatureSM23 : SubtargetFeature<"sm23", "PTXTarget", "PTX_SM_2_3",
61 "Use Shader Model 2.3">;
63 def FeatureCOMPUTE10 : SubtargetFeature<"compute10", "PTXTarget",
65 "Use Compute Compatibility 1.0">;
66 def FeatureCOMPUTE11 : SubtargetFeature<"compute11", "PTXTarget",
68 "Use Compute Compatibility 1.1">;
69 def FeatureCOMPUTE12 : SubtargetFeature<"compute12", "PTXTarget",
71 "Use Compute Compatibility 1.2">;
72 def FeatureCOMPUTE13 : SubtargetFeature<"compute13", "PTXTarget",
74 "Use Compute Compatibility 1.3">;
75 def FeatureCOMPUTE20 : SubtargetFeature<"compute20", "PTXTarget",
77 "Use Compute Compatibility 2.0">;
79 //===----------------------------------------------------------------------===//
80 // PTX supported processors
81 //===----------------------------------------------------------------------===//
83 class Proc<string Name, list<SubtargetFeature> Features>
84 : Processor<Name, NoItineraries, Features>;
86 def : Proc<"generic", []>;
88 // Processor definitions for compute/shader models
89 def : Proc<"compute_10", [FeatureCOMPUTE10]>;
90 def : Proc<"compute_11", [FeatureCOMPUTE11]>;
91 def : Proc<"compute_12", [FeatureCOMPUTE12]>;
92 def : Proc<"compute_13", [FeatureCOMPUTE13]>;
93 def : Proc<"compute_20", [FeatureCOMPUTE20]>;
94 def : Proc<"sm_10", [FeatureSM10]>;
95 def : Proc<"sm_11", [FeatureSM11]>;
96 def : Proc<"sm_12", [FeatureSM12]>;
97 def : Proc<"sm_13", [FeatureSM13]>;
98 def : Proc<"sm_20", [FeatureSM20]>;
99 def : Proc<"sm_21", [FeatureSM21]>;
100 def : Proc<"sm_22", [FeatureSM22]>;
101 def : Proc<"sm_23", [FeatureSM23]>;
103 // Processor definitions for common GPU architectures
104 def : Proc<"g80", [FeatureSM10]>;
105 def : Proc<"gt200", [FeatureSM13]>;
106 def : Proc<"gf100", [FeatureSM20, FeatureDouble]>;
107 def : Proc<"fermi", [FeatureSM20, FeatureDouble]>;
109 //===----------------------------------------------------------------------===//
110 // Register File Description
111 //===----------------------------------------------------------------------===//
113 include "PTXRegisterInfo.td"
115 //===----------------------------------------------------------------------===//
116 // Calling Conventions
117 //===----------------------------------------------------------------------===//
119 include "PTXCallingConv.td"
121 //===----------------------------------------------------------------------===//
122 // Instruction Descriptions
123 //===----------------------------------------------------------------------===//
125 include "PTXInstrInfo.td"
127 def PTXInstrInfo : InstrInfo;
129 //===----------------------------------------------------------------------===//
130 // Target Declaration
131 //===----------------------------------------------------------------------===//
134 let InstructionSet = PTXInstrInfo;