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...) Expand 10 before | Expand all | Expand 10 after 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() == 0x3) { |
| 1281 bool dp_operation = (instr->SzValue() == 1); |
| 1282 // vrintz - round towards zero (truncate) |
| 1283 if (dp_operation) { |
| 1284 Format(instr, "vrintz'cond.f64.f64 'Dd, 'Dm"); |
| 1285 } else { |
| 1286 Unknown(instr); // Not used by V8. |
| 1287 } |
1280 } else { | 1288 } else { |
1281 Unknown(instr); // Not used by V8. | 1289 Unknown(instr); // Not used by V8. |
1282 } | 1290 } |
1283 } else if (instr->Opc1Value() == 0x3) { | 1291 } else if (instr->Opc1Value() == 0x3) { |
1284 if (instr->SzValue() == 0x1) { | 1292 if (instr->SzValue() == 0x1) { |
1285 if (instr->Opc3Value() & 0x1) { | 1293 if (instr->Opc3Value() & 0x1) { |
1286 Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm"); | 1294 Format(instr, "vsub'cond.f64 'Dd, 'Dn, 'Dm"); |
1287 } else { | 1295 } else { |
1288 Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm"); | 1296 Format(instr, "vadd'cond.f64 'Dd, 'Dn, 'Dm"); |
1289 } | 1297 } |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1628 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1621 "pld [r%d, #-%d]", Rn, offset); | 1629 "pld [r%d, #-%d]", Rn, offset); |
1622 } else { | 1630 } else { |
1623 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1631 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, |
1624 "pld [r%d, #+%d]", Rn, offset); | 1632 "pld [r%d, #+%d]", Rn, offset); |
1625 } | 1633 } |
1626 } else { | 1634 } else { |
1627 Unknown(instr); | 1635 Unknown(instr); |
1628 } | 1636 } |
1629 break; | 1637 break; |
| 1638 case 0x1D: |
| 1639 if (instr->Opc1Value() == 0x7 && instr->Bits(19, 18) == 0x2 && |
| 1640 instr->Bits(11, 9) == 0x5 && instr->Bits(7, 6) == 0x1 && |
| 1641 instr->Bit(4) == 0x0) { |
| 1642 // VRINTA, VRINTN, VRINTP, VRINTM (floating-point) |
| 1643 bool dp_operation = (instr->SzValue() == 1); |
| 1644 int rounding_mode = instr->Bits(17, 16); |
| 1645 switch (rounding_mode) { |
| 1646 case 0x0: |
| 1647 if (dp_operation) { |
| 1648 Format(instr, "vrinta.f64.f64 'Dd, 'Dm"); |
| 1649 } else { |
| 1650 Unknown(instr); |
| 1651 } |
| 1652 break; |
| 1653 case 0x1: |
| 1654 if (dp_operation) { |
| 1655 Format(instr, "vrintn.f64.f64 'Dd, 'Dm"); |
| 1656 } else { |
| 1657 Unknown(instr); |
| 1658 } |
| 1659 break; |
| 1660 case 0x2: |
| 1661 if (dp_operation) { |
| 1662 Format(instr, "vrintp.f64.f64 'Dd, 'Dm"); |
| 1663 } else { |
| 1664 Unknown(instr); |
| 1665 } |
| 1666 break; |
| 1667 case 0x3: |
| 1668 if (dp_operation) { |
| 1669 Format(instr, "vrintm.f64.f64 'Dd, 'Dm"); |
| 1670 } else { |
| 1671 Unknown(instr); |
| 1672 } |
| 1673 break; |
| 1674 default: |
| 1675 UNREACHABLE(); // Case analysis is exhaustive. |
| 1676 break; |
| 1677 } |
| 1678 } else { |
| 1679 Unknown(instr); |
| 1680 } |
| 1681 break; |
1630 default: | 1682 default: |
1631 Unknown(instr); | 1683 Unknown(instr); |
1632 break; | 1684 break; |
1633 } | 1685 } |
1634 } | 1686 } |
1635 | 1687 |
1636 #undef VERIFIY | 1688 #undef VERIFIY |
1637 | 1689 |
1638 bool Decoder::IsConstantPoolAt(byte* instr_ptr) { | 1690 bool Decoder::IsConstantPoolAt(byte* instr_ptr) { |
1639 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); | 1691 int instruction_bits = *(reinterpret_cast<int*>(instr_ptr)); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 v8::internal::PrintF( | 1844 v8::internal::PrintF( |
1793 f, "%p %08x %s\n", | 1845 f, "%p %08x %s\n", |
1794 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1846 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1795 } | 1847 } |
1796 } | 1848 } |
1797 | 1849 |
1798 | 1850 |
1799 } // namespace disasm | 1851 } // namespace disasm |
1800 | 1852 |
1801 #endif // V8_TARGET_ARCH_ARM | 1853 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |