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"
37 static const char *
const GCCRegNames[];
45 unsigned FPU = FPUMode;
52 bool HasFullFP16 =
false;
53 bool HasDotProd =
false;
54 bool HasFP16FML =
false;
56 bool HasPAuth =
false;
58 bool HasRandGen =
false;
59 bool HasMatMul =
false;
60 bool HasBFloat16 =
false;
62 bool HasSVE2p1 =
false;
63 bool HasSVEAES =
false;
64 bool HasSVE2SHA3 =
false;
65 bool HasSVE2SM4 =
false;
66 bool HasSVEB16B16 =
false;
67 bool HasSVEBitPerm =
false;
68 bool HasMatmulFP64 =
false;
69 bool HasMatmulFP32 =
false;
71 bool HasFlagM =
false;
72 bool HasAlternativeNZCV =
false;
80 bool HasFRInt3264 =
false;
83 bool HasSMEF64F64 =
false;
84 bool HasSMEI16I64 =
false;
85 bool HasSMEF16F16 =
false;
86 bool HasSMEB16B16 =
false;
87 bool HasSME2p1 =
false;
89 bool HasFP8FMA =
false;
90 bool HasFP8DOT2 =
false;
91 bool HasFP8DOT4 =
false;
92 bool HasSSVE_FP8DOT2 =
false;
93 bool HasSSVE_FP8DOT4 =
false;
94 bool HasSSVE_FP8FMA =
false;
95 bool HasSME_F8F32 =
false;
96 bool HasSME_F8F16 =
false;
98 bool HasPredRes =
false;
101 bool HasWFxT =
false;
102 bool HasJSCVT =
false;
103 bool HasFCMA =
false;
104 bool HasNoFP =
false;
105 bool HasNoNeon =
false;
106 bool HasNoSVE =
false;
109 bool HasRCPC3 =
false;
110 bool HasSMEFA64 =
false;
111 bool HasPAuthLR =
false;
112 bool HasFPRCVT =
false;
113 bool HasF8F16MM =
false;
114 bool HasF8F32MM =
false;
115 bool HasSVE_F16F32MM =
false;
116 bool HasSVE_BFSCALE =
false;
117 bool HasSVE_AES2 =
false;
118 bool HasSSVE_AES =
false;
119 bool HasSVE2p2 =
false;
120 bool HasSME2p2 =
false;
121 bool HasSVE2p3 =
false;
122 bool HasSME2p3 =
false;
123 bool HasSVE_B16MM =
false;
124 bool HasF16MM =
false;
125 bool HasF16F32DOT =
false;
126 bool HasF16F32MM =
false;
128 const llvm::AArch64::ArchInfo *ArchInfo = &llvm::AArch64::ARMV8A;
132 void computeFeatureLookup();
140 StringRef
getABI()
const override;
141 bool setABI(
const std::string &Name)
override;
146 StringRef &Err)
const override;
150 bool setCPU(StringRef Name)
override;
193 std::optional<std::pair<unsigned, unsigned>>
195 llvm::StringMap<bool> *FeatureMap =
nullptr)
const override;
200 bool Enabled)
const override;
208 bool hasBFloat16Type()
const override;
210 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
212 bool isCLZForZeroUndef()
const override;
214 BuiltinVaListKind getBuiltinVaListKind()
const override;
219 std::string convertConstraint(
const char *&Constraint)
const override;
221 bool validateAsmConstraint(
const char *&Name,
224 validateConstraintModifier(StringRef Constraint,
char Modifier,
unsigned Size,
225 std::string &SuggestedModifier)
const override;
226 std::string_view getClobbers()
const override;
233 int getEHDataRegisterNumber(
unsigned RegNo)
const override;
235 bool validatePointerAuthKey(
const llvm::APSInt &value)
const override;
240 return std::make_pair(256, 64);
243 bool hasInt128Type()
const override;
249 bool validateGlobalRegisterVariable(StringRef RegName,
unsigned RegSize,
250 bool &HasSizeMismatch)
const override;
276 if (Name ==
"pauthtest") {
285 const llvm::Triple Triple;
309 bool HasNonWeakDef)
const override;
327 const llvm::Triple &Triple);
338 return std::make_pair(128, 64);
342 void getOSDefines(
const LangOptions &Opts,
const llvm::Triple &Triple,
357 return std::make_pair(128, 64);
361 void getOSDefines(
const LangOptions &Opts,
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.
The type of a lookup table which maps from language-specific address spaces to target-specific ones.
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...
void getTargetDefinesARMV95A(const LangOptions &Opts, MacroBuilder &Builder) const
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.
ParsedTargetAttr parseTargetAttr(StringRef Str) const override
void getTargetDefinesARMV96A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV97A(const LangOptions &Opts, MacroBuilder &Builder) const
AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
const char * getBFloat16Mangling() const override
Return the mangled code of bfloat.
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Perform initialization based on the user configured set of features (e.g., +sse4).
bool checkArithmeticFenceSupported() const override
Controls if __arithmetic_fence is supported in the targeted backend.
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
void setFeatureEnabled(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const override
Enable or disable a specific target feature; the feature name must be valid.
llvm::SmallVector< Builtin::InfosShard > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
bool setCPU(StringRef Name) override
Target the specified CPU.
void getTargetDefinesARMV89A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV92A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV93A(const LangOptions &Opts, MacroBuilder &Builder) const
bool setABI(const std::string &Name) override
Use the specified ABI.
void getTargetDefinesARMV84A(const LangOptions &Opts, MacroBuilder &Builder) const
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.
void getTargetDefinesARMV88A(const LangOptions &Opts, MacroBuilder &Builder) const
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
void getTargetDefinesARMV87A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV9A(const LangOptions &Opts, MacroBuilder &Builder) const
bool supportsCpuSupports() const override
void getTargetDefinesARMV91A(const LangOptions &Opts, MacroBuilder &Builder) const
std::optional< std::pair< unsigned, unsigned > > getVScaleRange(const LangOptions &LangOpts, ArmStreamingKind Mode, llvm::StringMap< bool > *FeatureMap=nullptr) const override
Returns target-specific min and max values VScale_Range.
void getTargetDefinesARMV81A(const LangOptions &Opts, MacroBuilder &Builder) const
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
void getTargetDefinesARMV86A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV94A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV82A(const LangOptions &Opts, MacroBuilder &Builder) const
void getTargetDefinesARMV83A(const LangOptions &Opts, MacroBuilder &Builder) const
bool validateCpuSupports(StringRef FeatureStr) const override
bool doesFeatureAffectCodeGen(StringRef Name) const override
Returns true if feature has an impact on target code generation.
void getTargetDefinesARMV85A(const LangOptions &Opts, MacroBuilder &Builder) const
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 -----------------------—===//
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...
AppleMachOAArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
AppleMachOTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
DarwinAArch64TargetInfo(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.
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...
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 constexpr LangASMap 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