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

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

Issue 11929021: Optimize double.floor and double.ceil down to roundsd when SSE4.1 is available. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 call); 1332 call);
1333 } else { 1333 } else {
1334 // Optimistically assume result fits into Smi. 1334 // Optimistically assume result fits into Smi.
1335 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call); 1335 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call);
1336 } 1336 }
1337 call->ReplaceWith(d2i_instr, current_iterator()); 1337 call->ReplaceWith(d2i_instr, current_iterator());
1338 RemovePushArguments(call); 1338 RemovePushArguments(call);
1339 return true; 1339 return true;
1340 } 1340 }
1341 if ((recognized_kind == MethodRecognizer::kDoubleTruncate) || 1341 if ((recognized_kind == MethodRecognizer::kDoubleTruncate) ||
1342 (recognized_kind == MethodRecognizer::kDoubleRound)) { 1342 (recognized_kind == MethodRecognizer::kDoubleRound) ||
1343 (recognized_kind == MethodRecognizer::kDoubleFloor) ||
1344 (recognized_kind == MethodRecognizer::kDoubleCeil)) {
1343 if (!CPUFeatures::double_truncate_round_supported()) { 1345 if (!CPUFeatures::double_truncate_round_supported()) {
1344 return false; 1346 return false;
1345 } 1347 }
1346 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); 1348 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy());
1347 DoubleToDoubleInstr* d2d_instr = 1349 DoubleToDoubleInstr* d2d_instr =
1348 new DoubleToDoubleInstr(call->ArgumentAt(0)->value(), 1350 new DoubleToDoubleInstr(call->ArgumentAt(0)->value(),
1349 call, 1351 call,
1350 recognized_kind); 1352 recognized_kind);
1351 call->ReplaceWith(d2d_instr, current_iterator()); 1353 call->ReplaceWith(d2d_instr, current_iterator());
1352 RemovePushArguments(call); 1354 RemovePushArguments(call);
(...skipping 3205 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 4560
4559 if (FLAG_trace_constant_propagation) { 4561 if (FLAG_trace_constant_propagation) {
4560 OS::Print("\n==== After constant propagation ====\n"); 4562 OS::Print("\n==== After constant propagation ====\n");
4561 FlowGraphPrinter printer(*graph_); 4563 FlowGraphPrinter printer(*graph_);
4562 printer.PrintBlocks(); 4564 printer.PrintBlocks();
4563 } 4565 }
4564 } 4566 }
4565 4567
4566 4568
4567 } // namespace dart 4569 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698