LLVM  15.0.0git
Classes | Functions | Variables
RISCVISAInfo.cpp File Reference
#include "llvm/Support/RISCVISAInfo.h"
#include "llvm/ADT/None.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 <string>
#include <vector>
Include dependency graph for RISCVISAInfo.cpp:

Go to the source code of this file.

Classes

struct  FindByName
 
struct  ImpliedExtsEntry
 
struct  CombinedExtsEntry
 

Functions

static bool stripExperimentalPrefix (StringRef &Ext)
 
static size_t findFirstNonVersionCharacter (StringRef Ext)
 
static Optional< RISCVExtensionVersion > findDefaultVersion (StringRef ExtName)
 
static StringRef getExtensionTypeDesc (StringRef Ext)
 
static StringRef getExtensionType (StringRef Ext)
 
static Optional< RISCVExtensionVersion > isExperimentalExtension (StringRef Ext)
 
static int singleLetterExtensionRank (char Ext)
 
static int multiLetterExtensionRank (const std::string &ExtName)
 
static Error getExtensionVersion (StringRef Ext, StringRef In, unsigned &Major, unsigned &Minor, unsigned &ConsumeLength, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck)
 

Variables

static constexpr StringLiteral AllStdExts = "mafdqlcbkjtpvn"
 
static const RISCVSupportedExtension SupportedExtensions []
 
static const RISCVSupportedExtension SupportedExperimentalExtensions []
 
static const char * ImpliedExtsV [] = {"zvl128b", "zve64d", "f", "d"}
 
static const char * ImpliedExtsZfhmin [] = {"f"}
 
static const char * ImpliedExtsZfh [] = {"f"}
 
static const char * ImpliedExtsZdinx [] = {"zfinx"}
 
static const char * ImpliedExtsZhinxmin [] = {"zfinx"}
 
static const char * ImpliedExtsZhinx [] = {"zfinx"}
 
static const char * ImpliedExtsZve64d [] = {"zve64f"}
 
static const char * ImpliedExtsZve64f [] = {"zve64x", "zve32f"}
 
static const char * ImpliedExtsZve64x [] = {"zve32x", "zvl64b"}
 
static const char * ImpliedExtsZve32f [] = {"zve32x"}
 
static const char * ImpliedExtsZve32x [] = {"zvl32b"}
 
static const char * ImpliedExtsZvl65536b [] = {"zvl32768b"}
 
static const char * ImpliedExtsZvl32768b [] = {"zvl16384b"}
 
static const char * ImpliedExtsZvl16384b [] = {"zvl8192b"}
 
static const char * ImpliedExtsZvl8192b [] = {"zvl4096b"}
 
static const char * ImpliedExtsZvl4096b [] = {"zvl2048b"}
 
static const char * ImpliedExtsZvl2048b [] = {"zvl1024b"}
 
static const char * ImpliedExtsZvl1024b [] = {"zvl512b"}
 
static const char * ImpliedExtsZvl512b [] = {"zvl256b"}
 
static const char * ImpliedExtsZvl256b [] = {"zvl128b"}
 
static const char * ImpliedExtsZvl128b [] = {"zvl64b"}
 
static const char * ImpliedExtsZvl64b [] = {"zvl32b"}
 
static const char * ImpliedExtsZk [] = {"zkn", "zkt", "zkr"}
 
static const char * ImpliedExtsZkn [] = {"zbkb", "zbkc", "zbkx", "zkne", "zknd", "zknh"}
 
static const char * ImpliedExtsZks [] = {"zbkb", "zbkc", "zbkx", "zksed", "zksh"}
 
static const char * ImpliedExtsZvfh [] = {"zve32f"}
 
static constexpr ImpliedExtsEntry ImpliedExts []
 
static constexpr CombinedExtsEntry CombineIntoExts []
 

Function Documentation

◆ findDefaultVersion()

static Optional<RISCVExtensionVersion> findDefaultVersion ( StringRef  ExtName)
static

◆ findFirstNonVersionCharacter()

static size_t findFirstNonVersionCharacter ( StringRef  Ext)
static

Definition at line 121 of file RISCVISAInfo.cpp.

References assert(), llvm::MipsISD::Ext, and isDigit().

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

◆ getExtensionType()

static StringRef getExtensionType ( StringRef  Ext)
static

Definition at line 180 of file RISCVISAInfo.cpp.

References llvm::MipsISD::Ext.

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

◆ getExtensionTypeDesc()

static StringRef getExtensionTypeDesc ( StringRef  Ext)
static

Definition at line 168 of file RISCVISAInfo.cpp.

References llvm::MipsISD::Ext.

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

◆ getExtensionVersion()

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

◆ isExperimentalExtension()

static Optional<RISCVExtensionVersion> isExperimentalExtension ( StringRef  Ext)
static

◆ multiLetterExtensionRank()

static int multiLetterExtensionRank ( const std::string &  ExtName)
static

◆ singleLetterExtensionRank()

static int singleLetterExtensionRank ( char  Ext)
static

◆ stripExperimentalPrefix()

