LLVM  14.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
 

Functions

static bool stripExperimentalPrefix (StringRef &Ext)
 
static size_t findFirstNonVersionCharacter (const 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 = "mafdqlcbjtpvn"
 
static const RISCVSupportedExtension SupportedExtensions []
 
static const RISCVSupportedExtension SupportedExperimentalExtensions []
 
static const char * ImpliedExtsV [] = {"zvlsseg", "zvl128b"}
 
static const char * ImpliedExtsZfh [] = {"zfhmin"}
 
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 constexpr ImpliedExtsEntry ImpliedExts []
 

Function Documentation

◆ findDefaultVersion()

static Optional<RISCVExtensionVersion> findDefaultVersion ( StringRef  ExtName)
static

◆ findFirstNonVersionCharacter()

static size_t findFirstNonVersionCharacter ( const StringRef Ext)
static

Definition at line 95 of file RISCVISAInfo.cpp.

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

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

◆ getExtensionType()

static StringRef getExtensionType ( StringRef  Ext)
static

Definition at line 154 of file RISCVISAInfo.cpp.

References llvm::MipsISD::Ext.

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

◆ getExtensionTypeDesc()

static StringRef getExtensionTypeDesc ( StringRef  Ext)
static

Definition at line 142 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 = "mafdqlcbjtpvn"
staticconstexpr

◆ ImpliedExts

constexpr ImpliedExtsEntry ImpliedExts[]
staticconstexpr
Initial value:
= {
{{"v"}, {ImpliedExtsV}},
{{"zfh"}, {ImpliedExtsZfh}},
{{"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 734 of file RISCVISAInfo.cpp.

◆ ImpliedExtsV

const char* ImpliedExtsV[] = {"zvlsseg", "zvl128b"}
static

Definition at line 709 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZfh

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

Definition at line 710 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl1024b

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

Definition at line 717 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl128b

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

Definition at line 720 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl16384b

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

Definition at line 713 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl2048b

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

Definition at line 716 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl256b

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

Definition at line 719 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl32768b

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

Definition at line 712 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl4096b

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

Definition at line 715 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl512b

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

Definition at line 718 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl64b

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

Definition at line 721 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl65536b

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

Definition at line 711 of file RISCVISAInfo.cpp.

◆ ImpliedExtsZvl8192b

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

Definition at line 714 of file RISCVISAInfo.cpp.

◆ SupportedExperimentalExtensions

const RISCVSupportedExtension SupportedExperimentalExtensions[]
static
Initial value:
= {
{"v", RISCVExtensionVersion{0, 10}},
{"zbe", RISCVExtensionVersion{0, 93}},
{"zbf", RISCVExtensionVersion{0, 93}},
{"zbm", RISCVExtensionVersion{0, 93}},
{"zbp", RISCVExtensionVersion{0, 93}},
{"zbr", RISCVExtensionVersion{0, 93}},
{"zbt", RISCVExtensionVersion{0, 93}},
{"zvlsseg", RISCVExtensionVersion{0, 10}},
{"zvl32b", RISCVExtensionVersion{0, 10}},
{"zvl64b", RISCVExtensionVersion{0, 10}},
{"zvl128b", RISCVExtensionVersion{0, 10}},
{"zvl256b", RISCVExtensionVersion{0, 10}},
{"zvl512b", RISCVExtensionVersion{0, 10}},
{"zvl1024b", RISCVExtensionVersion{0, 10}},
{"zvl2048b", RISCVExtensionVersion{0, 10}},
{"zvl4096b", RISCVExtensionVersion{0, 10}},
{"zvl8192b", RISCVExtensionVersion{0, 10}},
{"zvl16384b", RISCVExtensionVersion{0, 10}},
{"zvl32768b", RISCVExtensionVersion{0, 10}},
{"zvl65536b", RISCVExtensionVersion{0, 10}},
}

Definition at line 60 of file RISCVISAInfo.cpp.

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

◆ SupportedExtensions

const RISCVSupportedExtension SupportedExtensions[]
static
Initial value:
= {
{"i", RISCVExtensionVersion{2, 0}},
{"e", RISCVExtensionVersion{1, 9}},
{"m", RISCVExtensionVersion{2, 0}},
{"a", RISCVExtensionVersion{2, 0}},
{"f", RISCVExtensionVersion{2, 0}},
{"d", RISCVExtensionVersion{2, 0}},
{"c", RISCVExtensionVersion{2, 0}},
{"zfhmin", RISCVExtensionVersion{1, 0}},
{"zfh", RISCVExtensionVersion{1, 0}},
{"zba", RISCVExtensionVersion{1, 0}},
{"zbb", RISCVExtensionVersion{1, 0}},
{"zbc", RISCVExtensionVersion{1, 0}},
{"zbs", RISCVExtensionVersion{1, 0}},
}

Definition at line 42 of file RISCVISAInfo.cpp.

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

ImpliedExtsV
static const char * ImpliedExtsV[]
Definition: RISCVISAInfo.cpp:709
ImpliedExtsZvl1024b
static const char * ImpliedExtsZvl1024b[]
Definition: RISCVISAInfo.cpp:717
ImpliedExtsZfh
static const char * ImpliedExtsZfh[]
Definition: RISCVISAInfo.cpp:710
ImpliedExtsZvl128b
static const char * ImpliedExtsZvl128b[]
Definition: RISCVISAInfo.cpp:720
ImpliedExtsZvl8192b
static const char * ImpliedExtsZvl8192b[]
Definition: RISCVISAInfo.cpp:714
ImpliedExtsZvl512b
static const char * ImpliedExtsZvl512b[]
Definition: RISCVISAInfo.cpp:718
ImpliedExtsZvl65536b
static const char * ImpliedExtsZvl65536b[]
Definition: RISCVISAInfo.cpp:711
ImpliedExtsZvl2048b
static const char * ImpliedExtsZvl2048b[]
Definition: RISCVISAInfo.cpp:716
ImpliedExtsZvl64b
static const char * ImpliedExtsZvl64b[]
Definition: RISCVISAInfo.cpp:721
ImpliedExtsZvl32768b
static const char * ImpliedExtsZvl32768b[]
Definition: RISCVISAInfo.cpp:712
ImpliedExtsZvl16384b
static const char * ImpliedExtsZvl16384b[]
Definition: RISCVISAInfo.cpp:713
ImpliedExtsZvl4096b
static const char * ImpliedExtsZvl4096b[]
Definition: RISCVISAInfo.cpp:715
ImpliedExtsZvl256b
static const char * ImpliedExtsZvl256b[]
Definition: RISCVISAInfo.cpp:719