Lines Matching refs:Op
568 auto Op = make_unique<LanaiOperand>(TOKEN);
569 Op->Tok.Data = Str.data();
570 Op->Tok.Length = Str.size();
571 Op->StartLoc = Start;
572 Op->EndLoc = Start;
573 return Op;
578 auto Op = make_unique<LanaiOperand>(REGISTER);
579 Op->Reg.RegNum = RegNum;
580 Op->StartLoc = Start;
581 Op->EndLoc = End;
582 return Op;
587 auto Op = make_unique<LanaiOperand>(IMMEDIATE);
588 Op->Imm.Value = Value;
589 Op->StartLoc = Start;
590 Op->EndLoc = End;
591 return Op;
595 MorphToMemImm(std::unique_ptr<LanaiOperand> Op) {
596 const MCExpr *Imm = Op->getImm();
597 Op->Kind = MEMORY_IMM;
598 Op->Mem.BaseReg = 0;
599 Op->Mem.AluOp = LPAC::ADD;
600 Op->Mem.OffsetReg = 0;
601 Op->Mem.Offset = Imm;
602 return Op;
606 MorphToMemRegReg(unsigned BaseReg, std::unique_ptr<LanaiOperand> Op,
608 unsigned OffsetReg = Op->getReg();
609 Op->Kind = MEMORY_REG_REG;
610 Op->Mem.BaseReg = BaseReg;
611 Op->Mem.AluOp = AluOp;
612 Op->Mem.OffsetReg = OffsetReg;
613 Op->Mem.Offset = nullptr;
614 return Op;
618 MorphToMemRegImm(unsigned BaseReg, std::unique_ptr<LanaiOperand> Op,
620 const MCExpr *Imm = Op->getImm();
621 Op->Kind = MEMORY_REG_IMM;
622 Op->Mem.BaseReg = BaseReg;
623 Op->Mem.AluOp = AluOp;
624 Op->Mem.OffsetReg = 0;
625 Op->Mem.Offset = Imm;
626 return Op;
691 std::unique_ptr<LanaiOperand> Op = parseRegister();
692 if (Op != 0)
693 RegNum = Op->getReg();
694 return (Op == 0);
819 bool shouldBeSls(const LanaiOperand &Op) {
822 if (const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Op.getImm())) {
828 if (const LanaiMCExpr *SymbolRefExpr = dyn_cast<LanaiMCExpr>(Op.getImm()))
833 if (const MCBinaryExpr *BinaryExpr = dyn_cast<MCBinaryExpr>(Op.getImm())) {
867 std::unique_ptr<LanaiOperand> Op = parseRegister();
868 if (!Op)
869 Op = parseImmediate();
873 if (!Op)
879 Operands.push_back(std::move(Op));
885 if (Op)
886 Offset.swap(Op);
891 Op = parseRegister();
892 if (!Op) {
894 if ((Op = parseImmediate()) && Lexer.is(AsmToken::RBrac)) {
899 if (shouldBeSls(*Op)) {
900 Operands.push_back(LanaiOperand::MorphToMemImm(std::move(Op)));
902 if (!Op->isLoImm16Signed()) {
909 Lanai::R0, std::move(Op), LPAC::ADD));
919 BaseReg = Op->getReg();
954 // First form has addition as operator. Add pre- or post-op indicator as
991 std::unique_ptr<LanaiOperand> Op = parseRegister();
994 if (!Op)
995 Op = parseImmediate();
998 if (!Op) {
1005 Operands->push_back(std::move(Op));
1115 static bool IsRegister(const MCParsedAsmOperand &op) {
1116 return static_cast<const LanaiOperand &>(op).isReg();