#ifndef LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
#include "MCTargetDesc/RISCVMCTargetDesc.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/TargetParser/RISCVTargetParser.h"
#include "llvm/TargetParser/SubtargetFeature.h"
namespace llvm {
namespace RISCVII {
enum { … };
static inline unsigned getFormat(uint64_t TSFlags) { … }
static inline VLMUL getLMul(uint64_t TSFlags) { … }
static inline bool doesForceTailAgnostic(uint64_t TSFlags) { … }
static inline bool isTiedPseudo(uint64_t TSFlags) { … }
static inline bool hasSEWOp(uint64_t TSFlags) { … }
static inline bool hasVLOp(uint64_t TSFlags) { … }
static inline bool hasVecPolicyOp(uint64_t TSFlags) { … }
static inline bool isRVVWideningReduction(uint64_t TSFlags) { … }
static inline bool usesMaskPolicy(uint64_t TSFlags) { … }
static inline bool hasRoundModeOp(uint64_t TSFlags) { … }
static inline bool usesVXRM(uint64_t TSFlags) { … }
static inline bool elementsDependOnVL(uint64_t TSFlags) { … }
static inline bool elementsDependOnMask(uint64_t TSFlags) { … }
static inline unsigned getVLOpNum(const MCInstrDesc &Desc) { … }
static inline unsigned getSEWOpNum(const MCInstrDesc &Desc) { … }
static inline unsigned getVecPolicyOpNum(const MCInstrDesc &Desc) { … }
static inline int getFRMOpNum(const MCInstrDesc &Desc) { … }
static inline int getVXRMOpNum(const MCInstrDesc &Desc) { … }
static inline bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc) { … }
enum { … };
}
namespace RISCVOp {
enum OperandType : unsigned { … };
}
namespace RISCVFenceField {
enum FenceField { … };
}
namespace RISCVFPRndMode {
enum RoundingMode { … };
inline static StringRef roundingModeToString(RoundingMode RndMode) { … }
inline static RoundingMode stringToRoundingMode(StringRef Str) { … }
inline static bool isValidRoundingMode(unsigned Mode) { … }
}
namespace RISCVVXRndMode {
enum RoundingMode { … };
}
namespace RISCVLoadFPImm {
float getFPImm(unsigned Imm);
int getLoadFPImm(APFloat FPImm);
}
namespace RISCVSysReg {
struct SysReg { … };
#define GET_SysRegsList_DECL
#include "RISCVGenSearchableTables.inc"
}
namespace RISCVInsnOpcode {
struct RISCVOpcode { … };
#define GET_RISCVOpcodesList_DECL
#include "RISCVGenSearchableTables.inc"
}
namespace RISCVABI {
enum ABI { … };
ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
StringRef ABIName);
ABI getTargetABI(StringRef ABIName);
MCRegister getBPReg();
MCRegister getSCSPReg();
}
namespace RISCVFeatures {
void validate(const Triple &TT, const FeatureBitset &FeatureBits);
llvm::Expected<std::unique_ptr<RISCVISAInfo>>
parseFeatureBits(bool IsRV64, const FeatureBitset &FeatureBits);
}
namespace RISCVRVC {
bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
}
namespace RISCVZC {
enum RLISTENCODE { … };
inline unsigned encodeRlist(MCRegister EndReg, bool IsRV32E = false) { … }
inline static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64) { … }
inline static bool getSpimm(unsigned RlistVal, unsigned &SpimmVal,
int64_t StackAdjustment, bool IsRV64) { … }
void printRlist(unsigned SlistEncode, raw_ostream &OS);
}
}
#endif