From: Luis Machado <luisgpm@linux.vnet.ibm.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Andreas Schwab <schwab@suse.de>, gdb-patches@sourceware.org
Subject: Re: GDB/libiberty support for IBM long double
Date: Wed, 02 Jan 2008 18:12:00 -0000 [thread overview]
Message-ID: <1199297126.13275.7.camel@gargoyle> (raw)
In-Reply-To: <20080102165519.GA26437@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 568 bytes --]
> However, could you test also replacing the two floatformat_from_double
> calls in convert_doublest_to_floatformat?
Sure. Follows the patch.
The results still show up correctly, casting doubles to long doubles and
long doubles to doubles.
===> Output <===
(gdb) set $ld=(long double)1.2
(gdb) p $ld
$8 = 1.1999999999999999555910790149937384
(gdb) p (double) $ld
$9 = 1.2
(gdb) set $ld=(double)1.2
(gdb) p $ld
$12 = 1.2
(gdb) p (long double) $ld
$13 = 1.1999999999999999555910790149937384
Regards,
--
Luis Machado
Software Engineer
IBM Linux Technology Center
[-- Attachment #2: fix_long_double.diff --]
[-- Type: text/x-patch, Size: 1990 bytes --]
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.
(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;
next prev parent reply other threads:[~2008-01-02 18:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 0:25 Joseph S. Myers
2007-10-26 0:37 ` DJ Delorie
2007-10-29 1:31 ` Joseph S. Myers
2007-11-05 22:33 ` Ping " Joseph S. Myers
2007-11-07 22:43 ` Daniel Jacobowitz
2007-11-07 23:26 ` DJ Delorie
2007-11-09 1:07 ` Ulrich Weigand
2007-11-13 0:39 ` Joseph S. Myers
2007-11-13 13:56 ` Ulrich Weigand
2007-11-13 14:37 ` Joseph S. Myers
2007-11-13 15:15 ` DJ Delorie
2007-11-13 17:58 ` Ulrich Weigand
2007-12-28 1:20 ` Luis Machado
2007-12-28 12:29 ` Andreas Schwab
2007-12-28 21:40 ` Luis Machado
2007-12-30 11:25 ` Daniel Jacobowitz
2008-01-02 16:17 ` Luis Machado
2008-01-02 17:01 ` Daniel Jacobowitz
2008-01-02 18:12 ` Luis Machado [this message]
2008-01-02 18:32 ` Daniel Jacobowitz
2008-01-03 11:47 ` Luis Machado
2007-10-26 8:05 ` Mark Kettenis
2007-10-26 15:01 ` Joseph S. Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1199297126.13275.7.camel@gargoyle \
--to=luisgpm@linux.vnet.ibm.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox