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/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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 Node* const node = value->InputAt(0); | 1730 Node* const node = value->InputAt(0); |
1731 Node* const result = NodeProperties::FindProjection(node, 0); | 1731 Node* const result = NodeProperties::FindProjection(node, 0); |
1732 if (result == nullptr || selector->IsDefined(result)) { | 1732 if (result == nullptr || selector->IsDefined(result)) { |
1733 switch (node->opcode()) { | 1733 switch (node->opcode()) { |
1734 case IrOpcode::kInt32AddWithOverflow: | 1734 case IrOpcode::kInt32AddWithOverflow: |
1735 cont->OverwriteAndNegateIfEqual(kOverflow); | 1735 cont->OverwriteAndNegateIfEqual(kOverflow); |
1736 return VisitBinop(selector, node, kMips64Dadd, cont); | 1736 return VisitBinop(selector, node, kMips64Dadd, cont); |
1737 case IrOpcode::kInt32SubWithOverflow: | 1737 case IrOpcode::kInt32SubWithOverflow: |
1738 cont->OverwriteAndNegateIfEqual(kOverflow); | 1738 cont->OverwriteAndNegateIfEqual(kOverflow); |
1739 return VisitBinop(selector, node, kMips64Dsub, cont); | 1739 return VisitBinop(selector, node, kMips64Dsub, cont); |
| 1740 case IrOpcode::kInt32MulWithOverflow: |
| 1741 cont->OverwriteAndNegateIfEqual(kOverflow); |
| 1742 return VisitBinop(selector, node, kMips64MulOvf, cont); |
1740 case IrOpcode::kInt64AddWithOverflow: | 1743 case IrOpcode::kInt64AddWithOverflow: |
1741 cont->OverwriteAndNegateIfEqual(kOverflow); | 1744 cont->OverwriteAndNegateIfEqual(kOverflow); |
1742 return VisitBinop(selector, node, kMips64DaddOvf, cont); | 1745 return VisitBinop(selector, node, kMips64DaddOvf, cont); |
1743 case IrOpcode::kInt64SubWithOverflow: | 1746 case IrOpcode::kInt64SubWithOverflow: |
1744 cont->OverwriteAndNegateIfEqual(kOverflow); | 1747 cont->OverwriteAndNegateIfEqual(kOverflow); |
1745 return VisitBinop(selector, node, kMips64DsubOvf, cont); | 1748 return VisitBinop(selector, node, kMips64DsubOvf, cont); |
1746 default: | 1749 default: |
1747 break; | 1750 break; |
1748 } | 1751 } |
1749 } | 1752 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1859 | 1862 |
1860 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { | 1863 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { |
1861 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { | 1864 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
1862 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); | 1865 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
1863 return VisitBinop(this, node, kMips64Dsub, &cont); | 1866 return VisitBinop(this, node, kMips64Dsub, &cont); |
1864 } | 1867 } |
1865 FlagsContinuation cont; | 1868 FlagsContinuation cont; |
1866 VisitBinop(this, node, kMips64Dsub, &cont); | 1869 VisitBinop(this, node, kMips64Dsub, &cont); |
1867 } | 1870 } |
1868 | 1871 |
| 1872 void InstructionSelector::VisitInt32MulWithOverflow(Node* node) { |
| 1873 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
| 1874 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
| 1875 return VisitBinop(this, node, kMips64MulOvf, &cont); |
| 1876 } |
| 1877 FlagsContinuation cont; |
| 1878 VisitBinop(this, node, kMips64MulOvf, &cont); |
| 1879 } |
1869 | 1880 |
1870 void InstructionSelector::VisitInt64AddWithOverflow(Node* node) { | 1881 void InstructionSelector::VisitInt64AddWithOverflow(Node* node) { |
1871 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { | 1882 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
1872 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); | 1883 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
1873 return VisitBinop(this, node, kMips64DaddOvf, &cont); | 1884 return VisitBinop(this, node, kMips64DaddOvf, &cont); |
1874 } | 1885 } |
1875 FlagsContinuation cont; | 1886 FlagsContinuation cont; |
1876 VisitBinop(this, node, kMips64DaddOvf, &cont); | 1887 VisitBinop(this, node, kMips64DaddOvf, &cont); |
1877 } | 1888 } |
1878 | 1889 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 } else { | 2104 } else { |
2094 DCHECK(kArchVariant == kMips64r2); | 2105 DCHECK(kArchVariant == kMips64r2); |
2095 return MachineOperatorBuilder::AlignmentRequirements:: | 2106 return MachineOperatorBuilder::AlignmentRequirements:: |
2096 NoUnalignedAccessSupport(); | 2107 NoUnalignedAccessSupport(); |
2097 } | 2108 } |
2098 } | 2109 } |
2099 | 2110 |
2100 } // namespace compiler | 2111 } // namespace compiler |
2101 } // namespace internal | 2112 } // namespace internal |
2102 } // namespace v8 | 2113 } // namespace v8 |
OLD | NEW |