[llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp
Chris Lattner
clattner at apple.com
Wed Oct 8 21:48:48 PDT 2008
On Oct 7, 2008, at 3:19 PM, Neil Booth wrote:
>> When I implemented the -0.0 conversion to int, I thought that was
>> what
>> IEEE754 calls for, but I missed the definition of inexact, obscurely
>> placed in 7.4(4). 6.3 is clear that the result should have a
>> negative
>> sign, and that's not implementable on a twos complement machine, yet
>> none of the exceptions seems to apply; I guess the standard calls for
>> quietly producing an answer known to be wrong. This one really seems
>> like a bug in the standard.
>
> This one should be special-cased at the call site. I think the loss
> of IEEE semantics, which are there for good reason and may even be
> being relied on elsewhere in APFloat, is a very bad idea here.
>
> Chris, what do you think?
Dale and I discussed this today and basically came to the conclusion
that keeping APFloat as close to IEEE semantics is goodness. The
issue is that we don't really know what we're doing here :), and IEEE
is common currency among numericists. I think that it's best to
change the clients of these functions to be implemented in different
ways (e.g. fptrunc then fpextend and see if we have the same bit
pattern) or add new methods that do crazy things that are somehow
different than what IEEE says.
-Chris
More information about the llvm-commits
mailing list