[LLVMbugs] [Bug 1688] Assertion failed: (APInt::tcCompare(dividend, divisor, partsCount) >= 0)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Sep 20 17:08:58 PDT 2007


Dale Johannesen <dalej at apple.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Dale Johannesen <dalej at apple.com>  2007-09-20 19:08:56 ---
This is fixed.  It turns out to be interesting, at least for those interested
in APFloat (both of us).

First, Neil's code originally added 1 to the precision when computing the
number of words for the mantissa; I mistakenly thought this had something to do
with the integer bit, and turned it off for x87 long double.  In fact that
extra bit is needed for (at least) the divide algorithm to work right.  That
was the immediate cause of the crash; I put it back the way it was.

However, fixing that requires 2 words rather than 1 to store x87 mantissas,
which exposed a problem in APFloat::convert.  Converting to a type with more
words than the incoming type is handled correctly, but when the incoming type
is 2 words and the outgoing type is only 1 (where the mantissa is stored
directly rather than by following a pointer), the corresponding conversion
wasn't done.  I have fixed this for the x87->float/double case, where the
obvious truncation preserves all 64 bits with information in them; I think this
case is correct.   However I think there would be issues with rounding if you
are losing information, as in shortening IEEEquad.  Neil, this isn't urgent,
but could you look at it sometime?  Thanks.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list