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