OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 case NEG_D: | 508 case NEG_D: |
509 Format(instr, "neg.d 'fd, 'fs"); | 509 Format(instr, "neg.d 'fd, 'fs"); |
510 break; | 510 break; |
511 case SQRT_D: | 511 case SQRT_D: |
512 Format(instr, "sqrt.d 'fd, 'fs"); | 512 Format(instr, "sqrt.d 'fd, 'fs"); |
513 break; | 513 break; |
514 case CVT_W_D: | 514 case CVT_W_D: |
515 Format(instr, "cvt.w.d 'fd, 'fs"); | 515 Format(instr, "cvt.w.d 'fd, 'fs"); |
516 break; | 516 break; |
517 case CVT_L_D: { | 517 case CVT_L_D: { |
518 if (mips32r2) { | 518 if (arch_variant == mips32r2) { |
519 Format(instr, "cvt.l.d 'fd, 'fs"); | 519 Format(instr, "cvt.l.d 'fd, 'fs"); |
520 } else { | 520 } else { |
521 Unknown(instr); | 521 Unknown(instr); |
522 } | 522 } |
523 break; | 523 break; |
524 } | 524 } |
525 case TRUNC_W_D: | 525 case TRUNC_W_D: |
526 Format(instr, "trunc.w.d 'fd, 'fs"); | 526 Format(instr, "trunc.w.d 'fd, 'fs"); |
527 break; | 527 break; |
528 case TRUNC_L_D: { | 528 case TRUNC_L_D: { |
529 if (mips32r2) { | 529 if (arch_variant == mips32r2) { |
530 Format(instr, "trunc.l.d 'fd, 'fs"); | 530 Format(instr, "trunc.l.d 'fd, 'fs"); |
531 } else { | 531 } else { |
532 Unknown(instr); | 532 Unknown(instr); |
533 } | 533 } |
534 break; | 534 break; |
535 } | 535 } |
536 case ROUND_W_D: | 536 case ROUND_W_D: |
537 Format(instr, "round.w.d 'fd, 'fs"); | 537 Format(instr, "round.w.d 'fd, 'fs"); |
538 break; | 538 break; |
539 case FLOOR_W_D: | 539 case FLOOR_W_D: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 case CVT_D_W: // Convert word to double. | 585 case CVT_D_W: // Convert word to double. |
586 Format(instr, "cvt.d.w 'fd, 'fs"); | 586 Format(instr, "cvt.d.w 'fd, 'fs"); |
587 break; | 587 break; |
588 default: | 588 default: |
589 UNREACHABLE(); | 589 UNREACHABLE(); |
590 } | 590 } |
591 break; | 591 break; |
592 case L: | 592 case L: |
593 switch (instr->FunctionFieldRaw()) { | 593 switch (instr->FunctionFieldRaw()) { |
594 case CVT_D_L: { | 594 case CVT_D_L: { |
595 if (mips32r2) { | 595 if (arch_variant == mips32r2) { |
596 Format(instr, "cvt.d.l 'fd, 'fs"); | 596 Format(instr, "cvt.d.l 'fd, 'fs"); |
597 } else { | 597 } else { |
598 Unknown(instr); | 598 Unknown(instr); |
599 } | 599 } |
600 break; | 600 break; |
601 } | 601 } |
602 case CVT_S_L: { | 602 case CVT_S_L: { |
603 if (mips32r2) { | 603 if (arch_variant == mips32r2) { |
604 Format(instr, "cvt.s.l 'fd, 'fs"); | 604 Format(instr, "cvt.s.l 'fd, 'fs"); |
605 } else { | 605 } else { |
606 Unknown(instr); | 606 Unknown(instr); |
607 } | 607 } |
608 break; | 608 break; |
609 } | 609 } |
610 default: | 610 default: |
611 UNREACHABLE(); | 611 UNREACHABLE(); |
612 } | 612 } |
613 break; | 613 break; |
(...skipping 15 matching lines...) Expand all Loading... |
629 case SLL: | 629 case SLL: |
630 if ( 0x0 == static_cast<int>(instr->InstructionBits())) | 630 if ( 0x0 == static_cast<int>(instr->InstructionBits())) |
631 Format(instr, "nop"); | 631 Format(instr, "nop"); |
632 else | 632 else |
633 Format(instr, "sll 'rd, 'rt, 'sa"); | 633 Format(instr, "sll 'rd, 'rt, 'sa"); |
634 break; | 634 break; |
635 case SRL: | 635 case SRL: |
636 if (instr->RsValue() == 0) { | 636 if (instr->RsValue() == 0) { |
637 Format(instr, "srl 'rd, 'rt, 'sa"); | 637 Format(instr, "srl 'rd, 'rt, 'sa"); |
638 } else { | 638 } else { |
639 if (mips32r2) { | 639 if (arch_variant == mips32r2) { |
640 Format(instr, "rotr 'rd, 'rt, 'sa"); | 640 Format(instr, "rotr 'rd, 'rt, 'sa"); |
641 } else { | 641 } else { |
642 Unknown(instr); | 642 Unknown(instr); |
643 } | 643 } |
644 } | 644 } |
645 break; | 645 break; |
646 case SRA: | 646 case SRA: |
647 Format(instr, "sra 'rd, 'rt, 'sa"); | 647 Format(instr, "sra 'rd, 'rt, 'sa"); |
648 break; | 648 break; |
649 case SLLV: | 649 case SLLV: |
650 Format(instr, "sllv 'rd, 'rt, 'rs"); | 650 Format(instr, "sllv 'rd, 'rt, 'rs"); |
651 break; | 651 break; |
652 case SRLV: | 652 case SRLV: |
653 if (instr->SaValue() == 0) { | 653 if (instr->SaValue() == 0) { |
654 Format(instr, "srlv 'rd, 'rt, 'rs"); | 654 Format(instr, "srlv 'rd, 'rt, 'rs"); |
655 } else { | 655 } else { |
656 if (mips32r2) { | 656 if (arch_variant == mips32r2) { |
657 Format(instr, "rotrv 'rd, 'rt, 'rs"); | 657 Format(instr, "rotrv 'rd, 'rt, 'rs"); |
658 } else { | 658 } else { |
659 Unknown(instr); | 659 Unknown(instr); |
660 } | 660 } |
661 } | 661 } |
662 break; | 662 break; |
663 case SRAV: | 663 case SRAV: |
664 Format(instr, "srav 'rd, 'rt, 'rs"); | 664 Format(instr, "srav 'rd, 'rt, 'rs"); |
665 break; | 665 break; |
666 case MFHI: | 666 case MFHI: |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 case CLZ: | 763 case CLZ: |
764 Format(instr, "clz 'rd, 'rs"); | 764 Format(instr, "clz 'rd, 'rs"); |
765 break; | 765 break; |
766 default: | 766 default: |
767 UNREACHABLE(); | 767 UNREACHABLE(); |
768 } | 768 } |
769 break; | 769 break; |
770 case SPECIAL3: | 770 case SPECIAL3: |
771 switch (instr->FunctionFieldRaw()) { | 771 switch (instr->FunctionFieldRaw()) { |
772 case INS: { | 772 case INS: { |
773 if (mips32r2) { | 773 if (arch_variant == mips32r2) { |
774 Format(instr, "ins 'rt, 'rs, 'sa, 'ss2"); | 774 Format(instr, "ins 'rt, 'rs, 'sa, 'ss2"); |
775 } else { | 775 } else { |
776 Unknown(instr); | 776 Unknown(instr); |
777 } | 777 } |
778 break; | 778 break; |
779 } | 779 } |
780 case EXT: { | 780 case EXT: { |
781 if (mips32r2) { | 781 if (arch_variant == mips32r2) { |
782 Format(instr, "ext 'rt, 'rs, 'sa, 'ss1"); | 782 Format(instr, "ext 'rt, 'rs, 'sa, 'ss1"); |
783 } else { | 783 } else { |
784 Unknown(instr); | 784 Unknown(instr); |
785 } | 785 } |
786 break; | 786 break; |
787 } | 787 } |
788 default: | 788 default: |
789 UNREACHABLE(); | 789 UNREACHABLE(); |
790 } | 790 } |
791 break; | 791 break; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1042 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1043 } | 1043 } |
1044 } | 1044 } |
1045 | 1045 |
1046 | 1046 |
1047 #undef UNSUPPORTED | 1047 #undef UNSUPPORTED |
1048 | 1048 |
1049 } // namespace disasm | 1049 } // namespace disasm |
1050 | 1050 |
1051 #endif // V8_TARGET_ARCH_MIPS | 1051 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |