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

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

Issue 2498283002: [wasm] implement simd lowering for replaceLane, load, store and test for phi (Closed)
Patch Set: Created 4 years, 1 month 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
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index ff6af34a02089e0831878d92374236ab42ac069a..7d63e3b491758419b0c3d5ce1f95ac8e6270912b 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -1335,6 +1335,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) {
@@ -1346,6 +1358,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) {

Powered by Google App Engine
This is Rietveld 408576698