OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 if (instr->RsValue() == 0) | 1560 if (instr->RsValue() == 0) |
1561 Format(instr, "bal 'imm16s -> 'imm16p4s2"); | 1561 Format(instr, "bal 'imm16s -> 'imm16p4s2"); |
1562 else | 1562 else |
1563 Format(instr, "bgezal 'rs, 'imm16u -> 'imm16p4s2"); | 1563 Format(instr, "bgezal 'rs, 'imm16u -> 'imm16p4s2"); |
1564 break; | 1564 break; |
1565 } | 1565 } |
1566 case BGEZALL: | 1566 case BGEZALL: |
1567 Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2"); | 1567 Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2"); |
1568 break; | 1568 break; |
1569 case DAHI: | 1569 case DAHI: |
1570 Format(instr, "dahi 'rs, 'imm16u"); | 1570 Format(instr, "dahi 'rs, 'imm16x"); |
1571 break; | 1571 break; |
1572 case DATI: | 1572 case DATI: |
1573 Format(instr, "dati 'rs, 'imm16u"); | 1573 Format(instr, "dati 'rs, 'imm16x"); |
1574 break; | 1574 break; |
1575 default: | 1575 default: |
1576 UNREACHABLE(); | 1576 UNREACHABLE(); |
1577 } | 1577 } |
1578 } | 1578 } |
1579 | 1579 |
1580 | 1580 |
1581 void Decoder::DecodeTypeImmediate(Instruction* instr) { | 1581 void Decoder::DecodeTypeImmediate(Instruction* instr) { |
1582 switch (instr->OpcodeFieldRaw()) { | 1582 switch (instr->OpcodeFieldRaw()) { |
1583 case COP1: | 1583 case COP1: |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 Format(instr, "ori 'rt, 'rs, 'imm16x"); | 1716 Format(instr, "ori 'rt, 'rs, 'imm16x"); |
1717 break; | 1717 break; |
1718 case XORI: | 1718 case XORI: |
1719 Format(instr, "xori 'rt, 'rs, 'imm16x"); | 1719 Format(instr, "xori 'rt, 'rs, 'imm16x"); |
1720 break; | 1720 break; |
1721 case LUI: | 1721 case LUI: |
1722 if (kArchVariant != kMips64r6) { | 1722 if (kArchVariant != kMips64r6) { |
1723 Format(instr, "lui 'rt, 'imm16x"); | 1723 Format(instr, "lui 'rt, 'imm16x"); |
1724 } else { | 1724 } else { |
1725 if (instr->RsValue() != 0) { | 1725 if (instr->RsValue() != 0) { |
1726 Format(instr, "aui 'rt, 'imm16x"); | 1726 Format(instr, "aui 'rt, 'rs, 'imm16x"); |
1727 } else { | 1727 } else { |
1728 Format(instr, "lui 'rt, 'imm16x"); | 1728 Format(instr, "lui 'rt, 'imm16x"); |
1729 } | 1729 } |
1730 } | 1730 } |
1731 break; | 1731 break; |
1732 case DAUI: | 1732 case DAUI: |
1733 Format(instr, "daui 'rt, 'imm16x"); | 1733 Format(instr, "daui 'rt, 'rs, 'imm16x"); |
1734 break; | 1734 break; |
1735 // ------------- Memory instructions. | 1735 // ------------- Memory instructions. |
1736 case LB: | 1736 case LB: |
1737 Format(instr, "lb 'rt, 'imm16s('rs)"); | 1737 Format(instr, "lb 'rt, 'imm16s('rs)"); |
1738 break; | 1738 break; |
1739 case LH: | 1739 case LH: |
1740 Format(instr, "lh 'rt, 'imm16s('rs)"); | 1740 Format(instr, "lh 'rt, 'imm16s('rs)"); |
1741 break; | 1741 break; |
1742 case LWL: | 1742 case LWL: |
1743 Format(instr, "lwl 'rt, 'imm16s('rs)"); | 1743 Format(instr, "lwl 'rt, 'imm16s('rs)"); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1971 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1972 } | 1972 } |
1973 } | 1973 } |
1974 | 1974 |
1975 | 1975 |
1976 #undef UNSUPPORTED | 1976 #undef UNSUPPORTED |
1977 | 1977 |
1978 } // namespace disasm | 1978 } // namespace disasm |
1979 | 1979 |
1980 #endif // V8_TARGET_ARCH_MIPS64 | 1980 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |