[rfc] alpha-linux changing to 128-bit long double
Richard Henderson
rth@twiddle.net
Sun Mar 14 01:58:00 GMT 2004
On Sat, Mar 13, 2004 at 09:08:06AM +0100, Jakub Jelinek wrote:
> On the other side, Alpha is not the only arch which want long double
> and changing SONAME is really painful.
I was noticing this.
> http://sources.redhat.com/ml/libc-hacker/2002-08/msg00102.html
> was my initial attempt to handle this (even including support for
> compilation with 64bit or 128bit long double), it just did not handle
> *printf/*scanf, but I wrote in there how could that be solved.
My thought for handling printf/scanf was to do something like
sysdeps/generic/ldouble-compat.h:
#define DOUBLE_LDOUBLE_SAME_P (sizeof(double) == sizeof(long double))
sysdeps/alpha/ldouble-compat.h:
extern __thread int __libc_double_ldouble_same;
#define DOUBLE_LDOUBLE_SAME_P __libc_double_ldouble_same
and then use that like so:
vfscanf.c:
if (!DOUBLE_LDOUBLE_SAME_P && (flags & LONGDBL))
{
long double d = ...
...
}
else if (flags & (LONGDBL | LONG))
{
double d = ...
...
}
else
...
which would even save a teeny bit of code for those targets that
do not plan to change to have different sized doubles. vfprintf
is somewhat more complex, since there are at least three places
where we look at va_arg, but otherwise conceptually the same.
The tls variable would get set properly by the actual user-visible
entry points. That seemed slightly easier than passing this down
as a conditionalized parameter to the internal function.
> I can revive this patch, finish it and it could be then used on
> alpha/sparc32/ppc*.
That would be cool.
r~
More information about the Libc-alpha
mailing list