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"
38 HasFeatureLSX =
false;
39 HasFeatureLASX =
false;
40 LongDoubleWidth = 128;
41 LongDoubleAlign = 128;
42 LongDoubleFormat = &llvm::APFloat::IEEEquad();
43 MCountName =
"_mcount";
45 WCharType = SignedInt;
46 WIntType = UnsignedInt;
49 bool setCPU(
const std::string &Name)
override {
50 if (!isValidCPUName(Name))
56 StringRef
getCPU()
const {
return CPU; }
58 StringRef
getABI()
const override {
return ABI; }
66 return TargetInfo::VoidPtrBuiltinVaList;
83 bool validateAsmConstraint(
const char *&Name,
85 std::string convertConstraint(
const char *&Constraint)
const override;
89 bool handleTargetFeatures(std::vector<std::string> &Features,
95 const std::vector<std::string> &FeaturesVec)
const override;
97 bool hasFeature(StringRef Feature)
const override;
99 bool isValidCPUName(StringRef Name)
const override;
108 IntPtrType = SignedInt;
109 PtrDiffType = SignedInt;
110 SizeType = UnsignedInt;
111 resetDataLayout(
"e-m:e-p:32:32-i64:64-n32-S128");
116 bool setABI(
const std::string &Name)
override {
117 if (Name ==
"ilp32d" || Name ==
"ilp32f" || Name ==
"ilp32s") {
124 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
133 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
134 IntMaxType = Int64Type = SignedLong;
135 HasUnalignedAccess =
true;
136 resetDataLayout(
"e-m:e-p:64:64-i64:64-i128:128-n64-S128");
141 bool setABI(
const std::string &Name)
override {
142 if (Name ==
"lp64d" || Name ==
"lp64f" || Name ==
"lp64s") {
149 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.