[PATCH] D41868: APFloat/x87: Fix string conversion for "unnormal" values (pr35860)

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 06:25:23 PST 2018


labath added a comment.

In https://reviews.llvm.org/D41868#987776, @scanon wrote:

> My recollection is that on 386 and later unnormals with a zero significand are treated as an invalid operand; should these print as 0 or as NaN?


I was going off of the comment before `initFromF80LongDoubleAPInt`, which states that APFloat treats unnormals as regular values (i.e., like a pre-386 processor would). As far as I can tell this statement is true: the non-zero unnormal values will print out correctly (I haven't tried doing arithmetic on them).

So, this only makes sure that we treat "unnormal zero" the same way as other unnormal numbers. However, I can certainly see a case for printing them out differently. This would even be preferable for the debugger use case. OTOH, that will likely be a much more intrusive change than this.


https://reviews.llvm.org/D41868





More information about the llvm-commits mailing list