From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26961 invoked by alias); 14 Mar 2004 01:58:24 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26696 invoked from network); 14 Mar 2004 01:58:22 -0000 Received: from unknown (HELO are.twiddle.net) (64.81.246.98) by sources.redhat.com with SMTP; 14 Mar 2004 01:58:22 -0000 Received: from are.twiddle.net (localhost.localdomain [127.0.0.1]) by are.twiddle.net (8.12.8/8.12.8) with ESMTP id i2E1wMqb019775; Sat, 13 Mar 2004 17:58:22 -0800 Received: (from rth@localhost) by are.twiddle.net (8.12.8/8.12.8/Submit) id i2E1wLIT019773; Sat, 13 Mar 2004 17:58:21 -0800 X-Authentication-Warning: are.twiddle.net: rth set sender to rth@twiddle.net using -f Date: Sun, 14 Mar 2004 01:58:00 -0000 From: Richard Henderson To: Jakub Jelinek Cc: libc-alpha@sources.redhat.com, gcc@gcc.gnu.org, debian-glibc@lists.debian.org Subject: Re: [rfc] alpha-linux changing to 128-bit long double Message-ID: <20040314015821.GA19652@twiddle.net> References: <20040307055826.GA1244@twiddle.net> <20040313080806.GM3822@sunsite.ms.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040313080806.GM3822@sunsite.ms.mff.cuni.cz> User-Agent: Mutt/1.4i X-SW-Source: 2004-03/txt/msg00625.txt.bz2 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~