diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2020-09-18 15:50:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-18 15:50:25 -0700 |
commit | 3b4cb935f83c7fabacbf61146e56dabc0d65a441 (patch) | |
tree | 9aaac74aad59fe2ff2b00ac6e6a77bb808b01747 /src/literal.h | |
parent | 1a928bc3ff4b511e81b3f93db8aea872e88abaaf (diff) | |
download | binaryen-3b4cb935f83c7fabacbf61146e56dabc0d65a441.tar.gz binaryen-3b4cb935f83c7fabacbf61146e56dabc0d65a441.tar.bz2 binaryen-3b4cb935f83c7fabacbf61146e56dabc0d65a441.zip |
Initial implementation of "Memory64" proposal (#3130)
Also includes a lot of new spec tests that eventually need to go into the spec repo
Diffstat (limited to 'src/literal.h')
-rw-r--r-- | src/literal.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/literal.h b/src/literal.h index 981f5b6d4..c617f56f0 100644 --- a/src/literal.h +++ b/src/literal.h @@ -117,6 +117,21 @@ public: } } + static Literal makeFromUInt64(uint64_t x, Type type) { + switch (type.getBasic()) { + case Type::i32: + return Literal(int32_t(x)); + case Type::i64: + return Literal(int64_t(x)); + case Type::f32: + return Literal(float(x)); + case Type::f64: + return Literal(double(x)); + default: + WASM_UNREACHABLE("unexpected type"); + } + } + static Literals makeZero(Type type); static Literal makeSingleZero(Type type); |