13#ifndef LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
14#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
367 return Desc.getNumOperands() - 1;
383 return Desc.getNumOperands() - 5;
385 return Desc.getNumOperands() - 4;
391 return Desc.getNumOperands() - 3;
412 return FeatureBits[RISCV::FeatureStdExtZicfilp] ? RISCV::X7 : RISCV::X6;
426 return Desc.getNumOperands() - 1;
436 int Idx = RISCV::getNamedOperandIdx(
Desc.getOpcode(), RISCV::OpName::rm);
437 assert(Idx >= 0 &&
"No rm operand?");
439 "Operand has wrong type");
451 int Idx = RISCV::getNamedOperandIdx(
Desc.getOpcode(), RISCV::OpName::rm);
452 assert(Idx >= 0 &&
"No rm operand?");
454 "Operand has wrong type");
464 return Desc.getNumDefs() <
Desc.getNumOperands() &&
690 if (
IsRV32Only && ActiveFeatures[RISCV::Feature64Bit])
699#define GET_SysRegEncodings_DECL
700#define GET_SysRegsList_DECL
701#include "RISCVGenSearchableTables.inc"
710#define GET_RISCVOpcodesList_DECL
711#include "RISCVGenSearchableTables.inc"
750namespace RISCVFeatures {
754void validate(
const Triple &TT,
const FeatureBitset &FeatureBits);
785 assert((!IsRVE || EndReg <= RISCV::X9) &&
"Invalid Rlist for RV32E");
786 switch (EndReg.
id()) {
817 assert(NumRegs > 0 && NumRegs < 14 && NumRegs != 12 &&
818 "Unexpected number of registers");
833 unsigned RegSize = IsRV64 ? 8 : 4;
840namespace RISCVVInversePseudosTable {
849#define GET_RISCVVInversePseudosTable_DECL
850#include "RISCVGenSearchableTables.inc"
853 uint8_t SEW,
bool IsAltFmt =
false) {
854 return getBaseInfoImpl(BaseInstr, VLMul, SEW, IsAltFmt);
932#define GET_RISCVVSSEGTable_DECL
933#define GET_RISCVVLSEGTable_DECL
934#define GET_RISCVVLXSEGTable_DECL
935#define GET_RISCVVSXSEGTable_DECL
936#define GET_RISCVVLETable_DECL
937#define GET_RISCVVSETable_DECL
938#define GET_RISCVVLXTable_DECL
939#define GET_RISCVVSXTable_DECL
940#define GET_RISCVNDSVLNTable_DECL
941#include "RISCVGenSearchableTables.inc"
944 return (Imm >= 1 && Imm <= 255) ||
945 (Imm >= 256 && Imm <= 504 && (Imm % 8) == 0) ||
946 (Imm >= 512 && Imm <= 4096 && (Imm % 16) == 0);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file implements a class to represent arbitrary precision integral constant values and operations...
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Tagged union holding either a T or a Error.
Container class for subtarget features.
Instances of this class represent a single low-level machine instruction.
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
constexpr unsigned id() const
Generic base class for all target subtargets.
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.
ABI getTargetABI(StringRef ABIName)
ABI computeTargetABI(const MCSubtargetInfo &STI, StringRef ABIName)
static bool isValidRoundingMode(unsigned Mode)
static RoundingMode stringToRoundingMode(StringRef Str)
static StringRef roundingModeToString(RoundingMode RndMode)
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
llvm::Expected< std::unique_ptr< RISCVISAInfo > > parseFeatureBits(const MCSubtargetInfo &STI)
static unsigned getVecPolicyOpNum(const MCInstrDesc &Desc)
static unsigned getTMOpNum(const MCInstrDesc &Desc)
static bool usesMaskPolicy(uint64_t TSFlags)
static bool hasRoundModeOp(uint64_t TSFlags)
static bool readsPastVL(uint64_t TSFlags)
static bool hasTWidenOp(uint64_t TSFlags)
static bool isTiedPseudo(uint64_t TSFlags)
static RISCVVType::VLMUL getLMul(uint64_t TSFlags)
static unsigned getTKOpNum(const MCInstrDesc &Desc)
static unsigned getVLOpNum(const MCInstrDesc &Desc)
static AltFmtType getAltFmtType(uint64_t TSFlags)
static unsigned getFormat(uint64_t TSFlags)
static unsigned getTWidenOpNum(const MCInstrDesc &Desc)
static bool hasTKOp(uint64_t TSFlags)
static bool hasVLOp(uint64_t TSFlags)
@ TargetOverlapConstraintTypeMask
@ TargetOverlapConstraintTypeShift
@ IsRVVWideningReductionShift
@ IsRVVWideningReductionMask
@ ElementsDependOnMaskShift
@ InstFormatNDS_BRANCH_10
@ ElementsDependOnVLShift
@ ElementsDependOnMaskMask
@ IsSignExtendingOpWShift
static MCRegister getTailExpandUseRegNo(const FeatureBitset &FeatureBits)
static bool elementsDependOnMask(uint64_t TSFlags)
static int getFRMOpNum(const MCInstrDesc &Desc)
static bool hasTMOp(uint64_t TSFlags)
static int getVXRMOpNum(const MCInstrDesc &Desc)
static unsigned getTNOpNum(const MCInstrDesc &Desc)
static bool hasVecPolicyOp(uint64_t TSFlags)
static bool usesVXRM(uint64_t TSFlags)
static bool isRVVWideningReduction(uint64_t TSFlags)
static unsigned getSEWOpNum(const MCInstrDesc &Desc)
static bool elementsDependOnVL(uint64_t TSFlags)
static bool hasSEWOp(uint64_t TSFlags)
static bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc)
int getLoadFPImm(APFloat FPImm)
getLoadFPImm - Return a 5-bit binary encoding of the floating-point immediate value.
float getFPImm(unsigned Imm)
@ OPERAND_UIMMLOG2XLEN_NONZERO
@ OPERAND_SIMM12_LSB00000
@ OPERAND_SIMM10_UNSIGNED
@ OPERAND_FIRST_RISCV_IMM
@ OPERAND_UIMM10_LSB00_NONZERO
@ OPERAND_SIMM10_LSB0000_NONZERO
@ OPERAND_ATOMIC_ORDERING
@ OPERAND_UIMM5_GE6_PLUS1
bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI)
const PseudoInfo * getBaseInfo(unsigned BaseInstr, uint8_t VLMul, uint8_t SEW, bool IsAltFmt=false)
static bool isValidRoundingMode(unsigned Mode)
static RoundingMode stringToRoundingMode(StringRef Str)
static StringRef roundingModeToString(RoundingMode RndMode)
unsigned encodeRegList(MCRegister EndReg, bool IsRVE=false)
static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64)
void printRegList(unsigned RlistEncode, raw_ostream &OS)
static unsigned encodeRegListNumRegs(unsigned NumRegs)
bool isValidYBNDSWImm(int64_t Imm)
static StringRef SMTVTypeModeToString(SMTVTypeMode TypeMode)
static SMTVTypeMode stringToSMTVTypeMode(StringRef Str)
static bool isValidSMTVTypeMode(unsigned Mode)
This is an optimization pass for GlobalISel generic memory operations.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
FeatureBitset FeaturesRequired
bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const