summaryrefslogtreecommitdiff
path: root/src/wasm-s-parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r--src/wasm-s-parser.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index aa7ef42b9..1ed23b190 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -462,6 +462,7 @@ public:
abort_on(op);
}
case 's': {
+ if (op[1] == 'e') return makeSelect(s, type);
if (op[1] == 'h') {
if (op[2] == 'l') return makeBinary(s, BinaryOp::Shl, type);
return makeBinary(s, op[4] == 'u' ? BinaryOp::ShrU : BinaryOp::ShrS, type);
@@ -580,6 +581,15 @@ private:
return ret;
}
+ Expression* makeSelect(Element& s, WasmType type) {
+ auto ret = allocator.alloc<Select>();
+ ret->condition = parseExpression(s[1]);
+ ret->ifTrue = parseExpression(s[2]);
+ ret->ifFalse = parseExpression(s[3]);
+ ret->type = type;
+ return ret;
+ }
+
Expression* makeHost(Element& s, HostOp op) {
auto ret = allocator.alloc<Host>();
ret->op = op;