Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: runtime/vm/assembler_arm_test.cc

Issue 18326012: Fixes ARM assembler test for hardware. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) { 1533 ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) {
1534 #if defined(USING_SIMULATOR)
1534 bool orig = CPUFeatures::integer_division_supported(); 1535 bool orig = CPUFeatures::integer_division_supported();
1535 CPUFeatures::set_integer_division_supported(true); 1536 CPUFeatures::set_integer_division_supported(true);
1536 __ mov(R0, ShifterOperand(27)); 1537 __ mov(R0, ShifterOperand(27));
1537 __ mov(R1, ShifterOperand(9)); 1538 __ mov(R1, ShifterOperand(9));
1538 __ IntegerDivide(R0, R0, R1, D0, D1); 1539 __ IntegerDivide(R0, R0, R1, D0, D1);
1539 CPUFeatures::set_integer_division_supported(orig); 1540 CPUFeatures::set_integer_division_supported(orig);
1540 __ bx(LR); 1541 __ bx(LR);
1542 #else
1543 __ mov(R0, ShifterOperand(27));
1544 __ mov(R1, ShifterOperand(9));
1545 __ IntegerDivide(R0, R0, R1, D0, D1);
1546 __ bx(LR);
1547 #endif
1541 } 1548 }
1542 1549
1543 1550
1544 ASSEMBLER_TEST_RUN(IntDiv_supported, test) { 1551 ASSEMBLER_TEST_RUN(IntDiv_supported, test) {
1545 EXPECT(test != NULL); 1552 EXPECT(test != NULL);
1546 typedef int (*Tst)(); 1553 typedef int (*Tst)();
1547 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1554 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1548 } 1555 }
1549 1556
1550 1557
1551 ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) { 1558 ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) {
1559 #if defined(USING_SIMULATOR)
1552 bool orig = CPUFeatures::integer_division_supported(); 1560 bool orig = CPUFeatures::integer_division_supported();
1553 CPUFeatures::set_integer_division_supported(false); 1561 CPUFeatures::set_integer_division_supported(false);
1554 __ mov(R0, ShifterOperand(27)); 1562 __ mov(R0, ShifterOperand(27));
1555 __ mov(R1, ShifterOperand(9)); 1563 __ mov(R1, ShifterOperand(9));
1556 __ IntegerDivide(R0, R0, R1, D0, D1); 1564 __ IntegerDivide(R0, R0, R1, D0, D1);
1557 CPUFeatures::set_integer_division_supported(orig); 1565 CPUFeatures::set_integer_division_supported(orig);
1558 __ bx(LR); 1566 __ bx(LR);
1567 #else
1568 __ mov(R0, ShifterOperand(27));
1569 __ mov(R1, ShifterOperand(9));
1570 __ IntegerDivide(R0, R0, R1, D0, D1);
1571 __ bx(LR);
1572 #endif
1559 } 1573 }
1560 1574
1561 1575
1562 ASSEMBLER_TEST_RUN(IntDiv_unsupported, test) { 1576 ASSEMBLER_TEST_RUN(IntDiv_unsupported, test) {
1563 EXPECT(test != NULL); 1577 EXPECT(test != NULL);
1564 typedef int (*Tst)(); 1578 typedef int (*Tst)();
1565 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry())); 1579 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT32(Tst, test->entry()));
1566 } 1580 }
1567 1581
1568 1582
(...skipping 24 matching lines...) Expand all
1593 __ StoreIntoObject(R2, 1607 __ StoreIntoObject(R2,
1594 FieldAddress(R2, GrowableObjectArray::data_offset()), 1608 FieldAddress(R2, GrowableObjectArray::data_offset()),
1595 R1); 1609 R1);
1596 __ PopList((1 << CTX) | (1 << LR)); 1610 __ PopList((1 << CTX) | (1 << LR));
1597 __ Ret(); 1611 __ Ret();
1598 } 1612 }
1599 1613
1600 } // namespace dart 1614 } // namespace dart
1601 1615
1602 #endif // defined TARGET_ARCH_ARM 1616 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698