#include "clang/Support/RISCVVIntrinsicUtils.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <numeric>
#include <optional>
usingnamespacellvm;
namespace clang {
namespace RISCV {
const PrototypeDescriptor PrototypeDescriptor::Mask = …;
const PrototypeDescriptor PrototypeDescriptor::VL = …;
const PrototypeDescriptor PrototypeDescriptor::Vector = …;
LMULType::LMULType(int NewLog2LMUL) { … }
std::string LMULType::str() const { … }
VScaleVal LMULType::getScale(unsigned ElementBitwidth) const { … }
void LMULType::MulLog2LMUL(int log2LMUL) { … }
RVVType::RVVType(BasicType BT, int Log2LMUL,
const PrototypeDescriptor &prototype)
: … { … }
bool RVVType::verifyType() const { … }
void RVVType::initBuiltinStr() { … }
void RVVType::initClangBuiltinStr() { … }
void RVVType::initTypeStr() { … }
void RVVType::initShortStr() { … }
static VectorTypeModifier getTupleVTM(unsigned NF) { … }
void RVVType::applyBasicType() { … }
std::optional<PrototypeDescriptor>
PrototypeDescriptor::parsePrototypeDescriptor(
llvm::StringRef PrototypeDescriptorStr) { … }
void RVVType::applyModifier(const PrototypeDescriptor &Transformer) { … }
void RVVType::applyLog2EEW(unsigned Log2EEW) { … }
void RVVType::applyFixedSEW(unsigned NewSEW) { … }
void RVVType::applyFixedLog2LMUL(int Log2LMUL, enum FixedLMULType Type) { … }
std::optional<RVVTypes>
RVVTypeCache::computeTypes(BasicType BT, int Log2LMUL, unsigned NF,
ArrayRef<PrototypeDescriptor> Prototype) { … }
static uint64_t computeRVVTypeHashValue(BasicType BT, int Log2LMUL,
PrototypeDescriptor Proto) { … }
std::optional<RVVTypePtr> RVVTypeCache::computeType(BasicType BT, int Log2LMUL,
PrototypeDescriptor Proto) { … }
RVVIntrinsic::RVVIntrinsic(
StringRef NewName, StringRef Suffix, StringRef NewOverloadedName,
StringRef OverloadedSuffix, StringRef IRName, bool IsMasked,
bool HasMaskedOffOperand, bool HasVL, PolicyScheme Scheme,
bool SupportOverloading, bool HasBuiltinAlias, StringRef ManualCodegen,
const RVVTypes &OutInTypes, const std::vector<int64_t> &NewIntrinsicTypes,
unsigned NF, Policy NewPolicyAttrs, bool HasFRMRoundModeOp)
: … { … }
std::string RVVIntrinsic::getBuiltinTypeStr() const { … }
std::string RVVIntrinsic::getSuffixStr(
RVVTypeCache &TypeCache, BasicType Type, int Log2LMUL,
llvm::ArrayRef<PrototypeDescriptor> PrototypeDescriptors) { … }
llvm::SmallVector<PrototypeDescriptor> RVVIntrinsic::computeBuiltinTypes(
llvm::ArrayRef<PrototypeDescriptor> Prototype, bool IsMasked,
bool HasMaskedOffOperand, bool HasVL, unsigned NF,
PolicyScheme DefaultScheme, Policy PolicyAttrs, bool IsTuple) { … }
llvm::SmallVector<Policy> RVVIntrinsic::getSupportedUnMaskedPolicies() { … }
llvm::SmallVector<Policy>
RVVIntrinsic::getSupportedMaskedPolicies(bool HasTailPolicy,
bool HasMaskPolicy) { … }
void RVVIntrinsic::updateNamesAndPolicy(
bool IsMasked, bool HasPolicy, std::string &Name, std::string &BuiltinName,
std::string &OverloadedName, Policy &PolicyAttrs, bool HasFRMRoundModeOp) { … }
SmallVector<PrototypeDescriptor> parsePrototypes(StringRef Prototypes) { … }
raw_ostream &operator<<(raw_ostream &OS, const RVVIntrinsicRecord &Record) { … }
}
}