jcranmer-intel wrote:

> I have a question about interpreting the standard. The standard says each of 
> these macros "is defined if and only if the respective type contains 
> signaling NaNs." Given that by default LLVM IR gives the compiler permission 
> to treat all NaNs as if they were quiet NaNs, should we really be defining 
> these macros in the default mode?
> 
> My understanding is that these built-ins will indeed produce a signaling NaN 
> value, but the quiet/signaling behavior may not be respected by the optimizer.

The way I interpret the standard, it discusses whether or not the *format of 
the type* supports sNaNs, not whether or not the current floating-point model 
has full sNaN operational semantics. Since the IEEE 754 types support sNaNs, 
then they should have sNaN support enabled for them.

Whether or not the sNaN types are actually usable is actually envisioned by the 
standard--there's actually a `FE_SNANS_ALWAYS_SIGNAL` macro in Annex F for 
indicating whether or not sNaNs are fully following IEEE 754 operational 
semantics.

https://github.com/llvm/llvm-project/pull/162858
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to