summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-07 18:52:57 -0700
committerGitHub <noreply@github.com>2019-05-07 18:52:57 -0700
commit14a286971d203e3caf6f49089fe6ddc16024861f (patch)
treee20a5659bfd95dacc3f2d779f759173da065d607 /src/wasm/literal.cpp
parentda716eb233f9fe7cefc61d9d1ce54f8b8c9d9126 (diff)
downloadbinaryen-14a286971d203e3caf6f49089fe6ddc16024861f.tar.gz
binaryen-14a286971d203e3caf6f49089fe6ddc16024861f.tar.bz2
binaryen-14a286971d203e3caf6f49089fe6ddc16024861f.zip
Add except_ref type (#2081)
This adds except_ref type, which is a part of the exception handling proposal.
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp
index 3d7303e23..48b58c3ca 100644
--- a/src/wasm/literal.cpp
+++ b/src/wasm/literal.cpp
@@ -137,6 +137,7 @@ void Literal::getBits(uint8_t (&buf)[16]) const {
case Type::v128:
memcpy(buf, &v128, sizeof(v128));
break;
+ case Type::except_ref: // except_ref type is opaque
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -271,6 +272,7 @@ std::ostream& operator<<(std::ostream& o, Literal literal) {
o << "i32x4 ";
literal.printVec128(o, literal.getv128());
break;
+ case Type::except_ref: // except_ref type is opaque
case Type::unreachable:
WASM_UNREACHABLE();
}
@@ -473,6 +475,7 @@ Literal Literal::eqz() const {
case Type::f64:
return eq(Literal(double(0)));
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -491,6 +494,7 @@ Literal Literal::neg() const {
case Type::f64:
return Literal(int64_t(i64 ^ 0x8000000000000000ULL)).castToF64();
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -509,6 +513,7 @@ Literal Literal::abs() const {
case Type::f64:
return Literal(int64_t(i64 & 0x7fffffffffffffffULL)).castToF64();
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -610,6 +615,7 @@ Literal Literal::add(const Literal& other) const {
case Type::f64:
return Literal(getf64() + other.getf64());
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -628,6 +634,7 @@ Literal Literal::sub(const Literal& other) const {
case Type::f64:
return Literal(getf64() - other.getf64());
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -717,6 +724,7 @@ Literal Literal::mul(const Literal& other) const {
case Type::f64:
return Literal(getf64() * other.getf64());
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -934,6 +942,7 @@ Literal Literal::eq(const Literal& other) const {
case Type::f64:
return Literal(getf64() == other.getf64());
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();
@@ -952,6 +961,7 @@ Literal Literal::ne(const Literal& other) const {
case Type::f64:
return Literal(getf64() != other.getf64());
case Type::v128:
+ case Type::except_ref:
case Type::none:
case Type::unreachable:
WASM_UNREACHABLE();