Subject: Re: PR 18803 - printf(3) does not handle long double
To: None <tech-userlevel@netbsd.org>
From: Stephen Paskaluk <paskaluk@itanium.ece.ualberta.ca>
List: tech-userlevel
Date: 01/12/2005 18:59:16
On Wed, 12 Jan 2005 18:59:07 +0100, Jesper Louis Andersen wrote:
>What I am not sure about is the performance issue. Throwing everything
>into a long double (included floats and doubles) might be overkill, 
>but it is the simplemest solution. If that is not an option, I need
>somewhat seperate code paths for the long double case compared to the
>double case (which includes the float case). 

I took a look at this not too long ago as well and the same
question crossed my mind.  Before I got busy with other things
I had come to the conclusion that this is really the kind of
thing where a patch to test exactly what the performance hit
would be to convert everything to a long double.

It also depends on the exact implementation of ldtoa() or
whatever performs that function, since it should (I say should
because there's almost certainly something I haven't
considered) only take two comparisons (one for the number of 
bits used in the mantissa, the other for the size of the
exponent) to determine if the full long double conversion
actually has to be done.  ldtoa() could subsequently call
dtoa() or shortcut the conversion as appropriate.  I didn't
get a chance to look into it that much, so I'm curious to see
other thoughts on the issue as well.

-- 
Stephen Paskaluk