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

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

Issue 1778893005: [wasm] Int64Lowering of Int64Sub on ia32 and arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-add
Patch Set: 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/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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 NodeProperties::ChangeOp(node, machine()->Int32PairAdd()); 265 NodeProperties::ChangeOp(node, machine()->Int32PairAdd());
266 // We access the additional return values through projections. 266 // We access the additional return values through projections.
267 Node* low_node = graph()->NewNode(common()->Projection(0), node); 267 Node* low_node = graph()->NewNode(common()->Projection(0), node);
268 Node* high_node = graph()->NewNode(common()->Projection(1), node); 268 Node* high_node = graph()->NewNode(common()->Projection(1), node);
269 ReplaceNode(node, low_node, high_node); 269 ReplaceNode(node, low_node, high_node);
270 break; 270 break;
271 } 271 }
272 272
273 // kExprI64Sub: 273 // kExprI64Sub:
274 case IrOpcode::kInt64Sub: {
275 DCHECK(node->InputCount() == 2);
276
277 Node* right = node->InputAt(1);
278 node->ReplaceInput(1, GetReplacementLow(right));
279 node->AppendInput(zone(), GetReplacementHigh(right));
280
281 Node* left = node->InputAt(0);
282 node->ReplaceInput(0, GetReplacementLow(left));
283 node->InsertInput(zone(), 1, GetReplacementHigh(left));
284
285 NodeProperties::ChangeOp(node, machine()->Int32PairSub());
286 // We access the additional return values through projections.
287 Node* low_node = graph()->NewNode(common()->Projection(0), node);
288 Node* high_node = graph()->NewNode(common()->Projection(1), node);
289 ReplaceNode(node, low_node, high_node);
290 break;
291 }
274 // kExprI64Mul: 292 // kExprI64Mul:
275 // kExprI64DivS: 293 // kExprI64DivS:
276 // kExprI64DivU: 294 // kExprI64DivU:
277 // kExprI64RemS: 295 // kExprI64RemS:
278 // kExprI64RemU: 296 // kExprI64RemU:
279 // kExprI64Ior: 297 // kExprI64Ior:
280 case IrOpcode::kWord64Or: { 298 case IrOpcode::kWord64Or: {
281 DCHECK(node->InputCount() == 2); 299 DCHECK(node->InputCount() == 2);
282 Node* left = node->InputAt(0); 300 Node* left = node->InputAt(0);
283 Node* right = node->InputAt(1); 301 Node* right = node->InputAt(1);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 530 }
513 531
514 Node* Int64Lowering::GetReplacementHigh(Node* node) { 532 Node* Int64Lowering::GetReplacementHigh(Node* node) {
515 Node* result = replacements_[node->id()].high; 533 Node* result = replacements_[node->id()].high;
516 DCHECK(result); 534 DCHECK(result);
517 return result; 535 return result;
518 } 536 }
519 } // namespace compiler 537 } // namespace compiler
520 } // namespace internal 538 } // namespace internal
521 } // namespace v8 539 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698