Lines Matching refs:lir

592 void MipsMir2Lir::ConvertShortToLongBranch(LIR* lir) {  in ConvertShortToLongBranch()  argument
595 int opcode = lir->opcode; in ConvertShortToLongBranch()
596 int dalvik_offset = lir->dalvik_offset; in ConvertShortToLongBranch()
619 LIR* hop_branch = RawLIR(dalvik_offset, opcode, lir->operands[0], in ConvertShortToLongBranch()
620 lir->operands[1], 0, 0, 0, hop_target); in ConvertShortToLongBranch()
621 InsertLIRBefore(lir, hop_branch); in ConvertShortToLongBranch()
624 InsertLIRBefore(lir, curr_pc); in ConvertShortToLongBranch()
627 lir->target); in ConvertShortToLongBranch()
628 InsertLIRBefore(lir, delta_hi); in ConvertShortToLongBranch()
629 InsertLIRBefore(lir, anchor); in ConvertShortToLongBranch()
631 lir->target); in ConvertShortToLongBranch()
632 InsertLIRBefore(lir, delta_lo); in ConvertShortToLongBranch()
634 InsertLIRBefore(lir, addu); in ConvertShortToLongBranch()
636 InsertLIRBefore(lir, jalr); in ConvertShortToLongBranch()
638 InsertLIRBefore(lir, hop_target); in ConvertShortToLongBranch()
640 NopLIR(lir); in ConvertShortToLongBranch()
650 LIR *lir; in AssembleInstructions() local
653 for (lir = first_lir_insn_; lir != nullptr; lir = NEXT_LIR(lir)) { in AssembleInstructions()
654 if (lir->opcode < 0) { in AssembleInstructions()
658 if (lir->flags.is_nop) { in AssembleInstructions()
662 if (lir->flags.fixup != kFixupNone) { in AssembleInstructions()
663 if (lir->opcode == kMipsDelta) { in AssembleInstructions()
674 int offset1 = UnwrapPointer<LIR>(lir->operands[2])->offset; in AssembleInstructions()
675 const EmbeddedData* tab_rec = UnwrapPointer<EmbeddedData>(lir->operands[3]); in AssembleInstructions()
676 int offset2 = tab_rec ? tab_rec->offset : lir->target->offset; in AssembleInstructions()
680 lir->operands[1] = delta; in AssembleInstructions()
682 LIR *new_addiu = RawLIR(lir->dalvik_offset, kMips64Daddiu, lir->operands[0], rRAd, in AssembleInstructions()
684 InsertLIRBefore(lir, new_addiu); in AssembleInstructions()
685 NopLIR(lir); in AssembleInstructions()
690 LIR *new_delta_hi = RawLIR(lir->dalvik_offset, kMipsDeltaHi, lir->operands[0], 0, in AssembleInstructions()
691 lir->operands[2], lir->operands[3], 0, lir->target); in AssembleInstructions()
692 InsertLIRBefore(lir, new_delta_hi); in AssembleInstructions()
693 LIR *new_delta_lo = RawLIR(lir->dalvik_offset, kMipsDeltaLo, lir->operands[0], 0, in AssembleInstructions()
694 lir->operands[2], lir->operands[3], 0, lir->target); in AssembleInstructions()
695 InsertLIRBefore(lir, new_delta_lo); in AssembleInstructions()
698 new_addu = RawLIR(lir->dalvik_offset, kMips64Daddu, lir->operands[0], lir->operands[0], in AssembleInstructions()
701 new_addu = RawLIR(lir->dalvik_offset, kMipsAddu, lir->operands[0], lir->operands[0], in AssembleInstructions()
704 InsertLIRBefore(lir, new_addu); in AssembleInstructions()
705 NopLIR(lir); in AssembleInstructions()
708 } else if (lir->opcode == kMipsDeltaLo) { in AssembleInstructions()
709 int offset1 = UnwrapPointer<LIR>(lir->operands[2])->offset; in AssembleInstructions()
710 const EmbeddedData* tab_rec = UnwrapPointer<EmbeddedData>(lir->operands[3]); in AssembleInstructions()
711 int offset2 = tab_rec ? tab_rec->offset : lir->target->offset; in AssembleInstructions()
713 lir->operands[1] = delta & 0xffff; in AssembleInstructions()
714 } else if (lir->opcode == kMipsDeltaHi) { in AssembleInstructions()
715 int offset1 = UnwrapPointer<LIR>(lir->operands[2])->offset; in AssembleInstructions()
716 const EmbeddedData* tab_rec = UnwrapPointer<EmbeddedData>(lir->operands[3]); in AssembleInstructions()
717 int offset2 = tab_rec ? tab_rec->offset : lir->target->offset; in AssembleInstructions()
719 lir->operands[1] = (delta >> 16) & 0xffff; in AssembleInstructions()
720 } else if (lir->opcode == kMipsB || lir->opcode == kMipsBal) { in AssembleInstructions()
721 LIR *target_lir = lir->target; in AssembleInstructions()
722 CodeOffset pc = lir->offset + 4; in AssembleInstructions()
730 ConvertShortToLongBranch(lir); in AssembleInstructions()
732 lir->operands[0] = delta >> 2; in AssembleInstructions()
734 } else if (lir->opcode >= kMipsBeqz && lir->opcode <= kMipsBnez) { in AssembleInstructions()
735 LIR *target_lir = lir->target; in AssembleInstructions()
736 CodeOffset pc = lir->offset + 4; in AssembleInstructions()
744 ConvertShortToLongBranch(lir); in AssembleInstructions()
746 lir->operands[1] = delta >> 2; in AssembleInstructions()
748 } else if (lir->opcode == kMipsBeq || lir->opcode == kMipsBne) { in AssembleInstructions()
749 LIR *target_lir = lir->target; in AssembleInstructions()
750 CodeOffset pc = lir->offset + 4; in AssembleInstructions()
758 ConvertShortToLongBranch(lir); in AssembleInstructions()
760 lir->operands[2] = delta >> 2; in AssembleInstructions()
762 } else if (lir->opcode == kMipsJal) { in AssembleInstructions()
763 CodeOffset cur_pc = (start_addr + lir->offset + 4) & ~3; in AssembleInstructions()
764 CodeOffset target = lir->operands[0]; in AssembleInstructions()
770 lir->operands[0] = target >> 2; in AssembleInstructions()
771 } else if (lir->opcode == kMipsLahi) { /* ld address hi (via lui) */ in AssembleInstructions()
772 LIR *target_lir = lir->target; in AssembleInstructions()
774 lir->operands[1] = target >> 16; in AssembleInstructions()
775 } else if (lir->opcode == kMipsLalo) { /* ld address lo (via ori) */ in AssembleInstructions()
776 LIR *target_lir = lir->target; in AssembleInstructions()
778 lir->operands[2] = lir->operands[2] + target; in AssembleInstructions()
790 DCHECK(!IsPseudoLirOp(lir->opcode)); in AssembleInstructions()
791 const MipsEncodingMap *encoder = &EncodingMap[lir->opcode]; in AssembleInstructions()
797 operand = lir->operands[i]; in AssembleInstructions()
843 DCHECK(!IsPseudoLirOp(lir->opcode)); in AssembleInstructions()
855 size_t MipsMir2Lir::GetInsnSize(LIR* lir) { in GetInsnSize() argument
856 DCHECK(!IsPseudoLirOp(lir->opcode)); in GetInsnSize()
857 return EncodingMap[lir->opcode].size; in GetInsnSize()
863 LIR* lir; in AssignInsnOffsets() local
866 for (lir = first_lir_insn_; lir != nullptr; lir = NEXT_LIR(lir)) { in AssignInsnOffsets()
867 lir->offset = offset; in AssignInsnOffsets()
868 if (LIKELY(lir->opcode >= 0)) { in AssignInsnOffsets()
869 if (!lir->flags.is_nop) { in AssignInsnOffsets()
870 offset += lir->flags.size; in AssignInsnOffsets()
872 } else if (UNLIKELY(lir->opcode == kPseudoPseudoAlign4)) { in AssignInsnOffsets()
875 lir->operands[0] = 1; in AssignInsnOffsets()
877 lir->operands[0] = 0; in AssignInsnOffsets()