Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: test/cctest/test-disasm-mips64.cc

Issue 1195793002: MIPS: Implemented PC-relative instructions for R6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-disasm-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 "d88fffff beqzc a0, 0xfffff"); 304 "d88fffff beqzc a0, 0xfffff");
305 COMPARE(beqzc(a0, 0x100000), // 0x100000 == -1048576. 305 COMPARE(beqzc(a0, 0x100000), // 0x100000 == -1048576.
306 "d8900000 beqzc a0, 0x100000"); 306 "d8900000 beqzc a0, 0x100000");
307 307
308 COMPARE(bnezc(a0, 0), 308 COMPARE(bnezc(a0, 0),
309 "f8800000 bnezc a0, 0x0"); 309 "f8800000 bnezc a0, 0x0");
310 COMPARE(bnezc(a0, 0xfffff), // 0x0fffff == 1048575. 310 COMPARE(bnezc(a0, 0xfffff), // 0x0fffff == 1048575.
311 "f88fffff bnezc a0, 0xfffff"); 311 "f88fffff bnezc a0, 0xfffff");
312 COMPARE(bnezc(a0, 0x100000), // 0x100000 == -1048576. 312 COMPARE(bnezc(a0, 0x100000), // 0x100000 == -1048576.
313 "f8900000 bnezc a0, 0x100000"); 313 "f8900000 bnezc a0, 0x100000");
314
315 COMPARE(bc(-33554432), "ca000000 bc -33554432");
316 COMPARE(bc(-1), "cbffffff bc -1");
317 COMPARE(bc(0), "c8000000 bc 0");
318 COMPARE(bc(1), "c8000001 bc 1");
319 COMPARE(bc(33554431), "c9ffffff bc 33554431");
320
321 COMPARE(balc(-33554432), "ea000000 balc -33554432");
322 COMPARE(balc(-1), "ebffffff balc -1");
323 COMPARE(balc(0), "e8000000 balc 0");
324 COMPARE(balc(1), "e8000001 balc 1");
325 COMPARE(balc(33554431), "e9ffffff balc 33554431");
314 } 326 }
315 327
316 COMPARE(addiu(a0, a1, 0x0), 328 COMPARE(addiu(a0, a1, 0x0),
317 "24a40000 addiu a0, a1, 0"); 329 "24a40000 addiu a0, a1, 0");
318 COMPARE(addiu(s0, s1, 32767), 330 COMPARE(addiu(s0, s1, 32767),
319 "26307fff addiu s0, s1, 32767"); 331 "26307fff addiu s0, s1, 32767");
320 COMPARE(addiu(a6, a7, -32768), 332 COMPARE(addiu(a6, a7, -32768),
321 "256a8000 addiu a6, a7, -32768"); 333 "256a8000 addiu a6, a7, -32768");
322 COMPARE(addiu(v0, v1, -1), 334 COMPARE(addiu(v0, v1, -1),
323 "2462ffff addiu v0, v1, -1"); 335 "2462ffff addiu v0, v1, -1");
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 COMPARE(dbitswap(a0, a1), "7c052024 dbitswap a0, a1"); 690 COMPARE(dbitswap(a0, a1), "7c052024 dbitswap a0, a1");
679 COMPARE(dbitswap(t8, s0), "7c10c024 dbitswap t8, s0"); 691 COMPARE(dbitswap(t8, s0), "7c10c024 dbitswap t8, s0");
680 } 692 }
681 693
682 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8"); 694 COMPARE(abs_s(f6, f8), "46004185 abs.s f6, f8");
683 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12"); 695 COMPARE(abs_d(f10, f12), "46206285 abs.d f10, f12");
684 696
685 COMPARE(div_s(f2, f4, f6), "46062083 div.s f2, f4, f6"); 697 COMPARE(div_s(f2, f4, f6), "46062083 div.s f2, f4, f6");
686 COMPARE(div_d(f2, f4, f6), "46262083 div.d f2, f4, f6"); 698 COMPARE(div_d(f2, f4, f6), "46262083 div.d f2, f4, f6");
687 699
700 if (kArchVariant == kMips64r6) {
701 COMPARE(align(v0, a0, a1, 0), "7c851220 align v0, a0, a1, 0");
702 COMPARE(align(v0, a0, a1, 1), "7c851260 align v0, a0, a1, 1");
703 COMPARE(align(v0, a0, a1, 2), "7c8512a0 align v0, a0, a1, 2");
704 COMPARE(align(v0, a0, a1, 3), "7c8512e0 align v0, a0, a1, 3");
705 }
706
707 if (kArchVariant == kMips64r6) {
708 COMPARE(dalign(v0, a0, a1, 0), "7c851224 dalign v0, a0, a1, 0");
709 COMPARE(dalign(v0, a0, a1, 1), "7c851264 dalign v0, a0, a1, 1");
710 COMPARE(dalign(v0, a0, a1, 2), "7c8512a4 dalign v0, a0, a1, 2");
711 COMPARE(dalign(v0, a0, a1, 3), "7c8512e4 dalign v0, a0, a1, 3");
712 COMPARE(dalign(v0, a0, a1, 4), "7c851324 dalign v0, a0, a1, 4");
713 COMPARE(dalign(v0, a0, a1, 5), "7c851364 dalign v0, a0, a1, 5");
714 COMPARE(dalign(v0, a0, a1, 6), "7c8513a4 dalign v0, a0, a1, 6");
715 COMPARE(dalign(v0, a0, a1, 7), "7c8513e4 dalign v0, a0, a1, 7");
716 }
717
718 if (kArchVariant == kMips64r6) {
719 COMPARE(aluipc(v0, 0), "ec5f0000 aluipc v0, 0");
720 COMPARE(aluipc(v0, 1), "ec5f0001 aluipc v0, 1");
721 COMPARE(aluipc(v0, 32767), "ec5f7fff aluipc v0, 32767");
722 COMPARE(aluipc(v0, -32768), "ec5f8000 aluipc v0, -32768");
723 COMPARE(aluipc(v0, -1), "ec5fffff aluipc v0, -1");
724 }
725
726 if (kArchVariant == kMips64r6) {
727 COMPARE(auipc(t8, 0), "ef1e0000 auipc t8, 0");
728 COMPARE(auipc(t8, 1), "ef1e0001 auipc t8, 1");
729 COMPARE(auipc(t8, 32767), "ef1e7fff auipc t8, 32767");
730 COMPARE(auipc(t8, -32768), "ef1e8000 auipc t8, -32768");
731 COMPARE(auipc(t8, -1), "ef1effff auipc t8, -1");
732 }
733
734 if (kArchVariant == kMips64r6) {
735 COMPARE(lwpc(a5, 0), "ed280000 lwpc a5, 0");
736 COMPARE(lwpc(a5, 4), "ed280004 lwpc a5, 4");
737 COMPARE(lwpc(a5, -4), "ed2ffffc lwpc a5, -4");
738 }
739
740 if (kArchVariant == kMips64r6) {
741 COMPARE(lwupc(a0, -262144), "ec940000 lwupc a0, -262144");
742 COMPARE(lwupc(a0, -1), "ec97ffff lwupc a0, -1");
743 COMPARE(lwupc(a0, 0), "ec900000 lwupc a0, 0");
744 COMPARE(lwupc(a0, 1), "ec900001 lwupc a0, 1");
745 COMPARE(lwupc(a0, 262143), "ec93ffff lwupc a0, 262143");
746 }
747
748 if (kArchVariant == kMips64r6) {
749 COMPARE(jic(t0, 16), "d80c0010 jic t0, 16");
750 COMPARE(jic(t0, 4), "d80c0004 jic t0, 4");
751 COMPARE(jic(t0, -32), "d80cffe0 jic t0, -32");
752 }
753
754 if (kArchVariant == kMips64r6) {
755 COMPARE(beqzc(a0, 16), "d8800010 beqzc a0, 0x10");
756 COMPARE(beqzc(a0, 4), "d8800004 beqzc a0, 0x4");
757 COMPARE(beqzc(a0, -32), "d89fffe0 beqzc a0, 0x1fffe0");
758 }
759
760 if (kArchVariant == kMips64r6) {
761 COMPARE(ldpc(v0, 256), "ec580100 ldpc v0, 256");
762 COMPARE(ldpc(a0, -1), "ec9bffff ldpc a0, -1");
763 COMPARE(ldpc(a1, 0), "ecb80000 ldpc a1, 0");
764 }
765
766 if (kArchVariant == kMips64r6) {
767 COMPARE(addiupc(a0, 262143), "ec83ffff addiupc a0, 262143");
768 COMPARE(addiupc(a0, -1), "ec87ffff addiupc a0, -1");
769 COMPARE(addiupc(v0, 0), "ec400000 addiupc v0, 0");
770 COMPARE(addiupc(s1, 1), "ee200001 addiupc s1, 1");
771 COMPARE(addiupc(a0, -262144), "ec840000 addiupc a0, -262144");
772 }
773
774 if (kArchVariant == kMips64r6) {
775 COMPARE(jialc(a0, -32768), "f8048000 jialc a0, 0x8000");
776 COMPARE(jialc(a0, -1), "f804ffff jialc a0, 0xffff");
777 COMPARE(jialc(v0, 0), "f8020000 jialc v0, 0x0");
778 COMPARE(jialc(s1, 1), "f8110001 jialc s1, 0x1");
779 COMPARE(jialc(a0, 32767), "f8047fff jialc a0, 0x7fff");
780 }
781
688 VERIFY_RUN(); 782 VERIFY_RUN();
689 } 783 }
690 784
691 785
692 TEST(Type1) { 786 TEST(Type1) {
693 SET_UP(); 787 SET_UP();
694 if (kArchVariant == kMips64r6) { 788 if (kArchVariant == kMips64r6) {
695 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2"); 789 COMPARE(seleqz(a0, a1, a2), "00a62035 seleqz a0, a1, a2");
696 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2"); 790 COMPARE(selnez(a0, a1, a2), "00a62037 selnez a0, a1, a2");
697 791
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); 979 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24");
886 if (kArchVariant == kMips64r6 || kArchVariant == kMips64r2) { 980 if (kArchVariant == kMips64r6 || kArchVariant == kMips64r2) {
887 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); 981 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24");
888 } 982 }
889 983
890 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); 984 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24");
891 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); 985 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24");
892 986
893 VERIFY_RUN(); 987 VERIFY_RUN();
894 } 988 }
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698