34#define DEBUG_TYPE "mccodeemitter"
36STATISTIC(MCNumEmitted,
"Number of MC instructions emitted.");
37STATISTIC(MCNumFixups,
"Number of MC fixups created.");
46 AArch64MCCodeEmitter(
const AArch64MCCodeEmitter &) =
delete;
47 void operator=(
const AArch64MCCodeEmitter &) =
delete;
48 ~AArch64MCCodeEmitter()
override =
default;
52 uint64_t getBinaryCodeForInstr(
const MCInst &
MI,
53 SmallVectorImpl<MCFixup> &Fixups,
54 const MCSubtargetInfo &STI)
const;
58 unsigned getMachineOpValue(
const MCInst &
MI,
const MCOperand &MO,
59 SmallVectorImpl<MCFixup> &Fixups,
60 const MCSubtargetInfo &STI)
const;
65 template <u
int32_t FixupKind>
66 uint32_t getLdStUImm12OpValue(
const MCInst &
MI,
unsigned OpIdx,
67 SmallVectorImpl<MCFixup> &Fixups,
68 const MCSubtargetInfo &STI)
const;
72 uint32_t getAdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
73 SmallVectorImpl<MCFixup> &Fixups,
74 const MCSubtargetInfo &STI)
const;
78 uint32_t getAddSubImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
79 SmallVectorImpl<MCFixup> &Fixups,
80 const MCSubtargetInfo &STI)
const;
84 uint32_t getCondBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
85 SmallVectorImpl<MCFixup> &Fixups,
86 const MCSubtargetInfo &STI)
const;
90 uint32_t getCondCompBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
91 SmallVectorImpl<MCFixup> &Fixups,
92 const MCSubtargetInfo &STI)
const;
96 uint32_t getPAuthPCRelOpValue(
const MCInst &
MI,
unsigned OpIdx,
97 SmallVectorImpl<MCFixup> &Fixups,
98 const MCSubtargetInfo &STI)
const;
102 uint32_t getLoadLiteralOpValue(
const MCInst &
MI,
unsigned OpIdx,
103 SmallVectorImpl<MCFixup> &Fixups,
104 const MCSubtargetInfo &STI)
const;
109 uint32_t getMemExtendOpValue(
const MCInst &
MI,
unsigned OpIdx,
110 SmallVectorImpl<MCFixup> &Fixups,
111 const MCSubtargetInfo &STI)
const;
115 uint32_t getTestBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
116 SmallVectorImpl<MCFixup> &Fixups,
117 const MCSubtargetInfo &STI)
const;
122 SmallVectorImpl<MCFixup> &Fixups,
123 const MCSubtargetInfo &STI)
const;
127 uint32_t getMoveWideImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
128 SmallVectorImpl<MCFixup> &Fixups,
129 const MCSubtargetInfo &STI)
const;
132 uint32_t getVecShifterOpValue(
const MCInst &
MI,
unsigned OpIdx,
133 SmallVectorImpl<MCFixup> &Fixups,
134 const MCSubtargetInfo &STI)
const;
138 uint32_t getMoveVecShifterOpValue(
const MCInst &
MI,
unsigned OpIdx,
139 SmallVectorImpl<MCFixup> &Fixups,
140 const MCSubtargetInfo &STI)
const;
144 uint32_t getFixedPointScaleOpValue(
const MCInst &
MI,
unsigned OpIdx,
145 SmallVectorImpl<MCFixup> &Fixups,
146 const MCSubtargetInfo &STI)
const;
148 uint32_t getVecShiftR64OpValue(
const MCInst &
MI,
unsigned OpIdx,
149 SmallVectorImpl<MCFixup> &Fixups,
150 const MCSubtargetInfo &STI)
const;
151 uint32_t getVecShiftR32OpValue(
const MCInst &
MI,
unsigned OpIdx,
152 SmallVectorImpl<MCFixup> &Fixups,
153 const MCSubtargetInfo &STI)
const;
154 uint32_t getVecShiftR16OpValue(
const MCInst &
MI,
unsigned OpIdx,
155 SmallVectorImpl<MCFixup> &Fixups,
156 const MCSubtargetInfo &STI)
const;
157 uint32_t getVecShiftR8OpValue(
const MCInst &
MI,
unsigned OpIdx,
158 SmallVectorImpl<MCFixup> &Fixups,
159 const MCSubtargetInfo &STI)
const;
160 uint32_t getVecShiftL64OpValue(
const MCInst &
MI,
unsigned OpIdx,
161 SmallVectorImpl<MCFixup> &Fixups,
162 const MCSubtargetInfo &STI)
const;
163 uint32_t getVecShiftL32OpValue(
const MCInst &
MI,
unsigned OpIdx,
164 SmallVectorImpl<MCFixup> &Fixups,
165 const MCSubtargetInfo &STI)
const;
166 uint32_t getVecShiftL16OpValue(
const MCInst &
MI,
unsigned OpIdx,
167 SmallVectorImpl<MCFixup> &Fixups,
168 const MCSubtargetInfo &STI)
const;
169 uint32_t getVecShiftL8OpValue(
const MCInst &
MI,
unsigned OpIdx,
170 SmallVectorImpl<MCFixup> &Fixups,
171 const MCSubtargetInfo &STI)
const;
173 uint32_t getImm8OptLsl(
const MCInst &
MI,
unsigned OpIdx,
174 SmallVectorImpl<MCFixup> &Fixups,
175 const MCSubtargetInfo &STI)
const;
176 uint32_t getSVEIncDecImm(
const MCInst &
MI,
unsigned OpIdx,
177 SmallVectorImpl<MCFixup> &Fixups,
178 const MCSubtargetInfo &STI)
const;
180 unsigned fixMOVZ(
const MCInst &
MI,
unsigned EncodedValue,
181 const MCSubtargetInfo &STI)
const;
183 void encodeInstruction(
const MCInst &
MI, SmallVectorImpl<char> &CB,
184 SmallVectorImpl<MCFixup> &Fixups,
185 const MCSubtargetInfo &STI)
const override;
187 unsigned fixMulHigh(
const MCInst &
MI,
unsigned EncodedValue,
188 const MCSubtargetInfo &STI)
const;
190 template<
int hasRs,
int hasRt2>
unsigned
191 fixLoadStoreExclusive(
const MCInst &
MI,
unsigned EncodedValue,
192 const MCSubtargetInfo &STI)
const;
194 unsigned fixOneOperandFPComparison(
const MCInst &
MI,
unsigned EncodedValue,
195 const MCSubtargetInfo &STI)
const;
197 template <
unsigned Multiple,
unsigned Min,
unsigned Max>
198 uint32_t EncodeRegMul_MinMax(
const MCInst &
MI,
unsigned OpIdx,
199 SmallVectorImpl<MCFixup> &Fixups,
200 const MCSubtargetInfo &STI)
const;
201 uint32_t EncodeZK(
const MCInst &
MI,
unsigned OpIdx,
202 SmallVectorImpl<MCFixup> &Fixups,
203 const MCSubtargetInfo &STI)
const;
204 uint32_t EncodePNR_p8to15(
const MCInst &
MI,
unsigned OpIdx,
205 SmallVectorImpl<MCFixup> &Fixups,
206 const MCSubtargetInfo &STI)
const;
208 uint32_t EncodeZPR2StridedRegisterClass(
const MCInst &
MI,
unsigned OpIdx,
209 SmallVectorImpl<MCFixup> &Fixups,
210 const MCSubtargetInfo &STI)
const;
211 uint32_t EncodeZPR4StridedRegisterClass(
const MCInst &
MI,
unsigned OpIdx,
212 SmallVectorImpl<MCFixup> &Fixups,
213 const MCSubtargetInfo &STI)
const;
215 uint32_t EncodeMatrixTileListRegisterClass(
const MCInst &
MI,
unsigned OpIdx,
216 SmallVectorImpl<MCFixup> &Fixups,
217 const MCSubtargetInfo &STI)
const;
218 template <
unsigned BaseReg>
219 uint32_t encodeMatrixIndexGPR32(
const MCInst &
MI,
unsigned OpIdx,
220 SmallVectorImpl<MCFixup> &Fixups,
221 const MCSubtargetInfo &STI)
const;
240 assert(MO.
isImm() &&
"did not expect relocated expression");
241 return static_cast<unsigned>(MO.
getImm());
244template<
unsigned FixupKind> uint32_t
245AArch64MCCodeEmitter::getLdStUImm12OpValue(
const MCInst &
MI,
unsigned OpIdx,
246 SmallVectorImpl<MCFixup> &Fixups,
247 const MCSubtargetInfo &STI)
const {
248 const MCOperand &MO =
MI.getOperand(
OpIdx);
252 ImmVal =
static_cast<uint32_t
>(MO.
getImm());
254 assert(MO.
isExpr() &&
"unable to encode load/store imm operand");
266AArch64MCCodeEmitter::getAdrLabelOpValue(
const MCInst &
MI,
unsigned OpIdx,
267 SmallVectorImpl<MCFixup> &Fixups,
268 const MCSubtargetInfo &STI)
const {
269 const MCOperand &MO =
MI.getOperand(
OpIdx);
275 const MCExpr *Expr = MO.
getExpr();
277 unsigned Kind =
MI.getOpcode() == AArch64::ADR
280 addFixup(Fixups, 0, Expr, Kind,
true);
289AArch64MCCodeEmitter::getAddSubImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
290 SmallVectorImpl<MCFixup> &Fixups,
291 const MCSubtargetInfo &STI)
const {
293 const MCOperand &MO =
MI.getOperand(
OpIdx);
294 const MCOperand &MO1 =
MI.getOperand(
OpIdx + 1);
296 "unexpected shift type for add/sub immediate");
298 assert((ShiftVal == 0 || ShiftVal == 12) &&
299 "unexpected shift value for add/sub immediate");
301 return MO.
getImm() | (ShiftVal == 0 ? 0 : (1 << ShiftVal));
303 const MCExpr *Expr = MO.
getExpr();
319 return ShiftVal == 0 ? 0 : (1 << ShiftVal);
324uint32_t AArch64MCCodeEmitter::getCondBranchTargetOpValue(
325 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
326 const MCSubtargetInfo &STI)
const {
327 const MCOperand &MO =
MI.getOperand(
OpIdx);
342uint32_t AArch64MCCodeEmitter::getCondCompBranchTargetOpValue(
343 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
344 const MCSubtargetInfo &STI)
const {
345 const MCOperand &MO =
MI.getOperand(
OpIdx);
361AArch64MCCodeEmitter::getPAuthPCRelOpValue(
const MCInst &
MI,
unsigned OpIdx,
362 SmallVectorImpl<MCFixup> &Fixups,
363 const MCSubtargetInfo &STI)
const {
364 const MCOperand &MO =
MI.getOperand(
OpIdx);
381AArch64MCCodeEmitter::getLoadLiteralOpValue(
const MCInst &
MI,
unsigned OpIdx,
382 SmallVectorImpl<MCFixup> &Fixups,
383 const MCSubtargetInfo &STI)
const {
384 const MCOperand &MO =
MI.getOperand(
OpIdx);
398AArch64MCCodeEmitter::getMemExtendOpValue(
const MCInst &
MI,
unsigned OpIdx,
399 SmallVectorImpl<MCFixup> &Fixups,
400 const MCSubtargetInfo &STI)
const {
401 unsigned SignExtend =
MI.getOperand(
OpIdx).getImm();
402 unsigned DoShift =
MI.getOperand(
OpIdx + 1).getImm();
403 return (SignExtend << 1) | DoShift;
407AArch64MCCodeEmitter::getMoveWideImmOpValue(
const MCInst &
MI,
unsigned OpIdx,
408 SmallVectorImpl<MCFixup> &Fixups,
409 const MCSubtargetInfo &STI)
const {
410 const MCOperand &MO =
MI.getOperand(
OpIdx);
414 assert(MO.
isExpr() &&
"Unexpected movz/movk immediate");
426uint32_t AArch64MCCodeEmitter::getTestBranchTargetOpValue(
427 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
428 const MCSubtargetInfo &STI)
const {
429 const MCOperand &MO =
MI.getOperand(
OpIdx);
445AArch64MCCodeEmitter::getBranchTargetOpValue(
const MCInst &
MI,
unsigned OpIdx,
446 SmallVectorImpl<MCFixup> &Fixups,
447 const MCSubtargetInfo &STI)
const {
448 const MCOperand &MO =
MI.getOperand(
OpIdx);
455 unsigned Kind =
MI.getOpcode() == AArch64::BL
473AArch64MCCodeEmitter::getVecShifterOpValue(
const MCInst &
MI,
unsigned OpIdx,
474 SmallVectorImpl<MCFixup> &Fixups,
475 const MCSubtargetInfo &STI)
const {
476 const MCOperand &MO =
MI.getOperand(
OpIdx);
477 assert(MO.
isImm() &&
"Expected an immediate value for the shift amount!");
497uint32_t AArch64MCCodeEmitter::getFixedPointScaleOpValue(
498 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
499 const MCSubtargetInfo &STI)
const {
500 const MCOperand &MO =
MI.getOperand(
OpIdx);
501 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
506AArch64MCCodeEmitter::getVecShiftR64OpValue(
const MCInst &
MI,
unsigned OpIdx,
507 SmallVectorImpl<MCFixup> &Fixups,
508 const MCSubtargetInfo &STI)
const {
509 const MCOperand &MO =
MI.getOperand(
OpIdx);
510 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
515AArch64MCCodeEmitter::getVecShiftR32OpValue(
const MCInst &
MI,
unsigned OpIdx,
516 SmallVectorImpl<MCFixup> &Fixups,
517 const MCSubtargetInfo &STI)
const {
518 const MCOperand &MO =
MI.getOperand(
OpIdx);
519 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
524AArch64MCCodeEmitter::getVecShiftR16OpValue(
const MCInst &
MI,
unsigned OpIdx,
525 SmallVectorImpl<MCFixup> &Fixups,
526 const MCSubtargetInfo &STI)
const {
527 const MCOperand &MO =
MI.getOperand(
OpIdx);
528 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
533AArch64MCCodeEmitter::getVecShiftR8OpValue(
const MCInst &
MI,
unsigned OpIdx,
534 SmallVectorImpl<MCFixup> &Fixups,
535 const MCSubtargetInfo &STI)
const {
536 const MCOperand &MO =
MI.getOperand(
OpIdx);
537 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
542AArch64MCCodeEmitter::getVecShiftL64OpValue(
const MCInst &
MI,
unsigned OpIdx,
543 SmallVectorImpl<MCFixup> &Fixups,
544 const MCSubtargetInfo &STI)
const {
545 const MCOperand &MO =
MI.getOperand(
OpIdx);
546 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
551AArch64MCCodeEmitter::getVecShiftL32OpValue(
const MCInst &
MI,
unsigned OpIdx,
552 SmallVectorImpl<MCFixup> &Fixups,
553 const MCSubtargetInfo &STI)
const {
554 const MCOperand &MO =
MI.getOperand(
OpIdx);
555 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
560AArch64MCCodeEmitter::getVecShiftL16OpValue(
const MCInst &
MI,
unsigned OpIdx,
561 SmallVectorImpl<MCFixup> &Fixups,
562 const MCSubtargetInfo &STI)
const {
563 const MCOperand &MO =
MI.getOperand(
OpIdx);
564 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
569AArch64MCCodeEmitter::getVecShiftL8OpValue(
const MCInst &
MI,
unsigned OpIdx,
570 SmallVectorImpl<MCFixup> &Fixups,
571 const MCSubtargetInfo &STI)
const {
572 const MCOperand &MO =
MI.getOperand(
OpIdx);
573 assert(MO.
isImm() &&
"Expected an immediate value for the scale amount!");
577template <
unsigned Multiple,
unsigned Min,
unsigned Max>
579AArch64MCCodeEmitter::EncodeRegMul_MinMax(
const MCInst &
MI,
unsigned OpIdx,
580 SmallVectorImpl<MCFixup> &Fixups,
581 const MCSubtargetInfo &STI)
const {
583 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
585 assert(RegVal >= Min && RegVal <= Max && (RegVal & (Multiple - 1)) == 0);
586 return (RegVal - Min) / Multiple;
592uint32_t AArch64MCCodeEmitter::EncodeZK(
const MCInst &
MI,
unsigned OpIdx,
593 SmallVectorImpl<MCFixup> &Fixups,
594 const MCSubtargetInfo &STI)
const {
595 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
599 if (RegOpnd > AArch64::Z27)
600 return (RegVal - 24);
602 assert((RegOpnd > AArch64::Z19 && RegOpnd < AArch64::Z24) &&
603 "Expected ZK in Z20..Z23 or Z28..Z31");
605 return (RegVal - 20);
609AArch64MCCodeEmitter::EncodePNR_p8to15(
const MCInst &
MI,
unsigned OpIdx,
610 SmallVectorImpl<MCFixup> &Fixups,
611 const MCSubtargetInfo &STI)
const {
612 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
613 return RegOpnd - AArch64::PN8;
616uint32_t AArch64MCCodeEmitter::EncodeZPR2StridedRegisterClass(
617 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
618 const MCSubtargetInfo &STI)
const {
619 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
621 unsigned T = (RegVal & 0x10) >> 1;
622 unsigned Zt = RegVal & 0x7;
626uint32_t AArch64MCCodeEmitter::EncodeZPR4StridedRegisterClass(
627 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
628 const MCSubtargetInfo &STI)
const {
629 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
631 unsigned T = (RegVal & 0x10) >> 2;
632 unsigned Zt = RegVal & 0x3;
636uint32_t AArch64MCCodeEmitter::EncodeMatrixTileListRegisterClass(
637 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
638 const MCSubtargetInfo &STI)
const {
639 unsigned RegMask =
MI.getOperand(
OpIdx).getImm();
640 assert(RegMask <= 0xFF &&
"Invalid register mask!");
644template <
unsigned BaseReg>
646AArch64MCCodeEmitter::encodeMatrixIndexGPR32(
const MCInst &
MI,
unsigned OpIdx,
647 SmallVectorImpl<MCFixup> &Fixups,
648 const MCSubtargetInfo &STI)
const {
649 auto RegOpnd =
MI.getOperand(
OpIdx).getReg();
654AArch64MCCodeEmitter::getImm8OptLsl(
const MCInst &
MI,
unsigned OpIdx,
655 SmallVectorImpl<MCFixup> &Fixups,
656 const MCSubtargetInfo &STI)
const {
658 auto ShiftOpnd =
MI.getOperand(
OpIdx + 1).getImm();
660 "Unexpected shift type for imm8_opt_lsl immediate.");
663 assert((ShiftVal == 0 || ShiftVal == 8) &&
664 "Unexpected shift value for imm8_opt_lsl immediate.");
667 auto Immediate =
MI.getOperand(
OpIdx).getImm();
668 return (Immediate & 0xff) | (ShiftVal == 0 ? 0 : (1 << ShiftVal));
672AArch64MCCodeEmitter::getSVEIncDecImm(
const MCInst &
MI,
unsigned OpIdx,
673 SmallVectorImpl<MCFixup> &Fixups,
674 const MCSubtargetInfo &STI)
const {
675 const MCOperand &MO =
MI.getOperand(
OpIdx);
676 assert(MO.
isImm() &&
"Expected an immediate value!");
683uint32_t AArch64MCCodeEmitter::getMoveVecShifterOpValue(
684 const MCInst &
MI,
unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
685 const MCSubtargetInfo &STI)
const {
686 const MCOperand &MO =
MI.getOperand(
OpIdx);
688 "Expected an immediate value for the move shift amount!");
690 assert((ShiftVal == 8 || ShiftVal == 16) &&
"Invalid shift amount!");
691 return ShiftVal == 8 ? 0 : 1;
694unsigned AArch64MCCodeEmitter::fixMOVZ(
const MCInst &
MI,
unsigned EncodedValue,
695 const MCSubtargetInfo &STI)
const {
700 MCOperand UImm16MO =
MI.getOperand(1);
703 if (UImm16MO.
isImm())
706 const MCExpr *
E = UImm16MO.
getExpr();
708 switch (A64E->getSpecifier()) {
716 return EncodedValue & ~(1u << 30);
726void AArch64MCCodeEmitter::encodeInstruction(
const MCInst &
MI,
727 SmallVectorImpl<char> &CB,
729 SmallVectorImpl<MCFixup> &Fixups,
730 const MCSubtargetInfo &STI)
const {
731 if (
MI.getOpcode() == AArch64::TLSDESCCALL) {
736 ? ELF::R_AARCH64_P32_TLSDESC_CALL
737 : ELF::R_AARCH64_TLSDESC_CALL;
738 addFixup(Fixups, 0,
MI.getOperand(0).getExpr(), Reloc);
742 if (
MI.getOpcode() == AArch64::SPACE) {
747 uint64_t
Binary = getBinaryCodeForInstr(
MI, Fixups, STI);
753AArch64MCCodeEmitter::fixMulHigh(
const MCInst &
MI,
754 unsigned EncodedValue,
755 const MCSubtargetInfo &STI)
const {
758 EncodedValue |= 0x1f << 10;
762template<
int hasRs,
int hasRt2>
unsigned
763AArch64MCCodeEmitter::fixLoadStoreExclusive(
const MCInst &
MI,
764 unsigned EncodedValue,
765 const MCSubtargetInfo &STI)
const {
766 if (!hasRs) EncodedValue |= 0x001F0000;
767 if (!hasRt2) EncodedValue |= 0x00007C00;
772unsigned AArch64MCCodeEmitter::fixOneOperandFPComparison(
773 const MCInst &
MI,
unsigned EncodedValue,
const MCSubtargetInfo &STI)
const {
776 EncodedValue &= ~(0x1f << 16);
780#include "AArch64GenMCCodeEmitter.inc"
784 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)