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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 void InstructionSelector::VisitFloat32Max(Node* node) { | 882 void InstructionSelector::VisitFloat32Max(Node* node) { |
883 VisitFloatBinop(this, node, kAVXFloat32Max, kSSEFloat32Max); | 883 VisitFloatBinop(this, node, kAVXFloat32Max, kSSEFloat32Max); |
884 } | 884 } |
885 | 885 |
886 | 886 |
887 void InstructionSelector::VisitFloat32Min(Node* node) { | 887 void InstructionSelector::VisitFloat32Min(Node* node) { |
888 VisitFloatBinop(this, node, kAVXFloat32Min, kSSEFloat32Min); | 888 VisitFloatBinop(this, node, kAVXFloat32Min, kSSEFloat32Min); |
889 } | 889 } |
890 | 890 |
891 | 891 |
| 892 void InstructionSelector::VisitFloat32Abs(Node* node) { |
| 893 X64OperandGenerator g(this); |
| 894 Emit(kSSEFloat32Abs, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); |
| 895 } |
| 896 |
| 897 |
892 void InstructionSelector::VisitFloat32Sqrt(Node* node) { | 898 void InstructionSelector::VisitFloat32Sqrt(Node* node) { |
893 X64OperandGenerator g(this); | 899 X64OperandGenerator g(this); |
894 Emit(kSSEFloat32Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 900 Emit(kSSEFloat32Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
895 } | 901 } |
896 | 902 |
897 | 903 |
898 void InstructionSelector::VisitFloat64Add(Node* node) { | 904 void InstructionSelector::VisitFloat64Add(Node* node) { |
899 VisitFloatBinop(this, node, kAVXFloat64Add, kSSEFloat64Add); | 905 VisitFloatBinop(this, node, kAVXFloat64Add, kSSEFloat64Add); |
900 } | 906 } |
901 | 907 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 void InstructionSelector::VisitFloat64Max(Node* node) { | 952 void InstructionSelector::VisitFloat64Max(Node* node) { |
947 VisitFloatBinop(this, node, kAVXFloat64Max, kSSEFloat64Max); | 953 VisitFloatBinop(this, node, kAVXFloat64Max, kSSEFloat64Max); |
948 } | 954 } |
949 | 955 |
950 | 956 |
951 void InstructionSelector::VisitFloat64Min(Node* node) { | 957 void InstructionSelector::VisitFloat64Min(Node* node) { |
952 VisitFloatBinop(this, node, kAVXFloat64Min, kSSEFloat64Min); | 958 VisitFloatBinop(this, node, kAVXFloat64Min, kSSEFloat64Min); |
953 } | 959 } |
954 | 960 |
955 | 961 |
| 962 void InstructionSelector::VisitFloat64Abs(Node* node) { |
| 963 X64OperandGenerator g(this); |
| 964 Emit(kSSEFloat64Abs, g.DefineSameAsFirst(node), g.Use(node->InputAt(0))); |
| 965 } |
| 966 |
| 967 |
956 void InstructionSelector::VisitFloat64Sqrt(Node* node) { | 968 void InstructionSelector::VisitFloat64Sqrt(Node* node) { |
957 X64OperandGenerator g(this); | 969 X64OperandGenerator g(this); |
958 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 970 Emit(kSSEFloat64Sqrt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
959 } | 971 } |
960 | 972 |
961 | 973 |
962 namespace { | 974 namespace { |
963 | 975 |
964 void VisitRRFloat64(InstructionSelector* selector, InstructionCode opcode, | 976 void VisitRRFloat64(InstructionSelector* selector, InstructionCode opcode, |
965 Node* node) { | 977 Node* node) { |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 Node* right = node->InputAt(1); | 1513 Node* right = node->InputAt(1); |
1502 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), | 1514 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), |
1503 g.UseRegister(left), g.Use(right)); | 1515 g.UseRegister(left), g.Use(right)); |
1504 } | 1516 } |
1505 | 1517 |
1506 | 1518 |
1507 // static | 1519 // static |
1508 MachineOperatorBuilder::Flags | 1520 MachineOperatorBuilder::Flags |
1509 InstructionSelector::SupportedMachineOperatorFlags() { | 1521 InstructionSelector::SupportedMachineOperatorFlags() { |
1510 MachineOperatorBuilder::Flags flags = | 1522 MachineOperatorBuilder::Flags flags = |
| 1523 MachineOperatorBuilder::kFloat32Abs | |
1511 MachineOperatorBuilder::kFloat32Max | | 1524 MachineOperatorBuilder::kFloat32Max | |
1512 MachineOperatorBuilder::kFloat32Min | | 1525 MachineOperatorBuilder::kFloat32Min | |
| 1526 MachineOperatorBuilder::kFloat64Abs | |
1513 MachineOperatorBuilder::kFloat64Max | | 1527 MachineOperatorBuilder::kFloat64Max | |
1514 MachineOperatorBuilder::kFloat64Min | | 1528 MachineOperatorBuilder::kFloat64Min | |
1515 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1529 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1516 if (CpuFeatures::IsSupported(SSE4_1)) { | 1530 if (CpuFeatures::IsSupported(SSE4_1)) { |
1517 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1531 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1518 MachineOperatorBuilder::kFloat64RoundTruncate; | 1532 MachineOperatorBuilder::kFloat64RoundTruncate; |
1519 } | 1533 } |
1520 return flags; | 1534 return flags; |
1521 } | 1535 } |
1522 | 1536 |
1523 } // namespace compiler | 1537 } // namespace compiler |
1524 } // namespace internal | 1538 } // namespace internal |
1525 } // namespace v8 | 1539 } // namespace v8 |
OLD | NEW |