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

Side by Side Diff: src/compiler/machine-operator-reducer.cc

Issue 597083002: Translate NumberDivide/NumberModulus operators to Int32Div, Int32Mod in representation-change.h. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add multiply. Created 6 years, 2 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 | « src/compiler/change-lowering.h ('k') | src/compiler/representation-change.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/machine-operator-reducer.h" 5 #include "src/compiler/machine-operator-reducer.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/compiler/generic-node-inl.h" 8 #include "src/compiler/generic-node-inl.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value())); 420 if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value()));
421 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); 421 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0));
422 break; 422 break;
423 } 423 }
424 case IrOpcode::kTruncateInt64ToInt32: { 424 case IrOpcode::kTruncateInt64ToInt32: {
425 Int64Matcher m(node->InputAt(0)); 425 Int64Matcher m(node->InputAt(0));
426 if (m.HasValue()) return ReplaceInt32(static_cast<int32_t>(m.Value())); 426 if (m.HasValue()) return ReplaceInt32(static_cast<int32_t>(m.Value()));
427 if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0)); 427 if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0));
428 break; 428 break;
429 } 429 }
430 // TODO(turbofan): strength-reduce and fold floating point operations.
431 default: 430 default:
432 break; 431 break;
433 } 432 }
434 return NoChange(); 433 return NoChange();
435 } 434 }
436 435
437 436
438 Reduction MachineOperatorReducer::ReduceProjection(size_t index, Node* node) { 437 Reduction MachineOperatorReducer::ReduceProjection(size_t index, Node* node) {
439 switch (node->opcode()) { 438 switch (node->opcode()) {
440 case IrOpcode::kInt32AddWithOverflow: { 439 case IrOpcode::kInt32AddWithOverflow: {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 MachineOperatorBuilder* MachineOperatorReducer::machine() const { 479 MachineOperatorBuilder* MachineOperatorReducer::machine() const {
481 return jsgraph()->machine(); 480 return jsgraph()->machine();
482 } 481 }
483 482
484 483
485 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } 484 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); }
486 485
487 } // namespace compiler 486 } // namespace compiler
488 } // namespace internal 487 } // namespace internal
489 } // namespace v8 488 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/change-lowering.h ('k') | src/compiler/representation-change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698