xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUFeatures.td (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
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 FeatureLocalMemorySize0 : SubtargetFeatureLocalMemorySize<0>;
29def FeatureLocalMemorySize32768 : SubtargetFeatureLocalMemorySize<32768>;
30def FeatureLocalMemorySize65536 : SubtargetFeatureLocalMemorySize<65536>;
31
32class SubtargetFeatureWavefrontSize <int ValueLog2> : SubtargetFeature<
33  "wavefrontsize"#!shl(1, ValueLog2),
34  "WavefrontSizeLog2",
35  !cast<string>(ValueLog2),
36  "The number of threads per wavefront"
37>;
38
39def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<4>;
40def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<5>;
41def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<6>;
42
43class SubtargetFeatureGeneration <string Value, string FeatureName,
44                                 string Subtarget,
45                                  list<SubtargetFeature> Implies> :
46        SubtargetFeature <FeatureName, "Gen", Subtarget#"::"#Value,
47                          Value#" GPU generation", Implies>;
48
49def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
50  "EnablePromoteAlloca",
51  "true",
52  "Enable promote alloca pass"
53>;
54
55