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 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2372 Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs); | 2372 Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs); |
2373 } | 2373 } |
2374 | 2374 |
2375 void InstructionSelector::VisitCreateInt32x4(Node* node) { | 2375 void InstructionSelector::VisitCreateInt32x4(Node* node) { |
2376 X64OperandGenerator g(this); | 2376 X64OperandGenerator g(this); |
2377 Emit(kX64Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 2377 Emit(kX64Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
2378 } | 2378 } |
2379 | 2379 |
2380 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { | 2380 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { |
2381 X64OperandGenerator g(this); | 2381 X64OperandGenerator g(this); |
| 2382 int32_t lane = OpParameter<int32_t>(node); |
2382 Emit(kX64Int32x4ExtractLane, g.DefineAsRegister(node), | 2383 Emit(kX64Int32x4ExtractLane, g.DefineAsRegister(node), |
2383 g.UseRegister(node->InputAt(0)), g.UseImmediate(node->InputAt(1))); | 2384 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane)); |
| 2385 } |
| 2386 |
| 2387 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) { |
| 2388 X64OperandGenerator g(this); |
| 2389 int32_t lane = OpParameter<int32_t>(node); |
| 2390 Emit(kX64Int32x4ReplaceLane, g.DefineSameAsFirst(node), |
| 2391 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), |
| 2392 g.Use(node->InputAt(1))); |
| 2393 } |
| 2394 |
| 2395 void InstructionSelector::VisitInt32x4Add(Node* node) { |
| 2396 X64OperandGenerator g(this); |
| 2397 Emit(kX64Int32x4Add, g.DefineSameAsFirst(node), |
| 2398 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
| 2399 } |
| 2400 |
| 2401 void InstructionSelector::VisitInt32x4Sub(Node* node) { |
| 2402 X64OperandGenerator g(this); |
| 2403 Emit(kX64Int32x4Sub, g.DefineSameAsFirst(node), |
| 2404 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
2384 } | 2405 } |
2385 | 2406 |
2386 // static | 2407 // static |
2387 MachineOperatorBuilder::Flags | 2408 MachineOperatorBuilder::Flags |
2388 InstructionSelector::SupportedMachineOperatorFlags() { | 2409 InstructionSelector::SupportedMachineOperatorFlags() { |
2389 MachineOperatorBuilder::Flags flags = | 2410 MachineOperatorBuilder::Flags flags = |
2390 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2411 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2391 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; | 2412 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; |
2392 if (CpuFeatures::IsSupported(POPCNT)) { | 2413 if (CpuFeatures::IsSupported(POPCNT)) { |
2393 flags |= MachineOperatorBuilder::kWord32Popcnt | | 2414 flags |= MachineOperatorBuilder::kWord32Popcnt | |
(...skipping 15 matching lines...) Expand all Loading... |
2409 // static | 2430 // static |
2410 MachineOperatorBuilder::AlignmentRequirements | 2431 MachineOperatorBuilder::AlignmentRequirements |
2411 InstructionSelector::AlignmentRequirements() { | 2432 InstructionSelector::AlignmentRequirements() { |
2412 return MachineOperatorBuilder::AlignmentRequirements:: | 2433 return MachineOperatorBuilder::AlignmentRequirements:: |
2413 FullUnalignedAccessSupport(); | 2434 FullUnalignedAccessSupport(); |
2414 } | 2435 } |
2415 | 2436 |
2416 } // namespace compiler | 2437 } // namespace compiler |
2417 } // namespace internal | 2438 } // namespace internal |
2418 } // namespace v8 | 2439 } // namespace v8 |
OLD | NEW |