| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 1 | //===-- AMDGPUFeatures.td - AMDGPU Feature Definitions -----*- tablegen -*-===// | 
|  | 2 | // | 
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | 
|  | 4 | // See https://llvm.org/LICENSE.txt for license information. | 
|  | 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | 
| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 6 | // | 
|  | 7 | //===----------------------------------------------------------------------===// | 
|  | 8 |  | 
|  | 9 | def FeatureFP64 : SubtargetFeature<"fp64", | 
|  | 10 | "FP64", | 
|  | 11 | "true", | 
|  | 12 | "Enable double precision operations" | 
|  | 13 | >; | 
|  | 14 |  | 
|  | 15 | def FeatureFMA : SubtargetFeature<"fmaf", | 
|  | 16 | "FMA", | 
|  | 17 | "true", | 
|  | 18 | "Enable single precision FMA (not as fast as mul+add, but fused)" | 
|  | 19 | >; | 
|  | 20 |  | 
| Jan Vesely | 5ba1b4b | 2018-08-01 15:04:36 +0000 | [diff] [blame] | 21 | // Some instructions do not support denormals despite this flag. Using | 
|  | 22 | // fp32 denormals also causes instructions to run at the double | 
|  | 23 | // precision rate for the device. | 
|  | 24 | def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals", | 
|  | 25 | "FP32Denormals", | 
|  | 26 | "true", | 
|  | 27 | "Enable single precision denormal handling" | 
|  | 28 | >; | 
|  | 29 |  | 
| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 30 | class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature< | 
|  | 31 | "localmemorysize"#Value, | 
|  | 32 | "LocalMemorySize", | 
|  | 33 | !cast<string>(Value), | 
|  | 34 | "The size of local memory in bytes" | 
|  | 35 | >; | 
|  | 36 |  | 
|  | 37 | def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>; | 
|  | 38 | def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>; | 
|  | 39 | def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>; | 
|  | 40 |  | 
|  | 41 | class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature< | 
|  | 42 | "wavefrontsize"#Value, | 
|  | 43 | "WavefrontSize", | 
|  | 44 | !cast<string>(Value), | 
|  | 45 | "The number of threads per wavefront" | 
|  | 46 | >; | 
|  | 47 |  | 
|  | 48 | def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>; | 
|  | 49 | def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>; | 
|  | 50 | def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>; | 
|  | 51 |  | 
| Matt Arsenault | 45c165b | 2019-04-03 00:01:03 +0000 | [diff] [blame] | 52 | class SubtargetFeatureGeneration <string Value, string FeatureName, | 
|  | 53 | string Subtarget, | 
| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 54 | list<SubtargetFeature> Implies> : | 
| Matt Arsenault | 45c165b | 2019-04-03 00:01:03 +0000 | [diff] [blame] | 55 | SubtargetFeature <FeatureName, "Gen", Subtarget#"::"#Value, | 
| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 56 | Value#" GPU generation", Implies>; | 
|  | 57 |  | 
| Tom Stellard | c5a154d | 2018-06-28 23:47:12 +0000 | [diff] [blame] | 58 | def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca", | 
|  | 59 | "EnablePromoteAlloca", | 
|  | 60 | "true", | 
|  | 61 | "Enable promote alloca pass" | 
|  | 62 | >; | 
|  | 63 |  |