33#define DEBUG_TYPE "mccodeemitter"
35STATISTIC(MCNumEmitted,
"Number of MC instructions emitted.");
36STATISTIC(MCNumFixups,
"Number of MC fixups created.");
45 AArch64MCCodeEmitter(
const AArch64MCCodeEmitter &) =
delete;
46 void operator=(
const AArch64MCCodeEmitter &) =
delete;
47 ~AArch64MCCodeEmitter()
override =
default;
51 uint64_t getBinaryCodeForInstr(
const MCInst &
MI,
52 SmallVectorImpl<MCFixup> &Fixups,
53 const MCSubtargetInfo &STI)
const;
57 unsigned getMachineOpValue(
const MCInst &
MI,
const MCOperand &MO,
58 SmallVectorImpl<MCFixup> &Fixups,
59 const MCSubtargetInfo &STI)
const;
64 template <u
int32_t FixupKind>
65 uint32_t getLdStUImm12OpValue(
const MCInst &
MI,
unsigned OpIdx,
66 SmallVectorImpl<MCFixup> &Fixups,
67 const MCSubtargetInfo &STI)
const;
71 uint32_t getAdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
72 SmallVectorImpl<MCFixup> &Fixups,
73 const MCSubtargetInfo &STI)
const;
77 uint32_t getAddSubImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
78 SmallVectorImpl<MCFixup> &Fixups,
79 const MCSubtargetInfo &STI)
const;
83 uint32_t getCondBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
84 SmallVectorImpl<MCFixup> &Fixups,
85 const MCSubtargetInfo &STI)
const;
89 uint32_t getCondCompBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
90 SmallVectorImpl<MCFixup> &Fixups,
91 const MCSubtargetInfo &STI)
const;
95 uint32_t getPAuthPCRelOpValue(
const MCInst &
MI,
unsigned OpIdx,
96 SmallVectorImpl<MCFixup> &Fixups,
97 const MCSubtargetInfo &STI)
const;
101 uint32_t getLoadLiteralOpValue(
const MCInst &
MI,
unsigned OpIdx,
102 SmallVectorImpl<MCFixup> &Fixups,
103 const MCSubtargetInfo &STI)
const;
108 uint32_t getMemExtendOpValue(
const MCInst &
MI,
unsigned OpIdx,
109 SmallVectorImpl<MCFixup> &Fixups,
110 const MCSubtargetInfo &STI)
const;
114 uint32_t getTestBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
115 SmallVectorImpl<MCFixup> &Fixups,
116 const MCSubtargetInfo &STI)
const;
121 SmallVectorImpl<MCFixup> &Fixups,
122 const MCSubtargetInfo &STI)
const;
126 uint32_t getMoveWideImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
127 SmallVectorImpl<MCFixup> &Fixups,
128 const MCSubtargetInfo &STI)
const;
131 uint32_t getVecShifterOpValue(
const MCInst &
MI,
unsigned OpIdx,
132 SmallVectorImpl<MCFixup> &Fixups,
133 const MCSubtargetInfo &STI)
const;
137 uint32_t getMoveVecShifterOpValue(
const MCInst &
MI,
unsigned OpIdx,
138 SmallVectorImpl<MCFixup> &Fixups,
139 const MCSubtargetInfo &STI)
const;
143 uint32_t getFixedPointScaleOpValue(
const MCInst &
MI,
unsigned OpIdx,
144 SmallVectorImpl<MCFixup> &Fixups,
145 const MCSubtargetInfo &STI)
const;
147 uint32_t getVecShiftR64OpValue(
const MCInst &
MI,
unsigned OpIdx,
148 SmallVectorImpl<MCFixup> &Fixups,
149 const MCSubtargetInfo &STI)
const;
150 uint32_t getVecShiftR32OpValue(
const MCInst &
MI,
unsigned OpIdx,
151 SmallVectorImpl<MCFixup> &Fixups,
152 const MCSubtargetInfo &STI)
const;
153 uint32_t getVecShiftR16OpValue(
const MCInst &
MI,
unsigned OpIdx,
154 SmallVectorImpl<MCFixup> &Fixups,
155 const MCSubtargetInfo &STI)
const;
156 uint32_t getVecShiftR8OpValue(
const MCInst &
MI,
unsigned OpIdx,
157 SmallVectorImpl<MCFixup> &Fixups,
158 const MCSubtargetInfo &STI)
const;
159 uint32_t getVecShiftL64OpValue(
const MCInst &
MI,
unsigned OpIdx,
160 SmallVectorImpl<MCFixup> &Fixups,
161 const MCSubtargetInfo &STI)
const;
162 uint32_t getVecShiftL32OpValue(
const MCInst &
MI,
unsigned OpIdx,
163 SmallVectorImpl<MCFixup> &Fixups,
164 const MCSubtargetInfo &STI)
const;
165 uint32_t getVecShiftL16OpValue(
const MCInst &
MI,
unsigned OpIdx,
166 SmallVectorImpl<MCFixup> &Fixups,
167 const MCSubtargetInfo &STI)
const;
168 uint32_t getVecShiftL8OpValue(
const MCInst &
MI,
unsigned OpIdx,
169 SmallVectorImpl<MCFixup> &Fixups,
170 const MCSubtargetInfo &STI)
const;
172 uint32_t getImm8OptLsl(
const MCInst &
MI,
unsigned OpIdx,
173 SmallVectorImpl<MCFixup> &Fixups,
174 const MCSubtargetInfo &STI)
const;
175 uint32_t getSVEIncDecImm(
const MCInst &
MI,
unsigned OpIdx,
176 SmallVectorImpl<MCFixup> &Fixups,
177 const MCSubtargetInfo &STI)
const;
179 unsigned fixMOVZ(
const MCInst &
MI,
unsigned EncodedValue,
180 const MCSubtargetInfo &STI)
const;
182 void encodeInstruction(
const MCInst &
MI, SmallVectorImpl<char> &CB,
183 SmallVectorImpl<MCFixup> &Fixups,
184 const MCSubtargetInfo &STI)
const override;
186 unsigned fixMulHigh(
const MCInst &
MI,
unsigned EncodedValue,
187 const MCSubtargetInfo &STI)
const;
189 template<
int hasRs,
int hasRt2>
unsigned
190 fixLoadStoreExclusive(
const MCInst &
MI,
unsigned EncodedValue,
191 const MCSubtargetInfo &STI)
const;
193 unsigned fixOneOperandFPComparison(
const MCInst &
MI,
unsigned EncodedValue,
194 const MCSubtargetInfo &STI)
const;
196 template <
unsigned Multiple,
unsigned Min,
unsigned Max>
197 uint32_t EncodeRegMul_MinMax(
const MCInst &
MI,
unsigned OpIdx,
198 SmallVectorImpl<MCFixup> &Fixups,
199 const MCSubtargetInfo &STI)
const;
200 uint32_t EncodeZK(
const MCInst &
MI,
unsigned OpIdx,
201 SmallVectorImpl<MCFixup> &Fixups,
202 const MCSubtargetInfo &STI)
const;
203 uint32_t EncodePNR_p8to15(
const MCInst &
MI,
unsigned OpIdx,
204 SmallVectorImpl<MCFixup> &Fixups,
205 const MCSubtargetInfo &STI)
const;
207 uint32_t EncodeZPR2StridedRegisterClass(
const MCInst &
MI,
unsigned OpIdx,
208 SmallVectorImpl<MCFixup> &Fixups,
209 const MCSubtargetInfo &STI)
const;
210 uint32_t EncodeZPR4StridedRegisterClass(
const MCInst &
MI,
unsigned OpIdx,
211 SmallVectorImpl<MCFixup> &Fixups,
212 const MCSubtargetInfo &STI)
const;
214 uint32_t EncodeMatrixTileListRegisterClass(
const MCInst &
MI,
unsigned OpIdx,
215 SmallVectorImpl<MCFixup> &Fixups,
216 const MCSubtargetInfo &STI)
const;
217 template <
unsigned BaseReg>
218 uint32_t encodeMatrixIndexGPR32(
const MCInst &
MI,
unsigned OpIdx,
219 SmallVectorImpl<MCFixup> &Fixups,
220 const MCSubtargetInfo &STI)
const;
239 assert(MO.
isImm() &&
"did not expect relocated expression");
240 return static_cast<unsigned>(MO.
getImm());
243template<
unsigned FixupKind> uint32_t
244AArch64MCCodeEmitter::getLdStUImm12OpValue(
const MCInst &
MI,
unsigned OpIdx,
245 SmallVectorImpl<MCFixup> &Fixups,
246 const MCSubtargetInfo &STI)
const {
247 const MCOperand &MO =
MI.getOperand(
OpIdx);
251 ImmVal =
static_cast<uint32_t
>(MO.
getImm());
253 assert(MO.
isExpr() &&
"unable to encode load/store imm operand");
265AArch64MCCodeEmitter::getAdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
266 SmallVectorImpl<MCFixup> &Fixups,
267 const MCSubtargetInfo &STI)
const {
268 const MCOperand &MO =
MI.getOperand(
OpIdx);
274 const MCExpr *Expr = MO.
getExpr();
276 unsigned Kind =
MI.getOpcode() == AArch64::ADR
279 addFixup(Fixups, 0, Expr, Kind,
true);
288AArch64MCCodeEmitter::getAddSubImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
289 SmallVectorImpl<MCFixup> &Fixups,
290 const MCSubtargetInfo &STI)
const {
292 const MCOperand &MO =
MI.getOperand(
OpIdx);
293 const MCOperand &MO1 =
MI.getOperand(
OpIdx + 1);
295 "unexpected shift type for add/sub immediate");
297 assert((ShiftVal == 0 || ShiftVal == 12) &&
298 "unexpected shift value for add/sub immediate");
300 return MO.
getImm() | (ShiftVal == 0 ? 0 : (1 << ShiftVal));
302 const MCExpr *Expr = MO.
getExpr();
318 return ShiftVal == 0 ? 0 : (1 << ShiftVal);
323uint32_t AArch64MCCodeEmitter::getCondBranchTargetOpValue(
324 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
325 const MCSubtargetInfo &STI)
const {
326 const MCOperand &MO =
MI.getOperand(
OpIdx);
341uint32_t AArch64MCCodeEmitter::getCondCompBranchTargetOpValue(
342 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
343 const MCSubtargetInfo &STI)
const {
344 const MCOperand &MO =
MI.getOperand(
OpIdx);
360AArch64MCCodeEmitter::getPAuthPCRelOpValue(
const MCInst &
MI,
unsigned OpIdx,
361 SmallVectorImpl<MCFixup> &Fixups,
362 const MCSubtargetInfo &STI)
const {
363 const MCOperand &MO =
MI.getOperand(
OpIdx);
380AArch64MCCodeEmitter::getLoadLiteralOpValue(
const MCInst &
MI,
unsigned OpIdx,
381 SmallVectorImpl<MCFixup> &Fixups,
382 const MCSubtargetInfo &STI)
const {
383 const MCOperand &MO =
MI.getOperand(
OpIdx);
397AArch64MCCodeEmitter::getMemExtendOpValue(
const MCInst &
MI,
unsigned OpIdx,
398 SmallVectorImpl<MCFixup> &Fixups,
399 const MCSubtargetInfo &STI)
const {
400 unsigned SignExtend =
MI.getOperand(
OpIdx).getImm();
401 unsigned DoShift =
MI.getOperand(
OpIdx + 1).getImm();
402 return (SignExtend << 1) | DoShift;
406AArch64MCCodeEmitter::getMoveWideImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
407 SmallVectorImpl<MCFixup> &Fixups,
408 const MCSubtargetInfo &STI)
const {
409 const MCOperand &MO =
MI.getOperand(
OpIdx);
413 assert(MO.
isExpr() &&
"Unexpected movz/movk immediate");
425uint32_t AArch64MCCodeEmitter::getTestBranchTargetOpValue(
426 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
427 const MCSubtargetInfo &STI)
const {
428 const MCOperand &MO =
MI.getOperand(
OpIdx);
444AArch64MCCodeEmitter::getBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
445 SmallVectorImpl<MCFixup> &Fixups,
446 const MCSubtargetInfo &STI)
const {
447 const MCOperand &MO =
MI.getOperand(
OpIdx);
454 unsigned Kind =
MI.getOpcode() == AArch64::BL
472AArch64MCCodeEmitter::getVecShifterOpValue(
const MCInst &
MI,
unsigned OpIdx,
473 SmallVectorImpl<MCFixup> &Fixups,
474 const MCSubtargetInfo &STI)
const {
475 const MCOperand &MO =
MI.getOperand(
OpIdx);
476 assert(MO.
isImm() &&
"Expected an immediate value for the shift amount!");
496uint32_t AArch64MCCodeEmitter::getFixedPointScaleOpValue(
497 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
498 const MCSubtargetInfo &STI)
const {
499 const MCOperand &MO =
MI.getOperand(
OpIdx);
500 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
505AArch64MCCodeEmitter::getVecShiftR64OpValue(
const MCInst &
MI,
unsigned OpIdx,
506 SmallVectorImpl<MCFixup> &Fixups,
507 const MCSubtargetInfo &STI)
const {
508 const MCOperand &MO =
MI.getOperand(
OpIdx);
509 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
514AArch64MCCodeEmitter::getVecShiftR32OpValue(
const MCInst &
MI,
unsigned OpIdx,
515 SmallVectorImpl<MCFixup> &Fixups,
516 const MCSubtargetInfo &STI)
const {
517 const MCOperand &MO =
MI.getOperand(
OpIdx);
518 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
523AArch64MCCodeEmitter::getVecShiftR16OpValue(
const MCInst &
MI,
unsigned OpIdx,
524 SmallVectorImpl<MCFixup> &Fixups,
525 const MCSubtargetInfo &STI)
const {
526 const MCOperand &MO =
MI.getOperand(
OpIdx);
527 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
532AArch64MCCodeEmitter::getVecShiftR8OpValue(
const MCInst &
MI,
unsigned OpIdx,
533 SmallVectorImpl<MCFixup> &Fixups,
534 const MCSubtargetInfo &STI)
const {
535 const MCOperand &MO =
MI.getOperand(
OpIdx);
536 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
541AArch64MCCodeEmitter::getVecShiftL64OpValue(
const MCInst &
MI,
unsigned OpIdx,
542 SmallVectorImpl<MCFixup> &Fixups,
543 const MCSubtargetInfo &STI)
const {
544 const MCOperand &MO =
MI.getOperand(
OpIdx);
545 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
550AArch64MCCodeEmitter::getVecShiftL32OpValue(
const MCInst &
MI,
unsigned OpIdx,
551 SmallVectorImpl<MCFixup> &Fixups,
552 const MCSubtargetInfo &STI)
const {
553 const MCOperand &MO =
MI.getOperand(
OpIdx);
554 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
559AArch64MCCodeEmitter::getVecShiftL16OpValue(
const MCInst &
MI,
unsigned OpIdx,
560 SmallVectorImpl<MCFixup> &Fixups,
561 const MCSubtargetInfo &STI)
const {
562 const MCOperand &MO =
MI.getOperand(
OpIdx);
563 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
568AArch64MCCodeEmitter::getVecShiftL8OpValue(
const MCInst &
MI,
unsigned OpIdx,
569 SmallVectorImpl<MCFixup> &Fixups,
570 const MCSubtargetInfo &STI)
const {
571 const MCOperand &MO =
MI.getOperand(
OpIdx);
572 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
576template <
unsigned Multiple,
unsigned Min,
unsigned Max>
578AArch64MCCodeEmitter::EncodeRegMul_MinMax(
const MCInst &
MI,
unsigned OpIdx,
579 SmallVectorImpl<MCFixup> &Fixups,
580 const MCSubtargetInfo &STI)
const {
582 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
584 assert(RegVal >= Min && RegVal <= Max && (RegVal & (Multiple - 1)) == 0);
585 return (RegVal - Min) / Multiple;
591uint32_t AArch64MCCodeEmitter::EncodeZK(
const MCInst &
MI,
unsigned OpIdx,
592 SmallVectorImpl<MCFixup> &Fixups,
593 const MCSubtargetInfo &STI)
const {
594 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
598 if (RegOpnd > AArch64::Z27)
599 return (RegVal - 24);
601 assert((RegOpnd > AArch64::Z19 && RegOpnd < AArch64::Z24) &&
602 "Expected ZK in Z20..Z23 or Z28..Z31");
604 return (RegVal - 20);
608AArch64MCCodeEmitter::EncodePNR_p8to15(
const MCInst &
MI,
unsigned OpIdx,
609 SmallVectorImpl<MCFixup> &Fixups,
610 const MCSubtargetInfo &STI)
const {
611 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
612 return RegOpnd - AArch64::PN8;
615uint32_t AArch64MCCodeEmitter::EncodeZPR2StridedRegisterClass(
616 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
617 const MCSubtargetInfo &STI)
const {
618 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
620 unsigned T = (RegVal & 0x10) >> 1;
621 unsigned Zt = RegVal & 0x7;
625uint32_t AArch64MCCodeEmitter::EncodeZPR4StridedRegisterClass(
626 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
627 const MCSubtargetInfo &STI)
const {
628 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
630 unsigned T = (RegVal & 0x10) >> 2;
631 unsigned Zt = RegVal & 0x3;
635uint32_t AArch64MCCodeEmitter::EncodeMatrixTileListRegisterClass(
636 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
637 const MCSubtargetInfo &STI)
const {
638 unsigned RegMask =
MI.getOperand(
OpIdx).getImm();
639 assert(RegMask <= 0xFF &&
"Invalid register mask!");
643template <
unsigned BaseReg>
645AArch64MCCodeEmitter::encodeMatrixIndexGPR32(
const MCInst &
MI,
unsigned OpIdx,
646 SmallVectorImpl<MCFixup> &Fixups,
647 const MCSubtargetInfo &STI)
const {
648 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
653AArch64MCCodeEmitter::getImm8OptLsl(
const MCInst &
MI,
unsigned OpIdx,
654 SmallVectorImpl<MCFixup> &Fixups,
655 const MCSubtargetInfo &STI)
const {
657 auto ShiftOpnd =
MI.getOperand(
OpIdx + 1).getImm();
659 "Unexpected shift type for imm8_opt_lsl immediate.");
662 assert((ShiftVal == 0 || ShiftVal == 8) &&
663 "Unexpected shift value for imm8_opt_lsl immediate.");
666 auto Immediate =
MI.getOperand(
OpIdx).getImm();
667 return (Immediate & 0xff) | (ShiftVal == 0 ? 0 : (1 << ShiftVal));
671AArch64MCCodeEmitter::getSVEIncDecImm(
const MCInst &
MI,
unsigned OpIdx,
672 SmallVectorImpl<MCFixup> &Fixups,
673 const MCSubtargetInfo &STI)
const {
674 const MCOperand &MO =
MI.getOperand(
OpIdx);
675 assert(MO.
isImm() &&
"Expected an immediate value!");
682uint32_t AArch64MCCodeEmitter::getMoveVecShifterOpValue(
683 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
684 const MCSubtargetInfo &STI)
const {
685 const MCOperand &MO =
MI.getOperand(
OpIdx);
687 "Expected an immediate value for the move shift amount!");
689 assert((ShiftVal == 8 || ShiftVal == 16) &&
"Invalid shift amount!");
690 return ShiftVal == 8 ? 0 : 1;
693unsigned AArch64MCCodeEmitter::fixMOVZ(
const MCInst &
MI,
unsigned EncodedValue,
694 const MCSubtargetInfo &STI)
const {
699 MCOperand UImm16MO =
MI.getOperand(1);
702 if (UImm16MO.
isImm())
705 const MCExpr *
E = UImm16MO.
getExpr();
707 switch (A64E->getSpecifier()) {
715 return EncodedValue & ~(1u << 30);
725void AArch64MCCodeEmitter::encodeInstruction(
const MCInst &
MI,
726 SmallVectorImpl<char> &CB,
728 SmallVectorImpl<MCFixup> &Fixups,
729 const MCSubtargetInfo &STI)
const {
730 if (
MI.getOpcode() == AArch64::TLSDESCCALL) {
735 ? ELF::R_AARCH64_P32_TLSDESC_CALL
736 : ELF::R_AARCH64_TLSDESC_CALL;
737 addFixup(Fixups, 0,
MI.getOperand(0).getExpr(), Reloc);
741 if (
MI.getOpcode() == AArch64::SPACE) {
746 uint64_t
Binary = getBinaryCodeForInstr(
MI, Fixups, STI);
752AArch64MCCodeEmitter::fixMulHigh(
const MCInst &
MI,
753 unsigned EncodedValue,
754 const MCSubtargetInfo &STI)
const {
757 EncodedValue |= 0x1f << 10;
761template<
int hasRs,
int hasRt2>
unsigned
762AArch64MCCodeEmitter::fixLoadStoreExclusive(
const MCInst &
MI,
763 unsigned EncodedValue,
764 const MCSubtargetInfo &STI)
const {
765 if (!hasRs) EncodedValue |= 0x001F0000;
766 if (!hasRt2) EncodedValue |= 0x00007C00;
771unsigned AArch64MCCodeEmitter::fixOneOperandFPComparison(
772 const MCInst &
MI,
unsigned EncodedValue,
const MCSubtargetInfo &STI)
const {
775 EncodedValue &= ~(0x1f << 16);
779#include "AArch64GenMCCodeEmitter.inc"
783 return new AArch64MCCodeEmitter(MCII, Ctx);
static void addFixup(SmallVectorImpl< MCFixup > &Fixups, uint32_t Offset, const MCExpr *Value, uint16_t Kind, bool PCRel=false)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static uint32_t getBranchTargetOpValue(const MCInst &MI, unsigned OpIdx, unsigned FixupKind, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI)
getBranchTargetOpValue - Helper function to get the branch target operand, which is either an immedia...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
MachineInstr unsigned OpIdx
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
MCCodeEmitter - Generic instruction encoding interface.
Context object for machine code objects.
const MCRegisterInfo * getRegisterInfo() const
Base class for the full range of assembler expressions which are needed for parsing.
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, bool PCRel=false)
Consider bit fields if we need more flags.
Instances of this class represent a single low-level machine instruction.
Interface to description of machine instruction set.
Instances of this class represent operands of the MCInst class.
MCRegister getReg() const
Returns the register number.
const MCExpr * getExpr() const
uint16_t getEncodingValue(MCRegister Reg) const
Returns the encoding for Reg.
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
LLVM Value Representation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static unsigned getShiftValue(unsigned Imm)
getShiftValue - Extract the shift value.
static AArch64_AM::ShiftExtendType getShiftType(unsigned Imm)
getShiftType - Extract the shift type.
@ fixup_aarch64_pcrel_branch9
@ fixup_aarch64_pcrel_branch16
@ fixup_aarch64_pcrel_call26
@ fixup_aarch64_pcrel_branch26
@ fixup_aarch64_pcrel_branch19
@ fixup_aarch64_ldr_pcrel_imm19
@ fixup_aarch64_pcrel_adr_imm21
@ fixup_aarch64_pcrel_branch14
@ fixup_aarch64_pcrel_adrp_imm21
@ fixup_aarch64_add_imm12
BaseReg
Stack frame base register. Bit 0 of FREInfo.Info.
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
uint16_t MCFixupKind
Extensible enumeration to represent the type of a fixup.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
static Lanai::Fixups FixupKind(const MCExpr *Expr)
MCCodeEmitter * createAArch64MCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)