From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9411 invoked by alias); 2 Jan 2008 16:17:18 -0000 Received: (qmail 9289 invoked by uid 22791); 2 Jan 2008 16:17:16 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Jan 2008 16:11:45 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw1.br.ibm.com (Postfix) with ESMTP id 997DC32C084 for ; Wed, 2 Jan 2008 13:51:09 -0200 (BRDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m02GBU7N4182032 for ; Wed, 2 Jan 2008 14:11:30 -0200 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m02GBU2r016006 for ; Wed, 2 Jan 2008 14:11:30 -0200 Received: from [9.18.238.70] ([9.18.238.70]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m02GBUXa016002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Jan 2008 14:11:30 -0200 Subject: Re: GDB/libiberty support for IBM long double From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: Daniel Jacobowitz Cc: Andreas Schwab , gdb-patches@sourceware.org In-Reply-To: <20071230043845.GC24220@caradoc.them.org> References: <200711090107.lA917ZGs027733@d12av02.megacenter.de.ibm.com> <1198783208.7822.51.camel@gargoyle> <1198852288.7822.56.camel@gargoyle> <20071230043845.GC24220@caradoc.them.org> Content-Type: multipart/mixed; boundary="=-ZdscQmmmGhCjsMLJA3nM" Date: Wed, 02 Jan 2008 16:17:00 -0000 Message-Id: <1199290287.13275.3.camel@gargoyle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00024.txt.bz2 --=-ZdscQmmmGhCjsMLJA3nM Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 787 Hi, > I wonder if we really need to use floatformat_to_double instead of > floatformat_to_doublest for the split_half cases. It seems like that > relies unnecessarily on the host double format. Do things work better > if you use floatformat_to_doublest and DOUBLEST variables, instead > of floatformat_to_double (likewise floatformat_from_doublest)? The attached patch replaces the use of floatformat_to_double with floatformat_to_doublest, fixing the problem. There are other uses of floatformat_to_double in the function, by i'm not sure if we should just replace every call of that function with the "doublest" version (likewise with the floatformat_from_double -> floatformat_from_doublest replacement). Regards, -- Luis Machado Software Engineer IBM Linux Technology Center --=-ZdscQmmmGhCjsMLJA3nM Content-Disposition: attachment; filename=fix_long_double.diff Content-Type: text/x-patch; name=fix_long_double.diff; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 1072 2008-01-02 Luis Machado * doublest.c (convert_floatformat_to_doublest): Call floatformat_to_doublest instead of floatformat_to_double and use DOUBLEST variables. Index: gdb/doublest.c =================================================================== --- gdb.orig/doublest.c 2008-01-02 07:52:14.000000000 -0800 +++ gdb/doublest.c 2008-01-02 07:53:06.000000000 -0800 @@ -202,19 +202,19 @@ if (fmt->split_half) { - double dtop, dbot; - floatformat_to_double (fmt->split_half, ufrom, &dtop); + DOUBLEST dtop, dbot; + floatformat_to_doublest (fmt->split_half, ufrom, &dtop); /* Preserve the sign of 0, which is the sign of the top half. */ if (dtop == 0.0) { - *to = (DOUBLEST) dtop; + *to = dtop; return; } - floatformat_to_double (fmt->split_half, + floatformat_to_doublest (fmt->split_half, ufrom + fmt->totalsize / FLOATFORMAT_CHAR_BIT / 2, &dbot); - *to = (DOUBLEST) dtop + (DOUBLEST) dbot; + *to = dtop + dbot; return; } --=-ZdscQmmmGhCjsMLJA3nM--