9#ifndef LLVM_SUPPORT_RISCVISAINFO_H
10#define LLVM_SUPPORT_RISCVISAINFO_H
45 typedef std::map<std::string, ExtensionVersion, ExtensionComparator>
49 : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0), Exts(Exts) {}
58 bool ExperimentalExtensionVersionCheck =
true,
59 bool IgnoreUnknown =
false);
69 parseFeatures(
unsigned XLen,
const std::vector<std::string> &Features);
72 std::vector<std::string>
toFeatures(
bool AddAllExtensions =
false,
73 bool IgnoreUnknown =
true)
const;
92 unsigned MinorVersion);
99 : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0) {}
104 unsigned MaxELen, MaxELenFp;
108 void addExtension(StringRef ExtName, ExtensionVersion Version);
110 Error checkDependency();
112 void updateImplication();
113 void updateCombination();
115 void updateMinVLen();
116 void updateMaxELen();
This file defines the StringMap class.
Tagged union holding either a T or a Error.
std::map< std::string, ExtensionVersion, ExtensionComparator > OrderedExtensionMap
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
static bool isSupportedExtensionFeature(StringRef Ext)
RISCVISAInfo & operator=(const RISCVISAInfo &)=delete
static std::string getTargetFeatureForExtension(StringRef Ext)
unsigned getMinVLen() const
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseNormalizedArchString(StringRef Arch)
Parse RISC-V ISA info from an arch string that is already in normalized form (as defined in the psABI...
bool hasExtension(StringRef Ext) const
RISCVISAInfo(const RISCVISAInfo &)=delete
static bool compareExtension(const std::string &LHS, const std::string &RHS)
std::string toString() const
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > postProcessAndChecking(std::unique_ptr< RISCVISAInfo > &&ISAInfo)
StringRef computeDefaultABI() const
unsigned getMaxVLen() const
static bool isSupportedExtension(StringRef Ext)
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatures(unsigned XLen, const std::vector< std::string > &Features)
Parse RISC-V ISA info from feature vector.
unsigned getMaxELen() const
RISCVISAInfo(unsigned XLen, OrderedExtensionMap &Exts)
const OrderedExtensionMap & getExtensions() const
unsigned getMaxELenFp() const
std::vector< std::string > toFeatures(bool AddAllExtensions=false, bool IgnoreUnknown=true) const
Convert RISC-V ISA info to a feature vector.
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseArchString(StringRef Arch, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck=true, bool IgnoreUnknown=false)
Parse RISC-V ISA info from arch string.
static bool isSupportedExtensionWithVersion(StringRef Ext)
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
void riscvExtensionsHelp(StringMap< StringRef > DescMap)
Helper class for OrderedExtensionMap.
bool operator()(const std::string &LHS, const std::string &RHS) const
Represents the major and version number components of a RISC-V extension.