Chromium Code Reviews| 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2352 X64OperandGenerator g(this); | 2352 X64OperandGenerator g(this); |
| 2353 Emit(kX64Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 2353 Emit(kX64Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 2354 } | 2354 } |
| 2355 | 2355 |
| 2356 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { | 2356 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { |
| 2357 X64OperandGenerator g(this); | 2357 X64OperandGenerator g(this); |
| 2358 Emit(kX64Int32x4ExtractLane, g.DefineAsRegister(node), | 2358 Emit(kX64Int32x4ExtractLane, g.DefineAsRegister(node), |
| 2359 g.UseRegister(node->InputAt(0)), g.UseImmediate(node->InputAt(1))); | 2359 g.UseRegister(node->InputAt(0)), g.UseImmediate(node->InputAt(1))); |
| 2360 } | 2360 } |
| 2361 | 2361 |
| 2362 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) { | |
| 2363 X64OperandGenerator g(this); | |
| 2364 Emit(kX64Int32x4ReplaceLane, g.DefineSameAsFirst(node), | |
| 2365 g.UseRegister(node->InputAt(0)), g.UseImmediate(node->InputAt(1)), | |
|
titzer
2016/11/28 09:28:37
This is going to be brittle. You're assuming that
gdeepti
2016/12/02 00:43:45
Fixed so that lane values are compile time constan
| |
| 2366 g.Use(node->InputAt(2))); | |
| 2367 } | |
| 2368 | |
| 2369 void InstructionSelector::VisitInt32x4Add(Node* node) { | |
| 2370 X64OperandGenerator g(this); | |
| 2371 Emit(kX64Int32x4Add, g.DefineSameAsFirst(node), | |
| 2372 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); | |
| 2373 } | |
| 2374 | |
| 2375 void InstructionSelector::VisitInt32x4Sub(Node* node) { | |
| 2376 X64OperandGenerator g(this); | |
| 2377 Emit(kX64Int32x4Sub, g.DefineSameAsFirst(node), | |
| 2378 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); | |
| 2379 } | |
| 2380 | |
| 2362 // static | 2381 // static |
| 2363 MachineOperatorBuilder::Flags | 2382 MachineOperatorBuilder::Flags |
| 2364 InstructionSelector::SupportedMachineOperatorFlags() { | 2383 InstructionSelector::SupportedMachineOperatorFlags() { |
| 2365 MachineOperatorBuilder::Flags flags = | 2384 MachineOperatorBuilder::Flags flags = |
| 2366 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2385 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 2367 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; | 2386 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; |
| 2368 if (CpuFeatures::IsSupported(POPCNT)) { | 2387 if (CpuFeatures::IsSupported(POPCNT)) { |
| 2369 flags |= MachineOperatorBuilder::kWord32Popcnt | | 2388 flags |= MachineOperatorBuilder::kWord32Popcnt | |
| 2370 MachineOperatorBuilder::kWord64Popcnt; | 2389 MachineOperatorBuilder::kWord64Popcnt; |
| 2371 } | 2390 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 2385 // static | 2404 // static |
| 2386 MachineOperatorBuilder::AlignmentRequirements | 2405 MachineOperatorBuilder::AlignmentRequirements |
| 2387 InstructionSelector::AlignmentRequirements() { | 2406 InstructionSelector::AlignmentRequirements() { |
| 2388 return MachineOperatorBuilder::AlignmentRequirements:: | 2407 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2389 FullUnalignedAccessSupport(); | 2408 FullUnalignedAccessSupport(); |
| 2390 } | 2409 } |
| 2391 | 2410 |
| 2392 } // namespace compiler | 2411 } // namespace compiler |
| 2393 } // namespace internal | 2412 } // namespace internal |
| 2394 } // namespace v8 | 2413 } // namespace v8 |
| OLD | NEW |