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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2923103003: [WASM] Simplify SIMD shuffle opcodes. (Closed)
Patch Set: Mircea's review comments. Created 3 years, 6 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
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/function-body-decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 "src/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/base/platform/elapsed-timer.h" 10 #include "src/base/platform/elapsed-timer.h"
(...skipping 3566 matching lines...) Expand 10 before | Expand all | Expand 10 after
3577 return graph()->NewNode(jsgraph()->machine()->I8x16ShrS(shift), 3577 return graph()->NewNode(jsgraph()->machine()->I8x16ShrS(shift),
3578 inputs[0]); 3578 inputs[0]);
3579 case wasm::kExprI8x16ShrU: 3579 case wasm::kExprI8x16ShrU:
3580 return graph()->NewNode(jsgraph()->machine()->I8x16ShrU(shift), 3580 return graph()->NewNode(jsgraph()->machine()->I8x16ShrU(shift),
3581 inputs[0]); 3581 inputs[0]);
3582 default: 3582 default:
3583 FATAL_UNSUPPORTED_OPCODE(opcode); 3583 FATAL_UNSUPPORTED_OPCODE(opcode);
3584 } 3584 }
3585 } 3585 }
3586 3586
3587 Node* WasmGraphBuilder::SimdShuffleOp(uint8_t shuffle[16], unsigned lanes, 3587 Node* WasmGraphBuilder::Simd8x16ShuffleOp(uint8_t shuffle[16],
3588 const NodeVector& inputs) { 3588 const NodeVector& inputs) {
3589 has_simd_ = true; 3589 has_simd_ = true;
3590 switch (lanes) { 3590 return graph()->NewNode(jsgraph()->machine()->S8x16Shuffle(shuffle),
3591 case 4: 3591 inputs[0], inputs[1]);
3592 return graph()->NewNode(jsgraph()->machine()->S32x4Shuffle(shuffle),
3593 inputs[0], inputs[1]);
3594 case 8:
3595 return graph()->NewNode(jsgraph()->machine()->S16x8Shuffle(shuffle),
3596 inputs[0], inputs[1]);
3597 case 16:
3598 return graph()->NewNode(jsgraph()->machine()->S8x16Shuffle(shuffle),
3599 inputs[0], inputs[1]);
3600 default:
3601 UNREACHABLE();
3602 }
3603 } 3592 }
3604 3593
3605 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, 3594 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag,
3606 Isolate* isolate, Handle<Code> code, 3595 Isolate* isolate, Handle<Code> code,
3607 const char* message, uint32_t index, 3596 const char* message, uint32_t index,
3608 const wasm::WasmName& module_name, 3597 const wasm::WasmName& module_name,
3609 const wasm::WasmName& func_name) { 3598 const wasm::WasmName& func_name) {
3610 DCHECK(isolate->logger()->is_logging_code_events() || 3599 DCHECK(isolate->logger()->is_logging_code_events() ||
3611 isolate->is_profiling()); 3600 isolate->is_profiling());
3612 3601
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
4083 wasm::ErrorThrower* thrower, Isolate* isolate, 4072 wasm::ErrorThrower* thrower, Isolate* isolate,
4084 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) { 4073 wasm::ModuleBytesEnv* module_env, const wasm::WasmFunction* function) {
4085 WasmCompilationUnit unit(isolate, module_env, function); 4074 WasmCompilationUnit unit(isolate, module_env, function);
4086 unit.ExecuteCompilation(); 4075 unit.ExecuteCompilation();
4087 return unit.FinishCompilation(thrower); 4076 return unit.FinishCompilation(thrower);
4088 } 4077 }
4089 4078
4090 } // namespace compiler 4079 } // namespace compiler
4091 } // namespace internal 4080 } // namespace internal
4092 } // namespace v8 4081 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/function-body-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698