-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime: fix nearest for NaN inputs;
According to wasm's spec, nearest must do the following, for NaN inputs: - when the input is a canonical NaN, return a canonical NaN; - when the input is a non-canonical NaN, return an arithmetic NaN. This patch adds checks when the exponent is all ones if the input was a NaN, and will set the significand's most significant bit in that case. It works both for canonical inputs (which already had the bit set) and makes other NaN inputs canonical.
- Loading branch information
Showing
1 changed file
with
22 additions
and
2 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