summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-09-06 14:13:29 -0700
committerGitHub <noreply@github.com>2017-09-06 14:13:29 -0700
commitd2a401d27ef3592638e0e7689eebed317966334a (patch)
tree13f627f7cd3aaeb20ac1708ad1bf244bf7ec07c4 /src/wasm/wasm-validator.cpp
parent192b59a8bc8e5376ca120dc592d5abad7c654230 (diff)
downloadbinaryen-d2a401d27ef3592638e0e7689eebed317966334a.tar.gz
binaryen-d2a401d27ef3592638e0e7689eebed317966334a.tar.bz2
binaryen-d2a401d27ef3592638e0e7689eebed317966334a.zip
Add support for sign-extension operators from threading proposal (#1167)
These are not atomic operations, but are added with the atomic operations to keep from having to define atomic versions of all the sign-extending loads (an atomic zero-extending load + signext operation can be used instead).
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 8e93b1c38..5534eb7b9 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -430,8 +430,17 @@ void WasmValidator::visitUnary(Unary *curr) {
shouldBeTrue(curr->value->type == i64, curr, "i64.eqz input must be i64");
break;
}
- case ExtendSInt32: shouldBeEqual(curr->value->type, i32, curr, "extend type must be correct"); break;
- case ExtendUInt32: shouldBeEqual(curr->value->type, i32, curr, "extend type must be correct"); break;
+ case ExtendSInt32:
+ case ExtendUInt32:
+ case ExtendS8Int32:
+ case ExtendS16Int32: {
+ shouldBeEqual(curr->value->type, i32, curr, "extend type must be correct"); break;
+ }
+ case ExtendS8Int64:
+ case ExtendS16Int64:
+ case ExtendS32Int64: {
+ shouldBeEqual(curr->value->type, i64, curr, "extend type must be correct"); break;
+ }
case WrapInt64: shouldBeEqual(curr->value->type, i64, curr, "wrap type must be correct"); break;
case TruncSFloat32ToInt32: shouldBeEqual(curr->value->type, f32, curr, "trunc type must be correct"); break;
case TruncSFloat32ToInt64: shouldBeEqual(curr->value->type, f32, curr, "trunc type must be correct"); break;