This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484

--- Comment #19 from Charles L. Wilcox <zxClhzAApX1EdJwQANqrjLERmFeURQVy at cynd dot net> ---
(In reply to UroÅ Bizjak from comment #11)
> On an x86 target using the legacy x87 instructions and the 80-bit registers,
> a load of a 64-bit or 32-bit value in memory into the 80-bit registers
> counts as a format conversion and an signaling NaN input will turn into a
> quiet NaN in the register format.

Does this mean if a 80-bit sNaN was generated and loaded into a register it was
still have the signaling bit set correctly?  And if so, could this value then
be down-converted to a 32 or 64-bit float?  In C++:
    float float32_snan const
      = static_cast< float >( std::numeric_limits< long double
>::signaling_NaN() );
    double float64_snan const
      = static_cast< double >( std::numeric_limits< long double
>::signaling_NaN() );
Or, is the "cast" here a format conversion, causing the signaling NaN to
convert to a quiet NAN?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]