blob: 89992c202ea682372a99776febb88338d05a9fa3 [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
45def Feature64BitPtr : SubtargetFeature<"64BitPtr",
46 "Is64bit",
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000047 "true",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000048 "Specify if 64-bit addressing should be used">;
Tom Stellard99792772013-06-07 20:28:49 +000049
50def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
51 "R600ALUInst",
52 "false",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000053 "Older version of ALU instructions encoding">;
Tom Stellard99792772013-06-07 20:28:49 +000054
55def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
56 "HasVertexCache",
57 "true",
Matt Arsenaultf5e29972014-06-20 06:50:05 +000058 "Specify use of dedicated vertex cache">;
Tom Stellard99792772013-06-07 20:28:49 +000059
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 Stellard880a80a2014-06-17 16:53:14 +000089class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
90 "localmemorysize"#Value,
91 "LocalMemorySize",
92 !cast<string>(Value),
93 "The size of local memory in bytes">;
94
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000095class SubtargetFeatureGeneration <string Value,
96 list<SubtargetFeature> Implies> :
97 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
98 Value#" GPU generation", Implies>;
99
Tom Stellard880a80a2014-06-17 16:53:14 +0000100def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
101def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
102def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
103
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000104def FeatureR600 : SubtargetFeatureGeneration<"R600",
Tom Stellard880a80a2014-06-17 16:53:14 +0000105 [FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000106
107def FeatureR700 : SubtargetFeatureGeneration<"R700",
Tom Stellard880a80a2014-06-17 16:53:14 +0000108 [FeatureFetchLimit16, FeatureLocalMemorySize0]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000109
110def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
Tom Stellard880a80a2014-06-17 16:53:14 +0000111 [FeatureFetchLimit16, FeatureLocalMemorySize32768]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000112
113def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
Tom Stellard880a80a2014-06-17 16:53:14 +0000114 [FeatureFetchLimit16, FeatureWavefrontSize64,
115 FeatureLocalMemorySize32768]
116>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000117
118def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
Tom Stellard880a80a2014-06-17 16:53:14 +0000119 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize32768]>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000120
Tom Stellard6e1ee472013-10-29 16:37:28 +0000121def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
Tom Stellard880a80a2014-06-17 16:53:14 +0000122 [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536]>;
Tom Stellard3498e4f2013-06-07 20:28:55 +0000123//===----------------------------------------------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +0000124
125def AMDGPUInstrInfo : InstrInfo {
126 let guessInstructionProperties = 1;
127}
128
Tom Stellard75aadc22012-12-11 21:25:42 +0000129def AMDGPU : Target {
130 // Pull in Instruction Info:
131 let InstructionSet = AMDGPUInstrInfo;
Tom Stellard75aadc22012-12-11 21:25:42 +0000132}
133
Tom Stellardbc5b5372014-06-13 16:38:59 +0000134// Dummy Instruction itineraries for pseudo instructions
135def ALU_NULL : FuncUnit;
136def NullALU : InstrItinClass;
137
Tom Stellard0e70de52014-05-16 20:56:45 +0000138//===----------------------------------------------------------------------===//
139// Predicate helper class
140//===----------------------------------------------------------------------===//
141
142class PredicateControl {
143 Predicate SubtargetPredicate;
144 list<Predicate> OtherPredicates = [];
145 list<Predicate> Predicates = !listconcat([SubtargetPredicate],
146 OtherPredicates);
147}
148
Tom Stellard75aadc22012-12-11 21:25:42 +0000149// Include AMDGPU TD files
150include "R600Schedule.td"
151include "SISchedule.td"
152include "Processors.td"
153include "AMDGPUInstrInfo.td"
154include "AMDGPUIntrinsics.td"
155include "AMDGPURegisterInfo.td"
156include "AMDGPUInstructions.td"
Christian Konig2c8f6d52013-03-07 09:03:52 +0000157include "AMDGPUCallingConv.td"