Skip to content

Commit ca9d6e8

Browse files
committed
set quiet bit for nan / 0, but keep nan payload
See discussion in WebAssembly/spec#282
1 parent da44986 commit ca9d6e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/wasm-interpreter.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,7 @@ DEFINE_BITCAST(bitcast_u64_to_f64, uint64_t, double)
470470
VALUE_TYPE_##type lhs = POP_##type(); \
471471
if (WASM_UNLIKELY(IS_ZERO_##type(rhs))) { \
472472
if (IS_NAN_##type(lhs)) { \
473-
VALUE_TYPE_##type sign = (lhs & type##_SIGN_MASK); \
474-
PUSH_##type(sign | type##_QUIET_NAN); \
473+
PUSH_##type(lhs | type##_QUIET_NAN); \
475474
} else if (IS_ZERO_##type(lhs)) { \
476475
PUSH_##type(type##_QUIET_NAN); \
477476
} else { \

0 commit comments

Comments
 (0)