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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 09:56:58 PST 2023


spatel added a comment.

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

> We don't know how support of SNaN is important and how large is performance gain due to dropping it. The safe solution in this case is to support both strategies and let user to choose the needed.
> According to the proposed wording SNaNs will be supported with strict exception handling only. It is not natural to couple SNaN support with FP environment because these are orthogonal things. To keep the property `SNaN + 0.0 -> QNaN` access to rounding mode or status flags is not needed, so it can be available in default environment also. Strict exception behavior is associated with substantial performance drop and it can be inappropriate for users that use them.

No substantial performance drop is implied by using strict FP; someone just needs to do the work to make it fast(er) while remaining (some subset of) strict. Previous comments said that would be a welcome enhancement if anyone wants to implement it. It's just not appropriate to make that enhancement a pre-condition for clarifying the existing default behavior.

For default FP, we actually do have an indication of how important IEEE-754-compliant SNaN handling is for most users: neither LLVM nor GCC has ever had that mode on by default, and there are no LLVM bug reports asking for SNaN handling while ignoring exceptions AFAIK. I'd be interested in seeing a real program where that mode of operation makes sense.


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

https://reviews.llvm.org/D143074



More information about the llvm-commits mailing list