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"
39 HasFeatureLSX =
false;
40 HasFeatureLASX =
false;
41 HasFeatureFrecipe =
false;
42 LongDoubleWidth = 128;
43 LongDoubleAlign = 128;
44 LongDoubleFormat = &llvm::APFloat::IEEEquad();
45 MCountName =
"_mcount";
47 WCharType = SignedInt;
48 WIntType = UnsignedInt;
51 bool setCPU(
const std::string &Name)
override {
52 if (!isValidCPUName(Name))
58 StringRef
getCPU()
const {
return CPU; }
60 StringRef
getABI()
const override {
return ABI; }
68 return TargetInfo::VoidPtrBuiltinVaList;
85 bool validateAsmConstraint(
const char *&Name,
87 std::string convertConstraint(
const char *&Constraint)
const override;
91 bool handleTargetFeatures(std::vector<std::string> &Features,
97 const std::vector<std::string> &FeaturesVec)
const override;
99 bool hasFeature(StringRef Feature)
const override;
101 bool isValidCPUName(StringRef Name)
const override;
110 IntPtrType = SignedInt;
111 PtrDiffType = SignedInt;
112 SizeType = UnsignedInt;
113 resetDataLayout(
"e-m:e-p:32:32-i64:64-n32-S128");
118 bool setABI(
const std::string &Name)
override {
119 if (Name ==
"ilp32d" || Name ==
"ilp32f" || Name ==
"ilp32s") {
126 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
135 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
136 IntMaxType = Int64Type = SignedLong;
137 HasUnalignedAccess =
true;
138 resetDataLayout(
"e-m:e-p:64:64-i64:64-i128:128-n32:64-S128");
143 bool setABI(
const std::string &Name)
override {
144 if (Name ==
"lp64d" || Name ==
"lp64f" || Name ==
"lp64s") {
151 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.