From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14390 invoked by alias); 3 Jan 2008 11:47:10 -0000 Received: (qmail 14379 invoked by uid 22791); 3 Jan 2008 11:47:09 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.br.ibm.com (HELO igw2.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 03 Jan 2008 11:41:15 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw2.br.ibm.com (Postfix) with ESMTP id A2A3817F4F4 for ; Thu, 3 Jan 2008 09:35:36 -0200 (BRDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m03Bf0I84149330 for ; Thu, 3 Jan 2008 09:41:00 -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 m03BexKX021318 for ; Thu, 3 Jan 2008 09:41:00 -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 m03Bexao021315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Jan 2008 09:40:59 -0200 Subject: Re: GDB/libiberty support for IBM long double From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org In-Reply-To: <20080102182706.GA1184@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> <1199290287.13275.3.camel@gargoyle> <20080102165519.GA26437@caradoc.them.org> <1199297126.13275.7.camel@gargoyle> <20080102182706.GA1184@caradoc.them.org> Content-Type: multipart/mixed; boundary="=-xAqB7NyQIGC+gOLzz21m" Date: Thu, 03 Jan 2008 11:47:00 -0000 Message-Id: <1199360456.5315.1.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/msg00033.txt.bz2 --=-xAqB7NyQIGC+gOLzz21m Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 602 Thanks Daniel. I've checked in this version. On Wed, 2008-01-02 at 13:27 -0500, Daniel Jacobowitz wrote: > On Wed, Jan 02, 2008 at 04:05:26PM -0200, Luis Machado wrote: > > 2008-01-02 Luis Machado > > > > * doublest.c (convert_floatformat_to_doublest): Call > > floatformat_to_doublest instead of floatformat_to_double and use > > DOUBLEST variables. > > (convert_doublest_to_floatformat): Call floatformat_from_doublest > > instead of floatformat_from_double and use DOUBLEST variables. > > OK. > -- Luis Machado Software Engineer IBM Linux Technology Center --=-xAqB7NyQIGC+gOLzz21m 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: 1990 2008-01-03 Luis Machado * doublest.c (convert_floatformat_to_doublest): Call floatformat_to_doublest instead of floatformat_to_double and use DOUBLEST variables. (convert_doublest_to_floatformat): Call floatformat_from_doublest instead of floatformat_from_double and use DOUBLEST variables. Index: gdb/doublest.c =================================================================== --- gdb.orig/doublest.c 2008-01-02 08:24:41.000000000 -0800 +++ gdb/doublest.c 2008-01-02 09:53:55.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; } @@ -417,7 +417,7 @@ removed via storing in memory, and so the top half really is the result of converting to double. */ static volatile double dtop, dbot; - double dtopnv, dbotnv; + DOUBLEST dtopnv, dbotnv; dtop = (double) dfrom; /* If the rounded top half is Inf, the bottom must be 0 not NaN or Inf. */ @@ -427,8 +427,8 @@ dbot = (double) (dfrom - (DOUBLEST) dtop); dtopnv = dtop; dbotnv = dbot; - floatformat_from_double (fmt->split_half, &dtopnv, uto); - floatformat_from_double (fmt->split_half, &dbotnv, + floatformat_from_doublest (fmt->split_half, &dtopnv, uto); + floatformat_from_doublest (fmt->split_half, &dbotnv, (uto + fmt->totalsize / FLOATFORMAT_CHAR_BIT / 2)); return; --=-xAqB7NyQIGC+gOLzz21m--