This is the mail archive of the gcc-help@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] |
Andrew Troschinetz wrote:
It is not an area in which I am well versed so I probably can't give you
as good an answer as others on this list, but I'll give it a go. "Why
would it?" isn't actually a valid question, you should be asking "why
does it?" because all the tests I've done show that it does.
OK. I'd be very interested to know what values cause problems.
I believe the problem is that not all values of the sign, exponent, and
mantissa of a floating point number are valid under IEEE 754.
There isn't really any redundancy in IEEE 754. Even when a value is NaN, the payload is supposed to be preserved through loads and stores. It is quite possible, though, that on some machines sNaNs get turned into qNaNs by the act of loading into registers. I'm interested to know if that happens, hence my question. I don't think it should happen, but I'm quite prepared to believe that sometimes it does.
When you byteswap a valid floating point value you are very likely to get an invalid IEEE 754 floating point value, especially with single precision types.
You may well get a NaN, but a NaN is not an invalid IEEE 754 floating point value. I don't think there is any such thing.
-- Andrew Troschinetz Applied Research Laboratories
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |