This is an archive of the discontinued LLVM Phabricator instance.

[APFloat] Add support for operations on Signaling NaN
ClosedPublic

Authored by ekatz on Nov 3 2019, 12:57 PM.

Diff Detail

Event Timeline

ekatz created this revision.Nov 3 2019, 12:57 PM
arsenm added a subscriber: arsenm.Nov 3 2019, 1:13 PM
arsenm added inline comments.
llvm/unittests/ADT/APFloatTest.cpp
1867

Why the 1?

1893

Why the 1?

ekatz marked an inline comment as done.Nov 3 2019, 1:33 PM
ekatz added inline comments.
llvm/unittests/ADT/APFloatTest.cpp
1867

The 1 is the payload. A signaling NaN must have a payload. By default it is the highest bit after the "quiet" bit. To make the test more deterministic and not rely on implementation specifics, we define the payload explicitly. We will need the payload to make sure that when, later, a signaling NaN becomes a quiet NaN, it still has the same payload.

arsenm added inline comments.Nov 3 2019, 2:08 PM
llvm/unittests/ADT/APFloatTest.cpp
1867

A few more different payload values might be good, to be sure this isn't just a single bit preserved

ekatz added a reviewer: scanon.Nov 3 2019, 8:27 PM
ekatz marked an inline comment as done.Nov 4 2019, 10:39 AM
ekatz added inline comments.
llvm/unittests/ADT/APFloatTest.cpp
1867

Maybe just use a unique payload instead, like "123"?

simoll added a subscriber: simoll.Nov 4 2019, 10:59 AM
ekatz updated this revision to Diff 227919.Nov 5 2019, 10:38 AM

Use a more unique payload for sNaN tests.

arsenm accepted this revision.Nov 5 2019, 10:41 AM

LGTM

This revision is now accepted and ready to land.Nov 5 2019, 10:41 AM
This revision was automatically updated to reflect the committed changes.