LLVM 19.0.0git
|
#include "llvm/TargetParser/RISCVISAInfo.h"
Public Member Functions | |
RISCVISAInfo (const RISCVISAInfo &)=delete | |
RISCVISAInfo & | operator= (const RISCVISAInfo &)=delete |
RISCVISAInfo (unsigned XLen, RISCVISAUtils::OrderedExtensionMap &Exts) | |
std::vector< std::string > | toFeatures (bool AddAllExtensions=false, bool IgnoreUnknown=true) const |
Convert RISC-V ISA info to a feature vector. | |
const RISCVISAUtils::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 |
StringRef | computeDefaultABI () const |
Static Public Member Functions | |
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 24 of file RISCVISAInfo.h.
|
delete |
|
inline |
Definition at line 29 of file RISCVISAInfo.h.
StringRef RISCVISAInfo::computeDefaultABI | ( | ) | const |
Definition at line 993 of file RISCVISAInfo.cpp.
References hasExtension(), and llvm_unreachable.
|
inline |
Definition at line 56 of file RISCVISAInfo.h.
|
inline |
Definition at line 61 of file RISCVISAInfo.h.
|
inline |
Definition at line 64 of file RISCVISAInfo.h.
|
inline |
Definition at line 65 of file RISCVISAInfo.h.
|
inline |
Definition at line 63 of file RISCVISAInfo.h.
|
inline |
Definition at line 62 of file RISCVISAInfo.h.
|
static |
Definition at line 1034 of file RISCVISAInfo.cpp.
References findLastNonVersionCharacter(), isExperimentalExtension(), isSupportedExtension(), isSupportedExtensionWithVersion(), and Name.
|
inline |
Definition at line 60 of file RISCVISAInfo.h.
Definition at line 235 of file RISCVISAInfo.cpp.
References isSupportedExtension(), and stripExperimentalPrefix().
Referenced by computeDefaultABI().
Definition at line 208 of file RISCVISAInfo.cpp.
References I, llvm::lower_bound(), and verifyTables().
Referenced by getExtensionVersion(), getTargetFeatureForExtension(), hasExtension(), parseArchString(), processMultiLetterExtension(), processSingleLetterExtension(), and toFeatures().
|
static |
Definition at line 221 of file RISCVISAInfo.cpp.
References I.
Definition at line 197 of file RISCVISAInfo.cpp.
References llvm::ArrayRef< T >::end(), I, llvm::lower_bound(), and stripExperimentalPrefix().
Referenced by llvm::RISCVFeatures::parseFeatureBits().
Definition at line 1014 of file RISCVISAInfo.cpp.
References llvm::consumeError(), 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 594 of file RISCVISAInfo.cpp.
References llvm::RISCVISAUtils::AllStdExts, llvm::any_of(), assert(), llvm::StringRef::back(), llvm::StringRef::consume_front(), llvm::consumeError(), contains(), llvm::createStringError(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), findDefaultVersion(), llvm::StringRef::front(), getExtensionVersion(), getStringErrorForInvalidExt(), I, llvm::invalid_argument, isDigit(), isSupportedExtension(), parseArchString(), postProcessAndChecking(), processMultiLetterExtension(), processSingleLetterExtension(), Profile, RISCVGImplications, llvm::StringRef::size(), splitExtsByUnderscore(), llvm::StringRef::starts_with(), llvm::StringRef::str(), and llvm::upper_bound().
Referenced by llvm::RISCV::getFeaturesForCPU(), and parseArchString().
|
static |
Parse RISC-V ISA info from feature vector.
Definition at line 398 of file RISCVISAInfo.cpp.
References llvm::Add, assert(), llvm::StringRef::drop_front(), llvm::lower_bound(), postProcessAndChecking(), llvm::StringRef::size(), llvm::StringRef::str(), and stripExperimentalPrefix().
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 431 of file RISCVISAInfo.cpp.
References llvm::all_of(), llvm::CallingConv::C, llvm::StringRef::consume_front(), llvm::createStringError(), llvm::StringRef::empty(), llvm::StringRef::getAsInteger(), llvm::invalid_argument, isDigit(), isLower(), llvm::StringRef::npos, and llvm::StringRef::split().
|
static |
Definition at line 983 of file RISCVISAInfo.cpp.
Referenced by parseArchString(), and parseFeatures().
std::vector< std::string > RISCVISAInfo::toFeatures | ( | bool | AddAllExtensions = false , |
bool | IgnoreUnknown = true |
||
) | const |
Convert RISC-V ISA info to a feature vector.
Definition at line 244 of file RISCVISAInfo.cpp.
References _, isExperimentalExtension(), and isSupportedExtension().
std::string RISCVISAInfo::toString | ( | ) | const |
Definition at line 965 of file RISCVISAInfo.cpp.
References llvm::raw_string_ostream::str().