[PATCH] D22685: Disable shrinking of SNaN constants on SystemZ

Elliot Colp via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 11:53:23 PDT 2016


colpell added a comment.

In https://reviews.llvm.org/D22685#494797, @uweigand wrote:

> 1.) Does this actually have to be platform-specific?  I mean, is there any platform where a SNaN constant *can* be stored in converted form?  I would have expected that the type-conversion operation needed to load a "shrunk" SNaN constant would be required to actually trigger the "signaling" part of the SNaN (i.e. raise an invalid operation exception) on all platforms ...


This was my initial thought too. It doesn't seem to be a problem on x86 (we get the right value printed and no exceptions), which suggests that it's being handled somehow. I'm not sure about other platforms however.
I left this fix as platform-specific to reduce the possible impact, but if there are no expected drawbacks from disabling it globally, then I'm willing to do so.

> 2.) To detect an SNaN, you're testing for bitwise-equality against one specific SNaN value.  However, in general there can be many different SNaN values.  I think you should just test for APF.isSignaling().


Thanks, I've made this change.


https://reviews.llvm.org/D22685





More information about the llvm-commits mailing list