summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-05-18 15:49:41 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-18 16:38:16 -0700
commitb88e9de7df6a8b2ba9381e27dff3aa3dff64f764 (patch)
tree6c18d2d133e388a02b289471784822b5e29ac1f2 /src/passes/Print.cpp
parentcf224aa34a3660aa5154091759d396936e946b28 (diff)
downloadbinaryen-b88e9de7df6a8b2ba9381e27dff3aa3dff64f764.tar.gz
binaryen-b88e9de7df6a8b2ba9381e27dff3aa3dff64f764.tar.bz2
binaryen-b88e9de7df6a8b2ba9381e27dff3aa3dff64f764.zip
use separate internal opcodes for unary variants
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp85
1 files changed, 48 insertions, 37 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 121287846..4559a5ce6 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -283,44 +283,55 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void visitUnary(Unary *curr) {
o << '(';
- prepareColor(o) << printWasmType(curr->isRelational() ? curr->value->type : curr->type) << '.';
+ prepareColor(o);
switch (curr->op) {
- case Clz: o << "clz"; break;
- case Ctz: o << "ctz"; break;
- case Popcnt: o << "popcnt"; break;
- case EqZ: o << "eqz"; break;
- case Neg: o << "neg"; break;
- case Abs: o << "abs"; break;
- case Ceil: o << "ceil"; break;
- case Floor: o << "floor"; break;
- case Trunc: o << "trunc"; break;
- case Nearest: o << "nearest"; break;
- case Sqrt: o << "sqrt"; break;
- case ExtendSInt32: o << "extend_s/i32"; break;
- case ExtendUInt32: o << "extend_u/i32"; break;
- case WrapInt64: o << "wrap/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: o << "reinterpret/f32"; break;
- case ReinterpretFloat64: o << "reinterpret/f64"; 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 ReinterpretInt32: o << "reinterpret/i32"; break;
- case ReinterpretInt64: o << "reinterpret/i64"; break;
+ case ClzInt32: o << "i32.clz"; break;
+ case CtzInt32: o << "i32.ctz"; break;
+ case PopcntInt32: o << "i32.popcnt"; break;
+ case EqZInt32: o << "i32.eqz"; break;
+ case ClzInt64: o << "i64.clz"; break;
+ case CtzInt64: o << "i64.ctz"; break;
+ case PopcntInt64: o << "i64.popcnt"; break;
+ case EqZInt64: o << "i64.eqz"; break;
+ case NegFloat32: o << "f32.neg"; break;
+ case AbsFloat32: o << "f32.abs"; break;
+ case CeilFloat32: o << "f32.ceil"; break;
+ case FloorFloat32: o << "f32.floor"; break;
+ case TruncFloat32: o << "f32.trunc"; break;
+ case NearestFloat32: o << "f32.nearest"; break;
+ case SqrtFloat32: o << "f32.sqrt"; break;
+ case NegFloat64: o << "f64.neg"; break;
+ case AbsFloat64: o << "f64.abs"; break;
+ case CeilFloat64: o << "f64.ceil"; break;
+ case FloorFloat64: o << "f64.floor"; break;
+ case TruncFloat64: o << "f64.trunc"; break;
+ case NearestFloat64: o << "f64.nearest"; break;
+ case SqrtFloat64: o << "f64.sqrt"; break;
+ case ExtendSInt32: o << "i64.extend_s/i32"; break;
+ case ExtendUInt32: o << "i64.extend_u/i32"; break;
+ case WrapInt64: o << "i32.wrap/i64"; break;
+ case TruncSFloat32ToInt32: o << "i32.trunc_s/f32"; break;
+ case TruncSFloat32ToInt64: o << "i64.trunc_s/f32"; break;
+ case TruncUFloat32ToInt32: o << "i32.trunc_u/f32"; break;
+ case TruncUFloat32ToInt64: o << "i64.trunc_u/f32"; break;
+ case TruncSFloat64ToInt32: o << "i32.trunc_s/f64"; break;
+ case TruncSFloat64ToInt64: o << "i64.trunc_s/f64"; break;
+ case TruncUFloat64ToInt32: o << "i32.trunc_u/f64"; break;
+ case TruncUFloat64ToInt64: o << "i64.trunc_u/f64"; break;
+ case ReinterpretFloat32: o << "i32.reinterpret/f32"; break;
+ case ReinterpretFloat64: o << "i64.reinterpret/f64"; break;
+ case ConvertUInt32ToFloat32: o << "f32.convert_u/i32"; break;
+ case ConvertUInt32ToFloat64: o << "f64.convert_u/i32"; break;
+ case ConvertSInt32ToFloat32: o << "f32.convert_s/i32"; break;
+ case ConvertSInt32ToFloat64: o << "f64.convert_s/i32"; break;
+ case ConvertUInt64ToFloat32: o << "f32.convert_u/i64"; break;
+ case ConvertUInt64ToFloat64: o << "f64.convert_u/i64"; break;
+ case ConvertSInt64ToFloat32: o << "f32.convert_s/i64"; break;
+ case ConvertSInt64ToFloat64: o << "f64.convert_s/i64"; break;
+ case PromoteFloat32: o << "f64.promote/f32"; break;
+ case DemoteFloat64: o << "f32.demote/f64"; break;
+ case ReinterpretInt32: o << "f32.reinterpret/i32"; break;
+ case ReinterpretInt64: o << "f64.reinterpret/i64"; break;
default: abort();
}
incIndent();