1 //===-- ARM64/ARM64MCCodeEmitter.cpp - Convert ARM64 code to machine code -===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements the ARM64MCCodeEmitter class.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "mccodeemitter"
15 #include "MCTargetDesc/ARM64AddressingModes.h"
16 #include "MCTargetDesc/ARM64FixupKinds.h"
17 #include "MCTargetDesc/ARM64MCExpr.h"
18 #include "Utils/ARM64BaseInfo.h"
19 #include "llvm/MC/MCCodeEmitter.h"
20 #include "llvm/MC/MCContext.h"
21 #include "llvm/MC/MCInst.h"
22 #include "llvm/MC/MCInstrInfo.h"
23 #include "llvm/MC/MCRegisterInfo.h"
24 #include "llvm/MC/MCSubtargetInfo.h"
25 #include "llvm/ADT/Statistic.h"
26 #include "llvm/Support/raw_ostream.h"
29 STATISTIC(MCNumEmitted, "Number of MC instructions emitted.");
30 STATISTIC(MCNumFixups, "Number of MC fixups created.");
34 class ARM64MCCodeEmitter : public MCCodeEmitter {
37 ARM64MCCodeEmitter(const ARM64MCCodeEmitter &); // DO NOT IMPLEMENT
38 void operator=(const ARM64MCCodeEmitter &); // DO NOT IMPLEMENT
40 ARM64MCCodeEmitter(const MCInstrInfo &mcii, const MCSubtargetInfo &sti,
44 ~ARM64MCCodeEmitter() {}
46 // getBinaryCodeForInstr - TableGen'erated function for getting the
47 // binary encoding for an instruction.
48 uint64_t getBinaryCodeForInstr(const MCInst &MI,
49 SmallVectorImpl<MCFixup> &Fixups,
50 const MCSubtargetInfo &STI) const;
52 /// getMachineOpValue - Return binary encoding of operand. If the machine
53 /// operand requires relocation, record the relocation and return zero.
54 unsigned getMachineOpValue(const MCInst &MI, const MCOperand &MO,
55 SmallVectorImpl<MCFixup> &Fixups,
56 const MCSubtargetInfo &STI) const;
58 /// getAMIndexed8OpValue - Return encoding info for base register
59 /// and 12-bit unsigned immediate attached to a load, store or prfm
60 /// instruction. If operand requires a relocation, record it and
61 /// return zero in that part of the encoding.
62 template <uint32_t FixupKind>
63 uint32_t getAMIndexed8OpValue(const MCInst &MI, unsigned OpIdx,
64 SmallVectorImpl<MCFixup> &Fixups,
65 const MCSubtargetInfo &STI) const;
67 /// getAdrLabelOpValue - Return encoding info for 21-bit immediate ADR label
69 uint32_t getAdrLabelOpValue(const MCInst &MI, unsigned OpIdx,
70 SmallVectorImpl<MCFixup> &Fixups,
71 const MCSubtargetInfo &STI) const;
73 /// getAddSubImmOpValue - Return encoding for the 12-bit immediate value and
74 /// the 2-bit shift field.
75 uint32_t getAddSubImmOpValue(const MCInst &MI, unsigned OpIdx,
76 SmallVectorImpl<MCFixup> &Fixups,
77 const MCSubtargetInfo &STI) const;
79 /// getCondBranchTargetOpValue - Return the encoded value for a conditional
81 uint32_t getCondBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
82 SmallVectorImpl<MCFixup> &Fixups,
83 const MCSubtargetInfo &STI) const;
85 /// getTestBranchTargetOpValue - Return the encoded value for a test-bit-and-
87 uint32_t getTestBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
88 SmallVectorImpl<MCFixup> &Fixups,
89 const MCSubtargetInfo &STI) const;
91 /// getBranchTargetOpValue - Return the encoded value for an unconditional
93 uint32_t getBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
94 SmallVectorImpl<MCFixup> &Fixups,
95 const MCSubtargetInfo &STI) const;
97 /// getMoveWideImmOpValue - Return the encoded value for the immediate operand
98 /// of a MOVZ or MOVK instruction.
99 uint32_t getMoveWideImmOpValue(const MCInst &MI, unsigned OpIdx,
100 SmallVectorImpl<MCFixup> &Fixups,
101 const MCSubtargetInfo &STI) const;
103 /// getVecShifterOpValue - Return the encoded value for the vector shifter.
104 uint32_t getVecShifterOpValue(const MCInst &MI, unsigned OpIdx,
105 SmallVectorImpl<MCFixup> &Fixups,
106 const MCSubtargetInfo &STI) const;
108 /// getMoveVecShifterOpValue - Return the encoded value for the vector move
110 uint32_t getMoveVecShifterOpValue(const MCInst &MI, unsigned OpIdx,
111 SmallVectorImpl<MCFixup> &Fixups,
112 const MCSubtargetInfo &STI) const;
114 /// getFixedPointScaleOpValue - Return the encoded value for the
115 // FP-to-fixed-point scale factor.
116 uint32_t getFixedPointScaleOpValue(const MCInst &MI, unsigned OpIdx,
117 SmallVectorImpl<MCFixup> &Fixups,
118 const MCSubtargetInfo &STI) const;
120 uint32_t getVecShiftR64OpValue(const MCInst &MI, unsigned OpIdx,
121 SmallVectorImpl<MCFixup> &Fixups,
122 const MCSubtargetInfo &STI) const;
123 uint32_t getVecShiftR32OpValue(const MCInst &MI, unsigned OpIdx,
124 SmallVectorImpl<MCFixup> &Fixups,
125 const MCSubtargetInfo &STI) const;
126 uint32_t getVecShiftR16OpValue(const MCInst &MI, unsigned OpIdx,
127 SmallVectorImpl<MCFixup> &Fixups,
128 const MCSubtargetInfo &STI) const;
129 uint32_t getVecShiftR8OpValue(const MCInst &MI, unsigned OpIdx,
130 SmallVectorImpl<MCFixup> &Fixups,
131 const MCSubtargetInfo &STI) const;
132 uint32_t getVecShiftL64OpValue(const MCInst &MI, unsigned OpIdx,
133 SmallVectorImpl<MCFixup> &Fixups,
134 const MCSubtargetInfo &STI) const;
135 uint32_t getVecShiftL32OpValue(const MCInst &MI, unsigned OpIdx,
136 SmallVectorImpl<MCFixup> &Fixups,
137 const MCSubtargetInfo &STI) const;
138 uint32_t getVecShiftL16OpValue(const MCInst &MI, unsigned OpIdx,
139 SmallVectorImpl<MCFixup> &Fixups,
140 const MCSubtargetInfo &STI) const;
141 uint32_t getVecShiftL8OpValue(const MCInst &MI, unsigned OpIdx,
142 SmallVectorImpl<MCFixup> &Fixups,
143 const MCSubtargetInfo &STI) const;
145 /// getSIMDShift64OpValue - Return the encoded value for the
146 // shift-by-immediate AdvSIMD instructions.
147 uint32_t getSIMDShift64OpValue(const MCInst &MI, unsigned OpIdx,
148 SmallVectorImpl<MCFixup> &Fixups,
149 const MCSubtargetInfo &STI) const;
151 uint32_t getSIMDShift64_32OpValue(const MCInst &MI, unsigned OpIdx,
152 SmallVectorImpl<MCFixup> &Fixups,
153 const MCSubtargetInfo &STI) const;
155 uint32_t getSIMDShift32OpValue(const MCInst &MI, unsigned OpIdx,
156 SmallVectorImpl<MCFixup> &Fixups,
157 const MCSubtargetInfo &STI) const;
159 uint32_t getSIMDShift16OpValue(const MCInst &MI, unsigned OpIdx,
160 SmallVectorImpl<MCFixup> &Fixups,
161 const MCSubtargetInfo &STI) const;
163 unsigned fixMOVZ(const MCInst &MI, unsigned EncodedValue,
164 const MCSubtargetInfo &STI) const;
166 void EmitByte(unsigned char C, raw_ostream &OS) const { OS << (char)C; }
168 void EmitConstant(uint64_t Val, unsigned Size, raw_ostream &OS) const {
169 // Output the constant in little endian byte order.
170 for (unsigned i = 0; i != Size; ++i) {
171 EmitByte(Val & 255, OS);
176 void EncodeInstruction(const MCInst &MI, raw_ostream &OS,
177 SmallVectorImpl<MCFixup> &Fixups,
178 const MCSubtargetInfo &STI) const;
180 unsigned fixMulHigh(const MCInst &MI, unsigned EncodedValue,
181 const MCSubtargetInfo &STI) const;
183 template<int hasRs, int hasRt2> unsigned
184 fixLoadStoreExclusive(const MCInst &MI, unsigned EncodedValue,
185 const MCSubtargetInfo &STI) const;
189 } // end anonymous namespace
191 MCCodeEmitter *llvm::createARM64MCCodeEmitter(const MCInstrInfo &MCII,
192 const MCRegisterInfo &MRI,
193 const MCSubtargetInfo &STI,
195 return new ARM64MCCodeEmitter(MCII, STI, Ctx);
198 /// getMachineOpValue - Return binary encoding of operand. If the machine
199 /// operand requires relocation, record the relocation and return zero.
201 ARM64MCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO,
202 SmallVectorImpl<MCFixup> &Fixups,
203 const MCSubtargetInfo &STI) const {
205 return Ctx.getRegisterInfo()->getEncodingValue(MO.getReg());
207 assert(MO.isImm() && "did not expect relocated expression");
208 return static_cast<unsigned>(MO.getImm());
211 assert(0 && "Unable to encode MCOperand!");
215 template <uint32_t FixupKind>
217 ARM64MCCodeEmitter::getAMIndexed8OpValue(const MCInst &MI, unsigned OpIdx,
218 SmallVectorImpl<MCFixup> &Fixups,
219 const MCSubtargetInfo &STI) const {
220 unsigned BaseReg = MI.getOperand(OpIdx).getReg();
221 BaseReg = Ctx.getRegisterInfo()->getEncodingValue(BaseReg);
223 const MCOperand &MO = MI.getOperand(OpIdx + 1);
227 ImmVal = static_cast<uint32_t>(MO.getImm());
229 assert(MO.isExpr() && "unable to encode load/store imm operand");
230 MCFixupKind Kind = MCFixupKind(FixupKind);
231 Fixups.push_back(MCFixup::Create(0, MO.getExpr(), Kind, MI.getLoc()));
235 return BaseReg | (ImmVal << 5);
238 /// getAdrLabelOpValue - Return encoding info for 21-bit immediate ADR label
241 ARM64MCCodeEmitter::getAdrLabelOpValue(const MCInst &MI, unsigned OpIdx,
242 SmallVectorImpl<MCFixup> &Fixups,
243 const MCSubtargetInfo &STI) const {
244 const MCOperand &MO = MI.getOperand(OpIdx);
246 // If the destination is an immediate, we have nothing to do.
249 assert(MO.isExpr() && "Unexpected ADR target type!");
250 const MCExpr *Expr = MO.getExpr();
252 MCFixupKind Kind = MI.getOpcode() == ARM64::ADR
253 ? MCFixupKind(ARM64::fixup_arm64_pcrel_adr_imm21)
254 : MCFixupKind(ARM64::fixup_arm64_pcrel_adrp_imm21);
255 Fixups.push_back(MCFixup::Create(0, Expr, Kind, MI.getLoc()));
259 // All of the information is in the fixup.
263 /// getAddSubImmOpValue - Return encoding for the 12-bit immediate value and
264 /// the 2-bit shift field. The shift field is stored in bits 13-14 of the
267 ARM64MCCodeEmitter::getAddSubImmOpValue(const MCInst &MI, unsigned OpIdx,
268 SmallVectorImpl<MCFixup> &Fixups,
269 const MCSubtargetInfo &STI) const {
270 // Suboperands are [imm, shifter].
271 const MCOperand &MO = MI.getOperand(OpIdx);
272 const MCOperand &MO1 = MI.getOperand(OpIdx + 1);
273 assert(ARM64_AM::getShiftType(MO1.getImm()) == ARM64_AM::LSL &&
274 "unexpected shift type for add/sub immediate");
275 unsigned ShiftVal = ARM64_AM::getShiftValue(MO1.getImm());
276 assert((ShiftVal == 0 || ShiftVal == 12) &&
277 "unexpected shift value for add/sub immediate");
279 return MO.getImm() | (ShiftVal == 0 ? 0 : (1 << 12));
280 assert(MO.isExpr() && "Unable to encode MCOperand!");
281 const MCExpr *Expr = MO.getExpr();
282 assert(ShiftVal == 0 && "shift not allowed on add/sub immediate with fixup");
284 // Encode the 12 bits of the fixup.
285 MCFixupKind Kind = MCFixupKind(ARM64::fixup_arm64_add_imm12);
286 Fixups.push_back(MCFixup::Create(0, Expr, Kind, MI.getLoc()));
293 /// getCondBranchTargetOpValue - Return the encoded value for a conditional
295 uint32_t ARM64MCCodeEmitter::getCondBranchTargetOpValue(
296 const MCInst &MI, unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
297 const MCSubtargetInfo &STI) const {
298 const MCOperand &MO = MI.getOperand(OpIdx);
300 // If the destination is an immediate, we have nothing to do.
303 assert(MO.isExpr() && "Unexpected target type!");
305 MCFixupKind Kind = MCFixupKind(ARM64::fixup_arm64_pcrel_imm19);
306 Fixups.push_back(MCFixup::Create(0, MO.getExpr(), Kind, MI.getLoc()));
310 // All of the information is in the fixup.
315 ARM64MCCodeEmitter::getMoveWideImmOpValue(const MCInst &MI, unsigned OpIdx,
316 SmallVectorImpl<MCFixup> &Fixups,
317 const MCSubtargetInfo &STI) const {
318 const MCOperand &MO = MI.getOperand(OpIdx);
322 assert(MO.isExpr() && "Unexpected movz/movk immediate");
324 Fixups.push_back(MCFixup::Create(
325 0, MO.getExpr(), MCFixupKind(ARM64::fixup_arm64_movw), MI.getLoc()));
332 /// getTestBranchTargetOpValue - Return the encoded value for a test-bit-and-
334 uint32_t ARM64MCCodeEmitter::getTestBranchTargetOpValue(
335 const MCInst &MI, unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
336 const MCSubtargetInfo &STI) const {
337 const MCOperand &MO = MI.getOperand(OpIdx);
339 // If the destination is an immediate, we have nothing to do.
342 assert(MO.isExpr() && "Unexpected ADR target type!");
344 MCFixupKind Kind = MCFixupKind(ARM64::fixup_arm64_pcrel_branch14);
345 Fixups.push_back(MCFixup::Create(0, MO.getExpr(), Kind, MI.getLoc()));
349 // All of the information is in the fixup.
353 /// getBranchTargetOpValue - Return the encoded value for an unconditional
356 ARM64MCCodeEmitter::getBranchTargetOpValue(const MCInst &MI, unsigned OpIdx,
357 SmallVectorImpl<MCFixup> &Fixups,
358 const MCSubtargetInfo &STI) const {
359 const MCOperand &MO = MI.getOperand(OpIdx);
361 // If the destination is an immediate, we have nothing to do.
364 assert(MO.isExpr() && "Unexpected ADR target type!");
366 MCFixupKind Kind = MI.getOpcode() == ARM64::BL
367 ? MCFixupKind(ARM64::fixup_arm64_pcrel_call26)
368 : MCFixupKind(ARM64::fixup_arm64_pcrel_branch26);
369 Fixups.push_back(MCFixup::Create(0, MO.getExpr(), Kind, MI.getLoc()));
373 // All of the information is in the fixup.
377 /// getVecShifterOpValue - Return the encoded value for the vector shifter:
384 ARM64MCCodeEmitter::getVecShifterOpValue(const MCInst &MI, unsigned OpIdx,
385 SmallVectorImpl<MCFixup> &Fixups,
386 const MCSubtargetInfo &STI) const {
387 const MCOperand &MO = MI.getOperand(OpIdx);
388 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
390 switch (MO.getImm()) {
403 assert(false && "Invalid value for vector shift amount!");
408 ARM64MCCodeEmitter::getSIMDShift64OpValue(const MCInst &MI, unsigned OpIdx,
409 SmallVectorImpl<MCFixup> &Fixups,
410 const MCSubtargetInfo &STI) const {
411 const MCOperand &MO = MI.getOperand(OpIdx);
412 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
413 return 64 - (MO.getImm());
417 ARM64MCCodeEmitter::getSIMDShift64_32OpValue(const MCInst &MI, unsigned OpIdx,
418 SmallVectorImpl<MCFixup> &Fixups,
419 const MCSubtargetInfo &STI) const {
420 const MCOperand &MO = MI.getOperand(OpIdx);
421 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
422 return 64 - (MO.getImm() | 32);
426 ARM64MCCodeEmitter::getSIMDShift32OpValue(const MCInst &MI, unsigned OpIdx,
427 SmallVectorImpl<MCFixup> &Fixups,
428 const MCSubtargetInfo &STI) const {
429 const MCOperand &MO = MI.getOperand(OpIdx);
430 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
431 return 32 - (MO.getImm() | 16);
435 ARM64MCCodeEmitter::getSIMDShift16OpValue(const MCInst &MI, unsigned OpIdx,
436 SmallVectorImpl<MCFixup> &Fixups,
437 const MCSubtargetInfo &STI) const {
438 const MCOperand &MO = MI.getOperand(OpIdx);
439 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
440 return 16 - (MO.getImm() | 8);
443 /// getFixedPointScaleOpValue - Return the encoded value for the
444 // FP-to-fixed-point scale factor.
445 uint32_t ARM64MCCodeEmitter::getFixedPointScaleOpValue(
446 const MCInst &MI, unsigned OpIdx, SmallVectorImpl<MCFixup> &Fixups,
447 const MCSubtargetInfo &STI) const {
448 const MCOperand &MO = MI.getOperand(OpIdx);
449 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
450 return 64 - MO.getImm();
454 ARM64MCCodeEmitter::getVecShiftR64OpValue(const MCInst &MI, unsigned OpIdx,
455 SmallVectorImpl<MCFixup> &Fixups,
456 const MCSubtargetInfo &STI) const {
457 const MCOperand &MO = MI.getOperand(OpIdx);
458 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
459 return 64 - MO.getImm();
463 ARM64MCCodeEmitter::getVecShiftR32OpValue(const MCInst &MI, unsigned OpIdx,
464 SmallVectorImpl<MCFixup> &Fixups,
465 const MCSubtargetInfo &STI) const {
466 const MCOperand &MO = MI.getOperand(OpIdx);
467 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
468 return 32 - MO.getImm();
472 ARM64MCCodeEmitter::getVecShiftR16OpValue(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 scale amount!");
477 return 16 - MO.getImm();
481 ARM64MCCodeEmitter::getVecShiftR8OpValue(const MCInst &MI, unsigned OpIdx,
482 SmallVectorImpl<MCFixup> &Fixups,
483 const MCSubtargetInfo &STI) const {
484 const MCOperand &MO = MI.getOperand(OpIdx);
485 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
486 return 8 - MO.getImm();
490 ARM64MCCodeEmitter::getVecShiftL64OpValue(const MCInst &MI, unsigned OpIdx,
491 SmallVectorImpl<MCFixup> &Fixups,
492 const MCSubtargetInfo &STI) const {
493 const MCOperand &MO = MI.getOperand(OpIdx);
494 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
495 return MO.getImm() - 64;
499 ARM64MCCodeEmitter::getVecShiftL32OpValue(const MCInst &MI, unsigned OpIdx,
500 SmallVectorImpl<MCFixup> &Fixups,
501 const MCSubtargetInfo &STI) const {
502 const MCOperand &MO = MI.getOperand(OpIdx);
503 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
504 return MO.getImm() - 32;
508 ARM64MCCodeEmitter::getVecShiftL16OpValue(const MCInst &MI, unsigned OpIdx,
509 SmallVectorImpl<MCFixup> &Fixups,
510 const MCSubtargetInfo &STI) const {
511 const MCOperand &MO = MI.getOperand(OpIdx);
512 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
513 return MO.getImm() - 16;
517 ARM64MCCodeEmitter::getVecShiftL8OpValue(const MCInst &MI, unsigned OpIdx,
518 SmallVectorImpl<MCFixup> &Fixups,
519 const MCSubtargetInfo &STI) const {
520 const MCOperand &MO = MI.getOperand(OpIdx);
521 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
522 return MO.getImm() - 8;
525 /// getMoveVecShifterOpValue - Return the encoded value for the vector move
528 ARM64MCCodeEmitter::getMoveVecShifterOpValue(const MCInst &MI, unsigned OpIdx,
529 SmallVectorImpl<MCFixup> &Fixups,
530 const MCSubtargetInfo &STI) const {
531 const MCOperand &MO = MI.getOperand(OpIdx);
533 "Expected an immediate value for the move shift amount!");
534 unsigned ShiftVal = ARM64_AM::getShiftValue(MO.getImm());
535 assert((ShiftVal == 8 || ShiftVal == 16) && "Invalid shift amount!");
536 return ShiftVal == 8 ? 0 : 1;
539 unsigned ARM64MCCodeEmitter::fixMOVZ(const MCInst &MI, unsigned EncodedValue,
540 const MCSubtargetInfo &STI) const {
541 // If one of the signed fixup kinds is applied to a MOVZ instruction, the
542 // eventual result could be either a MOVZ or a MOVN. It's the MCCodeEmitter's
543 // job to ensure that any bits possibly affected by this are 0. This means we
544 // must zero out bit 30 (essentially emitting a MOVN).
545 MCOperand UImm16MO = MI.getOperand(1);
547 // Nothing to do if there's no fixup.
548 if (UImm16MO.isImm())
551 return EncodedValue & ~(1u << 30);
554 void ARM64MCCodeEmitter::EncodeInstruction(const MCInst &MI, raw_ostream &OS,
555 SmallVectorImpl<MCFixup> &Fixups,
556 const MCSubtargetInfo &STI) const {
557 if (MI.getOpcode() == ARM64::TLSDESCCALL) {
558 // This is a directive which applies an R_AARCH64_TLSDESC_CALL to the
559 // following (BLR) instruction. It doesn't emit any code itself so it
560 // doesn't go through the normal TableGenerated channels.
561 MCFixupKind Fixup = MCFixupKind(ARM64::fixup_arm64_tlsdesc_call);
562 Fixups.push_back(MCFixup::Create(0, MI.getOperand(0).getExpr(), Fixup));
566 uint64_t Binary = getBinaryCodeForInstr(MI, Fixups, STI);
567 EmitConstant(Binary, 4, OS);
568 ++MCNumEmitted; // Keep track of the # of mi's emitted.
572 ARM64MCCodeEmitter::fixMulHigh(const MCInst &MI,
573 unsigned EncodedValue,
574 const MCSubtargetInfo &STI) const {
575 // The Ra field of SMULH and UMULH is unused: it should be assembled as 31
576 // (i.e. all bits 1) but is ignored by the processor.
577 EncodedValue |= 0x1f << 10;
581 template<int hasRs, int hasRt2> unsigned
582 ARM64MCCodeEmitter::fixLoadStoreExclusive(const MCInst &MI,
583 unsigned EncodedValue,
584 const MCSubtargetInfo &STI) const {
585 if (!hasRs) EncodedValue |= 0x001F0000;
586 if (!hasRt2) EncodedValue |= 0x00007C00;
591 #include "ARM64GenMCCodeEmitter.inc"