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

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

Issue 2101123005: [turbofan] Introduce integer multiplication with overflow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. 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/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 Node* const node = value->InputAt(0); 1267 Node* const node = value->InputAt(0);
1268 Node* const result = NodeProperties::FindProjection(node, 0); 1268 Node* const result = NodeProperties::FindProjection(node, 0);
1269 if (!result || selector->IsDefined(result)) { 1269 if (!result || selector->IsDefined(result)) {
1270 switch (node->opcode()) { 1270 switch (node->opcode()) {
1271 case IrOpcode::kInt32AddWithOverflow: 1271 case IrOpcode::kInt32AddWithOverflow:
1272 cont->OverwriteAndNegateIfEqual(kOverflow); 1272 cont->OverwriteAndNegateIfEqual(kOverflow);
1273 return VisitBinop(selector, node, kMipsAddOvf, cont); 1273 return VisitBinop(selector, node, kMipsAddOvf, cont);
1274 case IrOpcode::kInt32SubWithOverflow: 1274 case IrOpcode::kInt32SubWithOverflow:
1275 cont->OverwriteAndNegateIfEqual(kOverflow); 1275 cont->OverwriteAndNegateIfEqual(kOverflow);
1276 return VisitBinop(selector, node, kMipsSubOvf, cont); 1276 return VisitBinop(selector, node, kMipsSubOvf, cont);
1277 case IrOpcode::kInt32MulWithOverflow:
1278 cont->OverwriteAndNegateIfEqual(kOverflow);
1279 return VisitBinop(selector, node, kMipsMulOvf, cont);
1277 default: 1280 default:
1278 break; 1281 break;
1279 } 1282 }
1280 } 1283 }
1281 } 1284 }
1282 break; 1285 break;
1283 case IrOpcode::kWord32And: 1286 case IrOpcode::kWord32And:
1284 return VisitWordCompare(selector, value, kMipsTst, cont, true); 1287 return VisitWordCompare(selector, value, kMipsTst, cont, true);
1285 default: 1288 default:
1286 break; 1289 break;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 1404
1402 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { 1405 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) {
1403 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { 1406 if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
1404 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); 1407 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
1405 return VisitBinop(this, node, kMipsSubOvf, &cont); 1408 return VisitBinop(this, node, kMipsSubOvf, &cont);
1406 } 1409 }
1407 FlagsContinuation cont; 1410 FlagsContinuation cont;
1408 VisitBinop(this, node, kMipsSubOvf, &cont); 1411 VisitBinop(this, node, kMipsSubOvf, &cont);
1409 } 1412 }
1410 1413
1414 void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
1415 if (Node* ovf = NodeProperties::FindProjection(node, 1)) {
1416 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf);
1417 return VisitBinop(this, node, kMipsMulOvf, &cont);
1418 }
1419 FlagsContinuation cont;
1420 VisitBinop(this, node, kMipsMulOvf, &cont);
1421 }
1411 1422
1412 void InstructionSelector::VisitFloat32Equal(Node* node) { 1423 void InstructionSelector::VisitFloat32Equal(Node* node) {
1413 FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node); 1424 FlagsContinuation cont = FlagsContinuation::ForSet(kEqual, node);
1414 VisitFloat32Compare(this, node, &cont); 1425 VisitFloat32Compare(this, node, &cont);
1415 } 1426 }
1416 1427
1417 1428
1418 void InstructionSelector::VisitFloat32LessThan(Node* node) { 1429 void InstructionSelector::VisitFloat32LessThan(Node* node) {
1419 FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node); 1430 FlagsContinuation cont = FlagsContinuation::ForSet(kUnsignedLessThan, node);
1420 VisitFloat32Compare(this, node, &cont); 1431 VisitFloat32Compare(this, node, &cont);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || 1601 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
1591 IsMipsArchVariant(kMips32r2)); 1602 IsMipsArchVariant(kMips32r2));
1592 return MachineOperatorBuilder::AlignmentRequirements:: 1603 return MachineOperatorBuilder::AlignmentRequirements::
1593 NoUnalignedAccessSupport(); 1604 NoUnalignedAccessSupport();
1594 } 1605 }
1595 } 1606 }
1596 1607
1597 } // namespace compiler 1608 } // namespace compiler
1598 } // namespace internal 1609 } // namespace internal
1599 } // namespace v8 1610 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-codes-mips.h ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698