[PATCH] D143074: [LangRef] improve documentation of SNaN in the default FP environment

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 07:53:56 PST 2023


jyknight added a comment.

In D143074#4108919 <https://reviews.llvm.org/D143074#4108919>, @sepavloff wrote:

> GCC has option `-fsignaling-nans`, which may be used to turn on standard treatment of SNaNs. Clang does not have similar option, now the only way to handle SNaNs in the standard way is to turn on exception handling, which is not suitable in some cases. LLVM as a low-level component must support SNaN on an opt-in basis, but request for such support must be more selective. Anyway SNaN treatment is nor a part of strict exception handling semantics.

That's an enhancement request. Support for sNaN currently _is_ part of the strictfp mode in LLVM, and that's functionally sufficient for all cases. That said, I do agree it may be overkill (with an unnecessary performance cost) if you only wanted sNaN support but don't care about exception support. I'm not sure if there's really a use-case for sNaN without exceptions, but if someone has such a use, I wouldn't be opposed to seeing such a mode added in the future.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143074/new/

https://reviews.llvm.org/D143074



More information about the llvm-commits mailing list