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 | |
| 10 | // Include AMDIL TD files |
| 11 | include "AMDILBase.td" |
| 12 | |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 13 | //===----------------------------------------------------------------------===// |
| 14 | // Subtarget Features |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 17 | // Debugging Features |
| 18 | |
| 19 | def FeatureDumpCode : SubtargetFeature <"DumpCode", |
| 20 | "DumpCode", |
| 21 | "true", |
| 22 | "Dump MachineInstrs in the CodeEmitter">; |
| 23 | |
Tom Stellard | 66df8a2 | 2013-11-18 19:43:44 +0000 | [diff] [blame] | 24 | def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer", |
Tom Stellard | ed0ceec | 2013-10-10 17:11:12 +0000 | [diff] [blame] | 25 | "EnableIRStructurizer", |
Tom Stellard | 66df8a2 | 2013-11-18 19:43:44 +0000 | [diff] [blame] | 26 | "false", |
| 27 | "Disable IR Structurizer">; |
Tom Stellard | ed0ceec | 2013-10-10 17:11:12 +0000 | [diff] [blame] | 28 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 29 | // Target features |
| 30 | |
Tom Stellard | 783893a | 2013-11-18 19:43:33 +0000 | [diff] [blame] | 31 | def FeatureIfCvt : SubtargetFeature <"disable-ifcvt", |
| 32 | "EnableIfCvt", |
| 33 | "false", |
| 34 | "Disable the if conversion pass">; |
| 35 | |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 36 | def FeatureFP64 : SubtargetFeature<"fp64", |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 37 | "FP64", |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 38 | "true", |
| 39 | "Enable 64bit double precision operations">; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 40 | |
| 41 | def Feature64BitPtr : SubtargetFeature<"64BitPtr", |
| 42 | "Is64bit", |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 43 | "true", |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 44 | "Specify if 64bit addressing should be used.">; |
| 45 | |
| 46 | def Feature32on64BitPtr : SubtargetFeature<"64on32BitPtr", |
| 47 | "Is32on64bit", |
| 48 | "false", |
| 49 | "Specify if 64bit sized pointers with 32bit addressing should be used.">; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 50 | |
| 51 | def FeatureR600ALUInst : SubtargetFeature<"R600ALUInst", |
| 52 | "R600ALUInst", |
| 53 | "false", |
| 54 | "Older version of ALU instructions encoding.">; |
| 55 | |
| 56 | def FeatureVertexCache : SubtargetFeature<"HasVertexCache", |
| 57 | "HasVertexCache", |
| 58 | "true", |
| 59 | "Specify use of dedicated vertex cache.">; |
| 60 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 61 | def FeatureCaymanISA : SubtargetFeature<"caymanISA", |
| 62 | "CaymanISA", |
| 63 | "true", |
| 64 | "Use Cayman ISA">; |
| 65 | |
Tom Stellard | 348273d | 2014-01-23 16:18:02 +0000 | [diff] [blame^] | 66 | def FeatureCFALUBug : SubtargetFeature<"cfalubug", |
| 67 | "CFALUBug", |
| 68 | "true", |
| 69 | "GPU has CF_ALU bug">; |
| 70 | |
Tom Stellard | 3498e4f | 2013-06-07 20:28:55 +0000 | [diff] [blame] | 71 | class SubtargetFeatureFetchLimit <string Value> : |
| 72 | SubtargetFeature <"fetch"#Value, |
| 73 | "TexVTXClauseSize", |
| 74 | Value, |
| 75 | "Limit the maximum number of fetches in a clause to "#Value>; |
Tom Stellard | 9979277 | 2013-06-07 20:28:49 +0000 | [diff] [blame] | 76 | |
Tom Stellard | 3498e4f | 2013-06-07 20:28:55 +0000 | [diff] [blame] | 77 | def FeatureFetchLimit8 : SubtargetFeatureFetchLimit <"8">; |
| 78 | def FeatureFetchLimit16 : SubtargetFeatureFetchLimit <"16">; |
| 79 | |
Tom Stellard | 8c347b0 | 2014-01-22 21:55:40 +0000 | [diff] [blame] | 80 | class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature< |
| 81 | "wavefrontsize"#Value, |
| 82 | "WavefrontSize", |
| 83 | !cast<string>(Value), |
| 84 | "The number of threads per wavefront">; |
| 85 | |
| 86 | def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>; |
| 87 | def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>; |
| 88 | def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>; |
| 89 | |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 90 | class SubtargetFeatureGeneration <string Value, |
| 91 | list<SubtargetFeature> Implies> : |
| 92 | SubtargetFeature <Value, "Gen", "AMDGPUSubtarget::"#Value, |
| 93 | Value#" GPU generation", Implies>; |
| 94 | |
| 95 | def FeatureR600 : SubtargetFeatureGeneration<"R600", |
| 96 | [FeatureR600ALUInst, FeatureFetchLimit8]>; |
| 97 | |
| 98 | def FeatureR700 : SubtargetFeatureGeneration<"R700", |
| 99 | [FeatureFetchLimit16]>; |
| 100 | |
| 101 | def FeatureEvergreen : SubtargetFeatureGeneration<"EVERGREEN", |
| 102 | [FeatureFetchLimit16]>; |
| 103 | |
| 104 | def FeatureNorthernIslands : SubtargetFeatureGeneration<"NORTHERN_ISLANDS", |
Tom Stellard | 8c347b0 | 2014-01-22 21:55:40 +0000 | [diff] [blame] | 105 | [FeatureFetchLimit16, FeatureWavefrontSize64]>; |
Tom Stellard | a6c6e1b | 2013-06-07 20:37:48 +0000 | [diff] [blame] | 106 | |
| 107 | def FeatureSouthernIslands : SubtargetFeatureGeneration<"SOUTHERN_ISLANDS", |
| 108 | [Feature64BitPtr, FeatureFP64]>; |
| 109 | |
Tom Stellard | 6e1ee47 | 2013-10-29 16:37:28 +0000 | [diff] [blame] | 110 | def FeatureSeaIslands : SubtargetFeatureGeneration<"SEA_ISLANDS", |
| 111 | [Feature64BitPtr, FeatureFP64]>; |
Tom Stellard | 3498e4f | 2013-06-07 20:28:55 +0000 | [diff] [blame] | 112 | //===----------------------------------------------------------------------===// |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 113 | |
| 114 | def AMDGPUInstrInfo : InstrInfo { |
| 115 | let guessInstructionProperties = 1; |
| 116 | } |
| 117 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 118 | def AMDGPU : Target { |
| 119 | // Pull in Instruction Info: |
| 120 | let InstructionSet = AMDGPUInstrInfo; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | // Include AMDGPU TD files |
| 124 | include "R600Schedule.td" |
| 125 | include "SISchedule.td" |
| 126 | include "Processors.td" |
| 127 | include "AMDGPUInstrInfo.td" |
| 128 | include "AMDGPUIntrinsics.td" |
| 129 | include "AMDGPURegisterInfo.td" |
| 130 | include "AMDGPUInstructions.td" |
Christian Konig | 2c8f6d5 | 2013-03-07 09:03:52 +0000 | [diff] [blame] | 131 | include "AMDGPUCallingConv.td" |