From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30338 invoked by alias); 23 Apr 2004 14:38:26 -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 30319 invoked from network); 23 Apr 2004 14:38:24 -0000 Received: from unknown (HELO dublin.act-europe.fr) (212.157.227.154) by sources.redhat.com with SMTP; 23 Apr 2004 14:38:24 -0000 Received: from localhost (province.act-europe.fr [10.10.0.214]) by filtered-dublin.act-europe.fr (Postfix) with ESMTP id B2142229FE1; Fri, 23 Apr 2004 16:38:22 +0200 (MET DST) Received: from dublin.act-europe.fr ([10.10.0.154]) by localhost (province.act-europe.fr [10.10.0.214]) (amavisd-new, port 10024) with ESMTP id 61798-06; Fri, 23 Apr 2004 16:38:22 +0200 (CEST) Received: from berne.act-europe.fr (berne.act-europe.fr [10.10.0.165]) by dublin.act-europe.fr (Postfix) with ESMTP id 6EE98229E92; Fri, 23 Apr 2004 16:38:22 +0200 (MET DST) Received: by berne.act-europe.fr (Postfix, from userid 560) id D9059592B; Fri, 23 Apr 2004 10:38:21 -0400 (EDT) Date: Fri, 23 Apr 2004 14:38:00 -0000 From: Jerome Guitton To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] powerpc - extract a float return value Message-ID: <20040423143821.GA27351@act-europe.fr> References: <20040420180348.GA23715@act-europe.fr> <20040421105415.12577df1@saguaro> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <20040421105415.12577df1@saguaro> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at act-europe.fr X-SW-Source: 2004-04/txt/msg00567.txt.bz2 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1087 Kevin Buettner (kevinb@redhat.com): > The rs6000 return value code will need to be revamped to not refer to > DEPRECATED_REGISTER_BYTE. And, in fact, it probably ought to be > restructured to use the mechanisms found in ppc-linux.c. See > ppc_linux_return_value() and ppc_sysv_abi_return_value(). This > is not a barrier to getting your current patch in; I only mention > it in case you wish to tackle this bit of work too. Sorry, I would not really easy for me, I do not have a convenient setup for PPC (that is actually the reason why it took me 3 days to be able to test against the testsuite :-) > > I have not yet tested it against the testsuite, I will do that > > tomorrow. In the meantime, if you have comments I would be happy to > > address them! > > Please let me know the results of your tests. If they look good, > please commit your patch. OK, thanks. Tested on the ppc-elf simulator, on a x86-linux host. No regression. I have slightly modified the patch, I do not see any reason to have a special case for doubles now. OK to apply with this change? -- Jerome --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diff.3" Content-length: 1489 2004-04-23 Jerome Guitton * rs6000-tdep.c (rs6000_extract_return_value): When extracting a float, use convert_typed_floating to get the appropriate format. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.191 diff -u -p -r1.191 rs6000-tdep.c --- rs6000-tdep.c 1 Apr 2004 21:00:59 -0000 1.191 +++ rs6000-tdep.c 21 Apr 2004 10:14:03 -0000 @@ -1251,22 +1251,15 @@ rs6000_extract_return_value (struct type if (TYPE_CODE (valtype) == TYPE_CODE_FLT) { - double dd; - float ff; /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes. We need to truncate the return value into float size (4 byte) if necessary. */ - if (TYPE_LENGTH (valtype) > 4) /* this is a double */ - memcpy (valbuf, - ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], - TYPE_LENGTH (valtype)); - else - { /* float */ - memcpy (&dd, ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8); - ff = (float) dd; - memcpy (valbuf, &ff, sizeof (float)); - } + convert_typed_floating (®buf[DEPRECATED_REGISTER_BYTE + (FP0_REGNUM + 1)], + builtin_type_double, + valbuf, + valtype); } else if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_LENGTH (valtype) == 16 --a8Wt8u1KmwUX3Y2C--