diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-04 20:03:21 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-04 20:03:21 -0800 |
commit | 6802e5795929d3725a96a3e2095b1ce836fb5335 (patch) | |
tree | 98f05c0ea0723aa4d0908f8563dbe6e763fcc62e /src | |
parent | e0023d29a8beade034a219b060ddf00b7c4302e9 (diff) | |
download | binaryen-6802e5795929d3725a96a3e2095b1ce836fb5335.tar.gz binaryen-6802e5795929d3725a96a3e2095b1ce836fb5335.tar.bz2 binaryen-6802e5795929d3725a96a3e2095b1ce836fb5335.zip |
more conversions
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-s-parser.h | 3 | ||||
-rw-r--r-- | src/wasm.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 4bc2c9f10..93a650ca5 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -356,7 +356,8 @@ public: } case 'r': { if (op[1] == 'e') { - return makeBinary(s, op[4] == 'u' ? BinaryOp::RemU : BinaryOp::RemS, type); + if (op[2] == 'm') return makeBinary(s, op[4] == 'u' ? BinaryOp::RemU : BinaryOp::RemS, type); + if (op[2] == 'i') return makeConvert(s, isWasmTypeFloat(type) ? ConvertOp::ReinterpretInt : ConvertOp::ReinterpretFloat, type); } abort_on(op); } diff --git a/src/wasm.h b/src/wasm.h index a69e6ba1c..0eefdbc24 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -687,14 +687,14 @@ public: 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 ReinterpretFloat: o << "reinterpret/" << (type == i64 ? "f64" : "f32"); 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; + case ReinterpretInt: o << "reinterpret" << (type == f64 ? "i64" : "i32"); break; default: abort(); } restoreNormalColor(o); |