diff options
author | lizhengxing <unixhaha@gmail.com> | 2018-03-15 20:46:46 -0700 |
---|---|---|
committer | Ben Smith <binjimin@gmail.com> | 2018-03-15 20:46:46 -0700 |
commit | bff679779509ab1bb0c923bc4e67cf88eaadfa42 (patch) | |
tree | 2f2c48150fad07aa1479a8a90f5540a95f318596 /src/wast-parser.cc | |
parent | e31a5623815a545e57db3eb0ec3988025b1b0f0e (diff) | |
download | wabt-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.cc | 10 |
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"); |