From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17202 invoked by alias); 28 Sep 2011 09:39:54 -0000 Received: (qmail 17189 invoked by uid 22791); 28 Sep 2011 09:39:52 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_50,RP_MATCHES_RCVD,TW_EG X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Sep 2011 09:39:37 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id p8S9dTEf013237; Wed, 28 Sep 2011 11:39:30 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id p8S9dSHX024441; Wed, 28 Sep 2011 11:39:28 +0200 (CEST) Date: Wed, 28 Sep 2011 17:09:00 -0000 Message-Id: <201109280939.p8S9dSHX024441@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: davem@davemloft.net CC: gdb-patches@sourceware.org In-reply-to: <20110928.012027.2236138577869370946.davem@davemloft.net> (message from David Miller on Wed, 28 Sep 2011 01:20:27 -0400 (EDT)) Subject: Re: [PATCH] Fix complex float on sparc References: <20110928.012027.2236138577869370946.davem@davemloft.net> 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: 2011-09/txt/msg00470.txt.bz2 > Date: Wed, 28 Sep 2011 01:20:27 -0400 (EDT) > From: David Miller > > Lots of testcase failures have crept into the sparc targets, > I'll try to fix as many as I can. > > This gets the complex float cases of callfuncs.exp passing > again for both 32-bit and 64-bit. > > For sparc32 it's pass in memory, return in float regs. > > For sparc64 it's pass in float regs (<= 16 bytes) or memory (> 16 > bytes), always return in float regs. > > Ok to commit? Looks good. Just a small request inline... > gdb/ > > 2011-09-27 David S. Miller > > * sparc-tdep.h (SPARC_F2_REGNUM, SPARC_F3_REGNUM, SPARC_F4_REGNUM, > SPARC_F5_REGNUM, SPARC_F6_REGNUM, SPARC_F7_REGNUM): New enums. > * sparc-tdep.c (sparc_complex_floating_p): New function. > (sparc32_store_arguments): Handle complex floats. > (sparc32_extract_return_value): Likewise. > (sparc32_store_return_value): Likewise. > (sparc32_stabs_argument_has_addr): Likewise. > * sparc64-tdep.c (sparc64_complex_floating_p): New function. > (sparc64_store_floating_fields): Handle complex floats. > (sparc64_store_arguments): Likewise. > (sparc64_store_return_value): Likewise. > > diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c > index faa7b3a..8541a31 100644 > --- a/gdb/sparc-tdep.c > +++ b/gdb/sparc-tdep.c > @@ -1238,12 +1258,25 @@ sparc32_extract_return_value (struct type *type, struct regcache *regcache, > gdb_assert (!sparc_structure_or_union_p (type)); > gdb_assert (!(sparc_floating_p (type) && len == 16)); > > - if (sparc_floating_p (type)) > + if (sparc_floating_p (type) > + || sparc_complex_floating_p (type)) I would have put both conditions on the same line, since this is wasting a bit of vertical space. Don't see this list growing in the near future and I don't think there's a significant difference in readability that way. > @@ -1281,13 +1314,26 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, > gdb_assert (!(sparc_floating_p (type) && len == 16)); > gdb_assert (len <= 8); > > - if (sparc_floating_p (type)) > + if (sparc_floating_p (type) > + || sparc_complex_floating_p (type)) Same here. > diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c > index 0430ecf..097f658 100644 > --- a/gdb/sparc64-tdep.c > +++ b/gdb/sparc64-tdep.c > @@ -622,11 +642,13 @@ static void > sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > const gdb_byte *valbuf, int element, int bitpos) > { > + int len = TYPE_LENGTH (type); > + > gdb_assert (element < 16); > > - if (sparc64_floating_p (type)) > + if (sparc64_floating_p (type) > + || (sparc64_complex_floating_p (type) && len <= 16)) Here. > @@ -886,7 +908,8 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, > if (element < 16) > sparc64_store_floating_fields (regcache, type, valbuf, element, 0); > } > - else if (sparc64_floating_p (type)) > + else if (sparc64_floating_p (type) > + || sparc64_complex_floating_p (type)) Here. > @@ -1067,7 +1090,8 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache, > if (TYPE_CODE (type) != TYPE_CODE_UNION) > sparc64_store_floating_fields (regcache, type, buf, 0, 0); > } > - else if (sparc64_floating_p (type)) > + else if (sparc64_floating_p (type) > + || sparc64_complex_floating_p (type)) And here. Would appreciate it if you could change this.