static bool stripExperimentalPrefix ( StringRef Ext)
static

Variable Documentation

◆ AllStdExts

constexpr StringLiteral AllStdExts = "mafdqlcbkjtpvn"
staticconstexpr

◆ CombineIntoExts

constexpr CombinedExtsEntry CombineIntoExts[]
staticconstexpr
Initial value:
= {
{{"zk"}, {ImpliedExtsZk}},
{{"zkn"}, {ImpliedExtsZkn}},
{{"zks"}, {ImpliedExtsZks}},
}

Definition at line 855 of file RISCVISAInfo.cpp.

◆ ImpliedExts

constexpr ImpliedExtsEntry ImpliedExts[]
staticconstexpr
Initial value:
= {
{{"v"}, {ImpliedExtsV}},
{{"zdinx"}, {ImpliedExtsZdinx}},
{{"zfh"}, {ImpliedExtsZfh}},
{{"zfhmin"}, {ImpliedExtsZfhmin}},
{{"zhinx"}, {ImpliedExtsZhinx}},
{{"zhinxmin"}, {ImpliedExtsZhinxmin}},
{{"zk"}, {ImpliedExtsZk}},
{{"zkn"}, {ImpliedExtsZkn}},
{{"zks"}, {ImpliedExtsZks}},
{{"zve32f"}, {ImpliedExtsZve32f}},
{{"zve32x"}, {ImpliedExtsZve32x}},
{{"zve64d"}, {ImpliedExtsZve64d}},
{{"zve64f"}, {ImpliedExtsZve64f}},
{{"zve64x"}, {ImpliedExtsZve64x}},
{{"zvfh"}, {ImpliedExtsZvfh}},
{{"zvl1024b"}, {ImpliedExtsZvl1024b}},
{{"zvl128b"}, {ImpliedExtsZvl128b}},
{{"zvl16384b"}, {ImpliedExtsZvl16384b}},
{{"zvl2048b"}, {ImpliedExtsZvl2048b}},
{{"zvl256b"}, {ImpliedExtsZvl256b}},
{{"zvl32768b"}, {ImpliedExtsZvl32768b}},
{{"zvl4096b"}, {ImpliedExtsZvl4096b}},
{{"zvl512b"}, {ImpliedExtsZvl512b}},
{{"zvl64b"}, {ImpliedExtsZvl64b}},
{{"zvl65536b"}, {ImpliedExtsZvl65536b}},
{{"zvl8192b"}, {ImpliedExtsZvl8192b}},
}

Definition at line 785 of file RISCVISAInfo.cpp.

◆ ImpliedExtsV

const char* ImpliedExtsV[] = {"zvl128b", "zve64d", "f", "d"}
static

Definition at line 746 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZdinx

const char* ImpliedExtsZdinx[] = {"zfinx"}
static

Definition at line 749 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZfh

const char* ImpliedExtsZfh[] = {"f"}
static

Definition at line 748 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZfhmin

const char* ImpliedExtsZfhmin[] = {"f"}
static

Definition at line 747 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZhinx

const char* ImpliedExtsZhinx[] = {"zfinx"}
static

Definition at line 751 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZhinxmin

const char* ImpliedExtsZhinxmin[] = {"zfinx"}
static

Definition at line 750 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZk

const char* ImpliedExtsZk[] = {"zkn", "zkt", "zkr"}
static

Definition at line 768 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZkn

const char* ImpliedExtsZkn[] = {"zbkb", "zbkc", "zbkx", "zkne", "zknd", "zknh"}
static

Definition at line 769 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZks

const char* ImpliedExtsZks[] = {"zbkb", "zbkc", "zbkx", "zksed", "zksh"}
static

Definition at line 770 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZve32f

const char* ImpliedExtsZve32f[] = {"zve32x"}
static

Definition at line 755 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZve32x

const char* ImpliedExtsZve32x[] = {"zvl32b"}
static

Definition at line 756 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZve64d

const char* ImpliedExtsZve64d[] = {"zve64f"}
static

Definition at line 752 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZve64f

const char* ImpliedExtsZve64f[] = {"zve64x", "zve32f"}
static

Definition at line 753 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZve64x

const char* ImpliedExtsZve64x[] = {"zve32x", "zvl64b"}
static

Definition at line 754 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvfh

const char* ImpliedExtsZvfh[] = {"zve32f"}
static

Definition at line 771 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl1024b

const char* ImpliedExtsZvl1024b[] = {"zvl512b"}
static

Definition at line 763 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl128b

const char* ImpliedExtsZvl128b[] = {"zvl64b"}
static

Definition at line 766 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl16384b

const char* ImpliedExtsZvl16384b[] = {"zvl8192b"}
static

Definition at line 759 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl2048b

const char* ImpliedExtsZvl2048b[] = {"zvl1024b"}
static

Definition at line 762 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl256b

const char* ImpliedExtsZvl256b[] = {"zvl128b"}
static

Definition at line 765 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl32768b

const char* ImpliedExtsZvl32768b[] = {"zvl16384b"}
static

Definition at line 758 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl4096b

