2016-01-26 05:49:22 +01:00
|
|
|
//===-- AMDGPU.td - AMDGPU Tablegen files --------*- tablegen -*-===//
|
2012-12-11 22:25:42 +01: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 05:49:22 +01:00
|
|
|
//===------------------------------------------------------------===//
|
2012-12-11 22:25:42 +01:00
|
|
|
|
2014-06-13 18:38:59 +02:00
|
|
|
include "llvm/Target/Target.td"
|
2012-12-11 22:25:42 +01:00
|
|
|
|
2016-01-26 05:49:22 +01:00
|
|
|
//===------------------------------------------------------------===//
|
|
|
|
// Subtarget Features (device properties)
|
|
|
|
//===------------------------------------------------------------===//
|
2013-11-18 20:43:33 +01:00
|
|
|
|
2014-06-20 08:50:05 +02:00
|
|
|
def FeatureFP64 : SubtargetFeature<"fp64",
|
2016-01-26 05:49:22 +01:00
|
|
|
"FP64",
|
|
|
|
"true",
|
|
|
|
"Enable double precision operations"
|
|
|
|
>;
|
2014-07-15 01:40:49 +02:00
|
|
|
|
2015-01-29 20:34:25 +01:00
|
|
|
def FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
|
2016-01-26 05:49:22 +01:00
|
|
|
"FastFMAF32",
|
|
|
|
"true",
|
|
|
|
"Assuming f32 fma is at least as fast as mul + add"
|
|
|
|
>;
|
2015-01-29 20:34:25 +01:00
|
|
|
|
2016-01-18 22:13:50 +01:00
|
|
|
def HalfRate64Ops : SubtargetFeature<"half-rate-64-ops",
|
2016-01-26 05:49:22 +01:00
|
|
|
"HalfRate64Ops",
|
|
|
|
"true",
|
|
|
|
"Most fp64 instructions are half rate instead of quarter"
|
|
|
|
>;
|
2014-07-15 01:40:49 +02:00
|
|
|
|
2013-06-07 22:28:49 +02:00
|
|
|
def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
|
2016-01-26 05:49:22 +01:00
|
|
|
"R600ALUInst",
|
|
|
|
"false",
|
|
|
|
"Older version of ALU instructions encoding"
|
|
|
|
>;
|
2013-06-07 22:28:49 +02:00
|
|
|
|
|
|
|
def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
|
2016-01-26 05:49:22 +01:00
|
|
|
"HasVertexCache",
|
|
|
|
"true",
|
|
|
|
"Specify use of dedicated vertex cache"
|
|
|
|
>;
|
2013-06-07 22:28:49 +02:00
|
|
|
|
2013-06-07 22:37:48 +02:00
|
|
|
def FeatureCaymanISA : SubtargetFeature<"caymanISA",
|
2016-01-26 05:49:22 +01:00
|
|
|
"CaymanISA",
|
|
|
|
"true",
|
|
|
|
"Use Cayman ISA"
|
|
|
|
>;
|
2013-06-07 22:37:48 +02:00
|
|
|
|
2014-01-23 17:18:02 +01:00
|
|
|
def FeatureCFALUBug : SubtargetFeature<"cfalubug",
|
2016-01-26 05:49:22 +01:00
|
|
|
"CFALUBug",
|
|
|
|
"true",
|
|
|
|
"GPU has CF_ALU bug"
|
|
|
|
>;
|
2015-12-22 21:55:23 +01:00
|
|
|
|
2014-09-15 17:41:53 +02:00
|
|
|
def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
|
2016-01-26 05:49:22 +01:00
|
|
|
"FlatAddressSpace",
|
|
|
|
"true",
|
|
|
|
"Support flat address space"
|
|
|
|
>;
|
2014-09-15 17:41:53 +02:00
|
|
|
|
2016-07-02 01:03:44 +02:00
|
|
|
def FeatureUnalignedBufferAccess : SubtargetFeature<"unaligned-buffer-access",
|
|
|
|
"UnalignedBufferAccess",
|
|
|
|
"true",
|
|
|
|
"Support unaligned global loads and stores"
|
|
|
|
>;
|
|
|
|
|
2016-10-14 20:10:39 +02:00
|
|
|
def FeatureUnalignedScratchAccess : SubtargetFeature<"unaligned-scratch-access",
|
|
|
|
"UnalignedScratchAccess",
|
|
|
|
"true",
|
|
|
|
"Support unaligned scratch loads and stores"
|
|
|
|
>;
|
|
|
|
|
2016-01-05 00:35:53 +01:00
|
|
|
def FeatureXNACK : SubtargetFeature<"xnack",
|
2016-01-26 05:49:22 +01:00
|
|
|
"EnableXNACK",
|
|
|
|
"true",
|
|
|
|
"Enable XNACK support"
|
|
|
|
>;
|
2015-01-20 20:33:04 +01:00
|
|
|
|
2015-03-09 16:48:09 +01:00
|
|
|
def FeatureSGPRInitBug : SubtargetFeature<"sgpr-init-bug",
|
2016-01-26 05:49:22 +01:00
|
|
|
"SGPRInitBug",
|
|
|
|
"true",
|
|
|
|
"VI SGPR initilization bug requiring a fixed SGPR allocation size"
|
|
|
|
>;
|
2016-01-21 05:28:34 +01:00
|
|
|
|
2013-06-07 22:28:55 +02:00
|
|
|
class SubtargetFeatureFetchLimit <string Value> :
|
|
|
|
SubtargetFeature <"fetch"#Value,
|
2016-01-26 05:49:22 +01:00
|
|
|
"TexVTXClauseSize",
|
|
|
|
Value,
|
|
|
|
"Limit the maximum number of fetches in a clause to "#Value
|
|
|
|
>;
|
2013-06-07 22:28:49 +02:00
|
|
|
|
2013-06-07 22:28:55 +02:00
|
|
|
def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
|
|
|
|
def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
|
|
|
|
|
2014-01-22 22:55:40 +01:00
|
|
|
class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
|
2016-01-26 05:49:22 +01:00
|
|
|
"wavefrontsize"#Value,
|
|
|
|
"WavefrontSize",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The number of threads per wavefront"
|
|
|
|
>;
|
2014-01-22 22:55:40 +01:00
|
|
|
|
|
|
|
def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
|
|
|
|
def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
|
|
|
|
def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
|
|
|
|
|
2015-05-25 18:15:54 +02:00
|
|
|
class SubtargetFeatureLDSBankCount <int Value> : SubtargetFeature <
|
2016-01-26 05:49:22 +01:00
|
|
|
"ldsbankcount"#Value,
|
|
|
|
"LDSBankCount",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The number of LDS banks per compute unit."
|
|
|
|
>;
|
2015-05-25 18:15:54 +02:00
|
|
|
|
|
|
|
def FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>;
|
|
|
|
def FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>;
|
|
|
|
|
2014-06-17 18:53:14 +02:00
|
|
|
class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
|
2016-01-26 05:49:22 +01:00
|
|
|
"localmemorysize"#Value,
|
|
|
|
"LocalMemorySize",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The size of local memory in bytes"
|
|
|
|
>;
|
2014-06-17 18:53:14 +02:00
|
|
|
|
2015-04-08 03:09:26 +02:00
|
|
|
def FeatureGCN : SubtargetFeature<"gcn",
|
2016-01-26 05:49:22 +01:00
|
|
|
"IsGCN",
|
|
|
|
"true",
|
|
|
|
"GCN or newer GPU"
|
|
|
|
>;
|
2015-04-08 03:09:26 +02:00
|
|
|
|
|
|
|
def FeatureGCN1Encoding : SubtargetFeature<"gcn1-encoding",
|
2016-01-26 05:49:22 +01:00
|
|
|
"GCN1Encoding",
|
|
|
|
"true",
|
|
|
|
"Encoding format for SI and CI"
|
|
|
|
>;
|
2015-04-08 03:09:26 +02:00
|
|
|
|
|
|
|
def FeatureGCN3Encoding : SubtargetFeature<"gcn3-encoding",
|
2016-01-26 05:49:22 +01:00
|
|
|
"GCN3Encoding",
|
|
|
|
"true",
|
|
|
|
"Encoding format for VI"
|
|
|
|
>;
|
2015-04-23 21:33:54 +02:00
|
|
|
|
|
|
|
def FeatureCIInsts : SubtargetFeature<"ci-insts",
|
2016-01-26 05:49:22 +01:00
|
|
|
"CIInsts",
|
|
|
|
"true",
|
|
|
|
"Additional intstructions for CI+"
|
|
|
|
>;
|
|
|
|
|
2016-02-27 09:53:55 +01:00
|
|
|
def FeatureSMemRealTime : SubtargetFeature<"s-memrealtime",
|
|
|
|
"HasSMemRealTime",
|
2016-02-27 09:53:46 +01:00
|
|
|
"true",
|
2016-02-27 09:53:55 +01:00
|
|
|
"Has s_memrealtime instruction"
|
|
|
|
>;
|
|
|
|
|
2016-10-29 06:05:06 +02:00
|
|
|
def FeatureInv2PiInlineImm : SubtargetFeature<"inv-2pi-inline-imm",
|
|
|
|
"HasInv2PiInlineImm",
|
|
|
|
"true",
|
|
|
|
"Has 1 / (2 * pi) as inline immediate"
|
|
|
|
>;
|
|
|
|
|
2016-02-27 09:53:55 +01:00
|
|
|
def Feature16BitInsts : SubtargetFeature<"16-bit-insts",
|
|
|
|
"Has16BitInsts",
|
|
|
|
"true",
|
|
|
|
"Has i16/f16 instructions"
|
2016-02-27 09:53:46 +01:00
|
|
|
>;
|
|
|
|
|
2016-10-12 20:00:51 +02: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-28 23:55:15 +02:00
|
|
|
def FeatureScalarStores : SubtargetFeature<"scalar-stores",
|
|
|
|
"HasScalarStores",
|
|
|
|
"true",
|
|
|
|
"Has store scalar memory instructions"
|
|
|
|
>;
|
|
|
|
|
2016-01-26 05:49:22 +01:00
|
|
|
//===------------------------------------------------------------===//
|
|
|
|
// Subtarget Features (options and debugging)
|
|
|
|
//===------------------------------------------------------------===//
|
|
|
|
|
2016-11-13 08:01:11 +01:00
|
|
|
def FeatureFP16Denormals : SubtargetFeature<"fp16-denormals",
|
|
|
|
"FP16Denormals",
|
|
|
|
"true",
|
|
|
|
"Enable half precision denormal handling"
|
|
|
|
>;
|
|
|
|
|
2016-01-26 05:49:22 +01:00
|
|
|
// 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"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals",
|
|
|
|
"FP64Denormals",
|
|
|
|
"true",
|
|
|
|
"Enable double precision denormal handling",
|
|
|
|
[FeatureFP64]
|
|
|
|
>;
|
|
|
|
|
2016-01-28 21:53:42 +01:00
|
|
|
def FeatureFPExceptions : SubtargetFeature<"fp-exceptions",
|
|
|
|
"FPExceptions",
|
|
|
|
"true",
|
|
|
|
"Enable floating point exceptions"
|
|
|
|
>;
|
|
|
|
|
2016-02-12 03:40:47 +01: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>;
|
|
|
|
|
2016-01-26 05:49:22 +01: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"
|
|
|
|
>;
|
|
|
|
|
|
|
|
def FeatureFlatForGlobal : SubtargetFeature<"flat-for-global",
|
|
|
|
"FlatForGlobal",
|
|
|
|
"true",
|
|
|
|
"Force to generate flat instruction for global"
|
|
|
|
>;
|
2015-04-23 21:33:54 +02:00
|
|
|
|
|
|
|
// Dummy feature used to disable assembler instructions.
|
|
|
|
def FeatureDisable : SubtargetFeature<"",
|
2016-01-26 05:49:22 +01:00
|
|
|
"FeatureDisable","true",
|
|
|
|
"Dummy feature to disable assembler instructions"
|
|
|
|
>;
|
2015-04-23 21:33:54 +02:00
|
|
|
|
2013-06-07 22:37:48 +02:00
|
|
|
class SubtargetFeatureGeneration <string Value,
|
|
|
|
list<SubtargetFeature> Implies> :
|
|
|
|
SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
|
|
|
|
Value#" GPU generation", Implies>;
|
|
|
|
|
2014-06-17 18:53:14 +02:00
|
|
|
def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
|
|
|
|
def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
|
|
|
|
def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
|
|
|
|
|
2013-06-07 22:37:48 +02:00
|
|
|
def FeatureR600 : SubtargetFeatureGeneration<"R600",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]
|
|
|
|
>;
|
2013-06-07 22:37:48 +02:00
|
|
|
|
|
|
|
def FeatureR700 : SubtargetFeatureGeneration<"R700",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureFetchLimit16, FeatureLocalMemorySize0]
|
|
|
|
>;
|
2013-06-07 22:37:48 +02:00
|
|
|
|
|
|
|
def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureFetchLimit16, FeatureLocalMemorySize32768]
|
|
|
|
>;
|
2013-06-07 22:37:48 +02:00
|
|
|
|
|
|
|
def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureFetchLimit16, FeatureWavefrontSize64,
|
|
|
|
FeatureLocalMemorySize32768]
|
2014-06-17 18:53:14 +02:00
|
|
|
>;
|
2013-06-07 22:37:48 +02:00
|
|
|
|
|
|
|
def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureFP64, FeatureLocalMemorySize32768,
|
|
|
|
FeatureWavefrontSize64, FeatureGCN, FeatureGCN1Encoding,
|
2016-10-12 20:00:51 +02:00
|
|
|
FeatureLDSBankCount32, FeatureMovrel]
|
2016-01-26 05:49:22 +01:00
|
|
|
>;
|
2013-06-07 22:37:48 +02:00
|
|
|
|
2013-10-29 17:37:28 +01:00
|
|
|
def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureFP64, FeatureLocalMemorySize65536,
|
|
|
|
FeatureWavefrontSize64, FeatureGCN, FeatureFlatAddressSpace,
|
2016-10-12 20:00:51 +02:00
|
|
|
FeatureGCN1Encoding, FeatureCIInsts, FeatureMovrel]
|
2016-01-26 05:49:22 +01:00
|
|
|
>;
|
2014-12-07 13:18:57 +01:00
|
|
|
|
|
|
|
def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
|
2016-01-26 05:49:22 +01:00
|
|
|
[FeatureFP64, FeatureLocalMemorySize65536,
|
|
|
|
FeatureWavefrontSize64, FeatureFlatAddressSpace, FeatureGCN,
|
2016-02-27 09:53:55 +01:00
|
|
|
FeatureGCN3Encoding, FeatureCIInsts, Feature16BitInsts,
|
2016-10-28 23:55:15 +02:00
|
|
|
FeatureSMemRealTime, FeatureVGPRIndexMode, FeatureMovrel,
|
2016-10-29 06:05:06 +02:00
|
|
|
FeatureScalarStores, FeatureInv2PiInlineImm
|
2016-02-27 09:53:55 +01:00
|
|
|
]
|
2016-01-26 05:49:22 +01:00
|
|
|
>;
|
2014-12-07 13:18:57 +01:00
|
|
|
|
2016-10-26 18:37:56 +02: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
|
|
|
|
>;
|
|
|
|
|
2016-11-01 01:55:14 +01:00
|
|
|
def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0,
|
2016-10-26 18:37:56 +02:00
|
|
|
[FeatureSeaIslands,
|
|
|
|
FeatureLDSBankCount32]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1,
|
|
|
|
[FeatureSeaIslands,
|
|
|
|
HalfRate64Ops,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureFastFMAF32]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion7_0_2 : SubtargetFeatureISAVersion <7,0,2,
|
|
|
|
[FeatureSeaIslands,
|
|
|
|
FeatureLDSBankCount16,
|
|
|
|
FeatureXNACK]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureSGPRInitBug]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureXNACK]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount32,
|
|
|
|
FeatureSGPRInitBug]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount32]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion8_0_4 : SubtargetFeatureISAVersion <8,0,4,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount32]>;
|
2016-11-01 01:55:14 +01:00
|
|
|
|
2016-10-26 18:37:56 +02:00
|
|
|
def FeatureISAVersion8_1_0 : SubtargetFeatureISAVersion <8,1,0,
|
|
|
|
[FeatureVolcanicIslands,
|
|
|
|
FeatureLDSBankCount16,
|
|
|
|
FeatureXNACK]>;
|
|
|
|
|
2016-04-18 18:28:23 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Debugger related subtarget features.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def FeatureDebuggerInsertNops : SubtargetFeature<
|
|
|
|
"amdgpu-debugger-insert-nops",
|
|
|
|
"DebuggerInsertNops",
|
|
|
|
"true",
|
2016-05-13 20:21:28 +02:00
|
|
|
"Insert one nop instruction for each high level source statement"
|
2016-04-18 18:28:23 +02:00
|
|
|
>;
|
|
|
|
|
2016-05-24 20:37:18 +02:00
|
|
|
def FeatureDebuggerReserveRegs : SubtargetFeature<
|
|
|
|
"amdgpu-debugger-reserve-regs",
|
|
|
|
"DebuggerReserveRegs",
|
2016-04-26 17:43:14 +02:00
|
|
|
"true",
|
2016-05-24 20:37:18 +02:00
|
|
|
"Reserve registers for debugger usage"
|
2016-04-26 17:43:14 +02:00
|
|
|
>;
|
|
|
|
|
2016-06-25 05:11:28 +02:00
|
|
|
def FeatureDebuggerEmitPrologue : SubtargetFeature<
|
|
|
|
"amdgpu-debugger-emit-prologue",
|
|
|
|
"DebuggerEmitPrologue",
|
|
|
|
"true",
|
|
|
|
"Emit debugger prologue"
|
|
|
|
>;
|
|
|
|
|
2013-06-07 22:28:55 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2012-12-11 22:25:42 +01:00
|
|
|
|
|
|
|
def AMDGPUInstrInfo : InstrInfo {
|
|
|
|
let guessInstructionProperties = 1;
|
2015-02-18 03:15:32 +01:00
|
|
|
let noNamedPositionallyEncodedOperands = 1;
|
2012-12-11 22:25:42 +01:00
|
|
|
}
|
|
|
|
|
2014-11-14 15:08:00 +01: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 16:42:48 +02:00
|
|
|
def AMDGPUAsmWriter : AsmWriter {
|
|
|
|
int PassSubtarget = 1;
|
|
|
|
}
|
|
|
|
|
2016-09-09 11:37:51 +02:00
|
|
|
def AMDGPUAsmVariants {
|
|
|
|
string Default = "Default";
|
|
|
|
int Default_ID = 0;
|
|
|
|
string VOP3 = "VOP3";
|
|
|
|
int VOP3_ID = 1;
|
|
|
|
string SDWA = "SDWA";
|
|
|
|
int SDWA_ID = 2;
|
|
|
|
string DPP = "DPP";
|
|
|
|
int DPP_ID = 3;
|
2016-09-12 16:42:43 +02:00
|
|
|
string Disable = "Disable";
|
|
|
|
int Disable_ID = 4;
|
2016-09-09 11:37:51 +02: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;
|
|
|
|
}
|
|
|
|
|
|
|
|
def DPPAsmParserVariant : AsmParserVariant {
|
|
|
|
let Variant = AMDGPUAsmVariants.DPP_ID;
|
|
|
|
let Name = AMDGPUAsmVariants.DPP;
|
|
|
|
}
|
|
|
|
|
2012-12-11 22:25:42 +01:00
|
|
|
def AMDGPU : Target {
|
|
|
|
// Pull in Instruction Info:
|
|
|
|
let InstructionSet = AMDGPUInstrInfo;
|
2014-11-14 15:08:00 +01:00
|
|
|
let AssemblyParsers = [AMDGPUAsmParser];
|
2016-09-09 11:37:51 +02:00
|
|
|
let AssemblyParserVariants = [DefaultAMDGPUAsmParserVariant,
|
|
|
|
VOP3AsmParserVariant,
|
|
|
|
SDWAAsmParserVariant,
|
|
|
|
DPPAsmParserVariant];
|
2016-09-27 16:42:48 +02:00
|
|
|
let AssemblyWriters = [AMDGPUAsmWriter];
|
2012-12-11 22:25:42 +01:00
|
|
|
}
|
|
|
|
|
2014-06-13 18:38:59 +02:00
|
|
|
// Dummy Instruction itineraries for pseudo instructions
|
|
|
|
def ALU_NULL : FuncUnit;
|
|
|
|
def NullALU : InstrItinClass;
|
|
|
|
|
2014-05-16 22:56:45 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Predicate helper class
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-04-23 21:33:54 +02:00
|
|
|
def TruePredicate : Predicate<"true">;
|
2016-01-26 05:49:22 +01:00
|
|
|
|
2015-04-23 21:33:54 +02:00
|
|
|
def isSICI : Predicate<
|
|
|
|
"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||"
|
|
|
|
"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS"
|
|
|
|
>, AssemblerPredicate<"FeatureGCN1Encoding">;
|
|
|
|
|
2015-12-24 04:18:18 +01:00
|
|
|
def isVI : Predicate <
|
|
|
|
"Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">,
|
|
|
|
AssemblerPredicate<"FeatureGCN3Encoding">;
|
|
|
|
|
2016-01-26 05:49:22 +01:00
|
|
|
def isCIVI : Predicate <
|
|
|
|
"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS || "
|
|
|
|
"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS"
|
|
|
|
>, AssemblerPredicate<"FeatureCIInsts">;
|
|
|
|
|
|
|
|
def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">;
|
|
|
|
|
2016-11-10 17:02:37 +01:00
|
|
|
def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">;
|
|
|
|
|
2014-05-16 22:56:45 +02:00
|
|
|
class PredicateControl {
|
|
|
|
Predicate SubtargetPredicate;
|
2015-04-23 21:33:54 +02:00
|
|
|
Predicate SIAssemblerPredicate = isSICI;
|
2015-12-24 04:18:18 +01:00
|
|
|
Predicate VIAssemblerPredicate = isVI;
|
2015-04-08 03:09:26 +02:00
|
|
|
list<Predicate> AssemblerPredicates = [];
|
2015-04-23 21:33:54 +02:00
|
|
|
Predicate AssemblerPredicate = TruePredicate;
|
2014-05-16 22:56:45 +02:00
|
|
|
list<Predicate> OtherPredicates = [];
|
2015-04-23 21:33:54 +02:00
|
|
|
list<Predicate> Predicates = !listconcat([SubtargetPredicate, AssemblerPredicate],
|
2015-04-08 03:09:26 +02:00
|
|
|
AssemblerPredicates,
|
2014-05-16 22:56:45 +02:00
|
|
|
OtherPredicates);
|
|
|
|
}
|
|
|
|
|
2012-12-11 22:25:42 +01:00
|
|
|
// Include AMDGPU TD files
|
|
|
|
include "R600Schedule.td"
|
|
|
|
include "SISchedule.td"
|
|
|
|
include "Processors.td"
|
|
|
|
include "AMDGPUInstrInfo.td"
|
|
|
|
include "AMDGPUIntrinsics.td"
|
|
|
|
include "AMDGPURegisterInfo.td"
|
|
|
|
include "AMDGPUInstructions.td"
|
2013-03-07 10:03:52 +01:00
|
|
|
include "AMDGPUCallingConv.td"
|