-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perform NaN randomization as part of the interpretation of float bits (…
…#279) * Perform NaN randomization as part of the interpretation of float bits This removes the `THE_HOST_WANTS_TO` option, which appeared to give hosts permission to interpret NaN bits how they "want to". The change here is to say that all core-wasm NaN bitpatterns are interpreted as the same component-model NaN value. It's my understanding that the `random_nan_bits` function isn't meant to be the precise algorithm that nondeterministic-profile implementations must use, so this doesn't require hosts to do any new randomization work. This change also fixes what appears to be a bug: `lift_flat_variant`/`lower_flat_variant` were calling `reinterpret_i32_as_float`/`reinterpret_float_as_i32` without performing NaN scrambling. By making NaN scrambling be part of interpretation, we ensure that it's performed anywhere interpretation is performed. * Remove now-redundant scramble calls. * Canonicalize rather than scramble on lifting. * Add comments explaining the NaN rules. * Convert code comments into prose text. And reword to better fit it in with the rest of the prose. * Rename `reinterpret_` functions to `encode_`/`decode_`. * Update design/mvp/CanonicalABI.md Co-authored-by: Luke Wagner <mail@lukewagner.name> --------- Co-authored-by: Luke Wagner <mail@lukewagner.name>
- Loading branch information
1 parent
29126b3
commit aba0746
Showing
3 changed files
with
141 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters