5 ms·
Hi, former IEEE 754 committee member here: languages and architectures are allowed to choose how they encode signalingness, but they cannot use the sign bit to
by stephencanon 4y ago
Hi, former IEEE 754 committee member here: languages and architectures are allowed to choose how they encode signalingness, but they cannot use the sign bit to do it. The most common choice is to use the high-order but of the significand field, but most choices you might make is represented by some architecture.
- robocat 4y agoAwesome! So the important part of section 6.2.1 (2008) is the “should” is not a “must”? “A quiet NaN bit string should be encoded with the first bit (d1) of the trailing significand field T being 1. A signaling NaN bit string should be encoded with the first bit of the trailing significand field being 0.“ Or is it that some implementations before 2008 used other bits? PS: I might be complaining, but I do sincerely thank you for your hard work. I certainly would not want to be on a standards committee, so I sincerely appreciate the efforts of the committed whom fight so hard to make things better. Your comment just goes to show how many corner cases there are to the corner cases!!
- jcranmer 4y agoTraditionally, PPC used a different encoding of qNaN than, well, everybody else. PPC itself would later include a hardware mode that aligned to the more universal interpretation of qNaN.
- stephencanon 4y agoIIRC MIPS does the reverse of x86 and ARM too.
- jcranmer 4y agoSorry, you're right, it's MIPS that had the two encodings--PPC had the double-double type for long double that makes things "interesting." (It seems all architectures have their own unique floating-point weirdness).
- stephencanon 4y agoIt’s a “should”, hence recommended practice. Things required for conformance are “shall”.
- saagarjha 4y agoAnd I thought signaling NaNs were bad enough already…so you’re saying there’s no portable way of testing whether a bit pattern is going to signal if you operate on it without actually doing the operation? This is incredibly cursed :/
- stephencanon 4y agoThere’s the 754 (2008) isSignaling operation, bound to the issignaling macro in C, which makes it the platform owner’s problem instead of yours.
- saagarjha 4y agoIf only the platform owner provided this operation…