summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-s-parser.h10
-rw-r--r--src/wasm.h20
2 files changed, 26 insertions, 4 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index d90c10ca6..4bc2c9f10 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -298,10 +298,12 @@ public:
if (op[3] == '_') return makeBinary(s, op[4] == 'u' ? BinaryOp::DivU : BinaryOp::DivS, type);
if (op[3] == 0) return makeBinary(s, BinaryOp::Div, type);
}
+ if (op[1] == 'e') return makeConvert(s, ConvertOp::DemoteFloat64, type);
abort_on(op);
}
case 'e': {
if (op[1] == 'q') return makeCompare(s, RelationalOp::Eq, type);
+ if (op[1] == 'x') return makeConvert(s, op[7] == 'u' ? ConvertOp::ExtendUInt32 : ConvertOp::ExtendSInt32, type);
abort_on(op);
}
case 'f': {
@@ -348,6 +350,10 @@ public:
if (op[1] == 'r') return makeBinary(s, BinaryOp::Or, type);
abort_on(op);
}
+ case 'p': {
+ if (op[1] == 'r') return makeConvert(s, ConvertOp::PromoteFloat32, type);
+ abort_on(op);
+ }
case 'r': {
if (op[1] == 'e') {
return makeBinary(s, op[4] == 'u' ? BinaryOp::RemU : BinaryOp::RemS, type);
@@ -367,6 +373,10 @@ public:
if (op[1] == 'r') return makeConvert(s, ConvertOp::TruncSFloat64, type);
abort_on(op);
}
+ case 'w': {
+ if (op[1] == 'r') return makeConvert(s, ConvertOp::WrapInt64, type);
+ abort_on(op);
+ }
case 'x': {
if (op[1] == 'o') return makeBinary(s, BinaryOp::Xor, type);
abort_on(op);
diff --git a/src/wasm.h b/src/wasm.h
index a91a1bd7f..a69e6ba1c 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -678,11 +678,23 @@ public:
std::ostream& doPrint(std::ostream &o, unsigned indent) {
o << '(';
- prepareColor(o);
+ prepareColor(o) << printWasmType(type);
switch (op) {
- case ConvertUInt32: o << "f64.convert_u/i32"; break;
- case ConvertSInt32: o << "f64.convert_s/i32"; break;
- case TruncSFloat64: o << "i32.trunc_s/f64"; break;
+ case ExtendSInt32: o << "extend_s/i32"; break;
+ case ExtendUInt32: o << "extend_u/i32"; break;
+ case WrapInt64: o << "wrap/i64"; break;
+ case TruncSFloat32: o << "trunc_s/f32"; break;
+ case TruncUFloat32: o << "trunc_u/f32"; break;
+ case TruncSFloat64: o << "trunc_s/f64"; break;
+ case TruncUFloat64: o << "trunc_u/f64"; break;
+ case ReinterpretFloat: o << "reinterpret/f64"; break;
+ case ConvertUInt32: o << "convert_u/i32"; break;
+ case ConvertSInt32: o << "convert_s/i32"; break;
+ case ConvertUInt64: o << "convert_u/i64"; break;
+ case ConvertSInt64: o << "convert_s/i64"; break;
+ case PromoteFloat32: o << "promote/f32"; break;
+ case DemoteFloat64: o << "demote/f64"; break;
+ case ReinterpretInt: o << "reinterpret/i64"; break;
default: abort();
}
restoreNormalColor(o);