Chromium Code Reviews| 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"); |
| 233 } | 232 } |
| 234 | 233 |
| 235 COMPARE(addiu(a0, a1, 0x0), | 234 COMPARE(addiu(a0, a1, 0x0), |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 } else { | 498 } else { |
| 500 COMPARE(clz(a0, a1), | 499 COMPARE(clz(a0, a1), |
| 501 "70a42020 clz a0, a1"); | 500 "70a42020 clz a0, a1"); |
| 502 COMPARE(clz(s6, s7), | 501 COMPARE(clz(s6, s7), |
| 503 "72f6b020 clz s6, s7"); | 502 "72f6b020 clz s6, s7"); |
| 504 COMPARE(clz(v0, v1), | 503 COMPARE(clz(v0, v1), |
| 505 "70621020 clz v0, v1"); | 504 "70621020 clz v0, v1"); |
| 506 } | 505 } |
| 507 } | 506 } |
| 508 | 507 |
| 509 if (IsMipsArchVariant(kMips32r2)) { | 508 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { |
| 510 COMPARE(ins_(a0, a1, 31, 1), | 509 COMPARE(ins_(a0, a1, 31, 1), |
| 511 "7ca4ffc4 ins a0, a1, 31, 1"); | 510 "7ca4ffc4 ins a0, a1, 31, 1"); |
| 512 COMPARE(ins_(s6, s7, 30, 2), | 511 COMPARE(ins_(s6, s7, 30, 2), |
| 513 "7ef6ff84 ins s6, s7, 30, 2"); | 512 "7ef6ff84 ins s6, s7, 30, 2"); |
| 514 COMPARE(ins_(v0, v1, 0, 32), | 513 COMPARE(ins_(v0, v1, 0, 32), |
| 515 "7c62f804 ins v0, v1, 0, 32"); | 514 "7c62f804 ins v0, v1, 0, 32"); |
| 516 COMPARE(ext_(a0, a1, 31, 1), | 515 COMPARE(ext_(a0, a1, 31, 1), |
| 517 "7ca407c0 ext a0, a1, 31, 1"); | 516 "7ca407c0 ext a0, a1, 31, 1"); |
| 518 COMPARE(ext_(s6, s7, 30, 2), | 517 COMPARE(ext_(s6, s7, 30, 2), |
| 519 "7ef60f80 ext s6, s7, 30, 2"); | 518 "7ef60f80 ext s6, s7, 30, 2"); |
| 520 COMPARE(ext_(v0, v1, 0, 32), | 519 COMPARE(ext_(v0, v1, 0, 32), |
| 521 "7c62f800 ext v0, v1, 0, 32"); | 520 "7c62f800 ext v0, v1, 0, 32"); |
| 522 } | 521 } |
| 523 COMPARE(add_s(f4, f6, f8), "46083100 add.s f4, f6, f8"); | 522 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"); | 523 COMPARE(add_d(f12, f14, f16), "46307300 add.d f12, f14, f16"); |
| 525 | 524 |
| 526 if (IsMipsArchVariant(kMips32r6)) { | 525 if (IsMipsArchVariant(kMips32r6)) { |
| 527 COMPARE(bitswap(a0, a1), "7c052020 bitswap a0, a1"); | 526 COMPARE(bitswap(a0, a1), "7c052020 bitswap a0, a1"); |
| 528 COMPARE(bitswap(t8, s0), "7c10c020 bitswap t8, s0"); | 527 COMPARE(bitswap(t8, s0), "7c10c020 bitswap t8, s0"); |
| 529 } | 528 } |
| 530 | 529 |
| 531 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8"); | 530 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8"); |
| 532 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12"); | 531 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12"); |
| 533 | 532 |
| 534 COMPARE(div_s(f2, f4, f6), "46062083 div.s f2, f4, f6"); | 533 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"); | 534 COMPARE(div_d(f2, f4, f6), "46262083 div.d f2, f4, f6"); |
| 536 | 535 |
| 536 if (kArchVariant == kMips32r6) { | |
|
dusmil.imgtec
2015/06/01 09:35:27
It should be IsMipsArchVariant() as above.
ilija.pavlovic
2015/06/12 09:51:32
Done.
| |
| 537 COMPARE(align(v0, a0, a1, 0), "7c851220 align v0, a0, a1, 0"); | |
| 538 COMPARE(align(v0, a0, a1, 1), "7c851260 align v0, a0, a1, 1"); | |
| 539 COMPARE(align(v0, a0, a1, 2), "7c8512a0 align v0, a0, a1, 2"); | |
| 540 COMPARE(align(v0, a0, a1, 3), "7c8512e0 align v0, a0, a1, 3"); | |
| 541 } | |
| 542 | |
| 543 if (kArchVariant == kMips32r6) { | |
| 544 COMPARE(aluipc(v0, 0), "ec5f0000 aluipc v0, 0"); | |
| 545 COMPARE(aluipc(v0, 1), "ec5f0001 aluipc v0, 1"); | |
| 546 COMPARE(aluipc(v0, 32767), "ec5f7fff aluipc v0, 32767"); | |
| 547 COMPARE(aluipc(v0, -32768), "ec5f8000 aluipc v0, -32768"); | |
| 548 COMPARE(aluipc(v0, -1), "ec5fffff aluipc v0, -1"); | |
| 549 } | |
| 550 | |
| 551 if (kArchVariant == kMips32r6) { | |
| 552 COMPARE(lwpc(t1, 0), "ed280000 lwpc t1, 0"); | |
| 553 COMPARE(lwpc(t1, 4), "ed280004 lwpc t1, 4"); | |
| 554 COMPARE(lwpc(t1, -4), "ed2ffffc lwpc t1, -4"); | |
| 555 } | |
| 556 | |
| 557 if (kArchVariant == kMips32r6) { | |
| 558 COMPARE(jic(t0, -32768), "d8088000 jic t0, -32768"); | |
| 559 COMPARE(jic(t0, -1), "d808ffff jic t0, -1"); | |
| 560 COMPARE(jic(t0, 0), "d8080000 jic t0, 0"); | |
| 561 COMPARE(jic(t0, 4), "d8080004 jic t0, 4"); | |
| 562 COMPARE(jic(t0, 32767), "d8087fff jic t0, 32767"); | |
| 563 } | |
| 564 | |
| 565 if (kArchVariant == kMips32r6) { | |
| 566 COMPARE(addiupc(a0, 262143), "ec83ffff addiupc a0, 262143"); | |
| 567 COMPARE(addiupc(a0, -1), "ec87ffff addiupc a0, -1"); | |
| 568 COMPARE(addiupc(v0, 0), "ec400000 addiupc v0, 0"); | |
| 569 COMPARE(addiupc(s1, 1), "ee200001 addiupc s1, 1"); | |
| 570 COMPARE(addiupc(a0, -262144), "ec840000 addiupc a0, -262144"); | |
| 571 } | |
| 572 | |
| 573 if (kArchVariant == kMips32r6) { | |
| 574 COMPARE(jialc(a0, -32768), "f8048000 jialc a0, 0x8000"); | |
| 575 COMPARE(jialc(a0, -1), "f804ffff jialc a0, 0xffff"); | |
| 576 COMPARE(jialc(v0, 0), "f8020000 jialc v0, 0x0"); | |
| 577 COMPARE(jialc(s1, 1), "f8110001 jialc s1, 0x1"); | |
| 578 COMPARE(jialc(a0, 32767), "f8047fff jialc a0, 0x7fff"); | |
| 579 } | |
| 580 | |
| 537 VERIFY_RUN(); | 581 VERIFY_RUN(); |
| 538 } | 582 } |
| 539 | 583 |
| 540 | 584 |
| 541 TEST(Type1) { | 585 TEST(Type1) { |
| 542 SET_UP(); | 586 SET_UP(); |
| 543 if (IsMipsArchVariant(kMips32r6)) { | 587 if (IsMipsArchVariant(kMips32r6)) { |
| 544 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); | 588 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); |
| 545 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); | 589 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); |
| 546 | 590 |
| (...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"); | 779 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
| 736 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { | 780 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { |
| 737 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); | 781 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); |
| 738 } | 782 } |
| 739 | 783 |
| 740 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); | 784 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"); | 785 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
| 742 | 786 |
| 743 VERIFY_RUN(); | 787 VERIFY_RUN(); |
| 744 } | 788 } |
| OLD | NEW |