Lines Matching refs:instr
191 Instr* instr = reinterpret_cast<Instr*>(instructions); in PatchCode() local
193 *(pc + i) = *(instr + i); in PatchCode()
363 Register Assembler::GetRtReg(Instr instr) { in GetRtReg() argument
365 rt.code_ = (instr & kRtFieldMask) >> kRtShift; in GetRtReg()
370 Register Assembler::GetRsReg(Instr instr) { in GetRsReg() argument
372 rs.code_ = (instr & kRsFieldMask) >> kRsShift; in GetRsReg()
377 Register Assembler::GetRdReg(Instr instr) { in GetRdReg() argument
379 rd.code_ = (instr & kRdFieldMask) >> kRdShift; in GetRdReg()
384 uint32_t Assembler::GetRt(Instr instr) { in GetRt() argument
385 return (instr & kRtFieldMask) >> kRtShift; in GetRt()
389 uint32_t Assembler::GetRtField(Instr instr) { in GetRtField() argument
390 return instr & kRtFieldMask; in GetRtField()
394 uint32_t Assembler::GetRs(Instr instr) { in GetRs() argument
395 return (instr & kRsFieldMask) >> kRsShift; in GetRs()
399 uint32_t Assembler::GetRsField(Instr instr) { in GetRsField() argument
400 return instr & kRsFieldMask; in GetRsField()
404 uint32_t Assembler::GetRd(Instr instr) { in GetRd() argument
405 return (instr & kRdFieldMask) >> kRdShift; in GetRd()
409 uint32_t Assembler::GetRdField(Instr instr) { in GetRdField() argument
410 return instr & kRdFieldMask; in GetRdField()
414 uint32_t Assembler::GetSa(Instr instr) { in GetSa() argument
415 return (instr & kSaFieldMask) >> kSaShift; in GetSa()
419 uint32_t Assembler::GetSaField(Instr instr) { in GetSaField() argument
420 return instr & kSaFieldMask; in GetSaField()
424 uint32_t Assembler::GetOpcodeField(Instr instr) { in GetOpcodeField() argument
425 return instr & kOpcodeMask; in GetOpcodeField()
429 uint32_t Assembler::GetFunction(Instr instr) { in GetFunction() argument
430 return (instr & kFunctionFieldMask) >> kFunctionShift; in GetFunction()
434 uint32_t Assembler::GetFunctionField(Instr instr) { in GetFunctionField() argument
435 return instr & kFunctionFieldMask; in GetFunctionField()
439 uint32_t Assembler::GetImmediate16(Instr instr) { in GetImmediate16() argument
440 return instr & kImm16Mask; in GetImmediate16()
444 uint32_t Assembler::GetLabelConst(Instr instr) { in GetLabelConst() argument
445 return instr & ~kImm16Mask; in GetLabelConst()
449 bool Assembler::IsPop(Instr instr) { in IsPop() argument
450 return (instr & ~kRtMask) == kPopRegPattern; in IsPop()
454 bool Assembler::IsPush(Instr instr) { in IsPush() argument
455 return (instr & ~kRtMask) == kPushRegPattern; in IsPush()
459 bool Assembler::IsSwRegFpOffset(Instr instr) { in IsSwRegFpOffset() argument
460 return ((instr & kLwSwInstrTypeMask) == kSwRegFpOffsetPattern); in IsSwRegFpOffset()
464 bool Assembler::IsLwRegFpOffset(Instr instr) { in IsLwRegFpOffset() argument
465 return ((instr & kLwSwInstrTypeMask) == kLwRegFpOffsetPattern); in IsLwRegFpOffset()
469 bool Assembler::IsSwRegFpNegOffset(Instr instr) { in IsSwRegFpNegOffset() argument
470 return ((instr & (kLwSwInstrTypeMask | kNegOffset)) == in IsSwRegFpNegOffset()
475 bool Assembler::IsLwRegFpNegOffset(Instr instr) { in IsLwRegFpNegOffset() argument
476 return ((instr & (kLwSwInstrTypeMask | kNegOffset)) == in IsLwRegFpNegOffset()
501 bool Assembler::IsBranch(Instr instr) { in IsBranch() argument
502 uint32_t opcode = GetOpcodeField(instr); in IsBranch()
503 uint32_t rt_field = GetRtField(instr); in IsBranch()
504 uint32_t rs_field = GetRsField(instr); in IsBranch()
505 uint32_t label_constant = GetLabelConst(instr); in IsBranch()
522 bool Assembler::IsBeq(Instr instr) { in IsBeq() argument
523 return GetOpcodeField(instr) == BEQ; in IsBeq()
527 bool Assembler::IsBne(Instr instr) { in IsBne() argument
528 return GetOpcodeField(instr) == BNE; in IsBne()
532 bool Assembler::IsJump(Instr instr) { in IsJump() argument
533 uint32_t opcode = GetOpcodeField(instr); in IsJump()
534 uint32_t rt_field = GetRtField(instr); in IsJump()
535 uint32_t rd_field = GetRdField(instr); in IsJump()
536 uint32_t function_field = GetFunctionField(instr); in IsJump()
544 bool Assembler::IsJ(Instr instr) { in IsJ() argument
545 uint32_t opcode = GetOpcodeField(instr); in IsJ()
551 bool Assembler::IsJal(Instr instr) { in IsJal() argument
552 return GetOpcodeField(instr) == JAL; in IsJal()
555 bool Assembler::IsJr(Instr instr) { in IsJr() argument
556 return GetOpcodeField(instr) == SPECIAL && GetFunctionField(instr) == JR; in IsJr()
559 bool Assembler::IsJalr(Instr instr) { in IsJalr() argument
560 return GetOpcodeField(instr) == SPECIAL && GetFunctionField(instr) == JALR; in IsJalr()
564 bool Assembler::IsLui(Instr instr) { in IsLui() argument
565 uint32_t opcode = GetOpcodeField(instr); in IsLui()
571 bool Assembler::IsOri(Instr instr) { in IsOri() argument
572 uint32_t opcode = GetOpcodeField(instr); in IsOri()
578 bool Assembler::IsNop(Instr instr, unsigned int type) { in IsNop() argument
581 uint32_t opcode = GetOpcodeField(instr); in IsNop()
582 uint32_t rt = GetRt(instr); in IsNop()
583 uint32_t rs = GetRs(instr); in IsNop()
584 uint32_t sa = GetSa(instr); in IsNop()
599 int32_t Assembler::GetBranchOffset(Instr instr) { in GetBranchOffset() argument
600 ASSERT(IsBranch(instr)); in GetBranchOffset()
601 return ((int16_t)(instr & kImm16Mask)) << 2; in GetBranchOffset()
605 bool Assembler::IsLw(Instr instr) { in IsLw() argument
606 return ((instr & kOpcodeMask) == LW); in IsLw()
610 int16_t Assembler::GetLwOffset(Instr instr) { in GetLwOffset() argument
611 ASSERT(IsLw(instr)); in GetLwOffset()
612 return ((instr & kImm16Mask)); in GetLwOffset()
616 Instr Assembler::SetLwOffset(Instr instr, int16_t offset) { in SetLwOffset() argument
617 ASSERT(IsLw(instr)); in SetLwOffset()
620 Instr temp_instr = LW | (instr & kRsFieldMask) | (instr & kRtFieldMask) in SetLwOffset()
627 bool Assembler::IsSw(Instr instr) { in IsSw() argument
628 return ((instr & kOpcodeMask) == SW); in IsSw()
632 Instr Assembler::SetSwOffset(Instr instr, int16_t offset) { in SetSwOffset() argument
633 ASSERT(IsSw(instr)); in SetSwOffset()
634 return ((instr & ~kImm16Mask) | (offset & kImm16Mask)); in SetSwOffset()
638 bool Assembler::IsAddImmediate(Instr instr) { in IsAddImmediate() argument
639 return ((instr & kOpcodeMask) == ADDIU); in IsAddImmediate()
643 Instr Assembler::SetAddImmediateOffset(Instr instr, int16_t offset) { in SetAddImmediateOffset() argument
644 ASSERT(IsAddImmediate(instr)); in SetAddImmediateOffset()
645 return ((instr & ~kImm16Mask) | (offset & kImm16Mask)); in SetAddImmediateOffset()
649 bool Assembler::IsAndImmediate(Instr instr) { in IsAndImmediate() argument
650 return GetOpcodeField(instr) == ANDI; in IsAndImmediate()
655 Instr instr = instr_at(pos); in target_at() local
656 if ((instr & ~kImm16Mask) == 0) { in target_at()
658 if (instr == 0) { in target_at()
661 int32_t imm18 =((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14; in target_at()
666 ASSERT(IsBranch(instr) || IsJ(instr) || IsLui(instr)); in target_at()
669 if (IsBranch(instr)) { in target_at()
670 int32_t imm18 = ((instr & static_cast<int32_t>(kImm16Mask)) << 16) >> 14; in target_at()
678 } else if (IsLui(instr)) { in target_at()
695 int32_t imm28 = (instr & static_cast<int32_t>(kImm26Mask)) << 2; in target_at()
711 Instr instr = instr_at(pos); in target_at_put() local
712 if ((instr & ~kImm16Mask) == 0) { in target_at_put()
720 ASSERT(IsBranch(instr) || IsJ(instr) || IsLui(instr)); in target_at_put()
721 if (IsBranch(instr)) { in target_at_put()
725 instr &= ~kImm16Mask; in target_at_put()
729 instr_at_put(pos, instr | (imm16 & kImm16Mask)); in target_at_put()
730 } else if (IsLui(instr)) { in target_at_put()
749 instr &= ~kImm26Mask; in target_at_put()
753 instr_at_put(pos, instr | (imm26 & kImm26Mask)); in target_at_put()
768 Instr instr = instr_at(l.pos()); in print() local
769 if ((instr & ~kImm16Mask) == 0) { in print()
772 PrintF("%d\n", instr); in print()
794 Instr instr = instr_at(fixup_pos); in bind_to() local
795 if (IsBranch(instr)) { in bind_to()
808 ASSERT(IsJ(instr) || IsLui(instr)); in bind_to()
860 Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift) in GenInstrRegister() local
862 emit(instr); in GenInstrRegister()
873 Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift) in GenInstrRegister() local
875 emit(instr); in GenInstrRegister()
887 Instr instr = opcode | fmt | (ft.code() << kFtShift) | (fs.code() << kFsShift) in GenInstrRegister() local
889 emit(instr); in GenInstrRegister()
901 Instr instr = opcode | fmt | (rt.code() << kRtShift) in GenInstrRegister() local
903 emit(instr); in GenInstrRegister()
914 Instr instr = in GenInstrRegister() local
916 emit(instr); in GenInstrRegister()
927 Instr instr = opcode | (rs.code() << kRsShift) | (rt.code() << kRtShift) in GenInstrImmediate() local
929 emit(instr); in GenInstrImmediate()
938 Instr instr = opcode | (rs.code() << kRsShift) | SF | (j & kImm16Mask); in GenInstrImmediate() local
939 emit(instr); in GenInstrImmediate()
949 Instr instr = opcode | (rs.code() << kRsShift) | (ft.code() << kFtShift) in GenInstrImmediate() local
951 emit(instr); in GenInstrImmediate()
959 Instr instr = opcode | address; in GenInstrJump() local
960 emit(instr); in GenInstrJump()
1322 Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift) in rotr() local
1324 emit(instr); in rotr()
1332 Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift) in rotrv() local
1334 emit(instr); in rotrv()
1491 Instr instr = SPECIAL | TGE | rs.code() << kRsShift in tge() local
1493 emit(instr); in tge()
1499 Instr instr = SPECIAL | TGEU | rs.code() << kRsShift in tgeu() local
1501 emit(instr); in tgeu()
1507 Instr instr = in tlt() local
1509 emit(instr); in tlt()
1515 Instr instr = in tltu() local
1518 emit(instr); in tltu()
1524 Instr instr = in teq() local
1526 emit(instr); in teq()
1532 Instr instr = in tne() local
1534 emit(instr); in tne()
1865 Instr instr = COP1 | fmt | ft.code() << 16 | fs.code() << kFsShift in c() local
1867 emit(instr); in c()
1884 Instr instr = COP1 | BC1 | cc << 18 | 0 << 16 | (offset & kImm16Mask); in bc1f() local
1885 emit(instr); in bc1f()
1892 Instr instr = COP1 | BC1 | cc << 18 | 1 << 16 | (offset & kImm16Mask); in bc1t() local
1893 emit(instr); in bc1t()
1921 Instr instr = instr_at(pc); in RelocateInternalReference() local
1922 ASSERT(IsJ(instr) || IsLui(instr)); in RelocateInternalReference()
1923 if (IsLui(instr)) { in RelocateInternalReference()
1944 uint32_t imm28 = (instr & static_cast<int32_t>(kImm26Mask)) << 2; in RelocateInternalReference()
1952 instr &= ~kImm26Mask; in RelocateInternalReference()
1956 instr_at_put(pc, instr | (imm26 & kImm26Mask)); in RelocateInternalReference()