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

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

Issue 2155553002: X87: [turbofan] Introduce integer multiplication with overflow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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/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 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 Node* const node = value->InputAt(0); 1433 Node* const node = value->InputAt(0);
1434 Node* const result = NodeProperties::FindProjection(node, 0); 1434 Node* const result = NodeProperties::FindProjection(node, 0);
1435 if (result == nullptr || selector->IsDefined(result)) { 1435 if (result == nullptr || selector->IsDefined(result)) {
1436 switch (node->opcode()) { 1436 switch (node->opcode()) {
1437 case IrOpcode::kInt32AddWithOverflow: 1437 case IrOpcode::kInt32AddWithOverflow:
1438 cont->OverwriteAndNegateIfEqual(kOverflow); 1438 cont->OverwriteAndNegateIfEqual(kOverflow);
1439 return VisitBinop(selector, node, kX87Add, cont); 1439 return VisitBinop(selector, node, kX87Add, cont);
1440 case IrOpcode::kInt32SubWithOverflow: 1440 case IrOpcode::kInt32SubWithOverflow:
1441 cont->OverwriteAndNegateIfEqual(kOverflow); 1441 cont->OverwriteAndNegateIfEqual(kOverflow);
1442 return VisitBinop(selector, node, kX87Sub, cont); 1442 return VisitBinop(selector, node, kX87Sub, cont);
1443 case IrOpcode::kInt32MulWithOverflow:
1444 cont->OverwriteAndNegateIfEqual(kOverflow);
1445 return VisitBinop(selector, node, kX87Imul, cont);
1443 default: 1446 default:
1444 break; 1447 break;
1445 } 1448 }
1446 } 1449 }
1447 } 1450 }
1448 break; 1451 break;
1449 case IrOpcode::kInt32Sub: 1452 case IrOpcode::kInt32Sub:
1450 return VisitWordCompare(selector, value, cont); 1453 return VisitWordCompare(selector, value, cont);
1451 case IrOpcode::kWord32And: 1454 case IrOpcode::kWord32And:
1452 return VisitWordCompare(selector, value, kX87Test, cont); 1455 return VisitWordCompare(selector, value, kX87Test, cont);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 1561
1559 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { 1562 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
1560 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { 1563 if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
1561 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); 1564 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
1562 return VisitBinop(this, node, kX87Sub, &cont); 1565 return VisitBinop(this, node, kX87Sub, &cont);
1563 } 1566 }
1564 FlagsContinuation cont; 1567 FlagsContinuation cont;
1565 VisitBinop(this, node, kX87Sub, &cont); 1568 VisitBinop(this, node, kX87Sub, &cont);
1566 } 1569 }
1567 1570
1571 void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
1572 if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
1573 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
1574 return VisitBinop(this, node, kX87Imul, &cont);
1575 }
1576 FlagsContinuation cont;
1577 VisitBinop(this, node, kX87Imul, &cont);
1578 }
1568 1579
1569 void InstructionSelector::VisitFloat32Equal(Node* node) { 1580 void InstructionSelector::VisitFloat32Equal(Node* node) {
1570 FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node); 1581 FlagsContinuation cont = FlagsContinuation::ForSet(kUnorderedEqual, node);
1571 VisitFloat32Compare(this, node, &cont); 1582 VisitFloat32Compare(this, node, &cont);
1572 } 1583 }
1573 1584
1574 1585
1575 void InstructionSelector::VisitFloat32LessThan(Node* node) { 1586 void InstructionSelector::VisitFloat32LessThan(Node* node) {
1576 FlagsContinuation cont = 1587 FlagsContinuation cont =
1577 FlagsContinuation::ForSet(kUnsignedGreaterThan, node); 1588 FlagsContinuation::ForSet(kUnsignedGreaterThan, node);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 // static 1728 // static
1718 MachineOperatorBuilder::AlignmentRequirements 1729 MachineOperatorBuilder::AlignmentRequirements
1719 InstructionSelector::AlignmentRequirements() { 1730 InstructionSelector::AlignmentRequirements() {
1720 return MachineOperatorBuilder::AlignmentRequirements:: 1731 return MachineOperatorBuilder::AlignmentRequirements::
1721 FullUnalignedAccessSupport(); 1732 FullUnalignedAccessSupport();
1722 } 1733 }
1723 1734
1724 } // namespace compiler 1735 } // namespace compiler
1725 } // namespace internal 1736 } // namespace internal
1726 } // namespace v8 1737 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698