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
 

Macros

#define GET_SUPPORTED_EXTENSIONS
 
#define GET_SUPPORTED_PROFILES
 
#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)
 
static bool operator< (const ImpliedExtsEntry &LHS, StringRef RHS)
 
static bool operator< (StringRef LHS, const ImpliedExtsEntry &RHS)
 

Variables

static const charRISCVGImplications []
 
static constexpr StringLiteral CombineIntoExts []
 

Macro Definition Documentation

◆ GET_IMPLIED_EXTENSIONS

#define GET_IMPLIED_EXTENSIONS

Definition at line 831 of file RISCVISAInfo.cpp.

◆ GET_SUPPORTED_EXTENSIONS

#define GET_SUPPORTED_EXTENSIONS

Definition at line 50 of file RISCVISAInfo.cpp.

◆ GET_SUPPORTED_PROFILES

#define GET_SUPPORTED_PROFILES

Definition at line 53 of file RISCVISAInfo.cpp.

Function Documentation

◆ findDefaultVersion()

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

Definition at line 143 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 173 of file RISCVISAInfo.cpp.

Referenced by performMemPairCombine(), and processMultiLetterExtension().

◆ getExtensionTypeDesc()

static StringRef getExtensionTypeDesc ( StringRef  Ext)
static

Definition at line 163 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

◆ operator<() [1/2]

static bool operator< ( const ImpliedExtsEntry LHS,
StringRef  RHS 
)
static

Definition at line 823 of file RISCVISAInfo.cpp.

References LHS, and RHS.

◆ operator<() [2/2]

static bool operator< ( StringRef  LHS,
const ImpliedExtsEntry RHS 
)
static

Definition at line 827 of file RISCVISAInfo.cpp.

References LHS, and RHS.

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

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

Variable Documentation

◆ CombineIntoExts

constexpr StringLiteral CombineIntoExts[]
staticconstexpr
Initial value:
= {
{"zk"}, {"zkn"}, {"zks"}, {"zvkn"}, {"zvknc"},
{"zvkng"}, {"zvks"}, {"zvksc"}, {"zvksg"},
}

Definition at line 878 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().