LLVM 17.0.0git
TargetParser.h
Go to the documentation of this file.
1//===-- TargetParser - Parser for target features ---------------*- C++ -*-===//
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// This file implements a target parser to recognise hardware features such as
10// FPU/CPU/ARCH names as well as specific support such as HDIV, etc.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TARGETPARSER_TARGETPARSER_H
15#define LLVM_TARGETPARSER_TARGETPARSER_H
16
17#include "llvm/ADT/StringRef.h"
18
19namespace llvm {
20
21template <typename T> class SmallVectorImpl;
22class Triple;
23
24// Target specific information in their own namespaces.
25// (ARM/AArch64/X86 are declared in ARM/AArch64/X86TargetParser.h)
26// These should be generated from TableGen because the information is already
27// there, and there is where new information about targets will be added.
28// FIXME: To TableGen this we need to make some table generated files available
29// even if the back-end is not compiled with LLVM, plus we need to create a new
30// back-end to TableGen to create these clean tables.
31namespace AMDGPU {
32
33/// GPU kinds supported by the AMDGPU target.
35 // Not specified processor.
37
38 // R600-based processors.
50 GK_SUMO = 12,
55
58
59 // AMDGCN-based processors.
63
70
76
86
98
103
106};
107
108/// Instruction set architecture version.
110 unsigned Major;
111 unsigned Minor;
112 unsigned Stepping;
113};
114
115// This isn't comprehensive for now, just things that are needed from the
116// frontend driver.
119
120 // These features only exist for r600, and are implied true for amdgcn.
121 FEATURE_FMA = 1 << 1,
123 FEATURE_FP64 = 1 << 3,
124
125 // Common features.
128
129 // Wavefront 32 is available.
131
132 // Xnack is available.
134
135 // Sram-ecc is available.
137};
138
144unsigned getArchAttrAMDGCN(GPUKind AK);
145unsigned getArchAttrR600(GPUKind AK);
146
149
150IsaVersion getIsaVersion(StringRef GPU);
151
152} // namespace AMDGPU
153} // namespace llvm
154
155#endif
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:577
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
StringRef getArchNameR600(GPUKind AK)
GPUKind
GPU kinds supported by the AMDGPU target.
Definition: TargetParser.h:34
StringRef getCanonicalArchName(const Triple &T, StringRef Arch)
void fillValidArchListR600(SmallVectorImpl< StringRef > &Values)
IsaVersion getIsaVersion(StringRef GPU)
void fillValidArchListAMDGCN(SmallVectorImpl< StringRef > &Values)
GPUKind parseArchAMDGCN(StringRef CPU)
@ FEATURE_FAST_DENORMAL_F32
Definition: TargetParser.h:127
StringRef getArchNameAMDGCN(GPUKind AK)
unsigned getArchAttrAMDGCN(GPUKind AK)
unsigned getArchAttrR600(GPUKind AK)
GPUKind parseArchR600(StringRef CPU)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Instruction set architecture version.
Definition: TargetParser.h:109