This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
- From: "zxClhzAApX1EdJwQANqrjLERmFeURQVy at cynd dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Jul 2013 11:53:31 +0000
- Subject: [Bug target/57484] 'std::numeric_limits< T >::signaling_NaN()' signaling-bit is incorrect for x86 32-bit.
- Auto-submitted: auto-generated
- References: <bug-57484-4 at http dot gcc dot gnu dot org/bugzilla/>
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?