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

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

Issue 2300753005: [wasm] fix Simd ExtractLane to take immediate instead of param (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 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 2872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2883 // TODO(gdeepti): Introduce Simd128Constant to common-operator.h and use 2883 // TODO(gdeepti): Introduce Simd128Constant to common-operator.h and use
2884 // instead of creating a SIMD Value. 2884 // instead of creating a SIMD Value.
2885 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), 2885 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(),
2886 Int32Constant(0), Int32Constant(0), Int32Constant(0), 2886 Int32Constant(0), Int32Constant(0), Int32Constant(0),
2887 Int32Constant(0)); 2887 Int32Constant(0));
2888 } 2888 }
2889 2889
2890 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, 2890 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
2891 const NodeVector& inputs) { 2891 const NodeVector& inputs) {
2892 switch (opcode) { 2892 switch (opcode) {
2893 case wasm::kExprI32x4ExtractLane:
2894 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(),
2895 inputs[0], inputs[1]);
2896 case wasm::kExprI32x4Splat: 2893 case wasm::kExprI32x4Splat:
2897 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0], 2894 return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0],
2898 inputs[0], inputs[0], inputs[0]); 2895 inputs[0], inputs[0], inputs[0]);
2899 default: 2896 default:
2900 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr); 2897 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
2901 } 2898 }
2902 } 2899 }
2903 2900
2901 Node* WasmGraphBuilder::SimdExtractLane(wasm::WasmOpcode opcode, uint8_t lane,
2902 Node* input) {
2903 switch (opcode) {
2904 case wasm::kExprI32x4ExtractLane:
2905 return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), input,
2906 Int32Constant(lane));
2907 default:
2908 return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
2909 }
2910 }
2911
gdeepti 2016/09/01 00:52:52 This can be merged into the function above by taki
aseemgarg 2016/09/02 22:40:12 I'm not keen on having a single function as there
2904 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag, 2912 static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag,
2905 Isolate* isolate, Handle<Code> code, 2913 Isolate* isolate, Handle<Code> code,
2906 const char* message, uint32_t index, 2914 const char* message, uint32_t index,
2907 const wasm::WasmName& module_name, 2915 const wasm::WasmName& module_name,
2908 const wasm::WasmName& func_name) { 2916 const wasm::WasmName& func_name) {
2909 DCHECK(isolate->logger()->is_logging_code_events() || 2917 DCHECK(isolate->logger()->is_logging_code_events() ||
2910 isolate->is_profiling()); 2918 isolate->is_profiling());
2911 2919
2912 ScopedVector<char> buffer(128); 2920 ScopedVector<char> buffer(128);
2913 SNPrintF(buffer, "%s#%d:%.*s:%.*s", message, index, module_name.length(), 2921 SNPrintF(buffer, "%s#%d:%.*s:%.*s", message, index, module_name.length(),
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3249 function_->code_start_offset), 3257 function_->code_start_offset),
3250 compile_ms); 3258 compile_ms);
3251 } 3259 }
3252 3260
3253 return code; 3261 return code;
3254 } 3262 }
3255 3263
3256 } // namespace compiler 3264 } // namespace compiler
3257 } // namespace internal 3265 } // namespace internal
3258 } // namespace v8 3266 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/ast-decoder.cc » ('j') | src/wasm/ast-decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698