| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 8 #if defined(TARGET_ARCH_MIPS) | 8 #if defined(TARGET_ARCH_MIPS) |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 | 10 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 void MIPSDecoder::DecodeCop1(Instr* instr) { | 479 void MIPSDecoder::DecodeCop1(Instr* instr) { |
| 480 ASSERT(instr->OpcodeField() == COP1); | 480 ASSERT(instr->OpcodeField() == COP1); |
| 481 if (instr->HasFormat()) { | 481 if (instr->HasFormat()) { |
| 482 // If the rs field is a valid format, then the function field identifies | 482 // If the rs field is a valid format, then the function field identifies |
| 483 // the instruction. | 483 // the instruction. |
| 484 switch (instr->Cop1FunctionField()) { | 484 switch (instr->Cop1FunctionField()) { |
| 485 case COP1_ADD: { | 485 case COP1_ADD: { |
| 486 Format(instr, "add.'fmt 'fd, 'fs, 'ft"); | 486 Format(instr, "add.'fmt 'fd, 'fs, 'ft"); |
| 487 break; | 487 break; |
| 488 } | 488 } |
| 489 case COP1_SUB: { |
| 490 Format(instr, "sub.'fmt 'fd, 'fs, 'ft"); |
| 491 break; |
| 492 } |
| 493 case COP1_MUL: { |
| 494 Format(instr, "mul.'fmt 'fd, 'fs, 'ft"); |
| 495 break; |
| 496 } |
| 497 case COP1_DIV: { |
| 498 Format(instr, "div.'fmt 'fd, 'fs, 'ft"); |
| 499 break; |
| 500 } |
| 501 case COP1_SQRT: { |
| 502 Format(instr, "sqrt.'fmt 'fd, 'fs"); |
| 503 break; |
| 504 } |
| 489 case COP1_MOV: { | 505 case COP1_MOV: { |
| 490 Format(instr, "mov.'fmt 'fd, 'fs"); | 506 Format(instr, "mov.'fmt 'fd, 'fs"); |
| 491 break; | 507 break; |
| 492 } | 508 } |
| 493 case COP1_C_F: { | 509 case COP1_C_F: { |
| 494 Format(instr, "c.f.'fmt 'fd, 'fs"); | 510 Format(instr, "c.f.'fmt 'fd, 'fs"); |
| 495 break; | 511 break; |
| 496 } | 512 } |
| 497 case COP1_C_UN: { | 513 case COP1_C_UN: { |
| 498 Format(instr, "c.un.'fmt 'fd, 'fs"); | 514 Format(instr, "c.un.'fmt 'fd, 'fs"); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 519 break; | 535 break; |
| 520 } | 536 } |
| 521 case COP1_C_ULE: { | 537 case COP1_C_ULE: { |
| 522 Format(instr, "c.ule.'fmt 'fd, 'fs"); | 538 Format(instr, "c.ule.'fmt 'fd, 'fs"); |
| 523 break; | 539 break; |
| 524 } | 540 } |
| 525 case COP1_CVT_D: { | 541 case COP1_CVT_D: { |
| 526 Format(instr, "cvt.d.'fmt 'fd, 'fs"); | 542 Format(instr, "cvt.d.'fmt 'fd, 'fs"); |
| 527 break; | 543 break; |
| 528 } | 544 } |
| 545 case COP1_CVT_W: { |
| 546 Format(instr, "cvt.w.'fmt 'fd, 'fs"); |
| 547 break; |
| 548 } |
| 529 default: { | 549 default: { |
| 530 Unknown(instr); | 550 Unknown(instr); |
| 531 break; | 551 break; |
| 532 } | 552 } |
| 533 } | 553 } |
| 534 } else { | 554 } else { |
| 535 // If the rs field isn't a valid format, then it must be a sub-opcode. | 555 // If the rs field isn't a valid format, then it must be a sub-opcode. |
| 536 switch (instr->Cop1SubField()) { | 556 switch (instr->Cop1SubField()) { |
| 537 case COP1_MF: { | 557 case COP1_MF: { |
| 538 if (instr->Bits(0, 11) != 0) { | 558 if (instr->Bits(0, 11) != 0) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 pc); | 756 pc); |
| 737 pc += instruction_length; | 757 pc += instruction_length; |
| 738 } | 758 } |
| 739 | 759 |
| 740 return; | 760 return; |
| 741 } | 761 } |
| 742 | 762 |
| 743 } // namespace dart | 763 } // namespace dart |
| 744 | 764 |
| 745 #endif // defined TARGET_ARCH_MIPS | 765 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |