Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/test/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ def get_tests(test_dir, extensions=[], recursive=False):
'conversions.wast', # Promoted NaN should be canonical
'data.wast', # Fail to parse data segment offset abbreviation
'elem.wast', # Requires modeling empty declarative segments
'f32.wast', # Adding -0 and -nan should give a canonical NaN
'f64.wast', # Adding -0 and -nan should give a canonical NaN
'float_exprs.wast', # Adding 0 and NaN should give canonical NaN
'f32.wast', # Platform-dependent NaN propagation produces sNaN from arithmetic
'f64.wast', # Platform-dependent NaN propagation produces sNaN from arithmetic
'float_exprs.wast', # Platform-dependent NaN propagation produces sNaN from arithmetic
'float_misc.wast', # Rounding wrong on f64.sqrt
'func.wast', # Duplicate parameter names not properly rejected
'global.wast', # Fail to parse table
Expand Down
8 changes: 4 additions & 4 deletions src/wasm/literal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,16 +528,16 @@ bool Literal::isCanonicalNaN() {
if (!isNaN()) {
return false;
}
return (type == Type::f32 && NaNPayload(getf32()) == (1u << 23) - 1) ||
(type == Type::f64 && NaNPayload(getf64()) == (1ull << 52) - 1);
return (type == Type::f32 && NaNPayload(getf32()) == (1u << 22)) ||
(type == Type::f64 && NaNPayload(getf64()) == (1ull << 51));
}

bool Literal::isArithmeticNaN() {
if (!isNaN()) {
return false;
}
return (type == Type::f32 && NaNPayload(getf32()) > (1u << 23) - 1) ||
(type == Type::f64 && NaNPayload(getf64()) > (1ull << 52) - 1);
return (type == Type::f32 && (NaNPayload(getf32()) & (1u << 22))) ||
(type == Type::f64 && (NaNPayload(getf64()) & (1ull << 51)));
}

uint32_t Literal::NaNPayload(float f) {
Expand Down
Loading