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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 | 86 |
87 // Verify that all invocations of the COMPARE macro passed successfully. | 87 // Verify that all invocations of the COMPARE macro passed successfully. |
88 // Exit with a failure if at least one of the tests failed. | 88 // Exit with a failure if at least one of the tests failed. |
89 #define VERIFY_RUN() \ | 89 #define VERIFY_RUN() \ |
90 if (failure) { \ | 90 if (failure) { \ |
91 V8_Fatal(__FILE__, __LINE__, "MIPS Disassembler tests failed.\n"); \ | 91 V8_Fatal(__FILE__, __LINE__, "MIPS Disassembler tests failed.\n"); \ |
92 } | 92 } |
93 | 93 |
94 | 94 |
95 TEST(Type1) { | |
96 if (kArchVariant == kMips64r6) { | |
97 SET_UP(); | |
98 COMPARE(seleqz(a0, a1, a2), "00853035 seleqz a0, a1, a2"); | |
99 COMPARE(selnez(a0, a1, a2), "00853037 selnez a0, a1, a2"); | |
100 | |
101 | |
102 COMPARE(seleqz(D, f3, f4, f5), "462428d4 seleqz.D f4, f5, f3"); | |
103 COMPARE(selnez(D, f3, f4, f5), "462428d7 selnez.D f4, f5, f3"); | |
104 | |
105 /*COMPARE(min(D, f3, f4, f5), | |
106 "462428dc min.D f4, f5, f3"); | |
107 COMPARE(max(D, f3, f4, f5), | |
108 "462428de max.D f4, f5, f3");*/ | |
109 VERIFY_RUN(); | |
110 } | |
111 } | |
112 | |
113 | |
114 TEST(Type0) { | 95 TEST(Type0) { |
115 SET_UP(); | 96 SET_UP(); |
116 | 97 |
117 COMPARE(addu(a0, a1, a2), | 98 COMPARE(addu(a0, a1, a2), |
118 "00a62021 addu a0, a1, a2"); | 99 "00a62021 addu a0, a1, a2"); |
119 COMPARE(daddu(a0, a1, a2), | 100 COMPARE(daddu(a0, a1, a2), |
120 "00a6202d daddu a0, a1, a2"); | 101 "00a6202d daddu a0, a1, a2"); |
121 COMPARE(addu(a6, a7, t0), | 102 COMPARE(addu(a6, a7, t0), |
122 "016c5021 addu a6, a7, t0"); | 103 "016c5021 addu a6, a7, t0"); |
123 COMPARE(daddu(a6, a7, t0), | 104 COMPARE(daddu(a6, a7, t0), |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 "7c62f804 ins v0, v1, 0, 32"); | 664 "7c62f804 ins v0, v1, 0, 32"); |
684 COMPARE(ext_(a0, a1, 31, 1), | 665 COMPARE(ext_(a0, a1, 31, 1), |
685 "7ca407c0 ext a0, a1, 31, 1"); | 666 "7ca407c0 ext a0, a1, 31, 1"); |
686 COMPARE(ext_(s6, s7, 30, 2), | 667 COMPARE(ext_(s6, s7, 30, 2), |
687 "7ef60f80 ext s6, s7, 30, 2"); | 668 "7ef60f80 ext s6, s7, 30, 2"); |
688 COMPARE(ext_(v0, v1, 0, 32), | 669 COMPARE(ext_(v0, v1, 0, 32), |
689 "7c62f800 ext v0, v1, 0, 32"); | 670 "7c62f800 ext v0, v1, 0, 32"); |
690 | 671 |
691 VERIFY_RUN(); | 672 VERIFY_RUN(); |
692 } | 673 } |
| 674 |
| 675 |
| 676 TEST(Type1) { |
| 677 if (kArchVariant == kMips64r6) { |
| 678 SET_UP(); |
| 679 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); |
| 680 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); |
| 681 |
| 682 |
| 683 COMPARE(seleqz(D, f3, f4, f5), "462520d4 seleqz.d f3, f4, f5"); |
| 684 COMPARE(selnez(D, f3, f4, f5), "462520d7 selnez.d f3, f4, f5"); |
| 685 |
| 686 COMPARE(min(D, f3, f4, f5), "462520dc min.d f3, f4, f5"); |
| 687 COMPARE(max(D, f3, f4, f5), "462520de max.d f3, f4, f5"); |
| 688 VERIFY_RUN(); |
| 689 } |
| 690 } |
OLD | NEW |