llvm/llvm/lib/TargetParser/RISCVISAInfo.cpp

//===-- RISCVISAInfo.cpp - RISC-V Arch String Parser ----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/ADT/STLExtras.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>

usingnamespacellvm;

namespace {

struct RISCVSupportedExtension {};

struct RISCVProfile {};

} // end anonymous namespace

static const char *RISCVGImplications[] =;

#define GET_SUPPORTED_EXTENSIONS
#include "llvm/TargetParser/RISCVTargetParserDef.inc"

#define GET_SUPPORTED_PROFILES
#include "llvm/TargetParser/RISCVTargetParserDef.inc"

static void verifyTables() {}

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

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

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

static bool stripExperimentalPrefix(StringRef &Ext) {}

// This function finds the last character that doesn't belong to a version
// (e.g. zba1p0 is extension 'zba' of version '1p0'). So the function will
// consume [0-9]*p[0-9]* starting from the backward. An extension name will not
// end with a digit or the letter 'p', so this function will parse correctly.
// NOTE: This function is NOT able to take empty strings or strings that only
// have version numbers and no extension name. It assumes the extension name
// will be at least more than one character.
static size_t findLastNonVersionCharacter(StringRef Ext) {}

namespace {
struct LessExtName {};
} // namespace

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

static StringRef getExtensionTypeDesc(StringRef Ext) {}

static StringRef getExtensionType(StringRef Ext) {}

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

bool RISCVISAInfo::isSupportedExtensionFeature(StringRef Ext) {}

bool RISCVISAInfo::isSupportedExtension(StringRef Ext) {}

bool RISCVISAInfo::isSupportedExtension(StringRef Ext, unsigned MajorVersion,
                                        unsigned MinorVersion) {}

bool RISCVISAInfo::hasExtension(StringRef Ext) const {}

std::vector<std::string> RISCVISAInfo::toFeatures(bool AddAllExtensions,
                                                  bool IgnoreUnknown) const {}

static Error getError(const Twine &Message) {}

static Error getErrorForInvalidExt(StringRef ExtName) {}

// Extensions may have a version number, and may be separated by
// an underscore '_' e.g.: rv32i2_m2.
// Version number is divided into major and minor version numbers,
// separated by a 'p'. If the minor version is 0 then 'p0' can be
// omitted from the version string. E.g., rv32i2p0, rv32i2, rv32i2p1.
static Error getExtensionVersion(StringRef Ext, StringRef In, unsigned &Major,
                                 unsigned &Minor, unsigned &ConsumeLength,
                                 bool EnableExperimentalExtension,
                                 bool ExperimentalExtensionVersionCheck) {}

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

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

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

llvm::Expected<std::unique_ptr<RISCVISAInfo>>
RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
                              bool ExperimentalExtensionVersionCheck) {}

static Error getIncompatibleError(StringRef Ext1, StringRef Ext2) {}

static Error getExtensionRequiresError(StringRef Ext, StringRef ReqExt) {}

Error RISCVISAInfo::checkDependency() {}

struct ImpliedExtsEntry {};

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

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

#define GET_IMPLIED_EXTENSIONS
#include "llvm/TargetParser/RISCVTargetParserDef.inc"

void RISCVISAInfo::updateImplication() {}

static constexpr StringLiteral CombineIntoExts[] =;

void RISCVISAInfo::updateCombination() {}

void RISCVISAInfo::updateImpliedLengths() {}

std::string RISCVISAInfo::toString() const {}

llvm::Expected<std::unique_ptr<RISCVISAInfo>>
RISCVISAInfo::postProcessAndChecking(std::unique_ptr<RISCVISAInfo> &&ISAInfo) {}

StringRef RISCVISAInfo::computeDefaultABI() const {}

bool RISCVISAInfo::isSupportedExtensionWithVersion(StringRef Ext) {}

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

struct RISCVExtBit {};

constexpr static RISCVExtBit RISCVBitPositions[] =;

std::pair<int, int> RISCVISAInfo::getRISCVFeaturesBitsInfo(StringRef Ext) {}