This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB/libiberty support for IBM long double
- From: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Andreas Schwab <schwab at suse dot de>, gdb-patches at sourceware dot org
- Date: Wed, 02 Jan 2008 14:11:27 -0200
- Subject: Re: GDB/libiberty support for IBM long double
- References: <200711090107.lA917ZGs027733@d12av02.megacenter.de.ibm.com> <Pine.LNX.4.64.0711130038330.29493@digraph.polyomino.org.uk> <1198783208.7822.51.camel@gargoyle> <jeprwrf6rp.fsf@sykes.suse.de> <1198852288.7822.56.camel@gargoyle> <20071230043845.GC24220@caradoc.them.org>
- Reply-to: luisgpm at linux dot vnet dot ibm dot com
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
2008-01-02 Luis Machado <luisgpm@br.ibm.com>
* 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;
}