LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::RISCVISAInfo Class Reference

#include "llvm/TargetParser/RISCVISAInfo.h"

Public Member Functions

 RISCVISAInfo (const RISCVISAInfo &)=delete
RISCVISAInfooperator= (const RISCVISAInfo &)=delete
std::vector< std::string > toFeatures (bool AddAllExtensions=false, bool IgnoreUnknown=true) const
 Convert RISC-V ISA info to a feature vector.
const RISCVISAUtils::OrderedExtensionMapgetExtensions () 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)
 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 llvm::Expected< std::unique_ptr< RISCVISAInfo > > createFromExtMap (unsigned XLen, const RISCVISAUtils::OrderedExtensionMap &Exts)
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 std::string getTargetFeatureForExtension (StringRef Ext)
static void printSupportedExtensions (StringMap< StringRef > &DescMap)
static void printEnabledExtensions (bool IsRV64, std::set< StringRef > &EnabledFeatureNames, StringMap< StringRef > &DescMap)
static int getRISCVFeaturesBitPosition (StringRef Ext)
 Return the bit position (in group 0) of __riscv_feature_bits.

Detailed Description

Definition at line 24 of file RISCVISAInfo.h.

Constructor & Destructor Documentation


llvm::RISCVISAInfo::RISCVISAInfo ( const RISCVISAInfo )

Member Function Documentation

◆ computeDefaultABI()

StringRef RISCVISAInfo::computeDefaultABI ( ) const

Definition at line 966 of file RISCVISAInfo.cpp.

References llvm_unreachable.

◆ createFromExtMap()

llvm::Expected< std::unique_ptr< RISCVISAInfo > > RISCVISAInfo::createFromExtMap ( unsigned  XLen,
const RISCVISAUtils::OrderedExtensionMap Exts 

Definition at line 437 of file RISCVISAInfo.cpp.

References assert().

Referenced by printEnabledExtensions().

◆ getExtensions()

const RISCVISAUtils::OrderedExtensionMap & llvm::RISCVISAInfo::getExtensions ( ) const

Definition at line 56 of file RISCVISAInfo.h.

◆ getFLen()

unsigned llvm::RISCVISAInfo::getFLen ( ) const

Definition at line 61 of file RISCVISAInfo.h.

◆ getMaxELen()

unsigned llvm::RISCVISAInfo::getMaxELen ( ) const

Definition at line 64 of file RISCVISAInfo.h.

◆ getMaxELenFp()

unsigned llvm::RISCVISAInfo::getMaxELenFp ( ) const

Definition at line 65 of file RISCVISAInfo.h.

◆ getMaxVLen()

unsigned llvm::RISCVISAInfo::getMaxVLen ( ) const

Definition at line 63 of file RISCVISAInfo.h.

◆ getMinVLen()

unsigned llvm::RISCVISAInfo::getMinVLen ( ) const

Definition at line 62 of file RISCVISAInfo.h.

◆ getRISCVFeaturesBitPosition()

int RISCVISAInfo::getRISCVFeaturesBitPosition ( StringRef  Ext)

Return the bit position (in group 0) of __riscv_feature_bits.

Returns -1 if not supported.

Definition at line 1054 of file RISCVISAInfo.cpp.

References RISCVGroup0BitPositions.

◆ getTargetFeatureForExtension()

std::string RISCVISAInfo::getTargetFeatureForExtension ( StringRef  Ext)

◆ getXLen()

unsigned llvm::RISCVISAInfo::getXLen ( ) const

Definition at line 60 of file RISCVISAInfo.h.

◆ hasExtension()

bool RISCVISAInfo::hasExtension ( StringRef  Ext) const

Definition at line 278 of file RISCVISAInfo.cpp.

References isSupportedExtension(), and stripExperimentalPrefix().

◆ isSupportedExtension() [1/2]

bool RISCVISAInfo::isSupportedExtension ( StringRef  Ext)

◆ isSupportedExtension() [2/2]

bool RISCVISAInfo::isSupportedExtension ( StringRef  Ext,
unsigned  MajorVersion,
unsigned  MinorVersion 

Definition at line 264 of file RISCVISAInfo.cpp.

References I, and Range.

◆ isSupportedExtensionFeature()

bool RISCVISAInfo::isSupportedExtensionFeature ( StringRef  Ext)

◆ isSupportedExtensionWithVersion()

bool RISCVISAInfo::isSupportedExtensionWithVersion ( StringRef  Ext)

◆ operator=()

RISCVISAInfo & llvm::RISCVISAInfo::operator= ( const RISCVISAInfo )

◆ parseArchString()

llvm::Expected< std::unique_ptr< RISCVISAInfo > > RISCVISAInfo::parseArchString ( StringRef  Arch,
bool  EnableExperimentalExtension,
bool  ExperimentalExtensionVersionCheck = true 

◆ parseFeatures()

llvm::Expected< std::unique_ptr< RISCVISAInfo > > RISCVISAInfo::parseFeatures ( unsigned  XLen,
const std::vector< std::string > &  Features 

◆ parseNormalizedArchString()

llvm::Expected< std::unique_ptr< RISCVISAInfo > > RISCVISAInfo::parseNormalizedArchString ( StringRef  Arch)

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 481 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(), Idx, isDigit(), isLower(), llvm::StringRef::npos, llvm::StringRef::size(), llvm::StringRef::slice(), and llvm::StringRef::str().

◆ printEnabledExtensions()

void RISCVISAInfo::printEnabledExtensions ( bool  IsRV64,
std::set< StringRef > &  EnabledFeatureNames,
StringMap< StringRef > &  DescMap 

◆ printSupportedExtensions()

void RISCVISAInfo::printSupportedExtensions ( StringMap< StringRef > &  DescMap)

◆ toFeatures()

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 287 of file RISCVISAInfo.cpp.

References _, isExperimentalExtension(), and isSupportedExtension().

◆ toString()

std::string RISCVISAInfo::toString ( ) const

Definition at line 938 of file RISCVISAInfo.cpp.

References llvm::raw_string_ostream::str().

The documentation for this class was generated from the following files: