summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 032b3f7f8..b5c575b1c 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -81,26 +81,14 @@ int64_t Literal::getBits() const {
bool Literal::operator==(const Literal& other) const {
if (type != other.type) return false;
- switch (type) {
- case Type::none: return true;
- case Type::i32: return i32 == other.i32;
- case Type::f32: return getf32() == other.getf32();
- case Type::i64: return i64 == other.i64;
- case Type::f64: return getf64() == other.getf64();
- default: abort();
- }
+ if (type == none) return true;
+ return getBits() == other.getBits();
}
bool Literal::operator!=(const Literal& other) const {
return !(*this == other);
}
-bool Literal::bitwiseEqual(const Literal& other) const {
- if (type != other.type) return false;
- if (type == none) return true;
- return getBits() == other.getBits();
-}
-
uint32_t Literal::NaNPayload(float f) {
assert(std::isnan(f) && "expected a NaN");
// SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF