Subject: Re: toolchain/21414: double to unsigned int conversion broken
To: David Laight <firstname.lastname@example.org>
From: Andrey Petrov <email@example.com>
Date: 05/01/2003 19:47:02
On Thu, May 01, 2003 at 08:22:36PM +0100, David Laight wrote:
> > >
> > > 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!).
Yeah, and I worked on this with gcc3.2.x which now don't overpromote
quad in this case.
> _Qp_qtoui (quad to unsigned) is implemented in
> return (unsigned int)float128_to_int32(*a);
> which is just plain wrong...
And as you said this operation is undefined by K&R2.
> In particular an unsigned version of roundAndPackInt32 (and Int64)
> is needed.
> David Laight: firstname.lastname@example.org