13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_LOONGARCH_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_LOONGARCH_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
43 HasFeatureLSX =
false;
44 HasFeatureLASX =
false;
45 HasFeatureFrecipe =
false;
46 HasFeatureLAM_BH =
false;
47 HasFeatureLAMCAS =
false;
48 HasFeatureLD_SEQ_SA =
false;
49 HasFeatureDiv32 =
false;
50 LongDoubleWidth = 128;
51 LongDoubleAlign = 128;
52 LongDoubleFormat = &llvm::APFloat::IEEEquad();
53 MCountName =
"_mcount";
55 WCharType = SignedInt;
56 WIntType = UnsignedInt;
59 bool setCPU(
const std::string &Name)
override {
60 if (!isValidCPUName(Name))
66 StringRef
getCPU()
const {
return CPU; }
68 StringRef
getABI()
const override {
return ABI; }
76 return TargetInfo::VoidPtrBuiltinVaList;
93 bool validateAsmConstraint(
const char *&Name,
95 std::string convertConstraint(
const char *&Constraint)
const override;
99 bool handleTargetFeatures(std::vector<std::string> &Features,
105 const std::vector<std::string> &FeaturesVec)
const override;
107 bool hasFeature(StringRef Feature)
const override;
109 bool isValidCPUName(StringRef Name)
const override;
118 IntPtrType = SignedInt;
119 PtrDiffType = SignedInt;
120 SizeType = UnsignedInt;
121 resetDataLayout(
"e-m:e-p:32:32-i64:64-n32-S128");
126 bool setABI(
const std::string &Name)
override {
127 if (Name ==
"ilp32d" || Name ==
"ilp32f" || Name ==
"ilp32s") {
134 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
143 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
144 IntMaxType = Int64Type = SignedLong;
145 HasUnalignedAccess =
true;
146 resetDataLayout(
"e-m:e-p:64:64-i64:64-i128:128-n32:64-S128");
151 bool setABI(
const std::string &Name)
override {
152 if (Name ==
"lp64d" || Name ==
"lp64f" || Name ==
"lp64s") {
159 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
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.
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Options for controlling the target.
LoongArch32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
bool setABI(const std::string &Name) override
Use the specified ABI.
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
bool setABI(const std::string &Name) override
Use the specified ABI.
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
LoongArch64TargetInfo(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.
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 setCPU(const std::string &Name) override
Target the specified CPU.
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
LoongArchTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.