| OLD | NEW |
| 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/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 namespace compiler { | 10 namespace compiler { |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 kArithmeticImm); | 1288 kArithmeticImm); |
| 1289 case IrOpcode::kInt64LessThanOrEqual: | 1289 case IrOpcode::kInt64LessThanOrEqual: |
| 1290 cont.OverwriteAndNegateIfEqual(kSignedLessThanOrEqual); | 1290 cont.OverwriteAndNegateIfEqual(kSignedLessThanOrEqual); |
| 1291 return VisitWordCompare(this, value, kArm64Cmp, &cont, false, | 1291 return VisitWordCompare(this, value, kArm64Cmp, &cont, false, |
| 1292 kArithmeticImm); | 1292 kArithmeticImm); |
| 1293 case IrOpcode::kUint64LessThan: | 1293 case IrOpcode::kUint64LessThan: |
| 1294 cont.OverwriteAndNegateIfEqual(kUnsignedLessThan); | 1294 cont.OverwriteAndNegateIfEqual(kUnsignedLessThan); |
| 1295 return VisitWordCompare(this, value, kArm64Cmp, &cont, false, | 1295 return VisitWordCompare(this, value, kArm64Cmp, &cont, false, |
| 1296 kArithmeticImm); | 1296 kArithmeticImm); |
| 1297 case IrOpcode::kFloat64Equal: | 1297 case IrOpcode::kFloat64Equal: |
| 1298 cont.OverwriteAndNegateIfEqual(kUnorderedEqual); | 1298 cont.OverwriteAndNegateIfEqual(kEqual); |
| 1299 return VisitFloat64Compare(this, value, &cont); | 1299 return VisitFloat64Compare(this, value, &cont); |
| 1300 case IrOpcode::kFloat64LessThan: | 1300 case IrOpcode::kFloat64LessThan: |
| 1301 cont.OverwriteAndNegateIfEqual(kUnorderedLessThan); | 1301 cont.OverwriteAndNegateIfEqual(kUnsignedLessThan); |
| 1302 return VisitFloat64Compare(this, value, &cont); | 1302 return VisitFloat64Compare(this, value, &cont); |
| 1303 case IrOpcode::kFloat64LessThanOrEqual: | 1303 case IrOpcode::kFloat64LessThanOrEqual: |
| 1304 cont.OverwriteAndNegateIfEqual(kUnorderedLessThanOrEqual); | 1304 cont.OverwriteAndNegateIfEqual(kUnsignedLessThanOrEqual); |
| 1305 return VisitFloat64Compare(this, value, &cont); | 1305 return VisitFloat64Compare(this, value, &cont); |
| 1306 case IrOpcode::kProjection: | 1306 case IrOpcode::kProjection: |
| 1307 // Check if this is the overflow output projection of an | 1307 // Check if this is the overflow output projection of an |
| 1308 // <Operation>WithOverflow node. | 1308 // <Operation>WithOverflow node. |
| 1309 if (OpParameter<size_t>(value) == 1u) { | 1309 if (OpParameter<size_t>(value) == 1u) { |
| 1310 // We cannot combine the <Operation>WithOverflow with this branch | 1310 // We cannot combine the <Operation>WithOverflow with this branch |
| 1311 // unless the 0th projection (the use of the actual value of the | 1311 // unless the 0th projection (the use of the actual value of the |
| 1312 // <Operation> is either NULL, which means there's no use of the | 1312 // <Operation> is either NULL, which means there's no use of the |
| 1313 // actual value, or was already defined, which means it is scheduled | 1313 // actual value, or was already defined, which means it is scheduled |
| 1314 // *AFTER* this branch). | 1314 // *AFTER* this branch). |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 } | 1490 } |
| 1491 | 1491 |
| 1492 | 1492 |
| 1493 void InstructionSelector::VisitUint64LessThan(Node* node) { | 1493 void InstructionSelector::VisitUint64LessThan(Node* node) { |
| 1494 FlagsContinuation cont(kUnsignedLessThan, node); | 1494 FlagsContinuation cont(kUnsignedLessThan, node); |
| 1495 VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm); | 1495 VisitWordCompare(this, node, kArm64Cmp, &cont, false, kArithmeticImm); |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 | 1498 |
| 1499 void InstructionSelector::VisitFloat64Equal(Node* node) { | 1499 void InstructionSelector::VisitFloat64Equal(Node* node) { |
| 1500 FlagsContinuation cont(kUnorderedEqual, node); | 1500 FlagsContinuation cont(kEqual, node); |
| 1501 VisitFloat64Compare(this, node, &cont); | 1501 VisitFloat64Compare(this, node, &cont); |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 | 1504 |
| 1505 void InstructionSelector::VisitFloat64LessThan(Node* node) { | 1505 void InstructionSelector::VisitFloat64LessThan(Node* node) { |
| 1506 FlagsContinuation cont(kUnorderedLessThan, node); | 1506 FlagsContinuation cont(kUnsignedLessThan, node); |
| 1507 VisitFloat64Compare(this, node, &cont); | 1507 VisitFloat64Compare(this, node, &cont); |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 | 1510 |
| 1511 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { | 1511 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
| 1512 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); | 1512 FlagsContinuation cont(kUnsignedLessThanOrEqual, node); |
| 1513 VisitFloat64Compare(this, node, &cont); | 1513 VisitFloat64Compare(this, node, &cont); |
| 1514 } | 1514 } |
| 1515 | 1515 |
| 1516 | 1516 |
| 1517 // static | 1517 // static |
| 1518 MachineOperatorBuilder::Flags | 1518 MachineOperatorBuilder::Flags |
| 1519 InstructionSelector::SupportedMachineOperatorFlags() { | 1519 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1520 return MachineOperatorBuilder::kFloat64Floor | | 1520 return MachineOperatorBuilder::kFloat64Floor | |
| 1521 MachineOperatorBuilder::kFloat64Ceil | | 1521 MachineOperatorBuilder::kFloat64Ceil | |
| 1522 MachineOperatorBuilder::kFloat64RoundTruncate | | 1522 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1523 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1523 MachineOperatorBuilder::kFloat64RoundTiesAway | |
| 1524 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1524 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 1525 MachineOperatorBuilder::kInt32DivIsSafe | | 1525 MachineOperatorBuilder::kInt32DivIsSafe | |
| 1526 MachineOperatorBuilder::kUint32DivIsSafe; | 1526 MachineOperatorBuilder::kUint32DivIsSafe; |
| 1527 } | 1527 } |
| 1528 |
| 1528 } // namespace compiler | 1529 } // namespace compiler |
| 1529 } // namespace internal | 1530 } // namespace internal |
| 1530 } // namespace v8 | 1531 } // namespace v8 |
| OLD | NEW |