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

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

Issue 2385393002: [wasm] Implement I32x4ReplaceLane, I32x4Add, I32x4Sub. (Closed)
Patch Set: Bill's review Created 4 years, 2 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 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/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 10
(...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 Int32Constant(0), Int32Constant(0), Int32Constant(0), 3012 Int32Constant(0), Int32Constant(0), Int32Constant(0),
3013 Int32Constant(0)); 3013 Int32Constant(0));
3014 } 3014 }
3015 3015
3016 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, 3016 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
3017 const NodeVector& inputs) { 3017 const NodeVector& inputs) {
3018 switch (opcode) { 3018 switch (opcode) {
3019 case wasm::kExprI32x4Splat: 3019 case wasm::kExprI32x4Splat:
3020 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], 3020 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0],
3021 inputs[0], inputs[0], inputs[0]); 3021 inputs[0], inputs[0], inputs[0]);
3022 case wasm::kExprI32x4ExtractLane:
3023 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(),
3024 inputs[0], inputs[1]);
3025 case wasm::kExprI32x4ReplaceLane:
3026 return graph()->NewNode(jsgraph()->machine()->Int32x4ReplaceLane(),
3027 inputs[0], inputs[1], inputs[2]);
3028 case wasm::kExprI32x4Add:
3029 return graph()->NewNode(jsgraph()->machine()->Int32x4Add(), inputs[0],
3030 inputs[1]);
3031 case wasm::kExprI32x4Sub:
3032 return graph()->NewNode(jsgraph()->machine()->Int32x4Sub(), inputs[0],
3033 inputs[1]);
3022 default: 3034 default:
3023 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); 3035 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
3024 } 3036 }
3025 }
3026
3027 Node* WasmGraphBuilder::SimdExtractLane(wasm::WasmOpcode opcode, uint8_t lane,
3028 Node* input) {
3029 switch (opcode) {
3030 case wasm::kExprI32x4ExtractLane:
3031 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), input,
3032 Int32Constant(lane));
3033 default:
3034 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
3035 }
3036 } 3037 }
3037 3038
3038 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, 3039 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag,
3039 Isolate* isolate, Handle<Code> code, 3040 Isolate* isolate, Handle<Code> code,
3040 const char* message, uint32_t index, 3041 const char* message, uint32_t index,
3041 const wasm::WasmName& module_name, 3042 const wasm::WasmName& module_name,
3042 const wasm::WasmName& func_name) { 3043 const wasm::WasmName& func_name) {
3043 DCHECK(isolate->logger()->is_logging_code_events() || 3044 DCHECK(isolate->logger()->is_logging_code_events() ||
3044 isolate->is_profiling()); 3045 isolate->is_profiling());
3045 3046
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
3383 function_->code_start_offset), 3384 function_->code_start_offset),
3384 compile_ms); 3385 compile_ms);
3385 } 3386 }
3386 3387
3387 return code; 3388 return code;
3388 } 3389 }
3389 3390
3390 } // namespace compiler 3391 } // namespace compiler
3391 } // namespace internal 3392 } // namespace internal
3392 } // namespace v8 3393 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698