LLVM 23.0.0git
RISCVBaseInfo.h
Go to the documentation of this file.
1//===-- RISCVBaseInfo.h - Top level definitions for RISC-V MC ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains small standalone enum definitions for the RISC-V target
10// useful for the compiler back-end and the MC libraries.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
14#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
15
17#include "llvm/ADT/APFloat.h"
18#include "llvm/ADT/APInt.h"
19#include "llvm/ADT/StringRef.h"
22#include "llvm/MC/MCInstrDesc.h"
26
27namespace llvm {
28
29class MCSubtargetInfo;
30
31namespace RISCVOp {
32enum OperandType : unsigned {
103 // Operand is a 3-bit rounding mode, '111' indicates FRM register.
104 // Represents 'frm' argument passing to floating-point operations.
106 // Operand is a 3-bit rounding mode where only RTZ is valid.
108 // Condition code used by select and short forward branch pseudos.
110 // Ordering for atomic pseudos.
112 // Vector policy operand.
114 // Vector SEW operand. Stores in log2(SEW).
116 // Special SEW for mask only instructions. Always 0.
118 // Vector rounding mode for VXRM or FRM.
120 // Vtype operand for XSfmm extension.
122 // XSfmm twiden operand.
125
128
129 // Simm12 or constant pool, global, basicblock, etc.
131
133
134 // Operand is either a register or uimm5, this is used by V extension pseudo
135 // instructions to represent a value that be passed as AVL to either vsetvli
136 // or vsetivli.
138
139 // Operand is either a register or imm, this is used by short forward branch
140 // (SFB) pseudos to enable SFB with branches on reg-reg and reg-imm compares.
142
143 // Operand is a branch opcode, this too is used by SFB pseudos.
145
149};
150} // namespace RISCVOp
151
152// RISCVII - This namespace holds all of the target specific flags that
153// instruction info tracks. All definitions must match RISCVInstrFormats.td.
154namespace RISCVII {
155enum : uint64_t {
185
188
194
197
198 // Is this a _TIED vector pseudo instruction. For these instructions we
199 // shouldn't skip the tied operand when converting to MC instructions.
202
203 // Does this instruction have a SEW operand. It will be the last explicit
204 // operand unless there is a vector policy operand. Used by RVV Pseudos.
207
208 // Does this instruction have a VL operand. It will be the second to last
209 // explicit operand unless there is a vector policy operand. Used by RVV
210 // Pseudos.
213
214 // Does this instruction have a vector policy operand. It will be the last
215 // explicit operand. Used by RVV Pseudos.
218
219 // Is this instruction a vector widening reduction instruction. Used by RVV
220 // Pseudos.
223
224 // Does this instruction care about mask policy. If it is not, the mask policy
225 // could be either agnostic or undisturbed. For example, unmasked, store, and
226 // reduction operations result would not be affected by mask policy, so
227 // compiler has free to select either one.
230
231 // Indicates that the result can be considered sign extended from bit 31. Some
232 // instructions with this flag aren't W instructions, but are either sign
233 // extended from a smaller size, always outputs a small integer, or put zeros
234 // in bits 63:31. Used by the SExtWRemoval pass.
237
240
243
244 // Indicates whether these instructions can partially overlap between source
245 // registers and destination registers according to the vector spec.
246 // 0 -> not a vector pseudo
247 // 1 -> default value for vector pseudos. not widening or narrowing.
248 // 2 -> narrowing case
249 // 3 -> widening case
252
255
258
259 // Indicates the EEW of a vector instruction's destination operand.
260 // 0 -> 1
261 // 1 -> SEW
262 // 2 -> SEW * 2
263 // 3 -> SEW * 4
266
269
270 // 0 -> Don't care about altfmt bit in VTYPE.
271 // 1 -> Is not altfmt.
272 // 2 -> Is altfmt(BF16).
275
276 // XSfmmbase
279
282
285
288};
289
290// Helper functions to read TSFlags.
291/// \returns the format of the instruction.
292static inline unsigned getFormat(uint64_t TSFlags) {
293 return (TSFlags & InstFormatMask) >> InstFormatShift;
294}
295/// \returns the LMUL for the instruction.
296static inline RISCVVType::VLMUL getLMul(uint64_t TSFlags) {
297 return static_cast<RISCVVType::VLMUL>((TSFlags & VLMulMask) >> VLMulShift);
298}
299/// \returns true if this a _TIED pseudo.
300static inline bool isTiedPseudo(uint64_t TSFlags) {
301 return TSFlags & IsTiedPseudoMask;
302}
303/// \returns true if there is a SEW operand for the instruction.
304static inline bool hasSEWOp(uint64_t TSFlags) {
305 return TSFlags & HasSEWOpMask;
306}
307/// \returns true if there is a VL operand for the instruction.
308static inline bool hasVLOp(uint64_t TSFlags) {
309 return TSFlags & HasVLOpMask;
310}
311/// \returns true if there is a vector policy operand for this instruction.
312static inline bool hasVecPolicyOp(uint64_t TSFlags) {
313 return TSFlags & HasVecPolicyOpMask;
314}
315/// \returns true if it is a vector widening reduction instruction.
316static inline bool isRVVWideningReduction(uint64_t TSFlags) {
317 return TSFlags & IsRVVWideningReductionMask;
318}
319/// \returns true if mask policy is valid for the instruction.
320static inline bool usesMaskPolicy(uint64_t TSFlags) {
321 return TSFlags & UsesMaskPolicyMask;
322}
323
324/// \returns true if there is a rounding mode operand for this instruction
325static inline bool hasRoundModeOp(uint64_t TSFlags) {
326 return TSFlags & HasRoundModeOpMask;
327}
328
330static inline AltFmtType getAltFmtType(uint64_t TSFlags) {
331 return static_cast<AltFmtType>((TSFlags & AltFmtTypeMask) >> AltFmtTypeShift);
332}
333
334/// \returns true if this instruction uses vxrm
335static inline bool usesVXRM(uint64_t TSFlags) { return TSFlags & UsesVXRMMask; }
336
337/// \returns true if the elements in the body are affected by VL,
338/// e.g. vslide1down.vx/vredsum.vs/viota.m
339static inline bool elementsDependOnVL(uint64_t TSFlags) {
340 return TSFlags & ElementsDependOnVLMask;
341}
342
343/// \returns true if the elements in the body are affected by the mask,
344/// e.g. vredsum.vs/viota.m
345static inline bool elementsDependOnMask(uint64_t TSFlags) {
346 return TSFlags & ElementsDependOnMaskMask;
347}
348
349/// \returns true if the instruction may read elements past VL, e.g.
350/// vslidedown/vrgather
351static inline bool readsPastVL(uint64_t TSFlags) {
352 return TSFlags & ReadsPastVLMask;
353}
354
355// XSfmmbase
356static inline bool hasTWidenOp(uint64_t TSFlags) {
357 return TSFlags & HasTWidenOpMask;
358}
359
360static inline bool hasTMOp(uint64_t TSFlags) { return TSFlags & HasTMOpMask; }
361
362static inline bool hasTKOp(uint64_t TSFlags) { return TSFlags & HasTKOpMask; }
363
364static inline unsigned getTWidenOpNum(const MCInstrDesc &Desc) {
365 assert(hasTWidenOp(Desc.TSFlags));
366 return Desc.getNumOperands() - 1;
367}
368
369static inline unsigned getTNOpNum(const MCInstrDesc &Desc) {
370 const uint64_t TSFlags = Desc.TSFlags;
371 assert(hasTWidenOp(TSFlags) && hasVLOp(TSFlags));
372 unsigned Offset = 3;
373 if (hasTKOp(TSFlags))
374 Offset = 4;
375 return Desc.getNumOperands() - Offset;
376}
377
378static inline unsigned getTMOpNum(const MCInstrDesc &Desc) {
379 const uint64_t TSFlags = Desc.TSFlags;
380 assert(hasTWidenOp(TSFlags) && hasTMOp(TSFlags));
381 if (hasTKOp(TSFlags))
382 return Desc.getNumOperands() - 5;
383 // vtzero.t
384 return Desc.getNumOperands() - 4;
385}
386
387static inline unsigned getTKOpNum(const MCInstrDesc &Desc) {
388 [[maybe_unused]] const uint64_t TSFlags = Desc.TSFlags;
389 assert(hasTWidenOp(TSFlags) && hasTKOp(TSFlags));
390 return Desc.getNumOperands() - 3;
391}
392
393static inline unsigned getVLOpNum(const MCInstrDesc &Desc) {
394 const uint64_t TSFlags = Desc.TSFlags;
395 // This method is only called if we expect to have a VL operand, and all
396 // instructions with VL also have SEW.
397 assert(hasSEWOp(TSFlags) && hasVLOp(TSFlags));
398 // In Xsfmmbase, TN is an alias for VL, so here we use the same TSFlags bit.
399 if (hasTWidenOp(TSFlags))
400 return getTNOpNum(Desc);
401 unsigned Offset = 2;
402 if (hasVecPolicyOp(TSFlags))
403 Offset = 3;
404 return Desc.getNumOperands() - Offset;
405}
406
407static inline MCRegister
409 // For Zicfilp, PseudoTAIL should be expanded to a software guarded branch.
410 // It means to use t2(x7) as rs1 of JALR to expand PseudoTAIL.
411 return FeatureBits[RISCV::FeatureStdExtZicfilp] ? RISCV::X7 : RISCV::X6;
412}
413
414static inline unsigned getSEWOpNum(const MCInstrDesc &Desc) {
415 const uint64_t TSFlags = Desc.TSFlags;
416 assert(hasSEWOp(TSFlags));
417 unsigned Offset = 1;
418 if (hasVecPolicyOp(TSFlags) || hasTWidenOp(TSFlags))
419 Offset = 2;
420 return Desc.getNumOperands() - Offset;
421}
422
423static inline unsigned getVecPolicyOpNum(const MCInstrDesc &Desc) {
424 assert(hasVecPolicyOp(Desc.TSFlags));
425 return Desc.getNumOperands() - 1;
426}
427
428/// \returns the index to the rounding mode immediate value if any, otherwise
429/// returns -1.
430static inline int getFRMOpNum(const MCInstrDesc &Desc) {
431 const uint64_t TSFlags = Desc.TSFlags;
432 if (!hasRoundModeOp(TSFlags) || usesVXRM(TSFlags))
433 return -1;
434
435 int Idx = RISCV::getNamedOperandIdx(Desc.getOpcode(), RISCV::OpName::rm);
436 assert(Idx >= 0 && "No rm operand?");
437 assert(Desc.operands()[Idx].OperandType == RISCVOp::OPERAND_VEC_RM &&
438 "Operand has wrong type");
439
440 return Idx;
441}
442
443/// \returns the index to the rounding mode immediate value if any, otherwise
444/// returns -1.
445static inline int getVXRMOpNum(const MCInstrDesc &Desc) {
446 const uint64_t TSFlags = Desc.TSFlags;
447 if (!hasRoundModeOp(TSFlags) || !usesVXRM(TSFlags))
448 return -1;
449
450 int Idx = RISCV::getNamedOperandIdx(Desc.getOpcode(), RISCV::OpName::rm);
451 assert(Idx >= 0 && "No rm operand?");
452 assert(Desc.operands()[Idx].OperandType == RISCVOp::OPERAND_VEC_RM &&
453 "Operand has wrong type");
454
455 return Idx;
456}
457
458// Is the first def operand tied to the first use operand. This is true for
459// vector pseudo instructions that have a merge operand for tail/mask
460// undisturbed. It's also true for vector FMA instructions where one of the
461// operands is also the destination register.
462static inline bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc) {
463 return Desc.getNumDefs() < Desc.getNumOperands() &&
464 Desc.getOperandConstraint(Desc.getNumDefs(), MCOI::TIED_TO) == 0;
465}
466
467// RISC-V Specific Machine Operand Flags
468enum {
471 MO_LO = 3,
472 MO_HI = 4,
486
487 // Used to differentiate between target-specific "direct" flags and "bitmask"
488 // flags. A machine operand can only have one "direct" flag, but can have
489 // multiple "bitmask" flags.
491};
492} // namespace RISCVII
493
494// Describes the predecessor/successor bits used in the FENCE instruction.
497 I = 8,
498 O = 4,
499 R = 2,
500 W = 1
501};
502}
503
504// Describes the supported floating point rounding mode encodings.
505namespace RISCVFPRndMode {
507 RNE = 0,
508 RTZ = 1,
509 RDN = 2,
510 RUP = 3,
511 RMM = 4,
512 DYN = 7,
514};
515
517 switch (RndMode) {
518 default:
519 llvm_unreachable("Unknown floating point rounding mode");
521 return "rne";
523 return "rtz";
525 return "rdn";
527 return "rup";
529 return "rmm";
531 return "dyn";
532 }
533}
534
545
546inline static bool isValidRoundingMode(unsigned Mode) {
547 switch (Mode) {
548 default:
549 return false;
556 return true;
557 }
558}
559} // namespace RISCVFPRndMode
560
561namespace XSMTVTypeMode {
563 // Define the different SMT VType modes here
567};
568
570 switch (TypeMode) {
571 default:
572 llvm_unreachable("Unknown VType mode of SpacemiT Integer Matrix");
574 return "i4";
576 return "i8";
577 }
578}
579
586
587inline static bool isValidSMTVTypeMode(unsigned Mode) {
588 switch (Mode) {
589 default:
590 return false;
593 return true;
594 }
595}
596
597} // namespace XSMTVTypeMode
598
599namespace RISCVVXRndMode {
601 RNU = 0,
602 RNE = 1,
603 RDN = 2,
604 ROD = 3,
606};
607
609 switch (RndMode) {
610 default:
611 llvm_unreachable("Unknown vector fixed-point rounding mode");
613 return "rnu";
615 return "rne";
617 return "rdn";
619 return "rod";
620 }
621}
622
631
632inline static bool isValidRoundingMode(unsigned Mode) {
633 switch (Mode) {
634 default:
635 return false;
640 return true;
641 }
642}
643} // namespace RISCVVXRndMode
644
647 NX = 0x01, // Inexact
648 UF = 0x02, // Underflow
649 OF = 0x04, // Overflow
650 DZ = 0x08, // Divide by zero
651 NV = 0x10, // Invalid operation
652 ALL = 0x1F // Mask for all accrued exception flags
653};
654}
655
656//===----------------------------------------------------------------------===//
657// Floating-point Immediates
658//
659
660namespace RISCVLoadFPImm {
661float getFPImm(unsigned Imm);
662
663/// getLoadFPImm - Return a 5-bit binary encoding of the floating-point
664/// immediate value. If the value cannot be represented as a 5-bit binary
665/// encoding, then return -1.
666int getLoadFPImm(APFloat FPImm);
667} // namespace RISCVLoadFPImm
668
669namespace RISCVSysReg {
670struct SysReg {
672 unsigned Encoding;
673 // FIXME: add these additional fields when needed.
674 // Privilege Access: Read, Write, Read-Only.
675 // unsigned ReadWrite;
676 // Privilege Mode: User, System or Machine.
677 // unsigned Mode;
678 // Check field name.
679 // unsigned Extra;
680 // Register number without the privilege bits.
681 // unsigned Number;
686
687 bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const {
688 // Not in 32-bit mode.
689 if (IsRV32Only && ActiveFeatures[RISCV::Feature64Bit])
690 return false;
691 // No required feature associated with the system register.
692 if (FeaturesRequired.none())
693 return true;
694 return (FeaturesRequired & ActiveFeatures) == FeaturesRequired;
695 }
696};
697
698#define GET_SysRegEncodings_DECL
699#define GET_SysRegsList_DECL
700#include "RISCVGenSearchableTables.inc"
701} // end namespace RISCVSysReg
702
703namespace RISCVInsnOpcode {
708
709#define GET_RISCVOpcodesList_DECL
710#include "RISCVGenSearchableTables.inc"
711} // end namespace RISCVInsnOpcode
712
713namespace RISCVABI {
714
734
735// Returns the target ABI, or else a StringError if the requested ABIName is
736// not supported for the subtargets triple and FeatureBits combination.
737ABI computeTargetABI(const MCSubtargetInfo &STI, StringRef ABIName);
738
739ABI getTargetABI(StringRef ABIName);
740
741// Returns the register used to hold the stack pointer after realignment.
743
744// Returns the register holding shadow call stack pointer.
746
747} // namespace RISCVABI
748
749namespace RISCVFeatures {
750
751// Validates if the given combination of features are valid for the target
752// triple. Exits with report_fatal_error if not.
753void validate(const Triple &TT, const FeatureBitset &FeatureBits);
754
756parseFeatureBits(const MCSubtargetInfo &STI);
757
758} // namespace RISCVFeatures
759
760namespace RISCVRVC {
761bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
762bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
763} // namespace RISCVRVC
764
765namespace RISCVZC {
782
783inline unsigned encodeRegList(MCRegister EndReg, bool IsRVE = false) {
784 assert((!IsRVE || EndReg <= RISCV::X9) && "Invalid Rlist for RV32E");
785 switch (EndReg.id()) {
786 case RISCV::X1:
787 return RLISTENCODE::RA;
788 case RISCV::X8:
789 return RLISTENCODE::RA_S0;
790 case RISCV::X9:
792 case RISCV::X18:
794 case RISCV::X19:
796 case RISCV::X20:
798 case RISCV::X21:
800 case RISCV::X22:
802 case RISCV::X23:
804 case RISCV::X24:
806 case RISCV::X25:
808 case RISCV::X27:
810 default:
811 llvm_unreachable("Undefined input.");
812 }
813}
814
815inline static unsigned encodeRegListNumRegs(unsigned NumRegs) {
816 assert(NumRegs > 0 && NumRegs < 14 && NumRegs != 12 &&
817 "Unexpected number of registers");
818 if (NumRegs == 13)
820
821 return RLISTENCODE::RA + (NumRegs - 1);
822}
823
824inline static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64) {
825 assert(RlistVal >= RLISTENCODE::RA && RlistVal <= RLISTENCODE::RA_S0_S11 &&
826 "Invalid Rlist");
827 unsigned NumRegs = (RlistVal - RLISTENCODE::RA) + 1;
828 // s10 and s11 are saved together.
829 if (RlistVal == RLISTENCODE::RA_S0_S11)
830 ++NumRegs;
831
832 unsigned RegSize = IsRV64 ? 8 : 4;
833 return alignTo(NumRegs * RegSize, 16);
834}
835
836void printRegList(unsigned RlistEncode, raw_ostream &OS);
837} // namespace RISCVZC
838
839namespace RISCVVInversePseudosTable {
847
848#define GET_RISCVVInversePseudosTable_DECL
849#include "RISCVGenSearchableTables.inc"
850
851inline const PseudoInfo *getBaseInfo(unsigned BaseInstr, uint8_t VLMul,
852 uint8_t SEW, bool IsAltFmt = false) {
853 return getBaseInfoImpl(BaseInstr, VLMul, SEW, IsAltFmt);
854}
855} // namespace RISCVVInversePseudosTable
856
857namespace RISCV {
867
877
886
896
905
913
922
930
931#define GET_RISCVVSSEGTable_DECL
932#define GET_RISCVVLSEGTable_DECL
933#define GET_RISCVVLXSEGTable_DECL
934#define GET_RISCVVSXSEGTable_DECL
935#define GET_RISCVVLETable_DECL
936#define GET_RISCVVSETable_DECL
937#define GET_RISCVVLXTable_DECL
938#define GET_RISCVVSXTable_DECL
939#define GET_RISCVNDSVLNTable_DECL
940#include "RISCVGenSearchableTables.inc"
941
942inline bool isValidYBNDSWImm(int64_t Imm) {
943 return (Imm >= 1 && Imm <= 255) ||
944 (Imm >= 256 && Imm <= 504 && (Imm % 8) == 0) ||
945 (Imm >= 512 && Imm <= 4096 && (Imm % 16) == 0);
946}
947} // namespace RISCV
948
949} // namespace llvm
950
951#endif
unsigned RegSize
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...
IRTranslator LLVM IR MI
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.
Definition Error.h:485
Container class for subtarget features.
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
constexpr unsigned id() const
Definition MCRegister.h:82
Generic base class for all target subtargets.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
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.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ OPERAND_FIRST_TARGET
Definition MCInstrDesc.h:79
ABI getTargetABI(StringRef ABIName)
MCRegister getBPReg()
ABI computeTargetABI(const MCSubtargetInfo &STI, StringRef ABIName)
MCRegister getSCSPReg()
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
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_UIMM10_LSB00_NONZERO
@ OPERAND_SIMM10_LSB0000_NONZERO
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.
@ Offset
Definition DWP.cpp:573
Op::Description Desc
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition Alignment.h:144
bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const
StringTable::Offset Name