Lines Matching refs:instr

37   void Stop(Instruction* instr);
82 void ArmDebugger::Stop(Instruction* instr) { in Stop() argument
84 uint32_t code = instr->SvcValue() & kStopCodeMask; in Stop()
102 instr->SetInstructionBits(kNopInstr); in Stop()
114 void ArmDebugger::Stop(Instruction* instr) { in Stop() argument
116 uint32_t code = instr->SvcValue() & kStopCodeMask; in Stop()
686 Instruction* instr) { in CheckICache() argument
687 intptr_t address = reinterpret_cast<intptr_t>(instr); in CheckICache()
698 memcmp(reinterpret_cast<void*>(instr), in CheckICache()
1101 int Simulator::ReadW(int32_t addr, Instruction* instr) { in ReadW() argument
1108 reinterpret_cast<intptr_t>(instr)); in ReadW()
1115 void Simulator::WriteW(int32_t addr, int value, Instruction* instr) { in WriteW() argument
1122 reinterpret_cast<intptr_t>(instr)); in WriteW()
1128 uint16_t Simulator::ReadHU(int32_t addr, Instruction* instr) { in ReadHU() argument
1136 reinterpret_cast<intptr_t>(instr)); in ReadHU()
1143 int16_t Simulator::ReadH(int32_t addr, Instruction* instr) { in ReadH() argument
1155 void Simulator::WriteH(int32_t addr, uint16_t value, Instruction* instr) { in WriteH() argument
1163 reinterpret_cast<intptr_t>(instr)); in WriteH()
1169 void Simulator::WriteH(int32_t addr, int16_t value, Instruction* instr) { in WriteH() argument
1176 reinterpret_cast<intptr_t>(instr)); in WriteH()
1245 void Simulator::Format(Instruction* instr, const char* format) { in Format() argument
1247 reinterpret_cast<intptr_t>(instr), format); in Format()
1254 bool Simulator::ConditionallyExecute(Instruction* instr) { in ConditionallyExecute() argument
1255 switch (instr->ConditionField()) { in ConditionallyExecute()
1400 int32_t Simulator::GetShiftRm(Instruction* instr, bool* carry_out) { in GetShiftRm() argument
1401 ShiftOp shift = instr->ShiftField(); in GetShiftRm()
1402 int shift_amount = instr->ShiftAmountValue(); in GetShiftRm()
1403 int32_t result = get_register(instr->RmValue()); in GetShiftRm()
1404 if (instr->Bit(4) == 0) { in GetShiftRm()
1474 int rs = instr->RsValue(); in GetShiftRm()
1558 int32_t Simulator::GetImm(Instruction* instr, bool* carry_out) { in GetImm() argument
1559 int rotate = instr->RotateValue() * 2; in GetImm()
1560 int immed8 = instr->Immed8Value(); in GetImm()
1579 int32_t Simulator::ProcessPU(Instruction* instr, in ProcessPU() argument
1584 int rn = instr->RnValue(); in ProcessPU()
1586 switch (instr->PUField()) { in ProcessPU()
1619 void Simulator::HandleRList(Instruction* instr, bool load) { in HandleRList() argument
1620 int rlist = instr->RlistValue(); in HandleRList()
1626 ProcessPU(instr, num_regs, kPointerSize, &start_address, &end_address); in HandleRList()
1645 if (instr->HasW()) { in HandleRList()
1646 set_register(instr->RnValue(), rn_val); in HandleRList()
1652 void Simulator::HandleVList(Instruction* instr) { in HandleVList() argument
1654 (instr->SzValue() == 0) ? kSinglePrecision : kDoublePrecision; in HandleVList()
1657 bool load = (instr->VLValue() == 0x1); in HandleVList()
1661 vd = instr->VFPDRegValue(precision); in HandleVList()
1663 num_regs = instr->Immed8Value(); in HandleVList()
1665 num_regs = instr->Immed8Value() / 2; in HandleVList()
1671 ProcessPU(instr, num_regs, operand_size, &start_address, &end_address); in HandleVList()
1678 reg, ReadW(reinterpret_cast<int32_t>(address), instr)); in HandleVList()
1681 get_sinteger_from_s_register(reg), instr); in HandleVList()
1687 ReadW(reinterpret_cast<int32_t>(address), instr), in HandleVList()
1688 ReadW(reinterpret_cast<int32_t>(address + 1), instr) in HandleVList()
1694 WriteW(reinterpret_cast<int32_t>(address), data[0], instr); in HandleVList()
1695 WriteW(reinterpret_cast<int32_t>(address + 1), data[1], instr); in HandleVList()
1701 if (instr->HasW()) { in HandleVList()
1702 set_register(instr->RnValue(), rn_val); in HandleVList()
1738 void Simulator::SoftwareInterrupt(Instruction* instr) { in SoftwareInterrupt() argument
1739 int svc = instr->SvcValue(); in SoftwareInterrupt()
1747 Redirection* redirection = Redirection::FromSwiInstruction(instr); in SoftwareInterrupt()
1954 dbg.Stop(instr); in SoftwareInterrupt()
1991 bool Simulator::isStopInstruction(Instruction* instr) { in isStopInstruction() argument
1992 return (instr->Bits(27, 24) == 0xF) && (instr->SvcValue() >= kStopCode); in isStopInstruction()
2066 void Simulator::DecodeType01(Instruction* instr) { in DecodeType01() argument
2067 int type = instr->TypeValue(); in DecodeType01()
2068 if ((type == 0) && instr->IsSpecialType0()) { in DecodeType01()
2070 if (instr->Bits(7, 4) == 9) { in DecodeType01()
2071 if (instr->Bit(24) == 0) { in DecodeType01()
2074 int rn = instr->RnValue(); in DecodeType01()
2075 int rm = instr->RmValue(); in DecodeType01()
2076 int rs = instr->RsValue(); in DecodeType01()
2079 if (instr->Bit(23) == 0) { in DecodeType01()
2080 if (instr->Bit(21) == 0) { in DecodeType01()
2088 if (instr->HasS()) { in DecodeType01()
2092 int rd = instr->RdValue(); in DecodeType01()
2094 if (instr->Bit(22) == 0) { in DecodeType01()
2122 int rd_lo = instr->RdValue(); in DecodeType01()
2125 if (instr->Bit(22) == 1) { in DecodeType01()
2141 if (instr->HasS()) { in DecodeType01()
2150 int rd = instr->RdValue(); in DecodeType01()
2151 int rn = instr->RnValue(); in DecodeType01()
2154 if (instr->Bit(22) == 0) { in DecodeType01()
2155 int rm = instr->RmValue(); in DecodeType01()
2157 switch (instr->PUField()) { in DecodeType01()
2160 DCHECK(!instr->HasW()); in DecodeType01()
2168 DCHECK(!instr->HasW()); in DecodeType01()
2178 if (instr->HasW()) { in DecodeType01()
2187 if (instr->HasW()) { in DecodeType01()
2199 int32_t imm_val = (instr->ImmedHValue() << 4) | instr->ImmedLValue(); in DecodeType01()
2200 switch (instr->PUField()) { in DecodeType01()
2203 DCHECK(!instr->HasW()); in DecodeType01()
2211 DCHECK(!instr->HasW()); in DecodeType01()
2221 if (instr->HasW()) { in DecodeType01()
2230 if (instr->HasW()) { in DecodeType01()
2242 if (((instr->Bits(7, 4) & 0xd) == 0xd) && (instr->Bit(20) == 0)) { in DecodeType01()
2244 if (instr->HasH()) { in DecodeType01()
2254 } else if (instr->HasH()) { in DecodeType01()
2255 if (instr->HasSign()) { in DecodeType01()
2256 if (instr->HasL()) { in DecodeType01()
2257 int16_t val = ReadH(addr, instr); in DecodeType01()
2261 WriteH(addr, val, instr); in DecodeType01()
2264 if (instr->HasL()) { in DecodeType01()
2265 uint16_t val = ReadHU(addr, instr); in DecodeType01()
2269 WriteH(addr, val, instr); in DecodeType01()
2274 DCHECK(instr->HasSign()); in DecodeType01()
2275 DCHECK(instr->HasL()); in DecodeType01()
2281 } else if ((type == 0) && instr->IsMiscType0()) { in DecodeType01()
2282 if (instr->Bits(22, 21) == 1) { in DecodeType01()
2283 int rm = instr->RmValue(); in DecodeType01()
2284 switch (instr->BitField(7, 4)) { in DecodeType01()
2303 } else if (instr->Bits(22, 21) == 3) { in DecodeType01()
2304 int rm = instr->RmValue(); in DecodeType01()
2305 int rd = instr->RdValue(); in DecodeType01()
2306 switch (instr->BitField(7, 4)) { in DecodeType01()
2325 PrintF("%08x\n", instr->InstructionBits()); in DecodeType01()
2328 } else if ((type == 1) && instr->IsNopType1()) { in DecodeType01()
2331 int rd = instr->RdValue(); in DecodeType01()
2332 int rn = instr->RnValue(); in DecodeType01()
2337 shifter_operand = GetShiftRm(instr, &shifter_carry_out); in DecodeType01()
2339 DCHECK(instr->TypeValue() == 1); in DecodeType01()
2340 shifter_operand = GetImm(instr, &shifter_carry_out); in DecodeType01()
2344 switch (instr->OpcodeField()) { in DecodeType01()
2350 if (instr->HasS()) { in DecodeType01()
2362 if (instr->HasS()) { in DecodeType01()
2374 if (instr->HasS()) { in DecodeType01()
2387 if (instr->HasS()) { in DecodeType01()
2400 if (instr->HasS()) { in DecodeType01()
2413 if (instr->HasS()) { in DecodeType01()
2422 Format(instr, "sbc'cond's 'rd, 'rn, 'shift_rm"); in DecodeType01()
2423 Format(instr, "sbc'cond's 'rd, 'rn, 'imm"); in DecodeType01()
2428 Format(instr, "rsc'cond's 'rd, 'rn, 'shift_rm"); in DecodeType01()
2429 Format(instr, "rsc'cond's 'rd, 'rn, 'imm"); in DecodeType01()
2434 if (instr->HasS()) { in DecodeType01()
2442 alu_out = instr->ImmedMovwMovtValue(); in DecodeType01()
2449 if (instr->HasS()) { in DecodeType01()
2464 if (instr->HasS()) { in DecodeType01()
2474 (instr->ImmedMovwMovtValue() << 16); in DecodeType01()
2481 if (instr->HasS()) { in DecodeType01()
2501 if (instr->HasS()) { in DecodeType01()
2513 if (instr->HasS()) { in DecodeType01()
2525 if (instr->HasS()) { in DecodeType01()
2537 if (instr->HasS()) { in DecodeType01()
2553 void Simulator::DecodeType2(Instruction* instr) { in DecodeType2() argument
2554 int rd = instr->RdValue(); in DecodeType2()
2555 int rn = instr->RnValue(); in DecodeType2()
2557 int32_t im_val = instr->Offset12Value(); in DecodeType2()
2559 switch (instr->PUField()) { in DecodeType2()
2562 DCHECK(!instr->HasW()); in DecodeType2()
2570 DCHECK(!instr->HasW()); in DecodeType2()
2580 if (instr->HasW()) { in DecodeType2()
2589 if (instr->HasW()) { in DecodeType2()
2599 if (instr->HasB()) { in DecodeType2()
2600 if (instr->HasL()) { in DecodeType2()
2608 if (instr->HasL()) { in DecodeType2()
2609 set_register(rd, ReadW(addr, instr)); in DecodeType2()
2611 WriteW(addr, get_register(rd), instr); in DecodeType2()
2617 void Simulator::DecodeType3(Instruction* instr) { in DecodeType3() argument
2618 int rd = instr->RdValue(); in DecodeType3()
2619 int rn = instr->RnValue(); in DecodeType3()
2622 int32_t shifter_operand = GetShiftRm(instr, &shifter_carry_out); in DecodeType3()
2624 switch (instr->PUField()) { in DecodeType3()
2626 DCHECK(!instr->HasW()); in DecodeType3()
2627 Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm"); in DecodeType3()
2632 if (instr->Bit(4) == 0) { in DecodeType3()
2635 if (instr->Bit(5) == 0) { in DecodeType3()
2636 switch (instr->Bits(22, 21)) { in DecodeType3()
2638 if (instr->Bit(20) == 0) { in DecodeType3()
2639 if (instr->Bit(6) == 0) { in DecodeType3()
2642 uint32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2643 int32_t shift = instr->Bits(11, 7); in DecodeType3()
2649 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2650 int32_t shift = instr->Bits(11, 7); in DecodeType3()
2669 int32_t sat_pos = instr->Bits(20, 16); in DecodeType3()
2671 int32_t shift = instr->Bits(11, 7); in DecodeType3()
2672 int32_t shift_type = instr->Bit(6); in DecodeType3()
2673 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2692 switch (instr->Bits(22, 21)) { in DecodeType3()
2697 if (instr->Bits(9, 6) == 1) { in DecodeType3()
2698 if (instr->Bit(20) == 0) { in DecodeType3()
2699 if (instr->Bits(19, 16) == 0xF) { in DecodeType3()
2701 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2702 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2720 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2721 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2738 if (instr->Bits(19, 16) == 0xF) { in DecodeType3()
2740 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2741 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2759 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2760 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2782 if ((instr->Bit(20) == 0) && (instr->Bits(9, 6) == 1)) { in DecodeType3()
2783 if (instr->Bits(19, 16) == 0xF) { in DecodeType3()
2785 uint32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2786 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2809 if ((instr->Bits(9, 6) == 1)) { in DecodeType3()
2810 if (instr->Bit(20) == 0) { in DecodeType3()
2811 if (instr->Bits(19, 16) == 0xF) { in DecodeType3()
2813 uint32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2814 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2832 uint32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2833 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2850 if (instr->Bits(19, 16) == 0xF) { in DecodeType3()
2852 uint32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2853 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2871 uint32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2872 int32_t rotate = instr->Bits(11, 10); in DecodeType3()
2900 if (instr->Bits(22, 20) == 0x5) { in DecodeType3()
2901 if (instr->Bits(7, 4) == 0x1) { in DecodeType3()
2902 int rm = instr->RmValue(); in DecodeType3()
2904 int rs = instr->RsValue(); in DecodeType3()
2906 if (instr->Bits(15, 12) == 0xF) { in DecodeType3()
2913 int rd = instr->RdValue(); in DecodeType3()
2922 if (instr->Bits(5, 4) == 0x1) { in DecodeType3()
2923 if ((instr->Bit(22) == 0x0) && (instr->Bit(20) == 0x1)) { in DecodeType3()
2926 int rm = instr->RmValue(); in DecodeType3()
2928 int rs = instr->RsValue(); in DecodeType3()
2932 if (instr->Bit(21) == 0x1) { in DecodeType3()
2945 if (instr->HasW()) { in DecodeType3()
2951 if (instr->HasW() && (instr->Bits(6, 4) == 0x5)) { in DecodeType3()
2952 uint32_t widthminus1 = static_cast<uint32_t>(instr->Bits(20, 16)); in DecodeType3()
2953 uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7)); in DecodeType3()
2956 if (instr->Bit(22)) { in DecodeType3()
2959 static_cast<uint32_t>(get_register(instr->RmValue())); in DecodeType3()
2962 set_register(instr->RdValue(), extr_val); in DecodeType3()
2965 int32_t rm_val = get_register(instr->RmValue()); in DecodeType3()
2968 set_register(instr->RdValue(), extr_val); in DecodeType3()
2974 } else if (!instr->HasW() && (instr->Bits(6, 4) == 0x1)) { in DecodeType3()
2975 uint32_t lsbit = static_cast<uint32_t>(instr->Bits(11, 7)); in DecodeType3()
2976 uint32_t msbit = static_cast<uint32_t>(instr->Bits(20, 16)); in DecodeType3()
2980 static_cast<uint32_t>(get_register(instr->RdValue())); in DecodeType3()
2984 if (instr->RmValue() != 15) { in DecodeType3()
2987 static_cast<uint32_t>(get_register(instr->RmValue())); in DecodeType3()
2991 set_register(instr->RdValue(), rd_val); in DecodeType3()
2999 if (instr->HasW()) { in DecodeType3()
3010 if (instr->HasB()) { in DecodeType3()
3011 if (instr->HasL()) { in DecodeType3()
3019 if (instr->HasL()) { in DecodeType3()
3020 set_register(rd, ReadW(addr, instr)); in DecodeType3()
3022 WriteW(addr, get_register(rd), instr); in DecodeType3()
3028 void Simulator::DecodeType4(Instruction* instr) { in DecodeType4() argument
3029 DCHECK(instr->Bit(22) == 0); // only allowed to be set in privileged mode in DecodeType4()
3030 if (instr->HasL()) { in DecodeType4()
3032 HandleRList(instr, true); in DecodeType4()
3035 HandleRList(instr, false); in DecodeType4()
3040 void Simulator::DecodeType5(Instruction* instr) { in DecodeType5() argument
3042 int off = (instr->SImmed24Value() << 2); in DecodeType5()
3044 if (instr->HasLink()) { in DecodeType5()
3052 void Simulator::DecodeType6(Instruction* instr) { in DecodeType6() argument
3053 DecodeType6CoprocessorIns(instr); in DecodeType6()
3057 void Simulator::DecodeType7(Instruction* instr) { in DecodeType7() argument
3058 if (instr->Bit(24) == 1) { in DecodeType7()
3059 SoftwareInterrupt(instr); in DecodeType7()
3061 DecodeTypeVFP(instr); in DecodeType7()
3090 void Simulator::DecodeTypeVFP(Instruction* instr) { in DecodeTypeVFP() argument
3091 DCHECK((instr->TypeValue() == 7) && (instr->Bit(24) == 0x0) ); in DecodeTypeVFP()
3092 DCHECK(instr->Bits(11, 9) == 0x5); in DecodeTypeVFP()
3095 int m = instr->VFPMRegValue(kSinglePrecision); in DecodeTypeVFP()
3096 int d = instr->VFPDRegValue(kSinglePrecision); in DecodeTypeVFP()
3097 int n = instr->VFPNRegValue(kSinglePrecision); in DecodeTypeVFP()
3099 int vm = instr->VFPMRegValue(kDoublePrecision); in DecodeTypeVFP()
3100 int vd = instr->VFPDRegValue(kDoublePrecision); in DecodeTypeVFP()
3101 int vn = instr->VFPNRegValue(kDoublePrecision); in DecodeTypeVFP()
3103 if (instr->Bit(4) == 0) { in DecodeTypeVFP()
3104 if (instr->Opc1Value() == 0x7) { in DecodeTypeVFP()
3106 if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x1)) { in DecodeTypeVFP()
3108 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3115 } else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) { in DecodeTypeVFP()
3117 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3128 } else if ((instr->Opc2Value() == 0x1) && (instr->Opc3Value() == 0x1)) { in DecodeTypeVFP()
3130 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3141 } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) { in DecodeTypeVFP()
3142 DecodeVCVTBetweenDoubleAndSingle(instr); in DecodeTypeVFP()
3143 } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) { in DecodeTypeVFP()
3144 DecodeVCVTBetweenFloatingPointAndInteger(instr); in DecodeTypeVFP()
3145 } else if ((instr->Opc2Value() == 0xA) && (instr->Opc3Value() == 0x3) && in DecodeTypeVFP()
3146 (instr->Bit(8) == 1)) { in DecodeTypeVFP()
3148 int fraction_bits = 32 - ((instr->Bits(3, 0) << 1) | instr->Bit(5)); in DecodeTypeVFP()
3152 } else if (((instr->Opc2Value() >> 1) == 0x6) && in DecodeTypeVFP()
3153 (instr->Opc3Value() & 0x1)) { in DecodeTypeVFP()
3154 DecodeVCVTBetweenFloatingPointAndInteger(instr); in DecodeTypeVFP()
3155 } else if (((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) && in DecodeTypeVFP()
3156 (instr->Opc3Value() & 0x1)) { in DecodeTypeVFP()
3157 DecodeVCMP(instr); in DecodeTypeVFP()
3158 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) { in DecodeTypeVFP()
3161 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3172 } else if (instr->Opc3Value() == 0x0) { in DecodeTypeVFP()
3174 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3175 set_d_register_from_double(vd, instr->DoubleImmedVmov()); in DecodeTypeVFP()
3179 } else if (((instr->Opc2Value() == 0x6)) && (instr->Opc3Value() == 0x3)) { in DecodeTypeVFP()
3181 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3195 } else if (instr->Opc1Value() == 0x3) { in DecodeTypeVFP()
3196 if (instr->Opc3Value() & 0x1) { in DecodeTypeVFP()
3198 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3213 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3227 } else if ((instr->Opc1Value() == 0x2) && !(instr->Opc3Value() & 0x1)) { in DecodeTypeVFP()
3229 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3242 } else if ((instr->Opc1Value() == 0x0)) { in DecodeTypeVFP()
3244 const bool is_vmls = (instr->Opc3Value() & 0x1); in DecodeTypeVFP()
3245 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3276 } else if ((instr->Opc1Value() == 0x4) && !(instr->Opc3Value() & 0x1)) { in DecodeTypeVFP()
3278 if (instr->SzValue() == 0x1) { in DecodeTypeVFP()
3297 if ((instr->VCValue() == 0x0) && in DecodeTypeVFP()
3298 (instr->VAValue() == 0x0)) { in DecodeTypeVFP()
3299 DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(instr); in DecodeTypeVFP()
3300 } else if ((instr->VLValue() == 0x0) && in DecodeTypeVFP()
3301 (instr->VCValue() == 0x1) && in DecodeTypeVFP()
3302 (instr->Bit(23) == 0x0)) { in DecodeTypeVFP()
3304 int vd = instr->Bits(19, 16) | (instr->Bit(7) << 4); in DecodeTypeVFP()
3307 data[instr->Bit(21)] = get_register(instr->RtValue()); in DecodeTypeVFP()
3309 } else if ((instr->VLValue() == 0x1) && in DecodeTypeVFP()
3310 (instr->VCValue() == 0x1) && in DecodeTypeVFP()
3311 (instr->Bit(23) == 0x0)) { in DecodeTypeVFP()
3313 int vn = instr->Bits(19, 16) | (instr->Bit(7) << 4); in DecodeTypeVFP()
3317 set_register(instr->RtValue(), data[instr->Bit(21)]); in DecodeTypeVFP()
3318 } else if ((instr->VLValue() == 0x1) && in DecodeTypeVFP()
3319 (instr->VCValue() == 0x0) && in DecodeTypeVFP()
3320 (instr->VAValue() == 0x7) && in DecodeTypeVFP()
3321 (instr->Bits(19, 16) == 0x1)) { in DecodeTypeVFP()
3323 uint32_t rt = instr->RtValue(); in DecodeTypeVFP()
3341 } else if ((instr->VLValue() == 0x0) && in DecodeTypeVFP()
3342 (instr->VCValue() == 0x0) && in DecodeTypeVFP()
3343 (instr->VAValue() == 0x7) && in DecodeTypeVFP()
3344 (instr->Bits(19, 16) == 0x1)) { in DecodeTypeVFP()
3346 uint32_t rt = instr->RtValue(); in DecodeTypeVFP()
3372 Instruction* instr) { in DecodeVMOVBetweenCoreAndSinglePrecisionRegisters() argument
3373 DCHECK((instr->Bit(4) == 1) && (instr->VCValue() == 0x0) && in DecodeVMOVBetweenCoreAndSinglePrecisionRegisters()
3374 (instr->VAValue() == 0x0)); in DecodeVMOVBetweenCoreAndSinglePrecisionRegisters()
3376 int t = instr->RtValue(); in DecodeVMOVBetweenCoreAndSinglePrecisionRegisters()
3377 int n = instr->VFPNRegValue(kSinglePrecision); in DecodeVMOVBetweenCoreAndSinglePrecisionRegisters()
3378 bool to_arm_register = (instr->VLValue() == 0x1); in DecodeVMOVBetweenCoreAndSinglePrecisionRegisters()
3390 void Simulator::DecodeVCMP(Instruction* instr) { in DecodeVCMP() argument
3391 DCHECK((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7)); in DecodeVCMP()
3392 DCHECK(((instr->Opc2Value() == 0x4) || (instr->Opc2Value() == 0x5)) && in DecodeVCMP()
3393 (instr->Opc3Value() & 0x1)); in DecodeVCMP()
3397 if (instr->SzValue() == 0x1) { in DecodeVCMP()
3401 int d = instr->VFPDRegValue(precision); in DecodeVCMP()
3403 if (instr->Opc2Value() == 0x4) { in DecodeVCMP()
3404 m = instr->VFPMRegValue(precision); in DecodeVCMP()
3410 if (instr->Opc2Value() == 0x4) { in DecodeVCMP()
3415 if (instr->Bit(7) == 1) { in DecodeVCMP()
3425 if (instr->Opc2Value() == 0x4) { in DecodeVCMP()
3430 if (instr->Bit(7) == 1) { in DecodeVCMP()
3441 void Simulator::DecodeVCVTBetweenDoubleAndSingle(Instruction* instr) { in DecodeVCVTBetweenDoubleAndSingle() argument
3442 DCHECK((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7)); in DecodeVCVTBetweenDoubleAndSingle()
3443 DCHECK((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)); in DecodeVCVTBetweenDoubleAndSingle()
3447 if (instr->SzValue() == 1) { in DecodeVCVTBetweenDoubleAndSingle()
3452 int dst = instr->VFPDRegValue(dst_precision); in DecodeVCVTBetweenDoubleAndSingle()
3453 int src = instr->VFPMRegValue(src_precision); in DecodeVCVTBetweenDoubleAndSingle()
3519 void Simulator::DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr) { in DecodeVCVTBetweenFloatingPointAndInteger() argument
3520 DCHECK((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7) && in DecodeVCVTBetweenFloatingPointAndInteger()
3521 (instr->Bits(27, 23) == 0x1D)); in DecodeVCVTBetweenFloatingPointAndInteger()
3522 DCHECK(((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) || in DecodeVCVTBetweenFloatingPointAndInteger()
3523 (((instr->Opc2Value() >> 1) == 0x6) && (instr->Opc3Value() & 0x1))); in DecodeVCVTBetweenFloatingPointAndInteger()
3526 bool to_integer = (instr->Bit(18) == 1); in DecodeVCVTBetweenFloatingPointAndInteger()
3528 VFPRegPrecision src_precision = (instr->SzValue() == 1) ? kDoublePrecision in DecodeVCVTBetweenFloatingPointAndInteger()
3539 int dst = instr->VFPDRegValue(kSinglePrecision); in DecodeVCVTBetweenFloatingPointAndInteger()
3540 int src = instr->VFPMRegValue(src_precision); in DecodeVCVTBetweenFloatingPointAndInteger()
3544 VFPRoundingMode mode = (instr->Bit(7) != 1) ? FPSCR_rounding_mode_ in DecodeVCVTBetweenFloatingPointAndInteger()
3548 bool unsigned_integer = (instr->Bit(16) == 0); in DecodeVCVTBetweenFloatingPointAndInteger()
3597 bool unsigned_integer = (instr->Bit(7) == 0); in DecodeVCVTBetweenFloatingPointAndInteger()
3599 int dst = instr->VFPDRegValue(src_precision); in DecodeVCVTBetweenFloatingPointAndInteger()
3600 int src = instr->VFPMRegValue(kSinglePrecision); in DecodeVCVTBetweenFloatingPointAndInteger()
3629 void Simulator::DecodeType6CoprocessorIns(Instruction* instr) { in DecodeType6CoprocessorIns() argument
3630 DCHECK((instr->TypeValue() == 6)); in DecodeType6CoprocessorIns()
3632 if (instr->CoprocessorValue() == 0xA) { in DecodeType6CoprocessorIns()
3633 switch (instr->OpcodeValue()) { in DecodeType6CoprocessorIns()
3638 int rn = instr->RnValue(); in DecodeType6CoprocessorIns()
3639 int vd = instr->VFPDRegValue(kSinglePrecision); in DecodeType6CoprocessorIns()
3640 int offset = instr->Immed8Value(); in DecodeType6CoprocessorIns()
3641 if (!instr->HasU()) { in DecodeType6CoprocessorIns()
3646 if (instr->HasL()) { in DecodeType6CoprocessorIns()
3648 set_s_register_from_sinteger(vd, ReadW(address, instr)); in DecodeType6CoprocessorIns()
3651 WriteW(address, get_sinteger_from_s_register(vd), instr); in DecodeType6CoprocessorIns()
3662 HandleVList(instr); in DecodeType6CoprocessorIns()
3667 } else if (instr->CoprocessorValue() == 0xB) { in DecodeType6CoprocessorIns()
3668 switch (instr->OpcodeValue()) { in DecodeType6CoprocessorIns()
3671 if (instr->Bits(7, 6) != 0 || instr->Bit(4) != 1) { in DecodeType6CoprocessorIns()
3674 int rt = instr->RtValue(); in DecodeType6CoprocessorIns()
3675 int rn = instr->RnValue(); in DecodeType6CoprocessorIns()
3676 int vm = instr->VFPMRegValue(kDoublePrecision); in DecodeType6CoprocessorIns()
3677 if (instr->HasL()) { in DecodeType6CoprocessorIns()
3692 int rn = instr->RnValue(); in DecodeType6CoprocessorIns()
3693 int vd = instr->VFPDRegValue(kDoublePrecision); in DecodeType6CoprocessorIns()
3694 int offset = instr->Immed8Value(); in DecodeType6CoprocessorIns()
3695 if (!instr->HasU()) { in DecodeType6CoprocessorIns()
3699 if (instr->HasL()) { in DecodeType6CoprocessorIns()
3702 ReadW(address, instr), in DecodeType6CoprocessorIns()
3703 ReadW(address + 4, instr) in DecodeType6CoprocessorIns()
3710 WriteW(address, data[0], instr); in DecodeType6CoprocessorIns()
3711 WriteW(address + 4, data[1], instr); in DecodeType6CoprocessorIns()
3722 HandleVList(instr); in DecodeType6CoprocessorIns()
3733 void Simulator::DecodeSpecialCondition(Instruction* instr) { in DecodeSpecialCondition() argument
3734 switch (instr->SpecialValue()) { in DecodeSpecialCondition()
3736 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && in DecodeSpecialCondition()
3737 (instr->Bit(4) == 1)) { in DecodeSpecialCondition()
3739 if ((instr->VdValue() & 1) != 0) UNIMPLEMENTED(); in DecodeSpecialCondition()
3740 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); in DecodeSpecialCondition()
3741 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); in DecodeSpecialCondition()
3742 int imm3 = instr->Bits(21, 19); in DecodeSpecialCondition()
3760 if ((instr->Bits(18, 16) == 0) && (instr->Bits(11, 6) == 0x28) && in DecodeSpecialCondition()
3761 (instr->Bit(4) == 1)) { in DecodeSpecialCondition()
3763 if ((instr->VdValue() & 1) != 0) UNIMPLEMENTED(); in DecodeSpecialCondition()
3764 int Vd = (instr->Bit(22) << 3) | (instr->VdValue() >> 1); in DecodeSpecialCondition()
3765 int Vm = (instr->Bit(5) << 4) | instr->VmValue(); in DecodeSpecialCondition()
3766 int imm3 = instr->Bits(21, 19); in DecodeSpecialCondition()
3784 if (instr->Bits(21, 20) == 0) { in DecodeSpecialCondition()
3786 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); in DecodeSpecialCondition()
3787 int Rn = instr->VnValue(); in DecodeSpecialCondition()
3788 int type = instr->Bits(11, 8); in DecodeSpecialCondition()
3789 int Rm = instr->VmValue(); in DecodeSpecialCondition()
3813 WriteW(address, data[0], instr); in DecodeSpecialCondition()
3814 WriteW(address + 4, data[1], instr); in DecodeSpecialCondition()
3825 } else if (instr->Bits(21, 20) == 2) { in DecodeSpecialCondition()
3827 int Vd = (instr->Bit(22) << 4) | instr->VdValue(); in DecodeSpecialCondition()
3828 int Rn = instr->VnValue(); in DecodeSpecialCondition()
3829 int type = instr->Bits(11, 8); in DecodeSpecialCondition()
3830 int Rm = instr->VmValue(); in DecodeSpecialCondition()
3853 data[0] = ReadW(address, instr); in DecodeSpecialCondition()
3854 data[1] = ReadW(address + 4, instr); in DecodeSpecialCondition()
3872 if ((instr->Bits(22, 20) == 5) && (instr->Bits(15, 12) == 0xf)) { in DecodeSpecialCondition()
3879 if (instr->Opc1Value() == 0x7 && instr->Opc3Value() == 0x1 && in DecodeSpecialCondition()
3880 instr->Bits(11, 9) == 0x5 && instr->Bits(19, 18) == 0x2) { in DecodeSpecialCondition()
3881 if (instr->SzValue() == 0x1) { in DecodeSpecialCondition()
3882 int vm = instr->VFPMRegValue(kDoublePrecision); in DecodeSpecialCondition()
3883 int vd = instr->VFPDRegValue(kDoublePrecision); in DecodeSpecialCondition()
3886 int rounding_mode = instr->Bits(17, 16); in DecodeSpecialCondition()
3908 int m = instr->VFPMRegValue(kSinglePrecision); in DecodeSpecialCondition()
3909 int d = instr->VFPDRegValue(kSinglePrecision); in DecodeSpecialCondition()
3912 int rounding_mode = instr->Bits(17, 16); in DecodeSpecialCondition()
3946 void Simulator::InstructionDecode(Instruction* instr) { in InstructionDecode() argument
3948 CheckICache(isolate_->simulator_i_cache(), instr); in InstructionDecode()
3957 reinterpret_cast<byte*>(instr)); in InstructionDecode()
3958 PrintF(" 0x%08x %s\n", reinterpret_cast<intptr_t>(instr), buffer.start()); in InstructionDecode()
3960 if (instr->ConditionField() == kSpecialCondition) { in InstructionDecode()
3961 DecodeSpecialCondition(instr); in InstructionDecode()
3962 } else if (ConditionallyExecute(instr)) { in InstructionDecode()
3963 switch (instr->TypeValue()) { in InstructionDecode()
3966 DecodeType01(instr); in InstructionDecode()
3970 DecodeType2(instr); in InstructionDecode()
3974 DecodeType3(instr); in InstructionDecode()
3978 DecodeType4(instr); in InstructionDecode()
3982 DecodeType5(instr); in InstructionDecode()
3986 DecodeType6(instr); in InstructionDecode()
3990 DecodeType7(instr); in InstructionDecode()
4000 } else if (instr->IsStop()) { in InstructionDecode()
4004 set_register(pc, reinterpret_cast<int32_t>(instr) in InstructionDecode()
4019 Instruction* instr = reinterpret_cast<Instruction*>(program_counter); in Execute() local
4021 InstructionDecode(instr); in Execute()
4028 Instruction* instr = reinterpret_cast<Instruction*>(program_counter); in Execute() local
4034 InstructionDecode(instr); in Execute()