]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/Target/AMDGPU/AMDGPUFeatures.td
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / lib / Target / AMDGPU / AMDGPUFeatures.td
1 //===-- AMDGPUFeatures.td - AMDGPU Feature Definitions -----*- 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 def FeatureFP64 : SubtargetFeature<"fp64",
11   "FP64",
12   "true",
13   "Enable double precision operations"
14 >;
15
16 def FeatureFMA : SubtargetFeature<"fmaf",
17   "FMA",
18   "true",
19   "Enable single precision FMA (not as fast as mul+add, but fused)"
20 >;
21
22 // Some instructions do not support denormals despite this flag. Using
23 // fp32 denormals also causes instructions to run at the double
24 // precision rate for the device.
25 def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals",
26   "FP32Denormals",
27   "true",
28   "Enable single precision denormal handling"
29 >;
30
31 class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
32   "localmemorysize"#Value,
33   "LocalMemorySize",
34   !cast<string>(Value),
35   "The size of local memory in bytes"
36 >;
37
38 def FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
39 def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
40 def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
41
42 class SubtargetFeatureWavefrontSize <int Value> : SubtargetFeature<
43   "wavefrontsize"#Value,
44   "WavefrontSize",
45   !cast<string>(Value),
46   "The number of threads per wavefront"
47 >;
48
49 def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<16>;
50 def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<32>;
51 def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<64>;
52
53 class SubtargetFeatureGeneration <string Value, string Subtarget,
54                                   list<SubtargetFeature> Implies> :
55         SubtargetFeature <Value, "Gen", Subtarget#"::"#Value,
56                           Value#" GPU generation", Implies>;
57
58 def FeatureDX10Clamp : SubtargetFeature<"dx10-clamp",
59   "DX10Clamp",
60   "true",
61   "clamp modifier clamps NaNs to 0.0"
62 >;
63
64 def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
65   "EnablePromoteAlloca",
66   "true",
67   "Enable promote alloca pass"
68 >;
69