13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_RISCV_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_RISCV_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/Support/RISCVISAInfo.h"
20#include "llvm/TargetParser/Triple.h"
30 std::unique_ptr<llvm::RISCVISAInfo>
ISAInfo;
47 bool setCPU(
const std::string &Name)
override {
92 const std::vector<std::string> &FeaturesVec)
const override;
94 std::optional<std::pair<unsigned, unsigned>>
97 bool hasFeature(StringRef Feature)
const override;
117 IntPtrType = SignedInt;
118 PtrDiffType = SignedInt;
119 SizeType = UnsignedInt;
120 resetDataLayout(
"e-m:e-p:32:32-i64:64-n32-S128");
123 bool setABI(
const std::string &Name)
override {
124 if (Name ==
"ilp32" || Name ==
"ilp32f" || Name ==
"ilp32d") {
132 MaxAtomicPromoteWidth = 128;
134 if (ISAInfo->hasExtension(
"a"))
135 MaxAtomicInlineWidth = 32;
142 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
143 IntMaxType = Int64Type = SignedLong;
144 resetDataLayout(
"e-m:e-p:64:64-i64:64-i128:128-n32:64-S128");
147 bool setABI(
const std::string &Name)
override {
148 if (Name ==
"lp64" || Name ==
"lp64f" || Name ==
"lp64d") {
156 MaxAtomicPromoteWidth = 128;
158 if (ISAInfo->hasExtension(
"a"))
159 MaxAtomicInlineWidth = 64;
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.
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Options for controlling the target.
RISCV32TargetInfo(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.
RISCV64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
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.
RISCVTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
std::string convertConstraint(const char *&Constraint) const override
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods -----------------------—===//
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeaturesVec) const override
Initialize the map with the default set of target features for the CPU this should include all legal ...
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
std::unique_ptr< llvm::RISCVISAInfo > ISAInfo
void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values for tuning CPU.
bool isValidTuneCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name for
std::optional< std::pair< unsigned, unsigned > > getVScaleRange(const LangOptions &LangOpts) const override
Returns target-specific min and max values VScale_Range.
ArrayRef< const char * > getGCCRegNames() const override
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
StringRef getABI() const override
Get the ABI currently in use.
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Perform initialization based on the user configured set of features.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
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 hasFeature(StringRef Feature) const override
Return true if has this feature, need to sync with handleTargetFeatures.
bool useFP16ConversionIntrinsics() const override
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
bool isValidCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name.
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.
Defines the clang::TargetInfo interface.
unsigned short SuitableAlign
const llvm::fltSemantics * LongDoubleFormat
unsigned char LongDoubleAlign
unsigned char LongDoubleWidth