Lines Matching defs:MO
61 unsigned getMachineOpValue(const MCInst &MI, const MCOperand &MO,
223 AArch64MCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO,
226 if (MO.isReg())
227 return Ctx.getRegisterInfo()->getEncodingValue(MO.getReg());
229 assert(MO.isImm() && "did not expect relocated expression");
230 return static_cast<unsigned>(MO.getImm());
237 const MCOperand &MO = MI.getOperand(OpIdx);
240 if (MO.isImm())
241 ImmVal = static_cast<uint32_t>(MO.getImm());
243 assert(MO.isExpr() && "unable to encode load/store imm operand");
245 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
258 const MCOperand &MO = MI.getOperand(OpIdx);
261 if (MO.isImm())
262 return MO.getImm();
263 assert(MO.isExpr() && "Unexpected target type!");
264 const MCExpr *Expr = MO.getExpr();
285 const MCOperand &MO = MI.getOperand(OpIdx);
292 if (MO.isImm())
293 return MO.getImm() | (ShiftVal == 0 ? 0 : (1 << ShiftVal));
294 assert(MO.isExpr() && "Unable to encode MCOperand!");
295 const MCExpr *Expr = MO.getExpr();
320 const MCOperand &MO = MI.getOperand(OpIdx);
323 if (MO.isImm())
324 return MO.getImm();
325 assert(MO.isExpr() && "Unexpected target type!");
328 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
342 const MCOperand &MO = MI.getOperand(OpIdx);
346 if (MO.isImm())
347 return -(MO.getImm());
348 assert(MO.isExpr() && "Unexpected target type!");
351 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
365 const MCOperand &MO = MI.getOperand(OpIdx);
368 if (MO.isImm())
369 return MO.getImm();
370 assert(MO.isExpr() && "Unexpected target type!");
373 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
394 const MCOperand &MO = MI.getOperand(OpIdx);
396 if (MO.isImm())
397 return MO.getImm();
398 assert(MO.isExpr() && "Unexpected movz/movk immediate");
401 0, MO.getExpr(), MCFixupKind(AArch64::fixup_aarch64_movw), MI.getLoc()));
413 const MCOperand &MO = MI.getOperand(OpIdx);
416 if (MO.isImm())
417 return MO.getImm();
418 assert(MO.isExpr() && "Unexpected ADR target type!");
421 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
435 const MCOperand &MO = MI.getOperand(OpIdx);
438 if (MO.isImm())
439 return MO.getImm();
440 assert(MO.isExpr() && "Unexpected ADR target type!");
445 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
463 const MCOperand &MO = MI.getOperand(OpIdx);
464 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
466 switch (MO.getImm()) {
487 const MCOperand &MO = MI.getOperand(OpIdx);
488 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
489 return 64 - MO.getImm();
496 const MCOperand &MO = MI.getOperand(OpIdx);
497 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
498 return 64 - MO.getImm();
505 const MCOperand &MO = MI.getOperand(OpIdx);
506 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
507 return 32 - MO.getImm();
514 const MCOperand &MO = MI.getOperand(OpIdx);
515 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
516 return 16 - MO.getImm();
523 const MCOperand &MO = MI.getOperand(OpIdx);
524 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
525 return 8 - MO.getImm();
532 const MCOperand &MO = MI.getOperand(OpIdx);
533 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
534 return MO.getImm() - 64;
541 const MCOperand &MO = MI.getOperand(OpIdx);
542 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
543 return MO.getImm() - 32;
550 const MCOperand &MO = MI.getOperand(OpIdx);
551 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
552 return MO.getImm() - 16;
559 const MCOperand &MO = MI.getOperand(OpIdx);
560 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
561 return MO.getImm() - 8;
642 const MCOperand &MO = MI.getOperand(OpIdx);
643 assert(MO.isImm() && "Expected an immediate value!");
645 return MO.getImm() - 1;
653 const MCOperand &MO = MI.getOperand(OpIdx);
654 assert(MO.isImm() &&
656 unsigned ShiftVal = AArch64_AM::getShiftValue(MO.getImm());