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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 EXPECT_EQ(0x0000444400002222LL, EXECUTE_TEST_CODE_INT64_LL( | 1167 EXPECT_EQ(0x0000444400002222LL, EXECUTE_TEST_CODE_INT64_LL( |
1168 Tst, test->entry(), 0x0000111100000000LL, 0x0000333300002222LL)); | 1168 Tst, test->entry(), 0x0000111100000000LL, 0x0000333300002222LL)); |
1169 } | 1169 } |
1170 | 1170 |
1171 | 1171 |
1172 ASSEMBLER_TEST_GENERATE(Ldm_stm_da, assembler) { | 1172 ASSEMBLER_TEST_GENERATE(Ldm_stm_da, assembler) { |
1173 __ mov(R0, Operand(1)); | 1173 __ mov(R0, Operand(1)); |
1174 __ mov(R1, Operand(7)); | 1174 __ mov(R1, Operand(7)); |
1175 __ mov(R2, Operand(11)); | 1175 __ mov(R2, Operand(11)); |
1176 __ mov(R3, Operand(31)); | 1176 __ mov(R3, Operand(31)); |
1177 __ Push(R5); // We use R5 as accumulator. | 1177 __ Push(R9); // We use R9 as accumulator. |
1178 __ Push(R5); | 1178 __ Push(R9); |
1179 __ Push(R5); | 1179 __ Push(R9); |
1180 __ Push(R5); | 1180 __ Push(R9); |
1181 __ Push(R5); | 1181 __ Push(R9); |
1182 __ Push(R0); // Make room, so we can decrement after. | 1182 __ Push(R0); // Make room, so we can decrement after. |
1183 __ stm(DA_W, SP, (1 << R0 | 1 << R1 | 1 << R2 | 1 << R3)); | 1183 __ stm(DA_W, SP, (1 << R0 | 1 << R1 | 1 << R2 | 1 << R3)); |
1184 __ str(R2, Address(SP)); // Should be a free slot. | 1184 __ str(R2, Address(SP)); // Should be a free slot. |
1185 __ ldr(R5, Address(SP, 1 * kWordSize)); // R0. R5 = +1. | 1185 __ ldr(R9, Address(SP, 1 * kWordSize)); // R0. R9 = +1. |
1186 __ ldr(IP, Address(SP, 2 * kWordSize)); // R1. | 1186 __ ldr(IP, Address(SP, 2 * kWordSize)); // R1. |
1187 __ sub(R5, R5, Operand(IP)); // -R1. R5 = -6. | 1187 __ sub(R9, R9, Operand(IP)); // -R1. R9 = -6. |
1188 __ ldr(IP, Address(SP, 3 * kWordSize)); // R2. | 1188 __ ldr(IP, Address(SP, 3 * kWordSize)); // R2. |
1189 __ add(R5, R5, Operand(IP)); // +R2. R5 = +5. | 1189 __ add(R9, R9, Operand(IP)); // +R2. R9 = +5. |
1190 __ ldr(IP, Address(SP, 4 * kWordSize)); // R3. | 1190 __ ldr(IP, Address(SP, 4 * kWordSize)); // R3. |
1191 __ sub(R5, R5, Operand(IP)); // -R3. R5 = -26. | 1191 __ sub(R9, R9, Operand(IP)); // -R3. R9 = -26. |
1192 __ ldm(IB_W, SP, (1 << R0 | 1 << R1 | 1 << R2 | 1 << R3)); | 1192 __ ldm(IB_W, SP, (1 << R0 | 1 << R1 | 1 << R2 | 1 << R3)); |
1193 // Same operations again. But this time from the restore registers. | 1193 // Same operations again. But this time from the restore registers. |
1194 __ add(R5, R5, Operand(R0)); | 1194 __ add(R9, R9, Operand(R0)); |
1195 __ sub(R5, R5, Operand(R1)); | 1195 __ sub(R9, R9, Operand(R1)); |
1196 __ add(R5, R5, Operand(R2)); | 1196 __ add(R9, R9, Operand(R2)); |
1197 __ sub(R0, R5, Operand(R3)); // R0 = result = -52. | 1197 __ sub(R0, R9, Operand(R3)); // R0 = result = -52. |
1198 __ Pop(R1); // Remove storage slot. | 1198 __ Pop(R1); // Remove storage slot. |
1199 __ Pop(R5); // Restore R5. | 1199 __ Pop(R9); // Restore R9. |
1200 __ Pop(R5); // Restore R5. | 1200 __ Pop(R9); // Restore R9. |
1201 __ Pop(R5); // Restore R5. | 1201 __ Pop(R9); // Restore R9. |
1202 __ Pop(R5); // Restore R5. | 1202 __ Pop(R9); // Restore R9. |
1203 __ Pop(R5); // Restore R5. | 1203 __ Pop(R9); // Restore R9. |
1204 __ bx(LR); | 1204 __ bx(LR); |
1205 } | 1205 } |
1206 | 1206 |
1207 | 1207 |
1208 ASSEMBLER_TEST_RUN(Ldm_stm_da, test) { | 1208 ASSEMBLER_TEST_RUN(Ldm_stm_da, test) { |
1209 EXPECT(test != NULL); | 1209 EXPECT(test != NULL); |
1210 typedef int (*Tst)() DART_UNUSED; | 1210 typedef int (*Tst)() DART_UNUSED; |
1211 EXPECT_EQ(-52, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1211 EXPECT_EQ(-52, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
1212 } | 1212 } |
1213 | 1213 |
(...skipping 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3989 EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMinInt64))); | 3989 EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMinInt64))); |
3990 | 3990 |
3991 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); | 3991 EXPECT_EQ(-1, RANGE_OF(Bool::True().raw())); |
3992 | 3992 |
3993 #undef RANGE_OF | 3993 #undef RANGE_OF |
3994 } | 3994 } |
3995 | 3995 |
3996 } // namespace dart | 3996 } // namespace dart |
3997 | 3997 |
3998 #endif // defined TARGET_ARCH_ARM | 3998 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |