[PATCH] D143074: [LangRef] improve documentation of SNaN in the default FP environment
Serge Pavlov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 20:58:02 PST 2023
sepavloff added a comment.
In D143074#4108036 <https://reviews.llvm.org/D143074#4108036>, @jyknight wrote:
>> The property of SNaN like SNan + 0.0 -> QNaN is not related to exceptions and must be preserved in default environment also.
>
> Neither GCC nor Clang have considered sNaN-related semantics important to provide by default thus far, and I don't think we ought to start now, either. We should continue to support them on an opt-in basis -- at least as far as the end-to-end behavior goes for Clang users. (If there's some good reason to do so, it'd be fine to contemplate changing the IR-level defaults.)
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143074/new/
https://reviews.llvm.org/D143074
More information about the llvm-commits
mailing list