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