13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_ARM_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_ARM_H
19#include "llvm/Support/Compiler.h"
20#include "llvm/TargetParser/ARMTargetParser.h"
21#include "llvm/TargetParser/ARMTargetParserCommon.h"
22#include "llvm/TargetParser/Triple.h"
43 enum HWDivMode { HWDivThumb = (1 << 0), HWDivARM = (1 << 1) };
45 static bool FPUModeIsVFP(FPUMode Mode) {
46 return Mode & (VFP2FPU | VFP3FPU | VFP4FPU | NeonFPU | FPARMV8);
50 static const char *
const GCCRegNames[];
57 enum { FP_Default, FP_VFP, FP_Neon } FPMath;
59 llvm::ARM::ISAKind ArchISA;
60 llvm::ARM::ArchKind ArchKind = llvm::ARM::ArchKind::ARMV4T;
61 llvm::ARM::ProfileKind ArchProfile;
64 LLVM_PREFERRED_TYPE(FPUMode)
66 LLVM_PREFERRED_TYPE(MVEMode)
69 LLVM_PREFERRED_TYPE(
bool)
71 LLVM_PREFERRED_TYPE(HWDivMode)
75 LLVM_PREFERRED_TYPE(
bool)
76 unsigned SoftFloat : 1;
77 LLVM_PREFERRED_TYPE(
bool)
78 unsigned SoftFloatABI : 1;
80 LLVM_PREFERRED_TYPE(
bool)
82 LLVM_PREFERRED_TYPE(
bool)
84 LLVM_PREFERRED_TYPE(
bool)
86 LLVM_PREFERRED_TYPE(
bool)
88 LLVM_PREFERRED_TYPE(
bool)
90 LLVM_PREFERRED_TYPE(
bool)
92 LLVM_PREFERRED_TYPE(
bool)
93 unsigned HasMatMul : 1;
94 LLVM_PREFERRED_TYPE(
bool)
95 unsigned FPRegsDisabled : 1;
96 LLVM_PREFERRED_TYPE(
bool)
98 LLVM_PREFERRED_TYPE(
bool)
121 FEATURE_COPROC_B1 = (1 << 0),
124 FEATURE_COPROC_B2 = (1 << 1),
126 FEATURE_COPROC_B3 = (1 << 2),
128 FEATURE_COPROC_B4 = (1 << 3),
132 void setABIAPCS(
bool IsAAPCS16);
135 void setArchInfo(llvm::ARM::ArchKind
Kind);
139 bool isThumb()
const;
140 bool supportsThumb()
const;
141 bool supportsThumb2()
const;
143 bool hasMVEFloat()
const;
146 StringRef getCPUAttr()
const;
147 StringRef getCPUProfile()
const;
152 StringRef getABI()
const override;
153 bool setABI(
const std::string &Name)
override;
155 bool isBranchProtectionSupportedArch(StringRef Arch)
const override;
156 bool validateBranchProtection(StringRef Spec, StringRef Arch,
158 StringRef &Err)
const override;
164 const std::vector<std::string> &FeaturesVec)
const override;
169 return Feature !=
"soft-float-abi";
172 bool handleTargetFeatures(std::vector<std::string> &Features,
175 bool hasFeature(StringRef Feature)
const override;
177 bool hasBFloat16Type()
const override;
179 bool isValidCPUName(StringRef Name)
const override;
182 bool setCPU(
const std::string &Name)
override;
184 bool setFPMath(StringRef Name)
override;
190 void getTargetDefinesARMV81A(
const LangOptions &Opts,
192 void getTargetDefinesARMV82A(
const LangOptions &Opts,
194 void getTargetDefinesARMV83A(
const LangOptions &Opts,
201 bool isCLZForZeroUndef()
const override;
202 BuiltinVaListKind getBuiltinVaListKind()
const override;
206 bool validateAsmConstraint(
const char *&Name,
208 std::string convertConstraint(
const char *&Constraint)
const override;
210 validateConstraintModifier(StringRef Constraint,
char Modifier,
unsigned Size,
211 std::string &SuggestedModifier)
const override;
212 std::string_view getClobbers()
const override;
219 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
221 int getEHDataRegisterNumber(
unsigned RegNo)
const override;
223 bool hasSjLjLowering()
const override;
230 return std::make_pair(getTriple().isArch64Bit() ? 256 : 64, 64);
250 const llvm::Triple Triple;
255 void getVisualStudioDefines(
const LangOptions &Opts,
258 BuiltinVaListKind getBuiltinVaListKind()
const override;
260 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
306 void getOSDefines(
const LangOptions &Opts,
const llvm::Triple &Triple,
enum clang::sema::@1655::IndirectLocalPathEntry::EntryKind Kind
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.
Defines the clang::TargetOptions class.
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...
Exposes information about the current target.
Options for controlling the 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...
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
const char * getBFloat16Mangling() const override
Return the mangled code of bfloat.
bool isValidFeatureName(StringRef Feature) const override
Determine whether this TargetInfo supports the given feature.
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...
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
CallingConv
CallingConv - Specifies the calling convention that a function uses.