Go to the documentation of this file.
9 #ifndef LLVM_SUPPORT_RISCVISAINFO_H
10 #define LLVM_SUPPORT_RISCVISAINFO_H
42 typedef std::map<std::string, RISCVExtensionInfo, ExtensionComparator>
46 : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0), Exts(Exts) {}
51 bool ExperimentalExtensionVersionCheck =
true,
52 bool IgnoreUnknown =
false);
56 parseFeatures(
unsigned XLen,
const std::vector<std::string> &Features);
59 void toFeatures(std::vector<StringRef> &Features,
61 bool AddAllExtensions)
const;
65 unsigned getXLen()
const {
return XLen; };
66 unsigned getFLen()
const {
return FLen; };
80 unsigned MinorVersion);
86 : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0) {}
91 unsigned MaxELen, MaxELenFp;
95 void addExtension(StringRef ExtName,
unsigned MajorVersion,
96 unsigned MinorVersion);
98 Error checkDependency();
100 void updateImplication();
101 void updateCombination();
103 void updateMinVLen();
104 void updateMaxELen();
bool hasExtension(StringRef Ext) const
This is an optimization pass for GlobalISel generic memory operations.
static bool compareExtension(const std::string &LHS, const std::string &RHS)
StringRef computeDefaultABI() const
unsigned getMaxVLen() const
RISCVISAInfo(unsigned XLen, OrderedExtensionMap &Exts)
static bool isSupportedExtension(StringRef Ext)
Tagged union holding either a T or a Error.
std::vector< std::string > toFeatureVector() const
const OrderedExtensionMap & getExtensions() const
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatures(unsigned XLen, const std::vector< std::string > &Features)
Parse RISCV ISA info from feature vector.
std::string toString() const
An efficient, type-erasing, non-owning reference to a callable.
unsigned getMinVLen() const
Helper class for OrderedExtensionMap.
bool operator()(const std::string &LHS, const std::string &RHS) const
unsigned getMaxELenFp() const
StringRef - Represent a constant reference to a string, i.e.
std::map< std::string, RISCVExtensionInfo, ExtensionComparator > OrderedExtensionMap
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
RISCVISAInfo(const RISCVISAInfo &)=delete
RISCVISAInfo & operator=(const RISCVISAInfo &)=delete
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > postProcessAndChecking(std::unique_ptr< RISCVISAInfo > &&ISAInfo)
unsigned getMaxELen() const
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseArchString(StringRef Arch, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck=true, bool IgnoreUnknown=false)
Parse RISCV ISA info from arch string.
static bool isSupportedExtensionFeature(StringRef Ext)
void toFeatures(std::vector< StringRef > &Features, llvm::function_ref< StringRef(const Twine &)> StrAlloc, bool AddAllExtensions) const
Convert RISCV ISA info to a feature vector.