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/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 | 1448 |
1449 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { | 1449 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { |
1450 VisitRR(this, node, kSSEFloat32Round | MiscField::encode(kRoundToNearest)); | 1450 VisitRR(this, node, kSSEFloat32Round | MiscField::encode(kRoundToNearest)); |
1451 } | 1451 } |
1452 | 1452 |
1453 | 1453 |
1454 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { | 1454 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { |
1455 VisitRR(this, node, kSSEFloat64Round | MiscField::encode(kRoundToNearest)); | 1455 VisitRR(this, node, kSSEFloat64Round | MiscField::encode(kRoundToNearest)); |
1456 } | 1456 } |
1457 | 1457 |
1458 void InstructionSelector::VisitFloat32Neg(Node* node) { UNREACHABLE(); } | 1458 void InstructionSelector::VisitFloat32Neg(Node* node) { |
| 1459 VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat32Neg, kSSEFloat32Neg); |
| 1460 } |
1459 | 1461 |
1460 void InstructionSelector::VisitFloat64Neg(Node* node) { UNREACHABLE(); } | 1462 void InstructionSelector::VisitFloat64Neg(Node* node) { |
| 1463 VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat64Neg, kSSEFloat64Neg); |
| 1464 } |
1461 | 1465 |
1462 void InstructionSelector::VisitFloat64Ieee754Binop(Node* node, | 1466 void InstructionSelector::VisitFloat64Ieee754Binop(Node* node, |
1463 InstructionCode opcode) { | 1467 InstructionCode opcode) { |
1464 X64OperandGenerator g(this); | 1468 X64OperandGenerator g(this); |
1465 Emit(opcode, g.DefineAsFixed(node, xmm0), g.UseFixed(node->InputAt(0), xmm0), | 1469 Emit(opcode, g.DefineAsFixed(node, xmm0), g.UseFixed(node->InputAt(0), xmm0), |
1466 g.UseFixed(node->InputAt(1), xmm1)) | 1470 g.UseFixed(node->InputAt(1), xmm1)) |
1467 ->MarkAsCall(); | 1471 ->MarkAsCall(); |
1468 } | 1472 } |
1469 | 1473 |
1470 void InstructionSelector::VisitFloat64Ieee754Unop(Node* node, | 1474 void InstructionSelector::VisitFloat64Ieee754Unop(Node* node, |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 inputs[input_count++] = g.UseUniqueRegister(value); | 2179 inputs[input_count++] = g.UseUniqueRegister(value); |
2176 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 2180 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
2177 Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs); | 2181 Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs); |
2178 } | 2182 } |
2179 | 2183 |
2180 // static | 2184 // static |
2181 MachineOperatorBuilder::Flags | 2185 MachineOperatorBuilder::Flags |
2182 InstructionSelector::SupportedMachineOperatorFlags() { | 2186 InstructionSelector::SupportedMachineOperatorFlags() { |
2183 MachineOperatorBuilder::Flags flags = | 2187 MachineOperatorBuilder::Flags flags = |
2184 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2188 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2185 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; | 2189 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz | |
| 2190 MachineOperatorBuilder::kFloat32Neg | MachineOperatorBuilder::kFloat64Neg; |
2186 if (CpuFeatures::IsSupported(POPCNT)) { | 2191 if (CpuFeatures::IsSupported(POPCNT)) { |
2187 flags |= MachineOperatorBuilder::kWord32Popcnt | | 2192 flags |= MachineOperatorBuilder::kWord32Popcnt | |
2188 MachineOperatorBuilder::kWord64Popcnt; | 2193 MachineOperatorBuilder::kWord64Popcnt; |
2189 } | 2194 } |
2190 if (CpuFeatures::IsSupported(SSE4_1)) { | 2195 if (CpuFeatures::IsSupported(SSE4_1)) { |
2191 flags |= MachineOperatorBuilder::kFloat32RoundDown | | 2196 flags |= MachineOperatorBuilder::kFloat32RoundDown | |
2192 MachineOperatorBuilder::kFloat64RoundDown | | 2197 MachineOperatorBuilder::kFloat64RoundDown | |
2193 MachineOperatorBuilder::kFloat32RoundUp | | 2198 MachineOperatorBuilder::kFloat32RoundUp | |
2194 MachineOperatorBuilder::kFloat64RoundUp | | 2199 MachineOperatorBuilder::kFloat64RoundUp | |
2195 MachineOperatorBuilder::kFloat32RoundTruncate | | 2200 MachineOperatorBuilder::kFloat32RoundTruncate | |
2196 MachineOperatorBuilder::kFloat64RoundTruncate | | 2201 MachineOperatorBuilder::kFloat64RoundTruncate | |
2197 MachineOperatorBuilder::kFloat32RoundTiesEven | | 2202 MachineOperatorBuilder::kFloat32RoundTiesEven | |
2198 MachineOperatorBuilder::kFloat64RoundTiesEven; | 2203 MachineOperatorBuilder::kFloat64RoundTiesEven; |
2199 } | 2204 } |
2200 return flags; | 2205 return flags; |
2201 } | 2206 } |
2202 | 2207 |
2203 // static | 2208 // static |
2204 MachineOperatorBuilder::AlignmentRequirements | 2209 MachineOperatorBuilder::AlignmentRequirements |
2205 InstructionSelector::AlignmentRequirements() { | 2210 InstructionSelector::AlignmentRequirements() { |
2206 return MachineOperatorBuilder::AlignmentRequirements:: | 2211 return MachineOperatorBuilder::AlignmentRequirements:: |
2207 FullUnalignedAccessSupport(); | 2212 FullUnalignedAccessSupport(); |
2208 } | 2213 } |
2209 | 2214 |
2210 } // namespace compiler | 2215 } // namespace compiler |
2211 } // namespace internal | 2216 } // namespace internal |
2212 } // namespace v8 | 2217 } // namespace v8 |
OLD | NEW |