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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 | 875 |
876 | 876 |
877 void InstructionSelector::VisitChangeInt32ToInt64(Node* node) { | 877 void InstructionSelector::VisitChangeInt32ToInt64(Node* node) { |
878 Arm64OperandGenerator g(this); | 878 Arm64OperandGenerator g(this); |
879 Emit(kArm64Sxtw, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); | 879 Emit(kArm64Sxtw, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); |
880 } | 880 } |
881 | 881 |
882 | 882 |
883 void InstructionSelector::VisitChangeUint32ToUint64(Node* node) { | 883 void InstructionSelector::VisitChangeUint32ToUint64(Node* node) { |
884 Arm64OperandGenerator g(this); | 884 Arm64OperandGenerator g(this); |
885 Emit(kArm64Mov32, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); | 885 Node* value = node->InputAt(0); |
| 886 switch (value->opcode()) { |
| 887 case IrOpcode::kWord32And: |
| 888 case IrOpcode::kWord32Or: |
| 889 case IrOpcode::kWord32Xor: |
| 890 case IrOpcode::kWord32Shl: |
| 891 case IrOpcode::kWord32Shr: |
| 892 case IrOpcode::kWord32Sar: |
| 893 case IrOpcode::kWord32Ror: |
| 894 case IrOpcode::kWord32Equal: |
| 895 case IrOpcode::kInt32Add: |
| 896 case IrOpcode::kInt32AddWithOverflow: |
| 897 case IrOpcode::kInt32Sub: |
| 898 case IrOpcode::kInt32SubWithOverflow: |
| 899 case IrOpcode::kInt32Mul: |
| 900 case IrOpcode::kInt32MulHigh: |
| 901 case IrOpcode::kInt32Div: |
| 902 case IrOpcode::kInt32Mod: |
| 903 case IrOpcode::kInt32LessThan: |
| 904 case IrOpcode::kInt32LessThanOrEqual: |
| 905 case IrOpcode::kUint32Div: |
| 906 case IrOpcode::kUint32LessThan: |
| 907 case IrOpcode::kUint32LessThanOrEqual: |
| 908 case IrOpcode::kUint32Mod: |
| 909 case IrOpcode::kUint32MulHigh: { |
| 910 // 32-bit operations will write their result in a W register (implicitly |
| 911 // clearing the top 32-bit of the corresponding X register) so the |
| 912 // zero-extension is a no-op. |
| 913 Emit(kArchNop, g.DefineSameAsFirst(node), g.Use(value)); |
| 914 return; |
| 915 } |
| 916 default: |
| 917 break; |
| 918 } |
| 919 Emit(kArm64Mov32, g.DefineAsRegister(node), g.UseRegister(value)); |
886 } | 920 } |
887 | 921 |
888 | 922 |
889 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 923 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
890 Arm64OperandGenerator g(this); | 924 Arm64OperandGenerator g(this); |
891 Emit(kArm64Float64ToFloat32, g.DefineAsRegister(node), | 925 Emit(kArm64Float64ToFloat32, g.DefineAsRegister(node), |
892 g.UseRegister(node->InputAt(0))); | 926 g.UseRegister(node->InputAt(0))); |
893 } | 927 } |
894 | 928 |
895 | 929 |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 MachineOperatorBuilder::Flags | 1446 MachineOperatorBuilder::Flags |
1413 InstructionSelector::SupportedMachineOperatorFlags() { | 1447 InstructionSelector::SupportedMachineOperatorFlags() { |
1414 return MachineOperatorBuilder::kFloat64Floor | | 1448 return MachineOperatorBuilder::kFloat64Floor | |
1415 MachineOperatorBuilder::kFloat64Ceil | | 1449 MachineOperatorBuilder::kFloat64Ceil | |
1416 MachineOperatorBuilder::kFloat64RoundTruncate | | 1450 MachineOperatorBuilder::kFloat64RoundTruncate | |
1417 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1451 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1418 } | 1452 } |
1419 } // namespace compiler | 1453 } // namespace compiler |
1420 } // namespace internal | 1454 } // namespace internal |
1421 } // namespace v8 | 1455 } // namespace v8 |
OLD | NEW |