Possible long double bug fix (Problem Report sparc64/55773)
Stephen Paskaluk
stephen.paskaluk at gmail.com
Thu Dec 23 09:12:11 PST 2004
On Thu, 23 Dec 2004 05:03:11 -0600, R. Tyler Ballance <tyler at tamu.edu> wrote:
> sap@ (of the MirOS project) has come up with a patch to fix this bug,
> which in my rudimentary testing on my Ultra2 seems to prove that it
> works.
> The .diff file can be found here:
> http://dero.tamu.edu/~tyler/code/freebsd/fpu_qp.diff
I did some more testing, this patch doesn't fix the problems
completely. It fixes the sign detection, but there's also a problem
with the magnitude calculation because __fpu_xtof (IIRC, I'm just
going from memory here) will do a two's complement before determining
the magnitude. So something like 0xffffffffffffffff will return -1.0
when signed and 1.0 when unsigned. This didn't come up in earlier
testing because the border case of 0x8000000000000000 is equal it's
own two's complement. There are two potential fixes I can think of,
the first is to for __fpu_xtof() to test fp_sign before doing the
two's complement. The second is to implement __fpu_uxtof(). The same
problem exists with with __fpu_itof().
I think the sign check is probably sufficient, I'll try to put
together and test a patch shortly but I'm busier today than I was
yesterday.
Cheers,
--
Stephen Paskaluk
More information about the freebsd-sparc64
mailing list