| 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/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 ASSEMBLER_TEST_RUN(VstmsVldms1, test) { | 1293 ASSEMBLER_TEST_RUN(VstmsVldms1, test) { |
| 1294 EXPECT(test != NULL); | 1294 EXPECT(test != NULL); |
| 1295 typedef int (*Tst)(); | 1295 typedef int (*Tst)(); |
| 1296 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1296 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 | 1299 |
| 1300 // Make sure we can store the D registers using vstmd and | 1300 // Make sure we can store the D registers using vstmd and |
| 1301 // load them into a different set using vldmd | 1301 // load them into a different set using vldmd |
| 1302 ASSEMBLER_TEST_GENERATE(VstmdVldmd_off, assembler) { | 1302 ASSEMBLER_TEST_GENERATE(VstmdVldmd_off, assembler) { |
| 1303 // Save used callee-saved FPU registers. |
| 1304 __ vstmd(DB_W, SP, D8, 3); |
| 1303 __ LoadDImmediate(D0, 0.0, R0); | 1305 __ LoadDImmediate(D0, 0.0, R0); |
| 1304 __ LoadDImmediate(D1, 1.0, R0); | 1306 __ LoadDImmediate(D1, 1.0, R0); |
| 1305 __ LoadDImmediate(D2, 2.0, R0); | 1307 __ LoadDImmediate(D2, 2.0, R0); |
| 1306 __ LoadDImmediate(D3, 3.0, R0); | 1308 __ LoadDImmediate(D3, 3.0, R0); |
| 1307 __ LoadDImmediate(D4, 4.0, R0); | 1309 __ LoadDImmediate(D4, 4.0, R0); |
| 1308 __ LoadDImmediate(D5, 5.0, R0); | 1310 __ LoadDImmediate(D5, 5.0, R0); |
| 1309 __ vstmd(DB_W, SP, D0, 5); // Push D0 - D4 onto the stack, dec SP | 1311 __ vstmd(DB_W, SP, D0, 5); // Push D0 - D4 onto the stack, dec SP |
| 1310 __ vldmd(IA_W, SP, D5, 5); // Pop stack into D5 - D9, inc SP | 1312 __ vldmd(IA_W, SP, D5, 5); // Pop stack into D5 - D9, inc SP |
| 1311 | 1313 |
| 1312 // Load success value into R0 | 1314 // Load success value into R0 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1336 __ vcmpd(D6, D10); | 1338 __ vcmpd(D6, D10); |
| 1337 __ vmstat(); | 1339 __ vmstat(); |
| 1338 __ mov(R0, ShifterOperand(0), NE); // Put failure into R0 if NE | 1340 __ mov(R0, ShifterOperand(0), NE); // Put failure into R0 if NE |
| 1339 | 1341 |
| 1340 // Check that 0.0 is in D5 | 1342 // Check that 0.0 is in D5 |
| 1341 __ LoadDImmediate(D10, 0.0, R1); | 1343 __ LoadDImmediate(D10, 0.0, R1); |
| 1342 __ vcmpd(D5, D10); | 1344 __ vcmpd(D5, D10); |
| 1343 __ vmstat(); | 1345 __ vmstat(); |
| 1344 __ mov(R0, ShifterOperand(0), NE); // Put failure into R0 if NE | 1346 __ mov(R0, ShifterOperand(0), NE); // Put failure into R0 if NE |
| 1345 | 1347 |
| 1348 // Restore used callee-saved FPU registers. |
| 1349 __ vldmd(IA_W, SP, D8, 3); |
| 1346 __ bx(LR); | 1350 __ bx(LR); |
| 1347 } | 1351 } |
| 1348 | 1352 |
| 1349 | 1353 |
| 1350 ASSEMBLER_TEST_RUN(VstmdVldmd_off, test) { | 1354 ASSEMBLER_TEST_RUN(VstmdVldmd_off, test) { |
| 1351 EXPECT(test != NULL); | 1355 EXPECT(test != NULL); |
| 1352 typedef int (*Tst)(); | 1356 typedef int (*Tst)(); |
| 1353 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1357 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1354 } | 1358 } |
| 1355 | 1359 |
| (...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3536 __ StoreIntoObject(R2, | 3540 __ StoreIntoObject(R2, |
| 3537 FieldAddress(R2, GrowableObjectArray::data_offset()), | 3541 FieldAddress(R2, GrowableObjectArray::data_offset()), |
| 3538 R1); | 3542 R1); |
| 3539 __ PopList((1 << CTX) | (1 << LR)); | 3543 __ PopList((1 << CTX) | (1 << LR)); |
| 3540 __ Ret(); | 3544 __ Ret(); |
| 3541 } | 3545 } |
| 3542 | 3546 |
| 3543 } // namespace dart | 3547 } // namespace dart |
| 3544 | 3548 |
| 3545 #endif // defined TARGET_ARCH_ARM | 3549 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |