Lines Matching refs:instr
78 void Stop(Instruction* instr);
86 static const Instr kBreakpointInstr = SPECIAL | BREAK | 0xfffff << 6;
87 static const Instr kNopInstr = 0x0;
125 void MipsDebugger::Stop(Instruction* instr) {
127 uint32_t code = instr->Bits(25, 6);
130 reinterpret_cast<char**>(sim_->get_pc() + Instr::kInstrSize);
145 instr->SetInstructionBits(kNopInstr);
146 reinterpret_cast<Instr*>(msg_address)->SetInstructionBits(kNopInstr);
159 void MipsDebugger::Stop(Instruction* instr) {
161 uint32_t code = instr->Bits(25, 6);
405 Instruction* instr = reinterpret_cast<Instruction*>(sim_->get_pc());
406 if (!(instr->IsTrap()) ||
407 instr->InstructionBits() == rtCallRedirInstr) {
854 Instruction* instr) {
855 intptr_t address = reinterpret_cast<intptr_t>(instr);
865 CHECK(memcmp(reinterpret_cast<void*>(instr),
1226 int Simulator::ReadW(int32_t addr, Instruction* instr) {
1230 addr, reinterpret_cast<intptr_t>(instr));
1240 reinterpret_cast<intptr_t>(instr));
1247 void Simulator::WriteW(int32_t addr, int value, Instruction* instr) {
1251 addr, reinterpret_cast<intptr_t>(instr));
1262 reinterpret_cast<intptr_t>(instr));
1268 double Simulator::ReadD(int32_t addr, Instruction* instr) {
1275 reinterpret_cast<intptr_t>(instr));
1281 void Simulator::WriteD(int32_t addr, double value, Instruction* instr) {
1289 reinterpret_cast<intptr_t>(instr));
1294 uint16_t Simulator::ReadHU(int32_t addr, Instruction* instr) {
1301 reinterpret_cast<intptr_t>(instr));
1307 int16_t Simulator::ReadH(int32_t addr, Instruction* instr) {
1314 reinterpret_cast<intptr_t>(instr));
1320 void Simulator::WriteH(int32_t addr, uint16_t value, Instruction* instr) {
1328 reinterpret_cast<intptr_t>(instr));
1333 void Simulator::WriteH(int32_t addr, int16_t value, Instruction* instr) {
1341 reinterpret_cast<intptr_t>(instr));
1379 void Simulator::Format(Instruction* instr, const char* format) {
1381 reinterpret_cast<intptr_t>(instr), format);
1413 void Simulator::SoftwareInterrupt(Instruction* instr) {
1417 int32_t func = instr->FunctionFieldRaw();
1418 uint32_t code = (func == BREAK) ? instr->Bits(25, 6) : -1;
1421 if (instr->InstructionBits() == rtCallRedirInstr) {
1422 Redirection* redirection = Redirection::FromSwiInstruction(instr);
1566 HandleStop(code, instr);
1585 PrintF("\n---- break %d marker: %3d (instr count: %8d) ----------"
1592 void Simulator::HandleStop(uint32_t code, Instruction* instr) {
1597 dbg.Stop(instr);
1604 bool Simulator::IsStopInstruction(Instruction* instr) {
1605 int32_t func = instr->FunctionFieldRaw();
1606 uint32_t code = static_cast<uint32_t>(instr->Bits(25, 6));
1680 void Simulator::ConfigureTypeRegister(Instruction* instr,
1691 const Opcode op = instr->OpcodeFieldRaw();
1692 const int32_t rs_reg = instr->RsValue();
1695 const int32_t rt_reg = instr->RtValue();
1698 const int32_t rd_reg = instr->RdValue();
1699 const uint32_t sa = instr->SaValue();
1701 const int32_t fs_reg = instr->FsValue();
1707 switch (instr->RsFieldRaw()) {
1739 switch (instr->FunctionFieldRaw()) {
1742 next_pc = get_register(instr->RsValue());
1873 switch (instr->FunctionFieldRaw()) {
1885 switch (instr->FunctionFieldRaw()) {
1916 void Simulator::DecodeTypeRegister(Instruction* instr) {
1918 const Opcode op = instr->OpcodeFieldRaw();
1919 const int32_t rs_reg = instr->RsValue();
1922 const int32_t rt_reg = instr->RtValue();
1925 const int32_t rd_reg = instr->RdValue();
1927 const int32_t fs_reg = instr->FsValue();
1928 const int32_t ft_reg = instr->FtValue();
1929 const int32_t fd_reg = instr->FdValue();
1948 ConfigureTypeRegister(instr,
1961 switch (instr->RsFieldRaw()) {
1986 instr->FunctionFieldRaw()) {
2014 cc = instr->FCccValue();
2016 switch (instr->FunctionFieldRaw()) {
2148 switch (instr->FunctionFieldRaw()) {
2162 switch (instr->FunctionFieldRaw()) {
2184 switch (instr->FunctionFieldRaw()) {
2235 SoftwareInterrupt(instr);
2243 uint32_t cc = instr->FBccValue();
2245 if (instr->Bit(16)) { // Read Tf bit.
2260 switch (instr->FunctionFieldRaw()) {
2272 switch (instr->FunctionFieldRaw()) {
2274 // Ins instr leaves result in Rt, rather than Rd.
2278 // Ext instr leaves result in Rt, rather than Rd.
2295 void Simulator::DecodeTypeImmediate(Instruction* instr) {
2297 Opcode op = instr->OpcodeFieldRaw();
2298 int32_t rs = get_register(instr->RsValue());
2300 int32_t rt_reg = instr->RtValue(); // Destination register.
2302 int16_t imm16 = instr->Imm16Value();
2304 int32_t ft_reg = instr->FtValue(); // Destination register.
2335 switch (instr->RsFieldRaw()) {
2337 cc = instr->FBccValue();
2340 do_branch = (instr->FBtrueValue()) ? cc_value : !cc_value;
2355 switch (instr->RtFieldRaw()) {
2371 switch (instr->RtFieldRaw()) {
2381 if (instr->IsLinkingInstruction()) {
2446 alu_out = ReadH(addr, instr);
2454 alu_out = ReadW(addr, instr);
2461 alu_out = ReadW(addr, instr);
2469 alu_out = ReadHU(addr, instr);
2477 alu_out = ReadW(addr, instr);
2493 mem_value = ReadW(addr, instr) & mask;
2504 mem_value = ReadW(addr, instr);
2510 alu_out = ReadW(addr, instr);
2514 fp_out = ReadD(addr, instr);
2539 if (instr->IsLinkingInstruction()) {
2571 WriteH(addr, static_cast<uint16_t>(rt), instr);
2574 WriteW(addr, mem_value, instr);
2577 WriteW(addr, rt, instr);
2580 WriteW(addr, mem_value, instr);
2590 WriteW(addr, get_fpu_register(ft_reg), instr);
2594 WriteD(addr, get_fpu_register_double(ft_reg), instr);
2618 void Simulator::DecodeTypeJump(Instruction* instr) {
2624 int32_t next_pc = pc_high_bits | (instr->Imm26Value() << 2);
2635 if (instr->IsLinkingInstruction()) {
2644 void Simulator::InstructionDecode(Instruction* instr) {
2646 CheckICache(isolate_->simulator_i_cache(), instr);
2654 dasm.InstructionDecode(buffer, reinterpret_cast<byte*>(instr));
2655 PrintF(" 0x%08x %s\n", reinterpret_cast<intptr_t>(instr),
2659 switch (instr->InstructionType()) {
2661 DecodeTypeRegister(instr);
2664 DecodeTypeImmediate(instr);
2667 DecodeTypeJump(instr);
2673 set_register(pc, reinterpret_cast<int32_t>(instr) +
2688 Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
2690 InstructionDecode(instr);
2697 Instruction* instr = reinterpret_cast<Instruction*>(program_counter);
2703 InstructionDecode(instr);