13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H
18#include "llvm/ADT/DenseSet.h"
19#include "llvm/TargetParser/AArch64TargetParser.h"
62 static const char *
const GCCRegNames[];
70 unsigned FPU = FPUMode;
77 bool HasFullFP16 =
false;
78 bool HasDotProd =
false;
79 bool HasFP16FML =
false;
81 bool HasPAuth =
false;
83 bool HasRandGen =
false;
84 bool HasMatMul =
false;
85 bool HasBFloat16 =
false;
87 bool HasSVE2p1 =
false;
88 bool HasSVEAES =
false;
89 bool HasSVE2SHA3 =
false;
90 bool HasSVE2SM4 =
false;
91 bool HasSVEB16B16 =
false;
92 bool HasSVEBitPerm =
false;
93 bool HasMatmulFP64 =
false;
94 bool HasMatmulFP32 =
false;
96 bool HasFlagM =
false;
97 bool HasAlternativeNZCV =
false;
100 bool HasRCPC =
false;
103 bool HasCCPP =
false;
104 bool HasCCDP =
false;
105 bool HasFRInt3264 =
false;
107 bool HasSME2 =
false;
108 bool HasSMEF64F64 =
false;
109 bool HasSMEI16I64 =
false;
110 bool HasSMEF16F16 =
false;
111 bool HasSMEB16B16 =
false;
112 bool HasSME2p1 =
false;
114 bool HasFP8FMA =
false;
115 bool HasFP8DOT2 =
false;
116 bool HasFP8DOT4 =
false;
117 bool HasSSVE_FP8DOT2 =
false;
118 bool HasSSVE_FP8DOT4 =
false;
119 bool HasSSVE_FP8FMA =
false;
120 bool HasSME_F8F32 =
false;
121 bool HasSME_F8F16 =
false;
123 bool HasPredRes =
false;
124 bool HasSSBS =
false;
126 bool HasWFxT =
false;
127 bool HasJSCVT =
false;
128 bool HasFCMA =
false;
129 bool HasNoFP =
false;
130 bool HasNoNeon =
false;
131 bool HasNoSVE =
false;
134 bool HasRCPC3 =
false;
135 bool HasSMEFA64 =
false;
136 bool HasPAuthLR =
false;
137 bool HasFPRCVT =
false;
138 bool HasF8F16MM =
false;
139 bool HasF8F32MM =
false;
140 bool HasSVE_F16F32MM =
false;
141 bool HasSVE_BFSCALE =
false;
142 bool HasSVE_AES2 =
false;
143 bool HasSSVE_AES =
false;
144 bool HasSVE2p2 =
false;
145 bool HasSME2p2 =
false;
147 const llvm::AArch64::ArchInfo *ArchInfo = &llvm::AArch64::ARMV8A;
151 void computeFeatureLookup();
159 StringRef
getABI()
const override;
160 bool setABI(
const std::string &Name)
override;
165 StringRef &Err)
const override;
169 bool setCPU(
const std::string &Name)
override;
177 void getTargetDefinesARMV81A(
const LangOptions &Opts,
179 void getTargetDefinesARMV82A(
const LangOptions &Opts,
181 void getTargetDefinesARMV83A(
const LangOptions &Opts,
183 void getTargetDefinesARMV84A(
const LangOptions &Opts,
185 void getTargetDefinesARMV85A(
const LangOptions &Opts,
187 void getTargetDefinesARMV86A(
const LangOptions &Opts,
189 void getTargetDefinesARMV87A(
const LangOptions &Opts,
191 void getTargetDefinesARMV88A(
const LangOptions &Opts,
193 void getTargetDefinesARMV89A(
const LangOptions &Opts,
195 void getTargetDefinesARMV9A(
const LangOptions &Opts,
197 void getTargetDefinesARMV91A(
const LangOptions &Opts,
199 void getTargetDefinesARMV92A(
const LangOptions &Opts,
201 void getTargetDefinesARMV93A(
const LangOptions &Opts,
203 void getTargetDefinesARMV94A(
const LangOptions &Opts,
205 void getTargetDefinesARMV95A(
const LangOptions &Opts,
207 void getTargetDefinesARMV96A(
const LangOptions &Opts,
209 void getTargetDefinesARMV97A(
const LangOptions &Opts,
216 std::optional<std::pair<unsigned, unsigned>>
217 getVScaleRange(
const LangOptions &LangOpts, ArmStreamingKind Mode,
218 llvm::StringMap<bool> *FeatureMap =
nullptr)
const override;
219 bool doesFeatureAffectCodeGen(StringRef Name)
const override;
220 bool validateCpuSupports(StringRef FeatureStr)
const override;
222 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
223 bool Enabled)
const override;
224 bool handleTargetFeatures(std::vector<std::string> &Features,
231 bool hasBFloat16Type()
const override;
233 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
235 bool isCLZForZeroUndef()
const override;
237 BuiltinVaListKind getBuiltinVaListKind()
const override;
242 std::string convertConstraint(
const char *&Constraint)
const override;
244 bool validateAsmConstraint(
const char *&Name,
247 validateConstraintModifier(StringRef Constraint,
char Modifier,
unsigned Size,
248 std::string &SuggestedModifier)
const override;
249 std::string_view getClobbers()
const override;
256 int getEHDataRegisterNumber(
unsigned RegNo)
const override;
258 bool validatePointerAuthKey(
const llvm::APSInt &value)
const override;
263 return std::make_pair(256, 64);
266 bool hasInt128Type()
const override;
272 bool validateGlobalRegisterVariable(StringRef RegName,
unsigned RegSize,
273 bool &HasSizeMismatch)
const override;
299 if (Name ==
"pauthtest") {
308 const llvm::Triple Triple;
332 bool HasNonWeakDef)
const override;
350 const llvm::Triple &Triple);
static llvm::APInt getFMVPriority(const TargetInfo &TI, const CodeGenFunction::FMVResolverOption &RO)
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Concrete class used by the front-end to report problems and issues.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
virtual bool setABI(const std::string &Name)
Use the specified ABI.
Options for controlling the target.
StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const override
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
bool useFP16ConversionIntrinsics() const override
Check whether conversions to and from __fp16 should go through an integer bitcast with i16.
std::pair< unsigned, unsigned > hardwareInterferenceSizes() const override
The first value in the pair is the minimum offset between two objects to avoid false sharing (destruc...
uint64_t getPointerWidthV(LangAS AddrSpace) const override
bool supportsTargetAttributeTune() const override
Determine whether this TargetInfo supports tune in target attribute.
AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
const char * getBFloat16Mangling() const override
Return the mangled code of bfloat.
bool checkArithmeticFenceSupported() const override
Controls if __arithmetic_fence is supported in the targeted backend.
bool setABI(const std::string &Name) override
Use the specified ABI.
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
StringRef getABI() const override
Get the ABI currently in use.
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
bool supportsCpuSupports() const override
bool validateBranchProtection(StringRef Spec, StringRef Arch, BranchProtectionInfo &BPI, const LangOptions &LO, StringRef &Err) const override
Determine if this TargetInfo supports the given branch protection specification.
uint64_t getPointerAlignV(LangAS AddrSpace) const override
bool setCPU(const std::string &Name) override
Target the specified CPU.
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
AArch64beTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
AArch64leTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
AppleMachOAArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
AppleMachOTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
DarwinAArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
DarwinTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
bool setABI(const std::string &Name) override
unsigned getMinGlobalAlign(uint64_t TypeSize, bool HasNonWeakDef) const override
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
MicrosoftARM64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
TargetInfo::CallingConvKind getCallingConvKind(bool ClangABICompat4) const override
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
MinGWARM64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
WindowsARM64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
WindowsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
void getAppleMachOAArch64Defines(MacroBuilder &Builder, const LangOptions &Opts, const llvm::Triple &Triple)
llvm::SmallDenseSet< StringRef, 32 > AArch64FeatureSet
static const unsigned ARM64AddrSpaceMap[]
The JSON file list parser is used to communicate input to InstallAPI.
LangAS
Defines the address space values used by the address space qualifier of QualType.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Contains information gathered from parsing the contents of TargetAttr.
unsigned char PointerWidth