2012-12-11 21:25:42 +00:00
|
|
|
//===-- AMDIL.td - AMDIL Tablegen files --*- tablegen -*-------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//==-----------------------------------------------------------------------===//
|
|
|
|
|
2014-06-13 16:38:59 +00:00
|
|
|
include "llvm/Target/Target.td"
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2013-06-07 20:28:49 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Subtarget Features
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
// Debugging Features
|
|
|
|
|
|
|
|
def FeatureDumpCode : SubtargetFeature <"DumpCode",
|
|
|
|
"DumpCode",
|
|
|
|
"true",
|
|
|
|
"Dump MachineInstrs in the CodeEmitter">;
|
|
|
|
|
2013-11-18 19:43:44 +00:00
|
|
|
def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer",
|
2013-10-10 17:11:12 +00:00
|
|
|
"EnableIRStructurizer",
|
2013-11-18 19:43:44 +00:00
|
|
|
"false",
|
|
|
|
"Disable IR Structurizer">;
|
2013-10-10 17:11:12 +00:00
|
|
|
|
2014-07-13 02:08:26 +00:00
|
|
|
def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
|
|
|
|
"EnablePromoteAlloca",
|
|
|
|
"true",
|
|
|
|
"Enable promote alloca pass">;
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
// Target features
|
|
|
|
|
2013-11-18 19:43:33 +00:00
|
|
|
def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
|
|
|
|
"EnableIfCvt",
|
|
|
|
"false",
|
|
|
|
"Disable the if conversion pass">;
|
|
|
|
|
2014-06-20 06:50:05 +00:00
|
|
|
def FeatureFP64 : SubtargetFeature<"fp64",
|
2013-06-07 20:37:48 +00:00
|
|
|
"FP64",
|
2013-06-07 20:28:49 +00:00
|
|
|
"true",
|
2014-06-20 06:50:05 +00:00
|
|
|
"Enable double precision operations">;
|
2013-06-07 20:28:49 +00:00
|
|
|
|
2014-07-14 23:40:49 +00:00
|
|
|
def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals",
|
|
|
|
"FP64Denormals",
|
|
|
|
"true",
|
|
|
|
"Enable double precision denormal handling",
|
|
|
|
[FeatureFP64]>;
|
|
|
|
|
2015-01-29 19:34:25 +00:00
|
|
|
def FeatureFastFMAF32 : SubtargetFeature<"fast-fmaf",
|
|
|
|
"FastFMAF32",
|
|
|
|
"true",
|
|
|
|
"Assuming f32 fma is at least as fast as mul + add",
|
|
|
|
[]>;
|
|
|
|
|
2014-07-14 23:40:49 +00: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">;
|
|
|
|
|
2013-06-07 20:28:49 +00:00
|
|
|
def Feature64BitPtr : SubtargetFeature<"64BitPtr",
|
|
|
|
"Is64bit",
|
2013-06-07 20:37:48 +00:00
|
|
|
"true",
|
2014-06-20 06:50:05 +00:00
|
|
|
"Specify if 64-bit addressing should be used">;
|
2013-06-07 20:28:49 +00:00
|
|
|
|
|
|
|
def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst",
|
|
|
|
"R600ALUInst",
|
|
|
|
"false",
|
2014-06-20 06:50:05 +00:00
|
|
|
"Older version of ALU instructions encoding">;
|
2013-06-07 20:28:49 +00:00
|
|
|
|
|
|
|
def FeatureVertexCache : SubtargetFeature<"HasVertexCache",
|
|
|
|
"HasVertexCache",
|
|
|
|
"true",
|
2014-06-20 06:50:05 +00:00
|
|
|
"Specify use of dedicated vertex cache">;
|
2013-06-07 20:28:49 +00:00
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
def FeatureCaymanISA : SubtargetFeature<"caymanISA",
|
|
|
|
"CaymanISA",
|
|
|
|
"true",
|
|
|
|
"Use Cayman ISA">;
|
|
|
|
|
2014-01-23 16:18:02 +00:00
|
|
|
def FeatureCFALUBug : SubtargetFeature<"cfalubug",
|
|
|
|
"CFALUBug",
|
|
|
|
"true",
|
|
|
|
"GPU has CF_ALU bug">;
|
|
|
|
|
2014-10-10 22:01:59 +00:00
|
|
|
// XXX - This should probably be removed once enabled by default
|
|
|
|
def FeatureEnableLoadStoreOpt : SubtargetFeature <"load-store-opt",
|
|
|
|
"EnableLoadStoreOpt",
|
|
|
|
"true",
|
|
|
|
"Enable SI load/store optimizer pass">;
|
|
|
|
|
2014-09-15 15:41:53 +00:00
|
|
|
def FeatureFlatAddressSpace : SubtargetFeature<"flat-address-space",
|
|
|
|
"FlatAddressSpace",
|
|
|
|
"true",
|
|
|
|
"Support flat address space">;
|
|
|
|
|
2015-01-20 19:33:04 +00:00
|
|
|
def FeatureVGPRSpilling : SubtargetFeature<"vgpr-spilling",
|
|
|
|
"EnableVGPRSpilling",
|
|
|
|
"true",
|
|
|
|
"Enable spilling of VGPRs to scratch memory">;
|
|
|
|
|
2013-06-07 20:28:55 +00:00
|
|
|
class SubtargetFeatureFetchLimit <string Value> :
|
|
|
|
SubtargetFeature <"fetch"#Value,
|
|
|
|
"TexVTXClauseSize",
|
|
|
|
Value,
|
|
|
|
"Limit the maximum number of fetches in a clause to "#Value>;
|
2013-06-07 20:28:49 +00:00
|
|
|
|
2013-06-07 20:28:55 +00:00
|
|
|
def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">;
|
|
|
|
def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">;
|
|
|
|
|
2014-01-22 21:55:40 +00:00
|
|
|
class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
|
|
|
|
"wavefrontsize"#Value,
|
|
|
|
"WavefrontSize",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The number of threads per wavefront">;
|
|
|
|
|
|
|
|
def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
|
|
|
|
def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
|
|
|
|
def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
|
|
|
|
|
2014-06-17 16:53:14 +00:00
|
|
|
class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
|
|
|
|
"localmemorysize"#Value,
|
|
|
|
"LocalMemorySize",
|
|
|
|
!cast<string>(Value),
|
|
|
|
"The size of local memory in bytes">;
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
class SubtargetFeatureGeneration <string Value,
|
|
|
|
list<SubtargetFeature> Implies> :
|
|
|
|
SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value,
|
|
|
|
Value#" GPU generation", Implies>;
|
|
|
|
|
2014-06-17 16:53:14 +00:00
|
|
|
def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
|
|
|
|
def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
|
|
|
|
def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
|
|
|
|
|
2013-06-07 20:37:48 +00:00
|
|
|
def FeatureR600 : SubtargetFeatureGeneration<"R600",
|
2014-06-17 16:53:14 +00:00
|
|
|
[FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]>;
|
2013-06-07 20:37:48 +00:00
|
|
|
|
|
|
|
def FeatureR700 : SubtargetFeatureGeneration<"R700",
|
2014-06-17 16:53:14 +00:00
|
|
|
[FeatureFetchLimit16, FeatureLocalMemorySize0]>;
|
2013-06-07 20:37:48 +00:00
|
|
|
|
|
|
|
def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN",
|
2014-06-17 16:53:14 +00:00
|
|
|
[FeatureFetchLimit16, FeatureLocalMemorySize32768]>;
|
2013-06-07 20:37:48 +00:00
|
|
|
|
|
|
|
def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS",
|
2014-06-17 16:53:14 +00:00
|
|
|
[FeatureFetchLimit16, FeatureWavefrontSize64,
|
|
|
|
FeatureLocalMemorySize32768]
|
|
|
|
>;
|
2013-06-07 20:37:48 +00:00
|
|
|
|
|
|
|
def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS",
|
2014-07-21 15:44:58 +00:00
|
|
|
[Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize32768,
|
|
|
|
FeatureWavefrontSize64]>;
|
2013-06-07 20:37:48 +00:00
|
|
|
|
2013-10-29 16:37:28 +00:00
|
|
|
def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS",
|
2014-07-21 15:44:58 +00:00
|
|
|
[Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536,
|
2014-09-15 15:41:53 +00:00
|
|
|
FeatureWavefrontSize64, FeatureFlatAddressSpace]>;
|
2014-12-07 12:18:57 +00:00
|
|
|
|
|
|
|
def FeatureVolcanicIslands : SubtargetFeatureGeneration<"VOLCANIC_ISLANDS",
|
|
|
|
[Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536,
|
|
|
|
FeatureWavefrontSize64, FeatureFlatAddressSpace]>;
|
|
|
|
|
2013-06-07 20:28:55 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2012-12-11 21:25:42 +00:00
|
|
|
|
|
|
|
def AMDGPUInstrInfo : InstrInfo {
|
|
|
|
let guessInstructionProperties = 1;
|
|
|
|
}
|
|
|
|
|
2014-11-14 14:08:00 +00: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;
|
|
|
|
}
|
|
|
|
|
2012-12-11 21:25:42 +00:00
|
|
|
def AMDGPU : Target {
|
|
|
|
// Pull in Instruction Info:
|
|
|
|
let InstructionSet = AMDGPUInstrInfo;
|
2014-11-14 14:08:00 +00:00
|
|
|
let AssemblyParsers = [AMDGPUAsmParser];
|
2012-12-11 21:25:42 +00:00
|
|
|
}
|
|
|
|
|
2014-06-13 16:38:59 +00:00
|
|
|
// Dummy Instruction itineraries for pseudo instructions
|
|
|
|
def ALU_NULL : FuncUnit;
|
|
|
|
def NullALU : InstrItinClass;
|
|
|
|
|
2014-05-16 20:56:45 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Predicate helper class
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
class PredicateControl {
|
|
|
|
Predicate SubtargetPredicate;
|
|
|
|
list<Predicate> OtherPredicates = [];
|
|
|
|
list<Predicate> Predicates = !listconcat([SubtargetPredicate],
|
|
|
|
OtherPredicates);
|
|
|
|
}
|
|
|
|
|
2012-12-11 21:25:42 +00: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 09:03:52 +00:00
|
|
|
include "AMDGPUCallingConv.td"
|