summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-29 20:51:18 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-29 22:16:58 -0800
commitd26cd0e48e948862b545d4fbf98c98b0978d1022 (patch)
treeaebefc671f5446e189a8fc48adfd3e94fe07f905 /src
parenta7dccb1294a258793203720b1dc889a5993c95bb (diff)
downloadbinaryen-d26cd0e48e948862b545d4fbf98c98b0978d1022.tar.gz
binaryen-d26cd0e48e948862b545d4fbf98c98b0978d1022.tar.bz2
binaryen-d26cd0e48e948862b545d4fbf98c98b0978d1022.zip
unary in binary format
Diffstat (limited to 'src')
-rw-r--r--src/wasm-binary.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index dec991add..f0d194cab 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -518,6 +518,35 @@ public:
}
}
void visitUnary(Unary *curr) {
+ switch (op) {
+ case Clz: o << int8_t(curr->type == i32 ? I32Clz : I64Clz); break;
+ case Ctz: o << int8_t(curr->type == i32 ? I32Ctz : I64Ctz); break;
+ case Popcnt: o << int8_t(curr->type == i32 ? I32Popcnt : I64Popcnt); break;
+ case Neg: o << int8_t(curr->type == f32 ? F32Neg : F64Neg); break;
+ case Abs: o << int8_t(curr->type == f32 ? F32Abs : F64Abs); break;
+ case Ceil: o << int8_t(curr->type == f32 ? F32Ceil : F64Ceil); break;
+ case Floor: o << int8_t(curr->type == f32 ? F32Floor : F64Floor); break;
+ case Trunc: o << int8_t(curr->type == f32 ? F32Trunc : F64Trunc); break;;
+ case Nearest: o << int8_t(curr->type == f32 ? F32NearestInt : F64NearestInt); break;
+ case Sqrt: o << int8_t(curr->type == f32 ? F32Sqrt : F64Sqrt); break;
+ case ExtendSInt32: o << "extend_s/i32"; break;
+ case ExtendUInt32: o << "extend_u/i32"; break;
+ case WrapInt64: o << "wrap/i64"; break;
+ case TruncSFloat32: // XXX no signe/dunsigned versions of trunc?
+ case TruncUFloat32: // XXX
+ case TruncSFloat64: // XXX
+ case TruncUFloat64: // XXX
+ case ReinterpretFloat: // XXX missing
+ case ConvertUInt32: o << int8_t(curr->type == f32 ? I32UConvertF32 : I32UConvertF64); break;
+ case ConvertSInt32: o << int8_t(curr->type == f32 ? I32SConvertF32 : I32SConvertF64); break;
+ case ConvertUInt64: o << int8_t(curr->type == f32 ? I64UConvertF32 : I64UConvertF64); break;
+ case ConvertSInt64: o << int8_t(curr->type == f32 ? I64UConvertF32 : I64UConvertF64); break;
+ case PromoteFloat32: // XXX
+ case DemoteFloat64: // XXX
+ case ReinterpretInt: // XXX
+ default: abort();
+ }
+ visit(curr->value);
}
void visitBinary(Binary *curr) {
}