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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 COMPARE(bnvc(a0, a0, static_cast<int16_t>(0)), | 211 COMPARE(bnvc(a0, a0, static_cast<int16_t>(0)), |
212 "60840000 bnvc a0, a0, 0"); | 212 "60840000 bnvc a0, a0, 0"); |
213 COMPARE(bnvc(a1, a0, static_cast<int16_t>(0)), | 213 COMPARE(bnvc(a1, a0, static_cast<int16_t>(0)), |
214 "60a40000 bnvc a1, a0, 0"); | 214 "60a40000 bnvc a1, a0, 0"); |
215 COMPARE(bnvc(a1, a0, 32767), | 215 COMPARE(bnvc(a1, a0, 32767), |
216 "60a47fff bnvc a1, a0, 32767"); | 216 "60a47fff bnvc a1, a0, 32767"); |
217 COMPARE(bnvc(a1, a0, -32768), | 217 COMPARE(bnvc(a1, a0, -32768), |
218 "60a48000 bnvc a1, a0, -32768"); | 218 "60a48000 bnvc a1, a0, -32768"); |
219 | 219 |
220 COMPARE(beqzc(a0, 0), | 220 COMPARE(beqzc(a0, -1048576), "d8900000 beqzc a0, -1048576"); |
221 "d8800000 beqzc a0, 0x0"); | 221 COMPARE(beqzc(a0, -1), "d89fffff beqzc a0, -1"); |
222 COMPARE(beqzc(a0, 0xfffff), // 0x0fffff == 1048575. | 222 COMPARE(beqzc(a0, 0), "d8800000 beqzc a0, 0"); |
223 "d88fffff beqzc a0, 0xfffff"); | 223 COMPARE(beqzc(a0, 1), "d8800001 beqzc a0, 1"); |
224 COMPARE(beqzc(a0, 0x100000), // 0x100000 == -1048576. | 224 COMPARE(beqzc(a0, 1048575), "d88fffff beqzc a0, 1048575"); |
225 "d8900000 beqzc a0, 0x100000"); | |
226 | 225 |
227 COMPARE(bnezc(a0, 0), | 226 COMPARE(bnezc(a0, 0), |
228 "f8800000 bnezc a0, 0x0"); | 227 "f8800000 bnezc a0, 0x0"); |
229 COMPARE(bnezc(a0, 0xfffff), // 0x0fffff == 1048575. | 228 COMPARE(bnezc(a0, 0xfffff), // 0x0fffff == 1048575. |
230 "f88fffff bnezc a0, 0xfffff"); | 229 "f88fffff bnezc a0, 0xfffff"); |
231 COMPARE(bnezc(a0, 0x100000), // 0x100000 == -1048576. | 230 COMPARE(bnezc(a0, 0x100000), // 0x100000 == -1048576. |
232 "f8900000 bnezc a0, 0x100000"); | 231 "f8900000 bnezc a0, 0x100000"); |
| 232 |
| 233 COMPARE(bc(-33554432), "ca000000 bc -33554432"); |
| 234 COMPARE(bc(-1), "cbffffff bc -1"); |
| 235 COMPARE(bc(0), "c8000000 bc 0"); |
| 236 COMPARE(bc(1), "c8000001 bc 1"); |
| 237 COMPARE(bc(33554431), "c9ffffff bc 33554431"); |
| 238 |
| 239 COMPARE(balc(-33554432), "ea000000 balc -33554432"); |
| 240 COMPARE(balc(-1), "ebffffff balc -1"); |
| 241 COMPARE(balc(0), "e8000000 balc 0"); |
| 242 COMPARE(balc(1), "e8000001 balc 1"); |
| 243 COMPARE(balc(33554431), "e9ffffff balc 33554431"); |
233 } | 244 } |
234 | 245 |
235 COMPARE(addiu(a0, a1, 0x0), | 246 COMPARE(addiu(a0, a1, 0x0), |
236 "24a40000 addiu a0, a1, 0"); | 247 "24a40000 addiu a0, a1, 0"); |
237 COMPARE(addiu(s0, s1, 32767), | 248 COMPARE(addiu(s0, s1, 32767), |
238 "26307fff addiu s0, s1, 32767"); | 249 "26307fff addiu s0, s1, 32767"); |
239 COMPARE(addiu(t2, t3, -32768), | 250 COMPARE(addiu(t2, t3, -32768), |
240 "256a8000 addiu t2, t3, -32768"); | 251 "256a8000 addiu t2, t3, -32768"); |
241 COMPARE(addiu(v0, v1, -1), | 252 COMPARE(addiu(v0, v1, -1), |
242 "2462ffff addiu v0, v1, -1"); | 253 "2462ffff addiu v0, v1, -1"); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } else { | 510 } else { |
500 COMPARE(clz(a0, a1), | 511 COMPARE(clz(a0, a1), |
501 "70a42020 clz a0, a1"); | 512 "70a42020 clz a0, a1"); |
502 COMPARE(clz(s6, s7), | 513 COMPARE(clz(s6, s7), |
503 "72f6b020 clz s6, s7"); | 514 "72f6b020 clz s6, s7"); |
504 COMPARE(clz(v0, v1), | 515 COMPARE(clz(v0, v1), |
505 "70621020 clz v0, v1"); | 516 "70621020 clz v0, v1"); |
506 } | 517 } |
507 } | 518 } |
508 | 519 |
509 if (IsMipsArchVariant(kMips32r2)) { | 520 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { |
510 COMPARE(ins_(a0, a1, 31, 1), | 521 COMPARE(ins_(a0, a1, 31, 1), |
511 "7ca4ffc4 ins a0, a1, 31, 1"); | 522 "7ca4ffc4 ins a0, a1, 31, 1"); |
512 COMPARE(ins_(s6, s7, 30, 2), | 523 COMPARE(ins_(s6, s7, 30, 2), |
513 "7ef6ff84 ins s6, s7, 30, 2"); | 524 "7ef6ff84 ins s6, s7, 30, 2"); |
514 COMPARE(ins_(v0, v1, 0, 32), | 525 COMPARE(ins_(v0, v1, 0, 32), |
515 "7c62f804 ins v0, v1, 0, 32"); | 526 "7c62f804 ins v0, v1, 0, 32"); |
516 COMPARE(ext_(a0, a1, 31, 1), | 527 COMPARE(ext_(a0, a1, 31, 1), |
517 "7ca407c0 ext a0, a1, 31, 1"); | 528 "7ca407c0 ext a0, a1, 31, 1"); |
518 COMPARE(ext_(s6, s7, 30, 2), | 529 COMPARE(ext_(s6, s7, 30, 2), |
519 "7ef60f80 ext s6, s7, 30, 2"); | 530 "7ef60f80 ext s6, s7, 30, 2"); |
520 COMPARE(ext_(v0, v1, 0, 32), | 531 COMPARE(ext_(v0, v1, 0, 32), |
521 "7c62f800 ext v0, v1, 0, 32"); | 532 "7c62f800 ext v0, v1, 0, 32"); |
522 } | 533 } |
523 COMPARE(add_s(f4, f6, f8), "46083100 add.s f4, f6, f8"); | 534 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"); | 535 COMPARE(add_d(f12, f14, f16), "46307300 add.d f12, f14, f16"); |
525 | 536 |
526 if (IsMipsArchVariant(kMips32r6)) { | 537 if (IsMipsArchVariant(kMips32r6)) { |
527 COMPARE(bitswap(a0, a1), "7c052020 bitswap a0, a1"); | 538 COMPARE(bitswap(a0, a1), "7c052020 bitswap a0, a1"); |
528 COMPARE(bitswap(t8, s0), "7c10c020 bitswap t8, s0"); | 539 COMPARE(bitswap(t8, s0), "7c10c020 bitswap t8, s0"); |
529 } | 540 } |
530 | 541 |
531 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8"); | 542 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8"); |
532 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12"); | 543 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12"); |
533 | 544 |
534 COMPARE(div_s(f2, f4, f6), "46062083 div.s f2, f4, f6"); | 545 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"); | 546 COMPARE(div_d(f2, f4, f6), "46262083 div.d f2, f4, f6"); |
536 | 547 |
| 548 if (IsMipsArchVariant(kMips32r6)) { |
| 549 COMPARE(align(v0, a0, a1, 0), "7c851220 align v0, a0, a1, 0"); |
| 550 COMPARE(align(v0, a0, a1, 1), "7c851260 align v0, a0, a1, 1"); |
| 551 COMPARE(align(v0, a0, a1, 2), "7c8512a0 align v0, a0, a1, 2"); |
| 552 COMPARE(align(v0, a0, a1, 3), "7c8512e0 align v0, a0, a1, 3"); |
| 553 } |
| 554 |
| 555 if (IsMipsArchVariant(kMips32r6)) { |
| 556 COMPARE(aluipc(v0, 0), "ec5f0000 aluipc v0, 0"); |
| 557 COMPARE(aluipc(v0, 1), "ec5f0001 aluipc v0, 1"); |
| 558 COMPARE(aluipc(v0, 32767), "ec5f7fff aluipc v0, 32767"); |
| 559 COMPARE(aluipc(v0, -32768), "ec5f8000 aluipc v0, -32768"); |
| 560 COMPARE(aluipc(v0, -1), "ec5fffff aluipc v0, -1"); |
| 561 } |
| 562 |
| 563 if (IsMipsArchVariant(kMips32r6)) { |
| 564 COMPARE(auipc(t8, 0), "ef1e0000 auipc t8, 0"); |
| 565 COMPARE(auipc(t8, 1), "ef1e0001 auipc t8, 1"); |
| 566 COMPARE(auipc(t8, 32767), "ef1e7fff auipc t8, 32767"); |
| 567 COMPARE(auipc(t8, -32768), "ef1e8000 auipc t8, -32768"); |
| 568 COMPARE(auipc(t8, -1), "ef1effff auipc t8, -1"); |
| 569 } |
| 570 |
| 571 if (IsMipsArchVariant(kMips32r6)) { |
| 572 COMPARE(lwpc(t1, 0), "ed280000 lwpc t1, 0"); |
| 573 COMPARE(lwpc(t1, 4), "ed280004 lwpc t1, 4"); |
| 574 COMPARE(lwpc(t1, -4), "ed2ffffc lwpc t1, -4"); |
| 575 } |
| 576 |
| 577 if (IsMipsArchVariant(kMips32r6)) { |
| 578 COMPARE(jic(t0, -32768), "d8088000 jic t0, -32768"); |
| 579 COMPARE(jic(t0, -1), "d808ffff jic t0, -1"); |
| 580 COMPARE(jic(t0, 0), "d8080000 jic t0, 0"); |
| 581 COMPARE(jic(t0, 4), "d8080004 jic t0, 4"); |
| 582 COMPARE(jic(t0, 32767), "d8087fff jic t0, 32767"); |
| 583 } |
| 584 |
| 585 if (IsMipsArchVariant(kMips32r6)) { |
| 586 COMPARE(addiupc(a0, 262143), "ec83ffff addiupc a0, 262143"); |
| 587 COMPARE(addiupc(a0, -1), "ec87ffff addiupc a0, -1"); |
| 588 COMPARE(addiupc(v0, 0), "ec400000 addiupc v0, 0"); |
| 589 COMPARE(addiupc(s1, 1), "ee200001 addiupc s1, 1"); |
| 590 COMPARE(addiupc(a0, -262144), "ec840000 addiupc a0, -262144"); |
| 591 } |
| 592 |
| 593 if (IsMipsArchVariant(kMips32r6)) { |
| 594 COMPARE(jialc(a0, -32768), "f8048000 jialc a0, 0x8000"); |
| 595 COMPARE(jialc(a0, -1), "f804ffff jialc a0, 0xffff"); |
| 596 COMPARE(jialc(v0, 0), "f8020000 jialc v0, 0x0"); |
| 597 COMPARE(jialc(s1, 1), "f8110001 jialc s1, 0x1"); |
| 598 COMPARE(jialc(a0, 32767), "f8047fff jialc a0, 0x7fff"); |
| 599 } |
| 600 |
537 VERIFY_RUN(); | 601 VERIFY_RUN(); |
538 } | 602 } |
539 | 603 |
540 | 604 |
541 TEST(Type1) { | 605 TEST(Type1) { |
542 SET_UP(); | 606 SET_UP(); |
543 if (IsMipsArchVariant(kMips32r6)) { | 607 if (IsMipsArchVariant(kMips32r6)) { |
544 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); | 608 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); |
545 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); | 609 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); |
546 | 610 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); | 799 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
736 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { | 800 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { |
737 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); | 801 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); |
738 } | 802 } |
739 | 803 |
740 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); | 804 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"); | 805 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
742 | 806 |
743 VERIFY_RUN(); | 807 VERIFY_RUN(); |
744 } | 808 } |
OLD | NEW |