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_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 } | 1642 } |
1643 | 1643 |
1644 | 1644 |
1645 ASSEMBLER_TEST_RUN(Cop1CvtWD_neg, test) { | 1645 ASSEMBLER_TEST_RUN(Cop1CvtWD_neg, test) { |
1646 typedef int (*SimpleCode)(); | 1646 typedef int (*SimpleCode)(); |
1647 EXPECT(test != NULL); | 1647 EXPECT(test != NULL); |
1648 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry())); | 1648 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT32(SimpleCode, test->entry())); |
1649 } | 1649 } |
1650 | 1650 |
1651 | 1651 |
| 1652 ASSEMBLER_TEST_GENERATE(Cop1CvtSD, assembler) { |
| 1653 __ LoadImmediate(D2, -42.42); |
| 1654 __ cvtsd(F2, D2); |
| 1655 __ cvtds(D0, F2); |
| 1656 __ Ret(); |
| 1657 } |
| 1658 |
| 1659 |
| 1660 ASSEMBLER_TEST_RUN(Cop1CvtSD, test) { |
| 1661 typedef double (*SimpleCode)(); |
| 1662 EXPECT(test != NULL); |
| 1663 double res = EXECUTE_TEST_CODE_DOUBLE(SimpleCode, test->entry()); |
| 1664 EXPECT_FLOAT_EQ(-42.42, res, 0.001); |
| 1665 } |
| 1666 |
| 1667 |
1652 // Called from assembler_test.cc. | 1668 // Called from assembler_test.cc. |
1653 // RA: return address. | 1669 // RA: return address. |
1654 // A0: context. | 1670 // A0: context. |
1655 // A1: value. | 1671 // A1: value. |
1656 // A2: growable array. | 1672 // A2: growable array. |
1657 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { | 1673 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { |
1658 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1674 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
1659 __ sw(CTX, Address(SP, 1 * kWordSize)); | 1675 __ sw(CTX, Address(SP, 1 * kWordSize)); |
1660 __ sw(RA, Address(SP, 0 * kWordSize)); | 1676 __ sw(RA, Address(SP, 0 * kWordSize)); |
1661 | 1677 |
1662 __ mov(CTX, A0); | 1678 __ mov(CTX, A0); |
1663 __ StoreIntoObject(A2, | 1679 __ StoreIntoObject(A2, |
1664 FieldAddress(A2, GrowableObjectArray::data_offset()), | 1680 FieldAddress(A2, GrowableObjectArray::data_offset()), |
1665 A1); | 1681 A1); |
1666 __ lw(RA, Address(SP, 0 * kWordSize)); | 1682 __ lw(RA, Address(SP, 0 * kWordSize)); |
1667 __ lw(CTX, Address(SP, 1 * kWordSize)); | 1683 __ lw(CTX, Address(SP, 1 * kWordSize)); |
1668 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 1684 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
1669 __ Ret(); | 1685 __ Ret(); |
1670 } | 1686 } |
1671 | 1687 |
1672 } // namespace dart | 1688 } // namespace dart |
1673 | 1689 |
1674 #endif // defined TARGET_ARCH_MIPS | 1690 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |