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

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

Issue 2385393002: [wasm] Implement I32x4ReplaceLane, I32x4Add, I32x4Sub. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.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 02d1db5bdad3b38998b0fd5b11e75c6202c58eab..9fabff9b578291ae98bc12bf650131854ce1cac0 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -1248,13 +1248,29 @@ class WasmFullDecoder : public WasmDecoder {
unsigned DecodeSimdOpcode(WasmOpcode opcode) {
unsigned len = 0;
switch (opcode) {
+ case kExprI32x4ReplaceLane: {
+ compiler::NodeVector inputs(3, zone_);
+ inputs[2] = Pop(1, LocalType::kWord32).node;
+ uint8_t lane = this->checked_read_u8(pc_, 2, "lane number");
+ if (lane < 0 || lane > 3) {
+ error(pc_, pc_ + 2, "invalid extract lane value");
bbudge 2016/10/04 20:34:26 s/extract/replace I think there are enough SIMD i
gdeepti 2016/11/22 01:15:20 Using LaneOperand as introduced in the ScalarLower
+ }
+ inputs[1] = builder_->Int32Constant(lane);
+ inputs[0] = Pop(0, LocalType::kSimd128).node;
+ TFNode* node = BUILD(SimdOp, opcode, inputs);
+ Push(LocalType::kSimd128, node);
+ len++;
+ break;
+ }
case kExprI32x4ExtractLane: {
+ compiler::NodeVector inputs(2, zone_);
+ inputs[0] = Pop(0, LocalType::kSimd128).node;
uint8_t lane = this->checked_read_u8(pc_, 2, "lane number");
if (lane < 0 || lane > 3) {
error(pc_, pc_ + 2, "invalid extract lane value");
}
- TFNode* input = Pop(0, LocalType::kSimd128).node;
- TFNode* node = BUILD(SimdExtractLane, opcode, lane, input);
+ inputs[1] = builder_->Int32Constant(lane);
+ TFNode* node = BUILD(SimdOp, opcode, inputs);
Push(LocalType::kWord32, node);
len++;
break;
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/wasm/wasm-macro-gen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698