13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H
18#include "llvm/TargetParser/AArch64TargetParser.h"
57 virtual void setDataLayout() = 0;
59 static const char *
const GCCRegNames[];
67 unsigned FPU = FPUMode;
74 bool HasFullFP16 =
false;
75 bool HasDotProd =
false;
76 bool HasFP16FML =
false;
79 bool HasPAuth =
false;
81 bool HasRandGen =
false;
82 bool HasMatMul =
false;
83 bool HasBFloat16 =
false;
85 bool HasSVE2p1 =
false;
86 bool HasSVEAES =
false;
87 bool HasSVE2SHA3 =
false;
88 bool HasSVE2SM4 =
false;
89 bool HasSVEB16B16 =
false;
90 bool HasSVEBitPerm =
false;
91 bool HasMatmulFP64 =
false;
92 bool HasMatmulFP32 =
false;
94 bool HasFlagM =
false;
95 bool HasAlternativeNZCV =
false;
101 bool HasCCPP =
false;
102 bool HasCCDP =
false;
103 bool HasFRInt3264 =
false;
105 bool HasSME2 =
false;
106 bool HasSMEF64F64 =
false;
107 bool HasSMEI16I64 =
false;
108 bool HasSMEF16F16 =
false;
109 bool HasSMEB16B16 =
false;
110 bool HasSME2p1 =
false;
112 bool HasFP8FMA =
false;
113 bool HasFP8DOT2 =
false;
114 bool HasFP8DOT4 =
false;
115 bool HasSSVE_FP8DOT2 =
false;
116 bool HasSSVE_FP8DOT4 =
false;
117 bool HasSSVE_FP8FMA =
false;
118 bool HasSME_F8F32 =
false;
119 bool HasSME_F8F16 =
false;
121 bool HasPredRes =
false;
122 bool HasSSBS =
false;
124 bool HasWFxT =
false;
125 bool HasJSCVT =
false;
126 bool HasFCMA =
false;
127 bool HasNoFP =
false;
128 bool HasNoNeon =
false;
129 bool HasNoSVE =
false;
132 bool HasRCPC3 =
false;
133 bool HasSMEFA64 =
false;
134 bool HasPAuthLR =
false;
136 const llvm::AArch64::ArchInfo *ArchInfo = &llvm::AArch64::ARMV8A;
144 StringRef
getABI()
const override;
145 bool setABI(
const std::string &Name)
override;
150 StringRef &Err)
const override;
154 bool setCPU(
const std::string &Name)
override;
162 void getTargetDefinesARMV81A(
const LangOptions &Opts,
164 void getTargetDefinesARMV82A(
const LangOptions &Opts,
166 void getTargetDefinesARMV83A(
const LangOptions &Opts,
168 void getTargetDefinesARMV84A(
const LangOptions &Opts,
170 void getTargetDefinesARMV85A(
const LangOptions &Opts,
172 void getTargetDefinesARMV86A(
const LangOptions &Opts,
174 void getTargetDefinesARMV87A(
const LangOptions &Opts,
176 void getTargetDefinesARMV88A(
const LangOptions &Opts,
178 void getTargetDefinesARMV89A(
const LangOptions &Opts,
180 void getTargetDefinesARMV9A(
const LangOptions &Opts,
182 void getTargetDefinesARMV91A(
const LangOptions &Opts,
184 void getTargetDefinesARMV92A(
const LangOptions &Opts,
186 void getTargetDefinesARMV93A(
const LangOptions &Opts,
188 void getTargetDefinesARMV94A(
const LangOptions &Opts,
190 void getTargetDefinesARMV95A(
const LangOptions &Opts,
192 void getTargetDefinesARMV96A(
const LangOptions &Opts,
194 void getTargetDefinesARMV97A(
const LangOptions &Opts,
201 std::optional<std::pair<unsigned, unsigned>>
202 getVScaleRange(
const LangOptions &LangOpts, ArmStreamingKind Mode,
203 llvm::StringMap<bool> *FeatureMap =
nullptr)
const override;
204 bool doesFeatureAffectCodeGen(StringRef Name)
const override;
205 bool validateCpuSupports(StringRef FeatureStr)
const override;
207 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
208 bool Enabled)
const override;
209 bool handleTargetFeatures(std::vector<std::string> &Features,
216 bool hasBFloat16Type()
const override;
218 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
220 bool isCLZForZeroUndef()
const override;
222 BuiltinVaListKind getBuiltinVaListKind()
const override;
227 std::string convertConstraint(
const char *&Constraint)
const override;
229 bool validateAsmConstraint(
const char *&Name,
232 validateConstraintModifier(StringRef Constraint,
char Modifier,
unsigned Size,
233 std::string &SuggestedModifier)
const override;
234 std::string_view getClobbers()
const override;
241 int getEHDataRegisterNumber(
unsigned RegNo)
const override;
243 bool validatePointerAuthKey(
const llvm::APSInt &value)
const override;
248 return std::make_pair(256, 64);
251 bool hasInt128Type()
const override;
257 bool validateGlobalRegisterVariable(StringRef RegName,
unsigned RegSize,
258 bool &HasSizeMismatch)
const override;
280 void setDataLayout()
override;
286 if (Name ==
"pauthtest") {
295 const llvm::Triple Triple;
321 bool HasNonWeakDef)
const override;
338 void setDataLayout()
override;
342 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 llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
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)
void setDataLayout() override
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)
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