xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td (revision fe75646a0234a261c0013bf1840fdac4acaf0cec)
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
9def FeatureFP64 : SubtargetFeature<"fp64",
10  "FP64",
11  "true",
12  "Enable double precision operations"
13>;
14
15def FeatureFMA : SubtargetFeature<"fmaf",
16  "FMA",
17  "true",
18  "Enable single precision FMA (not as fast as mul+add, but fused)"
19>;
20
21class SubtargetFeatureLocalMemorySize <int Value> : SubtargetFeature<
22  "localmemorysize"#Value,
23  "LocalMemorySize",
24  !cast<string>(Value),
25  "The size of local memory in bytes"
26>;
27
28def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
29def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
30
31class SubtargetFeatureWavefrontSize <int ValueLog2> : SubtargetFeature<
32  "wavefrontsize"#!shl(1, ValueLog2),
33  "WavefrontSizeLog2",
34  !cast<string>(ValueLog2),
35  "The number of threads per wavefront"
36>;
37
38def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<4>;
39def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<5>;
40def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<6>;
41
42class SubtargetFeatureGeneration <string Value, string FeatureName,
43                                 string Subtarget,
44                                  list<SubtargetFeature> Implies> :
45        SubtargetFeature <FeatureName, "Gen", Subtarget#"::"#Value,
46                          Value#" GPU generation", Implies>;
47
48def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
49  "EnablePromoteAlloca",
50  "true",
51  "Enable promote alloca pass"
52>;
53
54