Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 void DecodeType01(Instruction* instr); | 124 void DecodeType01(Instruction* instr); |
| 125 void DecodeType2(Instruction* instr); | 125 void DecodeType2(Instruction* instr); |
| 126 void DecodeType3(Instruction* instr); | 126 void DecodeType3(Instruction* instr); |
| 127 void DecodeType4(Instruction* instr); | 127 void DecodeType4(Instruction* instr); |
| 128 void DecodeType5(Instruction* instr); | 128 void DecodeType5(Instruction* instr); |
| 129 void DecodeType6(Instruction* instr); | 129 void DecodeType6(Instruction* instr); |
| 130 // Type 7 includes special Debugger instructions. | 130 // Type 7 includes special Debugger instructions. |
| 131 int DecodeType7(Instruction* instr); | 131 int DecodeType7(Instruction* instr); |
| 132 // For VFP support. | 132 // For VFP support. |
| 133 void DecodeTypeVFP(Instruction* instr); | 133 void DecodeTypeVFP(Instruction* instr); |
| 134 void DecodeSpecialCondition(Instruction* instr); | |
| 134 void DecodeType6CoprocessorIns(Instruction* instr); | 135 void DecodeType6CoprocessorIns(Instruction* instr); |
| 135 | 136 |
| 136 void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* instr); | 137 void DecodeVMOVBetweenCoreAndSinglePrecisionRegisters(Instruction* instr); |
| 137 void DecodeVCMP(Instruction* instr); | 138 void DecodeVCMP(Instruction* instr); |
| 138 void DecodeVCVTBetweenDoubleAndSingle(Instruction* instr); | 139 void DecodeVCVTBetweenDoubleAndSingle(Instruction* instr); |
| 139 void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr); | 140 void DecodeVCVTBetweenFloatingPointAndInteger(Instruction* instr); |
| 140 | 141 |
| 141 const disasm::NameConverter& converter_; | 142 const disasm::NameConverter& converter_; |
| 142 Vector<char> out_buffer_; | 143 Vector<char> out_buffer_; |
| 143 int out_buffer_pos_; | 144 int out_buffer_pos_; |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1204 Format(instr, "vcmp.f64'cond 'Dd, #0.0"); | 1205 Format(instr, "vcmp.f64'cond 'Dd, #0.0"); |
| 1205 } else { | 1206 } else { |
| 1206 Unknown(instr); // invalid | 1207 Unknown(instr); // invalid |
| 1207 } | 1208 } |
| 1208 } else { | 1209 } else { |
| 1209 Unknown(instr); // Not used by V8. | 1210 Unknown(instr); // Not used by V8. |
| 1210 } | 1211 } |
| 1211 } | 1212 } |
| 1212 | 1213 |
| 1213 | 1214 |
| 1215 // Currently supports: | |
| 1216 // Dd = vorr(Dn, Dm) | |
| 1217 void Decoder::DecodeSpecialCondition(Instruction* instr) { | |
| 1218 // See ARM DDI 0406A, A7-12 for how to detect which instruction this is. | |
| 1219 if (instr->Bits(11, 8) == 0x1 && | |
| 1220 instr->Bit(4) == 0x1 && | |
| 1221 instr->Bit(24) == 0x0 && | |
| 1222 instr->Opc1Value() == 0x2) { | |
|
Erik Corry
2012/08/06 10:44:40
This tests bits 20, 21, 23, 24, but ignores bits 2
Jakob Kummerow
2012/08/06 14:08:43
As discussed, removed vorr completely.
| |
| 1223 // vorr | |
| 1224 Format(instr, "vorr 'Dd, 'Dn, 'Dm"); | |
| 1225 } else { | |
| 1226 Unknown(instr); | |
| 1227 } | |
| 1228 } | |
| 1229 | |
| 1230 | |
| 1214 void Decoder::DecodeVCVTBetweenDoubleAndSingle(Instruction* instr) { | 1231 void Decoder::DecodeVCVTBetweenDoubleAndSingle(Instruction* instr) { |
| 1215 VERIFY((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7)); | 1232 VERIFY((instr->Bit(4) == 0) && (instr->Opc1Value() == 0x7)); |
| 1216 VERIFY((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)); | 1233 VERIFY((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)); |
| 1217 | 1234 |
| 1218 bool double_to_single = (instr->SzValue() == 1); | 1235 bool double_to_single = (instr->SzValue() == 1); |
| 1219 | 1236 |
| 1220 if (double_to_single) { | 1237 if (double_to_single) { |
| 1221 Format(instr, "vcvt.f32.f64'cond 'Sd, 'Dm"); | 1238 Format(instr, "vcvt.f32.f64'cond 'Sd, 'Dm"); |
| 1222 } else { | 1239 } else { |
| 1223 Format(instr, "vcvt.f64.f32'cond 'Dd, 'Sm"); | 1240 Format(instr, "vcvt.f64.f32'cond 'Dd, 'Sm"); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1375 | 1392 |
| 1376 | 1393 |
| 1377 // Disassemble the instruction at *instr_ptr into the output buffer. | 1394 // Disassemble the instruction at *instr_ptr into the output buffer. |
| 1378 int Decoder::InstructionDecode(byte* instr_ptr) { | 1395 int Decoder::InstructionDecode(byte* instr_ptr) { |
| 1379 Instruction* instr = Instruction::At(instr_ptr); | 1396 Instruction* instr = Instruction::At(instr_ptr); |
| 1380 // Print raw instruction bytes. | 1397 // Print raw instruction bytes. |
| 1381 out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_, | 1398 out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1382 "%08x ", | 1399 "%08x ", |
| 1383 instr->InstructionBits()); | 1400 instr->InstructionBits()); |
| 1384 if (instr->ConditionField() == kSpecialCondition) { | 1401 if (instr->ConditionField() == kSpecialCondition) { |
| 1385 Unknown(instr); | 1402 DecodeSpecialCondition(instr); |
| 1386 return Instruction::kInstrSize; | 1403 return Instruction::kInstrSize; |
| 1387 } | 1404 } |
| 1388 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); | 1405 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); |
| 1389 if ((instruction_bits & kConstantPoolMarkerMask) == kConstantPoolMarker) { | 1406 if ((instruction_bits & kConstantPoolMarkerMask) == kConstantPoolMarker) { |
| 1390 out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_, | 1407 out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
| 1391 "constant pool begin (length %d)", | 1408 "constant pool begin (length %d)", |
| 1392 instruction_bits & | 1409 instruction_bits & |
| 1393 kConstantPoolLengthMask); | 1410 kConstantPoolLengthMask); |
| 1394 return Instruction::kInstrSize; | 1411 return Instruction::kInstrSize; |
| 1395 } | 1412 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1507 pc += d.InstructionDecode(buffer, pc); | 1524 pc += d.InstructionDecode(buffer, pc); |
| 1508 fprintf(f, "%p %08x %s\n", | 1525 fprintf(f, "%p %08x %s\n", |
| 1509 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1526 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
| 1510 } | 1527 } |
| 1511 } | 1528 } |
| 1512 | 1529 |
| 1513 | 1530 |
| 1514 } // namespace disasm | 1531 } // namespace disasm |
| 1515 | 1532 |
| 1516 #endif // V8_TARGET_ARCH_ARM | 1533 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |