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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 2101123005: [turbofan] Introduce integer multiplication with overflow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile error. Created 4 years, 5 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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 Node* const node = value->InputAt(0); 1392 Node* const node = value->InputAt(0);
1393 Node* const result = NodeProperties::FindProjection(node, 0); 1393 Node* const result = NodeProperties::FindProjection(node, 0);
1394 if (result == nullptr || selector->IsDefined(result)) { 1394 if (result == nullptr || selector->IsDefined(result)) {
1395 switch (node->opcode()) { 1395 switch (node->opcode()) {
1396 case IrOpcode::kInt32AddWithOverflow: 1396 case IrOpcode::kInt32AddWithOverflow:
1397 cont->OverwriteAndNegateIfEqual(kOverflow); 1397 cont->OverwriteAndNegateIfEqual(kOverflow);
1398 return VisitBinop(selector, node, kIA32Add, cont); 1398 return VisitBinop(selector, node, kIA32Add, cont);
1399 case IrOpcode::kInt32SubWithOverflow: 1399 case IrOpcode::kInt32SubWithOverflow:
1400 cont->OverwriteAndNegateIfEqual(kOverflow); 1400 cont->OverwriteAndNegateIfEqual(kOverflow);
1401 return VisitBinop(selector, node, kIA32Sub, cont); 1401 return VisitBinop(selector, node, kIA32Sub, cont);
1402 case IrOpcode::kInt32MulWithOverflow:
1403 cont->OverwriteAndNegateIfEqual(kOverflow);
1404 return VisitBinop(selector, node, kIA32Imul, cont);
1402 default: 1405 default:
1403 break; 1406 break;
1404 } 1407 }
1405 } 1408 }
1406 } 1409 }
1407 break; 1410 break;
1408 case IrOpcode::kInt32Sub: 1411 case IrOpcode::kInt32Sub:
1409 return VisitWordCompare(selector, value, cont); 1412 return VisitWordCompare(selector, value, cont);
1410 case IrOpcode::kWord32And: 1413 case IrOpcode::kWord32And:
1411 return VisitWordCompare(selector, value, kIA32Test, cont); 1414 return VisitWordCompare(selector, value, kIA32Test, cont);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 1519
1517 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { 1520 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
1518 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { 1521 if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
1519 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); 1522 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
1520 return VisitBinop(this, node, kIA32Sub, &cont); 1523 return VisitBinop(this, node, kIA32Sub, &cont);
1521 } 1524 }
1522 FlagsContinuation cont; 1525 FlagsContinuation cont;
1523 VisitBinop(this, node, kIA32Sub, &cont); 1526 VisitBinop(this, node, kIA32Sub, &cont);
1524 } 1527 }
1525 1528
1529 void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
1530 if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
1531 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
1532 return VisitBinop(this, node, kIA32Imul, &cont);
1533 }
1534 FlagsContinuation cont;
1535 VisitBinop(this, node, kIA32Imul, &cont);
1536 }
1526 1537
1527 void InstructionSelector::VisitFloat32Equal(Node* node) { 1538 void InstructionSelector::VisitFloat32Equal(Node* node) {
1528 FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node); 1539 FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node);
1529 VisitFloat32Compare(this, node, &cont); 1540 VisitFloat32Compare(this, node, &cont);
1530 } 1541 }
1531 1542
1532 1543
1533 void InstructionSelector::VisitFloat32LessThan(Node* node) { 1544 void InstructionSelector::VisitFloat32LessThan(Node* node) {
1534 FlagsContinuation cont = 1545 FlagsContinuation cont =
1535 FlagsContinuation::ForSet(kUnsignedGreaterThan, node); 1546 FlagsContinuation::ForSet(kUnsignedGreaterThan, node);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 // static 1693 // static
1683 MachineOperatorBuilder::AlignmentRequirements 1694 MachineOperatorBuilder::AlignmentRequirements
1684 InstructionSelector::AlignmentRequirements() { 1695 InstructionSelector::AlignmentRequirements() {
1685 return MachineOperatorBuilder::AlignmentRequirements:: 1696 return MachineOperatorBuilder::AlignmentRequirements::
1686 FullUnalignedAccessSupport(); 1697 FullUnalignedAccessSupport();
1687 } 1698 }
1688 1699
1689 } // namespace compiler 1700 } // namespace compiler
1690 } // namespace internal 1701 } // namespace internal
1691 } // namespace v8 1702 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698