OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 "7ef6ff84 ins s6, s7, 30, 2"); | 513 "7ef6ff84 ins s6, s7, 30, 2"); |
514 COMPARE(ins_(v0, v1, 0, 32), | 514 COMPARE(ins_(v0, v1, 0, 32), |
515 "7c62f804 ins v0, v1, 0, 32"); | 515 "7c62f804 ins v0, v1, 0, 32"); |
516 COMPARE(ext_(a0, a1, 31, 1), | 516 COMPARE(ext_(a0, a1, 31, 1), |
517 "7ca407c0 ext a0, a1, 31, 1"); | 517 "7ca407c0 ext a0, a1, 31, 1"); |
518 COMPARE(ext_(s6, s7, 30, 2), | 518 COMPARE(ext_(s6, s7, 30, 2), |
519 "7ef60f80 ext s6, s7, 30, 2"); | 519 "7ef60f80 ext s6, s7, 30, 2"); |
520 COMPARE(ext_(v0, v1, 0, 32), | 520 COMPARE(ext_(v0, v1, 0, 32), |
521 "7c62f800 ext v0, v1, 0, 32"); | 521 "7c62f800 ext v0, v1, 0, 32"); |
522 } | 522 } |
| 523 COMPARE(add_s(f4, f6, f8), "46083100 add.s f4, f6, f8"); |
| 524 COMPARE(add_d(f12, f14, f16), "46307300 add.d f12, f14, f16"); |
| 525 |
| 526 if (IsMipsArchVariant(kMips32r6)) { |
| 527 COMPARE(bitswap(a0, a1), "7c052020 bitswap a0, a1"); |
| 528 COMPARE(bitswap(t8, s0), "7c10c020 bitswap t8, s0"); |
| 529 } |
| 530 |
| 531 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8"); |
| 532 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12"); |
| 533 |
| 534 COMPARE(div_s(f2, f4, f6), "46062083 div.s f2, f4, f6"); |
| 535 COMPARE(div_d(f2, f4, f6), "46262083 div.d f2, f4, f6"); |
523 | 536 |
524 VERIFY_RUN(); | 537 VERIFY_RUN(); |
525 } | 538 } |
526 | 539 |
527 | 540 |
528 TEST(Type1) { | 541 TEST(Type1) { |
529 SET_UP(); | 542 SET_UP(); |
530 if (IsMipsArchVariant(kMips32r6)) { | 543 if (IsMipsArchVariant(kMips32r6)) { |
531 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); | 544 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); |
532 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); | 545 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 COMPARE(movt_d(f6, f4, 4), "46312191 movt.d f6, f4, cc(1)"); | 622 COMPARE(movt_d(f6, f4, 4), "46312191 movt.d f6, f4, cc(1)"); |
610 | 623 |
611 COMPARE(movf_s(f6, f4, 4), "46102191 movf.s f6, f4, cc(1)"); | 624 COMPARE(movf_s(f6, f4, 4), "46102191 movf.s f6, f4, cc(1)"); |
612 COMPARE(movf_d(f6, f4, 4), "46302191 movf.d f6, f4, cc(1)"); | 625 COMPARE(movf_d(f6, f4, 4), "46302191 movf.d f6, f4, cc(1)"); |
613 | 626 |
614 COMPARE(movn_s(f6, f4, t0), "46082193 movn.s f6, f4, t0"); | 627 COMPARE(movn_s(f6, f4, t0), "46082193 movn.s f6, f4, t0"); |
615 COMPARE(movn_d(f6, f4, t0), "46282193 movn.d f6, f4, t0"); | 628 COMPARE(movn_d(f6, f4, t0), "46282193 movn.d f6, f4, t0"); |
616 } | 629 } |
617 VERIFY_RUN(); | 630 VERIFY_RUN(); |
618 } | 631 } |
| 632 |
| 633 |
| 634 TEST(Type2) { |
| 635 if (IsMipsArchVariant(kMips32r6)) { |
| 636 SET_UP(); |
| 637 |
| 638 COMPARE(class_s(f3, f4), "460020db class.s f3, f4"); |
| 639 COMPARE(class_d(f2, f3), "4620189b class.d f2, f3"); |
| 640 |
| 641 VERIFY_RUN(); |
| 642 } |
| 643 } |
| 644 |
| 645 |
| 646 TEST(C_FMT_DISASM) { |
| 647 if (IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kMips32r2)) { |
| 648 SET_UP(); |
| 649 |
| 650 COMPARE(c_s(F, f8, f10, 0), "460a4030 c.f.s f8, f10, cc(0)"); |
| 651 COMPARE(c_d(F, f8, f10, 0), "462a4030 c.f.d f8, f10, cc(0)"); |
| 652 |
| 653 COMPARE(c_s(UN, f8, f10, 2), "460a4231 c.un.s f8, f10, cc(2)"); |
| 654 COMPARE(c_d(UN, f8, f10, 2), "462a4231 c.un.d f8, f10, cc(2)"); |
| 655 |
| 656 COMPARE(c_s(EQ, f8, f10, 4), "460a4432 c.eq.s f8, f10, cc(4)"); |
| 657 COMPARE(c_d(EQ, f8, f10, 4), "462a4432 c.eq.d f8, f10, cc(4)"); |
| 658 |
| 659 COMPARE(c_s(UEQ, f8, f10, 6), "460a4633 c.ueq.s f8, f10, cc(6)"); |
| 660 COMPARE(c_d(UEQ, f8, f10, 6), "462a4633 c.ueq.d f8, f10, cc(6)"); |
| 661 |
| 662 COMPARE(c_s(OLT, f8, f10, 0), "460a4034 c.olt.s f8, f10, cc(0)"); |
| 663 COMPARE(c_d(OLT, f8, f10, 0), "462a4034 c.olt.d f8, f10, cc(0)"); |
| 664 |
| 665 COMPARE(c_s(ULT, f8, f10, 2), "460a4235 c.ult.s f8, f10, cc(2)"); |
| 666 COMPARE(c_d(ULT, f8, f10, 2), "462a4235 c.ult.d f8, f10, cc(2)"); |
| 667 |
| 668 COMPARE(c_s(OLE, f8, f10, 4), "460a4436 c.ole.s f8, f10, cc(4)"); |
| 669 COMPARE(c_d(OLE, f8, f10, 4), "462a4436 c.ole.d f8, f10, cc(4)"); |
| 670 |
| 671 COMPARE(c_s(ULE, f8, f10, 6), "460a4637 c.ule.s f8, f10, cc(6)"); |
| 672 COMPARE(c_d(ULE, f8, f10, 6), "462a4637 c.ule.d f8, f10, cc(6)"); |
| 673 |
| 674 VERIFY_RUN(); |
| 675 } |
| 676 } |
| 677 |
| 678 |
| 679 TEST(COND_FMT_DISASM) { |
| 680 if (IsMipsArchVariant(kMips32r6)) { |
| 681 SET_UP(); |
| 682 |
| 683 COMPARE(cmp_s(F, f6, f8, f10), "468a4180 cmp.af.s f6, f8, f10"); |
| 684 COMPARE(cmp_d(F, f6, f8, f10), "46aa4180 cmp.af.d f6, f8, f10"); |
| 685 |
| 686 COMPARE(cmp_s(UN, f6, f8, f10), "468a4181 cmp.un.s f6, f8, f10"); |
| 687 COMPARE(cmp_d(UN, f6, f8, f10), "46aa4181 cmp.un.d f6, f8, f10"); |
| 688 |
| 689 COMPARE(cmp_s(EQ, f6, f8, f10), "468a4182 cmp.eq.s f6, f8, f10"); |
| 690 COMPARE(cmp_d(EQ, f6, f8, f10), "46aa4182 cmp.eq.d f6, f8, f10"); |
| 691 |
| 692 COMPARE(cmp_s(UEQ, f6, f8, f10), "468a4183 cmp.ueq.s f6, f8, f10"); |
| 693 COMPARE(cmp_d(UEQ, f6, f8, f10), "46aa4183 cmp.ueq.d f6, f8, f10"); |
| 694 |
| 695 COMPARE(cmp_s(LT, f6, f8, f10), "468a4184 cmp.lt.s f6, f8, f10"); |
| 696 COMPARE(cmp_d(LT, f6, f8, f10), "46aa4184 cmp.lt.d f6, f8, f10"); |
| 697 |
| 698 COMPARE(cmp_s(ULT, f6, f8, f10), "468a4185 cmp.ult.s f6, f8, f10"); |
| 699 COMPARE(cmp_d(ULT, f6, f8, f10), "46aa4185 cmp.ult.d f6, f8, f10"); |
| 700 |
| 701 COMPARE(cmp_s(LE, f6, f8, f10), "468a4186 cmp.le.s f6, f8, f10"); |
| 702 COMPARE(cmp_d(LE, f6, f8, f10), "46aa4186 cmp.le.d f6, f8, f10"); |
| 703 |
| 704 COMPARE(cmp_s(ULE, f6, f8, f10), "468a4187 cmp.ule.s f6, f8, f10"); |
| 705 COMPARE(cmp_d(ULE, f6, f8, f10), "46aa4187 cmp.ule.d f6, f8, f10"); |
| 706 |
| 707 COMPARE(cmp_s(ORD, f6, f8, f10), "468a4191 cmp.or.s f6, f8, f10"); |
| 708 COMPARE(cmp_d(ORD, f6, f8, f10), "46aa4191 cmp.or.d f6, f8, f10"); |
| 709 |
| 710 COMPARE(cmp_s(UNE, f6, f8, f10), "468a4192 cmp.une.s f6, f8, f10"); |
| 711 COMPARE(cmp_d(UNE, f6, f8, f10), "46aa4192 cmp.une.d f6, f8, f10"); |
| 712 |
| 713 COMPARE(cmp_s(NE, f6, f8, f10), "468a4193 cmp.ne.s f6, f8, f10"); |
| 714 COMPARE(cmp_d(NE, f6, f8, f10), "46aa4193 cmp.ne.d f6, f8, f10"); |
| 715 |
| 716 VERIFY_RUN(); |
| 717 } |
| 718 } |
| 719 |
| 720 |
| 721 TEST(CVT_DISSASM) { |
| 722 SET_UP(); |
| 723 COMPARE(cvt_d_s(f22, f24), "4600c5a1 cvt.d.s f22, f24"); |
| 724 COMPARE(cvt_d_w(f22, f24), "4680c5a1 cvt.d.w f22, f24"); |
| 725 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { |
| 726 COMPARE(cvt_d_l(f22, f24), "46a0c5a1 cvt.d.l f22, f24"); |
| 727 } |
| 728 |
| 729 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { |
| 730 COMPARE(cvt_l_s(f22, f24), "4600c5a5 cvt.l.s f22, f24"); |
| 731 COMPARE(cvt_l_d(f22, f24), "4620c5a5 cvt.l.d f22, f24"); |
| 732 } |
| 733 |
| 734 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); |
| 735 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
| 736 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { |
| 737 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); |
| 738 } |
| 739 |
| 740 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); |
| 741 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
| 742 |
| 743 VERIFY_RUN(); |
| 744 } |
OLD | NEW |