Lines Matching defs:MO

58   unsigned getMachineOpValue(const MCInst &MI, const MCOperand &MO,
229 AArch64MCCodeEmitter::getMachineOpValue(const MCInst &MI, const MCOperand &MO,
232 if (MO.isReg())
233 return Ctx.getRegisterInfo()->getEncodingValue(MO.getReg());
235 assert(MO.isImm() && "did not expect relocated expression");
236 return static_cast<unsigned>(MO.getImm());
243 const MCOperand &MO = MI.getOperand(OpIdx);
246 if (MO.isImm())
247 ImmVal = static_cast<uint32_t>(MO.getImm());
249 assert(MO.isExpr() && "unable to encode load/store imm operand");
251 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
264 const MCOperand &MO = MI.getOperand(OpIdx);
267 if (MO.isImm())
268 return MO.getImm();
269 assert(MO.isExpr() && "Unexpected target type!");
270 const MCExpr *Expr = MO.getExpr();
291 const MCOperand &MO = MI.getOperand(OpIdx);
298 if (MO.isImm())
299 return MO.getImm() | (ShiftVal == 0 ? 0 : (1 << ShiftVal));
300 assert(MO.isExpr() && "Unable to encode MCOperand!");
301 const MCExpr *Expr = MO.getExpr();
326 const MCOperand &MO = MI.getOperand(OpIdx);
329 if (MO.isImm())
330 return MO.getImm();
331 assert(MO.isExpr() && "Unexpected target type!");
334 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
347 const MCOperand &MO = MI.getOperand(OpIdx);
350 if (MO.isImm())
351 return MO.getImm();
352 assert(MO.isExpr() && "Unexpected target type!");
355 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
369 const MCOperand &MO = MI.getOperand(OpIdx);
373 if (MO.isImm())
374 return -(MO.getImm());
375 assert(MO.isExpr() && "Unexpected target type!");
378 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
392 const MCOperand &MO = MI.getOperand(OpIdx);
395 if (MO.isImm())
396 return MO.getImm();
397 assert(MO.isExpr() && "Unexpected target type!");
400 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
421 const MCOperand &MO = MI.getOperand(OpIdx);
423 if (MO.isImm())
424 return MO.getImm();
425 assert(MO.isExpr() && "Unexpected movz/movk immediate");
428 0, MO.getExpr(), MCFixupKind(AArch64::fixup_aarch64_movw), MI.getLoc()));
440 const MCOperand &MO = MI.getOperand(OpIdx);
443 if (MO.isImm())
444 return MO.getImm();
445 assert(MO.isExpr() && "Unexpected ADR target type!");
448 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
462 const MCOperand &MO = MI.getOperand(OpIdx);
465 if (MO.isImm())
466 return MO.getImm();
467 assert(MO.isExpr() && "Unexpected ADR target type!");
472 Fixups.push_back(MCFixup::create(0, MO.getExpr(), Kind, MI.getLoc()));
490 const MCOperand &MO = MI.getOperand(OpIdx);
491 assert(MO.isImm() && "Expected an immediate value for the shift amount!");
493 switch (MO.getImm()) {
514 const MCOperand &MO = MI.getOperand(OpIdx);
515 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
516 return 64 - MO.getImm();
523 const MCOperand &MO = MI.getOperand(OpIdx);
524 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
525 return 64 - MO.getImm();
532 const MCOperand &MO = MI.getOperand(OpIdx);
533 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
534 return 32 - MO.getImm();
541 const MCOperand &MO = MI.getOperand(OpIdx);
542 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
543 return 16 - MO.getImm();
550 const MCOperand &MO = MI.getOperand(OpIdx);
551 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
552 return 8 - MO.getImm();
559 const MCOperand &MO = MI.getOperand(OpIdx);
560 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
561 return MO.getImm() - 64;
568 const MCOperand &MO = MI.getOperand(OpIdx);
569 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
570 return MO.getImm() - 32;
577 const MCOperand &MO = MI.getOperand(OpIdx);
578 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
579 return MO.getImm() - 16;
586 const MCOperand &MO = MI.getOperand(OpIdx);
587 assert(MO.isImm() && "Expected an immediate value for the scale amount!");
588 return MO.getImm() - 8;
689 const MCOperand &MO = MI.getOperand(OpIdx);
690 assert(MO.isImm() && "Expected an immediate value!");
692 return MO.getImm() - 1;
700 const MCOperand &MO = MI.getOperand(OpIdx);
701 assert(MO.isImm() &&
703 unsigned ShiftVal = AArch64_AM::getShiftValue(MO.getImm());