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

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

Issue 2498283002: [wasm] implement simd lowering for replaceLane, load, store and test for phi (Closed)
Patch Set: [wasm] implement simd lowering for replaceLane, load, store and test for phi Created 4 years 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/compiler/wasm-compiler.cc ('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 796bd9f7443412a47f0f4be1378302d00833e563..df52ede32fa62147bbb2eb127d3ed25e00fec406 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -1338,6 +1338,18 @@ class WasmFullDecoder : public WasmDecoder {
return operand.length;
}
+ unsigned ReplaceLane(WasmOpcode opcode, LocalType type) {
+ LaneOperand operand(this, pc_);
+ if (Validate(pc_, operand)) {
+ TFNode* input = Pop(0, LocalType::kSimd128).node;
+ TFNode* replacement = Pop(1, type).node;
+ TFNode* node =
+ BUILD(SimdReplaceLane, opcode, operand.lane, input, replacement);
+ Push(LocalType::kSimd128, node);
+ }
+ return operand.length;
+ }
+
unsigned DecodeSimdOpcode(WasmOpcode opcode) {
unsigned len = 0;
switch (opcode) {
@@ -1349,6 +1361,14 @@ class WasmFullDecoder : public WasmDecoder {
len = ExtractLane(opcode, LocalType::kFloat32);
break;
}
+ case kExprI32x4ReplaceLane: {
+ len = ReplaceLane(opcode, LocalType::kWord32);
+ break;
+ }
+ case kExprF32x4ReplaceLane: {
+ len = ReplaceLane(opcode, LocalType::kFloat32);
+ break;
+ }
default: {
FunctionSig* sig = WasmOpcodes::Signature(opcode);
if (sig != nullptr) {
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-macro-gen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698