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;
71 unsigned SoftFloat : 1;
72 unsigned SoftFloatABI : 1;
79 unsigned Unaligned : 1;
81 unsigned HasMatMul : 1;
82 unsigned FPRegsDisabled : 1;
104 void setABIAPCS(
bool IsAAPCS16);
107 void setArchInfo(llvm::ARM::ArchKind Kind);
111 bool isThumb()
const;
112 bool supportsThumb()
const;
113 bool supportsThumb2()
const;
115 bool hasMVEFloat()
const;
118 StringRef getCPUAttr()
const;
119 StringRef getCPUProfile()
const;
124 StringRef getABI()
const override;
125 bool setABI(
const std::string &Name)
override;
127 bool isBranchProtectionSupportedArch(StringRef Arch)
const override;
128 bool validateBranchProtection(StringRef Spec, StringRef Arch,
130 StringRef &Err)
const override;
136 const std::vector<std::string> &FeaturesVec)
const override;
141 return Feature !=
"soft-float-abi";
144 bool handleTargetFeatures(std::vector<std::string> &Features,
147 bool hasFeature(StringRef Feature)
const override;
149 bool hasBFloat16Type()
const override;
151 bool isValidCPUName(StringRef Name)
const override;
154 bool setCPU(
const std::string &Name)
override;
156 bool setFPMath(StringRef Name)
override;
162 void getTargetDefinesARMV81A(
const LangOptions &Opts,
164 void getTargetDefinesARMV82A(
const LangOptions &Opts,
166 void getTargetDefinesARMV83A(
const LangOptions &Opts,
173 bool isCLZForZeroUndef()
const override;
174 BuiltinVaListKind getBuiltinVaListKind()
const override;
178 bool validateAsmConstraint(
const char *&Name,
180 std::string convertConstraint(
const char *&Constraint)
const override;
182 validateConstraintModifier(StringRef Constraint,
char Modifier,
unsigned Size,
183 std::string &SuggestedModifier)
const override;
184 std::string_view getClobbers()
const override;
191 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
193 int getEHDataRegisterNumber(
unsigned RegNo)
const override;
195 bool hasSjLjLowering()
const override;
218 const llvm::Triple Triple;
223 void getVisualStudioDefines(
const LangOptions &Opts,
226 BuiltinVaListKind getBuiltinVaListKind()
const override;
228 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override;
274 void getOSDefines(
const LangOptions &Opts,
const llvm::Triple &Triple,
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.
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.
CallingConv
CallingConv - Specifies the calling convention that a function uses.