summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2016-03-21 15:33:46 -0700
committerDerek Schuff <dschuff@chromium.org>2016-03-21 15:33:46 -0700
commitb2489b81b9b6fef70e4cbb0af913734442d2bd03 (patch)
tree70fd888d74b9cf9996976352591f75343ecf81b5 /src/wasm.h
parentc34ed229b2df8bf4e8d0773917d0301c034980e3 (diff)
downloadbinaryen-b2489b81b9b6fef70e4cbb0af913734442d2bd03.tar.gz
binaryen-b2489b81b9b6fef70e4cbb0af913734442d2bd03.tar.bz2
binaryen-b2489b81b9b6fef70e4cbb0af913734442d2bd03.zip
Make type of EqZ unary operators always i32
This makes them symmetric to binary relational operators. Also support eqz in the s2wasm parser.
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 2fcc3cddc..7422dd85d 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -681,8 +681,10 @@ public:
// Operators
enum UnaryOp {
- Clz, Ctz, Popcnt, EqZ, // int
+ Clz, Ctz, Popcnt, // int
Neg, Abs, Ceil, Floor, Trunc, Nearest, Sqrt, // float
+ // relational
+ EqZ,
// conversions
ExtendSInt32, ExtendUInt32, WrapInt64, TruncSFloat32, TruncUFloat32, TruncSFloat64, TruncUFloat64, ReinterpretFloat, // int
ConvertSInt32, ConvertUInt32, ConvertSInt64, ConvertUInt64, PromoteFloat32, DemoteFloat64, ReinterpretInt // float
@@ -972,6 +974,11 @@ public:
UnaryOp op;
Expression *value;
+
+ // the type is always the type of the operands,
+ // except for relationals
+
+ bool isRelational() { return op == EqZ; }
};
class Binary : public Expression {