diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-18 15:49:41 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-18 16:38:16 -0700 |
commit | b88e9de7df6a8b2ba9381e27dff3aa3dff64f764 (patch) | |
tree | 6c18d2d133e388a02b289471784822b5e29ac1f2 /src/wasm.h | |
parent | cf224aa34a3660aa5154091759d396936e946b28 (diff) | |
download | binaryen-b88e9de7df6a8b2ba9381e27dff3aa3dff64f764.tar.gz binaryen-b88e9de7df6a8b2ba9381e27dff3aa3dff64f764.tar.bz2 binaryen-b88e9de7df6a8b2ba9381e27dff3aa3dff64f764.zip |
use separate internal opcodes for unary variants
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/src/wasm.h b/src/wasm.h index 68c388df8..6e7ca18ce 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -775,10 +775,10 @@ private: // Operators enum UnaryOp { - Clz, Ctz, Popcnt, // int - Neg, Abs, Ceil, Floor, Trunc, Nearest, Sqrt, // float + ClzInt32, ClzInt64, CtzInt32, CtzInt64, PopcntInt32, PopcntInt64, // int + NegFloat32, NegFloat64, AbsFloat32, AbsFloat64, CeilFloat32, CeilFloat64, FloorFloat32, FloorFloat64, TruncFloat32, TruncFloat64, NearestFloat32, NearestFloat64, SqrtFloat32, SqrtFloat64, // float // relational - EqZ, + EqZInt32, EqZInt64, // conversions ExtendSInt32, ExtendUInt32, // extend i32 to i64 WrapInt64, // i64 to i32 @@ -1116,21 +1116,32 @@ public: UnaryOp op; Expression *value; - bool isRelational() { return op == EqZ; } + bool isRelational() { return op == EqZInt32 || op == EqZInt64; } void finalize() { switch (op) { - case Clz: - case Ctz: - case Popcnt: - case Neg: - case Abs: - case Ceil: - case Floor: - case Trunc: - case Nearest: - case Sqrt: type = value->type; break; - case EqZ: type = i32; break; + case ClzInt32: + case CtzInt32: + case PopcntInt32: + case NegFloat32: + case AbsFloat32: + case CeilFloat32: + case FloorFloat32: + case TruncFloat32: + case NearestFloat32: + case SqrtFloat32: + case ClzInt64: + case CtzInt64: + case PopcntInt64: + case NegFloat64: + case AbsFloat64: + case CeilFloat64: + case FloorFloat64: + case TruncFloat64: + case NearestFloat64: + case SqrtFloat64: type = value->type; break; + case EqZInt32: + case EqZInt64: type = i32; break; case ExtendSInt32: case ExtendUInt32: type = i64; break; case WrapInt64: type = i32; break; case PromoteFloat32: type = f64; break; @@ -1155,7 +1166,7 @@ public: case ConvertUInt32ToFloat64: case ConvertSInt64ToFloat64: case ConvertUInt64ToFloat64: type = f64; break; - default: WASM_UNREACHABLE(); + default: std::cerr << "waka " << op << '\n'; WASM_UNREACHABLE(); } } }; |