OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A Disassembler object is used to disassemble a block of code instruction by | 5 // A Disassembler object is used to disassemble a block of code instruction by |
6 // instruction. The default implementation of the NameConverter object can be | 6 // instruction. The default implementation of the NameConverter object can be |
7 // overriden to modify register names or to do symbol lookup on addresses. | 7 // overriden to modify register names or to do symbol lookup on addresses. |
8 // | 8 // |
9 // The example below will disassemble a block of code and print it to stdout. | 9 // The example below will disassemble a block of code and print it to stdout. |
10 // | 10 // |
(...skipping 1259 matching lines...) Loading... | |
1270 (instr->Opc3Value() & 0x1)) { | 1270 (instr->Opc3Value() & 0x1)) { |
1271 DecodeVCMP(instr); | 1271 DecodeVCMP(instr); |
1272 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) { | 1272 } else if (((instr->Opc2Value() == 0x1)) && (instr->Opc3Value() == 0x3)) { |
1273 Format(instr, "vsqrt'cond.f64 'Dd, 'Dm"); | 1273 Format(instr, "vsqrt'cond.f64 'Dd, 'Dm"); |
1274 } else if (instr->Opc3Value() == 0x0) { | 1274 } else if (instr->Opc3Value() == 0x0) { |
1275 if (instr->SzValue() == 0x1) { | 1275 if (instr->SzValue() == 0x1) { |
1276 Format(instr, "vmov'cond.f64 'Dd, 'd"); | 1276 Format(instr, "vmov'cond.f64 'Dd, 'd"); |
1277 } else { | 1277 } else { |
1278 Unknown(instr); // Not used by V8. | 1278 Unknown(instr); // Not used by V8. |
1279 } | 1279 } |
1280 } else if (((instr->Opc2Value() == 0x6)) && (instr->Opc3Value() & 0x1)) { | |
1281 bool dp_operation = (instr->SzValue() == 1); | |
1282 if (instr->Opc3Value() & 0x2) { | |
1283 // vrintz - round towards zero (truncate) | |
1284 if (dp_operation) { | |
1285 Format(instr, "vrintz'cond.f64.f64 'Dd, 'Dm"); | |
1286 } else { | |
1287 Format(instr, "vrintz'cond.f32.f32 'Sd, 'Sm"); | |
1288 } | |
1289 } else { | |
1290 // vrintr - round according to rounding mode in FPSCR | |
Rodolph Perfetta (ARM)
2014/10/28 19:41:41
vrintr is not implemented by this patch, usually t
sigurds
2014/10/29 11:47:15
Done.
| |
1291 if (dp_operation) { | |
1292 Format(instr, "vrintr'cond.f64.f64 'Dd, 'Dm"); | |
1293 } else { | |
1294 Format(instr, "vrintr'cond.f32.f32 'Sd, 'Sm"); | |
1295 } | |
1296 } | |
1280 } else { | 1297 } else { |
1281 Unknown(instr); // Not used by V8. | 1298 Unknown(instr); // Not used by V8. |
1282 } | 1299 } |
1283 } else if (instr->Opc1Value() == 0x3) { | 1300 } else if (instr->Opc1Value() == 0x3) { |
1284 if (instr->SzValue() == 0x1) { | 1301 if (instr->SzValue() == 0x1) { |
1285 if (instr->Opc3Value() & 0x1) { | 1302 if (instr->Opc3Value() & 0x1) { |
1286 Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm"); | 1303 Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm"); |
1287 } else { | 1304 } else { |
1288 Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm"); | 1305 Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm"); |
1289 } | 1306 } |
(...skipping 330 matching lines...) Loading... | |
1620 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1637 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1621 "pld [r%d, #-%d]", Rn, offset); | 1638 "pld [r%d, #-%d]", Rn, offset); |
1622 } else { | 1639 } else { |
1623 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1640 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1624 "pld [r%d, #+%d]", Rn, offset); | 1641 "pld [r%d, #+%d]", Rn, offset); |
1625 } | 1642 } |
1626 } else { | 1643 } else { |
1627 Unknown(instr); | 1644 Unknown(instr); |
1628 } | 1645 } |
1629 break; | 1646 break; |
1647 case 0x1D: | |
1648 if (instr->Opc1Value() == 0x7 && instr->Bits(19, 18) == 0x2 && | |
1649 instr->Bits(11, 9) == 0x5 && instr->Bits(7, 6) == 0x1 && | |
1650 instr->Bit(4) == 0x0) { | |
1651 // VRINTA, VRINTN, VRINTP, VRINTM (floating-point) | |
1652 bool dp_operation = (instr->SzValue() == 1); | |
1653 int rounding_mode = instr->Bits(17, 16); | |
1654 switch (rounding_mode) { | |
1655 case 0x0: | |
1656 if (dp_operation) { | |
1657 Format(instr, "vrinta.f64.f64 'Dd, 'Dm"); | |
1658 } else { | |
1659 Format(instr, "vrinta.f32.f32 'Sd, 'Sm"); | |
Rodolph Perfetta (ARM)
2014/10/28 19:41:41
You don't implement single precision, so I would h
sigurds
2014/10/29 11:47:15
Done.
| |
1660 } | |
1661 break; | |
1662 case 0x1: | |
1663 if (dp_operation) { | |
1664 Format(instr, "vrintn.f64.f64 'Dd, 'Dm"); | |
1665 } else { | |
1666 Format(instr, "vrintn.f32.f32 'Sd, 'Sm"); | |
1667 } | |
1668 break; | |
1669 case 0x2: | |
1670 if (dp_operation) { | |
1671 Format(instr, "vrintp.f64.f64 'Dd, 'Dm"); | |
1672 } else { | |
1673 Format(instr, "vrintp.f32.f32 'Sd, 'Sm"); | |
1674 } | |
1675 break; | |
1676 case 0x3: | |
1677 if (dp_operation) { | |
1678 Format(instr, "vrintm.f64.f64 'Dd, 'Dm"); | |
1679 } else { | |
1680 Format(instr, "vrintm.f32.f32 'Sd, 'Sm"); | |
1681 } | |
1682 break; | |
1683 default: | |
1684 UNREACHABLE(); // Case analysis is exhaustive. | |
1685 break; | |
1686 } | |
1687 } else { | |
1688 Unknown(instr); | |
1689 } | |
1690 break; | |
1630 default: | 1691 default: |
1631 Unknown(instr); | 1692 Unknown(instr); |
1632 break; | 1693 break; |
1633 } | 1694 } |
1634 } | 1695 } |
1635 | 1696 |
1636 #undef VERIFIY | 1697 #undef VERIFIY |
1637 | 1698 |
1638 bool Decoder::IsConstantPoolAt(byte* instr_ptr) { | 1699 bool Decoder::IsConstantPoolAt(byte* instr_ptr) { |
1639 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); | 1700 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); |
(...skipping 152 matching lines...) Loading... | |
1792 v8::internal::PrintF( | 1853 v8::internal::PrintF( |
1793 f, "%p %08x %s\n", | 1854 f, "%p %08x %s\n", |
1794 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1855 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1795 } | 1856 } |
1796 } | 1857 } |
1797 | 1858 |
1798 | 1859 |
1799 } // namespace disasm | 1860 } // namespace disasm |
1800 | 1861 |
1801 #endif // V8_TARGET_ARCH_ARM | 1862 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |