diff options
author | Ben Smith <binji@chromium.org> | 2016-05-05 16:19:24 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-05-05 16:21:45 -0700 |
commit | ca9d6e81a01a731fda6be3140c38e176966aedc6 (patch) | |
tree | fdf9169de3540de64b9c219b5472f999d59f8931 /src/wasm-interpreter.c | |
parent | da449869d09d61e2f01711ca770d3d523379ab62 (diff) | |
download | wabt-ca9d6e81a01a731fda6be3140c38e176966aedc6.tar.gz wabt-ca9d6e81a01a731fda6be3140c38e176966aedc6.tar.bz2 wabt-ca9d6e81a01a731fda6be3140c38e176966aedc6.zip |
set quiet bit for nan / 0, but keep nan payload
See discussion in https://github.com/WebAssembly/spec/pull/282
Diffstat (limited to 'src/wasm-interpreter.c')
-rw-r--r-- | src/wasm-interpreter.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wasm-interpreter.c b/src/wasm-interpreter.c index 8f45831d..efba3c10 100644 --- a/src/wasm-interpreter.c +++ b/src/wasm-interpreter.c @@ -470,8 +470,7 @@ DEFINE_BITCAST(bitcast_u64_to_f64, uint64_t, double) VALUE_TYPE_##type lhs = POP_##type(); \ if (WASM_UNLIKELY(IS_ZERO_##type(rhs))) { \ if (IS_NAN_##type(lhs)) { \ - VALUE_TYPE_##type sign = (lhs & type##_SIGN_MASK); \ - PUSH_##type(sign | type##_QUIET_NAN); \ + PUSH_##type(lhs | type##_QUIET_NAN); \ } else if (IS_ZERO_##type(lhs)) { \ PUSH_##type(type##_QUIET_NAN); \ } else { \ |