From 92afb40eea6e9a09af2d355ff9ab6a4bd04c54bb Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 11 Apr 2018 12:02:29 -0700 Subject: 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 --- src/wasm.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/wasm.h') 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 { -- cgit v1.2.3