diff options
author | Ben Smith <binjimin@gmail.com> | 2017-03-24 14:44:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 14:44:37 -0700 |
commit | aad6e98314bc4225dca7e12aa9795cb0ad87f21e (patch) | |
tree | f1b7ad8914a19a169e9e256f0a1dd211616df3c8 /src/interpreter.h | |
parent | 41d597d678b6443d9e8a692316271ceafd8bcc2d (diff) | |
download | wabt-aad6e98314bc4225dca7e12aa9795cb0ad87f21e.tar.gz wabt-aad6e98314bc4225dca7e12aa9795cb0ad87f21e.tar.bz2 wabt-aad6e98314bc4225dca7e12aa9795cb0ad87f21e.zip |
Support arithmetic/canonical NaN; update testsuite (#368)
Positive NaN (+nan) is defined as being a NaN value where the sign bit
is clear, the exponent is all ones, and the tag has only the "quiet" bit
set. The quiet bit is the most-significant bit of the tag. For example,
for a 32-bit float, +nan is 0x7cf00000.
"Canonical NaN" is either +nan or -nan, where -nan is +nan with the sign
bit set.
"Arithmetic NaN" is defined as any other quiet NaN (i.e. the quiet bit
must be set, but any other bit can be either 0 or 1.)
This change doesn't update the interpreter because it is only a
loosening of the previous NaN behavior.
Diffstat (limited to 'src/interpreter.h')
-rw-r--r-- | src/interpreter.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interpreter.h b/src/interpreter.h index 94125005..28b15b33 100644 --- a/src/interpreter.h +++ b/src/interpreter.h @@ -361,8 +361,10 @@ struct InterpreterThreadOptions { uint32_t pc; }; -bool is_nan_f32(uint32_t f32_bits); -bool is_nan_f64(uint64_t f64_bits); +bool is_canonical_nan_f32(uint32_t f32_bits); +bool is_canonical_nan_f64(uint64_t f64_bits); +bool is_arithmetic_nan_f32(uint32_t f32_bits); +bool is_arithmetic_nan_f64(uint64_t f64_bits); bool func_signatures_are_equal(InterpreterEnvironment* env, uint32_t sig_index_0, uint32_t sig_index_1); |