23#define PROC(ENUM, NAME, DEFAULT_MARCH, FAST_SCALAR_UNALIGN, \
24 FAST_VECTOR_UNALIGN, MVENDORID, MARCHID, MIMPID) \
26#define TUNE_PROC(ENUM, NAME) CK_##ENUM,
27#include "llvm/TargetParser/RISCVTargetParserDef.inc"
31#define PROC(ENUM, NAME, DEFAULT_MARCH, FAST_SCALAR_UNALIGN, \
32 FAST_VECTOR_UNALIGN, MVENDORID, MARCHID, MIMPID) \
36 FAST_SCALAR_UNALIGN, \
37 FAST_VECTOR_UNALIGN, \
38 {MVENDORID, MARCHID, MIMPID}, \
40#include "llvm/TargetParser/RISCVTargetParserDef.inc"
52 return Info &&
Info->FastScalarUnalignedAccess;
57 return Info &&
Info->FastVectorUnalignedAccess;
84 return Info->is64Bit() == IsRV64;
88 std::optional<CPUKind> Kind =
91 #include "llvm/TargetParser/RISCVTargetParserDef.inc"
105 return Info->DefaultMarch;
110 if (IsRV64 ==
C.is64Bit())
117 if (IsRV64 ==
C.is64Bit())
120#define TUNE_PROC(ENUM, NAME) Values.emplace_back(StringRef(NAME));
121#include "llvm/TargetParser/RISCVTargetParserDef.inc"
129 if (MarchFromCPU ==
"")
132 EnabledFeatures.
clear();
139 std::vector<std::string> FeatStrings =
140 (*RII)->toFeatures(
false);
141 for (
const auto &
F : FeatStrings)
150namespace RISCVVType {
162 bool MaskAgnostic,
bool AltFmt) {
164 unsigned VLMulBits =
static_cast<unsigned>(VLMul);
166 unsigned VTypeI = (VSEWBits << 3) | (VLMulBits & 0x7);
182 unsigned VTypeI = (VSEWBits << 3) | AltFmt << 8 | TWiden << 9;
194 return std::make_pair(1 <<
static_cast<unsigned>(VLMul),
false);
198 return std::make_pair(1 << (8 -
static_cast<unsigned>(VLMul)),
true);
203 unsigned Sew =
getSEW(VType);
237 LMul = Fractional ? (8 / LMul) : (LMul * 8);
239 assert(SEW >= 8 &&
"Unexpected SEW value");
240 return (SEW * 8) / LMul;
245 unsigned EMULFixedPoint = (EEW * 8) / Ratio;
246 bool Fractional = EMULFixedPoint < 8;
247 unsigned EMUL = Fractional ? 8 / EMULFixedPoint : EMULFixedPoint / 8;
static SDValue Widen(SelectionDAG *CurDAG, SDValue N)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Analysis containing CSE Info
#define TUNE_PROC(ENUM, NAME)
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static LLVM_ABI llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseArchString(StringRef Arch, bool EnableExperimentalExtension, bool ExperimentalExtensionVersionCheck=true)
Parse RISC-V ISA info from arch string.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
static bool isTailAgnostic(unsigned VType)
static VLMUL encodeLMUL(unsigned LMUL, bool Fractional)
LLVM_ABI std::optional< VLMUL > getSameRatioLMUL(unsigned SEW, VLMUL VLMUL, unsigned EEW)
LLVM_ABI unsigned encodeXSfmmVType(unsigned SEW, unsigned Widen, bool AltFmt)
static bool isValidLMUL(unsigned LMUL, bool Fractional)
static bool isMaskAgnostic(unsigned VType)
LLVM_ABI std::pair< unsigned, bool > decodeVLMUL(VLMUL VLMul)
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 isAltFmt(unsigned VType)
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)
static const CPUInfo * getCPUInfoByName(StringRef CPU)
constexpr CPUInfo RISCVCPUInfo[]
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)
LLVM_ABI bool hasValidCPUModel(StringRef CPU)
LLVM_ABI StringRef getCPUNameFromCPUModel(const CPUModel &Model)
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.
bool errorToBool(Error Err)
Helper for converting an Error to a bool.
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.