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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 | 53 |
54 ASSEMBLER_TEST_RUN(MoveRotImm, test) { | 54 ASSEMBLER_TEST_RUN(MoveRotImm, test) { |
55 EXPECT(test != NULL); | 55 EXPECT(test != NULL); |
56 typedef int (*MoveRotImm)(); | 56 typedef int (*MoveRotImm)(); |
57 EXPECT_EQ(0x30550003, EXECUTE_TEST_CODE_INT32(MoveRotImm, test->entry())); | 57 EXPECT_EQ(0x30550003, EXECUTE_TEST_CODE_INT32(MoveRotImm, test->entry())); |
58 } | 58 } |
59 | 59 |
60 | 60 |
61 ASSEMBLER_TEST_GENERATE(MovImm16, assembler) { | 61 ASSEMBLER_TEST_GENERATE(MovImm16, assembler) { |
62 __ movw(R0, 0x5678); | 62 #if defined(USING_SIMULATOR) |
63 __ movt(R0, 0x1234); | 63 // ARMv7 is the default. |
| 64 HostCPUFeatures::set_arm_version(ARMv6); |
| 65 __ LoadDecodableImmediate(R0, 0x12345678 << 1); |
| 66 HostCPUFeatures::set_arm_version(ARMv7); |
| 67 __ LoadDecodableImmediate(R1, 0x12345678); |
| 68 __ sub(R0, R0, ShifterOperand(R1)); |
64 __ bx(LR); | 69 __ bx(LR); |
| 70 #else |
| 71 __ LoadDecodableImmediate(R0, 0x12345678); |
| 72 __ bx(LR); |
| 73 #endif |
65 } | 74 } |
66 | 75 |
67 | 76 |
68 ASSEMBLER_TEST_RUN(MovImm16, test) { | 77 ASSEMBLER_TEST_RUN(MovImm16, test) { |
69 EXPECT(test != NULL); | 78 EXPECT(test != NULL); |
70 typedef int (*MovImm16)(); | 79 typedef int (*MovImm16)(); |
71 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INT32(MovImm16, test->entry())); | 80 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INT32(MovImm16, test->entry())); |
72 } | 81 } |
73 | 82 |
74 | 83 |
(...skipping 3509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3584 __ StoreIntoObject(R2, | 3593 __ StoreIntoObject(R2, |
3585 FieldAddress(R2, GrowableObjectArray::data_offset()), | 3594 FieldAddress(R2, GrowableObjectArray::data_offset()), |
3586 R1); | 3595 R1); |
3587 __ PopList((1 << CTX) | (1 << LR)); | 3596 __ PopList((1 << CTX) | (1 << LR)); |
3588 __ Ret(); | 3597 __ Ret(); |
3589 } | 3598 } |
3590 | 3599 |
3591 } // namespace dart | 3600 } // namespace dart |
3592 | 3601 |
3593 #endif // defined TARGET_ARCH_ARM | 3602 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |