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"
21#include "llvm/MC/MCInstrDesc.h"
25
26namespace llvm {
27
28namespace RISCVOp {
29enum OperandType : unsigned {
99 // Operand is a 3-bit rounding mode, '111' indicates FRM register.
100 // Represents 'frm' argument passing to floating-point operations.
102 // Operand is a 3-bit rounding mode where only RTZ is valid.
104 // Condition code used by select and short forward branch pseudos.
106 // Ordering for atomic pseudos.
108 // Vector policy operand.
110 // Vector SEW operand. Stores in log2(SEW).
112 // Special SEW for mask only instructions. Always 0.
114 // Vector rounding mode for VXRM or FRM.
116 // Vtype operand for XSfmm extension.
118 // XSfmm twiden operand.
121
124
125 // Simm12 or constant pool, global, basicblock, etc.
127
129
130 // Operand is either a register or uimm5, this is used by V extension pseudo
131 // instructions to represent a value that be passed as AVL to either vsetvli
132 // or vsetivli.
134
135 // Operand is either a register or imm, this is used by short forward branch
136 // (SFB) pseudos to enable SFB with branches on reg-reg and reg-imm compares.
138
139 // Operand is a branch opcode, this too is used by SFB pseudos.
141
143};
144} // namespace RISCVOp
145
146// RISCVII - This namespace holds all of the target specific flags that
147// instruction info tracks. All definitions must match RISCVInstrFormats.td.
148namespace RISCVII {
149enum {
179
182
188
191
192 // Is this a _TIED vector pseudo instruction. For these instructions we
193 // shouldn't skip the tied operand when converting to MC instructions.
196
197 // Does this instruction have a SEW operand. It will be the last explicit
198 // operand unless there is a vector policy operand. Used by RVV Pseudos.
201
202 // Does this instruction have a VL operand. It will be the second to last
203 // explicit operand unless there is a vector policy operand. Used by RVV
204 // Pseudos.
207
208 // Does this instruction have a vector policy operand. It will be the last
209 // explicit operand. Used by RVV Pseudos.
212
213 // Is this instruction a vector widening reduction instruction. Used by RVV
214 // Pseudos.
217
218 // Does this instruction care about mask policy. If it is not, the mask policy
219 // could be either agnostic or undisturbed. For example, unmasked, store, and
220 // reduction operations result would not be affected by mask policy, so
221 // compiler has free to select either one.
224
225 // Indicates that the result can be considered sign extended from bit 31. Some
226 // instructions with this flag aren't W instructions, but are either sign
227 // extended from a smaller size, always outputs a small integer, or put zeros
228 // in bits 63:31. Used by the SExtWRemoval pass.
231
234
237
238 // Indicates whether these instructions can partially overlap between source
239 // registers and destination registers according to the vector spec.
240 // 0 -> not a vector pseudo
241 // 1 -> default value for vector pseudos. not widening or narrowing.
242 // 2 -> narrowing case
243 // 3 -> widening case
246
249
252
253 // Indicates the EEW of a vector instruction's destination operand.
254 // 0 -> 1
255 // 1 -> SEW
256 // 2 -> SEW * 2
257 // 3 -> SEW * 4
260
263
264 // 0 -> Don't care about altfmt bit in VTYPE.
265 // 1 -> Is not altfmt.
266 // 2 -> Is altfmt(BF16).
269
270 // XSfmmbase
273
276
279};
280
281// Helper functions to read TSFlags.
282/// \returns the format of the instruction.
283static inline unsigned getFormat(uint64_t TSFlags) {
284 return (TSFlags & InstFormatMask) >> InstFormatShift;
285}
286/// \returns the LMUL for the instruction.
287static inline RISCVVType::VLMUL getLMul(uint64_t TSFlags) {
288 return static_cast<RISCVVType::VLMUL>((TSFlags & VLMulMask) >> VLMulShift);
289}
290/// \returns true if this a _TIED pseudo.
291static inline bool isTiedPseudo(uint64_t TSFlags) {
292 return TSFlags & IsTiedPseudoMask;
293}
294/// \returns true if there is a SEW operand for the instruction.
295static inline bool hasSEWOp(uint64_t TSFlags) {
296 return TSFlags & HasSEWOpMask;
297}
298/// \returns true if there is a VL operand for the instruction.
299static inline bool hasVLOp(uint64_t TSFlags) {
300 return TSFlags & HasVLOpMask;
301}
302/// \returns true if there is a vector policy operand for this instruction.
303static inline bool hasVecPolicyOp(uint64_t TSFlags) {
304 return TSFlags & HasVecPolicyOpMask;
305}
306/// \returns true if it is a vector widening reduction instruction.
307static inline bool isRVVWideningReduction(uint64_t TSFlags) {
308 return TSFlags & IsRVVWideningReductionMask;
309}
310/// \returns true if mask policy is valid for the instruction.
311static inline bool usesMaskPolicy(uint64_t TSFlags) {
312 return TSFlags & UsesMaskPolicyMask;
313}
314
315/// \returns true if there is a rounding mode operand for this instruction
316static inline bool hasRoundModeOp(uint64_t TSFlags) {
317 return TSFlags & HasRoundModeOpMask;
318}
319
321static inline AltFmtType getAltFmtType(uint64_t TSFlags) {
322 return static_cast<AltFmtType>((TSFlags & AltFmtTypeMask) >> AltFmtTypeShift);
323}
324
325/// \returns true if this instruction uses vxrm
326static inline bool usesVXRM(uint64_t TSFlags) { return TSFlags & UsesVXRMMask; }
327
328/// \returns true if the elements in the body are affected by VL,
329/// e.g. vslide1down.vx/vredsum.vs/viota.m
330static inline bool elementsDependOnVL(uint64_t TSFlags) {
331 return TSFlags & ElementsDependOnVLMask;
332}
333
334/// \returns true if the elements in the body are affected by the mask,
335/// e.g. vredsum.vs/viota.m
336static inline bool elementsDependOnMask(uint64_t TSFlags) {
337 return TSFlags & ElementsDependOnMaskMask;
338}
339
340/// \returns true if the instruction may read elements past VL, e.g.
341/// vslidedown/vrgather
342static inline bool readsPastVL(uint64_t TSFlags) {
343 return TSFlags & ReadsPastVLMask;
344}
345
346// XSfmmbase
347static inline bool hasTWidenOp(uint64_t TSFlags) {
348 return TSFlags & HasTWidenOpMask;
349}
350
351static inline bool hasTMOp(uint64_t TSFlags) { return TSFlags & HasTMOpMask; }
352
353static inline bool hasTKOp(uint64_t TSFlags) { return TSFlags & HasTKOpMask; }
354
355static inline unsigned getTWidenOpNum(const MCInstrDesc &Desc) {
356 assert(hasTWidenOp(Desc.TSFlags));
357 return Desc.getNumOperands() - 1;
358}
359
360static inline unsigned getTNOpNum(const MCInstrDesc &Desc) {
361 const uint64_t TSFlags = Desc.TSFlags;
362 assert(hasTWidenOp(TSFlags) && hasVLOp(TSFlags));
363 unsigned Offset = 3;
364 if (hasTKOp(TSFlags))
365 Offset = 4;
366 return Desc.getNumOperands() - Offset;
367}
368
369static inline unsigned getTMOpNum(const MCInstrDesc &Desc) {
370 const uint64_t TSFlags = Desc.TSFlags;
371 assert(hasTWidenOp(TSFlags) && hasTMOp(TSFlags));
372 if (hasTKOp(TSFlags))
373 return Desc.getNumOperands() - 5;
374 // vtzero.t
375 return Desc.getNumOperands() - 4;
376}
377
378static inline unsigned getTKOpNum(const MCInstrDesc &Desc) {
379 [[maybe_unused]] const uint64_t TSFlags = Desc.TSFlags;
380 assert(hasTWidenOp(TSFlags) && hasTKOp(TSFlags));
381 return Desc.getNumOperands() - 3;
382}
383
384static inline unsigned getVLOpNum(const MCInstrDesc &Desc) {
385 const uint64_t TSFlags = Desc.TSFlags;
386 // This method is only called if we expect to have a VL operand, and all
387 // instructions with VL also have SEW.
388 assert(hasSEWOp(TSFlags) && hasVLOp(TSFlags));
389 // In Xsfmmbase, TN is an alias for VL, so here we use the same TSFlags bit.
390 if (hasTWidenOp(TSFlags))
391 return getTNOpNum(Desc);
392 unsigned Offset = 2;
393 if (hasVecPolicyOp(TSFlags))
394 Offset = 3;
395 return Desc.getNumOperands() - Offset;
396}
397
398static inline MCRegister
400 // For Zicfilp, PseudoTAIL should be expanded to a software guarded branch.
401 // It means to use t2(x7) as rs1 of JALR to expand PseudoTAIL.
402 return FeatureBits[RISCV::FeatureStdExtZicfilp] ? RISCV::X7 : RISCV::X6;
403}
404
405static inline unsigned getSEWOpNum(const MCInstrDesc &Desc) {
406 const uint64_t TSFlags = Desc.TSFlags;
407 assert(hasSEWOp(TSFlags));
408 unsigned Offset = 1;
409 if (hasVecPolicyOp(TSFlags) || hasTWidenOp(TSFlags))
410 Offset = 2;
411 return Desc.getNumOperands() - Offset;
412}
413
414static inline unsigned getVecPolicyOpNum(const MCInstrDesc &Desc) {
415 assert(hasVecPolicyOp(Desc.TSFlags));
416 return Desc.getNumOperands() - 1;
417}
418
419/// \returns the index to the rounding mode immediate value if any, otherwise
420/// returns -1.
421static inline int getFRMOpNum(const MCInstrDesc &Desc) {
422 const uint64_t TSFlags = Desc.TSFlags;
423 if (!hasRoundModeOp(TSFlags) || usesVXRM(TSFlags))
424 return -1;
425
426 int Idx = RISCV::getNamedOperandIdx(Desc.getOpcode(), RISCV::OpName::rm);
427 assert(Idx >= 0 && "No rm operand?");
428 assert(Desc.operands()[Idx].OperandType == RISCVOp::OPERAND_VEC_RM &&
429 "Operand has wrong type");
430
431 return Idx;
432}
433
434/// \returns the index to the rounding mode immediate value if any, otherwise
435/// returns -1.
436static inline int getVXRMOpNum(const MCInstrDesc &Desc) {
437 const uint64_t TSFlags = Desc.TSFlags;
438 if (!hasRoundModeOp(TSFlags) || !usesVXRM(TSFlags))
439 return -1;
440
441 int Idx = RISCV::getNamedOperandIdx(Desc.getOpcode(), RISCV::OpName::rm);
442 assert(Idx >= 0 && "No rm operand?");
443 assert(Desc.operands()[Idx].OperandType == RISCVOp::OPERAND_VEC_RM &&
444 "Operand has wrong type");
445
446 return Idx;
447}
448
449// Is the first def operand tied to the first use operand. This is true for
450// vector pseudo instructions that have a merge operand for tail/mask
451// undisturbed. It's also true for vector FMA instructions where one of the
452// operands is also the destination register.
453static inline bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc) {
454 return Desc.getNumDefs() < Desc.getNumOperands() &&
455 Desc.getOperandConstraint(Desc.getNumDefs(), MCOI::TIED_TO) == 0;
456}
457
458// RISC-V Specific Machine Operand Flags
459enum {
462 MO_LO = 3,
463 MO_HI = 4,
476
477 // Used to differentiate between target-specific "direct" flags and "bitmask"
478 // flags. A machine operand can only have one "direct" flag, but can have
479 // multiple "bitmask" flags.
481};
482} // namespace RISCVII
483
484// Describes the predecessor/successor bits used in the FENCE instruction.
487 I = 8,
488 O = 4,
489 R = 2,
490 W = 1
491};
492}
493
494// Describes the supported floating point rounding mode encodings.
495namespace RISCVFPRndMode {
497 RNE = 0,
498 RTZ = 1,
499 RDN = 2,
500 RUP = 3,
501 RMM = 4,
502 DYN = 7,
504};
505
507 switch (RndMode) {
508 default:
509 llvm_unreachable("Unknown floating point rounding mode");
511 return "rne";
513 return "rtz";
515 return "rdn";
517 return "rup";
519 return "rmm";
521 return "dyn";
522 }
523}
524
535
536inline static bool isValidRoundingMode(unsigned Mode) {
537 switch (Mode) {
538 default:
539 return false;
546 return true;
547 }
548}
549} // namespace RISCVFPRndMode
550
551namespace RISCVVXRndMode {
553 RNU = 0,
554 RNE = 1,
555 RDN = 2,
556 ROD = 3,
558};
559
561 switch (RndMode) {
562 default:
563 llvm_unreachable("Unknown vector fixed-point rounding mode");
565 return "rnu";
567 return "rne";
569 return "rdn";
571 return "rod";
572 }
573}
574
583
584inline static bool isValidRoundingMode(unsigned Mode) {
585 switch (Mode) {
586 default:
587 return false;
592 return true;
593 }
594}
595} // namespace RISCVVXRndMode
596
599 NX = 0x01, // Inexact
600 UF = 0x02, // Underflow
601 OF = 0x04, // Overflow
602 DZ = 0x08, // Divide by zero
603 NV = 0x10, // Invalid operation
604 ALL = 0x1F // Mask for all accrued exception flags
605};
606}
607
608//===----------------------------------------------------------------------===//
609// Floating-point Immediates
610//
611
612namespace RISCVLoadFPImm {
613float getFPImm(unsigned Imm);
614
615/// getLoadFPImm - Return a 5-bit binary encoding of the floating-point
616/// immediate value. If the value cannot be represented as a 5-bit binary
617/// encoding, then return -1.
618int getLoadFPImm(APFloat FPImm);
619} // namespace RISCVLoadFPImm
620
621namespace RISCVSysReg {
622struct SysReg {
623 const char Name[32];
624 unsigned Encoding;
625 // FIXME: add these additional fields when needed.
626 // Privilege Access: Read, Write, Read-Only.
627 // unsigned ReadWrite;
628 // Privilege Mode: User, System or Machine.
629 // unsigned Mode;
630 // Check field name.
631 // unsigned Extra;
632 // Register number without the privilege bits.
633 // unsigned Number;
638
639 bool haveRequiredFeatures(const FeatureBitset &ActiveFeatures) const {
640 // Not in 32-bit mode.
641 if (IsRV32Only && ActiveFeatures[RISCV::Feature64Bit])
642 return false;
643 // No required feature associated with the system register.
644 if (FeaturesRequired.none())
645 return true;
646 return (FeaturesRequired & ActiveFeatures) == FeaturesRequired;
647 }
648};
649
650#define GET_SysRegEncodings_DECL
651#define GET_SysRegsList_DECL
652#include "RISCVGenSearchableTables.inc"
653} // end namespace RISCVSysReg
654
655namespace RISCVInsnOpcode {
657 char Name[10];
659};
660
661#define GET_RISCVOpcodesList_DECL
662#include "RISCVGenSearchableTables.inc"
663} // end namespace RISCVInsnOpcode
664
665namespace RISCVABI {
666
685
686// Returns the target ABI, or else a StringError if the requested ABIName is
687// not supported for the given TT and FeatureBits combination.
688ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits,
689 StringRef ABIName);
690
691ABI getTargetABI(StringRef ABIName);
692
693// Returns the register used to hold the stack pointer after realignment.
695
696// Returns the register holding shadow call stack pointer.
698
699} // namespace RISCVABI
700
701namespace RISCVFeatures {
702
703// Validates if the given combination of features are valid for the target
704// triple. Exits with report_fatal_error if not.
705void validate(const Triple &TT, const FeatureBitset &FeatureBits);
706
708parseFeatureBits(bool IsRV64, const FeatureBitset &FeatureBits);
709
710} // namespace RISCVFeatures
711
712namespace RISCVRVC {
713bool compress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
714bool uncompress(MCInst &OutInst, const MCInst &MI, const MCSubtargetInfo &STI);
715} // namespace RISCVRVC
716
717namespace RISCVZC {
734
735inline unsigned encodeRegList(MCRegister EndReg, bool IsRVE = false) {
736 assert((!IsRVE || EndReg <= RISCV::X9) && "Invalid Rlist for RV32E");
737 switch (EndReg.id()) {
738 case RISCV::X1:
739 return RLISTENCODE::RA;
740 case RISCV::X8:
741 return RLISTENCODE::RA_S0;
742 case RISCV::X9:
744 case RISCV::X18:
746 case RISCV::X19:
748 case RISCV::X20:
750 case RISCV::X21:
752 case RISCV::X22:
754 case RISCV::X23:
756 case RISCV::X24:
758 case RISCV::X25:
760 case RISCV::X27:
762 default:
763 llvm_unreachable("Undefined input.");
764 }
765}
766
767inline static unsigned encodeRegListNumRegs(unsigned NumRegs) {
768 assert(NumRegs > 0 && NumRegs < 14 && NumRegs != 12 &&
769 "Unexpected number of registers");
770 if (NumRegs == 13)
772
773 return RLISTENCODE::RA + (NumRegs - 1);
774}
775
776inline static unsigned getStackAdjBase(unsigned RlistVal, bool IsRV64) {
777 assert(RlistVal >= RLISTENCODE::RA && RlistVal <= RLISTENCODE::RA_S0_S11 &&
778 "Invalid Rlist");
779 unsigned NumRegs = (RlistVal - RLISTENCODE::RA) + 1;
780 // s10 and s11 are saved together.
781 if (RlistVal == RLISTENCODE::RA_S0_S11)
782 ++NumRegs;
783
784 unsigned RegSize = IsRV64 ? 8 : 4;
785 return alignTo(NumRegs * RegSize, 16);
786}
787
788void printRegList(unsigned RlistEncode, raw_ostream &OS);
789} // namespace RISCVZC
790
791namespace RISCVVInversePseudosTable {
799
800#define GET_RISCVVInversePseudosTable_DECL
801#include "RISCVGenSearchableTables.inc"
802
803inline const PseudoInfo *getBaseInfo(unsigned BaseInstr, uint8_t VLMul,
804 uint8_t SEW, bool IsAltFmt = false) {
805 return getBaseInfoImpl(BaseInstr, VLMul, SEW, IsAltFmt);
806}
807} // namespace RISCVVInversePseudosTable
808
809namespace RISCV {
819
829
838
848
857
865
874
882
883#define GET_RISCVVSSEGTable_DECL
884#define GET_RISCVVLSEGTable_DECL
885#define GET_RISCVVLXSEGTable_DECL
886#define GET_RISCVVSXSEGTable_DECL
887#define GET_RISCVVLETable_DECL
888#define GET_RISCVVSETable_DECL
889#define GET_RISCVVLXTable_DECL
890#define GET_RISCVVSXTable_DECL
891#define GET_RISCVNDSVLNTable_DECL
892#include "RISCVGenSearchableTables.inc"
893
894inline bool isValidYBNDSWImm(int64_t Imm) {
895 return (Imm >= 1 && Imm <= 255) ||
896 (Imm >= 256 && Imm <= 504 && (Imm % 8) == 0) ||
897 (Imm >= 512 && Imm <= 4096 && (Imm % 16) == 0);
898}
899} // namespace RISCV
900
901} // namespace llvm
902
903#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)
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
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)
ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, StringRef ABIName)
MCRegister getBPReg()
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(bool IsRV64, const FeatureBitset &FeatureBits)
static unsigned getVecPolicyOpNum(const MCInstrDesc &Desc)
static unsigned getTMOpNum(const MCInstrDesc &Desc)
static bool usesMaskPolicy(uint64_t TSFlags)
static bool hasRoundModeOp(uint64_t TSFlags)
@ TargetOverlapConstraintTypeMask
@ TargetOverlapConstraintTypeShift
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)
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)
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:558
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