summaryrefslogtreecommitdiff
path: root/src/wast-parser.cc
diff options
context:
space:
mode:
authorlizhengxing <unixhaha@gmail.com>2018-03-13 11:18:34 -0700
committerBen Smith <binjimin@gmail.com>2018-03-13 11:18:34 -0700
commit0652fa7e6cd1a8413ad5088d005865f48905de7f (patch)
tree2770b41dc98be019cebc5af71f9d76347d0cb459 /src/wast-parser.cc
parentba6b56615d9a70da1a28c0d749f586405f2c7e6b (diff)
downloadwabt-0652fa7e6cd1a8413ad5088d005865f48905de7f.tar.gz
wabt-0652fa7e6cd1a8413ad5088d005865f48905de7f.tar.bz2
wabt-0652fa7e6cd1a8413ad5088d005865f48905de7f.zip
Simd i8x16.extract_lane_s instruction implementation. (#802)
Including: 1. All necessary code for SIMD lanes accessing. 2. i8x16.extract_lane_s implementation.
Diffstat (limited to 'src/wast-parser.cc')
-rw-r--r--src/wast-parser.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wast-parser.cc b/src/wast-parser.cc
index d62a277b..cd9b7bb1 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -173,6 +173,7 @@ bool IsPlainInstr(TokenType token_type) {
case TokenType::AtomicWake:
case TokenType::AtomicWait:
case TokenType::Ternary:
+ case TokenType::SimdLaneOp:
return true;
default:
return false;
@@ -1495,6 +1496,15 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) {
break;
}
+ case TokenType::SimdLaneOp: {
+ Token token = Consume();
+ ErrorUnlessOpcodeEnabled(token);
+ uint64_t lane_idx;
+ CHECK_RESULT(ParseNat(&lane_idx));
+ out_expr->reset(new SimdLaneOpExpr(token.opcode(), lane_idx, loc));
+ break;
+ }
+
default:
assert(
!"ParsePlainInstr should only be called when IsPlainInstr() is true");