LLVM 18.0.0git
|
#include "llvm/Support/RISCVISAInfo.h"
Classes | |
struct | ExtensionComparator |
Helper class for OrderedExtensionMap. More... | |
Public Types | |
typedef std::map< std::string, RISCVExtensionInfo, ExtensionComparator > | OrderedExtensionMap |
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension. | |
Public Member Functions | |
RISCVISAInfo (const RISCVISAInfo &)=delete | |
RISCVISAInfo & | operator= (const RISCVISAInfo &)=delete |
RISCVISAInfo (unsigned XLen, OrderedExtensionMap &Exts) | |
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. | |
const OrderedExtensionMap & | getExtensions () const |
unsigned | getXLen () const |
unsigned | getFLen () const |
unsigned | getMinVLen () const |
unsigned | getMaxVLen () const |
unsigned | getMaxELen () const |
unsigned | getMaxELenFp () const |
bool | hasExtension (StringRef Ext) const |
std::string | toString () const |
std::vector< std::string > | toFeatureVector () const |
StringRef | computeDefaultABI () const |
Static Public Member Functions | |
static bool | compareExtension (const std::string &LHS, const std::string &RHS) |
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 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). | |
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > | parseFeatures (unsigned XLen, const std::vector< std::string > &Features) |
Parse RISC-V ISA info from feature vector. | |
static bool | isSupportedExtensionFeature (StringRef Ext) |
static bool | isSupportedExtension (StringRef Ext) |
static bool | isSupportedExtensionWithVersion (StringRef Ext) |
static bool | isSupportedExtension (StringRef Ext, unsigned MajorVersion, unsigned MinorVersion) |
static llvm::Expected< std::unique_ptr< RISCVISAInfo > > | postProcessAndChecking (std::unique_ptr< RISCVISAInfo > &&ISAInfo) |
static std::string | getTargetFeatureForExtension (StringRef Ext) |
Definition at line 28 of file RISCVISAInfo.h.
typedef std::map<std::string, RISCVExtensionInfo, ExtensionComparator> llvm::RISCVISAInfo::OrderedExtensionMap |
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
Definition at line 45 of file RISCVISAInfo.h.
|
delete |
|
inline |
Definition at line 47 of file RISCVISAInfo.h.
Definition at line 450 of file RISCVISAInfo.cpp.
References getExtensionRank(), LHS, and RHS.
Referenced by llvm::RISCVISAInfo::ExtensionComparator::operator()().
StringRef RISCVISAInfo::computeDefaultABI | ( | ) | const |
Definition at line 1291 of file RISCVISAInfo.cpp.
References hasExtension(), and llvm_unreachable.
|
inline |
Definition at line 75 of file RISCVISAInfo.h.
|
inline |
Definition at line 78 of file RISCVISAInfo.h.
|
inline |
Definition at line 81 of file RISCVISAInfo.h.
|
inline |
Definition at line 82 of file RISCVISAInfo.h.
|
inline |
Definition at line 80 of file RISCVISAInfo.h.
|
inline |
Definition at line 79 of file RISCVISAInfo.h.
|
static |
Definition at line 1328 of file RISCVISAInfo.cpp.
References findLastNonVersionCharacter(), isExperimentalExtension(), isSupportedExtension(), isSupportedExtensionWithVersion(), and Name.
|
inline |
Definition at line 77 of file RISCVISAInfo.h.
Definition at line 382 of file RISCVISAInfo.cpp.
References isSupportedExtension(), and stripExperimentalPrefix().
Referenced by computeDefaultABI().
Definition at line 355 of file RISCVISAInfo.cpp.
References I, llvm::lower_bound(), SupportedExperimentalExtensions, SupportedExtensions, and verifyTables().
Referenced by getExtensionVersion(), getTargetFeatureForExtension(), hasExtension(), parseArchString(), and toFeatureVector().
|
static |
Definition at line 368 of file RISCVISAInfo.cpp.
References E, I, SupportedExperimentalExtensions, and SupportedExtensions.
Definition at line 344 of file RISCVISAInfo.cpp.
References llvm::ArrayRef< T >::end(), I, llvm::lower_bound(), stripExperimentalPrefix(), SupportedExperimentalExtensions, and SupportedExtensions.
Referenced by llvm::RISCVFeatures::parseFeatureBits().
Definition at line 1308 of file RISCVISAInfo.cpp.
References llvm::consumeError(), E, llvm::StringRef::empty(), findLastNonVersionCharacter(), getExtensionVersion(), and Name.
Referenced by getTargetFeatureForExtension().
|
delete |
|
static |
Parse RISC-V ISA info from arch string.
If IgnoreUnknown is set, any unrecognised extension names or extensions with unrecognised versions will be silently dropped, except for the special case of the base 'i' and 'e' extensions, where the default version will be used (as ignoring the base is not possible).
Definition at line 699 of file RISCVISAInfo.cpp.
References AllStdExts, llvm::any_of(), llvm::StringRef::back(), llvm::StringRef::begin(), llvm::CallingConv::C, llvm::StringRef::consume_front(), llvm::consumeError(), llvm::StringRef::contains(), llvm::createStringError(), llvm::StringRef::drop_front(), E, llvm::StringRef::end(), llvm::StringRef::find_first_of(), findDefaultVersion(), findLastNonVersionCharacter(), getExtensionType(), getExtensionTypeDesc(), getExtensionVersion(), I, llvm::invalid_argument, llvm::is_contained(), isDigit(), isSupportedExtension(), llvm_unreachable, Name, llvm::StringRef::npos, postProcessAndChecking(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), RISCVGImplications, llvm::StringRef::size(), llvm::StringRef::split(), llvm::StringRef::starts_with(), and llvm::StringRef::substr().
|
static |
Parse RISC-V ISA info from feature vector.
Definition at line 603 of file RISCVISAInfo.cpp.
References llvm::Add, assert(), llvm::StringRef::drop_front(), llvm::lower_bound(), postProcessAndChecking(), llvm::StringRef::size(), llvm::StringRef::str(), stripExperimentalPrefix(), SupportedExperimentalExtensions, and SupportedExtensions.
Referenced by llvm::RISCVFeatures::parseFeatureBits().
|
static |
Parse RISC-V ISA info from an arch string that is already in normalized form (as defined in the psABI).
Unlike parseArchString, this function will not error for unrecognized extension names or extension versions.
Definition at line 638 of file RISCVISAInfo.cpp.
References llvm::any_of(), llvm::StringRef::back(), llvm::createStringError(), llvm::StringRef::drop_back(), llvm::StringRef::empty(), llvm::StringRef::getAsInteger(), llvm::invalid_argument, isDigit(), llvm::StringRef::split(), llvm::StringRef::starts_with(), and llvm::StringRef::substr().
|
static |
Definition at line 1279 of file RISCVISAInfo.cpp.
Referenced by parseArchString(), and parseFeatures().
void RISCVISAInfo::toFeatures | ( | std::vector< StringRef > & | Features, |
llvm::function_ref< StringRef(const Twine &)> | StrAlloc, | ||
bool | AddAllExtensions | ||
) | const |
Convert RISC-V ISA info to a feature vector.
Definition at line 463 of file RISCVISAInfo.cpp.
References isExperimentalExtension(), SupportedExperimentalExtensions, and SupportedExtensions.
std::vector< std::string > RISCVISAInfo::toFeatureVector | ( | ) | const |
Definition at line 1262 of file RISCVISAInfo.cpp.
References isExperimentalExtension(), and isSupportedExtension().
std::string RISCVISAInfo::toString | ( | ) | const |
Definition at line 1245 of file RISCVISAInfo.cpp.
References llvm::raw_string_ostream::str().