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

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

Issue 425083003: Use (more) xor on FP register to load it with 0.0. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 __ LoadQFromOffset(VTMP, FP, source_offset, PP); 1578 __ LoadQFromOffset(VTMP, FP, source_offset, PP);
1579 __ StoreQToOffset(VTMP, FP, dest_offset, PP); 1579 __ StoreQToOffset(VTMP, FP, dest_offset, PP);
1580 } 1580 }
1581 } else { 1581 } else {
1582 ASSERT(source.IsConstant()); 1582 ASSERT(source.IsConstant());
1583 const Object& constant = source.constant(); 1583 const Object& constant = source.constant();
1584 if (destination.IsRegister()) { 1584 if (destination.IsRegister()) {
1585 __ LoadObject(destination.reg(), constant, PP); 1585 __ LoadObject(destination.reg(), constant, PP);
1586 } else if (destination.IsFpuRegister()) { 1586 } else if (destination.IsFpuRegister()) {
1587 const VRegister dst = destination.fpu_reg(); 1587 const VRegister dst = destination.fpu_reg();
1588 __ LoadObject(TMP, constant, PP); 1588 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
1589 __ LoadDFieldFromOffset(dst, TMP, Double::value_offset(), PP); 1589 __ veor(dst, dst, dst);
1590 } else {
1591 __ LoadObject(TMP, constant, PP);
1592 __ LoadDFieldFromOffset(dst, TMP, Double::value_offset(), PP);
1593 }
1590 } else if (destination.IsDoubleStackSlot()) { 1594 } else if (destination.IsDoubleStackSlot()) {
1595 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
1596 __ veor(VTMP, VTMP, VTMP);
1597 } else {
1598 __ LoadObject(TMP, constant, PP);
1599 __ LoadDFieldFromOffset(VTMP, TMP, Double::value_offset(), PP);
1600 }
1591 const intptr_t dest_offset = destination.ToStackSlotOffset(); 1601 const intptr_t dest_offset = destination.ToStackSlotOffset();
1592 __ LoadObject(TMP, constant, PP);
1593 __ LoadDFieldFromOffset(VTMP, TMP, Double::value_offset(), PP);
1594 __ StoreDToOffset(VTMP, FP, dest_offset, PP); 1602 __ StoreDToOffset(VTMP, FP, dest_offset, PP);
1595 } else { 1603 } else {
1596 ASSERT(destination.IsStackSlot()); 1604 ASSERT(destination.IsStackSlot());
1597 const intptr_t dest_offset = destination.ToStackSlotOffset(); 1605 const intptr_t dest_offset = destination.ToStackSlotOffset();
1598 __ LoadObject(TMP, constant, PP); 1606 __ LoadObject(TMP, constant, PP);
1599 __ StoreToOffset(TMP, FP, dest_offset, PP); 1607 __ StoreToOffset(TMP, FP, dest_offset, PP);
1600 } 1608 }
1601 } 1609 }
1602 1610
1603 move->Eliminate(); 1611 move->Eliminate();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { 1743 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
1736 UNIMPLEMENTED(); 1744 UNIMPLEMENTED();
1737 } 1745 }
1738 1746
1739 1747
1740 #undef __ 1748 #undef __
1741 1749
1742 } // namespace dart 1750 } // namespace dart
1743 1751
1744 #endif // defined TARGET_ARCH_ARM64 1752 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698