blob: 37c593d951edf89fb7a9a5cd089a68cb44aee1b6 [file] [log] [blame]
Matt Arsenault382d9452016-01-26 04:49:22 +00001//===-- AMDGPU.td - AMDGPU Tablegen files --------*- tablegen -*-===//
Tom Stellard75aadc22012-12-11 21:25:42 +00002//
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//
Matt Arsenault382d9452016-01-26 04:49:22 +00008//===------------------------------------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +00009
Tom Stellardbc5b5372014-06-13 16:38:59 +000010include "llvm/Target/Target.td"
Tom Stellard75aadc22012-12-11 21:25:42 +000011
Matt Arsenault382d9452016-01-26 04:49:22 +000012//===------------------------------------------------------------===//
13// Subtarget Features (device properties)
14//===------------------------------------------------------------===//
Tom Stellard783893a2013-11-18 19:43:33 +000015
Matt Arsenaultf5e29972014-06-20 06:50:05 +000016def FeatureFP64 : SubtargetFeature<"fp64",
Matt Arsenault382d9452016-01-26 04:49:22 +000017 "FP64",
18 "true",
19 "Enable double precision operations"
20>;
Matt Arsenaultf171cf22014-07-14 23:40:49 +000021
Jan Vesely39aeab42017-12-04 23:07:28 +000022def FeatureFMA : SubtargetFeature<"fmaf",
23 "FMA",
24 "true",
25 "Enable single precision FMA (not as fast as mul+add, but fused)"
26>;
27
Matt Arsenaultb035a572015-01-29 19:34:25 +000028def FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
Matt Arsenault382d9452016-01-26 04:49:22 +000029 "FastFMAF32",
30 "true",
31 "Assuming f32 fma is at least as fast as mul + add"
32>;
Matt Arsenaultb035a572015-01-29 19:34:25 +000033
Dmitry Preobrazhenskye3271ae2018-02-05 12:45:43 +000034def FeatureMIMG_R128 : SubtargetFeature<"mimg-r128",
35 "MIMG_R128",
36 "true",
37 "Support 128-bit texture resources"
38>;
39
Matt Arsenaulte83690c2016-01-18 21:13:50 +000040def HalfRate64Ops : SubtargetFeature<"half-rate-64-ops",
Matt Arsenault382d9452016-01-26 04:49:22 +000041 "HalfRate64Ops",
42 "true",
43 "Most fp64 instructions are half rate instead of quarter"
44>;
Matt Arsenaultf171cf22014-07-14 23:40:49 +000045
Tom Stellard99792772013-06-07 20:28:49 +000046def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
Matt Arsenault382d9452016-01-26 04:49:22 +000047 "R600ALUInst",
48 "false",
49 "Older version of ALU instructions encoding"
50>;
Tom Stellard99792772013-06-07 20:28:49 +000051
52def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
Matt Arsenault382d9452016-01-26 04:49:22 +000053 "HasVertexCache",
54 "true",
55 "Specify use of dedicated vertex cache"
56>;
Tom Stellard99792772013-06-07 20:28:49 +000057
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000058def FeatureCaymanISA : SubtargetFeature<"caymanISA",
Matt Arsenault382d9452016-01-26 04:49:22 +000059 "CaymanISA",
60 "true",
61 "Use Cayman ISA"
62>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000063
Tom Stellard348273d2014-01-23 16:18:02 +000064def FeatureCFALUBug : SubtargetFeature<"cfalubug",
Matt Arsenault382d9452016-01-26 04:49:22 +000065 "CFALUBug",
66 "true",
67 "GPU has CF_ALU bug"
68>;
Changpeng Fangb41574a2015-12-22 20:55:23 +000069
Matt Arsenault3f981402014-09-15 15:41:53 +000070def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
Matt Arsenault382d9452016-01-26 04:49:22 +000071 "FlatAddressSpace",
72 "true",
73 "Support flat address space"
74>;
Matt Arsenault3f981402014-09-15 15:41:53 +000075
Matt Arsenaultacdc7652017-05-10 21:19:05 +000076def FeatureFlatInstOffsets : SubtargetFeature<"flat-inst-offsets",
77 "FlatInstOffsets",
78 "true",
79 "Flat instructions have immediate offset addressing mode"
80>;
81
82def FeatureFlatGlobalInsts : SubtargetFeature<"flat-global-insts",
83 "FlatGlobalInsts",
84 "true",
85 "Have global_* flat memory instructions"
86>;
87
88def FeatureFlatScratchInsts : SubtargetFeature<"flat-scratch-insts",
89 "FlatScratchInsts",
90 "true",
91 "Have scratch_* flat memory instructions"
92>;
93
Matt Arsenaultc37fe662017-07-20 17:42:47 +000094def FeatureAddNoCarryInsts : SubtargetFeature<"add-no-carry-insts",
95 "AddNoCarryInsts",
96 "true",
97 "Have VALU add/sub instructions without carry out"
98>;
99
Matt Arsenault7f681ac2016-07-01 23:03:44 +0000100def FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
101 "UnalignedBufferAccess",
102 "true",
103 "Support unaligned global loads and stores"
104>;
105
Wei Ding205bfdb2017-02-10 02:15:29 +0000106def FeatureTrapHandler: SubtargetFeature<"trap-handler",
107 "TrapHandler",
108 "true",
109 "Trap handler support"
110>;
111
Tom Stellard64a9d082016-10-14 18:10:39 +0000112def FeatureUnalignedScratchAccess : SubtargetFeature<"unaligned-scratch-access",
113 "UnalignedScratchAccess",
114 "true",
115 "Support unaligned scratch loads and stores"
116>;
117
Matt Arsenaulte823d922017-02-18 18:29:53 +0000118def FeatureApertureRegs : SubtargetFeature<"aperture-regs",
119 "HasApertureRegs",
120 "true",
121 "Has Memory Aperture Base and Size Registers"
122>;
123
Matt Arsenault28f52e52017-10-25 07:00:51 +0000124def FeatureMadMixInsts : SubtargetFeature<"mad-mix-insts",
125 "HasMadMixInsts",
126 "true",
127 "Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions"
128>;
129
Marek Olsak0f55fba2016-12-09 19:49:54 +0000130// XNACK is disabled if SH_MEM_CONFIG.ADDRESS_MODE = GPUVM on chips that support
131// XNACK. The current default kernel driver setting is:
132// - graphics ring: XNACK disabled
133// - compute ring: XNACK enabled
134//
135// If XNACK is enabled, the VMEM latency can be worse.
136// If XNACK is disabled, the 2 SGPRs can be used for general purposes.
Nicolai Haehnle5b504972016-01-04 23:35:53 +0000137def FeatureXNACK : SubtargetFeature<"xnack",
Matt Arsenault382d9452016-01-26 04:49:22 +0000138 "EnableXNACK",
139 "true",
140 "Enable XNACK support"
141>;
Tom Stellarde99fb652015-01-20 19:33:04 +0000142
Marek Olsak4d00dd22015-03-09 15:48:09 +0000143def FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
Matt Arsenault382d9452016-01-26 04:49:22 +0000144 "SGPRInitBug",
145 "true",
Matt Arsenaulta7eb14af2017-08-06 18:13:23 +0000146 "VI SGPR initialization bug requiring a fixed SGPR allocation size"
Matt Arsenault382d9452016-01-26 04:49:22 +0000147>;
Tom Stellardde008d32016-01-21 04:28:34 +0000148
Tom Stellard3498e4f2013-06-07 20:28:55 +0000149class SubtargetFeatureFetchLimit <string Value> :
150 SubtargetFeature <"fetch"#Value,
Matt Arsenault382d9452016-01-26 04:49:22 +0000151 "TexVTXClauseSize",
152 Value,
153 "Limit the maximum number of fetches in a clause to "#Value
154>;
Tom Stellard99792772013-06-07 20:28:49 +0000155
Tom Stellard3498e4f2013-06-07 20:28:55 +0000156def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
157def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
158
Tom Stellard8c347b02014-01-22 21:55:40 +0000159class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
Matt Arsenault382d9452016-01-26 04:49:22 +0000160 "wavefrontsize"#Value,
161 "WavefrontSize",
162 !cast<string>(Value),
163 "The number of threads per wavefront"
164>;
Tom Stellard8c347b02014-01-22 21:55:40 +0000165
166def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
167def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
168def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
169
Tom Stellardec87f842015-05-25 16:15:54 +0000170class SubtargetFeatureLDSBankCount <int Value> : SubtargetFeature <
Matt Arsenault382d9452016-01-26 04:49:22 +0000171 "ldsbankcount"#Value,
172 "LDSBankCount",
173 !cast<string>(Value),
174 "The number of LDS banks per compute unit."
175>;
Tom Stellardec87f842015-05-25 16:15:54 +0000176
177def FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
178def FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
179
Tom Stellard880a80a2014-06-17 16:53:14 +0000180class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
Matt Arsenault382d9452016-01-26 04:49:22 +0000181 "localmemorysize"#Value,
182 "LocalMemorySize",
183 !cast<string>(Value),
184 "The size of local memory in bytes"
185>;
Tom Stellard880a80a2014-06-17 16:53:14 +0000186
Tom Stellardd7e6f132015-04-08 01:09:26 +0000187def FeatureGCN : SubtargetFeature<"gcn",
Matt Arsenault382d9452016-01-26 04:49:22 +0000188 "IsGCN",
189 "true",
190 "GCN or newer GPU"
191>;
Tom Stellardd7e6f132015-04-08 01:09:26 +0000192
Tom Stellardd7e6f132015-04-08 01:09:26 +0000193def FeatureGCN3Encoding : SubtargetFeature<"gcn3-encoding",
Matt Arsenault382d9452016-01-26 04:49:22 +0000194 "GCN3Encoding",
195 "true",
196 "Encoding format for VI"
197>;
Tom Stellardd1f0f022015-04-23 19:33:54 +0000198
199def FeatureCIInsts : SubtargetFeature<"ci-insts",
Matt Arsenault382d9452016-01-26 04:49:22 +0000200 "CIInsts",
201 "true",
Matt Arsenaultc6baa852017-10-02 20:31:18 +0000202 "Additional instructions for CI+"
Matt Arsenault382d9452016-01-26 04:49:22 +0000203>;
204
Matt Arsenault2021f082017-02-18 19:12:26 +0000205def FeatureGFX9Insts : SubtargetFeature<"gfx9-insts",
206 "GFX9Insts",
207 "true",
Matt Arsenaultc6baa852017-10-02 20:31:18 +0000208 "Additional instructions for GFX9+"
Matt Arsenault2021f082017-02-18 19:12:26 +0000209>;
210
Matt Arsenault9d82ee72016-02-27 08:53:55 +0000211def FeatureSMemRealTime : SubtargetFeature<"s-memrealtime",
212 "HasSMemRealTime",
Matt Arsenault61738cb2016-02-27 08:53:46 +0000213 "true",
Matt Arsenault9d82ee72016-02-27 08:53:55 +0000214 "Has s_memrealtime instruction"
215>;
216
Matt Arsenaultc88ba362016-10-29 04:05:06 +0000217def FeatureInv2PiInlineImm : SubtargetFeature<"inv-2pi-inline-imm",
218 "HasInv2PiInlineImm",
219 "true",
220 "Has 1 / (2 * pi) as inline immediate"
221>;
222
Matt Arsenault9d82ee72016-02-27 08:53:55 +0000223def Feature16BitInsts : SubtargetFeature<"16-bit-insts",
224 "Has16BitInsts",
225 "true",
226 "Has i16/f16 instructions"
Matt Arsenault61738cb2016-02-27 08:53:46 +0000227>;
228
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000229def FeatureVOP3P : SubtargetFeature<"vop3p",
230 "HasVOP3PInsts",
231 "true",
232 "Has VOP3P packed instructions"
233>;
234
Matt Arsenaultcc88ce32016-10-12 18:00:51 +0000235def FeatureMovrel : SubtargetFeature<"movrel",
236 "HasMovrel",
237 "true",
238 "Has v_movrel*_b32 instructions"
239>;
240
241def FeatureVGPRIndexMode : SubtargetFeature<"vgpr-index-mode",
242 "HasVGPRIndexMode",
243 "true",
244 "Has VGPR mode register indexing"
245>;
246
Matt Arsenault7b647552016-10-28 21:55:15 +0000247def FeatureScalarStores : SubtargetFeature<"scalar-stores",
248 "HasScalarStores",
249 "true",
250 "Has store scalar memory instructions"
251>;
252
Dmitry Preobrazhensky6bad04e2018-04-02 16:10:25 +0000253def FeatureScalarAtomics : SubtargetFeature<"scalar-atomics",
254 "HasScalarAtomics",
255 "true",
256 "Has atomic scalar memory instructions"
257>;
258
Sam Kolton07dbde22017-01-20 10:01:25 +0000259def FeatureSDWA : SubtargetFeature<"sdwa",
260 "HasSDWA",
261 "true",
262 "Support SDWA (Sub-DWORD Addressing) extension"
263>;
264
Sam Kolton3c4933f2017-06-22 06:26:41 +0000265def FeatureSDWAOmod : SubtargetFeature<"sdwa-omod",
266 "HasSDWAOmod",
267 "true",
268 "Support OMod with SDWA (Sub-DWORD Addressing) extension"
269>;
270
271def FeatureSDWAScalar : SubtargetFeature<"sdwa-scalar",
272 "HasSDWAScalar",
273 "true",
274 "Support scalar register with SDWA (Sub-DWORD Addressing) extension"
275>;
276
277def FeatureSDWASdst : SubtargetFeature<"sdwa-sdst",
278 "HasSDWASdst",
279 "true",
280 "Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension"
281>;
282
283def FeatureSDWAMac : SubtargetFeature<"sdwa-mav",
284 "HasSDWAMac",
285 "true",
286 "Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension"
287>;
288
Sam Koltona179d252017-06-27 15:02:23 +0000289def FeatureSDWAOutModsVOPC : SubtargetFeature<"sdwa-out-mods-vopc",
290 "HasSDWAOutModsVOPC",
Sam Kolton3c4933f2017-06-22 06:26:41 +0000291 "true",
292 "Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension"
293>;
294
Sam Kolton07dbde22017-01-20 10:01:25 +0000295def FeatureDPP : SubtargetFeature<"dpp",
296 "HasDPP",
297 "true",
298 "Support DPP (Data Parallel Primitives) extension"
299>;
300
Dmitry Preobrazhenskyff64aa52017-08-16 13:51:56 +0000301def FeatureIntClamp : SubtargetFeature<"int-clamp-insts",
302 "HasIntClamp",
303 "true",
304 "Support clamp for integer destination"
305>;
306
Changpeng Fang44dfa1d2018-01-12 21:12:19 +0000307def FeatureUnpackedD16VMem : SubtargetFeature<"unpacked-d16-vmem",
308 "HasUnpackedD16VMem",
309 "true",
310 "Has unpacked d16 vmem instructions"
311>;
312
Matt Arsenault382d9452016-01-26 04:49:22 +0000313//===------------------------------------------------------------===//
314// Subtarget Features (options and debugging)
315//===------------------------------------------------------------===//
316
317// Some instructions do not support denormals despite this flag. Using
318// fp32 denormals also causes instructions to run at the double
319// precision rate for the device.
320def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals",
321 "FP32Denormals",
322 "true",
323 "Enable single precision denormal handling"
324>;
325
Matt Arsenaulta6867fd2017-01-23 22:31:03 +0000326// Denormal handling for fp64 and fp16 is controlled by the same
327// config register when fp16 supported.
328// TODO: Do we need a separate f16 setting when not legal?
329def FeatureFP64FP16Denormals : SubtargetFeature<"fp64-fp16-denormals",
330 "FP64FP16Denormals",
Matt Arsenault382d9452016-01-26 04:49:22 +0000331 "true",
Matt Arsenaulta6867fd2017-01-23 22:31:03 +0000332 "Enable double and half precision denormal handling",
Matt Arsenault382d9452016-01-26 04:49:22 +0000333 [FeatureFP64]
334>;
335
Matt Arsenaulta6867fd2017-01-23 22:31:03 +0000336def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals",
337 "FP64FP16Denormals",
338 "true",
339 "Enable double and half precision denormal handling",
340 [FeatureFP64, FeatureFP64FP16Denormals]
341>;
342
343def FeatureFP16Denormals : SubtargetFeature<"fp16-denormals",
344 "FP64FP16Denormals",
345 "true",
346 "Enable half precision denormal handling",
347 [FeatureFP64FP16Denormals]
348>;
349
Matt Arsenault2fdf2a12017-02-21 23:35:48 +0000350def FeatureDX10Clamp : SubtargetFeature<"dx10-clamp",
351 "DX10Clamp",
352 "true",
353 "clamp modifier clamps NaNs to 0.0"
354>;
355
Matt Arsenaultf639c322016-01-28 20:53:42 +0000356def FeatureFPExceptions : SubtargetFeature<"fp-exceptions",
357 "FPExceptions",
358 "true",
359 "Enable floating point exceptions"
360>;
361
Matt Arsenault24ee0782016-02-12 02:40:47 +0000362class FeatureMaxPrivateElementSize<int size> : SubtargetFeature<
363 "max-private-element-size-"#size,
364 "MaxPrivateElementSize",
365 !cast<string>(size),
366 "Maximum private access size may be "#size
367>;
368
369def FeatureMaxPrivateElementSize4 : FeatureMaxPrivateElementSize<4>;
370def FeatureMaxPrivateElementSize8 : FeatureMaxPrivateElementSize<8>;
371def FeatureMaxPrivateElementSize16 : FeatureMaxPrivateElementSize<16>;
372
Matt Arsenault45b98182017-11-15 00:45:43 +0000373def FeatureEnableHugePrivateBuffer : SubtargetFeature<
374 "huge-private-buffer",
375 "EnableHugePrivateBuffer",
376 "true",
377 "Enable private/scratch buffer sizes greater than 128 GB"
378>;
379
Matt Arsenault382d9452016-01-26 04:49:22 +0000380def FeatureVGPRSpilling : SubtargetFeature<"vgpr-spilling",
381 "EnableVGPRSpilling",
382 "true",
383 "Enable spilling of VGPRs to scratch memory"
384>;
385
386def FeatureDumpCode : SubtargetFeature <"DumpCode",
387 "DumpCode",
388 "true",
389 "Dump MachineInstrs in the CodeEmitter"
390>;
391
392def FeatureDumpCodeLower : SubtargetFeature <"dumpcode",
393 "DumpCode",
394 "true",
395 "Dump MachineInstrs in the CodeEmitter"
396>;
397
Matt Arsenault382d9452016-01-26 04:49:22 +0000398def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
399 "EnablePromoteAlloca",
400 "true",
401 "Enable promote alloca pass"
402>;
403
404// XXX - This should probably be removed once enabled by default
405def FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
406 "EnableLoadStoreOpt",
407 "true",
408 "Enable SI load/store optimizer pass"
409>;
410
411// Performance debugging feature. Allow using DS instruction immediate
412// offsets even if the base pointer can't be proven to be base. On SI,
413// base pointer values that won't give the same result as a 16-bit add
414// are not safe to fold, but this will override the conservative test
415// for the base pointer.
416def FeatureEnableUnsafeDSOffsetFolding : SubtargetFeature <
417 "unsafe-ds-offset-folding",
418 "EnableUnsafeDSOffsetFolding",
419 "true",
420 "Force using DS instruction immediate offsets on SI"
421>;
422
Matt Arsenault382d9452016-01-26 04:49:22 +0000423def FeatureEnableSIScheduler : SubtargetFeature<"si-scheduler",
424 "EnableSIScheduler",
425 "true",
426 "Enable SI Machine Scheduler"
427>;
428
Marek Olsaka9a58fa2018-04-10 22:48:23 +0000429def FeatureEnableDS128 : SubtargetFeature<"enable-ds128",
430 "EnableDS128",
431 "true",
432 "Use ds_{read|write}_b128"
433>;
434
Matt Arsenault7aad8fd2017-01-24 22:02:15 +0000435// Unless +-flat-for-global is specified, turn on FlatForGlobal for
436// all OS-es on VI and newer hardware to avoid assertion failures due
437// to missing ADDR64 variants of MUBUF instructions.
438// FIXME: moveToVALU should be able to handle converting addr64 MUBUF
439// instructions.
440
Matt Arsenault382d9452016-01-26 04:49:22 +0000441def FeatureFlatForGlobal : SubtargetFeature<"flat-for-global",
442 "FlatForGlobal",
443 "true",
Matt Arsenaultd8f7ea32017-01-27 17:42:26 +0000444 "Force to generate flat instruction for global"
Matt Arsenault382d9452016-01-26 04:49:22 +0000445>;
Tom Stellardd1f0f022015-04-23 19:33:54 +0000446
Konstantin Zhuravlyovbe6c0ca2017-06-02 17:40:26 +0000447def FeatureAutoWaitcntBeforeBarrier : SubtargetFeature <
448 "auto-waitcnt-before-barrier",
449 "AutoWaitcntBeforeBarrier",
450 "true",
451 "Hardware automatically inserts waitcnt before barrier"
452>;
453
Konstantin Zhuravlyoveda425e2017-10-14 15:59:07 +0000454def FeatureCodeObjectV3 : SubtargetFeature <
455 "code-object-v3",
456 "CodeObjectV3",
457 "true",
458 "Generate code object version 3"
459>;
460
Tom Stellardd1f0f022015-04-23 19:33:54 +0000461// Dummy feature used to disable assembler instructions.
462def FeatureDisable : SubtargetFeature<"",
Matt Arsenault382d9452016-01-26 04:49:22 +0000463 "FeatureDisable","true",
464 "Dummy feature to disable assembler instructions"
465>;
Tom Stellardd1f0f022015-04-23 19:33:54 +0000466
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000467class SubtargetFeatureGeneration <string Value,
468 list<SubtargetFeature> Implies> :
469 SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
470 Value#" GPU generation", Implies>;
471
Tom Stellard880a80a2014-06-17 16:53:14 +0000472def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
473def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
474def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
475
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000476def FeatureR600 : SubtargetFeatureGeneration<"R600",
Matt Arsenault382d9452016-01-26 04:49:22 +0000477 [FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]
478>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000479
480def FeatureR700 : SubtargetFeatureGeneration<"R700",
Matt Arsenault382d9452016-01-26 04:49:22 +0000481 [FeatureFetchLimit16, FeatureLocalMemorySize0]
482>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000483
484def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
Matt Arsenault382d9452016-01-26 04:49:22 +0000485 [FeatureFetchLimit16, FeatureLocalMemorySize32768]
486>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000487
488def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
Matt Arsenault382d9452016-01-26 04:49:22 +0000489 [FeatureFetchLimit16, FeatureWavefrontSize64,
490 FeatureLocalMemorySize32768]
Tom Stellard880a80a2014-06-17 16:53:14 +0000491>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000492
493def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
Dmitry Preobrazhenskye3271ae2018-02-05 12:45:43 +0000494 [FeatureFP64, FeatureLocalMemorySize32768, FeatureMIMG_R128,
Matt Arsenault8728c5f2017-08-07 14:58:04 +0000495 FeatureWavefrontSize64, FeatureGCN,
Matt Arsenaultcc88ce32016-10-12 18:00:51 +0000496 FeatureLDSBankCount32, FeatureMovrel]
Matt Arsenault382d9452016-01-26 04:49:22 +0000497>;
Tom Stellarda6c6e1b2013-06-07 20:37:48 +0000498
Tom Stellard6e1ee472013-10-29 16:37:28 +0000499def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
Dmitry Preobrazhenskye3271ae2018-02-05 12:45:43 +0000500 [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
Matt Arsenault382d9452016-01-26 04:49:22 +0000501 FeatureWavefrontSize64, FeatureGCN, FeatureFlatAddressSpace,
Matt Arsenault8728c5f2017-08-07 14:58:04 +0000502 FeatureCIInsts, FeatureMovrel]
Matt Arsenault382d9452016-01-26 04:49:22 +0000503>;
Marek Olsak5df00d62014-12-07 12:18:57 +0000504
505def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
Dmitry Preobrazhenskye3271ae2018-02-05 12:45:43 +0000506 [FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
Matt Arsenault382d9452016-01-26 04:49:22 +0000507 FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
Matt Arsenault9d82ee72016-02-27 08:53:55 +0000508 FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
Matt Arsenault7b647552016-10-28 21:55:15 +0000509 FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel,
Sam Kolton3c4933f2017-06-22 06:26:41 +0000510 FeatureScalarStores, FeatureInv2PiInlineImm,
Dmitry Preobrazhenskyff64aa52017-08-16 13:51:56 +0000511 FeatureSDWA, FeatureSDWAOutModsVOPC, FeatureSDWAMac, FeatureDPP,
512 FeatureIntClamp
Matt Arsenault9d82ee72016-02-27 08:53:55 +0000513 ]
Matt Arsenault382d9452016-01-26 04:49:22 +0000514>;
Marek Olsak5df00d62014-12-07 12:18:57 +0000515
Matt Arsenaulte823d922017-02-18 18:29:53 +0000516def FeatureGFX9 : SubtargetFeatureGeneration<"GFX9",
517 [FeatureFP64, FeatureLocalMemorySize65536,
518 FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
519 FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
520 FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
Konstantin Zhuravlyovf6284062017-04-21 19:57:53 +0000521 FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode,
Dmitry Preobrazhenskyff64aa52017-08-16 13:51:56 +0000522 FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
Sam Kolton3c4933f2017-06-22 06:26:41 +0000523 FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
Matt Arsenaultc37fe662017-07-20 17:42:47 +0000524 FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
Dmitry Preobrazhensky6bad04e2018-04-02 16:10:25 +0000525 FeatureAddNoCarryInsts, FeatureScalarAtomics
Matt Arsenaulte823d922017-02-18 18:29:53 +0000526 ]
527>;
528
Yaxun Liu94add852016-10-26 16:37:56 +0000529class SubtargetFeatureISAVersion <int Major, int Minor, int Stepping,
530 list<SubtargetFeature> Implies>
531 : SubtargetFeature <
532 "isaver"#Major#"."#Minor#"."#Stepping,
533 "IsaVersion",
534 "ISAVersion"#Major#"_"#Minor#"_"#Stepping,
535 "Instruction set version number",
536 Implies
537>;
538
Wei Ding7c3e5112017-06-10 03:53:19 +0000539def FeatureISAVersion6_0_0 : SubtargetFeatureISAVersion <6,0,0,
540 [FeatureSouthernIslands,
Matt Arsenault8bcf2f22017-06-26 03:01:36 +0000541 FeatureFastFMAF32,
Wei Ding7c3e5112017-06-10 03:53:19 +0000542 HalfRate64Ops,
543 FeatureLDSBankCount32]>;
544
545def FeatureISAVersion6_0_1 : SubtargetFeatureISAVersion <6,0,1,
546 [FeatureSouthernIslands,
547 FeatureLDSBankCount32]>;
Matt Arsenault8bcf2f22017-06-26 03:01:36 +0000548
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000549def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0,
Yaxun Liu94add852016-10-26 16:37:56 +0000550 [FeatureSeaIslands,
551 FeatureLDSBankCount32]>;
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000552
Yaxun Liu94add852016-10-26 16:37:56 +0000553def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1,
554 [FeatureSeaIslands,
555 HalfRate64Ops,
556 FeatureLDSBankCount32,
557 FeatureFastFMAF32]>;
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000558
Yaxun Liu94add852016-10-26 16:37:56 +0000559def FeatureISAVersion7_0_2 : SubtargetFeatureISAVersion <7,0,2,
560 [FeatureSeaIslands,
Konstantin Zhuravlyov40b09e82018-02-27 21:46:15 +0000561 FeatureLDSBankCount16,
562 FeatureFastFMAF32]>;
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000563
Wei Ding7c3e5112017-06-10 03:53:19 +0000564def FeatureISAVersion7_0_3 : SubtargetFeatureISAVersion <7,0,3,
565 [FeatureSeaIslands,
566 FeatureLDSBankCount16]>;
567
Konstantin Zhuravlyovc40d9f22017-12-08 20:52:28 +0000568def FeatureISAVersion7_0_4 : SubtargetFeatureISAVersion <7,0,4,
569 [FeatureSeaIslands,
570 FeatureLDSBankCount32]>;
571
Yaxun Liu94add852016-10-26 16:37:56 +0000572def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1,
573 [FeatureVolcanicIslands,
Konstantin Zhuravlyov68107652017-08-24 20:03:07 +0000574 FeatureFastFMAF32,
575 HalfRate64Ops,
Yaxun Liu94add852016-10-26 16:37:56 +0000576 FeatureLDSBankCount32,
Changpeng Fang44dfa1d2018-01-12 21:12:19 +0000577 FeatureXNACK,
578 FeatureUnpackedD16VMem]>;
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000579
Yaxun Liu94add852016-10-26 16:37:56 +0000580def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2,
581 [FeatureVolcanicIslands,
582 FeatureLDSBankCount32,
Changpeng Fang44dfa1d2018-01-12 21:12:19 +0000583 FeatureSGPRInitBug,
584 FeatureUnpackedD16VMem]>;
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000585
Yaxun Liu94add852016-10-26 16:37:56 +0000586def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3,
587 [FeatureVolcanicIslands,
Changpeng Fang44dfa1d2018-01-12 21:12:19 +0000588 FeatureLDSBankCount32,
589 FeatureUnpackedD16VMem]>;
Matt Arsenaultf3dd8632016-11-01 00:55:14 +0000590
Yaxun Liu94add852016-10-26 16:37:56 +0000591def FeatureISAVersion8_1_0 : SubtargetFeatureISAVersion <8,1,0,
592 [FeatureVolcanicIslands,
593 FeatureLDSBankCount16,
594 FeatureXNACK]>;
595
Wei Ding7c3e5112017-06-10 03:53:19 +0000596def FeatureISAVersion9_0_0 : SubtargetFeatureISAVersion <9,0,0,
597 [FeatureGFX9,
Matt Arsenault28f52e52017-10-25 07:00:51 +0000598 FeatureMadMixInsts,
599 FeatureLDSBankCount32
600 ]>;
Wei Ding7c3e5112017-06-10 03:53:19 +0000601
Wei Ding7c3e5112017-06-10 03:53:19 +0000602def FeatureISAVersion9_0_2 : SubtargetFeatureISAVersion <9,0,2,
603 [FeatureGFX9,
Matt Arsenault28f52e52017-10-25 07:00:51 +0000604 FeatureMadMixInsts,
Konstantin Zhuravlyov331f97e172018-02-16 21:26:25 +0000605 FeatureLDSBankCount32,
606 FeatureXNACK
Matt Arsenault28f52e52017-10-25 07:00:51 +0000607 ]>;
Wei Ding7c3e5112017-06-10 03:53:19 +0000608
Tom Stellard3498e4f2013-06-07 20:28:55 +0000609//===----------------------------------------------------------------------===//
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +0000610// Debugger related subtarget features.
611//===----------------------------------------------------------------------===//
612
613def FeatureDebuggerInsertNops : SubtargetFeature<
614 "amdgpu-debugger-insert-nops",
615 "DebuggerInsertNops",
616 "true",
Konstantin Zhuravlyove3d322a2016-05-13 18:21:28 +0000617 "Insert one nop instruction for each high level source statement"
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +0000618>;
619
Konstantin Zhuravlyov29ddd2b2016-05-24 18:37:18 +0000620def FeatureDebuggerReserveRegs : SubtargetFeature<
621 "amdgpu-debugger-reserve-regs",
622 "DebuggerReserveRegs",
Konstantin Zhuravlyov1d99c4d2016-04-26 15:43:14 +0000623 "true",
Konstantin Zhuravlyov29ddd2b2016-05-24 18:37:18 +0000624 "Reserve registers for debugger usage"
Konstantin Zhuravlyov1d99c4d2016-04-26 15:43:14 +0000625>;
626
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000627def FeatureDebuggerEmitPrologue : SubtargetFeature<
628 "amdgpu-debugger-emit-prologue",
629 "DebuggerEmitPrologue",
630 "true",
631 "Emit debugger prologue"
632>;
633
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +0000634//===----------------------------------------------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +0000635
636def AMDGPUInstrInfo : InstrInfo {
637 let guessInstructionProperties = 1;
Matt Arsenault1ecac062015-02-18 02:15:32 +0000638 let noNamedPositionallyEncodedOperands = 1;
Tom Stellard75aadc22012-12-11 21:25:42 +0000639}
640
Tom Stellard9d7ddd52014-11-14 14:08:00 +0000641def AMDGPUAsmParser : AsmParser {
642 // Some of the R600 registers have the same name, so this crashes.
643 // For example T0_XYZW and T0_XY both have the asm name T0.
644 let ShouldEmitMatchRegisterName = 0;
645}
646
Konstantin Zhuravlyovda4687c2016-09-27 14:42:48 +0000647def AMDGPUAsmWriter : AsmWriter {
648 int PassSubtarget = 1;
649}
650
Sam Koltond63d8a72016-09-09 09:37:51 +0000651def AMDGPUAsmVariants {
652 string Default = "Default";
653 int Default_ID = 0;
654 string VOP3 = "VOP3";
655 int VOP3_ID = 1;
656 string SDWA = "SDWA";
657 int SDWA_ID = 2;
Sam Koltonf7659d712017-05-23 10:08:55 +0000658 string SDWA9 = "SDWA9";
659 int SDWA9_ID = 3;
Sam Koltond63d8a72016-09-09 09:37:51 +0000660 string DPP = "DPP";
Sam Koltonf7659d712017-05-23 10:08:55 +0000661 int DPP_ID = 4;
Sam Koltonfb0d9d92016-09-12 14:42:43 +0000662 string Disable = "Disable";
Sam Koltonf7659d712017-05-23 10:08:55 +0000663 int Disable_ID = 5;
Sam Koltond63d8a72016-09-09 09:37:51 +0000664}
665
666def DefaultAMDGPUAsmParserVariant : AsmParserVariant {
667 let Variant = AMDGPUAsmVariants.Default_ID;
668 let Name = AMDGPUAsmVariants.Default;
669}
670
671def VOP3AsmParserVariant : AsmParserVariant {
672 let Variant = AMDGPUAsmVariants.VOP3_ID;
673 let Name = AMDGPUAsmVariants.VOP3;
674}
675
676def SDWAAsmParserVariant : AsmParserVariant {
677 let Variant = AMDGPUAsmVariants.SDWA_ID;
678 let Name = AMDGPUAsmVariants.SDWA;
679}
680
Sam Koltonf7659d712017-05-23 10:08:55 +0000681def SDWA9AsmParserVariant : AsmParserVariant {
682 let Variant = AMDGPUAsmVariants.SDWA9_ID;
683 let Name = AMDGPUAsmVariants.SDWA9;
684}
685
686
Sam Koltond63d8a72016-09-09 09:37:51 +0000687def DPPAsmParserVariant : AsmParserVariant {
688 let Variant = AMDGPUAsmVariants.DPP_ID;
689 let Name = AMDGPUAsmVariants.DPP;
690}
691
Tom Stellard75aadc22012-12-11 21:25:42 +0000692def AMDGPU : Target {
693 // Pull in Instruction Info:
694 let InstructionSet = AMDGPUInstrInfo;
Tom Stellard9d7ddd52014-11-14 14:08:00 +0000695 let AssemblyParsers = [AMDGPUAsmParser];
Sam Koltond63d8a72016-09-09 09:37:51 +0000696 let AssemblyParserVariants = [DefaultAMDGPUAsmParserVariant,
697 VOP3AsmParserVariant,
698 SDWAAsmParserVariant,
Sam Koltonf7659d712017-05-23 10:08:55 +0000699 SDWA9AsmParserVariant,
Sam Koltond63d8a72016-09-09 09:37:51 +0000700 DPPAsmParserVariant];
Konstantin Zhuravlyovda4687c2016-09-27 14:42:48 +0000701 let AssemblyWriters = [AMDGPUAsmWriter];
Geoff Berryf8bf2ec2018-02-23 18:25:08 +0000702 let AllowRegisterRenaming = 1;
Tom Stellard75aadc22012-12-11 21:25:42 +0000703}
704
Tom Stellardbc5b5372014-06-13 16:38:59 +0000705// Dummy Instruction itineraries for pseudo instructions
706def ALU_NULL : FuncUnit;
707def NullALU : InstrItinClass;
708
Tom Stellard0e70de52014-05-16 20:56:45 +0000709//===----------------------------------------------------------------------===//
710// Predicate helper class
711//===----------------------------------------------------------------------===//
712
Tom Stellardd1f0f022015-04-23 19:33:54 +0000713def TruePredicate : Predicate<"true">;
Matt Arsenault382d9452016-01-26 04:49:22 +0000714
Tom Stellardd1f0f022015-04-23 19:33:54 +0000715def isSICI : Predicate<
716 "Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
717 "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS"
Matt Arsenault8728c5f2017-08-07 14:58:04 +0000718>, AssemblerPredicate<"!FeatureGCN3Encoding">;
Tom Stellardd1f0f022015-04-23 19:33:54 +0000719
Tom Stellard5ebdfbe2015-12-24 03:18:18 +0000720def isVI : Predicate <
721 "Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">,
722 AssemblerPredicate<"FeatureGCN3Encoding">;
723
Matt Arsenault2021f082017-02-18 19:12:26 +0000724def isGFX9 : Predicate <
725 "Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
726 AssemblerPredicate<"FeatureGFX9Insts">;
727
Matt Arsenaulte823d922017-02-18 18:29:53 +0000728// TODO: Either the name to be changed or we simply use IsCI!
Matt Arsenault382d9452016-01-26 04:49:22 +0000729def isCIVI : Predicate <
Matt Arsenaulte823d922017-02-18 18:29:53 +0000730 "Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">,
731 AssemblerPredicate<"FeatureCIInsts">;
Matt Arsenault382d9452016-01-26 04:49:22 +0000732
Matt Arsenault9698f1c2017-06-20 19:54:14 +0000733def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">,
734 AssemblerPredicate<"FeatureFlatAddressSpace">;
735
736def HasFlatGlobalInsts : Predicate<"Subtarget->hasFlatGlobalInsts()">,
737 AssemblerPredicate<"FeatureFlatGlobalInsts">;
Matt Arsenaultca7b0a12017-07-21 15:36:16 +0000738def HasFlatScratchInsts : Predicate<"Subtarget->hasFlatScratchInsts()">,
739 AssemblerPredicate<"FeatureFlatScratchInsts">;
Matt Arsenaulted6e8f02017-09-01 18:36:06 +0000740def HasD16LoadStore : Predicate<"Subtarget->hasD16LoadStore()">,
741 AssemblerPredicate<"FeatureGFX9Insts">;
Matt Arsenault382d9452016-01-26 04:49:22 +0000742
Changpeng Fang44dfa1d2018-01-12 21:12:19 +0000743def HasUnpackedD16VMem : Predicate<"Subtarget->hasUnpackedD16VMem()">,
744 AssemblerPredicate<"FeatureUnpackedD16VMem">;
745def HasPackedD16VMem : Predicate<"!Subtarget->hasUnpackedD16VMem()">,
746 AssemblerPredicate<"!FeatureUnpackedD16VMem">;
747
Matt Arsenault3f71c0e2017-11-29 00:55:57 +0000748
749def LDSRequiresM0Init : Predicate<"Subtarget->ldsRequiresM0Init()">;
750def NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
751
Matt Arsenaultefa1d652017-09-01 18:38:02 +0000752def HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
753 AssemblerPredicate<"FeatureGFX9Insts">;
754
Matt Arsenaultc37fe662017-07-20 17:42:47 +0000755def HasAddNoCarryInsts : Predicate<"Subtarget->hasAddNoCarryInsts()">,
756 AssemblerPredicate<"FeatureAddNoCarryInsts">;
757
758def NotHasAddNoCarryInsts : Predicate<"!Subtarget->hasAddNoCarryInsts()">,
759 AssemblerPredicate<"!FeatureAddNoCarryInsts">;
760
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000761def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
762 AssemblerPredicate<"Feature16BitInsts">;
763def HasVOP3PInsts : Predicate<"Subtarget->hasVOP3PInsts()">,
764 AssemblerPredicate<"FeatureVOP3P">;
Tom Stellard115a6152016-11-10 16:02:37 +0000765
Sam Kolton07dbde22017-01-20 10:01:25 +0000766def HasSDWA : Predicate<"Subtarget->hasSDWA()">,
Sam Koltonf7659d712017-05-23 10:08:55 +0000767 AssemblerPredicate<"FeatureSDWA,FeatureVolcanicIslands">;
768
769def HasSDWA9 : Predicate<"Subtarget->hasSDWA()">,
770 AssemblerPredicate<"FeatureSDWA,FeatureGFX9">;
Sam Kolton07dbde22017-01-20 10:01:25 +0000771
772def HasDPP : Predicate<"Subtarget->hasDPP()">,
773 AssemblerPredicate<"FeatureDPP">;
774
Dmitry Preobrazhenskyff64aa52017-08-16 13:51:56 +0000775def HasIntClamp : Predicate<"Subtarget->hasIntClamp()">,
776 AssemblerPredicate<"FeatureIntClamp">;
777
Matt Arsenault28f52e52017-10-25 07:00:51 +0000778def HasMadMixInsts : Predicate<"Subtarget->hasMadMixInsts()">,
779 AssemblerPredicate<"FeatureMadMixInsts">;
Matt Arsenaultd7e23032017-09-07 18:05:07 +0000780
Dmitry Preobrazhensky6bad04e2018-04-02 16:10:25 +0000781def HasScalarAtomics : Predicate<"Subtarget->hasScalarAtomics()">,
782 AssemblerPredicate<"FeatureScalarAtomics">;
783
Matt Arsenault84748032018-04-26 19:21:26 +0000784def has16BankLDS : Predicate<"Subtarget->getLDSBankCount() == 16">;
785def has32BankLDS : Predicate<"Subtarget->getLDSBankCount() == 32">;
786def HasVGPRIndexMode : Predicate<"Subtarget->hasVGPRIndexMode()">,
787 AssemblerPredicate<"FeatureVGPRIndexMode">;
788def HasMovrel : Predicate<"Subtarget->hasMovrel()">,
789 AssemblerPredicate<"FeatureMovrel">;
790
Matt Arsenaultcc852232017-10-10 20:22:07 +0000791def EnableLateCFGStructurize : Predicate<
792 "EnableLateStructurizeCFG">;
Matt Arsenault90c75932017-10-03 00:06:41 +0000793
794// Exists to help track down where SubtargetPredicate isn't set rather
795// than letting tablegen crash with an unhelpful error.
796def InvalidPred : Predicate<"predicate not set on instruction or pattern">;
797
Tom Stellard0e70de52014-05-16 20:56:45 +0000798class PredicateControl {
Matt Arsenault90c75932017-10-03 00:06:41 +0000799 Predicate SubtargetPredicate = InvalidPred;
Tom Stellardd1f0f022015-04-23 19:33:54 +0000800 Predicate SIAssemblerPredicate = isSICI;
Tom Stellard5ebdfbe2015-12-24 03:18:18 +0000801 Predicate VIAssemblerPredicate = isVI;
Tom Stellardd7e6f132015-04-08 01:09:26 +0000802 list<Predicate> AssemblerPredicates = [];
Tom Stellardd1f0f022015-04-23 19:33:54 +0000803 Predicate AssemblerPredicate = TruePredicate;
Tom Stellard0e70de52014-05-16 20:56:45 +0000804 list<Predicate> OtherPredicates = [];
Matt Arsenault90c75932017-10-03 00:06:41 +0000805 list<Predicate> Predicates = !listconcat([SubtargetPredicate,
806 AssemblerPredicate],
Tom Stellardd7e6f132015-04-08 01:09:26 +0000807 AssemblerPredicates,
Tom Stellard0e70de52014-05-16 20:56:45 +0000808 OtherPredicates);
809}
810
Matt Arsenault90c75932017-10-03 00:06:41 +0000811class AMDGPUPat<dag pattern, dag result> : Pat<pattern, result>,
812 PredicateControl;
813
814
Tom Stellard75aadc22012-12-11 21:25:42 +0000815// Include AMDGPU TD files
816include "R600Schedule.td"
Konstantin Zhuravlyov27b0a032017-11-10 20:01:58 +0000817include "R600Processors.td"
Tom Stellard75aadc22012-12-11 21:25:42 +0000818include "SISchedule.td"
Konstantin Zhuravlyov27b0a032017-11-10 20:01:58 +0000819include "GCNProcessors.td"
Tom Stellard75aadc22012-12-11 21:25:42 +0000820include "AMDGPUInstrInfo.td"
821include "AMDGPUIntrinsics.td"
822include "AMDGPURegisterInfo.td"
Tom Stellardca166212017-01-30 21:56:46 +0000823include "AMDGPURegisterBanks.td"
Tom Stellard75aadc22012-12-11 21:25:42 +0000824include "AMDGPUInstructions.td"
Christian Konig2c8f6d52013-03-07 09:03:52 +0000825include "AMDGPUCallingConv.td"
Nicolai Haehnle5d0d3032018-04-01 17:09:07 +0000826include "AMDGPUSearchableTables.td"