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 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { | 1230 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { |
1231 VisitRR(this, kArm64Float64ToInt32, node); | 1231 VisitRR(this, kArm64Float64ToInt32, node); |
1232 } | 1232 } |
1233 | 1233 |
1234 | 1234 |
1235 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { | 1235 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { |
1236 VisitRR(this, kArm64Float64ToUint32, node); | 1236 VisitRR(this, kArm64Float64ToUint32, node); |
1237 } | 1237 } |
1238 | 1238 |
1239 | 1239 |
1240 void InstructionSelector::VisitTruncateFloat32ToInt64(Node* node) { | 1240 void InstructionSelector::VisitTryTruncateFloat32ToInt64(Node* node) { |
1241 VisitRR(this, kArm64Float32ToInt64, node); | 1241 Arm64OperandGenerator g(this); |
| 1242 |
| 1243 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; |
| 1244 InstructionOperand outputs[2]; |
| 1245 size_t output_count = 0; |
| 1246 outputs[output_count++] = g.DefineAsRegister(node); |
| 1247 |
| 1248 Node* success_output = NodeProperties::FindProjection(node, 1); |
| 1249 if (success_output) { |
| 1250 outputs[output_count++] = g.DefineAsRegister(success_output); |
| 1251 } |
| 1252 |
| 1253 Emit(kArm64Float32ToInt64, output_count, outputs, 1, inputs); |
1242 } | 1254 } |
1243 | 1255 |
1244 | 1256 |
1245 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) { | 1257 void InstructionSelector::VisitTryTruncateFloat64ToInt64(Node* node) { |
1246 Arm64OperandGenerator g(this); | 1258 Arm64OperandGenerator g(this); |
1247 | 1259 |
1248 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; | 1260 InstructionOperand inputs[] = {g.UseRegister(node->InputAt(0))}; |
1249 InstructionOperand outputs[2]; | 1261 InstructionOperand outputs[2]; |
1250 size_t output_count = 0; | 1262 size_t output_count = 0; |
1251 outputs[output_count++] = g.DefineAsRegister(node); | 1263 outputs[output_count++] = g.DefineAsRegister(node); |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 if (result == NULL || IsDefined(result)) { | 1814 if (result == NULL || IsDefined(result)) { |
1803 switch (node->opcode()) { | 1815 switch (node->opcode()) { |
1804 case IrOpcode::kInt32AddWithOverflow: | 1816 case IrOpcode::kInt32AddWithOverflow: |
1805 cont.OverwriteAndNegateIfEqual(kOverflow); | 1817 cont.OverwriteAndNegateIfEqual(kOverflow); |
1806 return VisitBinop<Int32BinopMatcher>(this, node, kArm64Add32, | 1818 return VisitBinop<Int32BinopMatcher>(this, node, kArm64Add32, |
1807 kArithmeticImm, &cont); | 1819 kArithmeticImm, &cont); |
1808 case IrOpcode::kInt32SubWithOverflow: | 1820 case IrOpcode::kInt32SubWithOverflow: |
1809 cont.OverwriteAndNegateIfEqual(kOverflow); | 1821 cont.OverwriteAndNegateIfEqual(kOverflow); |
1810 return VisitBinop<Int32BinopMatcher>(this, node, kArm64Sub32, | 1822 return VisitBinop<Int32BinopMatcher>(this, node, kArm64Sub32, |
1811 kArithmeticImm, &cont); | 1823 kArithmeticImm, &cont); |
| 1824 case IrOpcode::kTryTruncateFloat64ToInt64: |
| 1825 return VisitTryTruncateFloat64ToInt64(result); |
| 1826 case IrOpcode::kTryTruncateFloat32ToInt64: |
| 1827 return VisitTryTruncateFloat32ToInt64(result); |
1812 default: | 1828 default: |
1813 break; | 1829 break; |
1814 } | 1830 } |
1815 } | 1831 } |
1816 } | 1832 } |
1817 break; | 1833 break; |
1818 case IrOpcode::kInt32Add: | 1834 case IrOpcode::kInt32Add: |
1819 return VisitWordCompare(this, value, kArm64Cmn32, &cont, true, | 1835 return VisitWordCompare(this, value, kArm64Cmn32, &cont, true, |
1820 kArithmeticImm); | 1836 kArithmeticImm); |
1821 case IrOpcode::kInt32Sub: | 1837 case IrOpcode::kInt32Sub: |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2122 MachineOperatorBuilder::kFloat32RoundTiesEven | | 2138 MachineOperatorBuilder::kFloat32RoundTiesEven | |
2123 MachineOperatorBuilder::kFloat64RoundTiesEven | | 2139 MachineOperatorBuilder::kFloat64RoundTiesEven | |
2124 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2140 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2125 MachineOperatorBuilder::kInt32DivIsSafe | | 2141 MachineOperatorBuilder::kInt32DivIsSafe | |
2126 MachineOperatorBuilder::kUint32DivIsSafe; | 2142 MachineOperatorBuilder::kUint32DivIsSafe; |
2127 } | 2143 } |
2128 | 2144 |
2129 } // namespace compiler | 2145 } // namespace compiler |
2130 } // namespace internal | 2146 } // namespace internal |
2131 } // namespace v8 | 2147 } // namespace v8 |
OLD | NEW |