Chromium Code Reviews

Side by Side Diff: src/mips64/disasm-mips64.cc

Issue 1481493002: (mips) adding simulator support for AUI/DAUI/DAHI/DATI instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: adding disasm tests. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 1517 matching lines...)
1528 if (instr->RsValue() == 0) 1528 if (instr->RsValue() == 0)
1529 Format(instr, "bal 'imm16s -> 'imm16p4s2"); 1529 Format(instr, "bal 'imm16s -> 'imm16p4s2");
1530 else 1530 else
1531 Format(instr, "bgezal 'rs, 'imm16u -> 'imm16p4s2"); 1531 Format(instr, "bgezal 'rs, 'imm16u -> 'imm16p4s2");
1532 break; 1532 break;
1533 } 1533 }
1534 case BGEZALL: 1534 case BGEZALL:
1535 Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2"); 1535 Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2");
1536 break; 1536 break;
1537 case DAHI: 1537 case DAHI:
1538 Format(instr, "dahi 'rs, 'imm16u"); 1538 Format(instr, "dahi 'rs, 'imm16x");
1539 break; 1539 break;
1540 case DATI: 1540 case DATI:
1541 Format(instr, "dati 'rs, 'imm16u"); 1541 Format(instr, "dati 'rs, 'imm16x");
1542 break; 1542 break;
1543 default: 1543 default:
1544 UNREACHABLE(); 1544 UNREACHABLE();
1545 } 1545 }
1546 } 1546 }
1547 1547
1548 1548
1549 void Decoder::DecodeTypeImmediate(Instruction* instr) { 1549 void Decoder::DecodeTypeImmediate(Instruction* instr) {
1550 switch (instr->OpcodeFieldRaw()) { 1550 switch (instr->OpcodeFieldRaw()) {
1551 case COP1: 1551 case COP1:
(...skipping 132 matching lines...)
1684 Format(instr, "ori 'rt, 'rs, 'imm16x"); 1684 Format(instr, "ori 'rt, 'rs, 'imm16x");
1685 break; 1685 break;
1686 case XORI: 1686 case XORI:
1687 Format(instr, "xori 'rt, 'rs, 'imm16x"); 1687 Format(instr, "xori 'rt, 'rs, 'imm16x");
1688 break; 1688 break;
1689 case LUI: 1689 case LUI:
1690 if (kArchVariant != kMips64r6) { 1690 if (kArchVariant != kMips64r6) {
1691 Format(instr, "lui 'rt, 'imm16x"); 1691 Format(instr, "lui 'rt, 'imm16x");
1692 } else { 1692 } else {
1693 if (instr->RsValue() != 0) { 1693 if (instr->RsValue() != 0) {
1694 Format(instr, "aui 'rt, 'imm16x"); 1694 Format(instr, "aui 'rt, 'rs, 'imm16x");
1695 } else { 1695 } else {
1696 Format(instr, "lui 'rt, 'imm16x"); 1696 Format(instr, "lui 'rt, 'imm16x");
1697 } 1697 }
1698 } 1698 }
1699 break; 1699 break;
1700 case DAUI: 1700 case DAUI:
1701 Format(instr, "daui 'rt, 'imm16x"); 1701 Format(instr, "daui 'rt, 'rs, 'imm16x");
1702 break; 1702 break;
1703 // ------------- Memory instructions. 1703 // ------------- Memory instructions.
1704 case LB: 1704 case LB:
1705 Format(instr, "lb 'rt, 'imm16s('rs)"); 1705 Format(instr, "lb 'rt, 'imm16s('rs)");
1706 break; 1706 break;
1707 case LH: 1707 case LH:
1708 Format(instr, "lh 'rt, 'imm16s('rs)"); 1708 Format(instr, "lh 'rt, 'imm16s('rs)");
1709 break; 1709 break;
1710 case LWL: 1710 case LWL:
1711 Format(instr, "lwl 'rt, 'imm16s('rs)"); 1711 Format(instr, "lwl 'rt, 'imm16s('rs)");
(...skipping 227 matching lines...)
1939 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); 1939 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
1940 } 1940 }
1941 } 1941 }
1942 1942
1943 1943
1944 #undef UNSUPPORTED 1944 #undef UNSUPPORTED
1945 1945
1946 } // namespace disasm 1946 } // namespace disasm
1947 1947
1948 #endif // V8_TARGET_ARCH_MIPS64 1948 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine