From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4078 invoked by alias); 12 Oct 2005 14:49:40 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4069 invoked by uid 22791); 12 Oct 2005 14:49:35 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 12 Oct 2005 14:49:35 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1EPhvB-0005o6-3Z; Wed, 12 Oct 2005 10:49:33 -0400 Date: Wed, 12 Oct 2005 14:49:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: bje@au1.ibm.com, gdb-patches@sources.redhat.com Subject: Re: [RFC] Decimal Floating Point support for GDB (Part 1: patch) Message-ID: <20051012144933.GA22202@nevyn.them.org> Mail-Followup-To: Wu Zhou , bje@au1.ibm.com, gdb-patches@sources.redhat.com References: <20051002205724.GB31820@nevyn.them.org> <20051009200814.GB7107@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-10/txt/msg00109.txt.bz2 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