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

Side by Side Diff: runtime/vm/assembler_arm_test.cc

Issue 14637013: Fix ARM memory addressing mode 3 in assembler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « runtime/vm/assembler_arm.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 782
783 783
784 ASSEMBLER_TEST_RUN(Rsb, test) { 784 ASSEMBLER_TEST_RUN(Rsb, test) {
785 EXPECT(test != NULL); 785 EXPECT(test != NULL);
786 typedef int (*Rsb)(); 786 typedef int (*Rsb)();
787 EXPECT_EQ(32, EXECUTE_TEST_CODE_INT32(Rsb, test->entry())); 787 EXPECT_EQ(32, EXECUTE_TEST_CODE_INT32(Rsb, test->entry()));
788 } 788 }
789 789
790 790
791 ASSEMBLER_TEST_GENERATE(Ldrh, assembler) { 791 ASSEMBLER_TEST_GENERATE(Ldrh, assembler) {
792 Label Test1; 792 Label Test1, Test2, Test3, Done;
793 Label Test2;
794 Label Done;
795 793
796 __ mov(R1, ShifterOperand(0x11)); 794 __ mov(R1, ShifterOperand(0x11));
797 __ mov(R2, ShifterOperand(SP)); 795 __ mov(R2, ShifterOperand(SP));
798 __ str(R1, Address(SP, (-kWordSize * 30), Address::PreIndex)); 796 __ str(R1, Address(SP, (-kWordSize * 30), Address::PreIndex));
799 __ ldrh(R0, Address(R2, (-kWordSize * 30))); 797 __ ldrh(R0, Address(R2, (-kWordSize * 30)));
800 __ cmp(R0, ShifterOperand(0x11)); 798 __ cmp(R0, ShifterOperand(0x11));
801 __ b(&Test1, EQ); 799 __ b(&Test1, EQ);
802 __ mov(R0, ShifterOperand(1)); 800 __ mov(R0, ShifterOperand(1));
803 __ b(&Done); 801 __ b(&Done);
804 __ Bind(&Test1); 802 __ Bind(&Test1);
805 803
806 __ mov(R0, ShifterOperand(0)); 804 __ mov(R0, ShifterOperand(0x22));
807 __ strh(R0, Address(R2, (-kWordSize * 30))); 805 __ strh(R0, Address(R2, (-kWordSize * 30)));
808 __ ldrh(R1, Address(R2, (-kWordSize * 30))); 806 __ ldrh(R1, Address(R2, (-kWordSize * 30)));
809 __ cmp(R1, ShifterOperand(0)); 807 __ cmp(R1, ShifterOperand(0x22));
810 __ b(&Test2, EQ); 808 __ b(&Test2, EQ);
811 __ mov(R0, ShifterOperand(1)); 809 __ mov(R0, ShifterOperand(1));
812 __ b(&Done); 810 __ b(&Done);
813 __ Bind(&Test2); 811 __ Bind(&Test2);
814 812
815 __ mov(R0, ShifterOperand(0)); 813 __ mov(R0, ShifterOperand(0));
814 __ AddImmediate(R2, (-kWordSize * 30));
815 __ strh(R0, Address(R2));
816 __ ldrh(R1, Address(R2));
817 __ cmp(R1, ShifterOperand(0));
818 __ b(&Test3, EQ);
819 __ mov(R0, ShifterOperand(1));
820 __ b(&Done);
821 __ Bind(&Test3);
822
823 __ mov(R0, ShifterOperand(0));
816 __ Bind(&Done); 824 __ Bind(&Done);
817 __ ldr(R1, Address(SP, (kWordSize * 30), Address::PostIndex)); 825 __ ldr(R1, Address(SP, (kWordSize * 30), Address::PostIndex));
818 __ mov(PC, ShifterOperand(LR)); 826 __ mov(PC, ShifterOperand(LR));
819 } 827 }
820 828
821 829
822 ASSEMBLER_TEST_RUN(Ldrh, test) { 830 ASSEMBLER_TEST_RUN(Ldrh, test) {
823 EXPECT(test != NULL); 831 EXPECT(test != NULL);
824 typedef int (*Tst)(); 832 typedef int (*Tst)();
825 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 833 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 __ StoreIntoObject(R2, 1570 __ StoreIntoObject(R2,
1563 FieldAddress(R2, GrowableObjectArray::data_offset()), 1571 FieldAddress(R2, GrowableObjectArray::data_offset()),
1564 R1); 1572 R1);
1565 __ PopList((1 << CTX) | (1 << LR)); 1573 __ PopList((1 << CTX) | (1 << LR));
1566 __ Ret(); 1574 __ Ret();
1567 } 1575 }
1568 1576
1569 } // namespace dart 1577 } // namespace dart
1570 1578
1571 #endif // defined TARGET_ARCH_ARM 1579 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698