Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===-- AMDIL.td - AMDIL Tablegen files --*- tablegen -*-------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //==-----------------------------------------------------------------------===// |
| 9 | |
Tom Stellard | bc5b537 | 2014-06-13 16:38:59 +0000 | [diff] [blame] | 10 | include "llvm/Target/Target.td" |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 11 | |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 12 | //===----------------------------------------------------------------------===// |
| 13 | // Subtarget Features |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 16 | // Debugging Features |
| 17 | |
| 18 | def FeatureDumpCode : SubtargetFeature <"DumpCode", |
| 19 | "DumpCode", |
| 20 | "true", |
| 21 | "Dump MachineInstrs in the CodeEmitter">; |
| 22 | |
Tom Stellard | 66df8a2 | 2013-11-18 19:43:44 +0000 | [diff] [blame] | 23 | def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer", |
Tom Stellard | ed0ceec | 2013-10-10 17:11:12 +0000 | [diff] [blame] | 24 | "EnableIRStructurizer", |
Tom Stellard | 66df8a2 | 2013-11-18 19:43:44 +0000 | [diff] [blame] | 25 | "false", |
| 26 | "Disable IR Structurizer">; |
Tom Stellard | ed0ceec | 2013-10-10 17:11:12 +0000 | [diff] [blame] | 27 | |
Matt Arsenault | d9a23ab | 2014-07-13 02:08:26 +0000 | [diff] [blame] | 28 | def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca", |
| 29 | "EnablePromoteAlloca", |
| 30 | "true", |
| 31 | "Enable promote alloca pass">; |
| 32 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 33 | // Target features |
| 34 | |
Tom Stellard | 783893a | 2013-11-18 19:43:33 +0000 | [diff] [blame] | 35 | def FeatureIfCvt : SubtargetFeature <"disable-ifcvt", |
| 36 | "EnableIfCvt", |
| 37 | "false", |
| 38 | "Disable the if conversion pass">; |
| 39 | |
Matt Arsenault | f5e2997 | 2014-06-20 06:50:05 +0000 | [diff] [blame] | 40 | def FeatureFP64 : SubtargetFeature<"fp64", |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 41 | "FP64", |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 42 | "true", |
Matt Arsenault | f5e2997 | 2014-06-20 06:50:05 +0000 | [diff] [blame] | 43 | "Enable double precision operations">; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 44 | |
Matt Arsenault | f171cf2 | 2014-07-14 23:40:49 +0000 | [diff] [blame] | 45 | def FeatureFP64Denormals : SubtargetFeature<"fp64-denormals", |
| 46 | "FP64Denormals", |
| 47 | "true", |
| 48 | "Enable double precision denormal handling", |
| 49 | [FeatureFP64]>; |
| 50 | |
| 51 | // Some instructions do not support denormals despite this flag. Using |
| 52 | // fp32 denormals also causes instructions to run at the double |
| 53 | // precision rate for the device. |
| 54 | def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals", |
| 55 | "FP32Denormals", |
| 56 | "true", |
| 57 | "Enable single precision denormal handling">; |
| 58 | |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 59 | def Feature64BitPtr : SubtargetFeature<"64BitPtr", |
| 60 | "Is64bit", |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 61 | "true", |
Matt Arsenault | f5e2997 | 2014-06-20 06:50:05 +0000 | [diff] [blame] | 62 | "Specify if 64-bit addressing should be used">; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 63 | |
| 64 | def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst", |
| 65 | "R600ALUInst", |
| 66 | "false", |
Matt Arsenault | f5e2997 | 2014-06-20 06:50:05 +0000 | [diff] [blame] | 67 | "Older version of ALU instructions encoding">; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 68 | |
| 69 | def FeatureVertexCache : SubtargetFeature<"HasVertexCache", |
| 70 | "HasVertexCache", |
| 71 | "true", |
Matt Arsenault | f5e2997 | 2014-06-20 06:50:05 +0000 | [diff] [blame] | 72 | "Specify use of dedicated vertex cache">; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 73 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 74 | def FeatureCaymanISA : SubtargetFeature<"caymanISA", |
| 75 | "CaymanISA", |
| 76 | "true", |
| 77 | "Use Cayman ISA">; |
| 78 | |
Tom Stellard | 348273d | 2014-01-23 16:18:02 +0000 | [diff] [blame] | 79 | def FeatureCFALUBug : SubtargetFeature<"cfalubug", |
| 80 | "CFALUBug", |
| 81 | "true", |
| 82 | "GPU has CF_ALU bug">; |
| 83 | |
Tom Stellard | 3498e4f | 2013-06-07 20:28:55 +0000 | [diff] [blame] | 84 | class SubtargetFeatureFetchLimit <string Value> : |
| 85 | SubtargetFeature <"fetch"#Value, |
| 86 | "TexVTXClauseSize", |
| 87 | Value, |
| 88 | "Limit the maximum number of fetches in a clause to "#Value>; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 89 | |
Tom Stellard | 3498e4f | 2013-06-07 20:28:55 +0000 | [diff] [blame] | 90 | def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">; |
| 91 | def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">; |
| 92 | |
Tom Stellard | 8c347b0 | 2014-01-22 21:55:40 +0000 | [diff] [blame] | 93 | class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature< |
| 94 | "wavefrontsize"#Value, |
| 95 | "WavefrontSize", |
| 96 | !cast<string>(Value), |
| 97 | "The number of threads per wavefront">; |
| 98 | |
| 99 | def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>; |
| 100 | def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>; |
| 101 | def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>; |
| 102 | |
Tom Stellard | 880a80a | 2014-06-17 16:53:14 +0000 | [diff] [blame] | 103 | class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature< |
| 104 | "localmemorysize"#Value, |
| 105 | "LocalMemorySize", |
| 106 | !cast<string>(Value), |
| 107 | "The size of local memory in bytes">; |
| 108 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 109 | class SubtargetFeatureGeneration <string Value, |
| 110 | list<SubtargetFeature> Implies> : |
| 111 | SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value, |
| 112 | Value#" GPU generation", Implies>; |
| 113 | |
Tom Stellard | 880a80a | 2014-06-17 16:53:14 +0000 | [diff] [blame] | 114 | def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>; |
| 115 | def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>; |
| 116 | def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>; |
| 117 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 118 | def FeatureR600 : SubtargetFeatureGeneration<"R600", |
Tom Stellard | 880a80a | 2014-06-17 16:53:14 +0000 | [diff] [blame] | 119 | [FeatureR600ALUInst, FeatureFetchLimit8, FeatureLocalMemorySize0]>; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 120 | |
| 121 | def FeatureR700 : SubtargetFeatureGeneration<"R700", |
Tom Stellard | 880a80a | 2014-06-17 16:53:14 +0000 | [diff] [blame] | 122 | [FeatureFetchLimit16, FeatureLocalMemorySize0]>; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 123 | |
| 124 | def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN", |
Tom Stellard | 880a80a | 2014-06-17 16:53:14 +0000 | [diff] [blame] | 125 | [FeatureFetchLimit16, FeatureLocalMemorySize32768]>; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 126 | |
| 127 | def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS", |
Tom Stellard | 880a80a | 2014-06-17 16:53:14 +0000 | [diff] [blame] | 128 | [FeatureFetchLimit16, FeatureWavefrontSize64, |
| 129 | FeatureLocalMemorySize32768] |
| 130 | >; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 131 | |
| 132 | def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS", |
Tom Stellard | 42639a5 | 2014-07-21 15:44:58 +0000 | [diff] [blame^] | 133 | [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize32768, |
| 134 | FeatureWavefrontSize64]>; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 135 | |
Tom Stellard | 6e1ee47 | 2013-10-29 16:37:28 +0000 | [diff] [blame] | 136 | def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS", |
Tom Stellard | 42639a5 | 2014-07-21 15:44:58 +0000 | [diff] [blame^] | 137 | [Feature64BitPtr, FeatureFP64, FeatureLocalMemorySize65536, |
| 138 | FeatureWavefrontSize64]>; |
Tom Stellard | 3498e4f | 2013-06-07 20:28:55 +0000 | [diff] [blame] | 139 | //===----------------------------------------------------------------------===// |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 140 | |
| 141 | def AMDGPUInstrInfo : InstrInfo { |
| 142 | let guessInstructionProperties = 1; |
| 143 | } |
| 144 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 145 | def AMDGPU : Target { |
| 146 | // Pull in Instruction Info: |
| 147 | let InstructionSet = AMDGPUInstrInfo; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Tom Stellard | bc5b537 | 2014-06-13 16:38:59 +0000 | [diff] [blame] | 150 | // Dummy Instruction itineraries for pseudo instructions |
| 151 | def ALU_NULL : FuncUnit; |
| 152 | def NullALU : InstrItinClass; |
| 153 | |
Tom Stellard | 0e70de5 | 2014-05-16 20:56:45 +0000 | [diff] [blame] | 154 | //===----------------------------------------------------------------------===// |
| 155 | // Predicate helper class |
| 156 | //===----------------------------------------------------------------------===// |
| 157 | |
| 158 | class PredicateControl { |
| 159 | Predicate SubtargetPredicate; |
| 160 | list<Predicate> OtherPredicates = []; |
| 161 | list<Predicate> Predicates = !listconcat([SubtargetPredicate], |
| 162 | OtherPredicates); |
| 163 | } |
| 164 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 165 | // Include AMDGPU TD files |
| 166 | include "R600Schedule.td" |
| 167 | include "SISchedule.td" |
| 168 | include "Processors.td" |
| 169 | include "AMDGPUInstrInfo.td" |
| 170 | include "AMDGPUIntrinsics.td" |
| 171 | include "AMDGPURegisterInfo.td" |
| 172 | include "AMDGPUInstructions.td" |
Christian Konig | 2c8f6d5 | 2013-03-07 09:03:52 +0000 | [diff] [blame] | 173 | include "AMDGPUCallingConv.td" |