Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 2719483002: [V8] Rename SIMD Create methods and add initialization operators. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 addressing_mode = kMode_MRI; 2267 addressing_mode = kMode_MRI;
2268 } else { 2268 } else {
2269 inputs[input_count++] = g.UseUniqueRegister(index); 2269 inputs[input_count++] = g.UseUniqueRegister(index);
2270 addressing_mode = kMode_MR1; 2270 addressing_mode = kMode_MR1;
2271 } 2271 }
2272 inputs[input_count++] = g.UseUniqueRegister(value); 2272 inputs[input_count++] = g.UseUniqueRegister(value);
2273 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); 2273 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
2274 Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs); 2274 Emit(code, 0, static_cast<InstructionOperand*>(nullptr), input_count, inputs);
2275 } 2275 }
2276 2276
2277 void InstructionSelector::VisitCreateInt32x4(Node* node) { 2277 void InstructionSelector::VisitInt32x4Splat(Node* node) {
2278 X64OperandGenerator g(this); 2278 X64OperandGenerator g(this);
2279 Emit(kX64Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 2279 Emit(kX64Int32x4Splat, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
2280 } 2280 }
2281 2281
2282 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { 2282 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) {
2283 X64OperandGenerator g(this); 2283 X64OperandGenerator g(this);
2284 int32_t lane = OpParameter<int32_t>(node); 2284 int32_t lane = OpParameter<int32_t>(node);
2285 Emit(kX64Int32x4ExtractLane, g.DefineAsRegister(node), 2285 Emit(kX64Int32x4ExtractLane, g.DefineAsRegister(node),
2286 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane)); 2286 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane));
2287 } 2287 }
2288 2288
2289 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) { 2289 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) {
2290 X64OperandGenerator g(this); 2290 X64OperandGenerator g(this);
2291 int32_t lane = OpParameter<int32_t>(node); 2291 int32_t lane = OpParameter<int32_t>(node);
2292 Emit(kX64Int32x4ReplaceLane, g.DefineSameAsFirst(node), 2292 Emit(kX64Int32x4ReplaceLane, g.DefineSameAsFirst(node),
2293 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), 2293 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane),
2294 g.Use(node->InputAt(1))); 2294 g.Use(node->InputAt(1)));
2295 } 2295 }
2296 2296
2297 void InstructionSelector::VisitInt32x4Add(Node* node) { 2297 void InstructionSelector::VisitInt32x4Add(Node* node) {
2298 X64OperandGenerator g(this); 2298 X64OperandGenerator g(this);
2299 Emit(kX64Int32x4Add, g.DefineSameAsFirst(node), 2299 Emit(kX64Int32x4Add, g.DefineSameAsFirst(node),
2300 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); 2300 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
2301 } 2301 }
2302 2302
2303 void InstructionSelector::VisitInt32x4Sub(Node* node) { 2303 void InstructionSelector::VisitInt32x4Sub(Node* node) {
2304 X64OperandGenerator g(this); 2304 X64OperandGenerator g(this);
2305 Emit(kX64Int32x4Sub, g.DefineSameAsFirst(node), 2305 Emit(kX64Int32x4Sub, g.DefineSameAsFirst(node),
2306 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); 2306 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)));
2307 } 2307 }
2308 2308
2309 void InstructionSelector::VisitSimd128Zero(Node* node) {
2310 X64OperandGenerator g(this);
2311 Emit(kX64Simd128Zero, g.DefineSameAsFirst(node));
2312 }
2313
2314 void InstructionSelector::VisitSimd1x4Zero(Node* node) {
2315 X64OperandGenerator g(this);
2316 Emit(kX64Simd128Zero, g.DefineSameAsFirst(node));
2317 }
2318
2319 void InstructionSelector::VisitSimd1x8Zero(Node* node) {
2320 X64OperandGenerator g(this);
2321 Emit(kX64Simd128Zero, g.DefineSameAsFirst(node));
2322 }
2323
2324 void InstructionSelector::VisitSimd1x16Zero(Node* node) {
2325 X64OperandGenerator g(this);
2326 Emit(kX64Simd128Zero, g.DefineSameAsFirst(node));
2327 }
2328
2309 // static 2329 // static
2310 MachineOperatorBuilder::Flags 2330 MachineOperatorBuilder::Flags
2311 InstructionSelector::SupportedMachineOperatorFlags() { 2331 InstructionSelector::SupportedMachineOperatorFlags() {
2312 MachineOperatorBuilder::Flags flags = 2332 MachineOperatorBuilder::Flags flags =
2313 MachineOperatorBuilder::kWord32ShiftIsSafe | 2333 MachineOperatorBuilder::kWord32ShiftIsSafe |
2314 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; 2334 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz;
2315 if (CpuFeatures::IsSupported(POPCNT)) { 2335 if (CpuFeatures::IsSupported(POPCNT)) {
2316 flags |= MachineOperatorBuilder::kWord32Popcnt | 2336 flags |= MachineOperatorBuilder::kWord32Popcnt |
2317 MachineOperatorBuilder::kWord64Popcnt; 2337 MachineOperatorBuilder::kWord64Popcnt;
2318 } 2338 }
(...skipping 13 matching lines...) Expand all
2332 // static 2352 // static
2333 MachineOperatorBuilder::AlignmentRequirements 2353 MachineOperatorBuilder::AlignmentRequirements
2334 InstructionSelector::AlignmentRequirements() { 2354 InstructionSelector::AlignmentRequirements() {
2335 return MachineOperatorBuilder::AlignmentRequirements:: 2355 return MachineOperatorBuilder::AlignmentRequirements::
2336 FullUnalignedAccessSupport(); 2356 FullUnalignedAccessSupport();
2337 } 2357 }
2338 2358
2339 } // namespace compiler 2359 } // namespace compiler
2340 } // namespace internal 2360 } // namespace internal
2341 } // namespace v8 2361 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698