From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30974 invoked by alias); 26 Nov 2007 21:40:33 -0000 Received: (qmail 30649 invoked by uid 22791); 26 Nov 2007 21:40:31 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 26 Nov 2007 21:40:19 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw1.br.ibm.com (Postfix) with ESMTP id 8E67A32C04F for ; Mon, 26 Nov 2007 19:34:47 -0200 (BRDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id lAQLeG4g2343038 for ; Mon, 26 Nov 2007 19:40:16 -0200 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lAQLeGpq006724 for ; Mon, 26 Nov 2007 19:40:16 -0200 Received: from [9.18.238.21] ([9.18.238.21]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id lAQLeEv6006660 for ; Mon, 26 Nov 2007 19:40:16 -0200 Subject: Re: [PATCH] PPC - Printing Decimal 128 types out of registers From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: gdb-patches@sourceware.org In-Reply-To: <1194460412.6686.34.camel@localhost> References: <1194460412.6686.34.camel@localhost> Content-Type: text/plain Date: Mon, 26 Nov 2007 21:40:00 -0000 Message-Id: <1196113213.4302.7.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00494.txt.bz2 Hi there, Did anyone have a chance to go through this one? Regards, Luis On Wed, 2007-11-07 at 16:33 -0200, Luis Machado wrote: > Hi folks, > > I'm continuing the work to enhance DFP type support on GDB. DFP types > are nativelly supported on the Power6 processor, thus they are stored in > registers as so. This patch handles the printing and setting of > Decimal128 types directly out of/in the registers. > > A Decimal128 type is stored using pairs of Floating Point registers, and > it always starts in an even-numbered register. So, we could, for > example, have a Decimal128 var taking up FPR0-FPR1, FPR10-FPR11, but > never FPR1-FPR2 or FPR23-24. > > Right now GDB isn't able to print those vars as it doesn't know they > take up more than one register. > > The idea to overcome this was to create a new set of 16 Decimal128-typed > pseudo-registers called DL (Standing for "D"ecimal "L"ong Double) that > would represent all 16 pairs of Floating Point Registers.. By using a > pseudo-register mechanism, we're able to force the DL/FPR registers to > map directly into the FPR/DL registers. > > Benefits of this change include: > > * Better printing support for Decimal128 types. We just print the > register as is. No need to include casting tricks and arrays to print > that value. > > * Straightforward way of setting Decimal128 values directly in the > registers. We just "set $dl0=1.23dl", for example, and it's > automatically set. > > * Overview of the state of 16 Decimal128 registers using the "info reg > all" command. > > > Supporting the patch there is also a number of other modifications, as > listed: > > * DFP types are now global since they were included as predefined types > in the "target-descriptions.c" file. > > * A simple testcase making sure the registers are working as expected. > > * Piece of documentation for the GDB manual. > > * Fix to display a 128-bit hex literal representation of Decimal128 > types (using "info reg"). > > Also note that this support will be available for both ppc64 and ppc32. > > Looking forward to have comments and suggestions for improvements. > > Regards, > Luis -- Luis Machado IBM Linux Technology Center e-mail: luisgpm@linux.vnet.ibm.com