14#ifndef LLVM_TARGETPARSER_RISCVTARGETPARSER_H
15#define LLVM_TARGETPARSER_RISCVTARGETPARSER_H
56 bool NeedPlus =
false);
96inline static bool isValidLMUL(
unsigned LMUL,
bool Fractional) {
97 return isPowerOf2_32(LMUL) && LMUL <= 8 && (!Fractional || LMUL != 1);
101 bool MaskAgnostic,
bool AltFmt =
false);
106 unsigned VLMul = VType & 0x7;
107 return static_cast<VLMUL>(VLMul);
115 unsigned LmulLog2 =
Log2_32(LMUL);
116 return static_cast<VLMUL>(Fractional ? 8 - LmulLog2 : LmulLog2);
120 assert(VSEW < 8 &&
"Unexpected VSEW value");
121 return 1 << (VSEW + 3);
129inline static unsigned getSEW(
unsigned VType) {
130 unsigned VSEW = (VType >> 3) & 0x7;
135 assert((TWiden == 1 || TWiden == 2 || TWiden == 3) &&
136 "Unexpected TWiden value");
137 return 1 << (TWiden - 1);
141 unsigned TWiden = (VType >> 9) & 0x3;
146 unsigned TWiden = (VType >> 9) & 0x3;
147 assert(TWiden != 0 &&
"Invalid widen value");
148 return 1 << (TWiden - 1);
160inline static bool isAltFmt(
unsigned VType) {
return VType & 0x100; }
static SDValue Widen(SelectionDAG *CurDAG, SDValue N)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
This class implements an extremely fast bulk output stream that can only output to a stream.
static bool isTailAgnostic(unsigned VType)
static VLMUL encodeLMUL(unsigned LMUL, bool Fractional)
static unsigned decodeVSEW(unsigned VSEW)
LLVM_ABI std::optional< VLMUL > getSameRatioLMUL(unsigned SEW, VLMUL VLMUL, unsigned EEW)
LLVM_ABI unsigned encodeXSfmmVType(unsigned SEW, unsigned Widen, bool AltFmt)
static unsigned getXSfmmWiden(unsigned VType)
static bool isValidLMUL(unsigned LMUL, bool Fractional)
static bool isMaskAgnostic(unsigned VType)
LLVM_ABI std::pair< unsigned, bool > decodeVLMUL(VLMUL VLMul)
static bool hasXSfmmWiden(unsigned VType)
static unsigned encodeSEW(unsigned SEW)
LLVM_ABI unsigned getSEWLMULRatio(unsigned SEW, VLMUL VLMul)
static bool isValidSEW(unsigned SEW)
LLVM_ABI void printVType(unsigned VType, raw_ostream &OS)
static bool isValidXSfmmVType(unsigned VTypeI)
static unsigned decodeTWiden(unsigned TWiden)
static bool isAltFmt(unsigned VType)
@ TAIL_UNDISTURBED_MASK_UNDISTURBED
LLVM_ABI unsigned encodeVTYPE(VLMUL VLMUL, unsigned SEW, bool TailAgnostic, bool MaskAgnostic, bool AltFmt=false)
static unsigned getSEW(unsigned VType)
static VLMUL getVLMUL(unsigned VType)
LLVM_ABI bool hasFastVectorUnalignedAccess(StringRef CPU)
LLVM_ABI void getFeaturesForCPU(StringRef CPU, SmallVectorImpl< std::string > &EnabledFeatures, bool NeedPlus=false)
LLVM_ABI void fillValidTuneCPUArchList(SmallVectorImpl< StringRef > &Values, bool IsRV64)
LLVM_ABI CPUModel getCPUModel(StringRef CPU)
LLVM_ABI StringRef getMArchFromMcpu(StringRef CPU)
LLVM_ABI bool parseCPU(StringRef CPU, bool IsRV64)
LLVM_ABI bool hasFastScalarUnalignedAccess(StringRef CPU)
static constexpr unsigned RVVBitsPerBlock
LLVM_ABI bool hasValidCPUModel(StringRef CPU)
LLVM_ABI StringRef getCPUNameFromCPUModel(const CPUModel &Model)
static constexpr unsigned RVVBytesPerBlock
LLVM_ABI bool parseTuneCPU(StringRef CPU, bool IsRV64)
LLVM_ABI void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values, bool IsRV64)
This is an optimization pass for GlobalISel generic memory operations.
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
StringLiteral DefaultMarch
bool FastVectorUnalignedAccess
bool FastScalarUnalignedAccess
bool operator==(const CPUModel &Other) const