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"
35 LongDoubleWidth = 128;
36 LongDoubleAlign = 128;
37 LongDoubleFormat = &llvm::APFloat::IEEEquad();
39 WCharType = SignedInt;
40 WIntType = UnsignedInt;
43 StringRef
getABI()
const override {
return ABI; }
51 return TargetInfo::VoidPtrBuiltinVaList;
68 bool validateAsmConstraint(
const char *&Name,
70 std::string convertConstraint(
const char *&Constraint)
const override;
74 bool handleTargetFeatures(std::vector<std::string> &Features,
80 const std::vector<std::string> &FeaturesVec)
const override;
82 bool hasFeature(StringRef Feature)
const override;
90 IntPtrType = SignedInt;
91 PtrDiffType = SignedInt;
92 SizeType = UnsignedInt;
93 resetDataLayout(
"e-m:e-p:32:32-i64:64-n32-S128");
98 bool setABI(
const std::string &Name)
override {
99 if (Name ==
"ilp32d" || Name ==
"ilp32f" || Name ==
"ilp32s") {
106 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
115 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
116 IntMaxType = Int64Type = SignedLong;
117 resetDataLayout(
"e-m:e-p:64:64-i64:64-i128:128-n64-S128");
122 bool setABI(
const std::string &Name)
override {
123 if (Name ==
"lp64d" || Name ==
"lp64f" || Name ==
"lp64s") {
130 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.
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.