From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21894 invoked by alias); 3 Dec 2003 18:44:38 -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 21850 invoked from network); 3 Dec 2003 18:44:37 -0000 Received: from unknown (HELO yosemite.airs.com) (209.128.65.135) by sources.redhat.com with SMTP; 3 Dec 2003 18:44:37 -0000 Received: (qmail 10648 invoked by uid 10); 3 Dec 2003 18:44:36 -0000 Received: (qmail 4253 invoked by uid 500); 3 Dec 2003 18:44:28 -0000 From: Ian Lance Taylor To: Carlo Wood Cc: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com Subject: Re: RFA: Support infinity, NaN, and denormalized numbers in floatformat.c References: <20031203181245.3896.qmail@gossamer.airs.com> <20031203183511.GA30132@alinoe.com> Date: Wed, 03 Dec 2003 18:44:00 -0000 In-Reply-To: <20031203183511.GA30132@alinoe.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-12/txt/msg00087.txt.bz2 Carlo Wood writes: > On Wed, Dec 03, 2003 at 01:12:45PM -0500, Ian Lance Taylor wrote: > > Here is a patch to improve the support for infinity, NaN, and > > denormalized numbers in floatformat.c. It's not clear how to handle > > these for non-IEEE formats. But the old code did entirely the wrong > > thing even when using IEEE formats, which are used by pretty much all > > modern processors. So I think we might as well do the right thing > > here. > > Sorry if this is not related - but what are you going to do > with the demangling of floating point values? I sensed a strong > opposition against the IEEE decoding - so I removed my IEEE print > routine again :/. > > But if your demangler will demangle everything as IEEE regardless > then I suppose I might as well do the same. What I'm working toward right now is permitting the caller of the demangling routines to pass in an optional array mapping floating point types to floatformat structures. Then if I see a floating point literal, I can use the floatformat structures to pull it apart. I then plan to output the literal as a C99 hex floating point constant. (A couple of people suggested this approach, and I can't think of a good reason to not do it.) If the demangler is called with no floatformat structures, then I plan to just dump out the string without any attempt to display it as a floating point number, just as I do today. This approach probably doesn't help you, since you probably don't want to deal with the floatformat routines. Anyhow, I was setting up the floatformat array when I realized that the floatformat routines were moderately bogus in that they completely failed to handle denormalized numbers. So I fixed them. I do think this is all kind of ridiculous, since I'm sure that nobody uses floating point constants in template expressions in real life. And I think that changing the mangling of floating point constants would be a much better solution for all concerned. But I don't know how to make that happen. Ian