blob: 0bff35e4dee366790996164e397d14ed8b09b08c [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===-- AMDIL.td - AMDIL Tablegen files --*- tablegen -*-------------------===//
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
Tom Stellardbc5b5372014-06-13 16:38:59 +000010include "llvm/Target/Target.td"
Tom Stellard75aadc22012-12-11 21:25:42 +000011
Tom Stellard99792772013-06-07 20:28:49 +000012//===----------------------------------------------------------------------===//
13// Subtarget Features
14//===----------------------------------------------------------------------===//
15
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000016// Debugging Features
17
18def FeatureDumpCode : SubtargetFeature <"DumpCode",
19 "DumpCode",
20 "true",
21 "Dump MachineInstrs in the CodeEmitter">;
22
Tom Stellard66df8a22013-11-18 19:43:44 +000023def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer",
Tom Stellarded0ceec2013-10-10 17:11:12 +000024 "EnableIRStructurizer",
Tom Stellard66df8a22013-11-18 19:43:44 +000025 "false",
26 "Disable IR Structurizer">;
Tom Stellarded0ceec2013-10-10 17:11:12 +000027
Matt Arsenaultd9a23ab2014-07-13 02:08:26 +000028def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
29 "EnablePromoteAlloca",
30 "true",
31 "Enable promote alloca pass">;
32
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000033// Target features
34
Tom Stellard783893a2013-11-18 19:43:33 +000035def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
36 "EnableIfCvt",
37 "false",
38 "Disable the if conversion pass">;
39
Matt Arsenaultf5e29972014-06-20 06:50:05 +000040def FeatureFP64 : SubtargetFeature<"fp64",
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000041 "FP64",
Tom Stellard99792772013-06-07 20:28:49 +000042 "true",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000043 "Enable double precision operations">;
Tom Stellard99792772013-06-07 20:28:49 +000044
Matt Arsenaultf171cf22014-07-14 23:40:49 +000045def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals",
46 "FP64Denormals",
47 "true",
48 "Enable double precision denormal handling",
49 [FeatureFP64]>;
50
51// Some instructions do not support denormals despite this flag. Using
52// fp32 denormals also causes instructions to run at the double
53// precision rate for the device.
54def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals",
55 "FP32Denormals",
56 "true",
57 "Enable single precision denormal handling">;
58
Tom Stellard99792772013-06-07 20:28:49 +000059def Feature64BitPtr : SubtargetFeature<"64BitPtr",
60 "Is64bit",
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000061 "true",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000062 "Specify if 64-bit addressing should be used">;
Tom Stellard99792772013-06-07 20:28:49 +000063
64def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
65 "R600ALUInst",
66 "false",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000067 "Older version of ALU instructions encoding">;
Tom Stellard99792772013-06-07 20:28:49 +000068
69def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
70 "HasVertexCache",
71 "true",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000072 "Specify use of dedicated vertex cache">;
Tom Stellard99792772013-06-07 20:28:49 +000073
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000074def FeatureCaymanISA : SubtargetFeature<"caymanISA",
75 "CaymanISA",
76 "true",
77 "Use Cayman ISA">;
78
Tom Stellard348273d2014-01-23 16:18:02 +000079def FeatureCFALUBug : SubtargetFeature<"cfalubug",
80 "CFALUBug",
81 "true",
82 "GPU has CF_ALU bug">;
83
Matt Arsenault3f981402014-09-15 15:41:53 +000084def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
85 "FlatAddressSpace",
86 "true",
87 "Support flat address space">;
88
Tom Stellard3498e4f2013-06-07 20:28:55 +000089class SubtargetFeatureFetchLimit <string Value> :
90 SubtargetFeature <"fetch"#Value,
91 "TexVTXClauseSize",
92 Value,
93 "Limit the maximum number of fetches in a clause to "#Value>;
Tom Stellard99792772013-06-07 20:28:49 +000094
Tom Stellard3498e4f2013-06-07 20:28:55 +000095def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
96def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
97
Tom Stellard8c347b02014-01-22 21:55:40 +000098class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
99 "wavefrontsize"#Value,
100 "WavefrontSize",
101 !cast<string>(Value),
102 "The number of threads per wavefront">;
103
104def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
105def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
106def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
107
Tom Stellard880a80a2014-06-17 16:53:14 +0000108class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
109 "localmemorysize"#Value,
110 "LocalMemorySize",
111 !cast<string>(Value),
112 "The size of local memory in bytes">;
113
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000114class SubtargetFeatureGeneration <string Value,
115 list<SubtargetFeature> Implies> :
116 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
117 Value#" GPU generation", Implies>;
118
Tom Stellard880a80a2014-06-17 16:53:14 +0000119def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
120def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
121def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
122
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000123def FeatureR600 : SubtargetFeatureGeneration<"R600",
Tom Stellard880a80a2014-06-17 16:53:14 +0000124 [FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000125
126def FeatureR700 : SubtargetFeatureGeneration<"R700",
Tom Stellard880a80a2014-06-17 16:53:14 +0000127 [FeatureFetchLimit16, FeatureLocalMemorySize0]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000128
129def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
Tom Stellard880a80a2014-06-17 16:53:14 +0000130 [FeatureFetchLimit16, FeatureLocalMemorySize32768]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000131
132def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
Tom Stellard880a80a2014-06-17 16:53:14 +0000133 [FeatureFetchLimit16, FeatureWavefrontSize64,
134 FeatureLocalMemorySize32768]
135>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000136
137def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
Tom Stellard42639a52014-07-21 15:44:58 +0000138 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize32768,
139 FeatureWavefrontSize64]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000140
Tom Stellard6e1ee472013-10-29 16:37:28 +0000141def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
Tom Stellard42639a52014-07-21 15:44:58 +0000142 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536,
Matt Arsenault3f981402014-09-15 15:41:53 +0000143 FeatureWavefrontSize64, FeatureFlatAddressSpace]>;
Tom Stellard3498e4f2013-06-07 20:28:55 +0000144//===----------------------------------------------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +0000145
146def AMDGPUInstrInfo : InstrInfo {
147 let guessInstructionProperties = 1;
148}
149
Tom Stellard75aadc22012-12-11 21:25:42 +0000150def AMDGPU : Target {
151 // Pull in Instruction Info:
152 let InstructionSet = AMDGPUInstrInfo;
Tom Stellard75aadc22012-12-11 21:25:42 +0000153}
154
Tom Stellardbc5b5372014-06-13 16:38:59 +0000155// Dummy Instruction itineraries for pseudo instructions
156def ALU_NULL : FuncUnit;
157def NullALU : InstrItinClass;
158
Tom Stellard0e70de52014-05-16 20:56:45 +0000159//===----------------------------------------------------------------------===//
160// Predicate helper class
161//===----------------------------------------------------------------------===//
162
163class PredicateControl {
164 Predicate SubtargetPredicate;
165 list<Predicate> OtherPredicates = [];
166 list<Predicate> Predicates = !listconcat([SubtargetPredicate],
167 OtherPredicates);
168}
169
Tom Stellard75aadc22012-12-11 21:25:42 +0000170// Include AMDGPU TD files
171include "R600Schedule.td"
172include "SISchedule.td"
173include "Processors.td"
174include "AMDGPUInstrInfo.td"
175include "AMDGPUIntrinsics.td"
176include "AMDGPURegisterInfo.td"
177include "AMDGPUInstructions.td"
Christian Konig2c8f6d52013-03-07 09:03:52 +0000178include "AMDGPUCallingConv.td"