const char* ImpliedExtsZvl4096b[] = {"zvl2048b"}
static

Definition at line 761 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl512b

const char* ImpliedExtsZvl512b[] = {"zvl256b"}
static

Definition at line 764 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl64b

const char* ImpliedExtsZvl64b[] = {"zvl32b"}
static

Definition at line 767 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl65536b

const char* ImpliedExtsZvl65536b[] = {"zvl32768b"}
static

Definition at line 757 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl8192b

const char* ImpliedExtsZvl8192b[] = {"zvl4096b"}
static

Definition at line 760 of file RISCVISAInfo.cpp.

◆ SupportedExperimentalExtensions

const RISCVSupportedExtension SupportedExperimentalExtensions[]
static
Initial value:
= {
{"zbe", RISCVExtensionVersion{0, 93}},
{"zbf", RISCVExtensionVersion{0, 93}},
{"zbm", RISCVExtensionVersion{0, 93}},
{"zbp", RISCVExtensionVersion{0, 93}},
{"zbr", RISCVExtensionVersion{0, 93}},
{"zbt", RISCVExtensionVersion{0, 93}},
{"zvfh", RISCVExtensionVersion{0, 1}},
}

Definition at line 100 of file RISCVISAInfo.cpp.

Referenced by findDefaultVersion(), isExperimentalExtension(), llvm::RISCVISAInfo::isSupportedExtension(), llvm::RISCVISAInfo::isSupportedExtensionFeature(), and llvm::RISCVISAInfo::parseFeatures().

◆ SupportedExtensions

const RISCVSupportedExtension SupportedExtensions[]
static
ImpliedExtsV
static const char * ImpliedExtsV[]
Definition: RISCVISAInfo.cpp:746
ImpliedExtsZvl1024b
static const char * ImpliedExtsZvl1024b[]
Definition: RISCVISAInfo.cpp:763
ImpliedExtsZfh
static const char * ImpliedExtsZfh[]
Definition: RISCVISAInfo.cpp:748
ImpliedExtsZhinxmin
static const char * ImpliedExtsZhinxmin[]
Definition: RISCVISAInfo.cpp:750
ImpliedExtsZvl128b
static const char * ImpliedExtsZvl128b[]
Definition: RISCVISAInfo.cpp:766
ImpliedExtsZvl8192b
static const char * ImpliedExtsZvl8192b[]
Definition: RISCVISAInfo.cpp:760
ImpliedExtsZve32f
static const char * ImpliedExtsZve32f[]
Definition: RISCVISAInfo.cpp:755
ImpliedExtsZvl512b
static const char * ImpliedExtsZvl512b[]
Definition: RISCVISAInfo.cpp:764
ImpliedExtsZvl65536b
static const char * ImpliedExtsZvl65536b[]
Definition: RISCVISAInfo.cpp:757
ImpliedExtsZvl2048b
static const char * ImpliedExtsZvl2048b[]
Definition: RISCVISAInfo.cpp:762
ImpliedExtsZvl64b
static const char * ImpliedExtsZvl64b[]
Definition: RISCVISAInfo.cpp:767
ImpliedExtsZk
static const char * ImpliedExtsZk[]
Definition: RISCVISAInfo.cpp:768
ImpliedExtsZvl32768b
static const char * ImpliedExtsZvl32768b[]
Definition: RISCVISAInfo.cpp:758
ImpliedExtsZvl16384b
static const char * ImpliedExtsZvl16384b[]
Definition: RISCVISAInfo.cpp:759
ImpliedExtsZkn
static const char * ImpliedExtsZkn[]
Definition: RISCVISAInfo.cpp:769
ImpliedExtsZks
static const char * ImpliedExtsZks[]
Definition: RISCVISAInfo.cpp:770
ImpliedExtsZve64f
static const char * ImpliedExtsZve64f[]
Definition: RISCVISAInfo.cpp:753
ImpliedExtsZve64d
static const char * ImpliedExtsZve64d[]
Definition: RISCVISAInfo.cpp:752
ImpliedExtsZvl4096b
static const char * ImpliedExtsZvl4096b[]
Definition: RISCVISAInfo.cpp:761
ImpliedExtsZvl256b
static const char * ImpliedExtsZvl256b[]
Definition: RISCVISAInfo.cpp:765
ImpliedExtsZve32x
static const char * ImpliedExtsZve32x[]
Definition: RISCVISAInfo.cpp:756
ImpliedExtsZve64x
static const char * ImpliedExtsZve64x[]
Definition: RISCVISAInfo.cpp:754
ImpliedExtsZdinx
static const char * ImpliedExtsZdinx[]
Definition: RISCVISAInfo.cpp:749
ImpliedExtsZhinx
static const char * ImpliedExtsZhinx[]
Definition: RISCVISAInfo.cpp:751
ImpliedExtsZvfh
static const char * ImpliedExtsZvfh[]
Definition: RISCVISAInfo.cpp:771
ImpliedExtsZfhmin
static const char * ImpliedExtsZfhmin[]
Definition: RISCVISAInfo.cpp:747