LLVM 24.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 {
104 // Operand is a 3-bit rounding mode, '111' indicates FRM register.
105 // Represents 'frm' argument passing to floating-point operations.
107 // Operand is a 3-bit rounding mode where only RTZ is valid.
109 // Condition code used by select and short forward branch pseudos.
111 // Ordering for atomic pseudos.
113 // Vector policy operand.
115 // Vector SEW operand. Stores in log2(SEW).
117 // Special SEW for mask only instructions. Always 0.
119 // Vector rounding mode for VXRM or FRM.
121 // Vtype operand for XSfmm extension.
123 // XSfmm twiden operand.
126
129
130 // Simm12 or constant pool, global, basicblock, etc.
132
134
135 // Operand is either a register or uimm5, this is used by V extension pseudo
136 // instructions to represent a value that be passed as AVL to either vsetvli
137 // or vsetivli.
139
140 // Operand is either a register or imm, this is used by short forward branch
141 // (SFB) pseudos to enable SFB with branches on reg-reg and reg-imm compares.
143
144 // Operand is a branch opcode, this too is used by SFB pseudos.
146
150};
151} // namespace RISCVOp
152
153// RISCVII - This namespace holds all of the target specific flags that
154// instruction info tracks. All definitions must match RISCVInstrFormats.td.
155namespace RISCVII {
156enum : uint64_t {
186
189
195
198
199 // Is this a _TIED vector pseudo instruction. For these instructions we
200 // shouldn't skip the tied operand when converting to MC instructions.
203
204 // Does this instruction have a SEW operand. It will be the last explicit
205 // operand unless there is a vector policy operand. Used by RVV Pseudos.
208
209 // Does this instruction have a VL operand. It will be the second to last
210 // explicit operand unless there is a vector policy operand. Used by RVV
211 // Pseudos.
214
215 // Does this instruction have a vector policy operand. It will be the last
216 // explicit operand. Used by RVV Pseudos.
219
220 // Is this instruction a vector widening reduction instruction. Used by RVV
221 // Pseudos.
224
225 // Does this instruction care about mask policy. If it is not, the mask policy
226 // could be either agnostic or undisturbed. For example, unmasked, store, and
227 // reduction operations result would not be affected by mask policy, so
228 // compiler has free to select either one.
231
232 // Indicates that the result can be considered sign extended from bit 31. Some
233 // instructions with this flag aren't W instructions, but are either sign
234 // extended from a smaller size, always outputs a small integer, or put zeros
235 // in bits 63:31. Used by the SExtWRemoval pass.
238
241
244
245 // Indicates whether these instructions can partially overlap between source
246 // registers and destination registers according to the vector spec.
247 // 0 -> not a vector pseudo
248 // 1 -> default value for vector pseudos. not widening or narrowing.
249 // 2 -> narrowing case
250 // 3 -> widening case
253
256
259
260 // Indicates the EEW of a vector instruction's destination operand.
261 // 0 -> 1
262 // 1 -> SEW
263 // 2 -> SEW * 2
264 // 3 -> SEW * 4
267
270
271 // 0 -> Don't care about altfmt bit in VTYPE.
272 // 1 -> Is not altfmt.
273 // 2 -> Is altfmt(BF16).
276
277 // XSfmmbase
280
283
286
289};
290
291// Helper functions to read TSFlags.
292/// \returns the format of the instruction.
293static inline unsigned getFormat(uint64_t TSFlags) {
294 return (TSFlags & InstFormatMask) >> InstFormatShift;
295}
296/// \returns the LMUL for the instruction.
297static inline RISCVVType::VLMUL getLMul(uint64_t TSFlags) {
298 return static_cast<RISCVVType::VLMUL>((TSFlags & VLMulMask) >> VLMulShift);
299}
300/// \returns true if this a _TIED pseudo.
301static inline bool isTiedPseudo(uint64_t TSFlags) {
302 return TSFlags & IsTiedPseudoMask;
303}
304/// \returns true if there is a SEW operand for the instruction.
305static inline bool hasSEWOp(uint64_t TSFlags) {
306 return TSFlags & HasSEWOpMask;
307}
308/// \returns true if there is a VL operand for the instruction.
309static inline bool hasVLOp(uint64_t TSFlags) {
310 return TSFlags & HasVLOpMask;
311}
312/// \returns true if there is a vector policy operand for this instruction.
313static inline bool hasVecPolicyOp(uint64_t TSFlags) {
314 return TSFlags & HasVecPolicyOpMask;
315}
316/// \returns true if it is a vector widening reduction instruction.
317static inline bool isRVVWideningReduction(uint64_t TSFlags) {
318 return TSFlags & IsRVVWideningReductionMask;
319}
320/// \returns true if mask policy is valid for the instruction.
321static inline bool usesMaskPolicy(uint64_t TSFlags) {
322 return TSFlags & UsesMaskPolicyMask;
323}
324
325/// \returns true if there is a rounding mode operand for this instruction
326static inline bool hasRoundModeOp(uint64_t TSFlags) {
327 return TSFlags & HasRoundModeOpMask;
328}
329
331static inline AltFmtType getAltFmtType(uint64_t TSFlags) {
332 return static_cast<AltFmtType>((TSFlags & AltFmtTypeMask) >> AltFmtTypeShift);
333}
334
335/// \returns true if this instruction uses vxrm
336static inline bool usesVXRM(uint64_t TSFlags) { return TSFlags & UsesVXRMMask; }
337
338/// \returns true if the elements in the body are affected by VL,
339/// e.g. vslide1down.vx/vredsum.vs/viota.m
340static inline bool elementsDependOnVL(uint64_t TSFlags) {
341 return TSFlags & ElementsDependOnVLMask;
342}
343
344/// \returns true if the elements in the body are affected by the mask,
345/// e.g. vredsum.vs/viota.m
346static inline bool elementsDependOnMask(uint64_t TSFlags) {
347 return TSFlags & ElementsDependOnMaskMask;
348}
349
350/// \returns true if the instruction may read elements past VL, e.g.
351/// vslidedown/vrgather
352static inline bool readsPastVL(uint64_t TSFlags) {
353 return TSFlags & ReadsPastVLMask;
354}
355
356// XSfmmbase
357static inline bool hasTWidenOp(uint64_t TSFlags) {
358 return TSFlags & HasTWidenOpMask;
359}
360
361static inline bool hasTMOp(uint64_t TSFlags) { return TSFlags & HasTMOpMask; }
362
363static inline bool hasTKOp(uint64_t TSFlags) { return TSFlags & HasTKOpMask; }
364
365static inline unsigned getTWidenOpNum(const MCInstrDesc &Desc) {
366 assert(hasTWidenOp(Desc.TSFlags));
367 return Desc.getNumOperands() - 1;
368}
369
370static inline unsigned getTNOpNum(const MCInstrDesc &Desc) {
371 const uint64_t TSFlags = Desc.TSFlags;
372 assert(hasTWidenOp(TSFlags) && hasVLOp(TSFlags));
373 unsigned Offset = 3;
374 if (hasTKOp(TSFlags))
375 Offset = 4;
376 return Desc.getNumOperands() - Offset;
377}
378
379static inline unsigned getTMOpNum(const MCInstrDesc &Desc) {
380 const uint64_t TSFlags = Desc.TSFlags;
381 assert(hasTWidenOp(TSFlags) && hasTMOp(TSFlags));
382 if (hasTKOp(TSFlags))
383 return Desc.getNumOperands() - 5;
384 // vtzero.t
385 return Desc.getNumOperands() - 4;
386}
387
388static inline unsigned getTKOpNum(const MCInstrDesc &Desc) {
389 [[maybe_unused]] const uint64_t TSFlags = Desc.TSFlags;
390 assert(hasTWidenOp(TSFlags) && hasTKOp(TSFlags));
391 return Desc.getNumOperands() - 3;
392}
393
394static inline unsigned getVLOpNum(const MCInstrDesc &Desc) {
395 const uint64_t TSFlags = Desc.TSFlags;
396 // This method is only called if we expect to have a VL operand, and all
397 // instructions with VL also have SEW.
398 assert(hasSEWOp(TSFlags) && hasVLOp(TSFlags));
399 // In Xsfmmbase, TN is an alias for VL, so here we use the same TSFlags bit.
400 if (hasTWidenOp(TSFlags))
401 return getTNOpNum(Desc);
402 unsigned Offset = 2;
403 if (hasVecPolicyOp(TSFlags))
404 Offset = 3;
405 return Desc.getNumOperands() - Offset;
406}
407
408static inline MCRegister
410 // For Zicfilp, PseudoTAIL should be expanded to a software guarded branch.
411 // It means to use t2(x7) as rs1 of JALR to expand PseudoTAIL.
412 return FeatureBits[RISCV::FeatureStdExtZicfilp] ? RISCV::X7 : RISCV::X6;
413}
414
415static inline unsigned getSEWOpNum(const MCInstrDesc &Desc) {
416 const uint64_t TSFlags = Desc.TSFlags;
417 assert(hasSEWOp(TSFlags));
418 unsigned Offset = 1;
419 if (hasVecPolicyOp(TSFlags) || hasTWidenOp(TSFlags))
420 Offset = 2;
421 return Desc.getNumOperands() - Offset;
422}
423
424static inline unsigned getVecPolicyOpNum(const MCInstrDesc &Desc) {
425 assert(hasVecPolicyOp(Desc.TSFlags));
426 return Desc.getNumOperands() - 1;
427}
428
429/// \returns the index to the rounding mode immediate value if any, otherwise
430/// returns -1.
431static inline int getFRMOpNum(const MCInstrDesc &Desc) {
432 const uint64_t TSFlags = Desc.TSFlags;
433 if (!hasRoundModeOp(TSFlags) || usesVXRM(TSFlags))
434 return -1;
435
436 int Idx = RISCV::getNamedOperandIdx(Desc.getOpcode(), RISCV::OpName::rm);
437 assert(Idx >= 0 && "No rm operand?");
438 assert(Desc.operands()[Idx].OperandType == RISCVOp::OPERAND_VEC_RM &&
439 "Operand has wrong type");
440
441 return Idx;
442}
443
444/// \returns the index to the rounding mode immediate value if any, otherwise
445/// returns -1.
446static inline int getVXRMOpNum(const MCInstrDesc &Desc) {
447 const uint64_t TSFlags = Desc.TSFlags;
448 if (!hasRoundModeOp(TSFlags) || !usesVXRM(TSFlags))
449 return -1;
450
451 int Idx = RISCV::getNamedOperandIdx(Desc.getOpcode(), RISCV::OpName::rm);
452 assert(Idx >= 0 && "No rm operand?");
453 assert(Desc.operands()[Idx].OperandType == RISCVOp::OPERAND_VEC_RM &&
454 "Operand has wrong type");
455
456 return Idx;
457}
458
459// Is the first def operand tied to the first use operand. This is true for
460// vector pseudo instructions that have a merge operand for tail/mask
461// undisturbed. It's also true for vector FMA instructions where one of the
462// operands is also the destination register.
463static inline bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc) {
464 return Desc.getNumDefs() < Desc.getNumOperands() &&
465 Desc.getOperandConstraint(Desc.getNumDefs(), MCOI::TIED_TO) == 0;
466}
467
468// RISC-V Specific Machine Operand Flags
469enum {
472 MO_LO = 3,
473 MO_HI = 4,
487
488 // Used to differentiate between target-specific "direct" flags and "bitmask"
489 // flags. A machine operand can only have one "direct" flag, but can have
490 // multiple "bitmask" flags.
492};
493} // namespace RISCVII
494
495// Describes the predecessor/successor bits used in the FENCE instruction.
498 I = 8,
499 O = 4,
500 R = 2,
501 W = 1
502};
503}
504
505// Describes the supported floating point rounding mode encodings.
506namespace RISCVFPRndMode {
508 RNE = 0,
509 RTZ = 1,
510 RDN = 2,
511 RUP = 3,
512 RMM = 4,
513 DYN = 7,
515};
516
518 switch (RndMode) {
519 default:
520 llvm_unreachable("Unknown floating point rounding mode");
522 return "rne";
524 return "rtz";
526 return "rdn";
528 return "rup";
530 return "rmm";
532 return "dyn";
533 }
534}
535
546
547inline static bool isValidRoundingMode(unsigned Mode) {
548 switch (Mode) {
549 default:
550 return false;
557 return true;
558 }
559}
560} // namespace RISCVFPRndMode
561
562namespace XSMTVTypeMode {
564 // Define the different SMT VType modes here
568};
569
571 switch (TypeMode) {
572 default:
573 llvm_unreachable("Unknown VType mode of SpacemiT Integer Matrix");
575 return "i4";
577 return "i8";
578 }
579}
580
587
588inline static bool isValidSMTVTypeMode(unsigned Mode) {
589 switch (Mode) {
590 default:
591 return false;
594 return true;
595 }
596}
597
598} // namespace XSMTVTypeMode
599
600namespace RISCVVXRndMode {
602 RNU = 0,
603 RNE = 1,
604 RDN = 2,
605 ROD = 3,
607};
608
610 switch (RndMode) {
611 default:
612 llvm_unreachable("Unknown vector fixed-point rounding mode");
614 return "rnu";
616 return "rne";
618 return "rdn";
620 return "rod";
621 }
622}
623
632
633inline static bool isValidRoundingMode(unsigned Mode) {
634 switch (Mode) {
635 default:
636 return false;
641 return true;
642 }
643}
644} // namespace RISCVVXRndMode
645
648 NX = 0x01, // Inexact
649 UF = 0x02, // Underflow
650 OF = 0x04, // Overflow
651 DZ = 0x08, // Divide by zero
652 NV = 0x10, // Invalid operation
653 ALL = 0x1F // Mask for all accrued exception flags
654};
655}
656
657//===----------------------------------------------------------------------===//
658// Floating-point Immediates
659//
660
661namespace RISCVLoadFPImm {
662float getFPImm(unsigned Imm);
663
664/// getLoadFPImm - Return a 5-bit binary encoding of the floating-point
665/// immediate value. If the value cannot be represented as a 5-bit binary
666/// encoding, then return -1.
667int getLoadFPImm(APFloat FPImm);
668} // namespace RISCVLoadFPImm
669
670namespace RISCVSysReg {
671struct SysReg {
673 unsigned Encoding;
674 // FIXME: add these additional fields when needed.
675 // Privilege Access: Read, Write, Read-Only.
676 // unsigned ReadWrite;
677 // Privilege Mode: User, System or Machine.
678 // unsigned Mode;
679 // Check field name.
680 // unsigned Extra;
681 // Register number without the privilege bits.
682 // unsigned Number;
687
688 bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const {
689 // Not in 32-bit mode.
690 if (IsRV32Only && ActiveFeatures[RISCV::Feature64Bit])
691 return false;
692 // No required feature associated with the system register.
693 if (FeaturesRequired.none())
694 return true;
695 return (FeaturesRequired & ActiveFeatures) == FeaturesRequired;
696 }
697};
698
699#define GET_SysRegEncodings_DECL
700#define GET_SysRegsList_DECL
701#include "RISCVGenSearchableTables.inc"
702} // end namespace RISCVSysReg
703
704namespace RISCVInsnOpcode {
709
710#define GET_RISCVOpcodesList_DECL
711#include "RISCVGenSearchableTables.inc"
712} // end namespace RISCVInsnOpcode
713
714namespace RISCVABI {
715
735
736// Returns the target ABI, or else a StringError if the requested ABIName is
737// not supported for the subtargets triple and FeatureBits combination.
738ABI computeTargetABI(const MCSubtargetInfo &STI, StringRef ABIName);
739
740ABI getTargetABI(StringRef ABIName);
741
742// Returns the register used to hold the stack pointer after realignment.
744
745// Returns the register holding shadow call stack pointer.
747
748} // namespace RISCVABI
749
750namespace RISCVFeatures {
751
752// Validates if the given combination of features are valid for the target
753// triple. Exits with report_fatal_error if not.
754void validate(const Triple &TT, const FeatureBitset &FeatureBits);
755
757parseFeatureBits(const MCSubtargetInfo &STI);
758
759} // namespace RISCVFeatures
760
761namespace RISCVRVC {
762bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
763bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
764} // namespace RISCVRVC
765
766namespace RISCVZC {
783
784inline unsigned encodeRegList(MCRegister EndReg, bool IsRVE = false) {
785 assert((!IsRVE || EndReg <= RISCV::X9) && "Invalid Rlist for RV32E");
786 switch (EndReg.id()) {
787 case RISCV::X1:
788 return RLISTENCODE::RA;
789 case RISCV::X8:
790 return RLISTENCODE::RA_S0;
791 case RISCV::X9:
793 case RISCV::X18:
795 case RISCV::X19:
797 case RISCV::X20:
799 case RISCV::X21:
801 case RISCV::X22:
803 case RISCV::X23:
805 case RISCV::X24:
807 case RISCV::X25:
809 case RISCV::X27:
811 default:
812 llvm_unreachable("Undefined input.");
813 }
814}
815
816inline static unsigned encodeRegListNumRegs(unsigned NumRegs) {
817 assert(NumRegs > 0 && NumRegs < 14 && NumRegs != 12 &&
818 "Unexpected number of registers");
819 if (NumRegs == 13)
821
822 return RLISTENCODE::RA + (NumRegs - 1);
823}
824
825inline static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64) {
826 assert(RlistVal >= RLISTENCODE::RA && RlistVal <= RLISTENCODE::RA_S0_S11 &&
827 "Invalid Rlist");
828 unsigned NumRegs = (RlistVal - RLISTENCODE::RA) + 1;
829 // s10 and s11 are saved together.
830 if (RlistVal == RLISTENCODE::RA_S0_S11)
831 ++NumRegs;
832
833 unsigned RegSize = IsRV64 ? 8 : 4;
834 return alignTo(NumRegs * RegSize, 16);
835}
836
837void printRegList(unsigned RlistEncode, raw_ostream &OS);
838} // namespace RISCVZC
839
840namespace RISCVVInversePseudosTable {
848
849#define GET_RISCVVInversePseudosTable_DECL
850#include "RISCVGenSearchableTables.inc"
851
852inline const PseudoInfo *getBaseInfo(unsigned BaseInstr, uint8_t VLMul,
853 uint8_t SEW, bool IsAltFmt = false) {
854 return getBaseInfoImpl(BaseInstr, VLMul, SEW, IsAltFmt);
855}
856} // namespace RISCVVInversePseudosTable
857
858namespace RISCV {
868
878
887
897
906
914
923
931
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"
942
943inline bool isValidYBNDSWImm(int64_t Imm) {
944 return (Imm >= 1 && Imm <= 255) ||
945 (Imm >= 256 && Imm <= 504 && (Imm % 8) == 0) ||
946 (Imm >= 512 && Imm <= 4096 && (Imm % 16) == 0);
947}
948} // namespace RISCV
949
950} // namespace llvm
951
952#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:578
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