From: Daniel Jacobowitz <drow@false.org>
To: Wu Zhou <woodzltc@cn.ibm.com>
Cc: bje@au1.ibm.com, gdb-patches@sources.redhat.com
Subject: Re: [RFC] Decimal Floating Point support for GDB (Part 1: patch)
Date: Wed, 12 Oct 2005 14:49:00 -0000 [thread overview]
Message-ID: <20051012144933.GA22202@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.63.0510122143200.11589@linux.site>
On Wed, Oct 12, 2005 at 10:46:22PM +0800, Wu Zhou wrote:
> > Or just use the decNumber packed representation, in value_contents().
> > Take a look at all the references to FLOATFORMAT to see how we handle
> > floating point types.
>
> I did had some looks at FLOATFORMAT, but found that there are quite
> some difference between DFP encoding format and normal binary floating
> encoding format: for example, dfp's fields is composed of combinator
> bits, exponent continuation bits and coefficient continuation bits.
> While most bfp floatformat is composed of two fields (exponent bits
> and coefficient bits). And they also have different representation
> for non-finite number (infinity and NaN).
Yes, sorry - I wasn't suggesting that you define floatformats for
these, just that you handle them in the same set of places that we
handle floatformats.
> So I am now thinking of adding a builtin type other than TYPE_CODE_FLT to
> represent dfp. This type (I am thinking of using TYPE_CODE_DECFLT) will
> have three fundamental type like TYPE_CODE_FLT for different sizes. In the
> fields it will have four fields: signedness, combinator, exponent
> continuation and coefficient continuation. And these fields will merged
> together into value.aligner.contents. In this way, we can not only
> support the setting and printing of dfp types (constants or variables),
> but also can add other feature (such as arithmetic operation) as needed.
>
> Is there any clear deficiency in this method? Do you think that it is
> feasible? and also extensible? I will start to code in this direction if
> there is not any obvous weakness.
This may be what you're saying, but the only copy of the data should be
in value_contents, not duplicated in unpacked form elsewhere.
Yes, I think introducing a new type code is a good idea; that will be
more robust than reusing TYPE_CODE_FLT. There are 230 references to
TYPE_CODE_FLT in gdb; many of them you'd want to handle DECFLT the same
way, but many you wouldn't. For instance, calling functions which take
decimal floating point arguments.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-10-12 14:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-28 4:40 Wu Zhou
2005-09-28 18:40 ` Eli Zaretskii
2005-09-29 2:12 ` Wu Zhou
2005-09-29 3:34 ` Eli Zaretskii
2005-10-02 21:00 ` Daniel Jacobowitz
2005-10-03 15:38 ` [RFC] Decimal Floating Point support for GDB (Part 1: patch)(a sidebar) Paul Gilliam
2005-10-03 15:41 ` Daniel Jacobowitz
2005-10-09 4:06 ` Wu Zhou
2005-10-09 5:23 ` [RFC] Decimal Floating Point support for GDB (Part 1: patch) Wu Zhou
2005-10-09 20:08 ` Daniel Jacobowitz
2005-10-12 14:42 ` Wu Zhou
2005-10-12 14:49 ` Daniel Jacobowitz [this message]
2005-10-18 10:02 ` [RFC] Decimal Floating Point support for GDB (Part 1: patch - Rewrited) Wu Zhou
2005-09-29 5:14 [RFC] Decimal Floating Point support for GDB (Part 1: patch) Wu Zhou
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=20051012144933.GA22202@nevyn.them.org \
--to=drow@false.org \
--cc=bje@au1.ibm.com \
--cc=gdb-patches@sources.redhat.com \
--cc=woodzltc@cn.ibm.com \
/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