blob: 2cfc46393795e9a7f85b40f53ab617d9dc1404e1 [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
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000028// Target features
29
Tom Stellard783893a2013-11-18 19:43:33 +000030def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
31 "EnableIfCvt",
32 "false",
33 "Disable the if conversion pass">;
34
Tom Stellard99792772013-06-07 20:28:49 +000035def FeatureFP64 : SubtargetFeature<"fp64",
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000036 "FP64",
Tom Stellard99792772013-06-07 20:28:49 +000037 "true",
38 "Enable 64bit double precision operations">;
Tom Stellard99792772013-06-07 20:28:49 +000039
40def Feature64BitPtr : SubtargetFeature<"64BitPtr",
41 "Is64bit",
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000042 "true",
Tom Stellard99792772013-06-07 20:28:49 +000043 "Specify if 64bit addressing should be used.">;
44
45def Feature32on64BitPtr : SubtargetFeature<"64on32BitPtr",
46 "Is32on64bit",
47 "false",
48 "Specify if 64bit sized pointers with 32bit addressing should be used.">;
Tom Stellard99792772013-06-07 20:28:49 +000049
50def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
51 "R600ALUInst",
52 "false",
53 "Older version of ALU instructions encoding.">;
54
55def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
56 "HasVertexCache",
57 "true",
58 "Specify use of dedicated vertex cache.">;
59
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000060def FeatureCaymanISA : SubtargetFeature<"caymanISA",
61 "CaymanISA",
62 "true",
63 "Use Cayman ISA">;
64
Tom Stellard348273d2014-01-23 16:18:02 +000065def FeatureCFALUBug : SubtargetFeature<"cfalubug",
66 "CFALUBug",
67 "true",
68 "GPU has CF_ALU bug">;
69
Tom Stellard3498e4f2013-06-07 20:28:55 +000070class SubtargetFeatureFetchLimit <string Value> :
71 SubtargetFeature <"fetch"#Value,
72 "TexVTXClauseSize",
73 Value,
74 "Limit the maximum number of fetches in a clause to "#Value>;
Tom Stellard99792772013-06-07 20:28:49 +000075
Tom Stellard3498e4f2013-06-07 20:28:55 +000076def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
77def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
78
Tom Stellard8c347b02014-01-22 21:55:40 +000079class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
80 "wavefrontsize"#Value,
81 "WavefrontSize",
82 !cast<string>(Value),
83 "The number of threads per wavefront">;
84
85def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
86def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
87def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
88
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000089class SubtargetFeatureGeneration <string Value,
90 list<SubtargetFeature> Implies> :
91 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
92 Value#" GPU generation", Implies>;
93
94def FeatureR600 : SubtargetFeatureGeneration<"R600",
95 [FeatureR600ALUInst, FeatureFetchLimit8]>;
96
97def FeatureR700 : SubtargetFeatureGeneration<"R700",
98 [FeatureFetchLimit16]>;
99
100def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
101 [FeatureFetchLimit16]>;
102
103def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
Tom Stellard8c347b02014-01-22 21:55:40 +0000104 [FeatureFetchLimit16, FeatureWavefrontSize64]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000105
106def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
107 [Feature64BitPtr, FeatureFP64]>;
108
Tom Stellard6e1ee472013-10-29 16:37:28 +0000109def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
110 [Feature64BitPtr, FeatureFP64]>;
Tom Stellard3498e4f2013-06-07 20:28:55 +0000111//===----------------------------------------------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +0000112
113def AMDGPUInstrInfo : InstrInfo {
114 let guessInstructionProperties = 1;
115}
116
Tom Stellard75aadc22012-12-11 21:25:42 +0000117def AMDGPU : Target {
118 // Pull in Instruction Info:
119 let InstructionSet = AMDGPUInstrInfo;
Tom Stellard75aadc22012-12-11 21:25:42 +0000120}
121
Tom Stellardbc5b5372014-06-13 16:38:59 +0000122// Dummy Instruction itineraries for pseudo instructions
123def ALU_NULL : FuncUnit;
124def NullALU : InstrItinClass;
125
Tom Stellard0e70de52014-05-16 20:56:45 +0000126//===----------------------------------------------------------------------===//
127// Predicate helper class
128//===----------------------------------------------------------------------===//
129
130class PredicateControl {
131 Predicate SubtargetPredicate;
132 list<Predicate> OtherPredicates = [];
133 list<Predicate> Predicates = !listconcat([SubtargetPredicate],
134 OtherPredicates);
135}
136
Tom Stellard75aadc22012-12-11 21:25:42 +0000137// Include AMDGPU TD files
138include "R600Schedule.td"
139include "SISchedule.td"
140include "Processors.td"
141include "AMDGPUInstrInfo.td"
142include "AMDGPUIntrinsics.td"
143include "AMDGPURegisterInfo.td"
144include "AMDGPUInstructions.td"
Christian Konig2c8f6d52013-03-07 09:03:52 +0000145include "AMDGPUCallingConv.td"