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

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

Issue 504143003: Support Int32 representation for selected binary operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
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" // 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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 const intptr_t source_offset = source.ToStackSlotOffset(); 1593 const intptr_t source_offset = source.ToStackSlotOffset();
1594 const intptr_t dest_offset = destination.ToStackSlotOffset(); 1594 const intptr_t dest_offset = destination.ToStackSlotOffset();
1595 const DRegister dtmp0 = DTMP; 1595 const DRegister dtmp0 = DTMP;
1596 __ LoadMultipleDFromOffset(dtmp0, 2, FP, source_offset); 1596 __ LoadMultipleDFromOffset(dtmp0, 2, FP, source_offset);
1597 __ StoreMultipleDToOffset(dtmp0, 2, FP, dest_offset); 1597 __ StoreMultipleDToOffset(dtmp0, 2, FP, dest_offset);
1598 } 1598 }
1599 } else { 1599 } else {
1600 ASSERT(source.IsConstant()); 1600 ASSERT(source.IsConstant());
1601 const Object& constant = source.constant(); 1601 const Object& constant = source.constant();
1602 if (destination.IsRegister()) { 1602 if (destination.IsRegister()) {
1603 __ LoadObject(destination.reg(), constant); 1603 if (source.constant_instruction()->representation() == kUnboxedInt32) {
1604 __ LoadImmediate(destination.reg(), Smi::Cast(constant).Value());
1605 } else {
1606 __ LoadObject(destination.reg(), constant);
1607 }
1604 } else if (destination.IsFpuRegister()) { 1608 } else if (destination.IsFpuRegister()) {
1605 const DRegister dst = EvenDRegisterOf(destination.fpu_reg()); 1609 const DRegister dst = EvenDRegisterOf(destination.fpu_reg());
1606 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0) && 1610 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0) &&
1607 TargetCPUFeatures::neon_supported()) { 1611 TargetCPUFeatures::neon_supported()) {
1608 QRegister qdst = destination.fpu_reg(); 1612 QRegister qdst = destination.fpu_reg();
1609 __ veorq(qdst, qdst, qdst); 1613 __ veorq(qdst, qdst, qdst);
1610 } else { 1614 } else {
1611 __ LoadObject(TMP, constant); 1615 __ LoadObject(TMP, constant);
1612 __ AddImmediate(TMP, TMP, Double::value_offset() - kHeapObjectTag); 1616 __ AddImmediate(TMP, TMP, Double::value_offset() - kHeapObjectTag);
1613 __ vldrd(dst, Address(TMP, 0)); 1617 __ vldrd(dst, Address(TMP, 0));
1614 } 1618 }
1615 } else if (destination.IsDoubleStackSlot()) { 1619 } else if (destination.IsDoubleStackSlot()) {
1616 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0) && 1620 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0) &&
1617 TargetCPUFeatures::neon_supported()) { 1621 TargetCPUFeatures::neon_supported()) {
1618 __ veorq(QTMP, QTMP, QTMP); 1622 __ veorq(QTMP, QTMP, QTMP);
1619 } else { 1623 } else {
1620 __ LoadObject(TMP, constant); 1624 __ LoadObject(TMP, constant);
1621 __ AddImmediate(TMP, TMP, Double::value_offset() - kHeapObjectTag); 1625 __ AddImmediate(TMP, TMP, Double::value_offset() - kHeapObjectTag);
1622 __ vldrd(DTMP, Address(TMP, 0)); 1626 __ vldrd(DTMP, Address(TMP, 0));
1623 } 1627 }
1624 const intptr_t dest_offset = destination.ToStackSlotOffset(); 1628 const intptr_t dest_offset = destination.ToStackSlotOffset();
1625 __ StoreDToOffset(DTMP, FP, dest_offset); 1629 __ StoreDToOffset(DTMP, FP, dest_offset);
1626 } else { 1630 } else {
1627 ASSERT(destination.IsStackSlot()); 1631 ASSERT(destination.IsStackSlot());
1628 const intptr_t dest_offset = destination.ToStackSlotOffset(); 1632 const intptr_t dest_offset = destination.ToStackSlotOffset();
1629 __ LoadObject(TMP, constant); 1633 if (source.constant_instruction()->representation() == kUnboxedInt32) {
1634 __ LoadImmediate(TMP, Smi::Cast(constant).Value());
1635 } else {
1636 __ LoadObject(TMP, constant);
1637 }
1630 __ StoreToOffset(kWord, TMP, FP, dest_offset); 1638 __ StoreToOffset(kWord, TMP, FP, dest_offset);
1631 } 1639 }
1632 } 1640 }
1633 1641
1634 move->Eliminate(); 1642 move->Eliminate();
1635 } 1643 }
1636 1644
1637 1645
1638 void ParallelMoveResolver::EmitSwap(int index) { 1646 void ParallelMoveResolver::EmitSwap(int index) {
1639 MoveOperands* move = moves_[index]; 1647 MoveOperands* move = moves_[index];
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 DRegister dreg = EvenDRegisterOf(reg); 1785 DRegister dreg = EvenDRegisterOf(reg);
1778 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1786 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1779 } 1787 }
1780 1788
1781 1789
1782 #undef __ 1790 #undef __
1783 1791
1784 } // namespace dart 1792 } // namespace dart
1785 1793
1786 #endif // defined TARGET_ARCH_ARM 1794 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698