]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td
zfs: merge openzfs/zfs@eb62221ff (zfs-2.1-release) into stable/13
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / lib / Target / AMDGPU / AMDGPUFeatures.td
1 //===-- AMDGPUFeatures.td - AMDGPU Feature Definitions -----*- tablegen -*-===//
2 //
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
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
21 class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
22   "localmemorysize"#Value,
23   "LocalMemorySize",
24   !cast<string>(Value),
25   "The size of local memory in bytes"
26 >;
27
28 def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
29 def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
30
31 class SubtargetFeatureWavefrontSize <int ValueLog2> : SubtargetFeature<
32   "wavefrontsize"#!shl(1, ValueLog2),
33   "WavefrontSizeLog2",
34   !cast<string>(ValueLog2),
35   "The number of threads per wavefront"
36 >;
37
38 def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<4>;
39 def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<5>;
40 def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<6>;
41
42 class SubtargetFeatureGeneration <string Value, string FeatureName,
43                                  string Subtarget,
44                                   list<SubtargetFeature> Implies> :
45         SubtargetFeature <FeatureName, "Gen", Subtarget#"::"#Value,
46                           Value#" GPU generation", Implies>;
47
48 def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
49   "EnablePromoteAlloca",
50   "true",
51   "Enable promote alloca pass"
52 >;
53