diff options
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h index e8f82f47c..f59e4368f 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -250,6 +250,14 @@ private: } } + int64_t getBits() { + switch (type) { + case WasmType::i32: case WasmType::f32: return i32; + case WasmType::i64: case WasmType::f64: return i64; + default: abort(); + } + } + bool operator==(const Literal& other) const { if (type != other.type) return false; switch (type) { @@ -262,6 +270,10 @@ private: } } + bool operator!=(const Literal& other) const { + return !(*this == other); + } + static uint32_t NaNPayload(float f) { assert(std::isnan(f) && "expected a NaN"); // SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF |