9#ifndef LLVM_SUPPORT_RISCVISAINFO_H
10#define LLVM_SUPPORT_RISCVISAINFO_H
44 typedef std::map<std::string, RISCVExtensionInfo, ExtensionComparator>
48 : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0), Exts(Exts) {}
57 bool ExperimentalExtensionVersionCheck =
true,
58 bool IgnoreUnknown =
false);
68 parseFeatures(
unsigned XLen,
const std::vector<std::string> &Features);
71 void toFeatures(std::vector<StringRef> &Features,
73 bool AddAllExtensions)
const;
77 unsigned getXLen()
const {
return XLen; };
78 unsigned getFLen()
const {
return FLen; };
93 unsigned MinorVersion);
100 : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0) {}
105 unsigned MaxELen, MaxELenFp;
109 void addExtension(StringRef ExtName,
unsigned MajorVersion,
110 unsigned MinorVersion);
112 Error checkDependency();
114 void updateImplication();
115 void updateCombination();
117 void updateMinVLen();
118 void updateMaxELen();
This file defines the StringMap class.
Tagged union holding either a T or a Error.
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
std::map< std::string, RISCVExtensionInfo, ExtensionComparator > OrderedExtensionMap
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > postProcessAndChecking(std::unique_ptr< RISCVISAInfo > &&ISAInfo)
std::vector< std::string > toFeatureVector() const
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
void toFeatures(std::vector< StringRef > &Features, llvm::function_ref< StringRef(const Twine &)> StrAlloc, bool AddAllExtensions) const
Convert RISC-V ISA info to a feature vector.
RISCVISAInfo(unsigned XLen, OrderedExtensionMap &Exts)
const OrderedExtensionMap & getExtensions() const
unsigned getMaxELenFp() const
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)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An efficient, type-erasing, non-owning reference to a callable.
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