Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 2004 10:12:10 -0700
From:      Stephen Paskaluk <stephen.paskaluk@gmail.com>
To:        "R. Tyler Ballance" <tyler@tamu.edu>
Cc:        freebsd-sparc64@freebsd.org
Subject:   Re: Possible long double bug fix (Problem Report sparc64/55773)
Message-ID:  <d8623cc4041223091225acd16e@mail.gmail.com>
In-Reply-To: <1103799791.7216.35.camel@localhost.localdomain>
References:  <1103799791.7216.35.camel@localhost.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 23 Dec 2004 05:03:11 -0600, R. Tyler Ballance <tyler@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d8623cc4041223091225acd16e>