Kevin Buettner | 1 Aug 2002 01:22
Picon
Favicon

Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit

On Jul 31,  3:44pm, Michael Snyder wrote:

> >         * mips-tdep.c (mips_push_arguments): Don't assume that
> >         ``MIPS_SAVED_REGSIZE < 8'' means that the o64 abi is in use.
> >         Instead, test for it explicitly.
> 
> Kevin, 
> 
> This change makes things worse for N32.  I haven't tested
> N64 yet.  I think we're gonna have to look at these lines
> from the perspective of all 3 (6) abis.

Okay, this patch is withdrawn while I retest...

To save some time, can you tell me which N32 regressions you see?

Kevin

Kevin Buettner | 1 Aug 2002 01:27
Picon
Favicon

[RFA] mips_push_arguments: N32/N64 struct arguments

The patch below addresses some details in how N32 and N64 struct and
union arguments are passed.  When using the SGI compiler, I'm seeing
the following failures fixed with this patch:

FAIL: gdb.base/call-ar-st.exp: print sum_array_print(10, *list1, *list2, *list3, *list4)
FAIL: gdb.base/call-ar-st.exp: print print_long_arg_list, pattern 12

For N32, this patch depends upon my previous patch:

    [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32

Okay to commit?

	* mips-tdep.c (mips_push_arguments): For N32 and N64 ABIs, don't
	write odd sized struct arguments living in registers to the stack.
	For small struct and union arguments not living in registers,
	don't shift the struct when writing to the stack.

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.85
diff -u -p -r1.85 mips-tdep.c
--- mips-tdep.c	31 Jul 2002 20:26:49 -0000	1.85
+++ mips-tdep.c	31 Jul 2002 23:07:27 -0000
 <at>  <at>  -2536,7 +2536,9  <at>  <at>  mips_push_arguments (int nargs,

 	      /* Write this portion of the argument to the stack.  */
 	      if (argreg > MIPS_LAST_ARG_REGNUM
-		  || odd_sized_struct
(Continue reading)

Kevin Buettner | 1 Aug 2002 01:32
Picon
Favicon

Re: [PATCH] mips-tdep.c: Add "n64" to "set mips abi" help message

On Jul 31,  3:57pm, Michael Snyder wrote:

> Isn't there also an "MEABI32" and "MEABI64"?

I've seen these before somewhere.  (bfd maybe).

> Something developed at mips?

I don't know anything about them.

> Perhaps we should add placeholders for those?

Sounds right to me so long as they're really different from the ones
we already have.

Kevin

Michael Snyder | 1 Aug 2002 01:21
Picon
Favicon

Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit

Kevin Buettner wrote:
> 
> On Jul 31,  3:44pm, Michael Snyder wrote:
> 
> > >         * mips-tdep.c (mips_push_arguments): Don't assume that
> > >         ``MIPS_SAVED_REGSIZE < 8'' means that the o64 abi is in use.
> > >         Instead, test for it explicitly.
> >
> > Kevin,
> >
> > This change makes things worse for N32.  I haven't tested
> > N64 yet.  I think we're gonna have to look at these lines
> > from the perspective of all 3 (6) abis.
> 
> Okay, this patch is withdrawn while I retest...
> 
> To save some time, can you tell me which N32 regressions you see?

Buncha failures in structs.exp.
If you have a look at the tweak that I sent, it might be the thing.

Michael Snyder | 1 Aug 2002 01:28
Picon
Favicon

Re: [RFA] mips_push_arguments: N32/N64 struct arguments

Kevin Buettner wrote:
> 
> The patch below addresses some details in how N32 and N64 struct and
> union arguments are passed.  When using the SGI compiler, I'm seeing
> the following failures fixed with this patch:
> 
> FAIL: gdb.base/call-ar-st.exp: print sum_array_print(10, *list1, *list2, *list3, *list4)
> FAIL: gdb.base/call-ar-st.exp: print print_long_arg_list, pattern 12
> 
> For N32, this patch depends upon my previous patch:
> 
>     [RFA] mips-tdep.c: Set mips_default_saved_regsize to 8 for N32
> 
> Okay to commit?

Kevin, 

I had already arrived at these same changes myself, but then
I seemed to have found that the REG_STRUCT_HAS_ADDR patch which
I just submitted rendered them unnecessary.

Could you try that patch, and meanwhile tell me which fails
these patches helped fix for you?

Michael

> 
>         * mips-tdep.c (mips_push_arguments): For N32 and N64 ABIs, don't
>         write odd sized struct arguments living in registers to the stack.
>         For small struct and union arguments not living in registers,
(Continue reading)

Kevin Buettner | 1 Aug 2002 03:10
Picon
Favicon

Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit

On Jul 31,  4:21pm, Michael Snyder wrote:

> Kevin Buettner wrote:
> > 
> > On Jul 31,  3:44pm, Michael Snyder wrote:
> > 
> > > >         * mips-tdep.c (mips_push_arguments): Don't assume that
> > > >         ``MIPS_SAVED_REGSIZE < 8'' means that the o64 abi is in use.
> > > >         Instead, test for it explicitly.
> > >
> > > Kevin,
> > >
> > > This change makes things worse for N32.  I haven't tested
> > > N64 yet.  I think we're gonna have to look at these lines
> > > from the perspective of all 3 (6) abis.
> > 
> > Okay, this patch is withdrawn while I retest...
> > 
> > To save some time, can you tell me which N32 regressions you see?
> 
> Buncha failures in structs.exp.
> If you have a look at the tweak that I sent, it might be the thing.

Hmm.  It looks to me like SGI's cc and gcc disagree on the meaning of
the N32 ABI.

When I use the original test (or the tweak that you sent me), I see
the following failures when testing with cc, but not gcc:

    FAIL: gdb.base/structs.exp: p L1
(Continue reading)

Eric Christopher | 1 Aug 2002 03:14
Picon
Favicon

Re: [PATCH] mips-tdep.c: Add "n64" to "set mips abi" help message

On Wed, 2002-07-31 at 16:32, Kevin Buettner wrote:
> On Jul 31,  3:57pm, Michael Snyder wrote:
> 
> > Isn't there also an "MEABI32" and "MEABI64"?
> 
> I've seen these before somewhere.  (bfd maybe).
> 

They are in gcc and stuff.

> > Something developed at mips?
> 
> I don't know anything about them.
> 

It was actually a multivendor (Jim Wilson was on the committee)
development. It was never completed.

> > Perhaps we should add placeholders for those?
> 
> Sounds right to me so long as they're really different from the ones
> we already have.
> 

I wouldn't worry about it. I put it in gcc because I was told it was
"almost complete" - almost 2 years ago. I pinged mips a few times and
haven't heard anything. I'll probably remove support for it in the next
few months if a final, useful, ABI doc doesn't materialize.

-eric
(Continue reading)

Kevin Buettner | 1 Aug 2002 03:30
Picon
Favicon

Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit

On Jul 31,  6:10pm, Kevin Buettner wrote:

> So, it seems that cc wants small structs shifted, but that gcc does not.
> 
> Time for me to dig into the ABI documents to find out which compiler's
> right...

It looks to me like the SGI (cc) compiler is right.  The text below was
obtained from:

http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/srch3 <at> n64/0650/bks/SGI_Developer/books/Mpro_n32_ABI/sgi_html/ch02.html

    * Structs, unions, or other composite types are treated as a
      sequence of doublewords, and are passed in integer or floating
      point registers as though they were simple scalar parameters to
      the extent that they fit, with any excess on the stack packed
      according to the normal memory layout of the object.  More
      specifically:

	- Regardless of the struct field structure, it is treated as a
	  sequence of 64-bit chunks.  If a chunk consists solely of a
	  double float field (but not a double, which is part of a
	  union), it is passed in a floating point register.  Any
	  other chunk is passed in an integer register.

	- A union, either as the parameter itself or as a struct
	  parameter field, is treated as a sequence of integer
	  doublewords for purposes of assignment to integer parameter
	  registers.  No attempt is made to identify floating point
	  components for passing in floating point registers.
(Continue reading)

Kevin Buettner | 1 Aug 2002 03:33
Picon
Favicon

Re: [PATCH] mips-tdep.c: Add "n64" to "set mips abi" help message

On Jul 31,  6:14pm, Eric Christopher wrote:

> > > Perhaps we should add placeholders for those?
> > 
> > Sounds right to me so long as they're really different from the ones
> > we already have.
> > 
> 
> I wouldn't worry about it. I put it in gcc because I was told it was
> "almost complete" - almost 2 years ago. I pinged mips a few times and
> haven't heard anything. I'll probably remove support for it in the next
> few months if a final, useful, ABI doc doesn't materialize.

Okay, we'll hold off on adding them then.  Please let us know if you
do ever see a final, useful ABI doc...

Thanks,

Kevin

Daniel Jacobowitz | 1 Aug 2002 03:39

Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit

On Wed, Jul 31, 2002 at 06:30:04PM -0700, Kevin Buettner wrote:
> On Jul 31,  6:10pm, Kevin Buettner wrote:
> 
> > So, it seems that cc wants small structs shifted, but that gcc does not.
> > 
> > Time for me to dig into the ABI documents to find out which compiler's
> > right...
> 
> It looks to me like the SGI (cc) compiler is right.  The text below was
> obtained from:
> 
> http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/srch3 <at> n64/0650/bks/SGI_Developer/books/Mpro_n32_ABI/sgi_html/ch02.html
> 
> 
>     * Structs, unions, or other composite types are treated as a
>       sequence of doublewords, and are passed in integer or floating
>       point registers as though they were simple scalar parameters to
>       the extent that they fit, with any excess on the stack packed
>       according to the normal memory layout of the object.  More
>       specifically:
> 
> 	- Regardless of the struct field structure, it is treated as a
> 	  sequence of 64-bit chunks.  If a chunk consists solely of a
> 	  double float field (but not a double, which is part of a
> 	  union), it is passed in a floating point register.  Any
> 	  other chunk is passed in an integer register.
> 
> 	- A union, either as the parameter itself or as a struct
> 	  parameter field, is treated as a sequence of integer
> 	  doublewords for purposes of assignment to integer parameter
(Continue reading)


Gmane