#ifndef LLVM_TARGETPARSER_RISCVTARGETPARSER_H
#define LLVM_TARGETPARSER_RISCVTARGETPARSER_H
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
namespace llvm {
class Triple;
namespace RISCV {
namespace RISCVExtensionBitmaskTable {
struct RISCVExtensionBitmask { … };
}
static constexpr unsigned RVVBitsPerBlock = …;
void getFeaturesForCPU(StringRef CPU,
SmallVectorImpl<std::string> &EnabledFeatures,
bool NeedPlus = false);
bool parseCPU(StringRef CPU, bool IsRV64);
bool parseTuneCPU(StringRef CPU, bool IsRV64);
StringRef getMArchFromMcpu(StringRef CPU);
void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
bool hasFastScalarUnalignedAccess(StringRef CPU);
bool hasFastVectorUnalignedAccess(StringRef CPU);
}
namespace RISCVII {
enum VLMUL : uint8_t { … };
enum { … };
}
namespace RISCVVType {
inline static bool isValidSEW(unsigned SEW) { … }
inline static bool isValidLMUL(unsigned LMUL, bool Fractional) { … }
unsigned encodeVTYPE(RISCVII::VLMUL VLMUL, unsigned SEW, bool TailAgnostic,
bool MaskAgnostic);
inline static RISCVII::VLMUL getVLMUL(unsigned VType) { … }
std::pair<unsigned, bool> decodeVLMUL(RISCVII::VLMUL VLMUL);
inline static RISCVII::VLMUL encodeLMUL(unsigned LMUL, bool Fractional) { … }
inline static unsigned decodeVSEW(unsigned VSEW) { … }
inline static unsigned encodeSEW(unsigned SEW) { … }
inline static unsigned getSEW(unsigned VType) { … }
inline static bool isTailAgnostic(unsigned VType) { … }
inline static bool isMaskAgnostic(unsigned VType) { … }
void printVType(unsigned VType, raw_ostream &OS);
unsigned getSEWLMULRatio(unsigned SEW, RISCVII::VLMUL VLMul);
std::optional<RISCVII::VLMUL>
getSameRatioLMUL(unsigned SEW, RISCVII::VLMUL VLMUL, unsigned EEW);
}
}
#endif