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

Side by Side Diff: src/compiler/int64-lowering.cc

Issue 1807273002: [wasm] Int64Lowering of Int64Mul on ia32 and arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-phi
Patch Set: Forgot to add the visit functions on mips, ppc, and x87. Created 4 years, 9 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
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/int64-lowering.h" 5 #include "src/compiler/int64-lowering.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/diamond.h" 7 #include "src/compiler/diamond.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // outputs of the Int32PairAdd will be accessed through projections. 190 // outputs of the Int32PairAdd will be accessed through projections.
191 PrepareProjectionReplacements(node); 191 PrepareProjectionReplacements(node);
192 break; 192 break;
193 } 193 }
194 case IrOpcode::kInt64Sub: { 194 case IrOpcode::kInt64Sub: {
195 // An Int64Sub node is changed into a Int32PairSub node. The two 195 // An Int64Sub node is changed into a Int32PairSub node. The two
196 // outputs of the Int32PairSub will be accessed through projections. 196 // outputs of the Int32PairSub will be accessed through projections.
197 PrepareProjectionReplacements(node); 197 PrepareProjectionReplacements(node);
198 break; 198 break;
199 } 199 }
200 case IrOpcode::kInt64Mul: {
201 // An Int64Sub node is changed into a Int32PairSub node. The two
202 // outputs of the Int32PairSub will be accessed through projections.
203 PrepareProjectionReplacements(node);
204 break;
205 }
200 case IrOpcode::kWord64Or: { 206 case IrOpcode::kWord64Or: {
201 Node* low_node = 207 Node* low_node =
202 graph()->NewNode(machine()->Word32Or(), placeholder_, placeholder_); 208 graph()->NewNode(machine()->Word32Or(), placeholder_, placeholder_);
203 Node* high_node = 209 Node* high_node =
204 graph()->NewNode(machine()->Word32Or(), placeholder_, placeholder_); 210 graph()->NewNode(machine()->Word32Or(), placeholder_, placeholder_);
205 ReplaceNode(node, low_node, high_node); 211 ReplaceNode(node, low_node, high_node);
206 break; 212 break;
207 } 213 }
208 case IrOpcode::kWord64Xor: { 214 case IrOpcode::kWord64Xor: {
209 Node* low_node = 215 Node* low_node =
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 node->ReplaceInput(1, GetReplacementLow(right)); 490 node->ReplaceInput(1, GetReplacementLow(right));
485 node->AppendInput(zone(), GetReplacementHigh(right)); 491 node->AppendInput(zone(), GetReplacementHigh(right));
486 492
487 Node* left = node->InputAt(0); 493 Node* left = node->InputAt(0);
488 node->ReplaceInput(0, GetReplacementLow(left)); 494 node->ReplaceInput(0, GetReplacementLow(left));
489 node->InsertInput(zone(), 1, GetReplacementHigh(left)); 495 node->InsertInput(zone(), 1, GetReplacementHigh(left));
490 496
491 NodeProperties::ChangeOp(node, machine()->Int32PairSub()); 497 NodeProperties::ChangeOp(node, machine()->Int32PairSub());
492 break; 498 break;
493 } 499 }
500 case IrOpcode::kInt64Mul: {
501 DCHECK(node->InputCount() == 2);
502
503 Node* right = node->InputAt(1);
504 node->ReplaceInput(1, GetReplacementLow(right));
505 node->AppendInput(zone(), GetReplacementHigh(right));
506
507 Node* left = node->InputAt(0);
508 node->ReplaceInput(0, GetReplacementLow(left));
509 node->InsertInput(zone(), 1, GetReplacementHigh(left));
510
511 NodeProperties::ChangeOp(node, machine()->Int32PairMul());
512 break;
513 }
494 case IrOpcode::kWord64Or: { 514 case IrOpcode::kWord64Or: {
495 DCHECK(node->InputCount() == 2); 515 DCHECK(node->InputCount() == 2);
496 Node* left = node->InputAt(0); 516 Node* left = node->InputAt(0);
497 Node* right = node->InputAt(1); 517 Node* right = node->InputAt(1);
498 518
499 Node* low_node = GetReplacementLow(node); 519 Node* low_node = GetReplacementLow(node);
500 low_node->ReplaceInput(0, GetReplacementLow(left)); 520 low_node->ReplaceInput(0, GetReplacementLow(left));
501 low_node->ReplaceInput(1, GetReplacementLow(right)); 521 low_node->ReplaceInput(1, GetReplacementLow(right));
502 522
503 Node* high_node = GetReplacementHigh(node); 523 Node* high_node = GetReplacementHigh(node);
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 } 874 }
855 875
856 Node* Int64Lowering::GetReplacementHigh(Node* node) { 876 Node* Int64Lowering::GetReplacementHigh(Node* node) {
857 Node* result = replacements_[node->id()].high; 877 Node* result = replacements_[node->id()].high;
858 DCHECK(result); 878 DCHECK(result);
859 return result; 879 return result;
860 } 880 }
861 } // namespace compiler 881 } // namespace compiler
862 } // namespace internal 882 } // namespace internal
863 } // namespace v8 883 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698