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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/flow_graph_compiler_arm64.cc
===================================================================
--- runtime/vm/flow_graph_compiler_arm64.cc (revision 38628)
+++ runtime/vm/flow_graph_compiler_arm64.cc (working copy)
@@ -1585,12 +1585,20 @@
__ LoadObject(destination.reg(), constant, PP);
} else if (destination.IsFpuRegister()) {
const VRegister dst = destination.fpu_reg();
- __ LoadObject(TMP, constant, PP);
- __ LoadDFieldFromOffset(dst, TMP, Double::value_offset(), PP);
+ if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
+ __ veor(dst, dst, dst);
+ } else {
+ __ LoadObject(TMP, constant, PP);
+ __ LoadDFieldFromOffset(dst, TMP, Double::value_offset(), PP);
+ }
} else if (destination.IsDoubleStackSlot()) {
+ if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
+ __ veor(VTMP, VTMP, VTMP);
+ } else {
+ __ LoadObject(TMP, constant, PP);
+ __ LoadDFieldFromOffset(VTMP, TMP, Double::value_offset(), PP);
+ }
const intptr_t dest_offset = destination.ToStackSlotOffset();
- __ LoadObject(TMP, constant, PP);
- __ LoadDFieldFromOffset(VTMP, TMP, Double::value_offset(), PP);
__ StoreDToOffset(VTMP, FP, dest_offset, PP);
} else {
ASSERT(destination.IsStackSlot());

Powered by Google App Engine
This is Rietveld 408576698