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

Side by Side Diff: test/cctest/test-assembler-arm.cc

Issue 13560007: Remove ARM support for soft float (pre-VFP2) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/v8globals.h ('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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 float f; 647 float f;
648 float g; 648 float g;
649 float h; 649 float h;
650 } F; 650 } F;
651 F f; 651 F f;
652 652
653 // Create a function that uses vldm/vstm to move some double and 653 // Create a function that uses vldm/vstm to move some double and
654 // single precision values around in memory. 654 // single precision values around in memory.
655 Assembler assm(isolate, NULL, 0); 655 Assembler assm(isolate, NULL, 0);
656 656
657 if (CpuFeatures::IsSupported(VFP2)) { 657 __ mov(ip, Operand(sp));
658 CpuFeatureScope scope(&assm, VFP2); 658 __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit());
659 __ sub(fp, ip, Operand(4));
659 660
660 __ mov(ip, Operand(sp)); 661 __ add(r4, r0, Operand(OFFSET_OF(D, a)));
661 __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); 662 __ vldm(ia_w, r4, d0, d3);
662 __ sub(fp, ip, Operand(4)); 663 __ vldm(ia_w, r4, d4, d7);
663 664
664 __ add(r4, r0, Operand(OFFSET_OF(D, a))); 665 __ add(r4, r0, Operand(OFFSET_OF(D, a)));
665 __ vldm(ia_w, r4, d0, d3); 666 __ vstm(ia_w, r4, d6, d7);
666 __ vldm(ia_w, r4, d4, d7); 667 __ vstm(ia_w, r4, d0, d5);
667 668
668 __ add(r4, r0, Operand(OFFSET_OF(D, a))); 669 __ add(r4, r1, Operand(OFFSET_OF(F, a)));
669 __ vstm(ia_w, r4, d6, d7); 670 __ vldm(ia_w, r4, s0, s3);
670 __ vstm(ia_w, r4, d0, d5); 671 __ vldm(ia_w, r4, s4, s7);
671 672
672 __ add(r4, r1, Operand(OFFSET_OF(F, a))); 673 __ add(r4, r1, Operand(OFFSET_OF(F, a)));
673 __ vldm(ia_w, r4, s0, s3); 674 __ vstm(ia_w, r4, s6, s7);
674 __ vldm(ia_w, r4, s4, s7); 675 __ vstm(ia_w, r4, s0, s5);
675 676
676 __ add(r4, r1, Operand(OFFSET_OF(F, a))); 677 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit());
677 __ vstm(ia_w, r4, s6, s7);
678 __ vstm(ia_w, r4, s0, s5);
679 678
680 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); 679 CodeDesc desc;
680 assm.GetCode(&desc);
681 Object* code = isolate->heap()->CreateCode(
682 desc,
683 Code::ComputeFlags(Code::STUB),
684 Handle<Code>())->ToObjectChecked();
685 CHECK(code->IsCode());
686 #ifdef DEBUG
687 Code::cast(code)->Print();
688 #endif
689 F4 fn = FUNCTION_CAST<F4>(Code::cast(code)->entry());
690 d.a = 1.1;
691 d.b = 2.2;
692 d.c = 3.3;
693 d.d = 4.4;
694 d.e = 5.5;
695 d.f = 6.6;
696 d.g = 7.7;
697 d.h = 8.8;
681 698
682 CodeDesc desc; 699 f.a = 1.0;
683 assm.GetCode(&desc); 700 f.b = 2.0;
684 Object* code = isolate->heap()->CreateCode( 701 f.c = 3.0;
685 desc, 702 f.d = 4.0;
686 Code::ComputeFlags(Code::STUB), 703 f.e = 5.0;
687 Handle<Code>())->ToObjectChecked(); 704 f.f = 6.0;
688 CHECK(code->IsCode()); 705 f.g = 7.0;
689 #ifdef DEBUG 706 f.h = 8.0;
690 Code::cast(code)->Print();
691 #endif
692 F4 fn = FUNCTION_CAST<F4>(Code::cast(code)->entry());
693 d.a = 1.1;
694 d.b = 2.2;
695 d.c = 3.3;
696 d.d = 4.4;
697 d.e = 5.5;
698 d.f = 6.6;
699 d.g = 7.7;
700 d.h = 8.8;
701 707
702 f.a = 1.0; 708 Object* dummy = CALL_GENERATED_CODE(fn, &d, &f, 0, 0, 0);
703 f.b = 2.0; 709 USE(dummy);
704 f.c = 3.0;
705 f.d = 4.0;
706 f.e = 5.0;
707 f.f = 6.0;
708 f.g = 7.0;
709 f.h = 8.0;
710 710
711 Object* dummy = CALL_GENERATED_CODE(fn, &d, &f, 0, 0, 0); 711 CHECK_EQ(7.7, d.a);
712 USE(dummy); 712 CHECK_EQ(8.8, d.b);
713 CHECK_EQ(1.1, d.c);
714 CHECK_EQ(2.2, d.d);
715 CHECK_EQ(3.3, d.e);
716 CHECK_EQ(4.4, d.f);
717 CHECK_EQ(5.5, d.g);
718 CHECK_EQ(6.6, d.h);
713 719
714 CHECK_EQ(7.7, d.a); 720 CHECK_EQ(7.0, f.a);
715 CHECK_EQ(8.8, d.b); 721 CHECK_EQ(8.0, f.b);
716 CHECK_EQ(1.1, d.c); 722 CHECK_EQ(1.0, f.c);
717 CHECK_EQ(2.2, d.d); 723 CHECK_EQ(2.0, f.d);
718 CHECK_EQ(3.3, d.e); 724 CHECK_EQ(3.0, f.e);
719 CHECK_EQ(4.4, d.f); 725 CHECK_EQ(4.0, f.f);
720 CHECK_EQ(5.5, d.g); 726 CHECK_EQ(5.0, f.g);
721 CHECK_EQ(6.6, d.h); 727 CHECK_EQ(6.0, f.h);
722
723 CHECK_EQ(7.0, f.a);
724 CHECK_EQ(8.0, f.b);
725 CHECK_EQ(1.0, f.c);
726 CHECK_EQ(2.0, f.d);
727 CHECK_EQ(3.0, f.e);
728 CHECK_EQ(4.0, f.f);
729 CHECK_EQ(5.0, f.g);
730 CHECK_EQ(6.0, f.h);
731 }
732 } 728 }
733 729
734 730
735 TEST(9) { 731 TEST(9) {
736 // Test VFP multi load/store with ia. 732 // Test VFP multi load/store with ia.
737 InitializeVM(); 733 InitializeVM();
738 Isolate* isolate = Isolate::Current(); 734 Isolate* isolate = Isolate::Current();
739 HandleScope scope(isolate); 735 HandleScope scope(isolate);
740 736
741 typedef struct { 737 typedef struct {
(...skipping 17 matching lines...) Expand all
759 float f; 755 float f;
760 float g; 756 float g;
761 float h; 757 float h;
762 } F; 758 } F;
763 F f; 759 F f;
764 760
765 // Create a function that uses vldm/vstm to move some double and 761 // Create a function that uses vldm/vstm to move some double and
766 // single precision values around in memory. 762 // single precision values around in memory.
767 Assembler assm(isolate, NULL, 0); 763 Assembler assm(isolate, NULL, 0);
768 764
769 if (CpuFeatures::IsSupported(VFP2)) { 765 __ mov(ip, Operand(sp));
770 CpuFeatureScope scope(&assm, VFP2); 766 __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit());
767 __ sub(fp, ip, Operand(4));
771 768
772 __ mov(ip, Operand(sp)); 769 __ add(r4, r0, Operand(OFFSET_OF(D, a)));
773 __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); 770 __ vldm(ia, r4, d0, d3);
774 __ sub(fp, ip, Operand(4)); 771 __ add(r4, r4, Operand(4 * 8));
772 __ vldm(ia, r4, d4, d7);
775 773
776 __ add(r4, r0, Operand(OFFSET_OF(D, a))); 774 __ add(r4, r0, Operand(OFFSET_OF(D, a)));
777 __ vldm(ia, r4, d0, d3); 775 __ vstm(ia, r4, d6, d7);
778 __ add(r4, r4, Operand(4 * 8)); 776 __ add(r4, r4, Operand(2 * 8));
779 __ vldm(ia, r4, d4, d7); 777 __ vstm(ia, r4, d0, d5);
780 778
781 __ add(r4, r0, Operand(OFFSET_OF(D, a))); 779 __ add(r4, r1, Operand(OFFSET_OF(F, a)));
782 __ vstm(ia, r4, d6, d7); 780 __ vldm(ia, r4, s0, s3);
783 __ add(r4, r4, Operand(2 * 8)); 781 __ add(r4, r4, Operand(4 * 4));
784 __ vstm(ia, r4, d0, d5); 782 __ vldm(ia, r4, s4, s7);
785 783
786 __ add(r4, r1, Operand(OFFSET_OF(F, a))); 784 __ add(r4, r1, Operand(OFFSET_OF(F, a)));
787 __ vldm(ia, r4, s0, s3); 785 __ vstm(ia, r4, s6, s7);
788 __ add(r4, r4, Operand(4 * 4)); 786 __ add(r4, r4, Operand(2 * 4));
789 __ vldm(ia, r4, s4, s7); 787 __ vstm(ia, r4, s0, s5);
790 788
791 __ add(r4, r1, Operand(OFFSET_OF(F, a))); 789 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit());
792 __ vstm(ia, r4, s6, s7);
793 __ add(r4, r4, Operand(2 * 4));
794 __ vstm(ia, r4, s0, s5);
795 790
796 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); 791 CodeDesc desc;
792 assm.GetCode(&desc);
793 Object* code = isolate->heap()->CreateCode(
794 desc,
795 Code::ComputeFlags(Code::STUB),
796 Handle<Code>())->ToObjectChecked();
797 CHECK(code->IsCode());
798 #ifdef DEBUG
799 Code::cast(code)->Print();
800 #endif
801 F4 fn = FUNCTION_CAST<F4>(Code::cast(code)->entry());
802 d.a = 1.1;
803 d.b = 2.2;
804 d.c = 3.3;
805 d.d = 4.4;
806 d.e = 5.5;
807 d.f = 6.6;
808 d.g = 7.7;
809 d.h = 8.8;
797 810
798 CodeDesc desc; 811 f.a = 1.0;
799 assm.GetCode(&desc); 812 f.b = 2.0;
800 Object* code = isolate->heap()->CreateCode( 813 f.c = 3.0;
801 desc, 814 f.d = 4.0;
802 Code::ComputeFlags(Code::STUB), 815 f.e = 5.0;
803 Handle<Code>())->ToObjectChecked(); 816 f.f = 6.0;
804 CHECK(code->IsCode()); 817 f.g = 7.0;
805 #ifdef DEBUG 818 f.h = 8.0;
806 Code::cast(code)->Print();
807 #endif
808 F4 fn = FUNCTION_CAST<F4>(Code::cast(code)->entry());
809 d.a = 1.1;
810 d.b = 2.2;
811 d.c = 3.3;
812 d.d = 4.4;
813 d.e = 5.5;
814 d.f = 6.6;
815 d.g = 7.7;
816 d.h = 8.8;
817 819
818 f.a = 1.0; 820 Object* dummy = CALL_GENERATED_CODE(fn, &d, &f, 0, 0, 0);
819 f.b = 2.0; 821 USE(dummy);
820 f.c = 3.0;
821 f.d = 4.0;
822 f.e = 5.0;
823 f.f = 6.0;
824 f.g = 7.0;
825 f.h = 8.0;
826 822
827 Object* dummy = CALL_GENERATED_CODE(fn, &d, &f, 0, 0, 0); 823 CHECK_EQ(7.7, d.a);
828 USE(dummy); 824 CHECK_EQ(8.8, d.b);
825 CHECK_EQ(1.1, d.c);
826 CHECK_EQ(2.2, d.d);
827 CHECK_EQ(3.3, d.e);
828 CHECK_EQ(4.4, d.f);
829 CHECK_EQ(5.5, d.g);
830 CHECK_EQ(6.6, d.h);
829 831
830 CHECK_EQ(7.7, d.a); 832 CHECK_EQ(7.0, f.a);
831 CHECK_EQ(8.8, d.b); 833 CHECK_EQ(8.0, f.b);
832 CHECK_EQ(1.1, d.c); 834 CHECK_EQ(1.0, f.c);
833 CHECK_EQ(2.2, d.d); 835 CHECK_EQ(2.0, f.d);
834 CHECK_EQ(3.3, d.e); 836 CHECK_EQ(3.0, f.e);
835 CHECK_EQ(4.4, d.f); 837 CHECK_EQ(4.0, f.f);
836 CHECK_EQ(5.5, d.g); 838 CHECK_EQ(5.0, f.g);
837 CHECK_EQ(6.6, d.h); 839 CHECK_EQ(6.0, f.h);
838
839 CHECK_EQ(7.0, f.a);
840 CHECK_EQ(8.0, f.b);
841 CHECK_EQ(1.0, f.c);
842 CHECK_EQ(2.0, f.d);
843 CHECK_EQ(3.0, f.e);
844 CHECK_EQ(4.0, f.f);
845 CHECK_EQ(5.0, f.g);
846 CHECK_EQ(6.0, f.h);
847 }
848 } 840 }
849 841
850 842
851 TEST(10) { 843 TEST(10) {
852 // Test VFP multi load/store with db_w. 844 // Test VFP multi load/store with db_w.
853 InitializeVM(); 845 InitializeVM();
854 Isolate* isolate = Isolate::Current(); 846 Isolate* isolate = Isolate::Current();
855 HandleScope scope(isolate); 847 HandleScope scope(isolate);
856 848
857 typedef struct { 849 typedef struct {
(...skipping 17 matching lines...) Expand all
875 float f; 867 float f;
876 float g; 868 float g;
877 float h; 869 float h;
878 } F; 870 } F;
879 F f; 871 F f;
880 872
881 // Create a function that uses vldm/vstm to move some double and 873 // Create a function that uses vldm/vstm to move some double and
882 // single precision values around in memory. 874 // single precision values around in memory.
883 Assembler assm(isolate, NULL, 0); 875 Assembler assm(isolate, NULL, 0);
884 876
885 if (CpuFeatures::IsSupported(VFP2)) { 877 __ mov(ip, Operand(sp));
886 CpuFeatureScope scope(&assm, VFP2); 878 __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit());
879 __ sub(fp, ip, Operand(4));
887 880
888 __ mov(ip, Operand(sp)); 881 __ add(r4, r0, Operand(OFFSET_OF(D, h) + 8));
889 __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); 882 __ vldm(db_w, r4, d4, d7);
890 __ sub(fp, ip, Operand(4)); 883 __ vldm(db_w, r4, d0, d3);
891 884
892 __ add(r4, r0, Operand(OFFSET_OF(D, h) + 8)); 885 __ add(r4, r0, Operand(OFFSET_OF(D, h) + 8));
893 __ vldm(db_w, r4, d4, d7); 886 __ vstm(db_w, r4, d0, d5);
894 __ vldm(db_w, r4, d0, d3); 887 __ vstm(db_w, r4, d6, d7);
895 888
896 __ add(r4, r0, Operand(OFFSET_OF(D, h) + 8)); 889 __ add(r4, r1, Operand(OFFSET_OF(F, h) + 4));
897 __ vstm(db_w, r4, d0, d5); 890 __ vldm(db_w, r4, s4, s7);
898 __ vstm(db_w, r4, d6, d7); 891 __ vldm(db_w, r4, s0, s3);
899 892
900 __ add(r4, r1, Operand(OFFSET_OF(F, h) + 4)); 893 __ add(r4, r1, Operand(OFFSET_OF(F, h) + 4));
901 __ vldm(db_w, r4, s4, s7); 894 __ vstm(db_w, r4, s0, s5);
902 __ vldm(db_w, r4, s0, s3); 895 __ vstm(db_w, r4, s6, s7);
903 896
904 __ add(r4, r1, Operand(OFFSET_OF(F, h) + 4)); 897 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit());
905 __ vstm(db_w, r4, s0, s5);
906 __ vstm(db_w, r4, s6, s7);
907 898
908 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); 899 CodeDesc desc;
900 assm.GetCode(&desc);
901 Object* code = isolate->heap()->CreateCode(
902 desc,
903 Code::ComputeFlags(Code::STUB),
904 Handle<Code>())->ToObjectChecked();
905 CHECK(code->IsCode());
906 #ifdef DEBUG
907 Code::cast(code)->Print();
908 #endif
909 F4 fn = FUNCTION_CAST<F4>(Code::cast(code)->entry());
910 d.a = 1.1;
911 d.b = 2.2;
912 d.c = 3.3;
913 d.d = 4.4;
914 d.e = 5.5;
915 d.f = 6.6;
916 d.g = 7.7;
917 d.h = 8.8;
909 918
910 CodeDesc desc; 919 f.a = 1.0;
911 assm.GetCode(&desc); 920 f.b = 2.0;
912 Object* code = isolate->heap()->CreateCode( 921 f.c = 3.0;
913 desc, 922 f.d = 4.0;
914 Code::ComputeFlags(Code::STUB), 923 f.e = 5.0;
915 Handle<Code>())->ToObjectChecked(); 924 f.f = 6.0;
916 CHECK(code->IsCode()); 925 f.g = 7.0;
917 #ifdef DEBUG 926 f.h = 8.0;
918 Code::cast(code)->Print();
919 #endif
920 F4 fn = FUNCTION_CAST<F4>(Code::cast(code)->entry());
921 d.a = 1.1;
922 d.b = 2.2;
923 d.c = 3.3;
924 d.d = 4.4;
925 d.e = 5.5;
926 d.f = 6.6;
927 d.g = 7.7;
928 d.h = 8.8;
929 927
930 f.a = 1.0; 928 Object* dummy = CALL_GENERATED_CODE(fn, &d, &f, 0, 0, 0);
931 f.b = 2.0; 929 USE(dummy);
932 f.c = 3.0;
933 f.d = 4.0;
934 f.e = 5.0;
935 f.f = 6.0;
936 f.g = 7.0;
937 f.h = 8.0;
938 930
939 Object* dummy = CALL_GENERATED_CODE(fn, &d, &f, 0, 0, 0); 931 CHECK_EQ(7.7, d.a);
940 USE(dummy); 932 CHECK_EQ(8.8, d.b);
933 CHECK_EQ(1.1, d.c);
934 CHECK_EQ(2.2, d.d);
935 CHECK_EQ(3.3, d.e);
936 CHECK_EQ(4.4, d.f);
937 CHECK_EQ(5.5, d.g);
938 CHECK_EQ(6.6, d.h);
941 939
942 CHECK_EQ(7.7, d.a); 940 CHECK_EQ(7.0, f.a);
943 CHECK_EQ(8.8, d.b); 941 CHECK_EQ(8.0, f.b);
944 CHECK_EQ(1.1, d.c); 942 CHECK_EQ(1.0, f.c);
945 CHECK_EQ(2.2, d.d); 943 CHECK_EQ(2.0, f.d);
946 CHECK_EQ(3.3, d.e); 944 CHECK_EQ(3.0, f.e);
947 CHECK_EQ(4.4, d.f); 945 CHECK_EQ(4.0, f.f);
948 CHECK_EQ(5.5, d.g); 946 CHECK_EQ(5.0, f.g);
949 CHECK_EQ(6.6, d.h); 947 CHECK_EQ(6.0, f.h);
950
951 CHECK_EQ(7.0, f.a);
952 CHECK_EQ(8.0, f.b);
953 CHECK_EQ(1.0, f.c);
954 CHECK_EQ(2.0, f.d);
955 CHECK_EQ(3.0, f.e);
956 CHECK_EQ(4.0, f.f);
957 CHECK_EQ(5.0, f.g);
958 CHECK_EQ(6.0, f.h);
959 }
960 } 948 }
961 949
962 950
963 TEST(11) { 951 TEST(11) {
964 // Test instructions using the carry flag. 952 // Test instructions using the carry flag.
965 InitializeVM(); 953 InitializeVM();
966 Isolate* isolate = Isolate::Current(); 954 Isolate* isolate = Isolate::Current();
967 HandleScope scope(isolate); 955 HandleScope scope(isolate);
968 956
969 typedef struct { 957 typedef struct {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 CHECK_EQ(2.75, t.x); 1141 CHECK_EQ(2.75, t.x);
1154 CHECK_EQ(1.5, t.y); 1142 CHECK_EQ(1.5, t.y);
1155 CHECK_EQ(17.0, t.z); 1143 CHECK_EQ(17.0, t.z);
1156 CHECK_EQ(14.7610017472335499, t.i); 1144 CHECK_EQ(14.7610017472335499, t.i);
1157 CHECK_EQ(16.0, t.j); 1145 CHECK_EQ(16.0, t.j);
1158 CHECK_EQ(73.8818412254460241, t.k); 1146 CHECK_EQ(73.8818412254460241, t.k);
1159 } 1147 }
1160 } 1148 }
1161 1149
1162 #undef __ 1150 #undef __
OLDNEW
« no previous file with comments | « src/v8globals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698