| 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" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 } else { | 1601 } else { |
| 1602 ASSERT(destination.IsQuadStackSlot()); | 1602 ASSERT(destination.IsQuadStackSlot()); |
| 1603 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1603 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
| 1604 const DRegister dsrc0 = EvenDRegisterOf(source.fpu_reg()); | 1604 const DRegister dsrc0 = EvenDRegisterOf(source.fpu_reg()); |
| 1605 __ StoreMultipleDToOffset(dsrc0, 2, FP, dest_offset); | 1605 __ StoreMultipleDToOffset(dsrc0, 2, FP, dest_offset); |
| 1606 } | 1606 } |
| 1607 } | 1607 } |
| 1608 } else if (source.IsDoubleStackSlot()) { | 1608 } else if (source.IsDoubleStackSlot()) { |
| 1609 if (destination.IsFpuRegister()) { | 1609 if (destination.IsFpuRegister()) { |
| 1610 const intptr_t dest_offset = source.ToStackSlotOffset(); | 1610 const intptr_t dest_offset = source.ToStackSlotOffset(); |
| 1611 DRegister dst = EvenDRegisterOf(destination.fpu_reg()); | 1611 const DRegister dst = EvenDRegisterOf(destination.fpu_reg()); |
| 1612 __ LoadDFromOffset(dst, FP, dest_offset); | 1612 __ LoadDFromOffset(dst, FP, dest_offset); |
| 1613 } else { | 1613 } else { |
| 1614 ASSERT(destination.IsDoubleStackSlot()); | 1614 ASSERT(destination.IsDoubleStackSlot()); |
| 1615 const intptr_t source_offset = source.ToStackSlotOffset(); | 1615 const intptr_t source_offset = source.ToStackSlotOffset(); |
| 1616 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1616 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
| 1617 __ LoadDFromOffset(DTMP, FP, source_offset); | 1617 __ LoadDFromOffset(DTMP, FP, source_offset); |
| 1618 __ StoreDToOffset(DTMP, FP, dest_offset); | 1618 __ StoreDToOffset(DTMP, FP, dest_offset); |
| 1619 } | 1619 } |
| 1620 } else if (source.IsQuadStackSlot()) { | 1620 } else if (source.IsQuadStackSlot()) { |
| 1621 if (destination.IsFpuRegister()) { | 1621 if (destination.IsFpuRegister()) { |
| 1622 const intptr_t dest_offset = source.ToStackSlotOffset(); | 1622 const intptr_t dest_offset = source.ToStackSlotOffset(); |
| 1623 const DRegister dst0 = EvenDRegisterOf(destination.fpu_reg()); | 1623 const DRegister dst0 = EvenDRegisterOf(destination.fpu_reg()); |
| 1624 __ LoadMultipleDFromOffset(dst0, 2, FP, dest_offset); | 1624 __ LoadMultipleDFromOffset(dst0, 2, FP, dest_offset); |
| 1625 } else { | 1625 } else { |
| 1626 ASSERT(destination.IsQuadStackSlot()); | 1626 ASSERT(destination.IsQuadStackSlot()); |
| 1627 const intptr_t source_offset = source.ToStackSlotOffset(); | 1627 const intptr_t source_offset = source.ToStackSlotOffset(); |
| 1628 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1628 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
| 1629 const DRegister dtmp0 = DTMP; | 1629 const DRegister dtmp0 = DTMP; |
| 1630 __ LoadMultipleDFromOffset(dtmp0, 2, FP, source_offset); | 1630 __ LoadMultipleDFromOffset(dtmp0, 2, FP, source_offset); |
| 1631 __ StoreMultipleDToOffset(dtmp0, 2, FP, dest_offset); | 1631 __ StoreMultipleDToOffset(dtmp0, 2, FP, dest_offset); |
| 1632 } | 1632 } |
| 1633 } else { | 1633 } else { |
| 1634 ASSERT(source.IsConstant()); | 1634 ASSERT(source.IsConstant()); |
| 1635 const Object& constant = source.constant(); |
| 1635 if (destination.IsRegister()) { | 1636 if (destination.IsRegister()) { |
| 1636 const Object& constant = source.constant(); | |
| 1637 __ LoadObject(destination.reg(), constant); | 1637 __ LoadObject(destination.reg(), constant); |
| 1638 } else if (destination.IsFpuRegister()) { |
| 1639 const DRegister dst = EvenDRegisterOf(destination.fpu_reg()); |
| 1640 __ LoadObject(TMP, constant); |
| 1641 __ AddImmediate(TMP, TMP, Double::value_offset() - kHeapObjectTag); |
| 1642 __ vldrd(dst, Address(TMP, 0)); |
| 1638 } else { | 1643 } else { |
| 1639 ASSERT(destination.IsStackSlot()); | 1644 ASSERT(destination.IsStackSlot()); |
| 1640 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1645 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
| 1641 __ LoadObject(TMP, source.constant()); | 1646 __ LoadObject(TMP, constant); |
| 1642 __ StoreToOffset(kWord, TMP, FP, dest_offset); | 1647 __ StoreToOffset(kWord, TMP, FP, dest_offset); |
| 1643 } | 1648 } |
| 1644 } | 1649 } |
| 1645 | 1650 |
| 1646 move->Eliminate(); | 1651 move->Eliminate(); |
| 1647 } | 1652 } |
| 1648 | 1653 |
| 1649 | 1654 |
| 1650 void ParallelMoveResolver::EmitSwap(int index) { | 1655 void ParallelMoveResolver::EmitSwap(int index) { |
| 1651 MoveOperands* move = moves_[index]; | 1656 MoveOperands* move = moves_[index]; |
| 1652 const Location source = move->src(); | 1657 const Location source = move->src(); |
| 1653 const Location destination = move->dest(); | 1658 const Location destination = move->dest(); |
| 1654 | 1659 |
| 1655 if (source.IsRegister() && destination.IsRegister()) { | 1660 if (source.IsRegister() && destination.IsRegister()) { |
| 1656 ASSERT(source.reg() != IP); | 1661 ASSERT(source.reg() != IP); |
| 1657 ASSERT(destination.reg() != IP); | 1662 ASSERT(destination.reg() != IP); |
| 1658 __ mov(IP, ShifterOperand(source.reg())); | 1663 __ mov(IP, ShifterOperand(source.reg())); |
| 1659 __ mov(source.reg(), ShifterOperand(destination.reg())); | 1664 __ mov(source.reg(), ShifterOperand(destination.reg())); |
| 1660 __ mov(destination.reg(), ShifterOperand(IP)); | 1665 __ mov(destination.reg(), ShifterOperand(IP)); |
| 1661 } else if (source.IsRegister() && destination.IsStackSlot()) { | 1666 } else if (source.IsRegister() && destination.IsStackSlot()) { |
| 1662 Exchange(source.reg(), destination.ToStackSlotOffset()); | 1667 Exchange(source.reg(), destination.ToStackSlotOffset()); |
| 1663 } else if (source.IsStackSlot() && destination.IsRegister()) { | 1668 } else if (source.IsStackSlot() && destination.IsRegister()) { |
| 1664 Exchange(destination.reg(), source.ToStackSlotOffset()); | 1669 Exchange(destination.reg(), source.ToStackSlotOffset()); |
| 1665 } else if (source.IsStackSlot() && destination.IsStackSlot()) { | 1670 } else if (source.IsStackSlot() && destination.IsStackSlot()) { |
| 1666 Exchange(source.ToStackSlotOffset(), destination.ToStackSlotOffset()); | 1671 Exchange(source.ToStackSlotOffset(), destination.ToStackSlotOffset()); |
| 1667 } else if (source.IsFpuRegister() && destination.IsFpuRegister()) { | 1672 } else if (source.IsFpuRegister() && destination.IsFpuRegister()) { |
| 1668 DRegister dst = EvenDRegisterOf(destination.fpu_reg()); | 1673 const DRegister dst = EvenDRegisterOf(destination.fpu_reg()); |
| 1669 DRegister src = EvenDRegisterOf(source.fpu_reg()); | 1674 DRegister src = EvenDRegisterOf(source.fpu_reg()); |
| 1670 __ vmovd(DTMP, src); | 1675 __ vmovd(DTMP, src); |
| 1671 __ vmovd(src, dst); | 1676 __ vmovd(src, dst); |
| 1672 __ vmovd(dst, DTMP); | 1677 __ vmovd(dst, DTMP); |
| 1673 } else if (source.IsFpuRegister() || destination.IsFpuRegister()) { | 1678 } else if (source.IsFpuRegister() || destination.IsFpuRegister()) { |
| 1674 ASSERT(destination.IsDoubleStackSlot() || | 1679 ASSERT(destination.IsDoubleStackSlot() || |
| 1675 destination.IsQuadStackSlot() || | 1680 destination.IsQuadStackSlot() || |
| 1676 source.IsDoubleStackSlot() || | 1681 source.IsDoubleStackSlot() || |
| 1677 source.IsQuadStackSlot()); | 1682 source.IsQuadStackSlot()); |
| 1678 bool double_width = destination.IsDoubleStackSlot() || | 1683 bool double_width = destination.IsDoubleStackSlot() || |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 DRegister dreg = EvenDRegisterOf(reg); | 1794 DRegister dreg = EvenDRegisterOf(reg); |
| 1790 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1795 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1791 } | 1796 } |
| 1792 | 1797 |
| 1793 | 1798 |
| 1794 #undef __ | 1799 #undef __ |
| 1795 | 1800 |
| 1796 } // namespace dart | 1801 } // namespace dart |
| 1797 | 1802 |
| 1798 #endif // defined TARGET_ARCH_ARM | 1803 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |