-
Notifications
You must be signed in to change notification settings - Fork 7
Modify nan screening for Mac #501
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
Conversation
|
Here's what I have discovered. In "Release", the NaN is coming through as:
which is interpreted as an NCHOICE. In "Debug", the NaN is coming through as:
which is just a normal NaN. The change appears to be triggered by clang's optimization flag (and not specific to apple clang). I posted a Stack Overflow question about this. I couldn't find anywhere that says that certain NaN representations are reserved, and it seems that how a compiler wants to represent NaN is implementation-specific. I found this article that is pretty helpful in terms of understanding the variations of NaN. For the purposes of this PR, I suggest that we use an explicit bit set to set We should also create an issue to follow up:
|
|
After reviewing the Stack Overflow responses, I believe we should modify the ISNCHOICE mask to exclude Independently (on a separate branch), we need to review our floating point compiler options across compilers for consistency. If we use the same options in clang that we are using in MSVC, we should see more consistent NaN representation for @spahrenk can you:
Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments in PR.
|
|
|
|
Description
Provides an additional condition for satisfying ISNUM, which is used by cvpak for screening. Currently, the cvpak unit test fails when run on Mac in release mode. (It succeeds in debug.) The bitmap representation of the
float nanfgenerated by the unit test differs slightly between the two modes. The condition used to determine whether the type represents a numeric nan is(bitmap & bitmask) != bitmaskwith bitmask = 0x7f800000L
It is now also required that
(bitmap & bitmask_mac) != bitmask_macbitmask_mac = 0x7fc00000L