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 21// Addressable local memory size is the maximum number of bytes of LDS that can 22// be allocated to a single workgroup. 23class SubtargetFeatureAddressableLocalMemorySize <int Value> : SubtargetFeature< 24 "addressablelocalmemorysize"#Value, 25 "AddressableLocalMemorySize", 26 !cast<string>(Value), 27 "The size of local memory in bytes" 28>; 29 30def FeatureAddressableLocalMemorySize32768 : SubtargetFeatureAddressableLocalMemorySize<32768>; 31def FeatureAddressableLocalMemorySize65536 : SubtargetFeatureAddressableLocalMemorySize<65536>; 32def FeatureAddressableLocalMemorySize163840 : SubtargetFeatureAddressableLocalMemorySize<163840>; 33 34class SubtargetFeatureWavefrontSize <int ValueLog2> : SubtargetFeature< 35 "wavefrontsize"#!shl(1, ValueLog2), 36 "WavefrontSizeLog2", 37 !cast<string>(ValueLog2), 38 "The number of threads per wavefront" 39>; 40 41def FeatureWavefrontSize16 : SubtargetFeatureWavefrontSize<4>; 42def FeatureWavefrontSize32 : SubtargetFeatureWavefrontSize<5>; 43def FeatureWavefrontSize64 : SubtargetFeatureWavefrontSize<6>; 44 45class SubtargetFeatureGeneration <string Value, string FeatureName, 46 string Subtarget, 47 list<SubtargetFeature> Implies> : 48 SubtargetFeature <FeatureName, "Gen", Subtarget#"::"#Value, 49 Value#" GPU generation", Implies>; 50 51def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca", 52 "EnablePromoteAlloca", 53 "true", 54 "Enable promote alloca pass" 55>; 56 57