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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (!DisassembleAndCompare(progcounter, compare_string)) failure = true; \ | 83 if (!DisassembleAndCompare(progcounter, compare_string)) failure = true; \ |
84 } | 84 } |
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 // tests only seleqz, selnez, seleqz.fmt and selnez.fmt | |
94 TEST(Type1) { | |
95 SET_UP(); | |
96 if (IsMipsArchVariant(kMips32r6)) { | |
97 COMPARE(seleqz(a0, a1, a2), "00853035 seleqz a0, a1, a2"); | |
98 COMPARE(selnez(a0, a1, a2), "00853037 selnez a0, a1, a2"); | |
99 | |
100 COMPARE(seleqz(S, f0, f1, f2), "45000894 seleqz.S f0, f1, f2"); | |
101 COMPARE(selnez(S, f0, f1, f2), "45000897 selnez.S f0, f1, f2"); | |
102 COMPARE(seleqz(D, f3, f4, f5), "00853035 seleqz.D f3, f4, f5"); | |
103 COMPARE(selnez(D, f3, f4, f5), "00853037 selnez.D f3, f4, f5"); | |
104 } | |
105 VERIFY_RUN(); | |
106 } | |
107 | 93 |
108 | 94 |
109 TEST(Type0) { | 95 TEST(Type0) { |
110 SET_UP(); | 96 SET_UP(); |
111 | 97 |
112 COMPARE(addu(a0, a1, a2), | 98 COMPARE(addu(a0, a1, a2), |
113 "00a62021 addu a0, a1, a2"); | 99 "00a62021 addu a0, a1, a2"); |
114 COMPARE(addu(t2, t3, t4), | 100 COMPARE(addu(t2, t3, t4), |
115 "016c5021 addu t2, t3, t4"); | 101 "016c5021 addu t2, t3, t4"); |
116 COMPARE(addu(v0, v1, s0), | 102 COMPARE(addu(v0, v1, s0), |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 COMPARE(ext_(a0, a1, 31, 1), | 516 COMPARE(ext_(a0, a1, 31, 1), |
531 "7ca407c0 ext a0, a1, 31, 1"); | 517 "7ca407c0 ext a0, a1, 31, 1"); |
532 COMPARE(ext_(s6, s7, 30, 2), | 518 COMPARE(ext_(s6, s7, 30, 2), |
533 "7ef60f80 ext s6, s7, 30, 2"); | 519 "7ef60f80 ext s6, s7, 30, 2"); |
534 COMPARE(ext_(v0, v1, 0, 32), | 520 COMPARE(ext_(v0, v1, 0, 32), |
535 "7c62f800 ext v0, v1, 0, 32"); | 521 "7c62f800 ext v0, v1, 0, 32"); |
536 } | 522 } |
537 | 523 |
538 VERIFY_RUN(); | 524 VERIFY_RUN(); |
539 } | 525 } |
| 526 |
| 527 |
| 528 // Tests only seleqz, selnez, seleqz.fmt and selnez.fmt |
| 529 TEST(Type1) { |
| 530 if (IsMipsArchVariant(kMips32r6)) { |
| 531 SET_UP(); |
| 532 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); |
| 533 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); |
| 534 |
| 535 |
| 536 COMPARE(seleqz(D, f3, f4, f5), "462520d4 seleqz.d f3, f4, f5"); |
| 537 COMPARE(selnez(D, f3, f4, f5), "462520d7 selnez.d f3, f4, f5"); |
| 538 |
| 539 COMPARE(min(D, f3, f4, f5), "462520dc min.d f3, f4, f5"); |
| 540 COMPARE(max(D, f3, f4, f5), "462520de max.d f3, f4, f5"); |
| 541 VERIFY_RUN(); |
| 542 } |
| 543 } |
OLD | NEW |