Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sNaN removal code tolerate different sNaN encodings #43025

Merged
merged 1 commit into from
Jul 4, 2017

Commits on Jul 3, 2017

  1. Make sNaN removal code tolerate different sNaN encodings

    IEEE 754-1985 specifies the encoding of NaN floating point numbers,
    but while it mentions that NaNs can be subdivided into signaling
    and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
    formats. This led to different implementations (CPUs) having different
    encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
    but some architectures are compatible with it, while others aren't.
    Certain MIPS and PA-RISC CPUs have different encodings for signaling
    NaNs.
    
    In order to have the float <-> binary cast feature of the std library be
    portable to them, we don't mask any quiet NaNs like we did before (only
    being compliant to IEEE 754-2008 and nothing else), but instead we
    simply pass a known good NaN instead.
    
    Note that in the code removed there was a bug; the 64 bit mask for quiet
    NaNs should have been `0x0008000000000000` instead of the specified
    `0x0001000000000000`.
    est31 committed Jul 3, 2017
    Configuration menu
    Copy the full SHA
    3ba0f07 View commit details
    Browse the repository at this point in the history