diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-03 22:01:14 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-03 22:01:14 -0700 |
commit | c7d7083920ddd9ff7d1a44577287b8ecc048a221 (patch) | |
tree | 1eb9e0cd2e50566b62f65171ccc35b29f8ca5c4d /src/passes/Print.cpp | |
parent | 5b2adeb4b2a66dfcda7667ce7a4c27ec49c62b1b (diff) | |
download | binaryen-c7d7083920ddd9ff7d1a44577287b8ecc048a221.tar.gz binaryen-c7d7083920ddd9ff7d1a44577287b8ecc048a221.tar.bz2 binaryen-c7d7083920ddd9ff7d1a44577287b8ecc048a221.zip |
Harmonize the internal opcodes with the binary format (#433)
* harmonize the internal opcodes with the binary format, so they clearly parallel, and also this helps us avoid needing the type to disambiguate
* comment on GetLocal in C API
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 1a62de4f3..85ecd9724 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -299,18 +299,28 @@ struct PrintSExpression : public Visitor<PrintSExpression> { 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/" << (curr->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 TruncSFloat32ToInt32: + case TruncSFloat32ToInt64: o << "trunc_s/f32"; break; + case TruncUFloat32ToInt32: + case TruncUFloat32ToInt64: o << "trunc_u/f32"; break; + case TruncSFloat64ToInt32: + case TruncSFloat64ToInt64: o << "trunc_s/f64"; break; + case TruncUFloat64ToInt32: + case TruncUFloat64ToInt64: o << "trunc_u/f64"; break; + case ReinterpretFloat32: + case ReinterpretFloat64: o << "reinterpret/" << (curr->type == i64 ? "f64" : "f32"); break; + case ConvertUInt32ToFloat32: + case ConvertUInt32ToFloat64: o << "convert_u/i32"; break; + case ConvertSInt32ToFloat32: + case ConvertSInt32ToFloat64: o << "convert_s/i32"; break; + case ConvertUInt64ToFloat32: + case ConvertUInt64ToFloat64: o << "convert_u/i64"; break; + case ConvertSInt64ToFloat32: + case ConvertSInt64ToFloat64: o << "convert_s/i64"; break; case PromoteFloat32: o << "promote/f32"; break; case DemoteFloat64: o << "demote/f64"; break; - case ReinterpretInt: o << "reinterpret/" << (curr->type == f64 ? "i64" : "i32"); break; + case ReinterpretInt32: + case ReinterpretInt64: o << "reinterpret/" << (curr->type == f64 ? "i64" : "i32"); break; default: abort(); } incIndent(); |