2016-01-26 12:49:22 +08:00
|
|
|
//===-- AMDGPU.td - AMDGPU Tablegen files --------*- tablegen -*-===//
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
2016-01-26 12:49:22 +08:00
|
|
|
//===------------------------------------------------------------===//
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2014-06-14 00:38:59 +08:00
|
|
|
include "llvm/Target/Target.td"
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2016-01-26 12:49:22 +08:00
|
|
|
//===------------------------------------------------------------===//
|
|
|
|
// Subtarget Features (device properties)
|
|
|
|
//===------------------------------------------------------------===//
|
2013-11-19 03:43:33 +08:00
|
|
|
|
2014-06-20 14:50:05 +08:00
|
|
|
def FeatureFP64 : SubtargetFeature<"fp64",
|
2016-01-26 12:49:22 +08:00
|
|
|
"FP64",
|
|
|
|
"true",
|
|
|
|
"Enable double precision operations"
|
|
|
|
>;
|
2014-07-15 07:40:49 +08:00
|
|
|
|
2017-12-05 07:07:28 +08:00
|
|
|
def FeatureFMA : SubtargetFeature<"fmaf",
|
|
|
|
"FMA",
|
|
|
|
"true",
|
|
|
|
"Enable single precision FMA (not as fast as mul+add, but fused)"
|
|
|
|
>;
|
|
|
|
|
2015-01-30 03:34:25 +08:00
|
|
|
def FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
|
2016-01-26 12:49:22 +08:00
|
|
|
"FastFMAF32",
|
|
|
|
"true",
|
|
|
|
"Assuming f32 fma is at least as fast as mul + add"
|
|
|
|
>;
|
2015-01-30 03:34:25 +08:00
|
|
|
|
2018-02-05 20:45:43 +08:00
|
|
|
def FeatureMIMG_R128 : SubtargetFeature<"mimg-r128",
|
|
|
|
"MIMG_R128",
|
|
|
|
"true",
|
|
|
|
"Support 128-bit texture resources"
|
|
|
|
>;
|
|
|
|
|
2016-01-19 05:13:50 +08:00
|
|
|
def HalfRate64Ops : SubtargetFeature<"half-rate-64-ops",
|
2016-01-26 12:49:22 +08:00
|
|
|
"HalfRate64Ops",
|
|
|
|
"true",
|
|
|
|
"Most fp64 instructions are half rate instead of quarter"
|
|
|
|
>;
|
2014-07-15 07:40:49 +08:00
|
|
|
|
2013-06-08 04:28:49 +08:00
|
|
|
def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
|
2016-01-26 12:49:22 +08:00
|
|
|
"R600ALUInst",
|
|
|
|
"false",
|
|
|
|
"Older version of ALU instructions encoding"
|
|
|
|
>;
|
2013-06-08 04:28:49 +08:00
|
|
|
|
|
|
|
def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
|
2016-01-26 12:49:22 +08:00
|
|
|
"HasVertexCache",
|
|
|
|
"true",
|
|
|
|
"Specify use of dedicated vertex cache"
|
|
|
|
>;
|
2013-06-08 04:28:49 +08:00
|
|
|
|
2013-06-08 04:37:48 +08:00
|
|
|
def FeatureCaymanISA : SubtargetFeature<"caymanISA",
|
2016-01-26 12:49:22 +08:00
|
|
|
"CaymanISA",
|
|
|
|
"true",
|
|
|
|
"Use Cayman ISA"
|
|
|
|
>;
|
2013-06-08 04:37:48 +08:00
|
|
|
|
2014-01-24 00:18:02 +08:00
|
|
|
def FeatureCFALUBug : SubtargetFeature<"cfalubug",
|
2016-01-26 12:49:22 +08:00
|
|
|
"CFALUBug",
|
|
|
|
"true",
|
|
|
|
"GPU has CF_ALU bug"
|
|
|
|
>;
|
2015-12-23 04:55:23 +08:00
|
|
|
|
2014-09-15 23:41:53 +08:00
|
|
|
def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
|
2016-01-26 12:49:22 +08:00
|
|
|
"FlatAddressSpace",
|
|
|
|
"true",
|
|
|
|
"Support flat address space"
|
|
|
|
>;
|
2014-09-15 23:41:53 +08:00
|
|
|
|
2017-05-11 05:19:05 +08:00
|
|
|
def FeatureFlatInstOffsets : SubtargetFeature<"flat-inst-offsets",
|
|
|
|
"FlatInstOffsets",
|
|
|
|
"true",
|
|
|
|
"Flat instructions have immediate offset addressing mode"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureFlatGlobalInsts : SubtargetFeature<"flat-global-insts",
|
|
|
|
"FlatGlobalInsts",
|
|
|
|
"true",
|
|
|
|
"Have global_* flat memory instructions"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureFlatScratchInsts : SubtargetFeature<"flat-scratch-insts",
|
|
|
|
"FlatScratchInsts",
|
|
|
|
"true",
|
|
|
|
"Have scratch_* flat memory instructions"
|
|
|
|
>;
|
|
|
|
|
2017-07-21 01:42:47 +08:00
|
|
|
def FeatureAddNoCarryInsts : SubtargetFeature<"add-no-carry-insts",
|
|
|
|
"AddNoCarryInsts",
|
|
|
|
"true",
|
|
|
|
"Have VALU add/sub instructions without carry out"
|
|
|
|
>;
|
|
|
|
|
2016-07-02 07:03:44 +08:00
|
|
|
def FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
|
|
|
|
"UnalignedBufferAccess",
|
|
|
|
"true",
|
|
|
|
"Support unaligned global loads and stores"
|
|
|
|
>;
|
|
|
|
|
2017-02-10 10:15:29 +08:00
|
|
|
def FeatureTrapHandler: SubtargetFeature<"trap-handler",
|
|
|
|
"TrapHandler",
|
|
|
|
"true",
|
|
|
|
"Trap handler support"
|
|
|
|
>;
|
|
|
|
|
2016-10-15 02:10:39 +08:00
|
|
|
def FeatureUnalignedScratchAccess : SubtargetFeature<"unaligned-scratch-access",
|
|
|
|
"UnalignedScratchAccess",
|
|
|
|
"true",
|
|
|
|
"Support unaligned scratch loads and stores"
|
|
|
|
>;
|
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
def FeatureApertureRegs : SubtargetFeature<"aperture-regs",
|
|
|
|
"HasApertureRegs",
|
|
|
|
"true",
|
|
|
|
"Has Memory Aperture Base and Size Registers"
|
|
|
|
>;
|
|
|
|
|
2017-10-25 15:00:51 +08:00
|
|
|
def FeatureMadMixInsts : SubtargetFeature<"mad-mix-insts",
|
|
|
|
"HasMadMixInsts",
|
|
|
|
"true",
|
|
|
|
"Has v_mad_mix_f32, v_mad_mixlo_f16, v_mad_mixhi_f16 instructions"
|
|
|
|
>;
|
|
|
|
|
2018-05-01 03:08:16 +08:00
|
|
|
def FeatureFmaMixInsts : SubtargetFeature<"fma-mix-insts",
|
|
|
|
"HasFmaMixInsts",
|
|
|
|
"true",
|
|
|
|
"Has v_fma_mix_f32, v_fma_mixlo_f16, v_fma_mixhi_f16 instructions"
|
|
|
|
>;
|
|
|
|
|
2016-12-10 03:49:54 +08:00
|
|
|
// XNACK is disabled if SH_MEM_CONFIG.ADDRESS_MODE = GPUVM on chips that support
|
|
|
|
// XNACK. The current default kernel driver setting is:
|
|
|
|
// - graphics ring: XNACK disabled
|
|
|
|
// - compute ring: XNACK enabled
|
|
|
|
//
|
|
|
|
// If XNACK is enabled, the VMEM latency can be worse.
|
|
|
|
// If XNACK is disabled, the 2 SGPRs can be used for general purposes.
|
2016-01-05 07:35:53 +08:00
|
|
|
def FeatureXNACK : SubtargetFeature<"xnack",
|
2016-01-26 12:49:22 +08:00
|
|
|
"EnableXNACK",
|
|
|
|
"true",
|
|
|
|
"Enable XNACK support"
|
|
|
|
>;
|
2015-01-21 03:33:04 +08:00
|
|
|
|
2015-03-09 23:48:09 +08:00
|
|
|
def FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
|
2016-01-26 12:49:22 +08:00
|
|
|
"SGPRInitBug",
|
|
|
|
"true",
|
2017-08-07 02:13:23 +08:00
|
|
|
"VI SGPR initialization bug requiring a fixed SGPR allocation size"
|
2016-01-26 12:49:22 +08:00
|
|
|
>;
|
2016-01-21 12:28:34 +08:00
|
|
|
|
2013-06-08 04:28:55 +08:00
|
|
|
class SubtargetFeatureFetchLimit <string Value> :
|
|
|
|
SubtargetFeature <"fetch"#Value,
|
2016-01-26 12:49:22 +08:00
|
|
|
"TexVTXClauseSize",
|
|
|
|
Value,
|
|
|
|
"Limit the maximum number of fetches in a clause to "#Value
|
|
|
|
>;
|
2013-06-08 04:28:49 +08:00
|
|
|
|
2013-06-08 04:28:55 +08:00
|
|
|
def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
|
|
|
|
def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
|
|
|
|
|
2014-01-23 05:55:40 +08:00
|
|
|
class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
|
2016-01-26 12:49:22 +08:00
|
|
|
"wavefrontsize"#Value,
|
|
|
|
"WavefrontSize",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The number of threads per wavefront"
|
|
|
|
>;
|
2014-01-23 05:55:40 +08:00
|
|
|
|
|
|
|
def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
|
|
|
|
def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
|
|
|
|
def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
|
|
|
|
|
2015-05-26 00:15:54 +08:00
|
|
|
class SubtargetFeatureLDSBankCount <int Value> : SubtargetFeature <
|
2016-01-26 12:49:22 +08:00
|
|
|
"ldsbankcount"#Value,
|
|
|
|
"LDSBankCount",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The number of LDS banks per compute unit."
|
|
|
|
>;
|
2015-05-26 00:15:54 +08:00
|
|
|
|
|
|
|
def FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
|
|
|
|
def FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
|
|
|
|
|
2014-06-18 00:53:14 +08:00
|
|
|
class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
|
2016-01-26 12:49:22 +08:00
|
|
|
"localmemorysize"#Value,
|
|
|
|
"LocalMemorySize",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The size of local memory in bytes"
|
|
|
|
>;
|
2014-06-18 00:53:14 +08:00
|
|
|
|
2015-04-08 09:09:26 +08:00
|
|
|
def FeatureGCN : SubtargetFeature<"gcn",
|
2016-01-26 12:49:22 +08:00
|
|
|
"IsGCN",
|
|
|
|
"true",
|
|
|
|
"GCN or newer GPU"
|
|
|
|
>;
|
2015-04-08 09:09:26 +08:00
|
|
|
|
|
|
|
def FeatureGCN3Encoding : SubtargetFeature<"gcn3-encoding",
|
2016-01-26 12:49:22 +08:00
|
|
|
"GCN3Encoding",
|
|
|
|
"true",
|
|
|
|
"Encoding format for VI"
|
|
|
|
>;
|
2015-04-24 03:33:54 +08:00
|
|
|
|
|
|
|
def FeatureCIInsts : SubtargetFeature<"ci-insts",
|
2016-01-26 12:49:22 +08:00
|
|
|
"CIInsts",
|
|
|
|
"true",
|
2017-10-03 04:31:18 +08:00
|
|
|
"Additional instructions for CI+"
|
2016-01-26 12:49:22 +08:00
|
|
|
>;
|
|
|
|
|
2017-02-19 03:12:26 +08:00
|
|
|
def FeatureGFX9Insts : SubtargetFeature<"gfx9-insts",
|
|
|
|
"GFX9Insts",
|
|
|
|
"true",
|
2017-10-03 04:31:18 +08:00
|
|
|
"Additional instructions for GFX9+"
|
2017-02-19 03:12:26 +08:00
|
|
|
>;
|
|
|
|
|
2016-02-27 16:53:55 +08:00
|
|
|
def FeatureSMemRealTime : SubtargetFeature<"s-memrealtime",
|
|
|
|
"HasSMemRealTime",
|
2016-02-27 16:53:46 +08:00
|
|
|
"true",
|
2016-02-27 16:53:55 +08:00
|
|
|
"Has s_memrealtime instruction"
|
|
|
|
>;
|
|
|
|
|
2016-10-29 12:05:06 +08:00
|
|
|
def FeatureInv2PiInlineImm : SubtargetFeature<"inv-2pi-inline-imm",
|
|
|
|
"HasInv2PiInlineImm",
|
|
|
|
"true",
|
|
|
|
"Has 1 / (2 * pi) as inline immediate"
|
|
|
|
>;
|
|
|
|
|
2016-02-27 16:53:55 +08:00
|
|
|
def Feature16BitInsts : SubtargetFeature<"16-bit-insts",
|
|
|
|
"Has16BitInsts",
|
|
|
|
"true",
|
|
|
|
"Has i16/f16 instructions"
|
2016-02-27 16:53:46 +08:00
|
|
|
>;
|
|
|
|
|
2017-02-28 02:49:11 +08:00
|
|
|
def FeatureVOP3P : SubtargetFeature<"vop3p",
|
|
|
|
"HasVOP3PInsts",
|
|
|
|
"true",
|
|
|
|
"Has VOP3P packed instructions"
|
|
|
|
>;
|
|
|
|
|
2016-10-13 02:00:51 +08:00
|
|
|
def FeatureMovrel : SubtargetFeature<"movrel",
|
|
|
|
"HasMovrel",
|
|
|
|
"true",
|
|
|
|
"Has v_movrel*_b32 instructions"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureVGPRIndexMode : SubtargetFeature<"vgpr-index-mode",
|
|
|
|
"HasVGPRIndexMode",
|
|
|
|
"true",
|
|
|
|
"Has VGPR mode register indexing"
|
|
|
|
>;
|
|
|
|
|
2016-10-29 05:55:15 +08:00
|
|
|
def FeatureScalarStores : SubtargetFeature<"scalar-stores",
|
|
|
|
"HasScalarStores",
|
|
|
|
"true",
|
|
|
|
"Has store scalar memory instructions"
|
|
|
|
>;
|
|
|
|
|
2018-04-03 00:10:25 +08:00
|
|
|
def FeatureScalarAtomics : SubtargetFeature<"scalar-atomics",
|
|
|
|
"HasScalarAtomics",
|
|
|
|
"true",
|
|
|
|
"Has atomic scalar memory instructions"
|
|
|
|
>;
|
|
|
|
|
2017-01-20 18:01:25 +08:00
|
|
|
def FeatureSDWA : SubtargetFeature<"sdwa",
|
|
|
|
"HasSDWA",
|
|
|
|
"true",
|
|
|
|
"Support SDWA (Sub-DWORD Addressing) extension"
|
|
|
|
>;
|
|
|
|
|
2017-06-22 14:26:41 +08:00
|
|
|
def FeatureSDWAOmod : SubtargetFeature<"sdwa-omod",
|
|
|
|
"HasSDWAOmod",
|
|
|
|
"true",
|
|
|
|
"Support OMod with SDWA (Sub-DWORD Addressing) extension"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureSDWAScalar : SubtargetFeature<"sdwa-scalar",
|
|
|
|
"HasSDWAScalar",
|
|
|
|
"true",
|
|
|
|
"Support scalar register with SDWA (Sub-DWORD Addressing) extension"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureSDWASdst : SubtargetFeature<"sdwa-sdst",
|
|
|
|
"HasSDWASdst",
|
|
|
|
"true",
|
|
|
|
"Support scalar dst for VOPC with SDWA (Sub-DWORD Addressing) extension"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureSDWAMac : SubtargetFeature<"sdwa-mav",
|
|
|
|
"HasSDWAMac",
|
|
|
|
"true",
|
|
|
|
"Support v_mac_f32/f16 with SDWA (Sub-DWORD Addressing) extension"
|
|
|
|
>;
|
|
|
|
|
[AMDGPU] SDWA: several fixes for V_CVT and VOPC instructions
Summary:
1. Instruction V_CVT_U32_F32 allow omod operand (see SIInstrInfo.td:1435). In fact this operand shouldn't be allowed here. This fix checks if SDWA pseudo instruction has OMod operand and then copy it.
2. There were several problems with support of VOPC instructions in SDWA peephole pass.
Reviewers: tstellar, arsenm, vpykhtin, airlied, kzhuravl
Subscribers: wdng, nhaehnle, yaxunl, dstuttard, tpr, sarnex, t-tye
Differential Revision: https://reviews.llvm.org/D34626
llvm-svn: 306413
2017-06-27 23:02:23 +08:00
|
|
|
def FeatureSDWAOutModsVOPC : SubtargetFeature<"sdwa-out-mods-vopc",
|
|
|
|
"HasSDWAOutModsVOPC",
|
2017-06-22 14:26:41 +08:00
|
|
|
"true",
|
|
|
|
"Support clamp for VOPC with SDWA (Sub-DWORD Addressing) extension"
|
|
|
|
>;
|
|
|
|
|
2017-01-20 18:01:25 +08:00
|
|
|
def FeatureDPP : SubtargetFeature<"dpp",
|
|
|
|
"HasDPP",
|
|
|
|
"true",
|
|
|
|
"Support DPP (Data Parallel Primitives) extension"
|
|
|
|
>;
|
|
|
|
|
2017-08-16 21:51:56 +08:00
|
|
|
def FeatureIntClamp : SubtargetFeature<"int-clamp-insts",
|
|
|
|
"HasIntClamp",
|
|
|
|
"true",
|
|
|
|
"Support clamp for integer destination"
|
|
|
|
>;
|
|
|
|
|
2018-01-13 05:12:19 +08:00
|
|
|
def FeatureUnpackedD16VMem : SubtargetFeature<"unpacked-d16-vmem",
|
|
|
|
"HasUnpackedD16VMem",
|
|
|
|
"true",
|
|
|
|
"Has unpacked d16 vmem instructions"
|
|
|
|
>;
|
|
|
|
|
2018-05-01 03:08:16 +08:00
|
|
|
def FeatureDLInsts : SubtargetFeature<"dl-insts",
|
|
|
|
"HasDLInsts",
|
|
|
|
"true",
|
|
|
|
"Has deep learning instructions"
|
|
|
|
>;
|
|
|
|
|
2016-01-26 12:49:22 +08:00
|
|
|
//===------------------------------------------------------------===//
|
|
|
|
// Subtarget Features (options and debugging)
|
|
|
|
//===------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Some instructions do not support denormals despite this flag. Using
|
|
|
|
// fp32 denormals also causes instructions to run at the double
|
|
|
|
// precision rate for the device.
|
|
|
|
def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals",
|
|
|
|
"FP32Denormals",
|
|
|
|
"true",
|
|
|
|
"Enable single precision denormal handling"
|
|
|
|
>;
|
|
|
|
|
2017-01-24 06:31:03 +08:00
|
|
|
// Denormal handling for fp64 and fp16 is controlled by the same
|
|
|
|
// config register when fp16 supported.
|
|
|
|
// TODO: Do we need a separate f16 setting when not legal?
|
|
|
|
def FeatureFP64FP16Denormals : SubtargetFeature<"fp64-fp16-denormals",
|
|
|
|
"FP64FP16Denormals",
|
2016-01-26 12:49:22 +08:00
|
|
|
"true",
|
2017-01-24 06:31:03 +08:00
|
|
|
"Enable double and half precision denormal handling",
|
2016-01-26 12:49:22 +08:00
|
|
|
[FeatureFP64]
|
|
|
|
>;
|
|
|
|
|
2017-01-24 06:31:03 +08:00
|
|
|
def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals",
|
|
|
|
"FP64FP16Denormals",
|
|
|
|
"true",
|
|
|
|
"Enable double and half precision denormal handling",
|
|
|
|
[FeatureFP64, FeatureFP64FP16Denormals]
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureFP16Denormals : SubtargetFeature<"fp16-denormals",
|
|
|
|
"FP64FP16Denormals",
|
|
|
|
"true",
|
|
|
|
"Enable half precision denormal handling",
|
|
|
|
[FeatureFP64FP16Denormals]
|
|
|
|
>;
|
|
|
|
|
2017-02-22 07:35:48 +08:00
|
|
|
def FeatureDX10Clamp : SubtargetFeature<"dx10-clamp",
|
|
|
|
"DX10Clamp",
|
|
|
|
"true",
|
|
|
|
"clamp modifier clamps NaNs to 0.0"
|
|
|
|
>;
|
|
|
|
|
2016-01-29 04:53:42 +08:00
|
|
|
def FeatureFPExceptions : SubtargetFeature<"fp-exceptions",
|
|
|
|
"FPExceptions",
|
|
|
|
"true",
|
|
|
|
"Enable floating point exceptions"
|
|
|
|
>;
|
|
|
|
|
2016-02-12 10:40:47 +08:00
|
|
|
class FeatureMaxPrivateElementSize<int size> : SubtargetFeature<
|
|
|
|
"max-private-element-size-"#size,
|
|
|
|
"MaxPrivateElementSize",
|
|
|
|
!cast<string>(size),
|
|
|
|
"Maximum private access size may be "#size
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureMaxPrivateElementSize4 : FeatureMaxPrivateElementSize<4>;
|
|
|
|
def FeatureMaxPrivateElementSize8 : FeatureMaxPrivateElementSize<8>;
|
|
|
|
def FeatureMaxPrivateElementSize16 : FeatureMaxPrivateElementSize<16>;
|
|
|
|
|
2017-11-15 08:45:43 +08:00
|
|
|
def FeatureEnableHugePrivateBuffer : SubtargetFeature<
|
|
|
|
"huge-private-buffer",
|
|
|
|
"EnableHugePrivateBuffer",
|
|
|
|
"true",
|
|
|
|
"Enable private/scratch buffer sizes greater than 128 GB"
|
|
|
|
>;
|
|
|
|
|
2016-01-26 12:49:22 +08:00
|
|
|
def FeatureVGPRSpilling : SubtargetFeature<"vgpr-spilling",
|
|
|
|
"EnableVGPRSpilling",
|
|
|
|
"true",
|
|
|
|
"Enable spilling of VGPRs to scratch memory"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureDumpCode : SubtargetFeature <"DumpCode",
|
|
|
|
"DumpCode",
|
|
|
|
"true",
|
|
|
|
"Dump MachineInstrs in the CodeEmitter"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureDumpCodeLower : SubtargetFeature <"dumpcode",
|
|
|
|
"DumpCode",
|
|
|
|
"true",
|
|
|
|
"Dump MachineInstrs in the CodeEmitter"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
|
|
|
|
"EnablePromoteAlloca",
|
|
|
|
"true",
|
|
|
|
"Enable promote alloca pass"
|
|
|
|
>;
|
|
|
|
|
|
|
|
// XXX - This should probably be removed once enabled by default
|
|
|
|
def FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
|
|
|
|
"EnableLoadStoreOpt",
|
|
|
|
"true",
|
|
|
|
"Enable SI load/store optimizer pass"
|
|
|
|
>;
|
|
|
|
|
|
|
|
// Performance debugging feature. Allow using DS instruction immediate
|
|
|
|
// offsets even if the base pointer can't be proven to be base. On SI,
|
|
|
|
// base pointer values that won't give the same result as a 16-bit add
|
|
|
|
// are not safe to fold, but this will override the conservative test
|
|
|
|
// for the base pointer.
|
|
|
|
def FeatureEnableUnsafeDSOffsetFolding : SubtargetFeature <
|
|
|
|
"unsafe-ds-offset-folding",
|
|
|
|
"EnableUnsafeDSOffsetFolding",
|
|
|
|
"true",
|
|
|
|
"Force using DS instruction immediate offsets on SI"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureEnableSIScheduler : SubtargetFeature<"si-scheduler",
|
|
|
|
"EnableSIScheduler",
|
|
|
|
"true",
|
|
|
|
"Enable SI Machine Scheduler"
|
|
|
|
>;
|
|
|
|
|
2018-04-11 06:48:23 +08:00
|
|
|
def FeatureEnableDS128 : SubtargetFeature<"enable-ds128",
|
|
|
|
"EnableDS128",
|
|
|
|
"true",
|
|
|
|
"Use ds_{read|write}_b128"
|
|
|
|
>;
|
|
|
|
|
2017-01-25 06:02:15 +08:00
|
|
|
// Unless +-flat-for-global is specified, turn on FlatForGlobal for
|
|
|
|
// all OS-es on VI and newer hardware to avoid assertion failures due
|
|
|
|
// to missing ADDR64 variants of MUBUF instructions.
|
|
|
|
// FIXME: moveToVALU should be able to handle converting addr64 MUBUF
|
|
|
|
// instructions.
|
|
|
|
|
2016-01-26 12:49:22 +08:00
|
|
|
def FeatureFlatForGlobal : SubtargetFeature<"flat-for-global",
|
|
|
|
"FlatForGlobal",
|
|
|
|
"true",
|
2017-01-28 01:42:26 +08:00
|
|
|
"Force to generate flat instruction for global"
|
2016-01-26 12:49:22 +08:00
|
|
|
>;
|
2015-04-24 03:33:54 +08:00
|
|
|
|
2017-06-03 01:40:26 +08:00
|
|
|
def FeatureAutoWaitcntBeforeBarrier : SubtargetFeature <
|
|
|
|
"auto-waitcnt-before-barrier",
|
|
|
|
"AutoWaitcntBeforeBarrier",
|
|
|
|
"true",
|
|
|
|
"Hardware automatically inserts waitcnt before barrier"
|
|
|
|
>;
|
|
|
|
|
2017-10-14 23:59:07 +08:00
|
|
|
def FeatureCodeObjectV3 : SubtargetFeature <
|
|
|
|
"code-object-v3",
|
|
|
|
"CodeObjectV3",
|
|
|
|
"true",
|
|
|
|
"Generate code object version 3"
|
|
|
|
>;
|
|
|
|
|
2015-04-24 03:33:54 +08:00
|
|
|
// Dummy feature used to disable assembler instructions.
|
|
|
|
def FeatureDisable : SubtargetFeature<"",
|
2016-01-26 12:49:22 +08:00
|
|
|
"FeatureDisable","true",
|
|
|
|
"Dummy feature to disable assembler instructions"
|
|
|
|
>;
|
2015-04-24 03:33:54 +08:00
|
|
|
|
2013-06-08 04:37:48 +08:00
|
|
|
class SubtargetFeatureGeneration <string Value,
|
|
|
|
list<SubtargetFeature> Implies> :
|
|
|
|
SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
|
|
|
|
Value#" GPU generation", Implies>;
|
|
|
|
|
2014-06-18 00:53:14 +08:00
|
|
|
def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
|
|
|
|
def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
|
|
|
|
def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
|
|
|
|
|
2013-06-08 04:37:48 +08:00
|
|
|
def FeatureR600 : SubtargetFeatureGeneration<"R600",
|
2016-01-26 12:49:22 +08:00
|
|
|
[FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]
|
|
|
|
>;
|
2013-06-08 04:37:48 +08:00
|
|
|
|
|
|
|
def FeatureR700 : SubtargetFeatureGeneration<"R700",
|
2016-01-26 12:49:22 +08:00
|
|
|
[FeatureFetchLimit16, FeatureLocalMemorySize0]
|
|
|
|
>;
|
2013-06-08 04:37:48 +08:00
|
|
|
|
|
|
|
def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
|
2016-01-26 12:49:22 +08:00
|
|
|
[FeatureFetchLimit16, FeatureLocalMemorySize32768]
|
|
|
|
>;
|
2013-06-08 04:37:48 +08:00
|
|
|
|
|
|
|
def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
|
2016-01-26 12:49:22 +08:00
|
|
|
[FeatureFetchLimit16, FeatureWavefrontSize64,
|
|
|
|
FeatureLocalMemorySize32768]
|
2014-06-18 00:53:14 +08:00
|
|
|
>;
|
2013-06-08 04:37:48 +08:00
|
|
|
|
|
|
|
def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
|
2018-02-05 20:45:43 +08:00
|
|
|
[FeatureFP64, FeatureLocalMemorySize32768, FeatureMIMG_R128,
|
2017-08-07 22:58:04 +08:00
|
|
|
FeatureWavefrontSize64, FeatureGCN,
|
2016-10-13 02:00:51 +08:00
|
|
|
FeatureLDSBankCount32, FeatureMovrel]
|
2016-01-26 12:49:22 +08:00
|
|
|
>;
|
2013-06-08 04:37:48 +08:00
|
|
|
|
2013-10-30 00:37:28 +08:00
|
|
|
def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
|
2018-02-05 20:45:43 +08:00
|
|
|
[FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
|
2016-01-26 12:49:22 +08:00
|
|
|
FeatureWavefrontSize64, FeatureGCN, FeatureFlatAddressSpace,
|
2017-08-07 22:58:04 +08:00
|
|
|
FeatureCIInsts, FeatureMovrel]
|
2016-01-26 12:49:22 +08:00
|
|
|
>;
|
2014-12-07 20:18:57 +08:00
|
|
|
|
|
|
|
def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
|
2018-02-05 20:45:43 +08:00
|
|
|
[FeatureFP64, FeatureLocalMemorySize65536, FeatureMIMG_R128,
|
2016-01-26 12:49:22 +08:00
|
|
|
FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
|
2016-02-27 16:53:55 +08:00
|
|
|
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
|
2016-10-29 05:55:15 +08:00
|
|
|
FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel,
|
2017-06-22 14:26:41 +08:00
|
|
|
FeatureScalarStores, FeatureInv2PiInlineImm,
|
2017-08-16 21:51:56 +08:00
|
|
|
FeatureSDWA, FeatureSDWAOutModsVOPC, FeatureSDWAMac, FeatureDPP,
|
|
|
|
FeatureIntClamp
|
2016-02-27 16:53:55 +08:00
|
|
|
]
|
2016-01-26 12:49:22 +08:00
|
|
|
>;
|
2014-12-07 20:18:57 +08:00
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
def FeatureGFX9 : SubtargetFeatureGeneration<"GFX9",
|
|
|
|
[FeatureFP64, FeatureLocalMemorySize65536,
|
|
|
|
FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
|
|
|
|
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
|
|
|
|
FeatureSMemRealTime, FeatureScalarStores, FeatureInv2PiInlineImm,
|
2017-04-22 03:57:53 +08:00
|
|
|
FeatureApertureRegs, FeatureGFX9Insts, FeatureVOP3P, FeatureVGPRIndexMode,
|
2017-08-16 21:51:56 +08:00
|
|
|
FeatureFastFMAF32, FeatureDPP, FeatureIntClamp,
|
2017-06-22 14:26:41 +08:00
|
|
|
FeatureSDWA, FeatureSDWAOmod, FeatureSDWAScalar, FeatureSDWASdst,
|
2017-07-21 01:42:47 +08:00
|
|
|
FeatureFlatInstOffsets, FeatureFlatGlobalInsts, FeatureFlatScratchInsts,
|
2018-04-03 00:10:25 +08:00
|
|
|
FeatureAddNoCarryInsts, FeatureScalarAtomics
|
2017-02-19 02:29:53 +08:00
|
|
|
]
|
|
|
|
>;
|
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
class SubtargetFeatureISAVersion <int Major, int Minor, int Stepping,
|
|
|
|
list<SubtargetFeature> Implies>
|
|
|
|
: SubtargetFeature <
|
|
|
|
"isaver"#Major#"."#Minor#"."#Stepping,
|
|
|
|
"IsaVersion",
|
|
|
|
"ISAVersion"#Major#"_"#Minor#"_"#Stepping,
|
|
|
|
"Instruction set version number",
|
|
|
|
Implies
|
|
|
|
>;
|
|
|
|
|
2017-06-10 11:53:19 +08:00
|
|
|
def FeatureISAVersion6_0_0 : SubtargetFeatureISAVersion <6,0,0,
|
|
|
|
[FeatureSouthernIslands,
|
2017-06-26 11:01:36 +08:00
|
|
|
FeatureFastFMAF32,
|
2017-06-10 11:53:19 +08:00
|
|
|
HalfRate64Ops,
|
|
|
|
FeatureLDSBankCount32]>;
|
|
|
|
|
|
|
|
def FeatureISAVersion6_0_1 : SubtargetFeatureISAVersion <6,0,1,
|
|
|
|
[FeatureSouthernIslands,
|
|
|
|
FeatureLDSBankCount32]>;
|
2017-06-26 11:01:36 +08:00
|
|
|
|
2016-11-01 08:55:14 +08:00
|
|
|
def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0,
|
2016-10-27 00:37:56 +08:00
|
|
|
[FeatureSeaIslands,
|
|
|
|
FeatureLDSBankCount32]>;
|
2016-11-01 08:55:14 +08:00
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1,
|
|
|
|
[FeatureSeaIslands,
|
|
|
|
HalfRate64Ops,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureFastFMAF32]>;
|
2016-11-01 08:55:14 +08:00
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
def FeatureISAVersion7_0_2 : SubtargetFeatureISAVersion <7,0,2,
|
|
|
|
[FeatureSeaIslands,
|
2018-02-28 05:46:15 +08:00
|
|
|
FeatureLDSBankCount16,
|
|
|
|
FeatureFastFMAF32]>;
|
2016-11-01 08:55:14 +08:00
|
|
|
|
2017-06-10 11:53:19 +08:00
|
|
|
def FeatureISAVersion7_0_3 : SubtargetFeatureISAVersion <7,0,3,
|
|
|
|
[FeatureSeaIslands,
|
|
|
|
FeatureLDSBankCount16]>;
|
|
|
|
|
2017-12-09 04:52:28 +08:00
|
|
|
def FeatureISAVersion7_0_4 : SubtargetFeatureISAVersion <7,0,4,
|
|
|
|
[FeatureSeaIslands,
|
|
|
|
FeatureLDSBankCount32]>;
|
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1,
|
|
|
|
[FeatureVolcanicIslands,
|
2017-08-25 04:03:07 +08:00
|
|
|
FeatureFastFMAF32,
|
|
|
|
HalfRate64Ops,
|
2016-10-27 00:37:56 +08:00
|
|
|
FeatureLDSBankCount32,
|
2018-01-13 05:12:19 +08:00
|
|
|
FeatureXNACK,
|
|
|
|
FeatureUnpackedD16VMem]>;
|
2016-11-01 08:55:14 +08:00
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount32,
|
2018-01-13 05:12:19 +08:00
|
|
|
FeatureSGPRInitBug,
|
|
|
|
FeatureUnpackedD16VMem]>;
|
2016-11-01 08:55:14 +08:00
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3,
|
|
|
|
[FeatureVolcanicIslands,
|
2018-01-13 05:12:19 +08:00
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureUnpackedD16VMem]>;
|
2016-11-01 08:55:14 +08:00
|
|
|
|
2016-10-27 00:37:56 +08:00
|
|
|
def FeatureISAVersion8_1_0 : SubtargetFeatureISAVersion <8,1,0,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount16,
|
|
|
|
FeatureXNACK]>;
|
|
|
|
|
2017-06-10 11:53:19 +08:00
|
|
|
def FeatureISAVersion9_0_0 : SubtargetFeatureISAVersion <9,0,0,
|
|
|
|
[FeatureGFX9,
|
2017-10-25 15:00:51 +08:00
|
|
|
FeatureMadMixInsts,
|
|
|
|
FeatureLDSBankCount32
|
|
|
|
]>;
|
2017-06-10 11:53:19 +08:00
|
|
|
|
|
|
|
def FeatureISAVersion9_0_2 : SubtargetFeatureISAVersion <9,0,2,
|
|
|
|
[FeatureGFX9,
|
2017-10-25 15:00:51 +08:00
|
|
|
FeatureMadMixInsts,
|
2018-02-17 05:26:25 +08:00
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureXNACK
|
2017-10-25 15:00:51 +08:00
|
|
|
]>;
|
2017-06-10 11:53:19 +08:00
|
|
|
|
2018-05-01 03:08:16 +08:00
|
|
|
def FeatureISAVersion9_0_4 : SubtargetFeatureISAVersion <9,0,4,
|
|
|
|
[FeatureGFX9,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureFmaMixInsts]>;
|
|
|
|
|
|
|
|
def FeatureISAVersion9_0_6 : SubtargetFeatureISAVersion <9,0,6,
|
|
|
|
[FeatureGFX9,
|
|
|
|
HalfRate64Ops,
|
|
|
|
FeatureFmaMixInsts,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureDLInsts]>;
|
|
|
|
|
2016-04-19 00:28:23 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Debugger related subtarget features.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def FeatureDebuggerInsertNops : SubtargetFeature<
|
|
|
|
"amdgpu-debugger-insert-nops",
|
|
|
|
"DebuggerInsertNops",
|
|
|
|
"true",
|
2016-05-14 02:21:28 +08:00
|
|
|
"Insert one nop instruction for each high level source statement"
|
2016-04-19 00:28:23 +08:00
|
|
|
>;
|
|
|
|
|
2016-05-25 02:37:18 +08:00
|
|
|
def FeatureDebuggerReserveRegs : SubtargetFeature<
|
|
|
|
"amdgpu-debugger-reserve-regs",
|
|
|
|
"DebuggerReserveRegs",
|
2016-04-26 23:43:14 +08:00
|
|
|
"true",
|
2016-05-25 02:37:18 +08:00
|
|
|
"Reserve registers for debugger usage"
|
2016-04-26 23:43:14 +08:00
|
|
|
>;
|
|
|
|
|
2016-06-25 11:11:28 +08:00
|
|
|
def FeatureDebuggerEmitPrologue : SubtargetFeature<
|
|
|
|
"amdgpu-debugger-emit-prologue",
|
|
|
|
"DebuggerEmitPrologue",
|
|
|
|
"true",
|
|
|
|
"Emit debugger prologue"
|
|
|
|
>;
|
|
|
|
|
2013-06-08 04:28:55 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
def AMDGPUInstrInfo : InstrInfo {
|
|
|
|
let guessInstructionProperties = 1;
|
2015-02-18 10:15:32 +08:00
|
|
|
let noNamedPositionallyEncodedOperands = 1;
|
2012-12-12 05:25:42 +08:00
|
|
|
}
|
|
|
|
|
2014-11-14 22:08:00 +08:00
|
|
|
def AMDGPUAsmParser : AsmParser {
|
|
|
|
// Some of the R600 registers have the same name, so this crashes.
|
|
|
|
// For example T0_XYZW and T0_XY both have the asm name T0.
|
|
|
|
let ShouldEmitMatchRegisterName = 0;
|
|
|
|
}
|
|
|
|
|
2016-09-27 22:42:48 +08:00
|
|
|
def AMDGPUAsmWriter : AsmWriter {
|
|
|
|
int PassSubtarget = 1;
|
|
|
|
}
|
|
|
|
|
2016-09-09 17:37:51 +08:00
|
|
|
def AMDGPUAsmVariants {
|
|
|
|
string Default = "Default";
|
|
|
|
int Default_ID = 0;
|
|
|
|
string VOP3 = "VOP3";
|
|
|
|
int VOP3_ID = 1;
|
|
|
|
string SDWA = "SDWA";
|
|
|
|
int SDWA_ID = 2;
|
2017-05-23 18:08:55 +08:00
|
|
|
string SDWA9 = "SDWA9";
|
|
|
|
int SDWA9_ID = 3;
|
2016-09-09 17:37:51 +08:00
|
|
|
string DPP = "DPP";
|
2017-05-23 18:08:55 +08:00
|
|
|
int DPP_ID = 4;
|
2016-09-12 22:42:43 +08:00
|
|
|
string Disable = "Disable";
|
2017-05-23 18:08:55 +08:00
|
|
|
int Disable_ID = 5;
|
2016-09-09 17:37:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def DefaultAMDGPUAsmParserVariant : AsmParserVariant {
|
|
|
|
let Variant = AMDGPUAsmVariants.Default_ID;
|
|
|
|
let Name = AMDGPUAsmVariants.Default;
|
|
|
|
}
|
|
|
|
|
|
|
|
def VOP3AsmParserVariant : AsmParserVariant {
|
|
|
|
let Variant = AMDGPUAsmVariants.VOP3_ID;
|
|
|
|
let Name = AMDGPUAsmVariants.VOP3;
|
|
|
|
}
|
|
|
|
|
|
|
|
def SDWAAsmParserVariant : AsmParserVariant {
|
|
|
|
let Variant = AMDGPUAsmVariants.SDWA_ID;
|
|
|
|
let Name = AMDGPUAsmVariants.SDWA;
|
|
|
|
}
|
|
|
|
|
2017-05-23 18:08:55 +08:00
|
|
|
def SDWA9AsmParserVariant : AsmParserVariant {
|
|
|
|
let Variant = AMDGPUAsmVariants.SDWA9_ID;
|
|
|
|
let Name = AMDGPUAsmVariants.SDWA9;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-09 17:37:51 +08:00
|
|
|
def DPPAsmParserVariant : AsmParserVariant {
|
|
|
|
let Variant = AMDGPUAsmVariants.DPP_ID;
|
|
|
|
let Name = AMDGPUAsmVariants.DPP;
|
|
|
|
}
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
def AMDGPU : Target {
|
|
|
|
// Pull in Instruction Info:
|
|
|
|
let InstructionSet = AMDGPUInstrInfo;
|
2014-11-14 22:08:00 +08:00
|
|
|
let AssemblyParsers = [AMDGPUAsmParser];
|
2016-09-09 17:37:51 +08:00
|
|
|
let AssemblyParserVariants = [DefaultAMDGPUAsmParserVariant,
|
|
|
|
VOP3AsmParserVariant,
|
|
|
|
SDWAAsmParserVariant,
|
2017-05-23 18:08:55 +08:00
|
|
|
SDWA9AsmParserVariant,
|
2016-09-09 17:37:51 +08:00
|
|
|
DPPAsmParserVariant];
|
2016-09-27 22:42:48 +08:00
|
|
|
let AssemblyWriters = [AMDGPUAsmWriter];
|
[MachineOperand][Target] MachineOperand::isRenamable semantics changes
Summary:
Add a target option AllowRegisterRenaming that is used to opt in to
post-register-allocation renaming of registers. This is set to 0 by
default, which causes the hasExtraSrcRegAllocReq/hasExtraDstRegAllocReq
fields of all opcodes to be set to 1, causing
MachineOperand::isRenamable to always return false.
Set the AllowRegisterRenaming flag to 1 for all in-tree targets that
have lit tests that were effected by enabling COPY forwarding in
MachineCopyPropagation (AArch64, AMDGPU, ARM, Hexagon, Mips, PowerPC,
RISCV, Sparc, SystemZ and X86).
Add some more comments describing the semantics of the
MachineOperand::isRenamable function and how it is set and maintained.
Change isRenamable to check the operand's opcode
hasExtraSrcRegAllocReq/hasExtraDstRegAllocReq bit directly instead of
relying on it being consistently reflected in the IsRenamable bit
setting.
Clear the IsRenamable bit when changing an operand's register value.
Remove target code that was clearing the IsRenamable bit when changing
registers/opcodes now that this is done conservatively by default.
Change setting of hasExtraSrcRegAllocReq in AMDGPU target to be done in
one place covering all opcodes that have constant pipe read limit
restrictions.
Reviewers: qcolombet, MatzeB
Subscribers: aemerson, arsenm, jyknight, mcrosier, sdardis, nhaehnle, javed.absar, tpr, arichardson, kristof.beyls, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, niosHD, escha, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D43042
llvm-svn: 325931
2018-02-24 02:25:08 +08:00
|
|
|
let AllowRegisterRenaming = 1;
|
2012-12-12 05:25:42 +08:00
|
|
|
}
|
|
|
|
|
2014-06-14 00:38:59 +08:00
|
|
|
// Dummy Instruction itineraries for pseudo instructions
|
|
|
|
def ALU_NULL : FuncUnit;
|
|
|
|
def NullALU : InstrItinClass;
|
|
|
|
|
2014-05-17 04:56:45 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Predicate helper class
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-04-24 03:33:54 +08:00
|
|
|
def TruePredicate : Predicate<"true">;
|
2016-01-26 12:49:22 +08:00
|
|
|
|
2015-04-24 03:33:54 +08:00
|
|
|
def isSICI : Predicate<
|
|
|
|
"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
|
|
|
|
"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS"
|
2017-08-07 22:58:04 +08:00
|
|
|
>, AssemblerPredicate<"!FeatureGCN3Encoding">;
|
2015-04-24 03:33:54 +08:00
|
|
|
|
2015-12-24 11:18:18 +08:00
|
|
|
def isVI : Predicate <
|
|
|
|
"Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">,
|
|
|
|
AssemblerPredicate<"FeatureGCN3Encoding">;
|
|
|
|
|
2017-02-19 03:12:26 +08:00
|
|
|
def isGFX9 : Predicate <
|
|
|
|
"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
|
|
|
|
AssemblerPredicate<"FeatureGFX9Insts">;
|
|
|
|
|
2017-02-19 02:29:53 +08:00
|
|
|
// TODO: Either the name to be changed or we simply use IsCI!
|
2016-01-26 12:49:22 +08:00
|
|
|
def isCIVI : Predicate <
|
2017-02-19 02:29:53 +08:00
|
|
|
"Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">,
|
|
|
|
AssemblerPredicate<"FeatureCIInsts">;
|
2016-01-26 12:49:22 +08:00
|
|
|
|
2017-06-21 03:54:14 +08:00
|
|
|
def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">,
|
|
|
|
AssemblerPredicate<"FeatureFlatAddressSpace">;
|
|
|
|
|
|
|
|
def HasFlatGlobalInsts : Predicate<"Subtarget->hasFlatGlobalInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureFlatGlobalInsts">;
|
2017-07-21 23:36:16 +08:00
|
|
|
def HasFlatScratchInsts : Predicate<"Subtarget->hasFlatScratchInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureFlatScratchInsts">;
|
2017-09-02 02:36:06 +08:00
|
|
|
def HasD16LoadStore : Predicate<"Subtarget->hasD16LoadStore()">,
|
|
|
|
AssemblerPredicate<"FeatureGFX9Insts">;
|
2016-01-26 12:49:22 +08:00
|
|
|
|
2018-01-13 05:12:19 +08:00
|
|
|
def HasUnpackedD16VMem : Predicate<"Subtarget->hasUnpackedD16VMem()">,
|
|
|
|
AssemblerPredicate<"FeatureUnpackedD16VMem">;
|
|
|
|
def HasPackedD16VMem : Predicate<"!Subtarget->hasUnpackedD16VMem()">,
|
|
|
|
AssemblerPredicate<"!FeatureUnpackedD16VMem">;
|
|
|
|
|
2017-11-29 08:55:57 +08:00
|
|
|
|
|
|
|
def LDSRequiresM0Init : Predicate<"Subtarget->ldsRequiresM0Init()">;
|
|
|
|
def NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
|
|
|
|
|
2017-09-02 02:38:02 +08:00
|
|
|
def HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
|
|
|
|
AssemblerPredicate<"FeatureGFX9Insts">;
|
|
|
|
|
2017-07-21 01:42:47 +08:00
|
|
|
def HasAddNoCarryInsts : Predicate<"Subtarget->hasAddNoCarryInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureAddNoCarryInsts">;
|
|
|
|
|
|
|
|
def NotHasAddNoCarryInsts : Predicate<"!Subtarget->hasAddNoCarryInsts()">,
|
|
|
|
AssemblerPredicate<"!FeatureAddNoCarryInsts">;
|
|
|
|
|
2017-02-28 02:49:11 +08:00
|
|
|
def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
|
|
|
|
AssemblerPredicate<"Feature16BitInsts">;
|
|
|
|
def HasVOP3PInsts : Predicate<"Subtarget->hasVOP3PInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureVOP3P">;
|
2016-11-11 00:02:37 +08:00
|
|
|
|
2017-01-20 18:01:25 +08:00
|
|
|
def HasSDWA : Predicate<"Subtarget->hasSDWA()">,
|
2017-05-23 18:08:55 +08:00
|
|
|
AssemblerPredicate<"FeatureSDWA,FeatureVolcanicIslands">;
|
|
|
|
|
|
|
|
def HasSDWA9 : Predicate<"Subtarget->hasSDWA()">,
|
|
|
|
AssemblerPredicate<"FeatureSDWA,FeatureGFX9">;
|
2017-01-20 18:01:25 +08:00
|
|
|
|
|
|
|
def HasDPP : Predicate<"Subtarget->hasDPP()">,
|
|
|
|
AssemblerPredicate<"FeatureDPP">;
|
|
|
|
|
2017-08-16 21:51:56 +08:00
|
|
|
def HasIntClamp : Predicate<"Subtarget->hasIntClamp()">,
|
|
|
|
AssemblerPredicate<"FeatureIntClamp">;
|
|
|
|
|
2017-10-25 15:00:51 +08:00
|
|
|
def HasMadMixInsts : Predicate<"Subtarget->hasMadMixInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureMadMixInsts">;
|
2017-09-08 02:05:07 +08:00
|
|
|
|
2018-04-03 00:10:25 +08:00
|
|
|
def HasScalarAtomics : Predicate<"Subtarget->hasScalarAtomics()">,
|
|
|
|
AssemblerPredicate<"FeatureScalarAtomics">;
|
|
|
|
|
2018-04-27 03:21:26 +08:00
|
|
|
def has16BankLDS : Predicate<"Subtarget->getLDSBankCount() == 16">;
|
|
|
|
def has32BankLDS : Predicate<"Subtarget->getLDSBankCount() == 32">;
|
|
|
|
def HasVGPRIndexMode : Predicate<"Subtarget->hasVGPRIndexMode()">,
|
|
|
|
AssemblerPredicate<"FeatureVGPRIndexMode">;
|
|
|
|
def HasMovrel : Predicate<"Subtarget->hasMovrel()">,
|
|
|
|
AssemblerPredicate<"FeatureMovrel">;
|
|
|
|
|
2018-05-01 03:08:16 +08:00
|
|
|
def HasFmaMixInsts : Predicate<"Subtarget->hasFmaMixInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureFmaMixInsts">;
|
|
|
|
|
|
|
|
def HasDLInsts : Predicate<"Subtarget->hasDLInsts()">,
|
|
|
|
AssemblerPredicate<"FeatureDLInsts">;
|
|
|
|
|
|
|
|
|
2017-10-11 04:22:07 +08:00
|
|
|
def EnableLateCFGStructurize : Predicate<
|
|
|
|
"EnableLateStructurizeCFG">;
|
2017-10-03 08:06:41 +08:00
|
|
|
|
|
|
|
// Exists to help track down where SubtargetPredicate isn't set rather
|
|
|
|
// than letting tablegen crash with an unhelpful error.
|
|
|
|
def InvalidPred : Predicate<"predicate not set on instruction or pattern">;
|
|
|
|
|
2014-05-17 04:56:45 +08:00
|
|
|
class PredicateControl {
|
2017-10-03 08:06:41 +08:00
|
|
|
Predicate SubtargetPredicate = InvalidPred;
|
2015-04-24 03:33:54 +08:00
|
|
|
Predicate SIAssemblerPredicate = isSICI;
|
2015-12-24 11:18:18 +08:00
|
|
|
Predicate VIAssemblerPredicate = isVI;
|
2015-04-08 09:09:26 +08:00
|
|
|
list<Predicate> AssemblerPredicates = [];
|
2015-04-24 03:33:54 +08:00
|
|
|
Predicate AssemblerPredicate = TruePredicate;
|
2014-05-17 04:56:45 +08:00
|
|
|
list<Predicate> OtherPredicates = [];
|
2017-10-03 08:06:41 +08:00
|
|
|
list<Predicate> Predicates = !listconcat([SubtargetPredicate,
|
|
|
|
AssemblerPredicate],
|
2015-04-08 09:09:26 +08:00
|
|
|
AssemblerPredicates,
|
2014-05-17 04:56:45 +08:00
|
|
|
OtherPredicates);
|
|
|
|
}
|
|
|
|
|
2017-10-03 08:06:41 +08:00
|
|
|
class AMDGPUPat<dag pattern, dag result> : Pat<pattern, result>,
|
|
|
|
PredicateControl;
|
|
|
|
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
// Include AMDGPU TD files
|
|
|
|
include "R600Schedule.td"
|
2017-11-11 04:01:58 +08:00
|
|
|
include "R600Processors.td"
|
2012-12-12 05:25:42 +08:00
|
|
|
include "SISchedule.td"
|
2017-11-11 04:01:58 +08:00
|
|
|
include "GCNProcessors.td"
|
2012-12-12 05:25:42 +08:00
|
|
|
include "AMDGPUInstrInfo.td"
|
|
|
|
include "AMDGPUIntrinsics.td"
|
|
|
|
include "AMDGPURegisterInfo.td"
|
Re-commit AMDGPU/GlobalISel: Add support for simple shaders
Fix build when global-isel is disabled and fix a warning.
Summary: We can select constant/global G_LOAD, global G_STORE, and G_GEP.
Reviewers: qcolombet, MatzeB, t.p.northover, ab, arsenm
Subscribers: mehdi_amini, vkalintiris, kzhuravl, wdng, nhaehnle, mgorny, yaxunl, tony-tye, modocache, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D26730
llvm-svn: 293551
2017-01-31 05:56:46 +08:00
|
|
|
include "AMDGPURegisterBanks.td"
|
2012-12-12 05:25:42 +08:00
|
|
|
include "AMDGPUInstructions.td"
|
2013-03-07 17:03:52 +08:00
|
|
|
include "AMDGPUCallingConv.td"
|
AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics
Summary:
Avoids having to list all intrinsics manually.
This is in preparation for the new dimension-aware image intrinsics,
which I'd rather not have to list here by hand.
Change-Id: If7ced04998397ef68c4cb8f7de66b5050fb767e5
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44937
llvm-svn: 328938
2018-04-02 01:09:07 +08:00
|
|
|
include "AMDGPUSearchableTables.td"
|