LLVM 22.0.0git
|
#include "llvm/TargetParser/RISCVISAInfo.h"
Public Member Functions | |
RISCVISAInfo (const RISCVISAInfo &)=delete | |
RISCVISAInfo & | operator= (const RISCVISAInfo &)=delete |
LLVM_ABI 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 |
LLVM_ABI bool | hasExtension (StringRef Ext) const |
LLVM_ABI std::string | toString () const |
LLVM_ABI StringRef | computeDefaultABI () const |
Static Public Member Functions | |
static LLVM_ABI llvm::Expected< std::unique_ptr< RISCVISAInfo > > | parseArchString (StringRef Arch, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck=true) |
Parse RISC-V ISA info from arch string. | |
static LLVM_ABI 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_ABI llvm::Expected< std::unique_ptr< RISCVISAInfo > > | parseFeatures (unsigned XLen, const std::vector< std::string > &Features) |
Parse RISC-V ISA info from feature vector. | |
static LLVM_ABI llvm::Expected< std::unique_ptr< RISCVISAInfo > > | createFromExtMap (unsigned XLen, const RISCVISAUtils::OrderedExtensionMap &Exts) |
static LLVM_ABI bool | isSupportedExtensionFeature (StringRef Ext) |
static LLVM_ABI bool | isSupportedExtension (StringRef Ext) |
static LLVM_ABI bool | isSupportedExtensionWithVersion (StringRef Ext) |
static LLVM_ABI bool | isSupportedExtension (StringRef Ext, unsigned MajorVersion, unsigned MinorVersion) |
static LLVM_ABI std::string | getTargetFeatureForExtension (StringRef Ext) |
static LLVM_ABI void | printSupportedExtensions (StringMap< StringRef > &DescMap) |
static LLVM_ABI void | printEnabledExtensions (bool IsRV64, std::set< StringRef > &EnabledFeatureNames, StringMap< StringRef > &DescMap) |
static LLVM_ABI std::pair< int, int > | getRISCVFeaturesBitsInfo (StringRef Ext) |
Return the group id and bit position of __riscv_feature_bits. |
Static Public Attributes | |
static constexpr unsigned | FeatureBitSize = 2 |
Definition at line 25 of file RISCVISAInfo.h.
|
delete |
References RISCVISAInfo().
Referenced by createFromExtMap(), operator=(), parseArchString(), parseFeatures(), parseNormalizedArchString(), and RISCVISAInfo().
StringRef RISCVISAInfo::computeDefaultABI | ( | ) | const |
Definition at line 1002 of file RISCVISAInfo.cpp.
References llvm_unreachable.
|
static |
Definition at line 436 of file RISCVISAInfo.cpp.
References assert(), and RISCVISAInfo().
Referenced by printEnabledExtensions().
|
inline |
Definition at line 57 of file RISCVISAInfo.h.
|
inline |
Definition at line 62 of file RISCVISAInfo.h.
|
inline |
Definition at line 65 of file RISCVISAInfo.h.
|
inline |
Definition at line 66 of file RISCVISAInfo.h.
|
inline |
Definition at line 64 of file RISCVISAInfo.h.
|
inline |
Definition at line 63 of file RISCVISAInfo.h.
|
static |
Return the group id and bit position of __riscv_feature_bits.
Returns <-1, -1> if not supported.
Definition at line 1075 of file RISCVISAInfo.cpp.
|
static |
Definition at line 1043 of file RISCVISAInfo.cpp.
References findLastNonVersionCharacter(), isExperimentalExtension(), isSupportedExtension(), and isSupportedExtensionWithVersion().
|
inline |
Definition at line 61 of file RISCVISAInfo.h.
Definition at line 277 of file RISCVISAInfo.cpp.
References isSupportedExtension(), and stripExperimentalPrefix().
Definition at line 250 of file RISCVISAInfo.cpp.
References llvm::ArrayRef(), I, llvm::lower_bound(), and verifyTables().
Referenced by getExtensionVersion(), getTargetFeatureForExtension(), hasExtension(), parseArchString(), and toFeatures().
|
static |
Definition at line 263 of file RISCVISAInfo.cpp.
References llvm::ArrayRef(), I, and Range.
Definition at line 239 of file RISCVISAInfo.cpp.
References llvm::ArrayRef(), llvm::ArrayRef< T >::end(), I, llvm::lower_bound(), and stripExperimentalPrefix().
Referenced by llvm::RISCVFeatures::parseFeatureBits().
Definition at line 1023 of file RISCVISAInfo.cpp.
References llvm::consumeError(), llvm::StringRef::empty(), findLastNonVersionCharacter(), and getExtensionVersion().
Referenced by getTargetFeatureForExtension().
|
delete |
References LLVM_ABI, and RISCVISAInfo().
|
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 555 of file RISCVISAInfo.cpp.
References llvm::all_of(), llvm::RISCVISAUtils::AllStdExts, assert(), llvm::CallingConv::C, llvm::StringRef::consume_front(), contains(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), llvm::StringRef::find(), findDefaultVersion(), findLastNonVersionCharacter(), llvm::StringRef::front(), getError(), getErrorForInvalidExt(), getExtensionType(), getExtensionTypeDesc(), getExtensionVersion(), I, llvm::isDigit(), llvm::isLower(), isSupportedExtension(), parseArchString(), Profile, RISCVGImplications, RISCVGImplicationsZi, RISCVISAInfo(), llvm::StringRef::size(), llvm::StringRef::slice(), llvm::StringRef::starts_with(), llvm::StringRef::str(), llvm::StringRef::substr(), llvm::upper_bound(), and llvm::Version.
Referenced by llvm::RISCV::getFeaturesForCPU(), and parseArchString().
|
static |
Parse RISC-V ISA info from feature vector.
Definition at line 447 of file RISCVISAInfo.cpp.
References llvm::Add, llvm::ArrayRef(), assert(), llvm::lower_bound(), RISCVISAInfo(), 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 479 of file RISCVISAInfo.cpp.
References llvm::all_of(), llvm::CallingConv::C, llvm::StringRef::consume_front(), llvm::StringRef::drop_front(), llvm::StringRef::empty(), llvm::StringRef::find(), llvm::StringRef::getAsInteger(), getError(), llvm::isDigit(), llvm::isLower(), RISCVISAInfo(), llvm::StringRef::size(), llvm::StringRef::slice(), llvm::StringRef::str(), and llvm::StringRef::substr().
|
static |
Definition at line 117 of file RISCVISAInfo.cpp.
References createFromExtMap(), llvm::StringMapImpl::empty(), llvm::outs(), PrintExtension(), and llvm::Version.
Definition at line 82 of file RISCVISAInfo.cpp.
References llvm::StringMapImpl::empty(), llvm::raw_ostream::indent(), llvm::outs(), P, PrintExtension(), and llvm::Version.
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 286 of file RISCVISAInfo.cpp.
References _, isExperimentalExtension(), and isSupportedExtension().
std::string RISCVISAInfo::toString | ( | ) | const |
Definition at line 974 of file RISCVISAInfo.cpp.
References llvm::raw_string_ostream::str().
|
staticconstexpr |
Definition at line 90 of file RISCVISAInfo.h.