| 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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 | 1523 |
| 1524 | 1524 |
| 1525 ASSEMBLER_TEST_RUN(Sdiv_corner, test) { | 1525 ASSEMBLER_TEST_RUN(Sdiv_corner, test) { |
| 1526 EXPECT(test != NULL); | 1526 EXPECT(test != NULL); |
| 1527 typedef int (*Tst)(); | 1527 typedef int (*Tst)(); |
| 1528 EXPECT_EQ(static_cast<int32_t>(0x80000000), | 1528 EXPECT_EQ(static_cast<int32_t>(0x80000000), |
| 1529 EXECUTE_TEST_CODE_INT32(Tst, test->entry())); | 1529 EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1530 } | 1530 } |
| 1531 | 1531 |
| 1532 | 1532 |
| 1533 ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) { |
| 1534 bool orig = CPUFeatures::integer_division_supported(); |
| 1535 CPUFeatures::set_integer_division_supported(true); |
| 1536 __ mov(R0, ShifterOperand(27)); |
| 1537 __ mov(R1, ShifterOperand(9)); |
| 1538 __ IntegerDivide(R0, R0, R1, D0, D1); |
| 1539 CPUFeatures::set_integer_division_supported(orig); |
| 1540 __ bx(LR); |
| 1541 } |
| 1542 |
| 1543 |
| 1544 ASSEMBLER_TEST_RUN(IntDiv_supported, test) { |
| 1545 EXPECT(test != NULL); |
| 1546 typedef int (*Tst)(); |
| 1547 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1548 } |
| 1549 |
| 1550 |
| 1551 ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) { |
| 1552 bool orig = CPUFeatures::integer_division_supported(); |
| 1553 CPUFeatures::set_integer_division_supported(false); |
| 1554 __ mov(R0, ShifterOperand(27)); |
| 1555 __ mov(R1, ShifterOperand(9)); |
| 1556 __ IntegerDivide(R0, R0, R1, D0, D1); |
| 1557 CPUFeatures::set_integer_division_supported(orig); |
| 1558 __ bx(LR); |
| 1559 } |
| 1560 |
| 1561 |
| 1562 ASSEMBLER_TEST_RUN(IntDiv_unsupported, test) { |
| 1563 EXPECT(test != NULL); |
| 1564 typedef int (*Tst)(); |
| 1565 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); |
| 1566 } |
| 1567 |
| 1568 |
| 1533 ASSEMBLER_TEST_GENERATE(Muls, assembler) { | 1569 ASSEMBLER_TEST_GENERATE(Muls, assembler) { |
| 1534 __ mov(R0, ShifterOperand(3)); | 1570 __ mov(R0, ShifterOperand(3)); |
| 1535 __ LoadImmediate(R1, -9); | 1571 __ LoadImmediate(R1, -9); |
| 1536 __ muls(R2, R0, R1); | 1572 __ muls(R2, R0, R1); |
| 1537 __ mov(R0, ShifterOperand(42), MI); | 1573 __ mov(R0, ShifterOperand(42), MI); |
| 1538 __ bx(LR); | 1574 __ bx(LR); |
| 1539 } | 1575 } |
| 1540 | 1576 |
| 1541 | 1577 |
| 1542 ASSEMBLER_TEST_RUN(Muls, test) { | 1578 ASSEMBLER_TEST_RUN(Muls, test) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1557 __ StoreIntoObject(R2, | 1593 __ StoreIntoObject(R2, |
| 1558 FieldAddress(R2, GrowableObjectArray::data_offset()), | 1594 FieldAddress(R2, GrowableObjectArray::data_offset()), |
| 1559 R1); | 1595 R1); |
| 1560 __ PopList((1 << CTX) | (1 << LR)); | 1596 __ PopList((1 << CTX) | (1 << LR)); |
| 1561 __ Ret(); | 1597 __ Ret(); |
| 1562 } | 1598 } |
| 1563 | 1599 |
| 1564 } // namespace dart | 1600 } // namespace dart |
| 1565 | 1601 |
| 1566 #endif // defined TARGET_ARCH_ARM | 1602 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |