LLVM 19.0.0git
Classes | Macros | Functions | Variables
RISCVISAInfo.cpp File Reference
#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
#include <array>
#include <atomic>
#include <optional>
#include <string>
#include <vector>
#include "llvm/TargetParser/RISCVTargetParserDef.inc"

Go to the source code of this file.

Classes

struct  ImpliedExtsEntry
 
struct  CombinedExtsEntry
 

Macros

#define GET_SUPPORTED_EXTENSIONS
 
#define GET_IMPLIED_EXTENSIONS
 

Functions

static void verifyTables ()
 
static void PrintExtension (StringRef Name, StringRef Version, StringRef Description)
 
static bool stripExperimentalPrefix (StringRef &Ext)
 
static size_t findLastNonVersionCharacter (StringRef Ext)
 
static std::optional< RISCVISAUtils::ExtensionVersionfindDefaultVersion (StringRef ExtName)
 
static StringRef getExtensionTypeDesc (StringRef Ext)
 
static StringRef getExtensionType (StringRef Ext)
 
static std::optional< RISCVISAUtils::ExtensionVersionisExperimentalExtension (StringRef Ext)
 
static Error getStringErrorForInvalidExt (std::string_view ExtName)
 
static Error getExtensionVersion (StringRef Ext, StringRef In, unsigned &Major, unsigned &Minor, unsigned &ConsumeLength, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
 
static Error splitExtsByUnderscore (StringRef Exts, std::vector< std::string > &SplitExts)
 
static Error processMultiLetterExtension (StringRef RawExt, MapVector< std::string, RISCVISAUtils::ExtensionVersion, std::map< std::string, unsigned > > &SeenExtMap, bool IgnoreUnknown, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
 
static Error processSingleLetterExtension (StringRef &RawExt, MapVector< std::string, RISCVISAUtils::ExtensionVersion, std::map< std::string, unsigned > > &SeenExtMap, bool IgnoreUnknown, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
 

Variables

static const charRISCVGImplications []
 
static constexpr RISCVProfile SupportedProfiles []
 
static constexpr CombinedExtsEntry CombineIntoExts []
 

Macro Definition Documentation

◆ GET_IMPLIED_EXTENSIONS

#define GET_IMPLIED_EXTENSIONS

Definition at line 859 of file RISCVISAInfo.cpp.

◆ GET_SUPPORTED_EXTENSIONS

#define GET_SUPPORTED_EXTENSIONS

Definition at line 50 of file RISCVISAInfo.cpp.

Function Documentation

◆ findDefaultVersion()

static std::optional< RISCVISAUtils::ExtensionVersion > findDefaultVersion ( StringRef  ExtName)
static

Definition at line 176 of file RISCVISAInfo.cpp.

References I, and llvm::lower_bound().

Referenced by getExtensionVersion(), and llvm::RISCVISAInfo::parseArchString().

◆ findLastNonVersionCharacter()

static size_t findLastNonVersionCharacter ( StringRef  Ext)
static

◆ getExtensionType()

static StringRef getExtensionType ( StringRef  Ext)
static

Definition at line 206 of file RISCVISAInfo.cpp.

Referenced by performMemPairCombine(), and processMultiLetterExtension().

◆ getExtensionTypeDesc()

static StringRef getExtensionTypeDesc ( StringRef  Ext)
static

Definition at line 196 of file RISCVISAInfo.cpp.

Referenced by getStringErrorForInvalidExt(), and processMultiLetterExtension().

◆ getExtensionVersion()

static Error getExtensionVersion ( StringRef  Ext,
StringRef  In,
unsigned Major,
unsigned Minor,
unsigned ConsumeLength,
bool  EnableExperimentalExtension,
bool  ExperimentalExtensionVersionCheck 
)
static

◆ getStringErrorForInvalidExt()

static Error getStringErrorForInvalidExt ( std::string_view  ExtName)
static

◆ isExperimentalExtension()

static std::optional< RISCVISAUtils::ExtensionVersion > isExperimentalExtension ( StringRef  Ext)
static

◆ PrintExtension()

static void PrintExtension ( StringRef  Name,
StringRef  Version,
StringRef  Description 
)
static

◆ processMultiLetterExtension()

static Error processMultiLetterExtension ( StringRef  RawExt,
MapVector< std::string, RISCVISAUtils::ExtensionVersion, std::map< std::string, unsigned > > &  SeenExtMap,
bool  IgnoreUnknown,
bool  EnableExperimentalExtension,
bool  ExperimentalExtensionVersionCheck 
)
static

◆ processSingleLetterExtension()

static Error processSingleLetterExtension ( StringRef RawExt,
MapVector< std::string, RISCVISAUtils::ExtensionVersion, std::map< std::string, unsigned > > &  SeenExtMap,
bool  IgnoreUnknown,
bool  EnableExperimentalExtension,
bool  ExperimentalExtensionVersionCheck 
)
static

◆ splitExtsByUnderscore()

static Error splitExtsByUnderscore ( StringRef  Exts,
std::vector< std::string > &  SplitExts 
)
static

◆ stripExperimentalPrefix()

static bool stripExperimentalPrefix ( StringRef Ext)
static

◆ verifyTables()

static void verifyTables ( )
static

Definition at line 89 of file RISCVISAInfo.cpp.

References assert(), and llvm::is_sorted().

Variable Documentation

◆ CombineIntoExts

constexpr CombinedExtsEntry CombineIntoExts[]
staticconstexpr
Initial value:
= {
{{"zk"}, {ImpliedExtsZk}},
{{"zkn"}, {ImpliedExtsZkn}},
{{"zks"}, {ImpliedExtsZks}},
{{"zvkn"}, {ImpliedExtsZvkn}},
{{"zvknc"}, {ImpliedExtsZvknc}},
{{"zvkng"}, {ImpliedExtsZvkng}},
{{"zvks"}, {ImpliedExtsZvks}},
{{"zvksc"}, {ImpliedExtsZvksc}},
{{"zvksg"}, {ImpliedExtsZvksg}},
}

Definition at line 910 of file RISCVISAInfo.cpp.

◆ RISCVGImplications

const char* RISCVGImplications[]
static
Initial value:
= {
"i", "m", "a", "f", "d", "zicsr", "zifencei"
}

Definition at line 46 of file RISCVISAInfo.cpp.

Referenced by llvm::RISCVISAInfo::parseArchString().

◆ SupportedProfiles

constexpr RISCVProfile SupportedProfiles[]
staticconstexpr

Definition at line 53 of file RISCVISAInfo.cpp.

Referenced by llvm::RISCVISAInfo::parseArchString().