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

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

Issue 1778493004: [wasm] Int64Lowering of Int64Add on ia32 and arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.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/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/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 case IrOpcode::kTruncateInt64ToInt32: { 244 case IrOpcode::kTruncateInt64ToInt32: {
245 DCHECK(node->InputCount() == 1); 245 DCHECK(node->InputCount() == 1);
246 Node* input = node->InputAt(0); 246 Node* input = node->InputAt(0);
247 ReplaceNode(node, GetReplacementLow(input), nullptr); 247 ReplaceNode(node, GetReplacementLow(input), nullptr);
248 node->NullAllInputs(); 248 node->NullAllInputs();
249 break; 249 break;
250 } 250 }
251 // todo(ahaas): I added a list of missing instructions here to make merging 251 // todo(ahaas): I added a list of missing instructions here to make merging
252 // easier when I do them one by one. 252 // easier when I do them one by one.
253 // kExprI64Add: 253 // kExprI64Add:
254 case IrOpcode::kInt64Add: {
255 DCHECK(node->InputCount() == 2);
256
257 Node* right = node->InputAt(1);
258 node->ReplaceInput(1, GetReplacementLow(right));
259 node->AppendInput(zone(), GetReplacementHigh(right));
260
261 Node* left = node->InputAt(0);
262 node->ReplaceInput(0, GetReplacementLow(left));
263 node->InsertInput(zone(), 1, GetReplacementHigh(left));
264
265 NodeProperties::ChangeOp(node, machine()->Int32PairAdd());
266 // We access the additional return values through projections.
267 Node* low_node = graph()->NewNode(common()->Projection(0), node);
268 Node* high_node = graph()->NewNode(common()->Projection(1), node);
269 ReplaceNode(node, low_node, high_node);
270 break;
271 }
272
254 // kExprI64Sub: 273 // kExprI64Sub:
255 // kExprI64Mul: 274 // kExprI64Mul:
256 // kExprI64DivS: 275 // kExprI64DivS:
257 // kExprI64DivU: 276 // kExprI64DivU:
258 // kExprI64RemS: 277 // kExprI64RemS:
259 // kExprI64RemU: 278 // kExprI64RemU:
260 // kExprI64Ior: 279 // kExprI64Ior:
261 case IrOpcode::kWord64Or: { 280 case IrOpcode::kWord64Or: {
262 DCHECK(node->InputCount() == 2); 281 DCHECK(node->InputCount() == 2);
263 Node* left = node->InputAt(0); 282 Node* left = node->InputAt(0);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 512 }
494 513
495 Node* Int64Lowering::GetReplacementHigh(Node* node) { 514 Node* Int64Lowering::GetReplacementHigh(Node* node) {
496 Node* result = replacements_[node->id()].high; 515 Node* result = replacements_[node->id()].high;
497 DCHECK(result); 516 DCHECK(result);
498 return result; 517 return result;
499 } 518 }
500 } // namespace compiler 519 } // namespace compiler
501 } // namespace internal 520 } // namespace internal
502 } // namespace v8 521 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698