| 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 break; | 1400 break; |
| 1401 } | 1401 } |
| 1402 Emit(kArm64Mov32, g.DefineAsRegister(node), g.UseRegister(value)); | 1402 Emit(kArm64Mov32, g.DefineAsRegister(node), g.UseRegister(value)); |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 | 1405 |
| 1406 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 1406 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
| 1407 VisitRR(this, kArm64Float64ToFloat32, node); | 1407 VisitRR(this, kArm64Float64ToFloat32, node); |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 void InstructionSelector::VisitTruncateFloat64ToWord32(Node* node) { |
| 1411 VisitRR(this, kArchTruncateDoubleToI, node); |
| 1412 } |
| 1410 | 1413 |
| 1411 void InstructionSelector::VisitTruncateFloat64ToInt32(Node* node) { | 1414 void InstructionSelector::VisitRoundFloat64ToInt32(Node* node) { |
| 1412 switch (TruncationModeOf(node->op())) { | 1415 VisitRR(this, kArm64Float64ToInt32, node); |
| 1413 case TruncationMode::kJavaScript: | |
| 1414 return VisitRR(this, kArchTruncateDoubleToI, node); | |
| 1415 case TruncationMode::kRoundToZero: | |
| 1416 return VisitRR(this, kArm64Float64ToInt32, node); | |
| 1417 } | |
| 1418 UNREACHABLE(); | |
| 1419 } | 1416 } |
| 1420 | 1417 |
| 1421 | 1418 |
| 1422 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { | 1419 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { |
| 1423 Arm64OperandGenerator g(this); | 1420 Arm64OperandGenerator g(this); |
| 1424 Node* value = node->InputAt(0); | 1421 Node* value = node->InputAt(0); |
| 1425 if (CanCover(node, value) && value->InputCount() >= 2) { | 1422 if (CanCover(node, value) && value->InputCount() >= 2) { |
| 1426 Int64BinopMatcher m(value); | 1423 Int64BinopMatcher m(value); |
| 1427 if ((m.IsWord64Sar() && m.right().HasValue() && | 1424 if ((m.IsWord64Sar() && m.right().HasValue() && |
| 1428 (m.right().Value() == 32)) || | 1425 (m.right().Value() == 32)) || |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2293 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2290 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 2294 MachineOperatorBuilder::kInt32DivIsSafe | | 2291 MachineOperatorBuilder::kInt32DivIsSafe | |
| 2295 MachineOperatorBuilder::kUint32DivIsSafe | | 2292 MachineOperatorBuilder::kUint32DivIsSafe | |
| 2296 MachineOperatorBuilder::kWord32ReverseBits | | 2293 MachineOperatorBuilder::kWord32ReverseBits | |
| 2297 MachineOperatorBuilder::kWord64ReverseBits; | 2294 MachineOperatorBuilder::kWord64ReverseBits; |
| 2298 } | 2295 } |
| 2299 | 2296 |
| 2300 } // namespace compiler | 2297 } // namespace compiler |
| 2301 } // namespace internal | 2298 } // namespace internal |
| 2302 } // namespace v8 | 2299 } // namespace v8 |
| OLD | NEW |