Subject: Re: toolchain/21414: double to unsigned int conversion broken
To: None <netbsd-bugs@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 05/01/2003 20:22:36
> >
> > So 0x7fffffff is fine...
>
> Duh, you are right.
No, I'm wrong...
For some reason best known to itself, gcc calls _Qp_dtoq then _Qp_qtoui
when converting double to unsigned int (ie it converts the value
to a 128bit float first!).
_Qp_qtoui (quad to unsigned) is implemented in
src/lib/libc/arch/sparc64/softfloat/qp.c
as
return (unsigned int)float128_to_int32(*a);
which is just plain wrong...
In particular an unsigned version of roundAndPackInt32 (and Int64)
is needed.
David
--
David Laight: david@l8s.co.uk