summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-04-11 12:02:29 -0700
committerGitHub <noreply@github.com>2018-04-11 12:02:29 -0700
commit92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb (patch)
tree671827c29364ef509ce2a6ba050d9b119c54c9cc /src/wasm.h
parent9b5ce471992033eeec9a8779bce55f2429496431 (diff)
downloadbinaryen-92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb.tar.gz
binaryen-92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb.tar.bz2
binaryen-92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb.zip
Some simple integer math opts (#1504)
Stuff like x + 5 != 2 => x != -3. Also some cleanups of utility functions I noticed while writing this, isTypeFloat => isFloatType. Inspired by https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/gen/generic.rules
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 9d8648308..6277d32fc 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -109,6 +109,8 @@ enum UnaryOp {
// Extend signed subword-sized integer. This differs from e.g. ExtendSInt32
// because the input integer is in an i64 value insetad of an i32 value.
ExtendS8Int32, ExtendS16Int32, ExtendS8Int64, ExtendS16Int64, ExtendS32Int64,
+
+ InvalidUnary
};
enum BinaryOp {
@@ -135,6 +137,8 @@ enum BinaryOp {
// relational ops
EqFloat64, NeFloat64, // int or float
LtFloat64, LeFloat64, GtFloat64, GeFloat64, // float
+
+ InvalidBinary
};
enum HostOp {