summaryrefslogtreecommitdiff
path: root/src/wast-parser.cc
diff options
context:
space:
mode:
authorlizhengxing <unixhaha@gmail.com>2018-03-15 20:46:46 -0700
committerBen Smith <binjimin@gmail.com>2018-03-15 20:46:46 -0700
commitbff679779509ab1bb0c923bc4e67cf88eaadfa42 (patch)
tree2f2c48150fad07aa1479a8a90f5540a95f318596 /src/wast-parser.cc
parente31a5623815a545e57db3eb0ec3988025b1b0f0e (diff)
downloadwabt-bff679779509ab1bb0c923bc4e67cf88eaadfa42.tar.gz
wabt-bff679779509ab1bb0c923bc4e67cf88eaadfa42.tar.bz2
wabt-bff679779509ab1bb0c923bc4e67cf88eaadfa42.zip
SIMD v8x16.shuffle implementation. (#811)
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 cd9b7bb1..4d94b245 100644
--- a/src/wast-parser.cc
+++ b/src/wast-parser.cc
@@ -174,6 +174,7 @@ bool IsPlainInstr(TokenType token_type) {
case TokenType::AtomicWait:
case TokenType::Ternary:
case TokenType::SimdLaneOp:
+ case TokenType::SimdShuffleOp:
return true;
default:
return false;
@@ -1505,6 +1506,15 @@ Result WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) {
break;
}
+ case TokenType::SimdShuffleOp: {
+ Token token = Consume();
+ ErrorUnlessOpcodeEnabled(token);
+ Const const_;
+ CHECK_RESULT((ParseSimdConst(&const_, Type::I32, sizeof(v128))));
+ out_expr->reset(new SimdShuffleOpExpr(token.opcode(), const_.v128_bits, loc));
+ break;
+ }
+
default:
assert(
!"ParsePlainInstr should only be called when IsPlainInstr() is true");