OLD | NEW |
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/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/os.h" | 10 #include "vm/os.h" |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 } | 676 } |
677 | 677 |
678 | 678 |
679 ASSEMBLER_TEST_RUN(AddSub, test) { | 679 ASSEMBLER_TEST_RUN(AddSub, test) { |
680 EXPECT(test != NULL); | 680 EXPECT(test != NULL); |
681 typedef int (*AddSub)(); | 681 typedef int (*AddSub)(); |
682 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(AddSub, test->entry())); | 682 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(AddSub, test->entry())); |
683 } | 683 } |
684 | 684 |
685 | 685 |
| 686 ASSEMBLER_TEST_GENERATE(AddCarry, assembler) { |
| 687 __ LoadImmediate(R2, 0xFFFFFFFF); |
| 688 __ mov(R1, ShifterOperand(1)); |
| 689 __ mov(R0, ShifterOperand(0)); |
| 690 __ adds(R2, R2, ShifterOperand(R1)); |
| 691 __ adcs(R0, R0, ShifterOperand(R0)); |
| 692 __ bx(LR); |
| 693 } |
| 694 |
| 695 |
| 696 ASSEMBLER_TEST_RUN(AddCarry, test) { |
| 697 EXPECT(test != NULL); |
| 698 typedef int (*AddCarry)(); |
| 699 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT32(AddCarry, test->entry())); |
| 700 } |
| 701 |
| 702 |
| 703 ASSEMBLER_TEST_GENERATE(SubCarry, assembler) { |
| 704 __ LoadImmediate(R2, 0x0); |
| 705 __ mov(R1, ShifterOperand(1)); |
| 706 __ mov(R0, ShifterOperand(0)); |
| 707 __ subs(R2, R2, ShifterOperand(R1)); |
| 708 __ sbcs(R0, R0, ShifterOperand(R0)); |
| 709 __ bx(LR); |
| 710 } |
| 711 |
| 712 |
| 713 ASSEMBLER_TEST_RUN(SubCarry, test) { |
| 714 EXPECT(test != NULL); |
| 715 typedef int (*SubCarry)(); |
| 716 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT32(SubCarry, test->entry())); |
| 717 } |
| 718 |
| 719 |
686 ASSEMBLER_TEST_GENERATE(AndOrr, assembler) { | 720 ASSEMBLER_TEST_GENERATE(AndOrr, assembler) { |
687 __ mov(R1, ShifterOperand(40)); | 721 __ mov(R1, ShifterOperand(40)); |
688 __ mov(R2, ShifterOperand(0)); | 722 __ mov(R2, ShifterOperand(0)); |
689 __ and_(R1, R2, ShifterOperand(R1)); | 723 __ and_(R1, R2, ShifterOperand(R1)); |
690 __ mov(R3, ShifterOperand(42)); | 724 __ mov(R3, ShifterOperand(42)); |
691 __ orr(R0, R1, ShifterOperand(R3)); | 725 __ orr(R0, R1, ShifterOperand(R3)); |
692 __ bx(LR); | 726 __ bx(LR); |
693 } | 727 } |
694 | 728 |
695 | 729 |
(...skipping 3342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4038 __ StoreIntoObject(R2, | 4072 __ StoreIntoObject(R2, |
4039 FieldAddress(R2, GrowableObjectArray::data_offset()), | 4073 FieldAddress(R2, GrowableObjectArray::data_offset()), |
4040 R1); | 4074 R1); |
4041 __ PopList((1 << CTX) | (1 << LR)); | 4075 __ PopList((1 << CTX) | (1 << LR)); |
4042 __ Ret(); | 4076 __ Ret(); |
4043 } | 4077 } |
4044 | 4078 |
4045 } // namespace dart | 4079 } // namespace dart |
4046 | 4080 |
4047 #endif // defined TARGET_ARCH_ARM | 4081 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |