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

Unified Diff: src/wasm/ast-decoder.cc

Issue 1991143002: Convert SIMD wasm ops to runtime function calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use NodeVector instead of std::vector Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-macro-gen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index 70f7bfdd1d7306dd8908feef1a054dbcd1ac9337..102bca96bdbc1c29aecc99ffc360d0b403112b4e 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -996,6 +996,13 @@ class WasmFullDecoder : public WasmDecoder {
len = 1 + operand.length;
break;
}
+ case kSimdPrefix: {
+ len++;
+ byte simd_index = *(pc_ + 1);
+ opcode = static_cast<WasmOpcode>(opcode << 8 | simd_index);
+ DecodeSimdOpcode(opcode);
bradnelson 2016/07/13 18:10:42 Add an --enable-wasm-simd flag, and error if this
gdeepti 2016/07/13 18:58:35 Added --enable-wasm-simd flag, falls through to in
+ break;
+ }
default:
error("Invalid opcode");
return;
@@ -1101,6 +1108,17 @@ class WasmFullDecoder : public WasmDecoder {
return 1 + operand.length;
}
+ void DecodeSimdOpcode(WasmOpcode opcode) {
+ FunctionSig* sig = WasmOpcodes::Signature(opcode);
+ compiler::NodeVector inputs(sig->parameter_count(), zone_);
+ for (int i = static_cast<int>(sig->parameter_count()); i > 0; i--) {
bradnelson 2016/07/13 18:10:42 size_t drop cast?
gdeepti 2016/07/13 18:58:35 Done.
+ Value val = Pop(i - 1, sig->GetParam(i - 1));
+ inputs[i - 1] = val.node;
+ }
+ TFNode* node = BUILD(SimdOp, opcode, inputs);
+ Push(GetReturnType(sig), node);
+ }
+
void DoReturn() {
int count = static_cast<int>(sig_->return_count());
TFNode** buffer = nullptr;
« no previous file with comments | « src/v8.gyp ('k') | src/wasm/wasm-macro-gen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698